PageSourceSearch

https://www.pawschicago.org/typo3temp/scriptmerger/uncompressed/he…-0419f96adea65ccb7db74c7f2f5a648a.merged.js

js pawschicago.org collected 2026-09-25 14:01:56 UTC 1,061,848 bytes, 15,736 lines download raw bytes

1/*!
2 * GoFundMe Embedded SDK
3 * Build: 2026-09-24T18:13:05.550Z
4 * Commit: a0578322bc49141fbb70491a38a01fa00fc2363d
5 */(()=>{var e={1724:()=>{(()=>{"use strict";class e extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"})}updateStyles(e){return Object.keys(e).map((t=>{const{cssVar:n,defaultValue:s}=e[t];return`${n}: ${this.getAttribute(t)||s};`})).join(" ")}}customElements.get("cl-custom-button")||customElements.define("cl-custom-button",class extends e{boundHandleClick=this.handleClick.bind(this);constructor(){super(),this.render()}static get observedAttributes(){return["disabled"]}attributeChangedCallback(e,t,n){"disabled"===e&&this.updateDisabledState()}get disabled(){const e=this.shadowRoot?.querySelector("button");return e?.hasAttribute("disabled")}set disabled(e){const t=this.shadowRoot?.querySelector("button");e?t?.setAttribute("disabled",""):t?.removeAttribute("disabled")}updateDisabledState(){const e=this.shadowRoot?.querySelector("button");this.hasAttribute("disabled")?e?.setAttribute("disabled",""):e?.removeAttribute("disabled")}handleClick(e){this.disabled?e.preventDefault():this.dispatchEvent(new CustomEvent("custom-button-click",{bubbles:!0,composed:!0}))}render(){this.shadowRoot.innerHTML='\n      <style>\n        :host {\n  --classy-padding-vertical: 16px;\n  --classy-padding-horizontal: 8px;\n  --classy-font-size: var(--classy-font__paragraph-md-bold--font-size, 20px);\n  --classy-line-height: var(--classy-font__paragraph-md-bold--line-height, 1.5);\n  --classy-font-weight: var(--classy-font__paragraph-md-bold--font-weight, 700);\n  --classy-font-family: var(--classy-font__font-family--base, sans-serif);\n  --classy-background-hover: var(--theme-color__brand-primary-darker, #364fc7); /* Assuming */\n  --classy-background-disabled: var(--theme-color__brand-primary-muted, #cccccc); /* Assuming */\n  --classy-border-focus: var(--classy-color__border--focus, #41a7ff);\n  --classy-filter-hover: brightness(0.88);\n  --classy-opacity-disabled: 0.5;\n  --classy-box-shadow: var(--classy-shadow__button);\n  --classy-box-shadow-active: none;\n  --classy-outline-focus-visible: 2px dotted var(--classy-border-focus);\n  --classy-outline-offset-focus-visible: 2px;\n  width: 100%;\n  display: block; /* Full width requires block display */\n  box-sizing: border-box; /* Padding included in width */\n}\n\nbutton {\n  font-family: var(--classy-font-family);\n  font-size: var(--classy-font-size);\n  line-height: var(--classy-line-height);\n  font-weight: var(--classy-font-weight);\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  color: inherit;\n  padding: var(--classy-padding-vertical) var(--classy-padding-horizontal);\n  overflow: hidden;\n  transition:\n    background-color 0.24s cubic-bezier(0.645, 0.045, 0.355, 1),\n    box-shadow 0.24s cubic-bezier(0.645, 0.045, 0.355, 1),\n    transform 0.24s cubic-bezier(0.645, 0.045, 0.355, 1),\n    opacity 0.24s cubic-bezier(0.645, 0.045, 0.355, 1);\n  background-color: var(--classy-background);\n  border-radius: var(--classy-border-radius, inherit);\n  border: none;\n  cursor: pointer;\n  text-decoration: none;\n\n  width: 100%;\n  height: 100%;\n}\n\nbutton:hover {\n  filter: var(--classy-filter-hover);\n}\n\nbutton:active {\n  box-shadow: var(--classy-box-shadow-active);\n  transform: scale(0.95);\n  color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\nbutton:disabled {\n  background-color: var(--classy-background-disabled);\n  cursor: not-allowed;\n  opacity: var(--classy-opacity-disabled);\n  box-shadow: none;\n}\n\nbutton:focus-visible {\n  outline: var(--classy-outline-focus-visible);\n  outline-offset: var(--classy-outline-offset-focus-visible);\n}\n\nbutton:hover:not(:active) {\n  background-image: linear-gradient(\n    var(--computed-color__brand-primary--tint, rgba(66, 92, 205, 0.12)) 0 0\n  );\n}\n\n      </style>\n\n      <button part="button">\n  <slot part="button-slot-content"></slot>\n</button>\n\n    ';const e=this.shadowRoot.querySelector("button");e.removeEventListener("click",this.boundHandleClick),e.addEventListener("click",this.boundHandleClick)}}),customElements.get("cl-hyperlink")||customElements.define("cl-hyperlink",class extends e{constructor(){super(),this.render()}static get observedAttributes(){return["href","text"]}href="";text="";attributeChangedCallback(e,t,n){"href"===e&&(this.href=n,this.updateLink()),"text"===e&&(this.text=n,this.updateLink())}updateLink(){const e=this.shadowRoot?.querySelector("a.link");e&&(e.setAttribute("href",this.href),e.textContent=this.text)}render(){this.shadowRoot.innerHTML='\n      <style>.link {\n    cursor: pointer;\n    text-decoration: none;\n  \n    font-family: var(--classy-font__font-family--base);\n    font-size: var(--classy-font__label--font-size);\n    font-weight: var(--classy-font__label--font-weight);\n    line-height: var(--classy-font__label--line-height);\n    color: inherit;\n  }\n  \n.link:hover {\n    text-decoration: underline;\n}</style>\n      <a part="link" class="link" target="_blank" rel="noopener noreferrer"></a>\n\n    ',this.updateLink()}});class t extends e{#e="";constructor(){super(),this.render()}static get observedAttributes(){return["value","placeholder","aria-label","data-id","disabled","type","step","min","max"]}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case"value":this.#e=n,this.updateInputValue();break;case"placeholder":case"aria-label":case"data-id":case"type":case"step":case"min":case"max":case"disabled":this.updateInputAttributes(e,n)}}get value(){return this.#e}set value(e){this.#e=e,this.updateInputValue()}handleInput(e){const t=e.target;this.#e=t.value,this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.#e}}))}updateInputValue(){const e=this.shadowRoot.querySelector("input");e&&(e.value=this.#e)}updateInputAttributes(e,t){const n=this.shadowRoot.querySelector("input");n&&(null===t?n.removeAttribute(e):n.setAttribute(e,t))}initializeAttributesAndListeners(){this.updateInputValue(),t.observedAttributes.forEac
5h((e=>{this.updateInputAttributes(e,this.getAttribute(e))})),this.initializeEventListeners()}initializeEventListeners(){const e=this.shadowRoot.querySelector("input");e&&e.addEventListener("input",this.handleInput.bind(this))}render(){this.shadowRoot.innerHTML='\n      <style>\n        input {\n  padding: 0px;\n  width: 100%;\n  border: 1px solid var(--classy-color__border--input, #ccc);\n  border-radius: var(--classy-custom-grid-radius, 4px); /* Apply grid border radius */\n  font-family: var(--classy-font__font-family--base, sans-serif);\n  font-size: var(--classy-font__paragraph-md--font-size, 16px);\n  line-height: 1.5;\n  font-weight: 400;\n  color: var(--classy-color__text, #000);\n  background-color: var(--classy-color__background, #fff);\n  box-sizing: border-box;\n  box-shadow: none; /* Ensure no drop shadow is applied */\n}\n\ninput[type="date"] {\n  appearance: none;\n  box-shadow: 0px 2px 2px rgba(27, 25, 24, 0.12);\n  cursor: pointer;\n  min-height: 40px;\n  padding: 10px;\n  margin-top: 4px;\n  margin-bottom: 24px;\n}\n\n      </style>\n\n      <input type="text" part="classy-input-textfield">\n\n    ',this.initializeAttributesAndListeners()}}customElements.get("cl-custom-input")||customElements.define("cl-custom-input",t);const{slice:n,forEach:s}=[],i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,o={create(e,t,n,s){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),s&&(o.domain=s),document.cookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!i.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!i.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invali
5d");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s}(e,encodeURIComponent(t),o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let s=n[e];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return s.substring(t.length,s.length)}return null},remove(e){this.create(e,"",-1)}};var a={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return o.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:s,cookieDomain:i,cookieOptions:a}=t;n&&"undefined"!=typeof document&&o.create(n,e,s,i,a)}},r={name:"querystring",lookup(e){let t,{lookupQuerystring:n}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const s=e.substring(1).split("&");for(let e=0;e<s.length;e++){const i=s[e].indexOf("=");i>0&&s[e].substring(0,i)===n&&(t=s[e].substring(i+1))}}return t}};let l=null;const c=()=>{if(null!==l)return l;try{if(l="undefined"!=typeof window&&null!==window.localStorage,!l)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){l=!1}return l};var d={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&c())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&c()&&window.localStorage.setItem(n,e)}};let u=null;const h=()=>{if(null!==u)return u;try{if(u="undefined"!=typeof window&&null!==window.sessionStorage,!u)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){u=!1}return u};var p={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&h())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&h()&&window.sessionStorage.setItem(n,e)}},g={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:s}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),s&&t.push(s)}return t.length>0?t:void 0}},f={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const s=n||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(t=s.getAttribute("lang")),t}},m={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(n))return;const s="number"==typeof t?t:0;return n[s]?.replace("/","")}},y={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"==typeof t?t+1:1,s="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[n]}};let b=!1;try{document.cookie,b=!0}catch(e){}const v=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];b||v.splice(1,1);class _{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return s.call(n.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:v,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(a),this.addDetector(r),this.addDetector(d),this.addDetector(p),this.addDetector(g),this.addDetector(f),this.addDetector(m),this.addDetector(y)}
vendor: 4,427 bytes, line 5
5addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return e.forEach((e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}})),t=t.map((e=>this.options.convertDetectedLanguage(e))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})))}}_.type="languageDetector";const A=e=>"string"==typeof e,E=()=>{let e,t;const n=new Promise(((n,s)=>{e=n,t=s}));return n.resolve=e,n.reject=t,n},w=e=>null==e?"":""+e,S=/###/g,C=e=>e&&e.indexOf("###")>-1?e.replace(S,"."):e,x=e=>!e||A(e),I=(e,t,n)=>{const s=A(t)?t.split("."):t;let i=0;for(;i<s.length-1;){if(x(e))return{};const t=C(s[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return x(e)?{}:{obj:e,k:C(s[i])}},k=(e,t,n)=>{const{obj:s,k:i}=I(e,t,Object);if(void 0!==s||1===t.length)return void(s[i]=n);let o=t[t.length-1],a=t.slice(0,t.length-1),r=I(e,a,Object);for(;void 0===r.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),r=I(e,a,Object),r?.obj&&void 0!==r.obj[`${r.k}.${o}`]&&(r.obj=void 0);r.obj[`${r.k}.${o}`]=n},R=(e,t)=>{const{obj:n,k:s}=I(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},O=(e,t,n)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?A(e[s])||e[s]instanceof String||A(t[s])||t[s]instanceof String?n&&(e[s]=t[s]):O(e[s],t[s],n):e[s]=t[s]);return e},D=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var P={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const L=e=>A(e)?e.replace(/[&<>"'\/]/g,(e=>P[e])):e,T=[" ",",","?","!",";"],M=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),N=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const s=t.split(n);let i=e;for(let e=0;e<s.length;){if(!i||"object"!=typeof i)return;let t,o="";for(let a=e;a<s.length;++a)if(a!==e&&(o+=n),o+=s[a],t=i[o],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<s.length-1)continue;e+=a-e+1;break}i=t}return i},F=e=>e?.replace("_","-"),q={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class j{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||q,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(A(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new j(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new j(this.logger,e)}}var $=new j;class G{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEac
vendor: 2,979 bytes, line 5
5h((e=>{let[t,s]=e;for(let e=0;e<s;e++)t(...n)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((t=>{let[s,i]=t;for(let t=0;t<i;t++)s.apply(s,[e,...n])}))}}class H extends G{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,o=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):A(n)&&i?a.push(...n.split(i)):a.push(n)));const r=R(this.data,a);return!r&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!r&&o&&A(n)?N(this.data?.[e]?.[t],n,i):r}addResource(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),s=t,t=a[1]),this.addNamespaces(t),k(this.data,a,s),i.silent||this.emit("added",e,t,n,s)}addResources(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const s in n)(A(n[s])||Array.isArray(n[s]))&&this.addResource(e,t,s,n[s],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),s=n,n=t,t=a[1]),this.addNamespaces(t);let r=R(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?O(r,n,i):r={...r,...n},k(this.data,a,r),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var U={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,s,i){return e.forEach((e=>{t=this.processors[e]?.process(t,n,s,i)??t})),t}};const V={},z=e=>!A(e)&&"boolean"!=typeof e&&"number"!=typeof e;class B extends G{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,s;super(),n=e,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
5i18nFormat","utils"].forEach((e=>{n[e]&&(s[e]=n[e])})),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=$.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return void 0!==n?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const s=T.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===s.length)return!0;const i=M.getRegExp(`(${s.map((e=>"?"===e?"\\?":e)).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,s));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:A(i)?[i]:i};const o=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(s)}return{key:e,namespaces:A(i)?[i]:i}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const s=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),r=a[a.length-1],l=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===l?.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return s?{res:`${r}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:r,usedParams:this.getUsedParamsDetails(t)}:`${r}${e}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:r,usedParams:this.getUsedParamsDetails(t)}:o}const d=this.resolve(e,t);let u=d?.res;const h=d?.usedKey||o,p=d?.exactUsedKey||o,g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,f=!this.i18nFormat||this.i18nFormat.handleAsObject,m=void 0!==t.count&&!A(t.count),y=B.hasDefaultValue(t),b=m?this.pluralResolver.getSuffix(l,t.count,t):"",v=t.ordinal&&m?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",_=m&&!t.ordinal&&0===t.count,E=_&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${b}`]||t[`defaultValue${v}`]||t.defaultValue;let w=u;f&&!u&&y&&(w=E);const S=z(w),C=Object.prototype.toString.apply(w);if(!(f&&w&&S&&["[object Number]","[object Function]","[object RegExp]"].indexOf(C)<0)||A(g)&&Array.isArray(w))if(f&&A(g)&&Array.isArray(u))u=u.join(g),u&&(u=this.extendTranslation(u,e,t,n));else{let s=!1,a=!1;!this.isValidLookup(u)&&y&&(s=!0,u=E),this.isValidLookup(u)||(a=!0,u=o);const c=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:u,h=y&&E!==u&&this.options.updateMissing;if(a||s||h){if(this.logger.log(h?"updateKey":"missingKey",l,r,o,h?E:u),i){const e=this.resolve(o,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const s=(e,n,s)=>{const i=y&&s!==u?s:c;this.options.missingKeyHandler?this.options.missingKeyHandler(e,r,n,i,h,t):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,r,n,i,h,t),this.emit("missingKey",e,r,n,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&m?e.forEach((e=>{const n=this.pluralResolver.getSuffixes(e,t);_&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}
5zero`),n.forEach((n=>{s([e],o+n,t[`defaultValue${n}`]||E)}))})):s(e,o,E))}u=this.extendTranslation(u,e,t,d,n),a&&u===o&&this.options.appendNamespaceToMissingKey&&(u=`${r}:${o}`),(a||s)&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${r}:${o}`:o,s?u:void 0))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,w,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(d.res=e,d.usedParams=this.getUsedParamsDetails(t),d):e}if(i){const e=Array.isArray(w),n=e?[]:{},s=e?p:h;for(const e in w)if(Object.prototype.hasOwnProperty.call(w,e)){const o=`${s}${i}${e}`;n[e]=y&&!u?this.translate(o,{...t,defaultValue:z(E)?E[e]:void 0,joinArrays:!1,ns:a}):this.translate(o,{...t,joinArrays:!1,ns:a}),n[e]===o&&(n[e]=w[e])}u=n}}return s?(d.res=u,d.usedParams=this.getUsedParamsDetails(t),d):u}extendTranslation(e,t,n,s,i){var o=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a=A(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(a){const t=e.match(this.interpolator.nestingRegexp);r=t&&t.length}let l=n.replace&&!A(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||s.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);r<(t&&t.length)&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,s=new Array(e),a=0;a<e;a++)s[a]=arguments[a];return i?.[0]!==s[0]||n.context?o.translate(...s,t):(o.logger.warn(`It seems you are nesting recursively key: ${s[0]} in key: ${t[0]}`),null)}),n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,r=A(a)?[a]:a;return null!=e&&r?.length&&!1!==n.applyPostProcessor&&(e=U.handle(r,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,s,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const r=this.extractFromKey(e,a),l=r.key;n=l;let c=r.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==a.count&&!A(a.count),u=d&&!a.ordinal&&0===a.count,h=void 0!==a.context&&(A(a.context)||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);
vendor: 4,632 bytes, line 5
5c.forEach((e=>{this.isValidLookup(t)||(o=e,V[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(V[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((n=>{if(this.isValidLookup(t))return;i=n;const o=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,n,e,a);else{let e;d&&(e=this.pluralResolver.getSuffix(n,a.count,a));const t=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(o.push(l+e),a.ordinal&&0===e.indexOf(s)&&o.push(l+e.replace(s,this.options.pluralSeparator)),u&&o.push(l+t)),h){const n=`${l}${this.options.contextSeparator}${a.context}`;o.push(n),d&&(o.push(n+e),a.ordinal&&0===e.indexOf(s)&&o.push(n+e.replace(s,this.options.pluralSeparator)),u&&o.push(n+t))}}let r;for(;r=o.pop();)this.isValidLookup(t)||(s=r,t=this.getResource(n,e,r,a))})))}))})),{res:t,usedKey:n,exactUsedKey:s,usedLng:i,usedNS:o}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!A(e.replace);let s=n?e.replace:e;if(n&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const e of t)delete s[e]}return s}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class K{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$.create("languageUtils")}getScriptPartFromCode(e){if(!(e=F(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=F(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(A(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),A(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],i=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return A(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):A(e)&&i(this.formatLanguageCode(e)),n.forEac
vendor: 4,317 bytes, line 5
5h((e=>{s.indexOf(e)<0&&i(this.formatLanguageCode(e))})),s}}const Y={zero:0,one:1,two:2,few:3,many:4,other:5},W={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Q{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=$.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=F("dev"===e?"en":e),s=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:s})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),W;if(!e.match(/-|_/))return W;const s=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(s,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>Y[e]-Y[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const J=function(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=((e,t,n)=>{const s=R(e,n);return void 0!==s?s:R(t,n)})(e,t,n);return!o&&i&&A(n)&&(o=N(e,n,s),void 0===o&&(o=N(t,n,s))),o},Z=e=>e.replace(/\$/g,"$$$$");class X{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=$.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:r,formatSeparator:l,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:L,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==s&&s,this.prefix=i?D(i):o||"{{",this.suffix=a?D(a):r||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?D(u):h||D("$t("),this.nestingSuffix=p?D(p):g||D(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){let i,o,a;const r=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=J(t,r,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...s,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(J(t,r,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...s,...t,interpolationkey:o})};this.resetRegExp();const c=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=void 0!==s?.interpolation?.ski
vendor: 4,119 bytes, line 5
5pOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Z(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Z(this.escape(e)):Z(e)}].forEach((t=>{for(a=0;i=t.regex.exec(e);){const n=i[1].trim();if(o=l(n),void 0===o)if("function"==typeof c){const t=c(e,i,s);o=A(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,n))o="";else{if(d){o=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o=""}else A(o)||this.useRawValueToEscape||(o=w(o));const r=t.safeValue(o);if(e=e.replace(i[0],r),d?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),e}nest(e,t){let n,s,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const s=e.split(new RegExp(`${n}[ ]*{`));let o=`{${s[1]}`;e=s[0],o=this.interpolate(o,i);const a=o.match(/'/g),r=o.match(/"/g);((a?.length??0)%2==0&&!r||r.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let r=[];i={...o},i=i.replace&&!A(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),r=e,l=!0}if(s=t(a.call(this,n[1].trim(),i),i),s&&n[0]===e&&!A(s))return s;A(s)||(s=w(s)),s||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),s=""),l&&(s=r.reduce(((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:n[1].trim()})),s.trim())),e=e.replace(n[0],s),this.regexp.lastIndex=0}return e}}const ee=e=>{const t={};return(n,s,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=s+JSON.stringify(o);let r=t[a];return r||(r=e(F(s),i),t[a]=r),r(n)}};class te{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=$.create("formatter"),this.options=e,this.formats={number:ee(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:ee(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:ee(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:ee(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:ee(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ee(t)}format(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find((e=>e.indexOf(")")>-1))){const e=i.findIndex((e=>e.indexOf(")")>-1));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce(((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((e=>{if(e){const[t,...s]=e.split(":"),i=s.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=i),"false"===i&&(n[o]=!1),"true"===i&&(n[o]=!0),isNaN(i)||(n[o]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const a=s?.formatParams?.[s.interpolationkey]||{},r=a.locale||a.lng||s.locale||s.lng||n;t=this.formats[i](e,r,{...o,...s,...a}
vendor: 5,313 bytes, line 5
5)}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e)}}class ne extends G{constructor(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=$.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,s.backend,s)}queueLoad(e,t,n,s){const i={},o={},a={},r={};return e.forEach((e=>{let s=!0;t.forEach((t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,s=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===r[t]&&(r[t]=!0)))})),s||(a[e]=!0)})),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(r)}}loaded(e,t,n){const s=e.split("|"),i=s[0],o=s[1];t&&this.emit("failedLoading",i,o,t),!t&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:s,k:i}=I(e,t,Object);s[i]=s[i]||[],s[i].push(n)})(n.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:i,callback:o});this.readingCalls++;const a=(a,r)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&r&&s<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,n,s+1,2*i,o)}),i):o(a,r)},r=this.backend[n].bind(this.backend);if(2!==r.length)return r(e,t,a);try{const n=r(e,t);n&&"function"==typeof n.then?n.then((e=>a(null,e))).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();A(e)&&(e=this.languageUtils.toResolveHierarchy(e)),A(t)&&(t=[t]);const i=this.queueLoad(e,t,n,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),s=n[0],i=n[1];this.read(s,i,"read",void 0,void 0,((n,o)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${s} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${s}`,o),this.loaded(e,n,o)}))}saveMissing(e,t,n,s,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const r={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,n,s,r):l(e,t,n,s),i&&"function"==typeof i.then?i.then((e=>a(null,e))).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,n,s,a,r)}e&&e[0]&&this.store.addResource(e[0],t,n,s)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const se=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),A(e[1])&&(t.defaultValue=e[1]),A(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];
vendor: 4,157 bytes, line 5
5Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),ie=e=>(A(e.ns)&&(e.ns=[e.ns]),A(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),A(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),oe=()=>{};class ae extends G{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=ie(e),this.services={},this.logger=$,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),null==t.defaultNS&&t.ns&&(A(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=se();this.options={...s,...this.options,...ie(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?$.init(i(this.modules.logger),this.options):$.init(null,this.options),t=this.modules.formatter?this.modules.formatter:te;const n=new K(this.options);this.store=new H(this.options.resources,this.options);const o=this.services;o.logger=$,o.resourceStore=this.store,o.languageUtils=n,o.pluralResolver=new Q(n,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format||(o.formatter=i(t),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new X(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new ne(i(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];e.emit(t,...s)})),this.modules.languageDetector&&(o.languageDetector=i(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=i(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new B(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];e.emit(t,...s)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=oe),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const o=E(),a=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit
vendor: 4,351 bytes, line 5
5("initialized",this.options),o.resolve(t),n(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),o}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oe;const n=A(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],s=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};n?s(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>s(e))),this.options.preload?.forEach?.((e=>s(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const s=E();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=oe),this.services.backendConnector.reload(e,t,(e=>{s.resolve(),n(e)})),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&U.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const s=E();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(e,o)=>{o?(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,s.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=A(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(e=>{o(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),s}getFixedT(e,t,n){var s=this;const i=function(e,t){let o;if("object"!=typeof t){for(var a=arguments.length,r=new Array(a>2?a-2:0),l=2;l<a;l++)r[l-2]=arguments[l];o=s.options.overloadTranslationOptionHandler([e,t].concat(r))}else o={...t};o.lng=o.lng||i.lng,o.lngs=o.lngs||i.lngs,o.ns=o.ns||i.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||i.keyPrefix);const c=s.options.keySeparator||".";let d;return d=o.keyPrefix&&Array.isArray(e)?e.map((e=>`${o.keyPrefix}${c}${e}`)):o.keyPrefix?`${o.keyPrefix}${c}${e}`:e,s.t(d,o)};return A(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.translate(...t)}exists(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.exists(...t)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
5if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!(!this.hasResourceBundle(n,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(n,e)||s&&!o(i,e)))}loadNamespaces(e,t){const n=E();return this.options.ns?(A(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=E();A(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter((e=>s.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return i.length?(this.options.preload=s.concat(i),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services?.languageUtils||new K(se());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new ae(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oe;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new ae(s);if(void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},Object.keys(e[t]).reduce(((n,s)=>(n[s]={...e[t][s]},n)),{}))),{});i.store=new H(e,s),i.services.resourceStore=i.store}return i.translator=new B(i.services,s),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];i.emit(e,...n)})),i.init(s,t),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const re=ae.createInstance();re.createInstance=ae.createInstance,re.createInstance,re.dir,re.init,re.loadResources,re.reloadResources,re.use,re.changeLanguage,re.getFixedT,re.t,re.exists,re.setDefaultNamespace,re.hasLoadedNamespace,re.loadNamespaces,re.loadLanguages;const le={defaultNS:"common",fallbackLng:["en"],initAsync:!1,interpolation:{escapeValue:!1},ns:["common"]};class ce{i18n=(()=>re.createInstance())();loadedNamespaces=(()=>new Set)();constructor(){this.i18n.use(_),this.i18n.init({...le,detection:{order:["cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"]}})}static getInstance(){return ce.instance||(ce.instance=new ce),ce.instance}addNamespaceResources(e,t){this.loadedNamespaces.has(e)||(Object.keys(t).forEach((n=>{this.i18n.addResourceBundle(n,e,t[n],!0,!0)})),this.loadedNamespaces.add(e))}translate(e,t){return this.i18n.t(e,t)}getLanguage(){return this.i18n.language}}class de extends e{loadI18nResources(e,t){this.namespace=e,ce.getInstance().addNamespaceResources(e,t)}t(e,t,n){if(!this.namespace&&!n?.ns)throw new Error("Namespace is not set. Call `this.loadI18nResources()` with a namespace first, or provide a namespace in the options parameter.");return ce.getInstance().translate(e,{ns:this.namespace||n.ns,defaultValue:t,...n??{}})}getLanguage(){return ce.getInstance().getLanguage()}}const ue=JSON.parse('{"custom-amount-placeholder":"Other","donation-amount":"Donation amount {{amountString}}","greater-amount-error-message":"Amount must be smaller than or equal to {{maxValue}}","less-amount-error-message":"Amount cannot be less than {{minValue}}","select-donation-currency":"Select Donation Currency"}
5'),he=JSON.parse('{"custom-amount-placeholder":"Otro","donation-amount":"Cantidad de la donación {{amountString}}","greater-amount-error-message":"La cantidad debe ser menor o igual a {{maxValue}}","less-amount-error-message":"La cantidad no puede ser menor que {{minValue}}","select-donation-currency":"Seleccionar moneda de donación"}'),pe={USD:"$",EUR:"€",GBP:"£",JPY:"¥",AUD:"A$",CAD:"CA$",CHF:"CHF",CNY:"¥",HKD:"HK$",NZD:"NZ$",SEK:"kr",KRW:"₩",SGD:"S$",NOK:"kr",MXN:"$",INR:"₹",RUB:"₽",ZAR:"R",TRY:"₺",BRL:"R$",TWD:"NT$",DKK:"kr",PLN:"zł",THB:"฿",IDR:"Rp",HUF:"Ft",CZK:"Kč",ILS:"₪",PHP:"₱",AED:"د.إ",COP:"$",SAR:"﷼",MYR:"RM"},ge=e=>pe[e]||e,fe=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"USD",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"en";if(!e)return null;try{if(Number.isNaN(Number(e)))return`$${e}`;const i=ge(n),o=t?.maximumFractionDigits??2,a=t?.minimumFractionDigits??o;return`${i}${i!==n?"":" "}${new Intl.NumberFormat(s,{...t,style:"decimal",minimumFractionDigits:a,maximumFractionDigits:o}).format(Number(e))}`}catch(e){return console.error("Error formatting currency: ",e),"Curr. format err"}};customElements.get("cl-amount-selector")||customElements.define("cl-amount-selector",class extends de{#t;#n;#s;#i;#o={presetAmounts:[],showCustomAmountsInput:!1,minimumDonationAmount:1};constructor(){super(),this.loadI18nResources("AmountSelector",{en:ue,es:he}),this.#t=null,this.#s=!1,this.#i=!1,this.#n="USD",this.handleAmountClick=this.handleAmountClick.bind(this),this.handleCustomAmountChange=this.handleCustomAmountChange.bind(this),this.handleCustomAmountInput=this.handleCustomAmountInput.bind(this),this.updateActiveStates=this.updateActiveStates.bind(this),this.render()}connectedCallback(){this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}handleCurrencyChange=e=>{const t=e.target;this.updateCurrencySymbol(t.value),this.updateCurrencyCodeDisplay(t.value),this.dispatchEvent(new CustomEvent("currency-selection-change",{detail:{selectedCurrency:t.value},bubbles:!0,composed:!0}))};updateCurrencyCodeDisplay(e){const t=this.shadowRoot.querySelector(".currency-code-display");t&&(t.textContent=e)}updateCurrencySymbol(e){const t=ge(e),n=this.shadowRoot.querySelector(".currency-symbol");n&&(n.textContent=t);const s=this.shadowRoot.querySelector('fieldset[aria-label="donation amount"]');s.innerHTML="",s.classList.remove("buttons-1","buttons-2","buttons-3","buttons-4");const i=this.#o.presetAmounts.filter((e=>{let{name:t}=e;return"other"!==t}));let o=0;i.forEach((t=>{let{amount:n,isVisible:i}=t;if(i){const t=document.createElement("cl-custom-button"),i=n.toString();t.setAttribute("value",i),t.textContent=fe(i,{maximumFractionDigits:0},e,this.getLanguage());const a=t.shadowRoot?.querySelector("button");a?.setAttribute("aria-label",this.t("donation-amount","Donation amount {{amountString}}",{amountString:i})),o+=1,s.appendChild(t)}})),s.classList.add(`buttons-${o}`),this.updateActiveStates()}removeEventListeners(){const e=this.shadowRoot?.querySelector("cl-custom-input");e&&(e.removeEventListener("value-change",this.handleCustomAmountInput),e.removeEventListener("blur",this.handleCustomAmountChange));const t=this.shadowRoot?.querySelector(".currency-select");t&&t.removeEventListener("change",this.handleCurrencyChange)}setupEventListeners(){this.shadowRoot?.addEventListener("custom-button-click",this.handleAmountClick);const e=this.shadowRoot?.querySelector("cl-custom-input");e&&(e.addEventListener("blur",this.handleCustomAmountChange),e.addEventListener("value-change",this.handleCustomAmountInput));const t=this.shadowRoot?.querySelector(".currency-select");t&&t.addEventListener("change",this.handleCurrencyChange)}handleAmountClick(e){const t=e.target,n=Number(t.getAttribute("value")),s=this.#o.minimumDonationAmount;if(n){if(n<s){this.selectedAmount=null,this.displayErrorMessage(this.t("less-amount-error-message","Amount cannot be less than {{minValue}}",{minValue:s}));const e=this.shadowRoot.querySelector("cl-custom-input"),t=this.shadowRoot.querySelector(".currency-custom-amount-container");return t?.classList.add("error"),e.value="",void(this.#t=null)}this.#s=!1,this.selectedAmount=n;const e=this.shadowRoot.querySelector("cl-custom-input");e&&(e.value=n.toString()),this.dispatchEvent(new CustomEvent("amount-selection-change",{detail:{selectedAmount:n},bubbles:!0,composed:!0}))}}handleCustomAmountChange(e){const t=e.target,n=parseFloat(t.value);this.#s=!0;const s=1e7,i=this.#o.minimumDonationAmount,o=this.shadowRoot.querySelector(".currency-custom-amount-container");n>s?(this.selectedAmount=null,this.displayErrorMessage(this.t("greater-amount-error-message","Amount must be smaller than or equal to {{maxValue}}",{maxValue:s})),o?.classList.add("error"),this.#t=null):n<i?(this.selectedAmount=null,this.displayErrorMessage(this.t("less-amount-error-message","Amount cannot be less than {{minValue}}",{minValue:i})),o?.classList.add("error"),this.#t=null):(this.selectedAmount=n,o?.classList.remove("error"),this.dispatchEvent(new CustomEvent("amount-selection-change",{detail:{selectedAmount:n},bubbles:!0,composed:!0})),this.updateActiveStates())}handleCustomAmountInput(e){e.target.value&&this.clearErrorMessage(),this.dispatchEvent(new CustomEvent("custom-amount-input-change",{bubbles:!0,composed:!0}))}static get observedAttributes(){return["selected-amount"]}set config(e){this.#o=e,this.applyDynamicConfiguration()}updateActiveStates(){const e=this.shadowRoot.querySelectorAll("cl-custom-button"),t=this.shadowRoot.querySelector("cl-custom-input"),n=this.shadowRoot.querySelector(".currency-custom-amount-container"),s=this.#o.minimumDonationAmount??0;e.forEach((e=>{const t=e.getAttribute("value"),n=null!==t?Number(t):Number.NaN,i=Number.isNaN(n)||n>=s,o=!this.#s&&i&&n===this.#t,a=e.shadowRoot?.querySelector("button");a?.setAttribute("aria-pressed",o.toString()),e.toggleAttribute("active",o)})),this.#s?(n?.classList.add("active"),t?.setAttribute("active","")):(n?.classList.remove("active"),t?.removeAttribute("active"))}applyDynamicConfiguration(){this.clearErrorMessage();const e=this.shadowRoot.querySelector('fieldset[aria-label="donation amount"]'),t=this.#i;let n;this.#i=!1,this.#o.currencies&&(n=this.#o.currencies?.find((e=>e.selected)),this.#n=ge(n?.value||"USD")),e.innerHTML="",e.classList.remove("buttons-1","buttons-2","buttons-3","buttons-4");const s=this.#o.presetAmounts.filter((e=>{let{name:t}=e;return"other"!==t}));let i=0;
5s.forEach(((o,a)=>{let{amount:r,isVisible:l,isDefault:c}=o;if(l){const o=document.createElement("cl-custom-button"),l=r.toString();if(o.setAttribute("value",l),o.textContent=fe(l,{maximumFractionDigits:0},n?.value||"USD",this.getLanguage()),c){const e=Number(l);t||null!==this.#t&&0!==this.#t?this.#t===e&&o.setAttribute("active",""):(this.selectedAmount=e,o.setAttribute("active",""))}const d=o.shadowRoot?.querySelector("button");d?.setAttribute("aria-label",this.t("donation-amount","Donation amount {{amountString}}",{amountString:l})),4===i&&4===a&&5===s.length&&o.classList.add("full-width"),i+=1,e.appendChild(o)}})),e.classList.add(`buttons-${i}`);const o=this.#o.presetAmounts.find((e=>{let{name:t}=e;return"other"===t})),a=this.shadowRoot.querySelector(".currency-custom-amount-container"),r=this.shadowRoot.querySelector("cl-custom-input");a.style.visibility=o?.isVisible?"":"hidden",o?.isDefault?(this.#s=!0,r.setAttribute("active",""),r.value=null,o.amount>0?this.selectedAmount=o.amount:this.#t=null):this.#s||(r.removeAttribute("active"),r.value="",a.style.visibility=o?.isVisible?"":"hidden");const l=this.shadowRoot.querySelector(".currency-select");this.#o.currencies&&l&&(l.innerHTML="",this.#o.currencies.forEach((e=>{let{label:t,value:n,selected:s}=e;const i=document.createElement("option");i.value=n,i.textContent=t,i.selected=s,l.appendChild(i),s&&this.updateCurrencyCodeDisplay(n)})));const c=this.#o.minimumDonationAmount,d=this.#o.presetAmounts.find((e=>e.isDefault)),u=null!==this.#t&&this.#t<c,h=!t&&!this.#s&&void 0!==d&&d.amount<c;if(u||h){h&&!u&&(this.selectedAmount=null),this.displayErrorMessage(this.t("less-amount-error-message","Amount cannot be less than {{minValue}}",{minValue:c}));const e=this.shadowRoot.querySelector(".currency-custom-amount-container");e?.classList.add("error")}const p=this.shadowRoot.querySelector("cl-custom-input");p?.setAttribute("min",String(this.#o.minimumDonationAmount)),p?.setAttribute("max","10000000"),this.updateActiveStates()}attributeChangedCallback(e,t,n){if("selected-amount"===e&&t!==n){const e=null===n?null:Number(n);this.#t=null===e?null:e,this.updateActiveStates()}}get selectedAmount(){return this.#t}set selectedAmount(e){this.#t=Number(e),this.updateActiveStates(),this.clearErrorMessage()}get isCustomAmountActive(){return this.#s}set isCustomAmountActive(e){this.#s=e}setCustomInputValue(e){const t=this.shadowRoot.querySelector("cl-custom-input");t&&(t.value=e)}setSelectedAmountSilently(e){this.#t=null===e?null:Number(e),this.#i=!0}resetSelectedAmountSilently(){this.#t=null}displayErrorMessage(e){const t=this.shadowRoot.querySelector(".error-message");t&&(t.textContent=`⚠ ${e}`,t.style.display="block")}clearErrorMessage(){const e=this.shadowRoot.querySelector(".error-message"),t=this.shadowRoot.querySelector(".currency-custom-amount-container");e&&(e.textContent="",e.style.display="none"),t&&t.classList.remove("error")}updateCurrencyLabel(){const e=this.shadowRoot.querySelector("#currency-label");e&&(e.textContent="USD")}updateAmountPlaceholder(){const e=this.shadowRoot.querySelector("#custom-amount");e&&e.setAttribute("placeholder",this.t("custom-amount-placeholder","Other"))}updateCurrencySelectLabel(){const e=this.shadowRoot.querySelector(".currency-select");e&&e.setAttribute("aria-label",this.t("select-donation-currency","Select Donation Currency"))}render(){this.shadowRoot.innerHTML='\n      <style>\n        :host {\n  display: grid;\n  gap: 4px;\n  /* Spacing between grid items */\n  /* Remove this comment at will */\n}\n\n.currency-custom-amount-container {\n  background-color: var(--classy-custom-secondary-color, #e8ebf9);\n  border: 2px solid var(--classy-custom-secondary-color, #e8ebf9);\n  border-radius: var(--classy-custom-grid-radius, 8px);\n  box-sizing: border-box;\n  /* Apply grid border radius */\n  height: 56px;\n  display: flex;\n  overflow: hidden;\n  /* Ensure inner elements do not affect the container\'s border radius */\n}\n\n.currency-select {\n  height: 100%;\n  display: flex;\n  align-items: center;\n  border: none;\n  width: 85px;\n  appearance: none; /* Remove default arrow (for most browsers) */\n  -webkit-appearance: none; /* Safari */\n  -moz-appearance: none; /* Firefox */\n\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-theme-font__paragraph-md--font-size);\n  line-height: var(--classy-theme-font__paragraph-md--line-height);\n  font-weight: var(--classy-font__paragraph-md--font-weight);\n  padding: 16px 12px;\n  background-color: var(--classy-custom-secondary-color, #e8ebf9);\n  /* Use secondary color */\n\n  /* Respect the border radius for the top-left and bottom-left corners */\n  border-top-left-radius: var(--classy-custom-grid-radius, 8px);\n  border-bottom-left-radius: var(--classy-custom-grid-radius, 8px);\n  border-top-right-radius: 0;\n  border-bottom-right-radius: 0;\n\n  /* Always hide the select text in the button area (we\'ll show it via overlay) */\n  /* The dropdown options will still show the full text */\n  text-indent: -9999px;\n}\n\n/* Make sure dropdown options show the full text */\n.currency-select option {\n  text-indent: 0;\n  direction: ltr;\n}\n\n.currency-select-wrapper {\n  position: relative;\n  display: inline-block;\n}\n\n/* Overlay to display only the currency code */\n.currency-code-display {\n  position: absolute;\n  left: 12px;\n  top: 50%;\n  transform: translateY(-50%);\n  pointer-events: none;\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-theme-font__paragraph-md--font-size);\n  line-height: var(--classy-theme-font__paragraph-md--line-height);\n  font-weight: var(--classy-font__paragraph-md--font-weight);\n  color: var(--classy-color__neutral--10);\n}
5\n\n/* Custom arrow */\n.currency-select-wrapper::after {\n  content: \'▾\';\n  font-size: 20px;\n  position: absolute;\n  right: 0.4rem;\n  top: 50%;\n  transform: translateY(-55%);\n  font-weight: bold;\n  pointer-events: none;\n  background: var(--classy-custom-secondary-color, #e8ebf9);\n  padding: 1px 4px 1px 4px;\n  font-family: \'Domine\';\n}\n\n.currency-input-container {\n  border-left: 1px solid white;\n  flex-grow: 1;\n  width: 100%;\n  color: var(--classy-color__neutral--10);\n  background-color: var(--classy-custom-secondary-color, #e8ebf9);\n  /* Use secondary color */\n  gap: 4px;\n  padding: 0;\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-font__paragraph-lg-bold--font-size);\n  line-height: var(--classy-font__paragraph-lg-bold--line-height);\n  font-weight: var(--classy-font__paragraph-lg-bold--font-weight);\n  padding-left: 12px;\n  display: flex;\n  align-items: center;\n}\n\n.currency-custom-amount-container.active {\n  border-color: var(--classy-custom-primary-color, #425cc7);\n  /* Use primary color */\n  margin-left: 0px;\n}\n\n.currency-custom-amount-container.active .currency-label {\n  background-color: var(--classy-custom-primary-color, #425cc7);\n  /* Use primary color */\n  color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\n.currency-custom-amount-container.error {\n  border: 2px solid var(--classy-color__status--error-base);\n  margin-left: 0px;\n}\n\n.currency-custom-amount-container.error .currency-label {\n  background-color: var(--classy-color__status--error-base);\n  color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\n.error-message {\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-font__label--font-size);\n  line-height: var(--classy-font__label--line-height);\n  font-weight: var(--classy-font__label--font-weight);\n  color: var(--classy-color__status--error-base);\n}\n\ncl-custom-input {\n  flex-grow: 1;\n}\n\ncl-custom-input::part(classy-input-textfield) {\n  width: 100%;\n  color: rgba(0, 0, 0, 0.9);\n  background: transparent;\n  border: unset;\n  font-family: var(--classy-font__font-family--base, sans-serif);\n  font-size: var(--classy-font__paragraph-lg-bold--font-size, 20px);\n  line-height: var(--classy-font__paragraph-lg-bold--line-height, 1.5);\n  font-weight: var(--classy-font__paragraph-lg-bold--font-weight, 700);\n}\n\ncl-custom-input::part(classy-input-textfield):focus-visible {\n  outline: none;\n}\n\ncl-custom-input::part(classy-input-textfield)::placeholder {\n  color: var(--classy-color__neutral--10);\n}\n\nfieldset {\n  display: grid;\n  gap: 4px;\n  border: none;\n  padding: 0;\n  margin: 0;\n}\n\nfieldset.buttons-6 {\n  grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-5 {\n  grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-4 {\n  grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-3 {\n  grid-template-columns: repeat(3, 1fr);\n}\n\nfieldset.buttons-2 {\n  grid-template-columns: repeat(2, 1fr);\n}\n\nfieldset.buttons-1 {\n  grid-template-columns: 1fr;\n}\n\ncl-custom-button::part(button),\ncl-custom-button {\n  font-family: var(--classy-font__font-family--base, \'Arial\', sans-serif);\n  font-size: var(--classy-font__paragraph-lg-bold--font-size, \'20px\');\n  line-height: var(--classy-font__paragraph-lg-bold--line-height, \'30px\');\n  font-weight: var(--classy-font__paragraph-lg-bold--font-weight, \'700\');\n\n  text-decoration-skip-ink: none;\n  text-underline-position: from-font;\n\n  border-radius: var(--classy-custom-grid-radius, 8px);\n  /* Apply frequency border radius */\n  border: unset;\n  max-height: 56px;\n  /* Set the max height for each button */\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  padding: 0;\n  /* Remove any extra padding to ensure the button size reflects its content */\n  height: 56px;\n  /* Ensure each button has a consistent height */\n  overflow: hidden;\n  /* Ensure content doesn\'t overflow the button */\n  box-sizing: border-box;\n  /* Include padding and border in the element\'s width and height */\n}\n\ncl-custom-button:focus-visible {\n  border-radius: var(--classy-custom-grid-radius, 8px);\n  /* Apply frequency border radius */\n}\n\ncl-custom-button[active] {\n  background-color: var(--classy-custom-primary-color, #425cc7
5);\n  /* Use primary color */\n  color: var(--computed-color__brand-primary--contrast, #ffffff);\n}\n\ncl-custom-button:not([active]) {\n  background-color: var(--classy-custom-secondary-color, #e8ebf9);\n  /* Use secondary color */\n  color: var(--classy-color__neutral--10);\n}\n\ncl-custom-button.full-width {\n  grid-column: 1 / span 2;\n}\n\n      </style>\n\n      <fieldset aria-label="donation amount"></fieldset>\n\n<div class="currency-custom-amount-container">\n  <div class="currency-select-wrapper">\n    <select class="currency-select" aria-label="Select Donation Currency"></select>\n    <span class="currency-code-display"></span>\n  </div>\n  <span class="currency-input-container">\n    <span class="currency-symbol"></span>\n    <cl-custom-input\n      data-id="custom-amount"\n      type="number"\n      step="1.00"\n      id="custom-amount"\n    ></cl-custom-input>\n  </span>\n</div>\n\n<div class="error-message" style="display: none; color: red" />\n\n    ',this.updateActiveStates(),this.applyDynamicConfiguration(),this.updateCurrencyLabel(),this.updateCurrencySymbol("USD"),this.updateAmountPlaceholder(),this.updateCurrencySelectLabel()}});const me=JSON.parse('{"higher-impact-title":"Higher Impact"}'),ye=JSON.parse('{"higher-impact-title":"Mayor impacto"}');function be(e){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(e)}customElements.get("cl-toggle-group")||customElements.define("cl-toggle-group",class extends de{#o={showRecurringTag:!1};#a;constructor(){super(),this.loadI18nResources("ToggleGroup",{en:me,es:ye}),this.#a="one-time",this.render()}get config(){return this.#o}set config(e){this.#o=e,this.applyDynamicConfiguration()}applyDynamicConfiguration(){const e=this.shadowRoot.querySelector("cl-tag");if(e){const t=this.shadowRoot.querySelector("#higherImpact");t&&(t.textContent=` ${this.t("higher-impact-title","Higher Impact")} `),e.setAttribute("class",this.#o.showRecurringTag?"":"hidden")}}connectedCallback(){this.shadowRoot.addEventListener("click",this.handleToggleClick),this.updateButtonStates()}disconnectedCallback(){this.shadowRoot.removeEventListener("click",this.handleToggleClick)}handleToggleClick=e=>{const t=e.composedPath().find((e=>"cl-custom-button"===e?.tagName?.toLowerCase()));if(t){const e=t.getAttribute("value");e&&(this.selected=e)}};static get observedAttributes(){return["selected"]}attributeChangedCallback(e,t,n){"selected"===e&&t!==n&&(this.#a=n,this.updateButtonStates())}get selected(){return this.#a}set selected(e){this.#a!==e&&(this.#a=e,this.setAttribute("selected",e),this.updateButtonStates(),this.dispatchEvent(new CustomEvent("selection-change",{detail:{selected:e},bubbles:!0,composed:!0})))}updateButtonStates(){const e=this.shadowRoot.querySelectorAll("cl-custom-button");setTimeout((()=>{e.forEach((e=>{const t=e.getAttribute("value")===this.#a;e.toggleAttribute("active",t);const n=e.shadowRoot?.querySelector("button");n&&(t?(n.style.display="flex",n.style.gap="6px"):(n.style.display="",n.style.gap=""),n?.setAttribute("aria-pressed",t.toString()));const s=e.querySelector("svg");if(t){if(!s){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("viewBox","6 7 13 10"),t.setAttribute("width","12"),t.setAttribute("height","12");const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M10.5 16.5c-.1 0-.2-.02-.4-.07-.12-.05-.23-.12-.34-.23L6.27 12.7c-.19-.19-.28-.43-.27-.72.01-.28.1-.51.3-.7.19-.19.43-.28.72-.28s.53.09.72.28l2.83 2.83L17.35 7.3c.19-.19.42-.28.72-.28.28-.01.52.09.74.3.19.19.28.42.28.7 0 .28-.09.52-.28.71l-7.54 7.54c-.11.11-.23.18-.34.23-.13.05-.25.07-.39.07z"),n.setAttribute("fill","var(--computed-color__brand-primary--contrast, #ffffff)"),t.appendChild(n),e.prepend(t)}}else s&&s.remove()}))}),5)}render(){this.shadowRoot.innerHTML='\n      <style>\n        fieldset {\n  display: flex;\n  border-radius: var(--classy-custom-frequency-radius, 24px);\n  /* Use the frequency border radius */\n  background-color: var(--classy-custom-secondary-color, #e8ebf9);\n  /* Default secondary color for inactive state */\n  height: 42px;\n  justify-content: space-around;\n  padding: 0px;\n  border: 2px solid var(--classy-background);\n}\n\ncl-custom-button::part(button),\ncl-custom-button {\n  font-family: var(--classy-font__font-family--base, \'Arial\', sans-serif);\n  font-size: var(--classy-font__paragraph-md-bold--font-size, \'16px\');\n  line-height: var(--classy-font__paragraph-md-bold--line-height, \'1.5\');\n  font-weight: var(--classy-font__paragraph-md-bold--font-weight, \'700\');\n  border-radius: var(--classy-custom-frequency-radius, 24px);\n  cursor: pointer;\n  transition: all 0.24s cubic-bezier(0.645, 0.045, 0.355, 1);\n  text-decoration-skip-ink: none;\n  text-underline-position: from-font;\n}\n\ncl-custom-button[active] {\n  background-color: var(--classy-custom-primary-color, #425cc7
5);\n  /* Primary color when active */\n  color: var(--computed-color__brand-primary--contrast, #ffffff);\n  box-shadow: var(--classy-shadow__active, 0 2px 4px rgba(0, 0, 0, 0.2));\n}\n\ncl-custom-button:not([active]) {\n  background-color: rgba(0, 0, 0, 0);\n  /* No background when inactive */\n  color: var(--classy-color__neutral--10);\n}\n\ncl-tag::part(tag),\n.tag-children {\n  display: flex;\n  align-items: center;\n  gap: 2px;\n}\n\ncl-tag::part(tag),\n.heart-path {\n  fill: var(--classy-custom-primary-color, #425cc7);\n  stroke: var(--classy-custom-primary-color, #425cc7);\n}\n\ncl-tag::part(tag),\n.impact-icon {\n  fill: var(--classy-custom-primary-color, #425cc7);\n}\n\n.hidden {\n  display: none;\n}\n\n      </style>\n\n      <fieldset>\n  <cl-custom-button value="one-time"></cl-custom-button>\n  <div style="display: flex; width: 100%; position: relative">\n    <cl-tag position="top-center">\n      <div class="tag-children">\n        <span id="higherImpact"></span>\n        <svg\n          width="15"\n          height="14"\n          viewB
5ox="0 0 15 14"\n          fill="none"\n          xmlns="http://www.w3.org/2000/svg"\n          class="impact-icon"\n        >\n          <path\n            d="M6.95832 3.5966L7.29167 3.98877L7.62502 3.5966C7.84932 3.33271 8.11408 3.13036 8.42214 2.98616C8.72952 2.84228 9.05119 2.77075 9.39167 2.77075C10.0138 2.77075 10.5109 2.97455 10.914 3.37761C11.317 3.78068 11.5208 4.27774 11.5208 4.89992C11.5208 5.20748 11.4692 5.50836 11.3649 5.80456C11.2634 6.09251 11.0773 6.42875 10.7905 6.81486C10.504 7.20051 10.1113 7.64486 9.60731 8.14889C9.10121 8.655 8.45783 9.25999 7.67574 9.96466C7.67565 9.96474 7.67557 9.96481 7.67548 9.96489L7.29167 10.309L6.90785 9.96489C6.90776 9.96481 6.90768 9.96474 6.90759 9.96466C6.1255 9.25999 5.48213 8.655 4.97603 8.14889C4.47199 7.64486 4.07935 7.20051 3.79287 6.81486C3.50605 6.42875 3.31991 6.09251 3.21848 5.80456C3.11414 5.50836 3.0625 5.20748 3.0625 4.89992C3.0625 4.27774 3.26629 3.78068 3.66936 3.37761C4.07243 2.97455 4.56949 2.77075 5.19167 2.77075C5.53215 2.77075 5.85382 2.84228 6.16119 2.98616C6.46926 3.13036 6.73401 3.33271 6.95832 3.5966Z"\n            class="heart-icon"\n          />\n        </svg>\n      </div>\n    </cl-tag>\n    <cl-custom-button value="recurring"></cl-custom-button>\n  </div>\n</fieldset>\n\n    ',this.updateButtonStates()}}),customElements.get("cl-tag")||customElements.define("cl-tag",class extends e{constructor(){super(),this.render()}static get observedAttributes(){return["text","position"]}attributeChangedCallback(e,t,n){if("text"===e){const e=this.shadowRoot?.querySelector(".tag-content");e&&(e.textContent=n)}if("position"===e){const e=this.shadowRoot?.querySelector(".tag");e&&e.setAttribute("data-position",n)}}render(){this.shadowRoot.innerHTML="\n      <style>:host {\n  display: inline-block;\n}\n\n.tag {\n  display: flex;\n  align-items: center;\n  position: absolute;\n\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-font__tag-bold--font-size, '12px');\n  line-height: var(--classy-font__tag-bold--line-height, '1');\n  font-weight: var(--classy-font__tag-bold--font-weight, '700');\n\n  color: var(--classy-color__text, #333333);\n  background-color: var(--classy-color__background-light, #ffffff);\n  padding: 0.25rem 0.5rem;\n  border: 2px solid var(--classy-color__border,);\n  border-radius: var(--classy-border-radius, 24px);\n  text-transform: uppercase;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  max-width: 100%;\n}\n\n/* Top positions */\n.tag[data-position='top-center'] {\n  top: -1.3rem;\n  right: 50%;\n  transform: translateX(50%);\n}\n\n.tag[data-position='top-right'] {\n  top: -1.3rem;\n  right: 0;\n}\n\n.tag[data-position='top-left'] {\n  top: -1.3rem;\n  left: 0;\n}\n\n/* Bottom positions */\n.tag[data-position='bottom-center'] {\n  bottom: -1.3rem;\n  right: 50%;\n  transform: translateX(50%);\n}\n\n.tag[data-position='bottom-right'] {\n  bottom: -1.3rem;\n  right: 0;\n}\n\n.tag[data-position='bottom-left'] {\n  bottom: -1.3rem;\n  left: 0;\n}\n\n/* Side positions */\n.tag[data-position='left-center'] {\n  left: -50%;\n  top: 50%;\n  transform: translateY(-50%);\n  transform-origin: right center;\n}\n\n.tag[data-position='right-center'] {\n  right: -50%;\n  top: 50%;\n  transform: translateY(-50%);\n  transform-origin: left center;\n}\n\n.hidden {\n  display: none;\n}\n</style>
vendor: 12,251 bytes, line 5
5\n      <span class=\"tag\" part=\"tag\">\n  <slot></slot>\n</span>\n\n    "}});var ve=/^\s+/,_e=/\s+$/;function Ae(e,t){if(t=t||{},(e=e||"")instanceof Ae)return e;if(!(this instanceof Ae))return new Ae(e,t);var n=function(e){var t,n,s,i={r:0,g:0,b:0},o=1,a=null,r=null,l=null,c=!1,d=!1;return"string"==typeof e&&(e=function(e){e=e.replace(ve,"").replace(_e,"").toLowerCase();var t,n=!1;if(qe[e])e=qe[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=Je.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=Je.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Je.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Je.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Je.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Je.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Je.hex8.exec(e))?{r:Ue(t[1]),g:Ue(t[2]),b:Ue(t[3]),a:Ke(t[4]),format:n?"name":"hex8"}:(t=Je.hex6.exec(e))?{r:Ue(t[1]),g:Ue(t[2]),b:Ue(t[3]),format:n?"name":"hex"}:(t=Je.hex4.exec(e))?{r:Ue(t[1]+""+t[1]),g:Ue(t[2]+""+t[2]),b:Ue(t[3]+""+t[3]),a:Ke(t[4]+""+t[4]),format:n?"name":"hex8"}:!!(t=Je.hex3.exec(e))&&{r:Ue(t[1]+""+t[1]),g:Ue(t[2]+""+t[2]),b:Ue(t[3]+""+t[3]),format:n?"name":"hex"}}(e)),"object"==be(e)&&(Ze(e.r)&&Ze(e.g)&&Ze(e.b)?(t=e.r,n=e.g,s=e.b,i={r:255*Ge(t,255),g:255*Ge(n,255),b:255*Ge(s,255)},c=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):Ze(e.h)&&Ze(e.s)&&Ze(e.v)?(a=ze(e.s),r=ze(e.v),i=function(e,t,n){e=6*Ge(e,360),t=Ge(t,100),n=Ge(n,100);var s=Math.floor(e),i=e-s,o=n*(1-t),a=n*(1-i*t),r=n*(1-(1-i)*t),l=s%6;return{r:255*[n,a,o,o,r,n][l],g:255*[r,n,n,a,o,o][l],b:255*[o,o,r,n,n,a][l]}}(e.h,a,r),c=!0,d="hsv"):Ze(e.h)&&Ze(e.s)&&Ze(e.l)&&(a=ze(e.s),l=ze(e.l),i=function(e,t,n){var s,i,o;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=Ge(e,360),t=Ge(t,100),n=Ge(n,100),0===t)s=i=o=n;else{var r=n<.5?n*(1+t):n+t-n*t,l=2*n-r;s=a(l,r,e+1/3),i=a(l,r,e),o=a(l,r,e-1/3)}return{r:255*s,g:255*i,b:255*o}}(e.h,a,l),c=!0,d="hsl"),e.hasOwnProperty("a")&&(o=e.a)),o=$e(o),{ok:c,format:e.format||d,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:o}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Ee(e,t,n){e=Ge(e,255),t=Ge(t,255),n=Ge(n,255);var s,i,o=Math.max(e,t,n),a=Math.min(e,t,n),r=(o+a)/2;if(o==a)s=i=0;else{var l=o-a;switch(i=r>.5?l/(2-o-a):l/(o+a),o){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4}s/=6}return{h:s,s:i,l:r}}function we(e,t,n){e=Ge(e,255),t=Ge(t,255),n=Ge(n,255);var s,i,o=Math.max(e,t,n),a=Math.min(e,t,n),r=o,l=o-a;if(i=0===o?0:l/o,o==a)s=0;else{switch(o){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4}s/=6}return{h:s,s:i,v:r}}function Se(e,t,n,s){var i=[Ve(Math.round(e).toString(16)),Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16))];return s&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Ce(e,t,n,s){return[Ve(Be(s)),Ve(Math.round(e).toString(16)),Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16))].join("")}function xe(e,t){t=0===t?0:t||10;var n=Ae(e).toHsl();return n.s-=t/100,n.s=He(n.s),Ae(n)}function Ie(e,t){t=0===t?0:t||10;var n=Ae(e).toHsl();return n.s+=t/100,n.s=He(n.s),Ae(n)}function ke(e){return Ae(e).desaturate(100)}function Re(e,t){t=0===t?0:t||10;var n=Ae(e).toHsl();return n.l+=t/100,n.l=He(n.l),Ae(n)}function Oe(e,t){t=0===t?0:t||10;var n=Ae(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),Ae(n)}function De(e,t){t=0===t?0:t||10;var n=Ae(e).toHsl();return n.l-=t/100,n.l=He(n.l),Ae(n)}function Pe(e,t){var n=Ae(e).toHsl(),s=(n.h+t)%360;return n.h=s<0?360+s:s,Ae(n)}function Le(e){var t=Ae(e).toHsl();return t.h=(t.h+180)%360,Ae(t)}function Te(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Ae(e).toHsl(),s=[Ae(e)],i=360/t,o=1;o<t;o++)s.push(Ae({h:(n.h+o*i)%360,s:n.s,l:n.l}));return s}function Me(e){var t=Ae(e).toHsl(),n=t.h;return[Ae(e),Ae({h:(n+72)%360,s:t.s,l:t.l}),Ae({h:(n+216)%360,s:t.s,l:t.l})]}function Ne(e,t,n){t=t||6,n=n||30;var s=Ae(e).toHsl(),i=360/n,o=[Ae(e)];for(s.h=(s.h-(i*t>>1)+720)%360;--t;)s.h=(s.h+i)%360,o.push(Ae(s));return o}function Fe(e,t){t=t||6;for(var n=Ae(e).toHsv(),s=n.h,i=n.s,o=n.v,a=[],r=1/t;t--;)a.push(Ae({h:s,s:i,v:o})),o=(o+r)%1;return a}Ae.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,s=this.toRgb();return e=s.r/255,t=s.g/255,n=s.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=$e(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=we(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=we(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+s+"%)":"hsva("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=Ee(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Ee(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return Se(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,s,i){var o=[Ve(Math.round(e).toString(16)),Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16)),Ve(Be(s))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Ge(this._r,255))+"%",g:Math.round(100*Ge(this._g,255))+"%",b:Math.round(100*Ge(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Ge(this._r,255))+"%, "+Math.round(100*Ge(this._g,255))+"%, "+Math.round(100*Ge(this._b,255))+"%)":"rgba("+Math.round(100*Ge(this._r,255))+"%, "+Math.round(100*Ge(this._g,255))+"%, "+Math.round(100*Ge(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(je[Se(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+Ce(this._r,this._g,this._b,this._a),n=t,s=this._gradientType?"GradientType = 1, ":"";if(e){var i=Ae(e);n="#"+Ce(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,s=this._a<1&&this._a>=0;return t||!s||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Ae(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Re,arguments)},brighten:function(){return this._applyModification(Oe,arguments)},darken:function(){return this._applyModification(De,arguments)},desaturate:function(){return this._applyModification(xe,arguments)},saturate:function(){return this._applyModification(Ie,arguments)},greyscale:function(){return this._applyModification(ke,arguments)},spin:function(){return this._applyModification(Pe,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(Ne,arguments)},complement:function(){return this._applyCombination(Le,arguments)},monochromatic:function(){return this._applyCombination(Fe,arguments)},splitcomplement:function(){return this._applyCombination(Me,arguments)},triad:function(){return this._applyCombination(Te,[3])},tetrad:function(){return this._applyCombination(Te,[4])}},Ae.fromRatio=function(e,t){if("object"==be(e)){var n={};for(var s in e)e.hasOwnProperty(s)&&(n[s]="a"===s?e[s]:ze(e[s]));e=n}return Ae(e,t)},Ae.equals=function(e,t){return!(!e||!t)&&Ae(e).toRgbString()==Ae(t).toRgbString()},Ae.random=function(){return Ae.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Ae.mix=function(e,t,n){n=0===n?0:n||50;var s=Ae(e).toRgb(),i=Ae(t).toRgb(),o=n/100;return Ae({r:(i.r-s.r)*o+s.r,g:(i.g-s.g)*o+s.g,b:(i.b-s.b)*o+s.b,a:(i.a-s.a)*o+s.a})},Ae.readability=function(e,t){var n=Ae(e),s=Ae(t);return(Math.max(n.getLuminance(),s.getLuminance())+.05)/(Math.min(n.getLuminance(),s.getLuminance())+.05)},Ae.isReadable=function(e,t,n){var s,i,o,a,r,l=Ae.readability(e,t);switch(i=!1,(o=n,"AA"!==(a=((o=o||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==a&&(a="AA"),"small"!==(r=(o.size||"small").toLowerCase())&&"large"!==r&&(r="small"),s={level:a,size:r}).level+s.size){case"AAsmall":case"AAAlarge":i=l>=4.5;break;case"AAlarge":i=l>=3;break;case"AAAsmall":i=l>=7}return i},Ae.mostReadable=function(e,t,n){var s,i,o,a,r=null,l=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;c<t.length;c++)(s=Ae.readability(e,t[c]))>l&&(l=s,r=Ae(t[c]));return Ae.isReadable(e,r,{level:o,size:a})||!i?r:(n.includeFallbackColors=!1,Ae.mostReadable(e,["#fff","#000"],n))};var qe=Ae.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
50",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},je=Ae.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(qe);function $e(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Ge(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function He(e){return Math.min(1,Math.max(0,e))}function Ue(e){return parseInt(e,16)}function Ve(e){return 1==e.length?"0"+e:""+e}function ze(e){return e<=1&&(e=100*e+"%"),e}function Be(e){return Math.round(255*parseFloat(e)).toString(16)}function Ke(e){return Ue(e)/255}var Ye,We,Qe,Je=(We="[\\s|\\(]+("+(Ye="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Ye+")[,|\\s]+("+Ye+")\\s*\\)?",Qe="[\\s|\\(]+("+Ye+")[,|\\s]+("+Ye+")[,|\\s]+("+Ye+")[,|\\s]+("+Ye+")\\s*\\)?",{CSS_UNIT:new RegExp(Ye),rgb:new RegExp("rgb"+We),rgba:new RegExp("rgba"+Qe),hsl:new RegExp("hsl"+We),hsla:new RegExp("hsla"+Qe),hsv:new RegExp("hsv"+We),hsva:new RegExp("hsva"
5+Qe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Ze(e){return!!Je.CSS_UNIT.exec(e)}class Xe extends e{#a;#o={options:[],selected:null};constructor(){super(),this.#a=null,this.render()}set config(e){this.#o=e,this.#a=e.selected,this.applyDynamicConfiguration()}connectedCallback(){this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}removeEventListeners(){}setupEventListeners(){const e=this.shadowRoot.querySelector("select");e&&e.addEventListener("change",this.handleChange.bind(this))}handleChange(e){const t=e.target;this.#a=t.value,this.dispatchEvent(new CustomEvent("select-change",{detail:{selected:this.#a}}))}applyDynamicConfiguration(){const e=this.shadowRoot.querySelector("select");e.innerHTML="",this.#o.options.forEach((t=>{let{value:n,label:s}=t;const i=document.createElement("option");i.value=n,i.innerText=s,this.#a===n&&(i.selected=!0),e.appendChild(i)}))}render(){this.shadowRoot.innerHTML='\n        <style>\n            div.select-container {\n    position: relative;\n}\n\nselect {\n    background: white;\n    appearance: none;\n    box-shadow: 0px 2px 2px rgba(27, 25, 24, 0.12);\n    cursor: pointer;\n    min-height: 40px;\n    padding: 10px;\n    width: 100%;\n    border: 1px solid var(--classy-color__border--input, #ccc);\n    border-radius: var(--classy-custom-grid-radius, 4px); /* Apply grid border radius */\n    font-family: var(--classy-font__font-family--base, sans-serif);\n    font-size: var(--classy-font__paragraph-md--font-size, 16px);\n    line-height: 1.5;\n    font-weight: 400;\n    color: var(--classy-color__text, #000);\n    background-color: var(--classy-color__background, #fff);\n    box-sizing: border-box;\n    margin-top: 4px;\n    margin-bottom: 24px;\n}\n\n.select-arrow {\n    position: absolute;\n    right: 10px;\n    top: 12px;\n}\n        </style>\n\n        <div class="select-container">\n    <select part="select">\n        <slot part="select-option"></slot>\n    </select>\n    <span class="select-arrow">\n        <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="24px">\n        <path d="M11.1786 14.9909L7.76625 11.5785C7.38091 11.1932 7.29205 10.7514 7.49966 10.2532C7.70727 9.75497 8.08209 9.50586 8.62412 9.50586H15.4425C15.9846 9.50586 16.3594 9.75497 16.567 10.2532C16.7746 10.7514 16.6858 11.1932 16.3005 11.5785L12.888 14.9909C12.7613 15.1177 12.6298 15.2099 12.4938 15.2676C12.3578 15.3253 12.2043 15.3542 12.0333 15.3542C11.8624 15.3542 11.7089 15.3253 11.5729 15.2676C11.4368 15.2099 11.3054 15.1177 11.1786 14.9909Z"/>\n        </svg>\n    </span>\n</div>\n\n        ',this.applyDynamicConfiguration()}}customElements.get("cl-select")||customElements.define("cl-select",Xe);const et=JSON.parse('{"choose-amount":"Choose an amount","continue":"Continue","donate":"Donate","donate-frequency":{"daily":"Donate daily","weekly":"Donate weekly","bi-weekly":"Donate every two weeks","monthly":"Donate monthly","bi-monthly":"Donate bi-monthly","quarterly":"Donate quarterly","semi-annually":"Donate every six months","yearly":"Donate yearly"},"frequency":{"bi-monthly":"Bi-monthly","bi-weekly":"Every two weeks","daily":"Daily","every":"Every","every-six-months":"every six months","every-two-weeks":"every two weeks","monthly":"Monthly","one-time":"One-time","quarterly":"Quarterly","recurring":"Recurring","semi-annually":"Every six months","weekly":"Weekly","yearly":"Yearly"},"frequency-select-label":"Donation Frequency","recurring-end-date-input-label":"End date (optional)","sub-heading-title":"Choose an amount to donate"}'),tt=JSON.parse('{"choose-amount":"Elige una cantidad","continue":"Continuar","donate":"Donar","donate-frequency":{"daily":"Donar diariamente","weekly":"Donar semanalmente","bi-weekly":"Donar quincenalmente","monthly":"Donar mensualmente","bi-monthly":"Donar bimestralmente","quarterly":"Donar trimestralmente","semi-annually":"Donar semestralmente","yearly":"Donar anualmente"},"frequency":{"bi-monthly":"Bimestral","bi-weekly":"Quincenal","daily":"Diaria","every":"Cada","every-six-months":"Cada seis meses","every-two-weeks":"Cada dos semanas","monthly":"Mensual","one-time":"Única","quarterly":"Trimestral","recurring":"Periódica","semi-annually":"Semestral","weekly":"Semanal","yearly":"Anual"},"frequency-select-label":"Frecuencia de donación","recurring-end-date-input-label":"Fecha de finalización (opcional)","sub-heading-title":"Elige una cantidad para donar"}');var nt=function(e){return e.ONE_TIME="one-time",e.DAILY="daily",e.WEEKLY="weekly",e.BI_WEEKLY="bi-weekly",e.MONTHLY="monthly",e.BI_MONTHLY="bi-monthly",e.QUARTERLY="quarterly",e.SEMI_ANNUALLY="semi-annually",e.YEARLY="yearly",e}(nt||{});customElements.get("cl-donation-form")||customElements.define("cl-donation-form",class extends de{#r;#l;#t;#c;#d;#u;#o;#h;#p;#g;#f;constructor(){super(),this.loadI18nResources("DonationForm",{en:et,es:tt}),this.#r=null,this.#t=null,this.#d=null,this.#u=null,this.#o={},this.#p=new Map,this.#g=new Map,this.#f=new Map,this.#h={ONE_TIME:this.t("frequency.one-time","One-time"),DAILY:this.t("frequency.daily","Daily"),WEEKLY:this.t("frequency.weekly","Weekly"),BI_WEEKLY:this.t("frequency.bi-weekly","Every two weeks"),MONTHLY:this.t("frequency.monthly","Monthly"),BI_MONTHLY:this.t("frequency.bi-monthly","Bi-monthly"),QUARTERLY:this.t("frequency.quarterly","Quarterly"),SEMI_ANNUALLY:this.t("frequency.semi-annually","Every six months"),YEARLY:this.t("frequency.yearly","Yearly")},this.#l=[],this.#c="",this.onFrequencySelectionChange=this.onFrequencySelectionChange.bind(this),this.onToggleChange=this.onToggleChange.bind(this),this.onAmountSelectionChange=this.onAmountSelectionChange.bind(this),this.onRecurringEnd
5DateChange=this.onRecurringEndDateChange.bind(this),this.onCurrencyChange=this.onCurrencyChange.bind(this),this.onCustomAmountInput=this.onCustomAmountInput.bind(this),this.onSubmit=this.onSubmit.bind(this),this.render()}connectedCallback(){this.#u=this.getAttribute("campaign-id")||null,null===this.#u&&console.warn("Please provide a non-null value for the campaign ID. PLEASE"),this.setupEventListeners()}disconnectedCallback(){this.removeEventListeners()}getCustomAmount(){const e=this.shadowRoot.querySelector("cl-amount-selector"),t=e?.shadowRoot?.querySelector("cl-custom-input");if(t&&t.value){const e=parseFloat(t.value);if(!Number.isNaN(e)&&e>0)return e}return null}getDefaultFrequency=e=>0===Object.keys(e).length?null:e.donationFrequencies.find((e=>e.isDefault));getTranslatedFrequency=e=>{const t=Object.entries(nt).find((t=>{let[n,s]=t;return s===e}))?.[0];return t?this.#h[t]:e};getCurrentCurrency(){const e=this.#o.currencies?.find((e=>e.selected))?.value;return this.#c||e||""}getFrequencyCurrencyKey(){return`${(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#r)||""}|${this.getCurrentCurrency()}`}initializeWithConfig(e){const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return;const n=Ae(e).setAlpha(t);return n.isValid()?n.toRgbString():void 0}(this.#o.cssBackgroundColor??"transparent",this.#o.cssBackgroundColorOpacity??1);switch(t&&this.style.setProperty("--classy-custom-background-color",t),this.#o.borderRadius){case"sharp":this.style.setProperty("--classy-custom-border-radius","0px"),this.style.setProperty("--classy-custom-frequency-radius","0px"),this.style.setProperty("--classy-custom-grid-radius","0px"),this.style.setProperty("--classy-custom-cta-radius","0");break;case"rounded":this.style.setProperty("--classy-custom-border-radius","8px"),this.style.setProperty("--classy-custom-frequency-radius","8px"),this.style.setProperty("--classy-custom-grid-radius","8px"),this.style.setProperty("--classy-custom-cta-radius","8px");break;case"pill":this.style.setProperty("--classy-custom-border-radius","20px"),this.style.setProperty("--classy-custom-frequency-radius","20px"),this.style.setProperty("--classy-custom-grid-radius","8px"),this.style.setProperty("--classy-custom-cta-radius","48px");break;default:this.style.setProperty("--classy-custom-border-radius","0px"),this.style.setProperty("--classy-custom-frequency-radius","0px"),this.style.setProperty("--classy-custom-grid-radius","0px"),this.style.setProperty("--classy-custom-cta-radius","0px")}if(this.style.setProperty("--classy-custom-primary-color",this.#o.primaryColor||"#425cc7"),this.style.setProperty("--classy-custom-primary-color",this.#o.primaryColor||"var(--theme-color__brand-primary)"),this.style.setProperty("--classy-custom-secondary-color",this.#o.secondaryColor||"var(--theme-color__brand-secondary)"),this.style.setProperty("--classy-custom-cta-button-color",this.#o.ctaButtonColor||"#000"),this.style.setProperty("--classy-custom-drop-shadow",this.#o.dropShadow?"0 8px 16px 0 rgba(27,27,27,.1)":"none"),this.#o.primaryColor){const e=Ae(this.#o.primaryColor).isDark()?"#fff":"#000";this.style.setProperty("--computed-color__brand-primary--contrast",e)}else this.style.setProperty("--computed-color__brand-primary--contrast","var(--theme-color__brand-custom-text-color)");if(e){const e=this.getDefaultFrequency(this.#o);this.selectedFrequency=e?e.name:nt.ONE_TIME}const n=(this.#r===nt.ONE_TIME?this.#o.donationAmounts:this.#o.recurringAmounts).find((e=>e.isDefault));this.#t=n?n.amount:0;const{visibleFrequencies:s}=this,i=this.shadowRoot.querySelector("cl-toggle-group");0===this.visibleFrequencies.filter((e=>e.name===nt.ONE_TIME&&e.isVisible)).length||0===this.visibleRecurringFrequencies.length?i.style.display="none":i.style.display="block",1===s.length&&(this.selectedFrequency=s[0].name);const o=this.shadowRoot.querySelector("#recurring-end-date-container"),a=this.shadowRoot.querySelector("#recurring-end-date-input-label");a&&(a.textContent=this.t("recurring-end-date-input-label","End date (optional)")),this.shadowRoot.querySelector("cl-custom-input#recurring-end-date").shadowRoot.querySelector("input").setAttribute("min",(new Date).toISOString().split("T")[0]),this.#o.hideRecurringEnd
5Date||this.#r===nt.ONE_TIME?o.style.display="none":o.style.display="block",this.updateDynamicContent()}updateDynamicContent(){this.updateHeading(),this.updateSubHeading(),this.updateSubmitButton(),this.updateAmountSelector(),this.updateRecurringFrequencySelect(),this.updateFaqHyperlink(),this.updateToggleTags()}updateRecurringFrequencySelect(){const e=this.shadowRoot.querySelector("cl-select#recurring-frequency-select"),t=this.visibleRecurringFrequencies.map((e=>{let{name:t}=e;return{value:t,label:(n=this.getTranslatedFrequency(t),n.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())))};var n}));e instanceof Xe&&(e.config={options:t,selected:this.#r});const n=this.shadowRoot.querySelector("#recurring-frequency-container"),s=this.shadowRoot.querySelector("#recurring-frequency-select-label");s&&(s.textContent=this.t("frequency-select-label","Donation Frequency")),this.#r===nt.ONE_TIME||this.visibleRecurringFrequencies.length<2?n.style.display="none":n.style.display="block"}updateToggleTags(){const e=this.shadowRoot?.querySelector("cl-toggle-group");e&&(e.config={showRecurringTag:this.#o.showRecurringUpsell})}updateAmountSelector(){const e=this.shadowRoot.querySelector("cl-amount-selector"),t=this.#r===nt.ONE_TIME?this.#o.donationAmounts:this.#o.recurringAmounts,n=this.#o.currencies?.map((e=>({...e,selected:this.#c?e.value===this.#c:e.selected})))??[],{minimumDonationAmount:s}=this.#o;this.getCurrentCurrency(),this.getFrequencyCurrencyKey();const i=this.#r||"",o=this.#p.get(i)??null,a=this.#g.get(i)??null,r=this.#f.get(i)??null;let l=null;if(null!==a)l=a;else if(null!==r){const e=t.find((e=>e.name===r&&e.isVisible));e?l=e.amount:null!==o&&(l=o)}else l=null!==o?o:t.find((e=>e.isDefault))?.amount??null;null!==a&&null!==l?(e.setCustomInputValue(a.toString()),e.isCustomAmountActive=!0,e.setSelectedAmountSilently(l)):(e.isCustomAmountActive=!1,null!==l?e.setSelectedAmountSilently(l):e.resetSelectedAmountSilently()),e.config={presetAmounts:t,currencies:n,minimumDonationAmount:s},null!==l&&(e.setCustomInputValue(l.toString()),this.selectedAmount=l)}setupEventListeners(){this.shadowRoot?.querySelector("cl-toggle-group")?.addEventListener("selection-change",this.onToggleChange),this.shadowRoot?.querySelector("cl-select#recurring-frequency-select")?.addEventListener("select-change",this.onFrequencySelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.addEventListener("amount-selection-change",this.onAmountSelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.addEventListener("currency-selection-change",this.onCurrencyChange),this.shadowRoot?.querySelector("cl-amount-selector")?.addEventListener("custom-amount-input-change",this.onCustomAmountInput),this.shadowRoot?.querySelector("cl-custom-input#recurring-end-date")?.addEventListener("value-change",this.onRecurringEndDateChange),this.shadowRoot?.querySelector(".submit-button")?.addEventListener("mousedown",this.onSubmit)}removeEventListeners(){this.shadowRoot?.querySelector("cl-toggle-group")?.removeEventListener("selection-change",this.onToggleChange),this.shadowRoot?.querySelector("cl-select#recurring-frequency-select")?.removeEventListener("select-change",this.onFrequencySelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.removeEventListener("amount-selection-change",this.onAmountSelectionChange),this.shadowRoot?.querySelector("cl-amount-selector")?.removeEventListener("custom-amount-input-change",this.onCustomAmountInput),this.shadowRoot?.querySelector(".submit-button")?.removeEventListener("mousedown",this.onSubmit)}attributeChangedCallback(e,t,n){"campaign-id"===e&&(this.#u=n)}onFrequencySelectionChange(e){this.selectedFrequency=e.detail.selected}onToggleChange(e){const{selected:t}=e.detail,n=this.shadowRoot.querySelector("#recurring-end-date-container");if(t===nt.ONE_TIME)this.selectedFrequency=t,n.style.display="none";else{const e=this.visibleRecurringFrequencies.find((e=>e.isDefault))??this.visibleRecurringFrequencies[0];this.selectedFrequency=e.name,n.style.display=this.#o.hideRecurringEndDate?"none":"block"}this.updateRecurringFrequencySelect()}onAmountSelectionChange(e){const t=this.shadowRoot.querySelector("cl-amount-selector"),n=t?.isCustomAmountActive??!1,s=e.detail.selectedAmount;if(null!==this.#r){const e=this.#r||"",t=this.#r===nt.ONE_TIME?this.#o.donationAmounts:this.#o.recurringAmounts;if(n)this.#p.set(e,s),this.#g.set(e,s),this.#f.set(e,"other");else{this.#p.set(e,s),this.#g.set(e,null);const n=t.find((e=>e.amount===s&&"other"!==e.name));this.#f.set(e,n?.name??null)}}this.selectedAmount=s}
5onRecurringEndDateChange(e){this.recurringEndDate=e.detail.value}onCurrencyChange(e){this.selectedCurrency=e.detail.selectedCurrency}onCustomAmountInput(){this.updateSubmitButton()}onSubmit(e){e.preventDefault();const t=this.shadowRoot.querySelector("cl-amount-selector"),n=t?.shadowRoot?.querySelector(".error-message");if(n?.textContent?.trim()&&n.offsetParent)return;const s=this.getCustomAmount();if(null!==s&&(s<this.#o.minimumDonationAmount||s>1e7)){const e=t?.shadowRoot?.querySelector("cl-custom-input");e?.dispatchEvent(new Event("blur",{bubbles:!0,composed:!0}))}else this.dispatchEvent(new CustomEvent("classy-donation-submit",{detail:{frequency:this.#r,amount:s??this.#t,recurringEndDate:this.#d,campaignId:this.#u,selectedCurrency:this.#c},bubbles:!0,composed:!0}))}static get observedAttributes(){return["campaign-id"]}set config(e){const t=this.getDefaultFrequency(this.#o),n=e=>(e||[]).map((e=>({...e,amount:"other"===e.name?e.amount:Math.round(e.amount)}))),s=n(e.donationAmounts),i=n(e.recurringAmounts);this.#o={...e,donationAmounts:s,recurringAmounts:i};const o=t!==this.getDefaultFrequency(this.#o);this.initializeWithConfig(o)}set externalCustomAmounts(e){if(!e)return;const t=this.#r;let n=!1;Object.entries(e).forEach((e=>{let[s,i]=e;const o=s,a=o||"";null==i?this.#g.set(a,null):(this.#p.set(a,i),this.#g.set(a,i),this.#f.set(a,"other")),t===o&&(n=!0)})),n&&this.updateAmountSelector()}set externalCustomAmount(e){e&&(this.externalCustomAmounts={[e.frequency]:e.amount})}get campaignId(){return this.#u}set campaignId(e){this.#u=e}get visibleFrequencies(){return this.#o.donationFrequencies.filter((e=>e.isVisible))}get visibleRecurringFrequencies(){return this.visibleFrequencies.filter((e=>e.name!==nt.ONE_TIME))}set selectedFrequency(e){if(this.#r!==e&&Object.keys(nt).map((e=>nt[e])).includes(e)){this.dispatchEvent(new CustomEvent("frequency_change",{detail:{from_frequency:this.#r,to_frequency:e},bubbles:!0,composed:!0})),this.#r=e;const t=this.shadowRoot.querySelector("cl-toggle-group"),n=this.#r===nt.ONE_TIME?"one-time":"recurring";t.setAttribute("selected",n),this.updateDynamicContent()}}set selectedAmount(e){if(this.#t!==e){this.dispatchEvent(new CustomEvent("amount_selected",{detail:{from_amount:this.#t,to_amount:e},bubbles:!0,composed:!0})),this.#t=e;const t=this.shadowRoot.querySelector("cl-amount-selector"),n=this.#r||"",s=this.#g.get(n)??null;null!==s&&s===e||t.setAttribute("selected-amount",this.#t.toString()),this.updateSubmitButton()}}set recurringEndDate(e){this.#d!==e&&(this.dispatchEvent(new CustomEvent("recurring_end_date_selected",{detail:{from_amount:this.#t,to_amount:e},bubbles:!0,composed:!0})),this.#d=e)}set selectedCurrency(e){this.#c!==e&&(this.dispatchEvent(new CustomEvent("currency_selected",{detail:{from_currency:this.#c,to_currency:e},bubbles:!0,composed:!0})),this.#c=e)}updateSubHeading(){const e=this.shadowRoot.querySelector(".sub-heading"),t=e?.querySelector("#sub-heading-title");t&&(t.textContent=this.t("sub-heading-title","Choose an amount to donate"));const n=e?.querySelector("#selected-frequency");if(n)switch(this.#r){case nt.ONE_TIME:n.textContent="";break;case nt.BI_WEEKLY:n.textContent=this.t("frequency.every-two-weeks","every two weeks");break;case nt.SEMI_ANNUALLY:n.textContent=this.t("frequency.every-six-months","every six months");break;default:n.textContent=this.getTranslatedFrequency(this.#r).toLowerCase()||""}const s=this.shadowRoot.querySelector("cl-toggle-group")?.shadowRoot?.querySelector('cl-custom-button[value="recurring"]'),{visibleRecurringFrequencies:i}=this;if(s&&1===i.length){const e=i[0].name;let t=this.getTranslatedFrequency(e);e!==nt.BI_WEEKLY&&e!==nt.SEMI_ANNUALLY||(t=this.t("frequency.every","Every")),s.innerHTML=`<span style="text-transform:capitalize">${t}</span>`}else s&&i.length>1&&(s.innerHTML=`<span>${this.t("frequency.recurring","Recurring")}</span>`);const o=this.shadowRoot.querySelector("cl-toggle-group")?.shadowRoot?.querySelector('cl-custom-button[value="one-time"]');o&&(o.innerHTML=`<span>${this.getTranslatedFrequency(nt.ONE_TIME)}</span>`)}updateHeading(){const e=this.shadowRoot.querySelector(".heading-logo");if(e&&this.#o.headingLogoUrl){e.style.display="block";const t=e.querySelector("img");t&&(t.src=this.#o.headingLogoUrl)}else e&&(e.style.display="none")}updateSubmitButton(){const e=this.shadowRoot.querySelector(".submit-button");if(!e)return;e.textContent="";const t=this.getCustomAmount(),n=null!==this.#t||null!==t&&t>=this.#o.minimumDonationAmount;e.disabled=!n;const s=document.createElement("span");if(n)if(this.#r&&this.#r!==nt.ONE_TIME){const e=this.#r,t=this.getTranslatedFrequency(e).toLowerCase(),n=`${this.t("donate","Donate")} ${t}`;s.textContent=this.t(`donate-frequency.${e}`,n)}else s.textContent=this.t("donate","Donate");else s.textContent=this.t("choose-amount","Choose an amount");e.appendChild(s)}updateFaqHyperlink(){const e=this.shadowRoot?.querySelector(".faq-hyperlink-container");if(!e)return;if(this.#o.hideFaqSection)return void(e.style.display="none");e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center";const t=e.querySelector("cl-hyperlink");if(t&&e.removeChild(t),this.#o.hyperlink?.isEnabled&&this.#o.hyperlink.url&&this.#o.hyperlink.text){const t=document.createElement("cl-hyperlink");t.setAttribute("href",this.#o.hyperlink.url),t.setAttribute("text",this.#o.hyperlink.text),e.appendChild(t)}}render(){this.shadowRoot.innerHTML='\n      <style>\n        .donation-form-container {\n  /* Reset all CSS coming from the parent DOM */\n  all: initial;\n\n  box-sizing: border-box;\n  padding: 24px;\n  display: flex;\n  flex-direction: column;\n  max-width: 700px;\n  min-width: 235px;\n  width: 100%;\n  background: var(--classy-custom-background-color, #fff);\n  border-radius: var(--classy-custom-border-radius, 0);\n  /* Apply form border radius */\n  box-shadow: var(--classy-custom-drop-shadow, none);\n  /* Drop shadow only here */\n  font-family: var(--classy-font__font-family--base);\n}\n\n.heading,\n.sub-heading,\n.submit-button {\n  font-family: var(--classy-font__font-family--base);\n}\n\n.heading {\n  line-height: var(--classy-font__heading-xs--line-height);\n  font-weight: var(--classy-font__heading-xs--font-weight);\n  font-size: var(--classy-font__heading-xs--font-size);\n  text-align: center;\n}\n\n.heading-logo {\n  text-align: center;\n  padding: 20px 24px 20px 24px;\n}\n\n.sub-heading,\nlabel {\n  font-size: var(--classy-font__paragraph-md--font-size);\n  line-height: var(--classy-font__paragraph-md--line-height);\n  font-weight: var(--classy-font__paragraph-md--font-weight);\n  text-decoration-skip-ink: none;\n  text-underline-position: from-font;\n  text-align: center;\n  margin: 24px 0;\n}\n\n.sub-heading #selected-frequency {\n  font-size: var(--classy-font__paragraph-md-bold-font-size);\n  line-height: var(--classy-font__paragraph-md-bold-line-height);\n  font-weight: var(--classy-font__paragraph-md-bold--font-weight);\n  text-decoration-skip-ink: none;\n  text-underline-position: from-font;\n}\n\n.amount-selector-container {\n  display: grid;\n  gap: 4px;\n  margin-bottom: 64px;\n  flex-grow: 1;\n  /* Make this container take up remaining space */\n}\n\n.submit-button-container {\n  display: flex;\n  align-items: flex-end;\n  /* Ensure the button container stays at the bottom */\n  flex-shrink: 0;\n  /* Prevent the button container from shrinking */\n}\n\n.submit-button::part(button),\n.submit-button {\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-font__paragraph-lg-bold--font-size);\n  line-height: var(--classy-font__paragraph-lg-bold--line-height);\n  font-weight: var(--classy-font__paragraph-lg-bold--font-weight);\n  background-color: var(--classy-custom-cta-button-color);\n  border-radius: var(--classy-custom-cta-radius);\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;
5\n  cursor: pointer;\n  border: none;\n  transition: all 0.24s cubic-bezier(0.645, 0.045, 0.355, 1);\n  width: 100%;\n  min-height: 64px;\n  text-decoration-skip-ink: none;\n  text-underline-position: from-font;\n}\n\n.submit-button > span:first-of-type {\n  font-family: var(--classy-font__font-family--base);\n  font-size: var(--classy-font__paragraph-lg-bold--font-size);\n  line-height: var(--classy-font__paragraph-lg-bold--line-height);\n  font-weight: var(--classy-font__paragraph-lg-bold--font-weight);\n}\n\n.submit-button span {\n  color: #ffffff;\n  display: block;\n}\n\n.submit-button-container > cl-custom-button::part(button) {\n  display: block;\n}\n\n.recurring-freq-end-date-container {\n  display: flex;\n  gap: 4px;\n}\n\n.recurring-freq-end-date-container div {\n  flex: 1 0 49%;\n}\n\ncl-amount-selector {\n  height: fit-content;\n}\n\n.faq-hyperlink-container {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  margin-top: 24px;\n}\n\n      </style>\n\n      <form class="donation-form-container">\n  <div class="heading"></div>\n  <div class="heading-logo">\n    <img src="" height="44" />\n  </div>\n\n  <cl-toggle-group id="frequency-toggle"></cl-toggle-group>\n\n  <div class="sub-heading">\n    <span id="sub-heading-title"></span>\n    <span id="selected-frequency"></span>\n  </div>\n\n  <div class="recurring-freq-end-date-container">\n    <div id="recurring-frequency-container">\n      <label id="recurring-frequency-select-label"></label>\n      <cl-select id="recurring-frequency-select"></cl-select>\n    </div>\n\n    <div id="recurring-end-date-container">\n      <label id="recurring-end-date-input-label"></label>\n      <cl-custom-input id="recurring-end-date" data-id="recurring-end-date" type="date" />\n    </div>\n  </div>\n\n  <div class="amount-selector-container">\n    <cl-amount-selector id="amount-selector"></cl-amount-selector>\n  </div>\n\n  <div class="submit-button-container">\n    <cl-custom-button class="submit-button">
5\n      <span id="donate-amount-text"></span>\n    </cl-custom-button>\n  </div>\n\n  \x3c!-- container for FAQ + hyperlink --\x3e\n  <div class="faq-hyperlink-container">\n    <cl-faq-drawer-opener></cl-faq-drawer-opener>\n  </div>\n</form>\n\n    '}})})()},5049:()=>{(()=>{"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}var t=/^\s+/,n=/\s+$/;function s(i,o){if(o=o||{},(i=i||"")instanceof s)return i;if(!(this instanceof s))return new s(i,o);var a=function(s){var i,o,a,r={r:0,g:0,b:0},l=1,c=null,d=null,u=null,h=!1,p=!1;return"string"==typeof s&&(s=function(e){e=e.replace(t,"").replace(n,"").toLowerCase();var s,i=!1;if(_[e])e=_[e],i=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(s=L.rgb.exec(e))?{r:s[1],g:s[2],b:s[3]}:(s=L.rgba.exec(e))?{r:s[1],g:s[2],b:s[3],a:s[4]}:(s=L.hsl.exec(e))?{h:s[1],s:s[2],l:s[3]}:(s=L.hsla.exec(e))?{h:s[1],s:s[2],l:s[3],a:s[4]}:(s=L.hsv.exec(e))?{h:s[1],s:s[2],v:s[3]}:(s=L.hsva.exec(e))?{h:s[1],s:s[2],v:s[3],a:s[4]}:(s=L.hex8.exec(e))?{r:C(s[1]),g:C(s[2]),b:C(s[3]),a:R(s[4]),format:i?"name":"hex8"}:(s=L.hex6.exec(e))?{r:C(s[1]),g:C(s[2]),b:C(s[3]),format:i?"name":"hex"}:(s=L.hex4.exec(e))?{r:C(s[1]+""+s[1]),g:C(s[2]+""+s[2]),b:C(s[3]+""+s[3]),a:R(s[4]+""+s[4]),format:i?"name":"hex8"}:!!(s=L.hex3.exec(e))&&{r:C(s[1]+""+s[1]),g:C(s[2]+""+s[2]),b:C(s[3]+""+s[3]),format:i?"name":"hex"}}(s)),"object"==e(s)&&(T(s.r)&&T(s.g)&&T(s.b)?(i=s.r,o=s.g,a=s.b,r={r:255*w(i,255),g:255*w(o,255),b:255*w(a,255)},h=!0,p="%"===String(s.r).substr(-1)?"prgb":"rgb"):T(s.h)&&T(s.s)&&T(s.v)?(c=I(s.s),d=I(s.v),r=function(e,t,n){e=6*w(e,360),t=w(t,100),n=w(n,100);var s=Math.floor(e),i=e-s,o=n*(1-t),a=n*(1-i*t),r=n*(1-(1-i)*t),l=s%6;return{r:255*[n,a,o,o,r,n][l],g:255*[r,n,n,a,o,o][l],b:255*[o,o,r,n,n,a][l]}}(s.h,c,d),h=!0,p="hsv"):T(s.h)&&T(s.s)&&T(s.l)&&(c=I(s.s),u=I(s.l),r=function(e,t,n){var s,i,o;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=w(e,360),t=w(t,100),n=w(n,100),0===t)s=i=o=n;else{var r=n<.5?n*(1+t):n+t-n*t,l=2*n-r;s=a(l,r,e+1/3),i=a(l,r,e),o=a(l,r,e-1/3)}return{r:255*s,g:255*i,b:255*o}}(s.h,c,u),h=!0,p="hsl"),s.hasOwnProperty("a")&&(l=s.a)),l=E(l),{ok:h,format:s.format||p,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:l}}(i);this._originalInput=i,this._r=a.r,this._g=a.g,this._b=a.b,this._a=a.a,this._roundA=Math.round(100*this._a)/100,this._format=o.format||a.format,this._gradientType=o.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=a.ok}function i(e,t,n){e=w(e,255),t=w(t,255),n=w(n,255);var s,i,o=Math.max(e,t,n),a=Math.min(e,t,n),r=(o+a)/2;if(o==a)s=i=0;else{var l=o-a;switch(i=r>.5?l/(2-o-a):l/(o+a),o){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4}s/=6}return{h:s,s:i,l:r}}function o(e,t,n){e=w(e,255),t=w(t,255),n=w(n,255);var s,i,o=Math.max(e,t,n),a=Math.min(e,t,n),r=o,l=o-a;if(i=0===o?0:l/o,o==a)s=0;else{switch(o){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4}s/=6}return{h:s,s:i,v:r}}function a(e,t,n,s){var i=[x(Math.round(e).toString(16)),x(Math.round(t).toString(16)),x(Math.round(n).toString(16))];return s&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function r(e,t,n,s){return[x(k(s)),x(Math.round(e).toString(16)),x(Math.round(t).toString(16)),x(Math.round(n).toString(16))].join("")}function l(e,t){t=0===t?0:t||10;var n=s(e).toHsl();return n.s-=t/100,n.s=S(n.s),s(n)}function c(e,t){t=0===t?0:t||10;var n=s(e).toHsl();return n.s+=t/100,n.s=S(n.s),s(n)}function d(e){return s(e).desaturate(100)}function u(e,t){t=0===t?0:t||10;var n=s(e).toHsl();return n.l+=t/100,n.l=S(n.l),s(n)}function h(e,t){t=0===t?0:t||10;var n=s(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),s(n)}function p(e,t){t=0===t?0:t||10;var n=s(e).toHsl();return n.l-=t/100,n.l=S(n.l),s(n)}function g(e,t){var n=s(e).toHsl(),i=(n.h+t)%360;return n.h=i<0?360+i:i,s(n)}function f(e){var t=s(e).toHsl();return t.h=(t.h+180)%360,s(t)}function m(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=s(e).toHsl(),i=[s(e)],o=360/t,a=1;a<t;a++)i.push(s({h:(n.h+a*o)%360,s:n.s,l:n.l}));return i}function y(e){var t=s(e).toHsl(),n=t.h;return[s(e),s({h:(n+72)%360,s:t.s,l:t.l}),s({h:(n+216)%360,s:t.s,l:t.l})]}function b(e,t,n){t=t||6,n=n||30;var i=s(e).toHsl(),o=360/n,a=[s(e)];for(i.h=(i.h-(o*t>>1)+720)%360;--t;)i.h=(i.h+o)%360,a.push(s(i));return a}function v(e,t){t=t||6;for(var n=s(e).toHsv(),i=n.h,o=n.s,a=n.v,r=[],l=1/t;t--;)r.push(s({h:i,s:o,v:a})),a=(a+l)%1;return r}s.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,s=this.toRgb();return e=s.r/255,t=s.g/255,n=s.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=E(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=o(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=o(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+s+"%)":"hsva("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var e=i(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=i(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),s=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return a(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,s,i){var o=[x(Math.round(e).toString(16)),x(Math.round(t).toString(16)),x(Math.round(n).toString(16)),x(k(s))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*w(this._r,255))+"%",g:Math.round(100*w(this._g,255))+"%",b:Math.round(100*w(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*w(this._r,255))+"%, "+Math.round(100*w(this._g,255))+"%, "+Math.round(100*w(this._b,255))+"%)":"rgba("+Math.round(100*w(this._r,255))+"%, "+Math.round(100*w(this._g,255))+"%, "+Math.round(100*w(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(A[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+r(this._r,this._g,this._b,this._a),n=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var o=s(e);n="#"+r(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,s=this._a<1&&this._a>=0;return t||!s||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"
vendor: 4,230 bytes, line 5
5===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return s(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(u,arguments)},brighten:function(){return this._applyModification(h,arguments)},darken:function(){return this._applyModification(p,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(c,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(g,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(b,arguments)},complement:function(){return this._applyCombination(f,arguments)},monochromatic:function(){return this._applyCombination(v,arguments)},splitcomplement:function(){return this._applyCombination(y,arguments)},triad:function(){return this._applyCombination(m,[3])},tetrad:function(){return this._applyCombination(m,[4])}},s.fromRatio=function(t,n){if("object"==e(t)){var i={};for(var o in t)t.hasOwnProperty(o)&&(i[o]="a"===o?t[o]:I(t[o]));t=i}return s(t,n)},s.equals=function(e,t){return!(!e||!t)&&s(e).toRgbString()==s(t).toRgbString()},s.random=function(){return s.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},s.mix=function(e,t,n){n=0===n?0:n||50;var i=s(e).toRgb(),o=s(t).toRgb(),a=n/100;return s({r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a})},s.readability=function(e,t){var n=s(e),i=s(t);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},s.isReadable=function(e,t,n){var i,o,a,r,l,c=s.readability(e,t);switch(o=!1,(a=n,"AA"!==(r=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==r&&(r="AA"),"small"!==(l=(a.size||"small").toLowerCase())&&"large"!==l&&(l="small"),i={level:r,size:l}).level+i.size){case"AAsmall":case"AAAlarge":o=c>=4.5;break;case"AAlarge":o=c>=3;break;case"AAAsmall":o=c>=7}return o},s.mostReadable=function(e,t,n){var i,o,a,r,l=null,c=0;o=(n=n||{}).includeFallbackColors,a=n.level,r=n.size;for(var d=0;d<t.length;d++)(i=s.readability(e,t[d]))>c&&(c=i,l=s(t[d]));return s.isReadable(e,l,{level:a,size:r})||!o?l:(n.includeFallbackColors=!1,s.mostReadable(e,["#fff","#000"],n))};var _=s.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
50",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},A=s.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(_);function E(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function w(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function S(e){return Math.min(1,Math.max(0,e))}function C(e){return parseInt(e,16)}function x(e){return 1==e.length?"0"+e:""+e}function I(e){return e<=1&&(e=100*e+"%"),e}function k(e){return Math.round(255*parseFloat(e)).toString(16)}function R(e){return C(e)/255}var O,D,P,L=(D="[\\s|\\(]+("+(O="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+O+")[,|\\s]+("+O+")\\s*\\)?",P="[\\s|\\(]+("+O+")[,|\\s]+("+O+")[,|\\s]+("+O+")[,|\\s]+("+O+")\\s*\\)?",{CSS_UNIT:new RegExp(O),rgb:new RegExp("rgb"+D),rgba:new RegExp("rgba"+P),hsl:new RegExp("hsl"+D),hsla:new RegExp("hsla"+P),hsv:new RegExp("hsv"+D),hsva:new RegExp("hsva"
5+P),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function T(e){return!!L.CSS_UNIT.exec(e)}const M=JSON.parse('{"nudge-tray-content":"Finish your donation to create an impact today.","nudge-tray-cta":"Give Now","nudge-tray-title":"Make a difference!"}'),N=JSON.parse('{"nudge-tray-content":"Finaliza tu donación para crear un impacto hoy.","nudge-tray-cta":"Dona ahora","nudge-tray-title":"¡Haz la diferencia!"}');class F extends HTMLElement{constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"})}updateStyles(e){return Object.keys(e).map((t=>{const{cssVar:n,defaultValue:s}=e[t];return`${n}: ${this.getAttribute(t)||s};`})).join(" ")}}const{slice:q,forEach:j}=[],$=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,G={create(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+60*n*1e3)),s&&(i.domain=s),document.cookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!$.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!$.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invali
5d");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s}(e,encodeURIComponent(t),i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let s=n[e];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return s.substring(t.length,s.length)}return null},remove(e){this.create(e,"",-1)}};var H={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return G.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:s,cookieDomain:i,cookieOptions:o}=t;n&&"undefined"!=typeof document&&G.create(n,e,s,i,o)}},U={name:"querystring",lookup(e){let t,{lookupQuerystring:n}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const s=e.substring(1).split("&");for(let e=0;e<s.length;e++){const i=s[e].indexOf("=");i>0&&s[e].substring(0,i)===n&&(t=s[e].substring(i+1))}}return t}};let V=null;const z=()=>{if(null!==V)return V;try{if(V="undefined"!=typeof window&&null!==window.localStorage,!V)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){V=!1}return V};var B={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&z())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&z()&&window.localStorage.setItem(n,e)}};let K=null;const Y=()=>{if(null!==K)return K;try{if(K="undefined"!=typeof window&&null!==window.sessionStorage,!K)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){K=!1}return K};var W={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Y())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Y()&&window.sessionStorage.setItem(n,e)}},Q={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:s}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),s&&t.push(s)}return t.length>0?t:void 0}},J={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const s=n||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(t=s.getAttribute("lang")),t}},Z={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(n))return;const s="number"==typeof t?t:0;return n[s]?.replace("/","")}},X={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"==typeof t?t+1:1,s="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[n]}};let ee=!1;try{document.cookie,ee=!0}catch(e){}const te=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];ee||te.splice(1,1);class ne{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return j.call(q.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:te,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(H),this.addDetector(U),this.addDetector(B),this.addDetector(W),this.addDetector(Q),this.addDetector(J),this.addDetector(Z),this.addDetector(X)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>
vendor: 4,386 bytes, line 5
50&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return e.forEach((e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}})),t=t.map((e=>this.options.convertDetectedLanguage(e))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)})))}}ne.type="languageDetector";const se=e=>"string"==typeof e,ie=()=>{let e,t;const n=new Promise(((n,s)=>{e=n,t=s}));return n.resolve=e,n.reject=t,n},oe=e=>null==e?"":""+e,ae=/###/g,re=e=>e&&e.indexOf("###")>-1?e.replace(ae,"."):e,le=e=>!e||se(e),ce=(e,t,n)=>{const s=se(t)?t.split("."):t;let i=0;for(;i<s.length-1;){if(le(e))return{};const t=re(s[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return le(e)?{}:{obj:e,k:re(s[i])}},de=(e,t,n)=>{const{obj:s,k:i}=ce(e,t,Object);if(void 0!==s||1===t.length)return void(s[i]=n);let o=t[t.length-1],a=t.slice(0,t.length-1),r=ce(e,a,Object);for(;void 0===r.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),r=ce(e,a,Object),r?.obj&&void 0!==r.obj[`${r.k}.${o}`]&&(r.obj=void 0);r.obj[`${r.k}.${o}`]=n},ue=(e,t)=>{const{obj:n,k:s}=ce(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},he=(e,t,n)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?se(e[s])||e[s]instanceof String||se(t[s])||t[s]instanceof String?n&&(e[s]=t[s]):he(e[s],t[s],n):e[s]=t[s]);return e},pe=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const fe=e=>se(e)?e.replace(/[&<>"'\/]/g,(e=>ge[e])):e,me=[" ",",","?","!",";"],ye=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),be=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const s=t.split(n);let i=e;for(let e=0;e<s.length;){if(!i||"object"!=typeof i)return;let t,o="";for(let a=e;a<s.length;++a)if(a!==e&&(o+=n),o+=s[a],t=i[o],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<s.length-1)continue;e+=a-e+1;break}i=t}return i},ve=e=>e?.replace("_","-"),_e={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Ae{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||_e,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(se(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ae(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Ae(this.logger,e)}}var Ee=new Ae;class we{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEac
vendor: 2,996 bytes, line 5
5h((e=>{let[t,s]=e;for(let e=0;e<s;e++)t(...n)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((t=>{let[s,i]=t;for(let t=0;t<i;t++)s.apply(s,[e,...n])}))}}class Se extends we{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,o=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):se(n)&&i?a.push(...n.split(i)):a.push(n)));const r=ue(this.data,a);return!r&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!r&&o&&se(n)?be(this.data?.[e]?.[t],n,i):r}addResource(e,t,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),s=t,t=a[1]),this.addNamespaces(t),de(this.data,a,s),i.silent||this.emit("added",e,t,n,s)}addResources(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const s in n)(se(n[s])||Array.isArray(n[s]))&&this.addResource(e,t,s,n[s],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),s=n,n=t,t=a[1]),this.addNamespaces(t);let r=ue(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?he(r,n,i):r={...r,...n},de(this.data,a,r),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var Ce={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,s,i){return e.forEach((e=>{t=this.processors[e]?.process(t,n,s,i)??t})),t}};const xe={},Ie=e=>!se(e)&&"boolean"!=typeof e&&"number"!=typeof e;class ke extends we{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,s;super(),n=e,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
5i18nFormat","utils"].forEach((e=>{n[e]&&(s[e]=n[e])})),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Ee.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return void 0!==n?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const s=me.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===s.length)return!0;const i=ye.getRegExp(`(${s.map((e=>"?"===e?"\\?":e)).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,s));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:se(i)?[i]:i};const o=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(s)}return{key:e,namespaces:se(i)?[i]:i}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const s=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),r=a[a.length-1],l=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===l?.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return s?{res:`${r}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:r,usedParams:this.getUsedParamsDetails(t)}:`${r}${e}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:r,usedParams:this.getUsedParamsDetails(t)}:o}const d=this.resolve(e,t);let u=d?.res;const h=d?.usedKey||o,p=d?.exactUsedKey||o,g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,f=!this.i18nFormat||this.i18nFormat.handleAsObject,m=void 0!==t.count&&!se(t.count),y=ke.hasDefaultValue(t),b=m?this.pluralResolver.getSuffix(l,t.count,t):"",v=t.ordinal&&m?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",_=m&&!t.ordinal&&0===t.count,A=_&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${b}`]||t[`defaultValue${v}`]||t.defaultValue;let E=u;f&&!u&&y&&(E=A);const w=Ie(E),S=Object.prototype.toString.apply(E);if(!(f&&E&&w&&["[object Number]","[object Function]","[object RegExp]"].indexOf(S)<0)||se(g)&&Array.isArray(E))if(f&&se(g)&&Array.isArray(u))u=u.join(g),u&&(u=this.extendTranslation(u,e,t,n));else{let s=!1,a=!1;!this.isValidLookup(u)&&y&&(s=!0,u=A),this.isValidLookup(u)||(a=!0,u=o);const c=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:u,h=y&&A!==u&&this.options.updateMissing;if(a||s||h){if(this.logger.log(h?"updateKey":"missingKey",l,r,o,h?A:u),i){const e=this.resolve(o,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const s=(e,n,s)=>{const i=y&&s!==u?s:c;this.options.missingKeyHandler?this.options.missingKeyHandler(e,r,n,i,h,t):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,r,n,i,h,t),this.emit("missingKey",e,r,n,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&m?e.forEach((e=>{const n=this.pluralResolver.getSuffixes(e,t);_&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}
5zero`),n.forEach((n=>{s([e],o+n,t[`defaultValue${n}`]||A)}))})):s(e,o,A))}u=this.extendTranslation(u,e,t,d,n),a&&u===o&&this.options.appendNamespaceToMissingKey&&(u=`${r}:${o}`),(a||s)&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${r}:${o}`:o,s?u:void 0))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...t,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(d.res=e,d.usedParams=this.getUsedParamsDetails(t),d):e}if(i){const e=Array.isArray(E),n=e?[]:{},s=e?p:h;for(const e in E)if(Object.prototype.hasOwnProperty.call(E,e)){const o=`${s}${i}${e}`;n[e]=y&&!u?this.translate(o,{...t,defaultValue:Ie(A)?A[e]:void 0,joinArrays:!1,ns:a}):this.translate(o,{...t,joinArrays:!1,ns:a}),n[e]===o&&(n[e]=E[e])}u=n}}return s?(d.res=u,d.usedParams=this.getUsedParamsDetails(t),d):u}extendTranslation(e,t,n,s,i){var o=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a=se(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(a){const t=e.match(this.interpolator.nestingRegexp);r=t&&t.length}let l=n.replace&&!se(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||s.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);r<(t&&t.length)&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,s=new Array(e),a=0;a<e;a++)s[a]=arguments[a];return i?.[0]!==s[0]||n.context?o.translate(...s,t):(o.logger.warn(`It seems you are nesting recursively key: ${s[0]} in key: ${t[0]}`),null)}),n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,r=se(a)?[a]:a;return null!=e&&r?.length&&!1!==n.applyPostProcessor&&(e=Ce.handle(r,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,s,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return se(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const r=this.extractFromKey(e,a),l=r.key;n=l;let c=r.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==a.count&&!se(a.count),u=d&&!a.ordinal&&0===a.count,h=void 0!==a.context&&(se(a.context)||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);
vendor: 4,643 bytes, line 5
5c.forEach((e=>{this.isValidLookup(t)||(o=e,xe[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(xe[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((n=>{if(this.isValidLookup(t))return;i=n;const o=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,n,e,a);else{let e;d&&(e=this.pluralResolver.getSuffix(n,a.count,a));const t=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(o.push(l+e),a.ordinal&&0===e.indexOf(s)&&o.push(l+e.replace(s,this.options.pluralSeparator)),u&&o.push(l+t)),h){const n=`${l}${this.options.contextSeparator}${a.context}`;o.push(n),d&&(o.push(n+e),a.ordinal&&0===e.indexOf(s)&&o.push(n+e.replace(s,this.options.pluralSeparator)),u&&o.push(n+t))}}let r;for(;r=o.pop();)this.isValidLookup(t)||(s=r,t=this.getResource(n,e,r,a))})))}))})),{res:t,usedKey:n,exactUsedKey:s,usedLng:i,usedNS:o}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!se(e.replace);let s=n?e.replace:e;if(n&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const e of t)delete s[e]}return s}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class Re{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ee.create("languageUtils")}getScriptPartFromCode(e){if(!(e=ve(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=ve(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(se(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),se(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],i=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return se(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):se(e)&&i(this.formatLanguageCode(e)),n.forEac
vendor: 4,344 bytes, line 5
5h((e=>{s.indexOf(e)<0&&i(this.formatLanguageCode(e))})),s}}const Oe={zero:0,one:1,two:2,few:3,many:4,other:5},De={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Pe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Ee.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=ve("dev"===e?"en":e),s=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:s})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),De;if(!e.match(/-|_/))return De;const s=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(s,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>Oe[e]-Oe[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Le=function(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=((e,t,n)=>{const s=ue(e,n);return void 0!==s?s:ue(t,n)})(e,t,n);return!o&&i&&se(n)&&(o=be(e,n,s),void 0===o&&(o=be(t,n,s))),o},Te=e=>e.replace(/\$/g,"$$$$");class Me{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Ee.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:r,formatSeparator:l,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:fe,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==s&&s,this.prefix=i?pe(i):o||"{{",this.suffix=a?pe(a):r||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?pe(u):h||pe("$t("),this.nestingSuffix=p?pe(p):g||pe(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){let i,o,a;const r=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=Le(t,r,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...s,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(Le(t,r,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...s,...t,interpolationkey:o})};this.resetRegExp();const c=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=void 0!==s?.interpolation?.ski
vendor: 4,131 bytes, line 5
5pOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Te(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Te(this.escape(e)):Te(e)}].forEach((t=>{for(a=0;i=t.regex.exec(e);){const n=i[1].trim();if(o=l(n),void 0===o)if("function"==typeof c){const t=c(e,i,s);o=se(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,n))o="";else{if(d){o=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o=""}else se(o)||this.useRawValueToEscape||(o=oe(o));const r=t.safeValue(o);if(e=e.replace(i[0],r),d?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),e}nest(e,t){let n,s,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const s=e.split(new RegExp(`${n}[ ]*{`));let o=`{${s[1]}`;e=s[0],o=this.interpolate(o,i);const a=o.match(/'/g),r=o.match(/"/g);((a?.length??0)%2==0&&!r||r.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let r=[];i={...o},i=i.replace&&!se(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),r=e,l=!0}if(s=t(a.call(this,n[1].trim(),i),i),s&&n[0]===e&&!se(s))return s;se(s)||(s=oe(s)),s||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),s=""),l&&(s=r.reduce(((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:n[1].trim()})),s.trim())),e=e.replace(n[0],s),this.regexp.lastIndex=0}return e}}const Ne=e=>{const t={};return(n,s,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=s+JSON.stringify(o);let r=t[a];return r||(r=e(ve(s),i),t[a]=r),r(n)}};class Fe{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Ee.create("formatter"),this.options=e,this.formats={number:Ne(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:Ne(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:Ne(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:Ne(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:Ne(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Ne(t)}format(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find((e=>e.indexOf(")")>-1))){const e=i.findIndex((e=>e.indexOf(")")>-1));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce(((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((e=>{if(e){const[t,...s]=e.split(":"),i=s.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=i),"false"===i&&(n[o]=!1),"true"===i&&(n[o]=!0),isNaN(i)||(n[o]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const a=s?.formatParams?.[s.interpolationkey]||{},r=a.locale||a.lng||s.locale||s.lng||n;t=this.formats[i](e,r,{...o,...s,...a}
vendor: 5,320 bytes, line 5
5)}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e)}}class qe extends we{constructor(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=Ee.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,s.backend,s)}queueLoad(e,t,n,s){const i={},o={},a={},r={};return e.forEach((e=>{let s=!0;t.forEach((t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,s=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===r[t]&&(r[t]=!0)))})),s||(a[e]=!0)})),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(r)}}loaded(e,t,n){const s=e.split("|"),i=s[0],o=s[1];t&&this.emit("failedLoading",i,o,t),!t&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:s,k:i}=ce(e,t,Object);s[i]=s[i]||[],s[i].push(n)})(n.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:i,callback:o});this.readingCalls++;const a=(a,r)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&r&&s<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,n,s+1,2*i,o)}),i):o(a,r)},r=this.backend[n].bind(this.backend);if(2!==r.length)return r(e,t,a);try{const n=r(e,t);n&&"function"==typeof n.then?n.then((e=>a(null,e))).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();se(e)&&(e=this.languageUtils.toResolveHierarchy(e)),se(t)&&(t=[t]);const i=this.queueLoad(e,t,n,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),s=n[0],i=n[1];this.read(s,i,"read",void 0,void 0,((n,o)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${s} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${s}`,o),this.loaded(e,n,o)}))}saveMissing(e,t,n,s,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const r={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,n,s,r):l(e,t,n,s),i&&"function"==typeof i.then?i.then((e=>a(null,e))).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,n,s,a,r)}e&&e[0]&&this.store.addResource(e[0],t,n,s)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const je=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),se(e[1])&&(t.defaultValue=e[1]),se(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];
vendor: 4,172 bytes, line 5
5Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),$e=e=>(se(e.ns)&&(e.ns=[e.ns]),se(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),se(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),Ge=()=>{};class He extends we{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=$e(e),this.services={},this.logger=Ee,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),null==t.defaultNS&&t.ns&&(se(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=je();this.options={...s,...this.options,...$e(t)},this.options.interpolation={...s.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?Ee.init(i(this.modules.logger),this.options):Ee.init(null,this.options),t=this.modules.formatter?this.modules.formatter:Fe;const n=new Re(this.options);this.store=new Se(this.options.resources,this.options);const o=this.services;o.logger=Ee,o.resourceStore=this.store,o.languageUtils=n,o.pluralResolver=new Pe(n,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format||(o.formatter=i(t),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new Me(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new qe(i(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];e.emit(t,...s)})),this.modules.languageDetector&&(o.languageDetector=i(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=i(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new ke(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];e.emit(t,...s)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=Ge),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const o=ie(),a=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit
vendor: 4,357 bytes, line 5
5("initialized",this.options),o.resolve(t),n(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),o}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ge;const n=se(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],s=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};n?s(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>s(e))),this.options.preload?.forEach?.((e=>s(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const s=ie();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ge),this.services.backendConnector.reload(e,t,(e=>{s.resolve(),n(e)})),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Ce.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const s=ie();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(e,o)=>{o?(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,s.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=se(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(e=>{o(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),s}getFixedT(e,t,n){var s=this;const i=function(e,t){let o;if("object"!=typeof t){for(var a=arguments.length,r=new Array(a>2?a-2:0),l=2;l<a;l++)r[l-2]=arguments[l];o=s.options.overloadTranslationOptionHandler([e,t].concat(r))}else o={...t};o.lng=o.lng||i.lng,o.lngs=o.lngs||i.lngs,o.ns=o.ns||i.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||i.keyPrefix);const c=s.options.keySeparator||".";let d;return d=o.keyPrefix&&Array.isArray(e)?e.map((e=>`${o.keyPrefix}${c}${e}`)):o.keyPrefix?`${o.keyPrefix}${c}${e}`:e,s.t(d,o)};return se(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.translate(...t)}exists(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.translator?.exists(...t)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
5if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!(!this.hasResourceBundle(n,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(n,e)||s&&!o(i,e)))}loadNamespaces(e,t){const n=ie();return this.options.ns?(se(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=ie();se(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter((e=>s.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return i.length?(this.options.preload=s.concat(i),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services?.languageUtils||new Re(je());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new He(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ge;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new He(s);if(void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]={...this.store.data[t]},Object.keys(e[t]).reduce(((n,s)=>(n[s]={...e[t][s]},n)),{}))),{});i.store=new Se(e,s),i.services.resourceStore=i.store}return i.translator=new ke(i.services,s),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];i.emit(e,...n)})),i.init(s,t),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ue=He.createInstance();Ue.createInstance=He.createInstance,Ue.createInstance,Ue.dir,Ue.init,Ue.loadResources,Ue.reloadResources,Ue.use,Ue.changeLanguage,Ue.getFixedT,Ue.t,Ue.exists,Ue.setDefaultNamespace,Ue.hasLoadedNamespace,Ue.loadNamespaces,Ue.loadLanguages;const Ve={defaultNS:"common",fallbackLng:["en"],initAsync:!1,interpolation:{escapeValue:!1},ns:["common"]};class ze{i18n=(()=>Ue.createInstance())();loadedNamespaces=(()=>new Set)();constructor(){this.i18n.use(ne),this.i18n.init({...Ve,detection:{order:["cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"]}})}static getInstance(){return ze.instance||(ze.instance=new ze),ze.instance}addNamespaceResources(e,t){this.loadedNamespaces.has(e)||(Object.keys(t).forEach((n=>{this.i18n.addResourceBundle(n,e,t[n],!0,!0)})),this.loadedNamespaces.add(e))}translate(e,t){return this.i18n.t(e,t)}getLanguage(){return this.i18n.language}}class Be extends F{loadI18nResources(e,t){this.namespace=e,ze.getInstance().addNamespaceResources(e,t)}t(e,t,n){if(!this.namespace&&!n?.ns)throw new Error("Namespace is not set. Call `this.loadI18nResources()` with a namespace first, or provide a namespace in the options parameter.");return ze.getInstance().translate(e,{ns:this.namespace||n.ns,defaultValue:t,...n??{}})}getLanguage(){return ze.getInstance().getLanguage()}}const Ke="title",Ye="content",We="open",Qe="cta-label",Je="brand-color";class Ze extends Be{static observedAttributes=(()=>[Qe,Je,Ke,Ye,We])();constructor(){super(),this.loadI18nResources("NudgeTray",{en:M,es:N})}connectedCallback(){this.shadowRoot||this.attachShadow({mode:"open"}),this.render(),this.bindEvents()}attributeChangedCallback(e,t,n){switch(e){case Qe:this.updateCtaLabel(n);break;case Je:this.updateCtaBG(n),this.updateIconColor(n);break;case Ke:this.updateTitle(n);break;case Ye:this.updateContent(n);break;case We:this.updateOpen(n)}}render(){this.shadowRoot&&(this.shadowRoot.innerHTML='\n<style>\n.nudge-tray {\n  gap: 16px;\n  padding: 16px;\n  display: flex;\n  align-items: center;\n  font-family: sans-serif;\n  border-radius: 8px;\n  position: fixed;\n  bottom: 16px;\n  left: 16px;\n  width: 340px;\n  max-width: calc(100% - 72px);\n  background-color: #ffffff;
5\n  color: rgba(0, 0, 0, 0.9);\n  z-index: 2147483644; /* 1 smaller than the modal  */\n  box-shadow: 0px 2px 4px 0px rgba(27, 27, 27, 0.1);\n  transition: transform 0.3s ease-in-out;\n  transform: translateX(-200%); /* hide the nudge tray by offsetting it to the right */\n}\n\n.nudge-tray.open {\n  transform: translateX(0); /* show the nudge by removing its right offset */\n}\n\n.nudge-tray--icon {\n  transition:\n    transform 0.3s ease-in-out,\n    opacity 0.3s ease-in-out;\n  animation: inReveal 0.5s ease-in-out;\n}\n\n@keyframes inReveal {\n  0% {\n    transform: scale(0.25);\n    opacity: 1;\n  }\n\n  50% {\n    transform: scale(1.25);\n    opacity: 1;\n  }\n\n  100% {\n    transform: scale(1);\n    opacity: 1;\n  }\n}\n\n.nudge-tray--icon svg {\n  vertical-align: bottom;\n}\n\n.nudge-tray--text {\n  flex: 1;\n}\n\n.nudge-tray--title {\n  margin: 0 0 4px;\n  font-size: 14px;\n  font-weight: bold;\n}\n\n.nudge-tray--content {\n  margin: 0;\n  font-size: 12px;\n}\n\n.nudge-tray .nudge-tray--cta {\n  cursor: pointer;\n  font-size: 14px;\n  font-weight: bold;\n  color: #ffffff;\n  padding: 8px 16px;\n  border-radius: 8px;\n  border-width: 0;\n  background-color: #425ccd;\n}\n\n.nudge-tray--close {\n  cursor: pointer;\n  top: -14px;\n  right: -14px;\n  border: none;\n  position: absolute;\n  width: 28px;\n  height: 28px;\n  border-radius: 28px;\n  line-height: 28px;\n  border-radius: 999px;\n  background-color: #ffffff;\n  color: #000000e6;\n  box-shadow: 0px 2px 4px 0px rgba(27, 27, 27, 0.1);\n}\n\n</style>\n\n<div class="nudge-tray" role="complementary">\n  <button class="nudge-tray--close" type="button" aria-label="close">\n    <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none">\n      <path\n        fill-rule="evenodd"\n        clip-rule="evenodd"\n        d="M5.00004 5.70714L8.70898 9.41609L9.41609 8.70898L5.70715 5.00004L9.41609 1.29109L8.70898 0.583984L5.00004 4.29293L1.29109 0.583984L0.583984 1.29109L4.29293 5.00004L0.583985 8.70898L1.29109 9.41609L5.00004 5.70714Z"\n        fill="#000000e6"\n      />\n    </svg>\n  </button>\n  <div class="nudge-tray--icon">\n    <svg\n      xmlns="http://www.w3.org/2000/svg"\n      xmlns:xlink="http://www.w3.org/1999/xlink"\n      viewBox="0 0 430 430"\n      width="48"\n      height="48"\n      preserveAspectRatio="xMidYMid meet"\n      style="\n        width: 100%;\n        height: auto;\n        transform: translate3d(0px, 0px, 0px);\n        content-visibility: visible;\n      "\n    >\n      <defs>\n        <clipPath id="__lottie_element_2">\n          <rect width="430" height="430" x="0" y="0"></rect>\n        </clipPath>\n        <clipPath id="__lottie_element_4"><path d="M0,0 L430,0 L430,430 L0,430z"></path></clipPath>\n      </defs>\n      <g clip-path="url(#__lottie_element_2)">\n        <g\n          clip-path="url(#__lottie_element_4)"\n          transform="matrix(1,0,0,1,0,0)"\n          opacity="1"\n          style="display: block"\n        >\n          <g transform="matrix(1,0,0,1,215,215)" opacity="1" style="display: block">\n            <g opacity="1" transform="matrix(1,0,0,1,0,0)">\n              <path\n                stroke-linecap="round"\n                stroke-linejoin="round"\n                fill-opacity="0"\n                class="secondary"\n                stroke="rgb(248,210,209)"\n                stroke-opacity="1"\n                stroke-width="14"\n                d=" M-142.60400390625,-123.28299713134766 C-180.1909942626953,-84.56600189208984 -174.6439971923828,-40.32699966430664 -135.97900390625,-1.7760000228881836 C-135.96200561523438,-1.7760000228881836 -129.0469970703125,5.383999824523926 -118.34200286865234,16.479000091552734"\n              ></path>\n            </g>\n          </g>\n          <g transform="matrix(1,0,0,1,215,215)" opacity="1" style="display: block">\n            <g opacity="1" transform="matrix(1,0,0,1,0,0)">\n              <path\n                stroke-linecap="round"\n                stroke-linejoin="round"\n                fill-opacity="0"\n                class="primary"\n                stroke="rgb(250,10,10)"\n                stroke-opacity="1"\n                stroke-width="14"\n                d=" M164.48916625976562,16.985082626342773 C187.0865936279297,-5.612349987030029 198.43740844726562,-35.25269317626953 198.43740844726562,-64.84539794921875 C198.43740844726562,-94.48474884033203 187.07566833496094,-124.11316680908203 164.48916625976562,-146.72250366210938 C145.20230102539062,-166.02822875976562 120.80171966552734,-177.09622192382812 95.64395141601562,-179.92648315429688 C61.846534729003906,-183.72828674316406 26.699493408203125,-172.6593017578125 0.78652423620224,-146.72250366210938 C0.78652423620224,-146.72250366210938 0.6475982666015625,-146.5835723876953 0.6475982666015625,-146.5835723876953 C0.6475982666015625,-146.5835723876953 0.5056822896003723,-146.72250366210938 0.5056822896003723,-146.72250366210938 C-22.091751098632812,-169.3199462890625 -51.732093811035156,-180.67076110839844 -81.32479858398438,-180.67076110839844 C-110.96414947509766,-180.67076110839844 -140.58859252929688,-169.3080291748047 -163.19793701171875,-146.72250366210938 C-208.4444122314453,-101.5226821899414 -208.4444122314453,-28.21474266052246 -163.19793701171875,16.985082626342773 C-163.19793701171875,16.985082626342773 -55.54985046386719,124.62936401367188 -55.501708984375,124.67822265625 C-55.426177978515625,124.75489807128906 0.516339123249054,180.69833374023438 0.6505793929100037,180.6980438232422 C0.7854218482971191,180.69773864746094 57.13397216796875,124.33794403076172 57.2140274
504785156,124.26512145996094 C57.28014373779297,124.20498657226562 164.48916625976562,16.985082626342773 164.48916625976562,16.985082626342773z"\n              ></path>\n            </g>\n          </g>\n        </g>\n      </g>\n    </svg>\n  </div>\n  <div class="nudge-tray--text">\n    <p class="nudge-tray--title"></p>\n    <p class="nudge-tray--content">\n    </p>\n  </div>\n  <button class="nudge-tray--cta" type="button"></button>\n</div>\n\n    ',this.updateOpen(this.getAttribute(We)),this.updateCtaLabel(this.getAttribute(Qe)),this.updateCtaBG(this.getAttribute(Je)),this.updateIconColor(this.getAttribute(Je)),this.updateTitle(this.getAttribute(Ke)),this.updateContent(this.getAttribute(Ye)))}updateOpen(e){const t=this.shadowRoot?.querySelector(".nudge-tray"),n=this.shadowRoot?.querySelector(".nudge-tray--close"),s=this.shadowRoot?.querySelector(".nudge-tray--cta"),i="true"===e;t&&(i?(t.classList.contains("open")||t.classList.add("open"),t.setAttribute("aria-hidden","false"),t.removeAttribute("inert")):(t.classList.remove("open"),t.setAttribute("aria-hidden","true"),t.setAttribute("inert",""))),i?(n?.removeAttribute("tabindex"),s?.removeAttribute("tabindex")):(n?.setAttribute("tabindex","-1"),s?.setAttribute("tabindex","-1"))}updateTitle(e){const t=this.shadowRoot?.querySelector(".nudge-tray--title");t&&(t.textContent=e||this.t("nudge-tray-title","Make a difference!"))}updateContent(e){const t=this.shadowRoot?.querySelector(".nudge-tray--content");t&&(t.textContent=e||this.t("nudge-tray-content","Finish your donation to create an impact today."))}updateCtaLabel(e){const t=this.shadowRoot?.querySelector(".nudge-tray--cta");t&&(t.textContent=e||this.t("nudge-tray-cta","Give Now"))}updateCtaBG(e){if(!e)return;const t=this.shadowRoot?.querySelector(".nudge-tray--cta");t&&(t.style.backgroundColor=e)}updateIconColor(e){if(!e)return;const t=this.shadowRoot?.querySelector(".nudge-tray--icon path.primary"),n=this.shadowRoot?.querySelector(".nudge-tray--icon path.secondary");t&&n&&(t.style.stroke=e,n.style.stroke=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return;const n=s(e).setAlpha(t);return n.isValid()?n.toRgbString():void 0}(e,.5))}bindEvents(){this.bindCtaEvent(),this.bindCloseEvent()}bindCtaEvent(){const e=this.shadowRoot?.querySelector(".nudge-tray--cta");e&&e.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("cl-nudge-tray--cta",{bubbles:!0,composed:!0}))}))}bindCloseEvent(){const e=this.shadowRoot?.querySelector(".nudge-tray--close");e&&e.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("cl-nudge-tray--close",{bubbles:!0,composed:!0}))}))}}customElements.get("cl-nudge-tray")||customElements.define("cl-nudge-tray",Ze)})()},9727:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var s=n(1354),i=n.n(s),o=n(6314),a=n.n(o)()(i());a.push([e.id,"/* @import url('@classy/design-tokens/dist/tokens.css'); */\n\n:root {\n  /* Default and Web Safe Fonts */\n  --classy-font__font-family--arial: Arial, sans-serif;\n  --classy-font__font-family--georgia: Georgia, serif;\n  --classy-font__font-family--impact: Impact, sans-serif;\n  --classy-font__font-family--tahoma: Tahoma, sans-serif;\n  --classy-font__font-family--times-new-roman: 'Times New Roman', serif;\n  --classy-font__font-family--verdana: Verdana, sans-serif;\n\n  /* Google Fonts */\n  --classy-font__font-family--domine: 'Domine', serif;\n  --classy-font__font-family--inter: 'Inter', sans-serif;\n  --classy-font__font-family--karla: 'Karla', sans-serif;\n  --classy-font__font-family--lato: 'Lato', sans-serif;\n  --classy-font__font-family--merriweather: 'Merriweather', serif;\n  --classy-font__font-family--montserrat: 'Montserrat', sans-serif;\n  --classy-font__font-family--open-sans: 'Open Sans', sans-serif;\n  --classy-font__font-family--oswald: 'Oswald', sans-serif;\n  --classy-font__font-family--poppins: 'Poppins', sans-serif;\n  --classy-font__font-family--pt-sans: 'PT Sans', sans-serif;\n  --classy-font__font-family--raleway: 'Raleway', sans-serif;\n  --classy-font__font-family--roboto: 'Roboto', sans-serif;\n  --classy-font__font-family--slabo-13px: 'Slabo 13px', serif;\n  --classy-font__font-family--slabo-27px: 'Slabo 27px', serif;\n  --classy-font__font-family--source-sans-3: 'Source Sans 3', sans-serif;\n\n  /* Theme Colors */\n  --classy-theme-color__brand-primary: #425ccd;\n  --classy-theme-color__brand-secondary: #e8ebf9;\n  --classy-theme-color__brand-tertiary: #303030;\n  --classy-theme-color__text-general: #2d2e31;\n  --classy-theme-color__background: #ffffff;\n  --classy-theme-color__background-accent: #f2f1ef;\n\n  /* Base Font Family */\n  --classy-font__font-family--base: system-ui, -apple-system, BlinkMacSystemFont, 'San Francisco',\n    'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;\n\n  /* Typography Variables */\n  --classy-font__label--font-size: 12px;\n  --classy-font__label--line-height: 1.5;\n  --classy-font__label--font-weight: 400;\n  --classy-font__label-bold--font-weight: 700;\n\n  --classy-font__paragraph-sm--font-size: 14px;\n  --classy-font__paragraph-sm--line-height: 1.5;\n  --classy-font__paragraph-sm--font-weight: 400;\n  --classy-font__paragraph-sm-bold--font-size: 14px;\n  --classy-font__paragraph-sm-bold--line-height: 1.5;\n  --classy-font__paragraph-sm-bold--font-weight: 700;\n\n  --classy-font__paragraph-md--font-size: 16px;\n  --classy-font__paragraph-md--line-height: 1.5;\n  --classy-font__paragraph-md--font-weight: 400;\n  --classy-font__paragraph-md-bold--font-size: 16px;\n  --classy-font__paragraph-md-bold--line-height: 1.5;\n  --classy-font__paragraph-md-bold--font-weight: 700;\n\n  --classy-font__paragraph-lg--font-size: 20px;
5\n  --classy-font__paragraph-lg--line-height: 1.5;\n  --classy-font__paragraph-lg--font-weight: 400;\n  --classy-font__paragraph-lg-bold--font-size: 20px;\n  --classy-font__paragraph-lg-bold--line-height: 1.5;\n  --classy-font__paragraph-lg-bold--font-weight: 700;\n\n  --classy-font__heading-sm--font-size: 28px;\n  --classy-font__heading-sm--line-height: 1.2;\n  --classy-font__heading-sm--font-weight: 700;\n\n  --classy-font__tag-bold--font-size: 12px;\n  --classy-font__tag-bold--line-height: 1;\n  --classy-font__tag-bold--font-weight: 700;\n\n  /* General and Heading Font Family Aliases */\n  --classy-theme-font__font-family--paragraph: var(--classy-font__font-family--base);\n  --classy-theme-font__font-family--heading: var(--classy-font__font-family--base);\n\n  --classy-font__heading-xs--font-size: 24px;\n  --classy-font__heading-xs--line-height: 1.2;\n  --classy-font__heading-xs--font-weight: 700;\n\n  --classy-theme-font__paragraph-md--font-size: 16px;\n  --classy-theme-font__paragraph-md--line-height: 1.5;\n  --classy-theme-font__paragraph-md--font-weight: 400;\n\n  /* Border Radius */\n  --classy-border__radius-sm: 4px;\n  --classy-border__radius-md: 8px;\n  --classy-border__radius-lg: 12px;\n  --classy-border__radius-xl: 16px;\n  --classy-border__radius-xxl: 20px;\n\n  /* Shadows */\n  --classy-shadow__button: 0 2px 2px 0 rgba(27, 25, 24, 0.12);\n  --classy-shadow__text: 0 1px 1px 0 rgba(0, 0, 0, 0.24);\n  --classy-shadow__alert: 0 4px 8px 0 rgba(28, 25, 23, 0.12);\n  --classy-shadow__modal: 0 16px 32px 0 rgba(27, 25, 24, 0.12);\n  --classy-shadow__sheet: 0 0 16px 0 rgba(27, 25, 24, 0.24);\n  --classy-shadow__active: 0px 2px 2px 0px rgba(0, 0, 0, 0.24) inset,\n    1px 1px 1px 0px rgba(0, 0, 0, 0.24) inset;\n  --classy-shadow__inactive: 0px -2px 4px 0px rgba(0, 0, 0, 0.12) inset,\n    1px 2px 4px 0px rgba(255, 255, 255, 0.12) inset;\n\n  /* Brand Colors */\n  --classy-color__brand-primary--base: rgb(54, 81, 201);\n  --classy-color__brand-primary--darker: rgb(27, 40, 101);\n  --classy-color__brand-primary--dark: rgb(41, 61, 153);\n  --classy-color__brand-primary--light: rgb(102, 123, 214);\n  --classy-color__brand-primary--lighter: rgb(154, 168, 228);\n  --classy-color__brand-primary--lightest: rgb(207, 213, 242);\n  --classy-color__brand-secondary: rgb(232, 235, 248);\n  --classy-color__brand-secondary-dark: rgb(206, 213, 242);\n  --classy-color__brand-tertiary: rgb(26, 25, 24);\n\n  /* Neutral Colors */\n  --classy-color__neutral--10: rgb(27, 25, 24);\n  --classy-color__neutral--20: rgb(49, 47, 45);\n  --classy-color__neutral--30: rgb(80, 76, 73);\n  --classy-color__neutral--40: rgb(106, 101, 98);\n  --classy-color__neutral--45: rgb(120, 114, 110);\n  --classy-color__neutral--50: rgb(133, 127, 122);\n  --classy-color__neutral--60: rgb(157, 152, 149);\n  --classy-color__neutral--70: rgb(181, 178, 176);\n  --classy-color__neutral--80: rgb(206, 204, 202);\n  --classy-color__neutral--90: rgb(230, 229, 229);\n  --classy-color__neutral--95: rgb(243, 242, 242);\n  --classy-color__neutral--100: rgb(255, 255, 255);\n\n  /* Borders */\n  --classy-color__border--input: var(--classy-color__neutral--50);\n  --classy-color__border--input-hover: var(--classy-color__neutral--60);\n  --classy-color__border--lightest: rgb(235, 234, 234);\n  --classy-color__border--placeholder: rgb(248, 247, 247);\n  --classy-color__border--focus: rgb(41, 114, 255);\n\n  /* Backgrounds */\n  --classy-color__background: rgb(255, 255, 255);\n  --classy-color__background--accent: rgb(245, 245, 245);\n  --classy-color__background--lightest: var(--classy-color__neutral--95);\n  --classy-color__background--input: rgb(248, 247, 247);\n  --classy-color__background--backdrop: rgba(255, 255, 255, 0.8);\n  --classy-color__background--backdrop-dark: rgba(26, 25, 25, 0.8);\n\n  /* Status Colors */\n  --classy-color__status--error-base: rgb(169, 15, 15);\n  --classy-color__status--error-lightest: rgb(254, 246, 246);\n  --classy-color__status--success-base: rgb(46, 125, 50);\n\n  /*\n   * * Component-specific\n   * ! FIXME align breakpoint names with design system, CL-27142\n   */\n  --classy-layout__max-width--tablet: 1280px;\n  --classy-section__padding-inline--mobile: 24px;\n  --classy-section__padding-block--mobile: 24px;\n  --classy-section__padding-inline--tablet: 32px;\n  --classy-section__padding-block--tablet: 48px;\n  --classy-content__width--wide: 768px;\n}\n\n","",{version:3,sources:["webpack://./node_modules/@classy/embedded-components/dist/common.css"],names:[],mappings:"AAAA,0DAA0D;;AAE1D;EACE,+BAA+B;EAC/B,oDAAoD;EACpD,mDAAmD;EACnD,sDAAsD;EACtD,sDAAsD;EACtD,qEAAqE;EACrE,wDAAwD;;EAExD,iBAAiB;EACjB,mDAAmD;EACnD,sDAAsD;EACtD,sDAAsD;EACtD,oDAAoD;EACpD,+DAA+D;EAC/D,gEAAgE;EAChE,8DAA8D;
5EAC9D,wDAAwD;EACxD,0DAA0D;EAC1D,0DAA0D;EAC1D,0DAA0D;EAC1D,wDAAwD;EACxD,2DAA2D;EAC3D,2DAA2D;EAC3D,sEAAsE;;EAEtE,iBAAiB;EACjB,4CAA4C;EAC5C,8CAA8C;EAC9C,6CAA6C;EAC7C,2CAA2C;EAC3C,yCAAyC;EACzC,gDAAgD;;EAEhD,qBAAqB;EACrB;oDACkD;;EAElD,yBAAyB;EACzB,qCAAqC;EACrC,sCAAsC;EACtC,sCAAsC;EACtC,2CAA2C;;EAE3C,4CAA4C;EAC5C,6CAA6C;EAC7C,6CAA6C;EAC7C,iDAAiD;EACjD,kDAAkD;EAClD,kDAAkD;;EAElD,4CAA4C;EAC5C,6CAA6C;EAC7C,6CAA6C;EAC7C,iDAAiD;EACjD,kDAAkD;EAClD,kDAAkD;;EAElD,4CAA4C;EAC5C,6CAA6C;EAC7C,6CAA6C;EAC7C,iDAAiD;EACjD,kDAAkD;EAClD,kDAAkD;;EAElD,0CAA0C;EAC1C,2CAA2C;EAC3C,2CAA2C;;EAE3C,wCAAwC;EACxC,uCAAuC;EACvC,yCAAyC;;EAEzC,4CAA4C;EAC5C,kFAAkF;EAClF,gFAAgF;;EAEhF,0CAA0C;EAC1C,2CAA2C;EAC3C,2CAA2C;;EAE3C,kDAAkD;EAClD,mDAAmD;EACnD,mDAAmD;;EAEnD,kBAAkB;EAClB,+BAA+B;EAC/B,+BAA+B;EAC/B,gCAAgC;EAChC,gCAAgC;EAChC,iCAAiC;;EAEjC,YAAY;EACZ,2DAA2D;EAC3D,sDAAsD;EACtD,0DAA0D;EAC1D,4DAA4D;EAC5D,yDAAyD;EACzD;6CAC2C;EAC3C;mDACiD;;EAEjD,iBAAiB;EACjB,qDAAqD;EACrD,uDAAuD;EACvD,qDAAqD;EACrD,wDAAwD;EACxD,0DAA0D;EAC1D,2DAA2D;EAC3D,mDAAmD;EACnD,wDAAwD;EACxD,+CAA+C;;EAE/C,mBAAmB;EACnB,4CAA4C;EAC5C,4CAA4C;EAC5C,4CAA4C;EAC5C,8CAA8C;EAC9C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,+CAA+C;EAC/C,gDAAgD;;EAEhD,YAAY;EACZ,+DAA+D;EAC/D,qEAAqE;EACrE,oDAAoD;EACpD,uDAAuD;EACvD,gDAAgD;;EAEhD,gBAAgB;EAChB,8CAA8C;EAC9C,sDAAsD;EACtD,sEAAsE;EACtE,qDAAqD;EACrD,8DAA8D;EAC9D,gEAAgE;;EAEhE,kBAAkB;EAClB,oDAAoD;EACpD,0DAA0D;EAC1D,sDAAsD;;EAEtD;;;IAGE;EACF,0CAA0C;EAC1C,8CAA8C;EAC9C,6CAA6C;EAC7C,8CAA8C;EAC9C,6CAA6C;EAC7C,oCAAoC;AACtC",sourcesContent:["/* @import url('@classy/design-tokens/dist/tokens.css'); */\n\n:root {\n  /* Default and Web Safe Fonts */\n  --classy-font__font-family--arial: Arial, sans-serif;\n  --classy-font__font-family--georgia: Georgia, serif;\n  --classy-font__font-family--impact: Impact, sans-serif;\n  --classy-font__font-family--tahoma: Tahoma, sans-serif;\n  --classy-font__font-family--times-new-roman: 'Times New Roman', serif;\n  --classy-font__font-family--verdana: Verdana, sans-serif;\n\n  /* Google Fonts */\n  --classy-font__font-family--domine: 'Domine', serif;\n  --classy-font__font-family--inter: 'Inter', sans-serif;\n  --classy-font__font-family--karla: 'Karla', sans-serif;\n  --classy-font__font-family--lato: 'Lato', sans-serif;\n  --classy-font__font-family--merriweather: 'Merriweather', serif;\n  --classy-font__font-family--montserrat: 'Montserrat', sans-serif;\n  --classy-font__font-family--open-sans: 'Open Sans', sans-serif;\n  --classy-font__font-family--oswald: 'Oswald', sans-serif;\n  --classy-font__font-family--poppins: 'Poppins', sans-serif;\n  --classy-font__font-family--pt-sans: 'PT Sans', sans-serif;\n  --classy-font__font-family--raleway: 'Raleway', sans-serif;\n  --classy-font__font-family--roboto: 'Roboto', sans-serif;\n  --classy-font__font-family--slabo-13px: 'Slabo 13px', serif;\n  --classy-font__font-family--slabo-27px: 'Slabo 27px', serif;\n  --classy-font__font-family--source-sans-3: 'Source Sans 3', sans-serif;\n\n  /* Theme Colors */\n  --classy-theme-color__brand-primary: #425ccd;\n  --classy-theme-color__brand-secondary: #e8ebf9;\n  --classy-theme-color__brand-tertiary: #303030;\n  --classy-theme-color__text-general: #2d2e31;\n  --classy-theme-color__background: #ffffff;\n  --classy-theme-color__background-accent: #f2f1ef;\n\n  /* Base Font Family */\n  --classy-font__font-family--base: system-ui, -apple-system, BlinkMacSystemFont, 'San Francisco',\n    'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;\n\n  /* Typography Variables */\n  --classy-font__label--font-size: 12px;\n  --classy-font__label--line-height: 1.5;\n  --classy-font__label--font-weight: 400;\n  --classy-font__label-bold--font-weight: 700;\n\n  --classy-font__paragraph-sm--font-size: 14px;\n  --classy-font__paragraph-sm--line-height: 1.5;\n  --classy-font__paragraph-sm--font-weight: 400;\n  --classy-font__paragraph-sm-bold--font-size: 14px;\n  --classy-font__paragraph-sm-bold--line-height: 1.5;\n  --classy-font__paragraph-sm-bold--font-weight: 700;\n\n  --classy-font__paragraph-md--font-size: 16px;\n  --classy-font__paragraph-md--line-height: 1.5;\n  --classy-font__paragraph-md--font-weight: 400;\n  --classy-font__paragraph-md-bold--font-size: 16px;\n  --classy-font__paragraph-md-bold--line-height: 1.5;\n  --classy-font__paragraph-md-bold--font-weight: 700;\n\n  --classy-font__paragraph-lg--font-size: 20px;
5\n  --classy-font__paragraph-lg--line-height: 1.5;\n  --classy-font__paragraph-lg--font-weight: 400;\n  --classy-font__paragraph-lg-bold--font-size: 20px;\n  --classy-font__paragraph-lg-bold--line-height: 1.5;\n  --classy-font__paragraph-lg-bold--font-weight: 700;\n\n  --classy-font__heading-sm--font-size: 28px;\n  --classy-font__heading-sm--line-height: 1.2;\n  --classy-font__heading-sm--font-weight: 700;\n\n  --classy-font__tag-bold--font-size: 12px;\n  --classy-font__tag-bold--line-height: 1;\n  --classy-font__tag-bold--font-weight: 700;\n\n  /* General and Heading Font Family Aliases */\n  --classy-theme-font__font-family--paragraph: var(--classy-font__font-family--base);\n  --classy-theme-font__font-family--heading: var(--classy-font__font-family--base);\n\n  --classy-font__heading-xs--font-size: 24px;\n  --classy-font__heading-xs--line-height: 1.2;\n  --classy-font__heading-xs--font-weight: 700;\n\n  --classy-theme-font__paragraph-md--font-size: 16px;\n  --classy-theme-font__paragraph-md--line-height: 1.5;\n  --classy-theme-font__paragraph-md--font-weight: 400;\n\n  /* Border Radius */\n  --classy-border__radius-sm: 4px;\n  --classy-border__radius-md: 8px;\n  --classy-border__radius-lg: 12px;\n  --classy-border__radius-xl: 16px;\n  --classy-border__radius-xxl: 20px;\n\n  /* Shadows */\n  --classy-shadow__button: 0 2px 2px 0 rgba(27, 25, 24, 0.12);\n  --classy-shadow__text: 0 1px 1px 0 rgba(0, 0, 0, 0.24);\n  --classy-shadow__alert: 0 4px 8px 0 rgba(28, 25, 23, 0.12);\n  --classy-shadow__modal: 0 16px 32px 0 rgba(27, 25, 24, 0.12);\n  --classy-shadow__sheet: 0 0 16px 0 rgba(27, 25, 24, 0.24);\n  --classy-shadow__active: 0px 2px 2px 0px rgba(0, 0, 0, 0.24) inset,\n    1px 1px 1px 0px rgba(0, 0, 0, 0.24) inset;\n  --classy-shadow__inactive: 0px -2px 4px 0px rgba(0, 0, 0, 0.12) inset,\n    1px 2px 4px 0px rgba(255, 255, 255, 0.12) inset;\n\n  /* Brand Colors */\n  --classy-color__brand-primary--base: rgb(54, 81, 201);\n  --classy-color__brand-primary--darker: rgb(27, 40, 101);\n  --classy-color__brand-primary--dark: rgb(41, 61, 153);\n  --classy-color__brand-primary--light: rgb(102, 123, 214);\n  --classy-color__brand-primary--lighter: rgb(154, 168, 228);\n  --classy-color__brand-primary--lightest: rgb(207, 213, 242);\n  --classy-color__brand-secondary: rgb(232, 235, 248);\n  --classy-color__brand-secondary-dark: rgb(206, 213, 242);\n  --classy-color__brand-tertiary: rgb(26, 25, 24);\n\n  /* Neutral Colors */\n  --classy-color__neutral--10: rgb(27, 25, 24);\n  --classy-color__neutral--20: rgb(49, 47, 45);\n  --classy-color__neutral--30: rgb(80, 76, 73);\n  --classy-color__neutral--40: rgb(106, 101, 98);\n  --classy-color__neutral--45: rgb(120, 114, 110);\n  --classy-color__neutral--50: rgb(133, 127, 122);\n  --classy-color__neutral--60: rgb(157, 152, 149);\n  --classy-color__neutral--70: rgb(181, 178, 176);\n  --classy-color__neutral--80: rgb(206, 204, 202);\n  --classy-color__neutral--90: rgb(230, 229, 229);\n  --classy-color__neutral--95: rgb(243, 242, 242);\n  --classy-color__neutral--100: rgb(255, 255, 255);\n\n  /* Borders */\n  --classy-color__border--input: var(--classy-color__neutral--50);\n  --classy-color__border--input-hover: var(--classy-color__neutral--60);\n  --classy-color__border--lightest: rgb(235, 234, 234);\n  --classy-color__border--placeholder: rgb(248, 247, 247);\n  --classy-color__border--focus: rgb(41, 114, 255);\n\n  /* Backgrounds */\n  --classy-color__background: rgb(255, 255, 255);\n  --classy-color__background--accent: rgb(245, 245, 245);\n  --classy-color__background--lightest: var(--classy-color__neutral--95);\n  --classy-color__background--input: rgb(248, 247, 247);\n  --classy-color__background--backdrop: rgba(255, 255, 255, 0.8);\n  --classy-color__background--backdrop-dark: rgba(26, 25, 25, 0.8);\n\n  /* Status Colors */\n  --classy-color__status--error-base: rgb(169, 15, 15);\n  --classy-color__status--error-lightest: rgb(254, 246, 246);\n  --classy-color__status--success-base: rgb(46, 125, 50);\n\n  /*\n   * * Component-specific\n   * ! FIXME align breakpoint names with design system, CL-27142\n   */\n  --classy-layout__max-width--tablet: 1280px;\n  --classy-section__padding-inline--mobile: 24px;\n  --classy-section__padding-block--mobile: 24px;\n  --classy-section__padding-inline--tablet: 32px;\n  --classy-section__padding-block--tablet: 48px;\n  --classy-content__width--wide: 768px;\n}\n\n"],sourceRoot:""}]);const r=a},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",s=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),s&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),s&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,s,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(s)for(var r=0;r<this.length;r++){var l=this[r][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);s&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},1354:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];
5if(!n)return t;if("function"==typeof btoa){var s=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),o="/*# ".concat(i," */");return[t].concat([o]).join("\n")}return[t].join("\n")}},7910:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});var s=n(5072),i=n.n(s),o=n(7825),a=n.n(o),r=n(7659),l=n.n(r),c=n(5056),d=n.n(c),u=n(540),h=n.n(u),p=n(1113),g=n.n(p),f=n(9727),m={};m.styleTagTransform=g(),m.setAttributes=d(),m.insert=l().bind(null,"head"),m.domAPI=a(),m.insertStyleElement=h();i()(f.A,m);const y=f.A&&f.A.locals?f.A.locals:void 0},5072:e=>{"use strict";var t=[];function n(e){for(var n=-1,s=0;s<t.length;s++)if(t[s].identifier===e){n=s;break}return n}function s(e,s){for(var o={},a=[],r=0;r<e.length;r++){var l=e[r],c=s.base?l[0]+s.base:l[0],d=o[c]||0,u="".concat(c," ").concat(d);o[c]=d+1;var h=n(u),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var g=i(p,s);s.byIndex=r,t.splice(r,0,{identifier:u,updater:g,references:1})}a.push(u)}return a}function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var o=s(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var r=n(o[a]);t[r].references--}for(var l=s(e,i),c=0;c<o.length;c++){var d=n(o[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}o=l}}},7659:e=>{"use strict";var t={};e.exports=function(e,n){var s=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var s="";n.supports&&(s+="@supports (".concat(n.supports,") {")),n.media&&(s+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(s+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),s+=n.css,i&&(s+="}"),n.media&&(s+="}"),n.supports&&(s+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(s,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},1679:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n(2816)),a=i(n(9468)),r=n(3918);t.default=class{constructor(e){this.destroyed=!1,this.init=()=>s(this,void 0,void 0,(function*(){const{modalSDK:e}=this.props;if(this.model=new o.default({win:this.props.win,msg:this.props.msg,configs:yield this.props.configs}),this.view=new a.default({win:this.props.win,onCta:this.subscribeToNudgeTrayCtaEvent,onClose:this.subscribeToNudgeTrayCloseEvent,isOpen:!!(yield this.model.get())&&!e.isOpen()}),e.subscribeToOpenEvent(this.subscribeToModalOpenEvent),e.subscribeToCloseEvent(this.subscribeToModalCloseEvent),e.isOpen()){this.model.markModalOpened();const t=e.getCampaign();t&&this.model.set({campaign:t,params:e.getParams()})}else{const e=yield this.model.get();e&&this.view.open(e)}})),this.subscribeToModalOpenEvent=e=>{this.model.markModalOpened(),this.model.set(e.data),this.view.close()},this.subscribeToModalCloseEvent=()=>s(this,void 0,void 0,(function*(){const e=yield this.model.get();e&&this.view.open(e)})),this.subscribeToNudgeTrayCloseEvent=()=>s(this,void 0,void 0,(function*(){var e;const t=yield this.model.get();(null==t?void 0:t.nav.campaign)&&(null===(e=this.props.hostPageEventInstrumentation)||void 0===e||e.track(r.abandonCartActionEvent,{campaignId:t.nav.campaign,data:{text:"Dismiss",tracking_id:"abandoned cart dismissed"}})),this.model.reset(),this.view.close()})),this.subscribeToNudgeTrayCtaEvent=()=>s(this,void 0,void 0,(function*(){var e;const t=yield this.model.get();(null==t?void 0:t.nav.campaign)&&(null===(e=this.props.hostPageEventInstrumentation)||void 0===e||e.track(r.abandonCartActionEvent,{campaignId:t.nav.campaign,data:{text:"Give Now",tracking_id:"abandoned cart give now"}}),this.props.modalSDK.open(t.nav.campaign,t.nav.params))}
5)),this.props=e,this.init()}destroy(){this.destroyed||(this.destroyed=!0,this.view&&this.view.destroy(),this.model&&this.model.destroy())}}},2816:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i="cl-nudge-tray",o=s(n(8311));t.default=class{constructor(e){this.destroyed=!1,this.hasTrackedModalOpen=!1,this.set=e=>{const t=Object.assign(Object.assign({},e),{hasInteractedWithDonationForm:!0});this.props.win.localStorage.setItem(i,JSON.stringify(t))},this.reset=()=>{this.props.win.localStorage.removeItem(i)},this.markModalOpened=()=>{this.hasTrackedModalOpen=!0},this.get=()=>{try{const e=this.props.win.localStorage.getItem(i);if(!e)return null;const t=JSON.parse(e);if(!this.isValidState(t))return null;const n=t.campaign;if(!n)return null;const s=t,o=this.getConfig(n);return(null==o?void 0:o.enabled)?{nav:s,config:o}:null}catch(e){return null}},this.getConfig=e=>{const t=this.props.configs[e];if(!t)return null;const n=Object.values(t.components).find((e=>"nudge-tray"===e.type));return n?{enabled:n.props.abandonCartNudgeEnabled,theme:t.theme,organizationName:t.organizationName}:null},this.onDonationChanged=e=>{this.hasTrackedModalOpen&&e.data.payload.campaignId&&e.data.payload.params&&this.set({campaign:e.data.payload.campaignId,params:e.data.payload.params})},this.onDonationCompleted=()=>{this.reset()},this.isValidState=e=>this.hasInteractedWithDonationForm(e.hasInteractedWithDonationForm)&&this.isValidStateCampaign(e.campaign)&&this.isValidStateParams(e.params),this.hasInteractedWithDonationForm=e=>!0===e,this.isValidStateCampaign=e=>!!e&&"string"==typeof e,this.isValidStateParams=e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,this.props=e,this.dao=new o.default({win:this.props.win}),this.props.msg.onDonationChanged(this.onDonationChanged),this.props.msg.onDonationCompleted(this.onDonationCompleted)}destroy(){this.destroyed||(this.destroyed=!0)}}},9468:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,i)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e){this.destroyed=!1,this.open=e=>{this.pendingState=e,e.config.enabled&&this.el&&(this.setCtaBg(e),this.setContent(e),this.setAriaLabel(e),this.setOpen(!0))},this.close=()=>{this.setOpen(!1)},this.init=()=>a(this,void 0,void 0,(function*(){try{yield Promise.resolve().then((()=>o(n(5049)))),this.el=this.props.win.document.createElement("cl-nudge-tray"),this.el.setAttribute("role","complementary"),this.props.win.document.body.appendChild(this.el),this.el.addEventListener("cl-nudge-tray--cta",this.props.onCta),this.el.addEventListener("cl-nudge-tray--close",this.props.onClose),setTimeout((()=>{this.pendingState&&this.pendingState.config.enabled&&(this.setCtaBg(this.pendingState),this.setContent(this.pendingState),this.setAriaLabel(this.pendingState)),this.setOpen(this.props.isOpen)}),0)}catch(e){console.log(e),console.error("unable to init the abandon cart nudge tray view")}})),this.setContent=e=>{if(!this.el)return;const t=Number(e.nav.params.amount);isNaN(t)||!isFinite(t)||t<=0||this.el.setAttribute("content",`Finish your $${t} gift to create an impact today.`)},this.setCtaBg=e=>{this.el&&this.el.setAttribute("brand-color",e.config.theme["--theme-color__brand-primary"])},this.setAriaLabel=e=>{if(!this.el)return;const t=e.config.organizationName?`Donate to ${e.config.organizationName}`:"Donate";this.el.setAttribute("aria-label",t)},this.setOpen=e=>{this.el&&this.el.setAttribute("open",e?"true":"false")},this.props=e,this.init()}destroy(){this.destroyed||(this.destroyed=!0,this.el&&(this.el.removeEventListener("cl-nudge-tray--cta",this.props.onCta),this.el.removeEventListener("cl-nudge-tray--close",this.props.onClose),this.el.remove(),this.el=void 0))}}},1604:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Prom
5ise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(n(963));t.default=class{constructor(e){this.GA4_ID=null,this.analyticsLoaded=!1,this.eventQueue=[],this.tealiumInitialized=!1,this.tealiumEventQueue=[],this.messenger=null,this.destroyed=!1,this.props=e}destroy(){this.destroyed||(this.destroyed=!0,this.processEventQueue(),this.processTealiumEventQueue(),this.messenger&&(this.messenger.destroy(),this.messenger=null),this.eventQueue=[],this.tealiumEventQueue=[],this.analyticsLoaded=!1,this.tealiumInitialized=!1)}initialize(){return s(this,void 0,void 0,(function*(){yield this.initializeAnalytics()}))}isGA4Available(){return"function"==typeof window.gtag||this.checkGA4InDataLayer()}isGTMAvailable(){var e;const t=null===(e=null===window||void 0===window?void 0:window.dataLayer)||void 0===e?void 0:e.find((e=>e["gtm.start"]));return!!t&&!!t["gtm.uniqueEventId"]}checkGA4InDataLayer(){if(window.dataLayer)for(const e of window.dataLayer)if("config"===e[0]&&e[1]===this.GA4_ID)return!0;return!1}isTealiumAvailable(){var e,t;return"function"==typeof(null===(e=this.props.win.utag)||void 0===e?void 0:e.link)&&"function"==typeof(null===(t=this.props.win.utag)||void 0===t?void 0:t.view)}hasValidTealiumConfig(e){var t,n,s;return Boolean((null===(t=null==e?void 0:e.account)||void 0===t?void 0:t.trim())&&(null===(n=null==e?void 0:e.profile)||void 0===n?void 0:n.trim())&&(null===(s=null==e?void 0:e.environment)||void 0===s?void 0:s.trim()))}initializeTealium(e){if(this.tealiumInitialized||!this.hasValidTealiumConfig(e))return;const t=this.props.win,n=t.document,{account:s,profile:o}=e,a=i(e,["account","profile"]);if(t.utag_cfg_ovrd=t.utag_cfg_ovrd||{},t.utag_cfg_ovrd.noview=!0,t.utag_data=a,!n.getElementById("classy-tealium-sync-script")){const t=n.createElement("script");t.id="classy-tealium-sync-script",t.type="text/javascript",t.src=`https://tags.tiqcdn.com/utag/${s}/${o}/${e.environment}/utag.sync.js`,n.head.prepend(t)}if(!n.getElementById("classy-tealium-script")){const t=n.createElement("script");t.id="classy-tealium-script",t.type="text/javascript",t.async=!0,t.src=`https://tags.tiqcdn.com/utag/${s}/${o}/${e.environment}/utag.js`,t.addEventListener("load",(()=>this.processTealiumEventQueue())),n.body.prepend(t)}this.tealiumInitialized=!0}initializeAnalytics(){return s(this,void 0,void 0,(function*(){try{const e=this.isGA4Available(),t=this.isGTMAvailable();if(e||t)return this.analyticsLoaded=!0,void this.processEventQueue()}catch(e){console.error("Failed to initialize analytics:",e)}}))}queueOrSendEvent(e,t){if(this.analyticsLoaded)this.handleAnalyticsEvent(e,t);else{const n=this.isGA4Available(),s=this.isGTMAvailable();n||s?(this.analyticsLoaded=!0,this.processEventQueue(),this.handleAnalyticsEvent(e,t)):this.eventQueue.push({eventName:e,eventData:t})}}processEventQueue(){for(;this.eventQueue.length>0;){const e=this.eventQueue.shift();if(e){const{eventName:t,eventData:n}=e;this.handleAnalyticsEvent(t,n)}}}queueOrSendTealiumEvent(e){if(this.hasValidTealiumConfig(e.config)){if(this.initializeTealium(e.config),this.isTealiumAvailable())return this.processTealiumEventQueue(),void this.sendEventToTealium(e);this.tealiumEventQueue.push(e)}else console.warn("Tealium analytics config is missing account, profile, or environment.")}processTealiumEventQueue(){if(this.isTealiumAvailable())for(;this.tealiumEventQueue.length>0;){const e=this.tealiumEventQueue.shift();e&&this.sendEventToTealium(e)}}sendEventToTealium(e){const{utag:t}=this.props.win;(null==t?void 0:t.link)&&t.view?"page"!==e.eventType?t.link(e.data):t.view(e.data):console.warn("Teal
5ium is not available to handle the event.")}sendEventToGA4(e,t){this.isGA4Available()&&("function"==typeof window.gtag?window.gtag("event",e,t):console.warn("GA4 is not available to handle the event."))}sendEventToGTM(e,t){this.isGTMAvailable()?window.dataLayer.push(Object.assign({event:e},t)):console.warn("GTM is not available to handle the event.")}handleAnalyticsEvent(e,t){this.isGA4Available()?this.sendEventToGA4(e,t):this.isGTMAvailable()?this.sendEventToGTM(e,t):console.warn("Neither GA4 nor GTM are available to handle the event.")}setupEventListener(){this.messenger=new a.default({win:this.props.win}),this.messenger.onAnalyticsEvent((e=>{const{event:t,data:n}=e.data.payload;this.queueOrSendEvent(t,n)})),this.messenger.onTealiumAnalyticsEvent((e=>{this.queueOrSendTealiumEvent(e.data.payload)}))}sendEvent(e,t){this.queueOrSendEvent(e,t)}}},2664:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n(8311)),a=n(8392);t.default=class{constructor(e){this.destroyed=!1,this.fetch=()=>s(this,void 0,void 0,(function*(){const e=this.getIds();return(yield this.dao.fetchConfigs(e,this.props.cookiesManager.getPgdidCookie())).reduce(((e,t)=>(e[t.campaignId]=t,e)),{})})),this.getIds=()=>{const e=this.getIdFromActiveUrl(),t=[...this.getIdsFromOrgElements(),...this.getIdsFromClassyElements()];e&&t.push(e);const n=this.getIdFromNudgeTrayState();n&&t.push(n);return[...new Set(t)]},this.getIdFromActiveUrl=()=>{try{return new URLSearchParams(this.props.win.location.search).get(a.CLASSY_HREF)}catch(e){return null}},this.getIdFromNudgeTrayState=()=>{try{const e=this.props.win.localStorage.getItem("cl-nudge-tray");if(!e)return null;const t=JSON.parse(e);return"string"==typeof t.campaign?t.campaign:null}catch(e){return null}},this.getIdsFromOrgElements=()=>{const e=document.querySelectorAll(`a[href*=${a.CLASSY_HREF}]`),t=[];return e.forEach((e=>{const n=e.getAttribute("href");if(!n)return;const s=this._extractCampaignId(n);s&&t.push(s)})),t},this.getIdsFromClassyElements=()=>{const e=document.querySelectorAll(`[${a.CLASSY_ATTR}]`),t=[];return e.length?(e.forEach((e=>{const n=e.getAttribute(a.CLASSY_ATTR);n&&t.push(n)})),t):t},this._extractCampaignId=e=>{if(e.startsWith(`${a.CLASSY_HREF}=`))return e.split("=")[1]||null;(e.startsWith("/?")||e.startsWith("?"))&&(e="https://placeholder.com"+e);try{return new URL(e).searchParams.get(a.CLASSY_HREF)}catch(e){return null}},this.props=e,this.dao=new o.default({win:e.win})}destroy(){this.destroyed||(this.destroyed=!0,this.dao.destroy())}}},862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getComponentSectionByType=void 0;t.getComponentSectionByType=(e,t,n)=>{const s=Object.values(n.components).find((t=>t.type===e));if(!(null==s?void 0:s.sections))return;const i=Object.values(s.sections).find((e=>e.type===t));return i||void 0}},8672:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.destroyed=!1,this.pgdid=this.getOrCreatePgdid()}destroy(){this.destroyed||(this.destroyed=!0)}generateUUID(){return(null===crypto||void 0===crypto?void 0:crypto.randomUUID)?crypto.randomUUID():this.fallbackUUID()}fallbackUUID(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16)))}setCookie(e,t,n={}){const s=`${e}=${t}; Path=/; SameSite=Lax;${n.maxAge?` Max-Age=${n.maxAge};`:""}`;document.cookie=s+" Secure;"}setPgdidCookie(e){this.setCookie("pgdid",e,{maxAge:3456e4})}getPgdidCookie(){return this.getCookie("pgdid")}clearCookie(e){document.cookie=`${e}=; Max-Age=0; Path=/;`}getOrCreatePgdid(){const e=this.getPgdidCookie();if(e)return e;const t=this.generateUUID();return this.setPgdidCookie(t),t}getCookie(e){const t=document.cookie.split("; ");for(const n of t){const[t,s]=n.split("=");if(t===e)return s}return null}}},8392:(e,t)=>{"use strict";
5Object.defineProperty(t,"__esModule",{value:!0}),t.CLASSY_HREF=t.CLASSY_ATTR=void 0,t.CLASSY_ATTR="classy",t.CLASSY_HREF="campaign"},2758:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,i)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.strategyHandlers=void 0;const r=n(5318),l=n(3386),c=n(3918),d=n(8869),u="other",h="Custom",p={0:"one-time",1:"yearly",2:"semi-annually",4:"quarterly",12:"monthly",26:"bi-weekly",52:"weekly",365:"daily"};t.strategyHandlers={donationForm:e=>a(void 0,void 0,void 0,(function*(){var t;try{yield Promise.resolve().then((()=>o(n(1724))));const s=(e,t)=>e.map((e=>Object.assign(Object.assign({},e),{selected:e.value===t}))),i=(e,t)=>a(void 0,void 0,void 0,(function*(){const n=new URL((0,d.getBaseUri)()).origin,s=yield fetch(`${n}/api/checkout/currency?fromCurrency=${e}&toCurrency=${t}`);if(!s)throw new Error("Failed to fetch config");return yield s.json()})),l=document.createElement("cl-donation-form");l.setAttribute("campaign-id",e.campaignId);const g=()=>Boolean(l.__egHostPageEventSyncDepth);let f,m=[],y=[],b="";const v={},_={};let A=null,E=null,w=null;if(e.config){const{options:t,default:n}=e.config.props.currencies;let i=!1;e.config.props.orgTags&&(i=e.config.props.orgTags.some((e=>"disable-multi-currency"===e.name)));const o=i?t.filter((e=>e.value===n)):t;b=n,E=n,m=JSON.parse(JSON.stringify(e.config.props.donationAmounts)),y=JSON.parse(JSON.stringify(e.config.props.recurringAmounts)),f=e.config.props.minimumDonationAmount;const a=e.config.props.donationFrequencies||[],r=a.find((e=>e.isDefault))||a[0];A=(null==r?void 0:r.name)?r.name:"one-time",e.config.props.currencies=s(o,n)}const S=(e,t,n)=>e.map((e=>Object.assign(Object.assign({},e),{amount:(e.amount*t).toFixed((0,r.getCurrencyDecimalPlaces)(n))}))),C=(t,n)=>{var s,i;return{frequency:t||A||"one-time",currency:n||E||(null===(i=null===(s=e.config)||void 0===s?void 0:s.props.currencies)||void 0===i?void 0:i.default)||"USD"}},x=t=>a(void 0,void 0,void 0,(function*(){if(!e.config)return;const n=b||"USD",o=yield i(n,t);if(e.config.props.donationAmounts=S(m,o.rate,t),e.config.props.recurringAmounts=S(y,o.rate,t),e.config.props.currencies=s(e.config.props.currencies,t),"number"==typeof f){const n=(0,r.getCurrencyDecimalPlaces)(t),s=Number((f*o.rate).toFixed(n));e.config.props.minimumDonationAmount=s}})),I=(e,t)=>a(void 0,void 0,void 0,(function*(){const n={},s=yield i(e,t),o=(0,r.getCurrencyDecimalPlaces)(t);if(Object.entries(v).forEach((([i,a])=>{if(a!==u)return;const r=_[i],l=null==r?void 0:r[e];if("number"!=typeof l)return;const c=Number((l*s.rate).toFixed(o));_[i]||(_[i]={}),_[i][t]=c,n[i]=c})),Object.keys(n).length>0){l.externalCustomAmounts=n}})),k=e.modalSDK.getParams(),R=k.frequency||k.recurring&&p[k.recurring]||k.recurring,O=k.preset1||k.preset2||k.preset3||k.preset4,D=k.currency||R||k.amount||O;if(e.config&&D){if(O){const t=e=>{for(const t of["preset1","preset2","preset3","preset4"]){const n=k[t];if(!n)continue;const s=Number(n);if(isNaN(s)||s<=0)continue;const i=e.find((e=>e.name===t));i&&(i.amount=s)}};t(e.config.props.donationAmounts),t(m),t(e.config.props.recurringAmounts),t(y)}if(k.currency&&k.currency!==E&&(yield x(k.currency),E=k.currency),R){const t=e.config.props.donationFrequencies,n=null==t?void 0:t.some((e=>e.name===R&&e.isVisible));let s=null;if(n)s=R;else if("one-time"!==R){const e=null==t?void 0:t.find((e=>e.isVisible&&"one-time"!==e.name));e&&(s=e.name)}s&&t&&(t.forEach((e=>{e.isDefault=e.name===s})),A=s)}if(k.amount){const t=Number(k.amount);if(!isNaN(t)&&t>0){const n="one-time"===(A||"one-time")?e.config.props.donationAmounts:e.config.props.recurringAmounts;if(n){const e=n.find((e=>Math.round(Number(e.amount))===Math.round(t)));
5e&&n.forEach((t=>{t.isDefault=t===e}))}}}}if(l.config=e.config.props,e.el.replaceWith(l),e.setReplacement(l),e.config&&k.amount){const t=Number(k.amount);if(!isNaN(t)&&t>0){const n=A||"one-time",s="one-time"===n?e.config.props.donationAmounts:e.config.props.recurringAmounts;if(!(null==s?void 0:s.some((e=>Math.round(Number(e.amount))===Math.round(t))))){const e=E||b||"USD";v[n]=u,_[n]||(_[n]={}),_[n][e]=t,l.externalCustomAmounts={[n]:t}}}}const P=e.config.props,L=A||"one-time",T="one-time"===L?P.donationAmounts||[]:P.recurringAmounts||[],M=T.filter((e=>e.isVisible&&"other"!==e.name)).map((e=>String(e.amount))).join(","),N=(P.donationFrequencies||[]).filter((e=>e.isVisible)).map((e=>e.name)).join(","),F=(Array.isArray(P.currencies)?P.currencies:[]).map((e=>e.value)).join(","),q=T.find((e=>e.isDefault)),j=q?Number(q.amount):0;null===(t=e.hostPageEventInstrumentation)||void 0===t||t.track(c.hostedDonationGridViewedEvent,{campaignId:e.campaignId,data:{donation_amount_default:j,donation_amount_options:M,donation_currency_default:b||"USD",donation_currency_options:F,donation_frequency_default:L,donation_frequency_options:N}}),l.addEventListener("classy-donation-submit",(t=>{var n;t.preventDefault(),t.stopPropagation();const s=t.detail,i=s.frequency||A||"one-time",o="monthly"===i?"Donate monthly":"Donate one time";null===(n=e.hostPageEventInstrumentation)||void 0===n||n.track(c.donateCTAClickedEvent,{campaignId:e.campaignId,data:{donation_amount:parseFloat(s.amount)||0,donation_currency:s.selectedCurrency||E||"USD",donation_frequency:i,link_url:window.location.href,text:o}});const a={};s.frequency&&(a.frequency=s.frequency),s.amount&&(a.amount=s.amount),s.recurringEndDate&&(a.recurringEndDate=s.recurringEndDate),s.selectedCurrency&&(a.currency=s.selectedCurrency),e.modalSDK.open(e.campaignId,a)})),l.addEventListener("frequency_change",(t=>{var n;const s=g(),{from_frequency:i,to_frequency:o}=t.detail;o&&(A=o),!s&&i&&o&&i!==o&&(null===(n=e.hostPageEventInstrumentation)||void 0===n||n.track(c.studioGridFrequencyToggleEvent,{campaignId:e.campaignId,data:{from_frequency:i,to_frequency:o}}))})),l.addEventListener("amount_selected",(t=>{var n;const s=g(),{from_amount:i,to_amount:o,preset_name:a,frequency:r,currency:l}=t.detail||{},{frequency:d,currency:p}=C(r,l);if(!d||null==o)return;let f=a;if(!f&&e.config){const t="string"==typeof o?Number(o):o,n="one-time"===d?e.config.props.donationAmounts:e.config.props.recurringAmounts,s=Math.round(t),i=null==n?void 0:n.find((e=>Math.round(Number(e.amount))===s));f=null==i?void 0:i.name}f||(f=u),v[d]=f;const m=(e=>{if(void 0===e)return null;const t="string"==typeof e?Number(e):e;return Number.isNaN(t)?null:t})(o),y=f===u,b=null!==m;y&&b&&(_[d]||(_[d]={}),_[d][p]=m);const A=y?h:b?((e,t)=>new Intl.NumberFormat("en-US",{currency:t,maximumFractionDigits:0,minimumFractionDigits:0,style:"currency"}).format(Math.round(e)))(m,p):null,E=y?h:b?`${p}:${Math.round(m)}`:null;A&&E&&!s&&E!==w&&(w=E,null===(n=e.hostPageEventInstrumentation)||void 0===n||n.track(c.studioGridAmountSelectionEvent,{campaignId:e.campaignId,data:Object.assign(Object.assign({},!y&&b?{donation_amount:m}:{}),{from_amount:i,to_amount:o,value:A})}))})),l.addEventListener("currency_selected",(t=>a(void 0,void 0,void 0,(function*(){var n,s;const i=g();if(!e.config)return;const{from_currency:o,to_currency:a}=t.detail,r=a,d=o||E||b||"USD";if(r&&d!==r){E=r,yield x(r),l.config=(null===(n=e.config)||void 0===n?void 0:n.props)||{},i||null===(s=e.hostPageEventInstrumentation)||void 0===s||s.track(c.studioGridCurrencySelectionEvent,{campaignId:e.campaignId,data:{from_currency:o,to_currency:r}});try{yield I(d,r)}catch(e){}}}))))}catch(e){console.error("Error replacing element with donation form:",e)}})),classyHref:e=>{e.el.addEventListener("click",(t=>{t.preventDefault();const n=e.el.getAttribute("href");if(n){const t=(0,l.extractClassyParamsFromHref)(n);e.modalSDK.open(e.campaignId,t)}}))},default:()=>{console.log("Default strategy: no specific action taken.")}}},1989:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(8392),i=n(2758),o=n(3458);t.default=class{constructor(e){this.destroyed=!1,this.originalElement=null,this.replacementElement=null,this.cleanupCallbacks=new Set,this.resolvedInlineGridDecision=o.DEFAULT_INLINE_GRID_DECISION,this.getInlineGrid
5Renderer=()=>{var e,t;const n=this.props.inlineGridDecision||o.DEFAULT_INLINE_GRID_DECISION,s=null===(e=this.props.inlineGridRenderers)||void 0===e?void 0:e[n.path];return s?(this.resolvedInlineGridDecision=n,s):"legacy"===n.path?(this.resolvedInlineGridDecision=n,i.strategyHandlers.donationForm):(this.resolvedInlineGridDecision=(0,o.makeInlineGridDecision)("legacy","renderer_unavailable"),(null===(t=this.props.inlineGridRenderers)||void 0===t?void 0:t.legacy)||i.strategyHandlers.donationForm)},this.isClassyHref=()=>{const e=this.props.el.getAttribute("href");return!(!e||-1===e.indexOf(s.CLASSY_HREF))},this.props=e,this.applyStrategy()}destroy(){this.destroyed||(this.destroyed=!0,this.cleanupCallbacks.forEach((e=>{try{e()}catch(e){console.warn("[SDK] Renderer cleanup failed:",e)}})),this.cleanupCallbacks.clear(),this.restoreReplacement())}setReplacement(e){this.originalElement=this.props.el,this.replacementElement=e}restoreReplacement(){var e;return!(!this.originalElement||!(null===(e=this.replacementElement)||void 0===e?void 0:e.parentNode))&&(this.replacementElement.parentNode.replaceChild(this.originalElement,this.replacementElement),this.replacementElement=null,!0)}addCleanup(e){this.destroyed?e():this.cleanupCallbacks.add(e)}get campaignId(){return this.props.campaignId}get config(){return this.props.config}get el(){return this.props.el}get modalSDK(){return this.props.modalSDK}get organizationName(){return this.props.organizationName}get pgdid(){return this.props.pgdid}get win(){return this.props.win}get hostPageEventInstrumentation(){return this.props.hostPageEventInstrumentation}get inlineGridDecision(){return this.resolvedInlineGridDecision}get inlineGridProfile(){return this.props.inlineGridProfile}applyStrategy(){var e;return this.isClassyHref()?i.strategyHandlers.classyHref(this):"inline-donation-grid"===(null===(e=this.props.config)||void 0===e?void 0:e.type)?this.getInlineGridRenderer()(this):i.strategyHandlers.default(this)}}},179:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(8392),a=i(n(1989)),r=n(862),l=n(3458);t.default=class{constructor(e){this.elements=[],this.destroyed=!1,this._initOrgElements=()=>{document.querySelectorAll(`a[href*=${o.CLASSY_HREF}]`).forEach((e=>{const t=e.getAttribute("href");if(!t)return;const n=this._extractCampaignId(t);n&&this.elements.push(new a.default({el:e,campaignId:n,config:null,hostPageEventInstrumentation:this.props.hostPageEventInstrumentation,inlineGridDecision:l.DEFAULT_INLINE_GRID_DECISION,inlineGridRenderers:this.props.inlineGridRenderers,win:this.props.win,modalSDK:this.props.modalSDK}))}))},this._extractCampaignId=e=>{if(e.startsWith(`${o.CLASSY_HREF}=`))return e.split("=")[1]||null;(e.startsWith("/?")||e.startsWith("?"))&&(e="https://placeholder.com"+e);try{return new URL(e).searchParams.get(o.CLASSY_HREF)}catch(e){return null}},this._initClassyElements=()=>s(this,void 0,void 0,(function*(){const e=document.querySelectorAll(`[${o.CLASSY_ATTR}]`);if(!e.length)return;const t=yield this.props.configs,n=[];e.forEach((e=>{const s=e.getAttribute("id"),i=e.getAttribute(o.CLASSY_ATTR);if(!s||!i)return;const a=t[i];if(!a)return;const r=this.getElementConfig(s,a);n.push({el:e,campaignId:i,campaignConfig:a,config:r,featureFlags:a.featureFlags})}));const s=this.props.inlineGridDecision||(0,l.resolveInlineGridDecision)({featureFlagSets:n.filter((({config:e})=>"inline-donation-grid"===(null==e?void 0:e.type))).map((({featureFlags:e})=>e))});n.forEach((({el:e,campaignId:t,campaignConfig:n,config:i})=>{this.props.modalSDK.setConfig(n),i&&this.elements.push(new a.default({el:e,config:i,campaignId:t,hostPageEventInstrumentation:this.props.hostPageEventInstrumentation,inl
5ineGridDecision:s,inlineGridRenderers:this.props.inlineGridRenderers,inlineGridProfile:n.inlineGridProfile,organizationName:n.organizationName,pgdid:this.props.pgdid,win:this.props.win,modalSDK:this.props.modalSDK}))}))})),this.getElementConfig=(e,t)=>{var n,s;const i=t.components[e];if("inline-donation-grid"===(null==i?void 0:i.type)){const e=(0,r.getComponentSectionByType)("checkout","donation-form",t);if(e)return Object.assign(Object.assign({},i),{props:Object.assign(Object.assign({},i.props),{minimumDonationAmount:t.minimum_donation_amount,donationAmounts:e.props.donationAmounts,donationFrequencies:e.props.donationFrequencies,hideRecurringEndDate:!!(null===(n=t.intelligentAsksConfig)||void 0===n?void 0:n.is_enabled)||e.props.hideRecurringEndDate,recurringAmounts:e.props.recurringAmounts,currencies:t.currency,orgTags:t.orgTags,showRecurringUpsell:!(!(null===(s=t.intelligentAsksConfig)||void 0===s?void 0:s.is_enabled)||200!==t.iaa.status||!t.iaa.data.showRecurringUpsell)})})}return i},this.props=e,this._initElements()}destroy(){this.destroyed||(this.destroyed=!0,this.elements.forEach((e=>{"function"==typeof e.destroy&&e.destroy()})),this.elements=[])}_initElements(){return s(this,void 0,void 0,(function*(){this._initOrgElements(),this._initClassyElements()}))}}},8311:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8369),o=n(8869);t.default=class{constructor(e){this.cache={config:{}},this.destroyed=!1,this.fetchConfigs=(e,t)=>s(this,void 0,void 0,(function*(){const n=e.map((e=>this.fetchConfig(e,t)));return Promise.allSettled(n).then((t=>(t.filter((e=>"rejected"===e.status)).forEach(((t,n)=>{console.error(`Failed to fetch campaign ${e[n]} failed:`,t.reason)})),t.filter((e=>"fulfilled"===e.status)).map((e=>e.value)))))})),this._adjustConfigTheme=e=>{const t=e.theme["--theme-color__brand-primary"],n=t?(0,i.isHexColor)(t)?(0,i.convertRgbToRGBA)((0,i.convertHexToRGB)(t),.1):(0,i.convertRgbToRGBA)(t,.1):"";for(const s in e.components){const o=e.components[s];if("inline-donation-grid"===o.type){const e=o.props;e&&!e.primaryColor&&(e.primaryColor=t),e&&!e.secondaryColor&&(e.secondaryColor=(0,i.convertRgbOrRgbaToHex)(n))}}return e},this._getIAATiles=(e,t)=>{const n=[];for(let t=0;t<e.length;t++)n.push({name:`preset${t+1}`,amount:e[t],isVisible:!0,isDefault:!1});return t&&n.push({name:"other",amount:0,isVisible:!0,isDefault:!1}),n},this._adjustDefaultFrequency=(e,t)=>{e.forEach((e=>{"one-time"===e.name&&(e.isDefault=!t),"one-time"!==e.name&&e.isVisible&&(e.isDefault=null!=t&&t)}))},this._adjustConfigWithIAA=e=>{var t,n,s,i,o,a,r,l;const c=e.iaa;if(200!==c.status)return e;if(!0===e.iaaConfig.useIntelligentAskOnetime||(null===(t=e.intelligentAsksConfig)||void 0===t?void 0:t.is_enabled))for(const t in e.components){const a=e.components[t];if("inline-donation-grid"===a.type){const t=a.props;t.donationAmounts=this._getIAATiles(null!==(n=c.data.suggestedOnetimeAmounts)&&void 0!==n?n:[],Boolean(t.donationAmounts.find((e=>"other"===e.name)))),(null===(s=e.intelligentAsksConfig)||void 0===s?void 0:s.is_enabled)&&this._adjustDefaultFrequency(t.donationFrequencies,c.data.isDefaultRecurring)}if("checkout"===a.type&&a.sections)for(const t in a.sections)if("donation-form"===a.sections[t].type){const n=a.sections[t].props;n.donationAmounts=this._getIAATiles(null!==(i=c.data.suggestedOnetimeAmounts)&&void 0!==i?i:[],Boolean(n.donationAmounts.find((e=>"other"===e.name)))),(null===(o=e.intelligentAsksConfig)||void 0===o?void 0:o.is_enabled)&&this._adjustDefaultFrequency(n.donationFrequencies,c.data.isDefaultRecurring)}}if(!0===e.iaaConfig.useIntelligentAskRecurring||(null===(a=e.intelligentAsksConfig)||void 0===a?void 0:a.is_enabled))for(const t in e.components){const n=e.components[t];if("inline-donation-grid"===n.type){const e=n.props;e.recurringAmounts=this._getIAATiles(null!==(r=c.data.suggestedRecurringAmounts)&&void 0!==r?r:[],Boolean(e.recurringAmounts.find((e=>"other"===e.name))))}if("checkout"===n.type&&n.sections)for(const e in n.sections)if("donation-form"===n.sections[e].type){const t=n.sections[e].props;t.recurringAmounts=this._getIAATiles(null!==(l=c.data.suggestedRecurringAmounts)&&void 0!==l?l:[],Boolean(t.recurringAmounts.find((e=>"other"===e.name))))}}return e},this._setCampaignLocale=e=>{document.cookie=`i18next=${e}`},this.props=e}destroy(){this.destroyed||(this.destroyed=!0,this.cache.config={})}fetchConfig(e,t){var n,i,a;return s(this,void 0,void 0,(function*(){if(this.cache.config[e])return this.cache.config[e];const s=(null===(n=null===window||void 0===window?void 0:window.screen)||void 0===n?void 0:n.height)||0,r=(null===(i=null===window||void 0===window?void 0:window.screen)||void 0===i?void 0:i.width)||0,l=navigator.language,c=new URLSearchParams({published:"1",clickSource:null===(a=null===window||void 0===window?void 0:window.location)||void 0===a?void 0:a.origin,screenHeight:String(s),screenWidth:String(r),locale:l,currency:"USD"});t&&c.append("pgdid",t);const d=new URLSearchParams(this.props.win.location.search);for(const e of["utm_medium","utm_source"]){const t=d.get(e);t&&Array.from(t).length<=255&&c.set(e,t)}const u=new URL((0,o.getBaseUri)()).origin,h=yield this.props.win.fetch(`${u}/api/checkout/sdk-config/campaigns/${e}?${c}`);if(!h.ok)throw new Error("Failed to fetch config");const p=yield h.json();this._setCampaignLocale(p.data.locale||"en");let g=this._adjustConfigTheme(p.data);return g=this._adjustConfigWithIAA(g),this.cache.config[e]=g,g}))}}},5835:(e,t)=>{"use strict";
5Object.defineProperty(t,"__esModule",{value:!0}),t.getSDKFeatureDecision=t.SDK_FEATURES=void 0,t.SDK_FEATURES={inlineGridIframe:{key:"npo_donate_embedded_cpb_grid",variations:["off","on"]}};t.getSDKFeatureDecision=(e,t)=>{if(null==e)return null;if("object"!=typeof e||Array.isArray(e))return"invalid";const n=e[t.key];return null==n?null:"string"==typeof n&&t.variations.includes(n)?n:"invalid"}},3918:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.studioGridCurrencySelectionEvent=t.studioGridAmountSelectionEvent=t.studioGridFrequencyToggleEvent=t.eg3SDKLoadEvent=t.hostedDonationGridViewedEvent=t.studioGridValueSelectedEvent=t.studioGridButtonClickedEvent=t.abandonCartActionEvent=t.donateCTAClickedEvent=void 0;const s=n(1126),i=n(9481);t.donateCTAClickedEvent=(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>({donation_amount:e.donation_amount,donation_currency:e.donation_currency,donation_frequency:e.donation_frequency,link_url:e.link_url,outbound:!1,text:e.text,tracking_id:"donation grid cta"}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_PRIMARY_CTA_CLICK,mparticleEventName:"Donate CTA Clicked",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"}),t.abandonCartActionEvent=(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>({placement:"hosted page",text:e.text,tracking_id:e.tracking_id}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.ABANDON_CART_NUDGE,mparticleEventName:"Button Clicked",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"abandon-cart-nudge"});const o=e=>(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>({tracking_id:e.tracking_id}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_INTERACTION,mparticleEventName:e,mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"});t.studioGridButtonClickedEvent=o("Button Clicked"),t.studioGridValueSelectedEvent=o("Value Selected"),t.hostedDonationGridViewedEvent=(0,s.defineHostPageFunnelEvent)({buildMParticleEventInfo:({data:e})=>Object.assign({donation_amount_default:e.donation_amount_default,donation_amount_options:e.donation_amount_options,donation_currency_default:e.donation_currency_default,donation_currency_options:e.donation_currency_options,donation_frequency_default:e.donation_frequency_default,donation_frequency_options:e.donation_frequency_options},e.donation_amount_options_set_id?{donation_amount_options_set_id:e.donation_amount_options_set_id}:{}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_VIEWED,mparticleEventName:"Hosted Donation Grid Viewed",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"}),t.eg3SDKLoadEvent=(0,s.defineHostPageFunnelEvent)({flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.EG3_SDK_LOAD,mparticleEventName:"EG3 SDK Loaded",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid",buildMParticleEventInfo:()=>({entry_source:"hosted_checkout"})});t.studioGridFrequencyToggleEvent=(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>{return{value:(t=e.to_frequency,"monthly"===t.toLowerCase()?"Monthly":"One-time")};var t},flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_FREQUENCY_CHANGE,mparticleEventName:"Frequency Toggle",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"}),t.studioGridAmountSelectionEvent=(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>Object.assign(Object.assign({},"number"==typeof e.donation_amount?{donation_amount:e.donation_amount}:{}),{tracking_id:"donation amount",value:e.value}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_AMOUNT_CHANGE,mparticleEventName:"Value Selected",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"}),t.studioGridCurrencySelectionEvent=(0,s.defineHostPageUIElementEvent)({buildMParticleEventInfo:({data:e})=>({tracking_id:"donation currency",value:e.to_currency}),flushMode:s.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE,hostPageEventName:i.HOST_PAGE_EVENT_NAMES.STUDIO_GRID_CURRENCY_CHANGE,mparticleEventName:"Value Selected",mparticleEventType:i.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER,source:"inline-donation-grid"})},1126:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esMo
5dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createHostPageEventInstrumentation=t.defineHostPageUIElementEvent=t.defineHostPageFunnelEvent=t.defineHostPageEvent=t.HOST_PAGE_EVENT_FLUSH_MODES=void 0;const i=s(n(4060));t.HOST_PAGE_EVENT_FLUSH_MODES={IMMEDIATE:"immediate",MANUAL:"manual"};t.defineHostPageEvent=e=>Object.assign(Object.assign({},e),{tracker:"event"});t.defineHostPageFunnelEvent=e=>Object.assign(Object.assign({},e),{tracker:"funnel"});t.defineHostPageUIElementEvent=e=>Object.assign(Object.assign({},e),{tracker:"ui-element"});class o{constructor(e){this.track=(e,n)=>{var s;const i=e.flushMode===t.HOST_PAGE_EVENT_FLUSH_MODES.IMMEDIATE;return this.getTracker(e.tracker)({campaignId:n.campaignId,componentId:n.componentId,data:n.data,mparticleEventInfo:null===(s=e.buildMParticleEventInfo)||void 0===s?void 0:s.call(e,n),mparticleEventName:e.mparticleEventName,mparticleEventType:e.mparticleEventType,name:e.hostPageEventName,source:e.source},{flush:i})},this.getTracker=e=>"ui-element"===e?this.tracker.trackUIElement:"funnel"===e?this.tracker.trackFunnelEvent:this.tracker.trackEvent,this.tracker=e}}t.default=o;t.createHostPageEventInstrumentation=e=>new o(new i.default(e))},4283:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e={}){this.eventsByCampaign={},this.sequence=0,this.record=e=>{const t=this.now(),n=++this.sequence,s=Object.assign(Object.assign({},e),{capturedAt:t,id:`${e.campaignId}:${n}:${t}`,sequence:n});return this.eventsByCampaign[e.campaignId]||(this.eventsByCampaign[e.campaignId]=[]),this.eventsByCampaign[e.campaignId].push(s),s},this.drain=e=>{const t=this.peek(e);return 0===t.length?[]:(delete this.eventsByCampaign[e],t)},this.peek=e=>{const t=this.eventsByCampaign[e];return t?[...t]:[]},this.reset=()=>{this.eventsByCampaign={},this.sequence=0},this.now=e.now||(()=>Date.now())}}},4060:function(e,t,n){"use strict";var s=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]])}return n},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(2681),a=i(n(4283)),r=n(9481);t.default=class{constructor(e){this.track=(e,t={})=>{var n;const s=this.queue.record(e);return null===(n=this.sendAnalyticsEvent)||void 0===n||n.call(this,e.name,e.data),t.flush&&this.flush(e.campaignId),s},this.trackEvent=(e,t={})=>this.trackWithMParticleTracker("event",e,t),this.trackFunnelEvent=(e,t={})=>this.trackWithMParticleTracker("funnel",e,t),this.trackUIElement=(e,t={})=>this.trackWithMParticleTracker("ui-element",e,t),this.flush=e=>{const t=this.queue.drain(e);0!==t.length&&this.sendMessage({type:o.HOST_PAGE_EVENTS_MSG_TO_APP,payload:{campaignId:e,events:t}})},this.peek=e=>this.queue.peek(e),this.reset=()=>{this.queue.reset()},this.trackWithMParticleTracker=(e,t,n)=>{const{mparticleEventInfo:i,mparticleEventName:o,mparticleEventType:a=r.HOST_PAGE_MPARTICLE_EVENT_TYPES.OTHER}=t,l=s(t,["mparticleEventInfo","mparticleEventName","mparticleEventType"]);return this.track(Object.assign(Object.assign({},l),{mparticle:{eventInfo:Object.assign(Object.assign({},i),{surface:r.HOST_PAGE_MPARTICLE_SURFACE}),eventName:o,eventType:a,tracker:e}}),n)},this.queue=e.queue||new a.default,this.sendAnalyticsEvent=e.sendAnalyticsEvent,this.sendMessage=e.sendMessage}}},9481:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HOST_PAGE_MPARTICLE_SURFACE=t.HOST_PAGE_MPARTICLE_EVENT_TYPES=t.HOST_PAGE_EVENT_NAMES=void 0,t.HOST_PAGE_EVENT_NAMES={ABANDON_CART_NUDGE:"abandon_cart_nudge",EG3_SDK_LOAD:"eg3_sdk_load",STUDIO_GRID_AMOUNT_CHANGE:"studio_grid_amount_change",STUDIO_GRID_CURRENCY_CHANGE:"studio_grid_currency_change",STUDIO_GRID_FREQUENCY_CHANGE:"studio_grid_frequency_change",STUDIO_GRID_INTERACTION:"studio_grid_interaction",STUDIO_GRID_PRIMARY_CTA_CLICK:"studio_grid_primary_cta_click",STUDIO_GRID_VIEWED:"studio_grid_viewed"},t.HOST_PAGE_MPARTICLE_EVENT_TYPES={LOCATION:"Location",MEDIA:"Media",NAVIGATION:"Navigation",OTHER:"Other",SEARCH:"Search",SOCIAL:"Social",TRANSACTION:"Transaction",UNKNOWN:"Unknown",USER_CONTENT:"UserContent",USER_PREFERENCE:"UserPreference"},t.HOST_PAGE_MPARTICLE_SURFACE="embedded-sdk"},3458:(e,t,n)=>{"use strict";
5Object.defineProperty(t,"__esModule",{value:!0}),t.resolveInlineGridDecision=t.DEFAULT_INLINE_GRID_DECISION=t.makeInlineGridDecision=void 0;const s=n(5835);t.makeInlineGridDecision=(e,t)=>Object.freeze({path:e,source:t}),t.DEFAULT_INLINE_GRID_DECISION=(0,t.makeInlineGridDecision)("legacy","no_inline_grid");t.resolveInlineGridDecision=({featureFlagSets:e})=>{const n=(e=>e.map((e=>(0,s.getSDKFeatureDecision)(e,s.SDK_FEATURES.inlineGridIframe))))(e);let i;if(n.length)if(n.some((e=>"invalid"===e)))i=(0,t.makeInlineGridDecision)("legacy","invalid_response");else if(n.some((e=>null===e)))i=(0,t.makeInlineGridDecision)("legacy","provider_fallback");else{const e=n.every((e=>"on"===e));i=(0,t.makeInlineGridDecision)(e?"iframe":"legacy","remote_flag")}else i=t.DEFAULT_INLINE_GRID_DECISION;return i}},3280:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeInlineGridIframeRenderer=t.buildInlineGridIframeUrl=void 0;const s=n(8869),i=new Set(["amount","c_src","c_src2","currency","designation","frequency","preset1","preset2","preset3","preset4","recurring","recurringEndDate"]),o=(e,t,n)=>{"string"==typeof n&&n.length>0&&e.set(t,n)};t.buildInlineGridIframeUrl=({baseUri:e,campaignId:t,componentId:n,hostSearch:a="",inlineGridProfile:r,params:l,pgdid:c,sdkBuild:d="a0578322",sdkOrigin:u=(0,s.getSdkScriptOrigin)(),sdkRoute:h=(0,s.getIframeRouteReason)(),sdkInstanceId:p})=>{const g=new URL(e),f=g.pathname.replace(/\/$/,"");if(!f.endsWith("/donate/embedded"))throw new Error("Inline grid requires the canonical Whammy embedded route");if(g.pathname=`${f}/grid`,g.hash="",g.search="",g.searchParams.set("cid",t),g.searchParams.set("component_id",n),o(g.searchParams,"pgdid",c),null==r)throw new Error("Inline grid requires a profile");const m=JSON.stringify(r);if(!m)throw new Error("Inline grid profile could not be serialized");g.searchParams.set("grid_profile",m),Object.entries(l).forEach((([e,t])=>{(i.has(e)||e.startsWith("utm_"))&&o(g.searchParams,e,t)})),new URLSearchParams(a).forEach(((e,t)=>{t.startsWith("ff_")&&o(g.searchParams,t,e)})),g.searchParams.set("sdk_build",d),g.searchParams.set("sdk_origin",u),g.searchParams.set("sdk_route",h),g.searchParams.set("sdk_surface","inline-grid"),g.searchParams.set("sdk_instance_id",p);const y=g.toString();if(new Blob([y]).size>8192)throw new Error("Inline grid iframe URL exceeds the 8 KiB limit");return y};t.makeInlineGridIframeRenderer=({fallback:e,getBaseUri:n=s.getIframeBaseUri,getSdkBuild:i=(()=>"a0578322"),getSdkOrigin:o=s.getSdkScriptOrigin,getSdkRoute:a=s.getIframeRouteReason,protocol:r})=>s=>{let l;try{const c=s.el.parentNode;if(!c)throw new Error("Inline grid placeholder is detached");const d=r.createInstanceId(s.campaignId,s.el.id),u=(0,t.buildInlineGridIframeUrl)({baseUri:n(),campaignId:s.campaignId,componentId:s.el.id,hostSearch:s.win.location.search,inlineGridProfile:s.inlineGridProfile,params:s.modalSDK.getParams(),pgdid:s.pgdid,sdkBuild:i(),sdkOrigin:o(),sdkRoute:a(),sdkInstanceId:d}),h=s.win.document.createElement("iframe");h.id=s.el.id,h.className=s.el.className,h.setAttribute("loading","eager"),h.name=`eg-inline-grid-iframe--${s.campaignId}--${s.el.id}`,h.referrerPolicy="strict-origin-when-cross-origin",h.src=u,h.title=s.organizationName?`Donate to ${s.organizationName}`:"Donate",h.style.border="0",h.style.borderRadius="16px",h.style.display="block",h.style.width="100%",h.style.minWidth="345px",h.style.height="0px";const p=s.win.document.createElement("div");p.style.width="100%",p.style.minWidth="0",p.style.overflowX="auto",p.tabIndex=0,p.setAttribute("role","region"),p.setAttribute("aria-label",h.title),p.appendChild(h);let g=!1;const f=()=>{g||(g=!0,null==l||l(),s.restoreReplacement()&&(console.warn("[SDK] Standalone inline grid unavailable; using legacy renderer"),e(s)))};l=r.register({campaignId:s.campaignId,componentId:s.el.id,iframe:h,instanceId:d,onUnavailable:f,targetOrigin:new URL(u).origin}),c.replaceChild(p,s.el),s.setReplacement(p),s.addCleanup(l)}catch(t){null==l||l(),console.error("[SDK] Failed to render the standalone inline grid; using legacy:",t),e(s)}}},6244:function(e,t,n){"use strict";var s=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]])}return n};
5Object.defineProperty(t,"__esModule",{value:!0});const i=n(3918),o=n(1791);t.default=class{constructor({hostPageEventInstrumentation:e,modalSDK:t,readyTimeoutMs:n=1e4,win:s}){this.sessions=new Map,this.destroyed=!1,this.instanceSequence=0,this.handleMessage=e=>{if(this.destroyed||!(0,o.isInlineGridMessageFromGrid)(e.data))return;const t=e.data,n=this.sessions.get(t.instanceId);n&&e.source===n.iframe.contentWindow&&e.origin===n.targetOrigin&&this.handleTrustedMessage(n,t)},this.hostPageEventInstrumentation=e,this.modalSDK=t,this.readyTimeoutMs=n,this.win=s,this.win.addEventListener("message",this.handleMessage)}createInstanceId(e,t){this.instanceSequence+=1;return`${e.replace(/[^A-Za-z0-9._:-]/g,"-")}:${t.replace(/[^A-Za-z0-9._:-]/g,"-")}:${this.instanceSequence}`}register(e){if(this.destroyed)return()=>{};const t=this.sessions.get(e.instanceId);null==t||t.cleanupLoadListener(),(null==t?void 0:t.readyTimeout)&&clearTimeout(t.readyTimeout);const n=()=>{this.sendInitialize(e.instanceId)};e.iframe.addEventListener("load",n);const s=Object.assign(Object.assign({},e),{amountByFrequency:{},cleanupLoadListener:()=>e.iframe.removeEventListener("load",n),hasMeasuredHeight:!1,isReady:!1,viewedTracked:!1});return this.sessions.set(e.instanceId,s),this.startReadyTimeout(e.instanceId),()=>this.unregister(e.instanceId)}syncSelection(e,t){if(this.destroyed)return;const n=(0,o.toInlineGridSelectionUpdate)(t);n&&this.sessions.forEach((t=>{if(!t.isReady||t.campaignId!==e)return;const s=this.normalizeSelectionUpdate(t,n);s&&this.postToGrid(t,(0,o.makeInlineGridMessage)(o.INLINE_GRID_MESSAGE_TYPE.SELECTION_UPDATE,t.instanceId,s))}))}getSelectionParams(e){const t=Array.from(this.sessions.values()).filter((t=>t.campaignId===e&&t.iframe.isConnected));if(this.destroyed||1!==t.length||!t[0].isReady)return;const n=t[0].liveSelection;return n&&null!==n.amount?{amount:String(n.amount),currency:n.currency,frequency:n.frequency}:void 0}destroy(){this.destroyed||(this.destroyed=!0,this.win.removeEventListener("message",this.handleMessage),Array.from(this.sessions.keys()).forEach((e=>this.unregister(e))))}handleTrustedMessage(e,t){switch(t.type){case o.INLINE_GRID_MESSAGE_TYPE.ANALYTICS:if(t.payload.campaignId!==e.campaignId)return;return void this.handleAnalytics(e,t.payload);case o.INLINE_GRID_MESSAGE_TYPE.HELLO:return void(t.payload.campaignId===e.campaignId&&this.sendInitialize(e.instanceId));case o.INLINE_GRID_MESSAGE_TYPE.READY:if(t.payload.campaignId!==e.campaignId||e.isReady)return;return void(e.isReady=!0);case o.INLINE_GRID_MESSAGE_TYPE.RESIZE:if(!e.isReady)return;return this.applyHeight(e.iframe,t.payload.height),void(e.hasMeasuredHeight||(e.hasMeasuredHeight=!0,e.readyTimeout&&(clearTimeout(e.readyTimeout),e.readyTimeout=void 0),this.trackViewedIfReady(e)));case o.INLINE_GRID_MESSAGE_TYPE.SUBMIT:if(!e.isReady||t.payload.campaignId!==e.campaignId)return;return void this.handleSubmit(e,t.payload);case o.INLINE_GRID_MESSAGE_TYPE.SELECTION_UPDATE:return e.liveSelection=t.payload,void(null!==t.payload.amount?(e.currentSelection=Object.assign(Object.assign(Object.assign({},e.currentSelection),t.payload),{amount:t.payload.amount}),e.amountByFrequency[t.payload.frequency]=t.payload.amount):e.currentSelection=void 0);case o.INLINE_GRID_MESSAGE_TYPE.ERROR:return console.warn("[SDK Inline Grid] Whammy reported a grid error:",{code:t.payload.code,instanceId:e.instanceId,phase:t.payload.phase,reason:t.payload.reason}),void(("initialize"===t.payload.phase||"render"===t.payload.phase||"GRID_SUBMIT_FAILED"===t.payload.code&&"submit"===t.payload.phase&&"selection_invalid"===t.payload.reason)&&this.failSession(e.instanceId));default:return}}handleSubmit(e,t){var n,s;e.currentSelection=t,e.amountByFrequency[t.frequency]=t.amount;const o=Object.assign(Object.assign(Object.assign({amount:String(t.amount),currency:t.currency,frequency:t.frequency,dedication:null!==(s=null===(n=t.dedication)||void 0===n?void 0:n.text)&&void 0!==s?s:""},void 0!==t.dedication&&{dedicationType:t.dedication.type}),void 0!==t.designation&&{designation:String(t.designation)}
5),void 0!==t.recurringEndDate&&{recurringEndDate:t.recurringEndDate});this.trackBestEffort((()=>{this.hostPageEventInstrumentation.track(i.donateCTAClickedEvent,{campaignId:e.campaignId,componentId:e.componentId,data:{donation_amount:t.amount,donation_currency:t.currency,donation_frequency:t.frequency,link_url:this.win.location.href,text:"monthly"===t.frequency?"Donate monthly":"Donate one time"}})})),this.modalSDK.open(e.campaignId,o)}handleAnalytics(e,t){this.trackBestEffort((()=>{switch(t.action){case"amount_change":{const o="custom"===t.donationType;return void this.hostPageEventInstrumentation.track(i.studioGridAmountSelectionEvent,{campaignId:e.campaignId,componentId:e.componentId,data:Object.assign(Object.assign({},!o&&{donation_amount:t.toAmount}),{from_amount:t.fromAmount,to_amount:t.toAmount,value:o?"Custom":(n=t.toAmount,s=t.currency,new Intl.NumberFormat("en-US",{currency:s,maximumFractionDigits:0,minimumFractionDigits:0,style:"currency"}).format(Math.round(n)))})})}case"currency_change":return void this.hostPageEventInstrumentation.track(i.studioGridCurrencySelectionEvent,{campaignId:e.campaignId,componentId:e.componentId,data:{from_currency:t.fromCurrency,to_currency:t.toCurrency}});case"frequency_change":return void this.hostPageEventInstrumentation.track(i.studioGridFrequencyToggleEvent,{campaignId:e.campaignId,componentId:e.componentId,data:{from_frequency:t.fromFrequency,to_frequency:t.toFrequency}});case"interaction":{const n="Button Clicked"===o.INLINE_GRID_INTERACTIONS[t.trackingId]?i.studioGridButtonClickedEvent:i.studioGridValueSelectedEvent;return void this.hostPageEventInstrumentation.track(n,{campaignId:e.campaignId,componentId:e.componentId,data:{tracking_id:t.trackingId}})}case"viewed":return e.viewedEventData={donation_amount_default:t.donation_amount_default,donation_amount_options:t.donation_amount_options,donation_currency_default:t.donation_currency_default,donation_currency_options:t.donation_currency_options,donation_frequency_default:t.donation_frequency_default,donation_frequency_options:t.donation_frequency_options},void this.trackViewedIfReady(e)}var n,s}))}trackViewedIfReady(e){const t=e.viewedEventData;e.isReady&&e.hasMeasuredHeight&&t&&!e.viewedTracked&&(e.viewedTracked=!0,this.trackBestEffort((()=>{this.hostPageEventInstrumentation.track(i.hostedDonationGridViewedEvent,{campaignId:e.campaignId,componentId:e.componentId,data:t})})))}trackBestEffort(e){try{e()}catch(e){}}normalizeSelectionUpdate(e,t){const n=e.currentSelection;if(!n)return e.currentSelection=(0,o.toInlineGridSelection)(t),t;const i=Object.assign({},t),a=n.frequency,r=t.frequency||a;if(t.frequency&&t.frequency!==a){void 0!==t.amount&&(e.amountByFrequency[a]=t.amount);const n=e.amountByFrequency[r];void 0!==n?i.amount=n:delete i.amount}else void 0!==t.amount&&(e.amountByFrequency[r]=t.amount);
5if(Object.keys(i).forEach((e=>{(0,o.isUnchangedSelectionField)(e,i,n)&&delete i[e]})),0===Object.keys(i).length)return null;const{dedication:l}=i,c=s(i,["dedication"]),d=Object.assign(Object.assign(Object.assign({},n),c),{frequency:r});return null===l?delete d.dedication:void 0!==l&&(d.dedication=l),e.currentSelection=d,i}applyHeight(e,t){const n=`${Math.ceil(t)}px`;e.style.height!==n&&(e.style.height=n)}sendInitialize(e){const t=this.sessions.get(e);t&&!t.isReady&&this.postToGrid(t,(0,o.makeInlineGridMessage)(o.INLINE_GRID_MESSAGE_TYPE.INITIALIZE,e,{campaignId:t.campaignId}))}startReadyTimeout(e){const t=this.sessions.get(e);!t||t.hasMeasuredHeight||t.readyTimeout||(t.readyTimeout=setTimeout((()=>{const t=this.sessions.get(e);t&&!t.hasMeasuredHeight&&(console.warn("[SDK Inline Grid] Grid did not become ready with a measured height before timeout:",{code:"GRID_INITIALIZATION_FAILED",instanceId:e,phase:"initialize"}),this.failSession(e))}),this.readyTimeoutMs))}failSession(e){const t=this.sessions.get(e);if(!t)return;const{onUnavailable:n}=t;this.unregister(e),n()}postToGrid(e,t){var n;null===(n=e.iframe.contentWindow)||void 0===n||n.postMessage(t,e.targetOrigin)}unregister(e){const t=this.sessions.get(e);t&&(t.cleanupLoadListener(),t.readyTimeout&&clearTimeout(t.readyTimeout),this.sessions.delete(e))}}},1791:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUnchangedSelectionField=t.toInlineGridSelection=t.toInlineGridSelectionUpdate=t.makeInlineGridMessage=t.isInlineGridMessageFromGrid=t.INLINE_GRID_INTERACTIONS=t.INLINE_GRID_MESSAGE_TYPE=t.INLINE_GRID_PROTOCOL=void 0,t.INLINE_GRID_PROTOCOL="classy-inline-grid",t.INLINE_GRID_MESSAGE_TYPE={ANALYTICS:"CLASSY_INLINE_GRID_ANALYTICS",ERROR:"CLASSY_INLINE_GRID_ERROR",HELLO:"CLASSY_INLINE_GRID_HELLO",INITIALIZE:"CLASSY_INLINE_GRID_INITIALIZE",READY:"CLASSY_INLINE_GRID_READY",RESIZE:"CLASSY_INLINE_GRID_RESIZE",SELECTION_UPDATE:"CLASSY_INLINE_GRID_SELECTION_UPDATE",SUBMIT:"CLASSY_INLINE_GRID_SUBMIT"},t.INLINE_GRID_INTERACTIONS={"dedication start":"Value Selected","donation: dedication hidden":"Value Selected","donation: dedication start":"Value Selected","donation: ticker dismissed":"Button Clicked","donation ticker dismissed":"Button Clicked"};const n=new Set(["one-time","daily","weekly","bi-weekly","monthly","quarterly","semi-annually","yearly"]),s=new Set(["GRID_INITIALIZATION_FAILED","GRID_NOT_INITIALIZED","GRID_RENDER_FAILED","GRID_RESIZE_FAILED","GRID_SUBMIT_FAILED"]),i=new Set(["initialize","render","resize","submit"]),o=new Set(["campaign_unavailable","configuration_unavailable","height_unavailable","protocol_not_initialized","render_unavailable","selection_invalid","status_failed","unknown"]),a=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),r=(e,t)=>"string"==typeof e&&e.length>0&&e.length<=t,l=e=>r(e,100),c=e=>"string"==typeof e&&/^[A-Z]{3}$/.test(e),d=e=>"number"==typeof e&&Number.isFinite(e)&&e>0,u=e=>"number"==typeof e&&Number.isSafeInteger(e)&&e>0,h=e=>a(e)&&f(e,["text","type"])&&"string"==typeof e.text&&e.text.length>0&&e.text.length<=100&&("honor"===e.type||"memory"===e.type),p=e=>{if("string"!=typeof e)return!1;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return!1;const n=Number(t[1]),s=Number(t[2]),i=Number(t[3]);if(0===n||s<1||s>12)return!1;return i>=1&&i<=[31,n%4==0&&(n%100!=0||n%400==0)?29:28,31,30,31,30,31,31,30,31,30,31][s-1]},g=e=>"string"==typeof e&&n.has(e);function f(e,t){return Object.keys(e).every((e=>t.includes(e)))}const m=e=>!!a(e)&&(e.protocol===t.INLINE_GRID_PROTOCOL&&(e=>r(e,200)&&/^[A-Za-z0-9._:-]+$/.test(e))(e.instanceId)&&"string"==typeof e.type&&a(e.payload)),y=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0;t.isInlineGridMessageFromGrid=e=>{if(!m(e))return!1;const n=e.payload;switch(e.type){case t.INLINE_GRID_MESSAGE_TYPE.ANALYTICS:return(e=>{if(!l(e.campaignId)||"string"!=typeof e.action)return!1;switch(e.action){case"amount_change":return f(e,["action","campaignId","currency","donationType","fromAmount","toAmount"])&&c(e.currency)&&("custom"===e.donationType||"preset"===e.donationType)&&y(e.fromAmount)&&y(e.toAmount);case"currency_change":return f(e,["action","campaignId","fromCurrency","toCurrency"])&&c(e.fromCurrency)&&c(e.toCurrency);case"frequency_change":return f(e,["action","campaignId","fromFrequency","toFrequency"])&&g(e.fromFrequency)&&g(e.toFrequency);case"interaction":return f(e,["action","campaignId","trackingId"])&&"string"==typeof e.trackingId&&Object.prototype.hasOwnProperty.call(t.INLINE_GRID_INTERACTIONS,e.trackingId);case"viewed":return f(e,["action","campaignId","donation_amount_default","donation_amount_options","donation_currency_default","donation_currency_options","donation_frequency_default","donation_frequency_options"])&&y(e.donation_amount_default)&&"string"==typeof e.donation_amount_options&&e.donation_amount_options.length<=2e3&&c(e.donation_currency_default)&&"string"==typeof e.donation_currency_options&&e.donation_currency_options.length<=2e3&&g(e.donation_frequency_default)&&"string"==typeof e.donation_frequency_options&&e.donation_frequency_options.length<=500;default:return!1}})(n);case t.INLINE_GRID_MESSAGE_TYPE.HELLO:case t.INLINE_GRID_MESSAGE_TYPE.READY:return f(n,["campaignId"])&&l(n.campaignId);case t.INLINE_GRID_MESSAGE_TYPE.RESIZE:return f(n,["height"])&&"number"==typeof n.height&&Number.isFinite(n.height)&&n.height>0&&n.height<=2e4;case t.INLINE_GRID_MESSAGE_TYPE.SELECTION_UPDATE:return f(n,["amount","currency","frequency"])&&(null===n.amount||d(n.amount))&&c(n.currency)&&g(n.frequency);case t.INLINE_GRID_MESSAGE_TYPE.SUBMIT:return f(n,["amount","campaignId","currency","dedication","designation","frequency","recurringEnd
5Date"])&&l(n.campaignId)&&(e=>d(e.amount)&&c(e.currency)&&g(e.frequency)&&(void 0===e.dedication||h(e.dedication))&&(void 0===e.designation||u(e.designation))&&(void 0===e.recurringEndDate||"one-time"!==e.frequency&&p(e.recurringEndDate)))(n);case t.INLINE_GRID_MESSAGE_TYPE.ERROR:return f(n,["code","phase","reason"])&&"string"==typeof n.code&&s.has(n.code)&&"string"==typeof n.phase&&i.has(n.phase)&&(void 0===n.reason||"string"==typeof n.reason&&o.has(n.reason));default:return!1}};t.makeInlineGridMessage=(e,n,s)=>({instanceId:n,payload:s,protocol:t.INLINE_GRID_PROTOCOL,type:e});const b=e=>{if("string"!=typeof e&&"number"!=typeof e)return;const t=Number(e);return Number.isFinite(t)&&t>0?t:void 0};t.toInlineGridSelectionUpdate=e=>{const t={},n=b(e.amount),s=b(e.designation);if(void 0!==n&&(t.amount=n),"string"==typeof e.currency&&c(e.currency)&&(t.currency=e.currency),""===e.dedication)t.dedication=null;else if("string"==typeof e.dedication){const n={text:e.dedication,type:"memory"===e.dedicationType?"memory":"honor"};h(n)&&(t.dedication=n)}var i;return void 0!==s&&u(s)&&(t.designation=s),g(e.frequency)&&(t.frequency=e.frequency),"string"==typeof e.recurringEndDate&&(""===(i=e.recurringEndDate)||p(i))&&(t.recurringEndDate=e.recurringEndDate),Object.keys(t).length>0?t:null};t.toInlineGridSelection=e=>{if(void 0!==e.amount&&void 0!==e.currency&&e.frequency)return Object.assign(Object.assign(Object.assign({amount:e.amount,currency:e.currency,frequency:e.frequency},void 0!==e.designation&&{designation:e.designation}),e.dedication?{dedication:e.dedication}:{}),e.recurringEndDate?{recurringEndDate:e.recurringEndDate}:{})};t.isUnchangedSelectionField=(e,t,n)=>{if("dedication"===e){const e=t.dedication,s=n.dedication;return null==e?void 0===s:void 0!==s&&s.text===e.text&&s.type===e.type}return"recurringEndDate"===e?(t.recurringEndDate||void 0)===(n.recurringEndDate||void 0):t[e]===n[e]}},4439:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,i)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LifecycleManager=void 0;const r=n(9816),l=n(2048),c=n(8869);t.LifecycleManager=new class{constructor(){this.state="uninitialized",this.currentInstance=null,this.pendingInit=null,this.config={},this.modules={},this.queue=new r.OperationQueue,this.targetWindow=null}init(e={}){return a(this,void 0,void 0,(function*(){return this.pendingInit?this.pendingInit:"initialized"===this.state&&this.currentInstance?(e.onError&&e.onError((0,l.createSDKError)("ALREADY_INITIALIZED","SDK is already initialized")),this.currentInstance):(this.config=e,this.targetWindow=e.win||window,(0,c.setBaseUri)(e.baseUri),this.pendingInit=this.queue.enqueue((()=>a(this,void 0,void 0,(function*(){try{this.state="initializing";const t=yield this.initializeModules();return this.state="initialized",this.currentInstance=t,e.onReady&&e.onReady(),t}catch(t){this.state="uninitialized";const n=t instanceof Error?(0,l.createSDKError)("INIT_FAILED",t.message):(0,l.createSDKError)("INIT_FAILED","Unknown initialization error");throw e.onError&&e.onError(n),n}finally{this.pendingInit=null}})))),this.pendingInit)}))}destroy(){var e;if("uninitialized"!==this.state&&"destroying"!==this.state){this.state="destroying";try{this.cleanupModules(),(null===(e=this.targetWindow)||void 0===e?void 0:e.eg)&&(delete this.targetWindow.eg.modal,delete this.targetWindow.eg.sendAnalyticsEvent),this.currentInstance=null,this.modules={},this.state="uninitialized"}catch(e){this.state="uninitialized"}}}isInitialized(){return"initialized"===this.state}getState(){return this.state}initializeModules(){var e;return a(this,void 0,void 0,(function*(){const t=this.targetWindow,{default:s}=yield Promise.resolve().then((()=>o(n(963)))),{default:i}=yield Promise.resolve().then((()=>o(n(8672)))),{default:a}=yield Promise.resolve().then((()=>o(n(2664)))),{default:r}=yield Promise.resolve().then((()=>o(n(4016)))),{default:l}=yield Promise.resolve().then((()=>o(n(1679)))),{default:c}=yield Promise.resolve().then((()=>o(n(179)))),{default:d}=yield Promise.resolve().then((()=>o(n(1604)))),{createHostPageEventInstrumentation:u}=yield Promise.resolve().then((()=>o(n(1126)))),{makeInlineGridIframeRenderer:h}=yield Promise.resolve().then((()=>o(n(3280)))),{default:p}=yield Promise.resolve().then((()=>o(n(6244)))),{strategyHandlers:g}=yield Promise.resolve().then((()=>o(n(2758)))),f=new s({win:t});this.modules.messenger=f;const m=new i;this.modules.cookiesManager=m;const y=null!==(e=m.getPgdidCookie())&&void 0!==e?e:void 0,b=new a({win:t,cookiesManager:m}),v=b.fetch();this.modules.configService=b;const _=new d({win:t});_.initialize(),_.setupEventListener(),this.modules.analytics=_;const A=new r({getInlineGridParams:e=>{var t;return null===(t=this.modules.inlineGridProtocol)||void 0===t?void 0:t.getSelectionParams(e)},win:t,msg:f,configs:v,pgdid:y,sendAnalyticsEvent:(e,t)=>
5_.sendEvent(e,t)});this.modules.modalCtrl=A;const E=A.sdk(),w=new p({hostPageEventInstrumentation:A.getHostPageEventInstrumentation(),modalSDK:E,win:t});this.modules.inlineGridProtocol=w;const S={iframe:h({fallback:g.donationForm,protocol:w})},C={},x={};f.onDonationChanged((e=>{var t;if(!E.isOpen())return;const{campaignId:n,params:s}=e.data.payload;if(!n)return;if(E.getCampaign()!==n)return;w.syncSelection(n,s);const i=document.querySelector(`cl-donation-form[campaign-id="${n}"]`);if(!i)return;const o=i;(e=>{e.__egHostPageEventSyncDepth=(e.__egHostPageEventSyncDepth||0)+1})(i);try{if(s.currency){const e=("function"==typeof o.getCurrentCurrency?o.getCurrentCurrency():null)||"USD";s.currency!==e&&(o.selectedCurrency=s.currency)}const e=x[n]||o.selectedFrequency||"one-time",i=s.frequency||e,a=s.frequency&&s.frequency!==e;let r=null;if(void 0!==s.amount&&null!==s.amount){const e="string"==typeof s.amount?Number(s.amount):s.amount;!isNaN(e)&&e>0&&(r=e)}if(a){r&&(C[`${n}:${e}`]=r),x[n]=s.frequency,o.selectedFrequency=s.frequency;const t=C[`${n}:${s.frequency}`];t&&(o.selectedAmount=0,o.selectedAmount=t)}else{if(r){C[`${n}:${i}`]=r;const e=null===(t=o.shadowRoot)||void 0===t?void 0:t.querySelector("cl-amount-selector");let s=!1;if(null==e?void 0:e.shadowRoot){e.shadowRoot.querySelectorAll("cl-custom-button").forEach((e=>{const t=e.getAttribute("value");null!==t&&Math.round(Number(t))===Math.round(r)&&(s=!0)}))}o.selectedAmount=0,o.selectedAmount=r,e&&(e.isCustomAmountActive=!s,e.selectedAmount=r),s||(o.externalCustomAmount={frequency:i,amount:r})}s.frequency&&(x[n]=s.frequency,o.selectedFrequency=s.frequency)}}finally{(e=>{Promise.resolve().then((()=>{const t=(e.__egHostPageEventSyncDepth||1)-1;t>0?e.__egHostPageEventSyncDepth=t:delete e.__egHostPageEventSyncDepth}))})(i)}}));const I=u({sendAnalyticsEvent:(e,t)=>_.sendEvent(e,t),sendMessage:f.iframe.sendMessage}),k=new l({win:t,msg:f,modalSDK:E,configs:v,hostPageEventInstrumentation:I});this.modules.abandonCartNudgeTray=k;const R=new c({win:t,modalSDK:E,configs:v,hostPageEventInstrumentation:I,inlineGridRenderers:S,pgdid:y});this.modules.crawler=R;const O=this.createSDKInstance(E,_),D=t.eg;return D&&(D.modal=this.createProxiedModal(E),D.sendAnalyticsEvent=this.createProxiedAnalytics(_)),O}))}createSDKInstance(e,t){return{modal:e,sendAnalyticsEvent:(e,n)=>{if(!this.isInitialized())throw(0,l.createSDKError)("NOT_INITIALIZED","SDK has been destroyed");t.sendEvent(e,n)},destroy:()=>this.destroy(),reinit:e=>(this.destroy(),this.initSync(e||this.config)),isInitialized:()=>this.isInitialized()}}initSync(e){return this.init(e),this.currentInstance}createProxiedModal(e){const t=()=>this.isInitialized();return new Proxy(e,{get(e,n){if(!t())throw(0,l.createSDKError)("NOT_INITIALIZED","SDK has been destroyed");return e[n]}})}createProxiedAnalytics(e){return(t,n)=>{if(!this.isInitialized())throw(0,l.createSDKError)("NOT_INITIALIZED","SDK has been destroyed");e.sendEvent(t,n)}}cleanupModules(){const e=["abandonCartNudgeTray","crawler","inlineGridProtocol","analytics","modalCtrl","configService","cookiesManager","messenger"];for(const t of e){const e=this.modules[t];if(e&&"function"==typeof e.destroy)try{e.destroy()}catch(e){console.error(`[eg] Failed to destroy ${t}:`,e)}}}}},9816:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OperationQueue=void 0;t.OperationQueue=class{constructor(){this.queue=[],this.processing=!1,this.lastOperationTime=0,this.RAPID_CYCLE_THRESHOLD_MS=100}enqueue(e){return n(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{const s={operation:e,resolve:t,reject:n,cancelled:!1};this.queue.push(s),this.trackTiming(),this.processQueue()}))}))}cancelPending(){this.queue.forEach((e=>{e.cancelled=!0,e.reject(new Error("Operation cancelled"))})),this.queue=[]}isRapidCycle(){return Date.now()-this.lastOperationTime<this.RAPID_CYCLE_THRESHOLD_MS}get pendingCount(){return this.queue.length}trackTiming(){this.lastOperationTime=Date.now()}processQueue(){return n(this,void 0,void 0,(function*(){if(!this.processing&&0!==this.queue.length){for(this.processing=!0;this.queue.length>0;){const e=this.queue.shift();if(e&&!e.cancelled)try{const t=yield e.operation();e.cancelled||e.resolve(t)}catch(t){e.cancelled||e.reject(t)}}this.processing=!1}}))}}},2048:(e,t)=>
5{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSDKError=t.createSDKError=void 0;const n=["IFRAME_LOAD_TIMEOUT","INIT_FAILED","ALREADY_INITIALIZED"];class s extends Error{constructor(e,t,n,i){super(t),this.name="SDKError",this.code=e,this.recoverable=n,this.context=i,Object.setPrototypeOf(this,s.prototype)}}t.createSDKError=function(e,t,i){const o=n.includes(e),a=new s(e,t,o,i);return console.error(`[eg] ${e}: ${t}`,i||""),a},t.isSDKError=function(e){return e instanceof s}},9205:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(2681);t.default=class{constructor(){this.isAppReady=!1,this.eventQueue=[],this.register=e=>{this.iframe=e,this.isAppReady&&this._flushQueue()},this.reset=()=>{this.iframe=void 0,this.isAppReady=!1,this.eventQueue=[]},this.sendMessage=e=>{var t;this.isAppReady&&(null===(t=this.iframe)||void 0===t?void 0:t.contentWindow)?this._postMessage(e):this._queueMessage(e)},this._queueMessage=e=>{this.eventQueue.push(e)},this._flushQueue=()=>{var e;if(this.isAppReady&&(null===(e=this.iframe)||void 0===e?void 0:e.contentWindow))for(;this.eventQueue.length>0;){const e=this.eventQueue.shift();this._postMessage(e)}},this._postMessage=e=>{var t;(null===(t=this.iframe)||void 0===t?void 0:t.contentWindow)&&this.iframe.contentWindow.postMessage(e,"*")},this.setAppReady=()=>{this.isAppReady=!0},this.sendSDKInitMessage=e=>{this._postMessage({type:s.SDK_INIT,payload:{safeguardToken:"insectsdofly",iaa:e.iaa}}),this._flushQueue()}}}},2681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DONATION_CLOSE_REQUESTED_MSG_TO_APP=t.HOST_PAGE_EVENTS_MSG_TO_APP=t.DONATION_PARAMS_UPDATE=t.SDK_INIT=t.DONATION_CLOSE_CONFIRMED_MSG_FROM_APP=t.DONATION_CLOSE_INTERCEPT_READY_MSG_FROM_APP=t.EMBEDDED_APP_VISIBLE=t.DONATION_COMPLETED_MSG_FROM_APP=t.DONATION_CHANGED_MSG_FROM_APP=t.DONATION_READY_MSG_FROM_APP=t.TEALIUM_ANALYTICS_EVENT_MSG_FROM_APP=t.ANALYTICS_EVENT_MSG_FROM_APP=t.GA4_INIT_MSG_FROM_APP=void 0,t.GA4_INIT_MSG_FROM_APP="GA4_INIT_MSG_FROM_APP",t.ANALYTICS_EVENT_MSG_FROM_APP="ANALYTICS_EVENT_MSG_FROM_APP",t.TEALIUM_ANALYTICS_EVENT_MSG_FROM_APP="TEALIUM_ANALYTICS_EVENT_MSG_FROM_APP",t.DONATION_READY_MSG_FROM_APP="DONATION_READY_MSG_FROM_APP",t.DONATION_CHANGED_MSG_FROM_APP="DONATION_CHANGED_MSG_FROM_APP",t.DONATION_COMPLETED_MSG_FROM_APP="DONATION_COMPLETED_MSG_FROM_APP",t.EMBEDDED_APP_VISIBLE="EMBEDDED_APP_VISIBLE",t.DONATION_CLOSE_INTERCEPT_READY_MSG_FROM_APP="DONATION_CLOSE_INTERCEPT_READY_MSG_FROM_APP",t.DONATION_CLOSE_CONFIRMED_MSG_FROM_APP="DONATION_CLOSE_CONFIRMED_MSG_FROM_APP",t.SDK_INIT="SDK_INIT",t.DONATION_PARAMS_UPDATE="DONATION_PARAMS_UPDATE",t.HOST_PAGE_EVENTS_MSG_TO_APP="HOST_PAGE_EVENTS_MSG_TO_APP",t.DONATION_CLOSE_REQUESTED_MSG_TO_APP="DONATION_CLOSE_REQUESTED_MSG_TO_APP"},963:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=s(n(2179)),o=s(n(9205)),a=n(2681);t.default=class{constructor(e){this.messageListener=null,this.destroyed=!1,this._subscribe=()=>{this.messageListener=e=>{const t=["https://giving.gofundme.com/donate/embedded","https://giving.gofundme.com/embedded","https://giving.classy.org/embedded"].filter((e=>Boolean(e)));if(!(e.origin===this.props.win.location.origin||t.some((t=>t.startsWith(e.origin)))))return void console.warn("Untrusted origin:",e.origin);if(!e.data)return;const{type:n,payload:s}=e.data;n&&s&&this.pubsub.publish({name:n,data:{type:n,payload:s,source:e.source}})},this.props.win.addEventListener("message",this.messageListener)},this.onGA4Init=e=>{this.pubsub.subscribe(a.GA4_INIT_MSG_FROM_APP,e)},this.onAnalyticsEvent=e=>{this.pubsub.subscribe(a.ANALYTICS_EVENT_MSG_FROM_APP,e)},this.onTealiumAnalyticsEvent=e=>{this.pubsub.subscribe(a.TEALIUM_ANALYTICS_EVENT_MSG_FROM_APP,e)},this.onDonationReady=e=>{this.pubsub.subscribe(a.DONATION_READY_MSG_FROM_APP,e)},this.onDonationChanged=e=>{this.pubsub.subscribe(a.DONATION_CHANGED_MSG_FROM_APP,e)},this.onDonationCompleted=e=>{this.pubsub.subscribe(a.DONATION_COMPLETED_MSG_FROM_APP,e)},this.onDonationCloseInterceptReady=e=>{this.pubsub.subscribe(a.DONATION_CLOSE_INTERCEPT_READY_MSG_FROM_APP,e)},this.onDonationCloseConfirmed=e=>{this.pubsub.subscribe(a.DONATION_CLOSE_CONFIRMED_MSG_FROM_APP,e)}
5,this.props=e,this.pubsub=new i.default,this.iframe=new o.default,this._subscribe()}destroy(){this.destroyed||(this.destroyed=!0,this.messageListener&&(this.props.win.removeEventListener("message",this.messageListener),this.messageListener=null),this.pubsub.unsubscribeAll(),this.iframe.reset())}}},4016:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function a(e){try{l(s.next(e))}catch(e){o(e)}}function r(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,r)}l((s=s.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n(5864)),a=i(n(1127)),r=n(2681),l=n(8392),c=n(1126),d=n(3918);t.default=class{constructor(e){this.destroyed=!1,this.cachedViews=new Map,this.unopenedPreloads=new Set,this.pendingHostPageEventMessages=new Map,this.eg3SDKLoadTrackedCampaigns=new Set,this.readyCampaigns=new Set,this.closeInterceptReadyCampaigns=new Set,this.reinitializingCampaigns=new Set,this.completedCampaigns=new Set,this.loadedViews=new WeakSet,this.sdk=()=>this.modal.sdk(),this.getHostPageEventInstrumentation=()=>this.hostPageEventInstrumentation,this._onLoad=e=>{e.data.campaign&&(this._subscribeToOpenEvent(e),this.modal.open(e.data.campaign,e.data.params))},this._subscribeToOpenEvent=({data:{campaign:e,params:t}})=>s(this,void 0,void 0,(function*(){var n,s;if(!e)return;this.pendingParams=t;const i=void 0!==t.amount||void 0!==t.frequency||void 0!==t.recurring||void 0!==t.currency;this.pendingInlineGridParams=i||null===(s=(n=this.props).getInlineGridParams)||void 0===s?void 0:s.call(n,e),this.view&&this.view.getCampaign()===e?(this._showView(this.view),this._sendDonationParamsUpdate(t)):this.view?(this._deactivateCurrentView(),yield this._activateCampaign(e,t,!0)):yield this._activateCampaign(e,t),this._sendEmbeddedAppVisibleEvent()})),this._activateCampaign=(e,t,n=!1)=>s(this,void 0,void 0,(function*(){yield this.props.configs;const s=this.cachedViews.get(e);s?(this.view=s,this.unopenedPreloads.delete(e),this._showView(this.view),this._registerCachedView(e,this.view,n),this._sendDonationParamsUpdate(t),0===this.unopenedPreloads.size&&this._removePreloadListener()):yield this._appendView(e,t,"visible")})),this._setViewVisibility=(e,t)=>{e.style.display="block",e.style.visibility=t,"visible"===t?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true")},this._showView=e=>{const{body:t}=this.props.win.document;t.style.overflow="hidden",this._setViewVisibility(e,"visible")},this._hideViewOnly=e=>{this._setViewVisibility(e,"hidden")},this._deactivateCurrentView=()=>{if(!this.view)return;const e=this.view.getCampaign();!this.readyCampaigns.has(e)||this.completedCampaigns.has(e)?this._removeView():this._hideViewOnly(this.view)},this._registerCachedView=(e,t,n)=>{n&&this.props.msg.iframe.reset(),this.readyCampaigns.has(e)&&this.props.msg.iframe.setAppReady(),this.props.msg.iframe.register(t.getIframe())},this._handleIframeLoad=e=>s(this,void 0,void 0,(function*(){const t=this.cachedViews.get(e);if(t)if(this.loadedViews.has(t)){if(!this.unopenedPreloads.has(e))if(this.completedCampaigns.delete(e),this.readyCampaigns.delete(e),this.view===t){this.reinitializingCampaigns.add(e);try{this.props.msg.iframe.reset(),this.props.msg.iframe.register(t.getIframe());const n=(yield this.props.configs)[e];if(!n||this.view!==t)return;this.props.msg.iframe.setAppReady(),this.props.msg.iframe.sendSDKInitMessage(n),this.readyCampaigns.add(e),this._flushHostPageEventMessages(e),this.pendingParams&&this._sendDonationParamsUpdate(this.pendingParams),this.modal.getIsOpen()&&this._sendEmbeddedAppVisibleEvent()}catch(e){console.warn("[SDK] Failed to reinitialize reloaded iframe:",e)}finally{this.reinitializingCampaigns.delete(e)}}else yield this._initializeInactiveIframe(e,!1)}else this.loadedViews.add(t)})),this._initializeInactiveIframe=(e,t)=>s(this,void 0,void 0,(function*(){try{const n=(yield this.props.configs)[e],s=this.cachedViews.get(e);if(!n||!s||s===this.view||!s.getIframe().contentWindow)return;this._postSDKInitMessage(s,n),t&&(this.readyCampaigns.add(e),this._flushHostPageEventMessages(e))}catch(e){console.warn("[SDK] Failed to initialize inactive iframe:",e)}})),this._postSDKInitMessage=(e,t)=>
5{var n;null===(n=e.getIframe().contentWindow)||void 0===n||n.postMessage({type:r.SDK_INIT,payload:{safeguardToken:"insectsdofly",iaa:t.iaa}},"*")},this._handleDonationCompleted=e=>{var t;const n=this._getCampaignBySource(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source);n&&this.completedCampaigns.add(n)},this._sendHostPageEventMessage=e=>{const t=e.payload.campaignId,n=this.cachedViews.get(t),s=null==n?void 0:n.getIframe();(null==s?void 0:s.contentWindow)&&this.readyCampaigns.has(t)?s.contentWindow.postMessage(e,"*"):this._queueHostPageEventMessage(e)},this._queueHostPageEventMessage=e=>{const t=e.payload.campaignId,n=this.pendingHostPageEventMessages.get(t)||[];n.push(e),this.pendingHostPageEventMessages.set(t,n)},this._flushHostPageEventMessages=e=>{const t=this.cachedViews.get(e),n=null==t?void 0:t.getIframe(),s=this.pendingHostPageEventMessages.get(e);(null==n?void 0:n.contentWindow)&&(null==s?void 0:s.length)&&this.readyCampaigns.has(e)&&(s.forEach((e=>{var t;return null===(t=n.contentWindow)||void 0===t?void 0:t.postMessage(e,"*")})),this.pendingHostPageEventMessages.delete(e))},this._subscribeToHoverEvent=({data:{campaign:e,params:t}})=>s(this,void 0,void 0,(function*(){var n,s;e&&(0===this.cachedViews.size&&(yield this._appendView(e,t,"hidden")),null===(s=null===(n=window.eg)||void 0===n?void 0:n.sendAnalyticsEvent)||void 0===s||s.call(n,"studio_checkout_cta_hover",{campaign:e,params:t}))})),this._subscribeToCloseEvent=({data:{campaign:e}})=>{var t,n;this._hideView(),null===(n=null===(t=window.eg)||void 0===t?void 0:t.sendAnalyticsEvent)||void 0===n||n.call(t,"studio_checkout_close",{campaign:e})},this._hideView=()=>{const{body:e}=this.props.win.document;e.style.overflow="inherit",this.view&&this._hideViewOnly(this.view)},this._removeView=()=>{var e,t;const{body:n}=this.props.win.document;n.style.overflow="inherit";const s=null===(e=this.view)||void 0===e?void 0:e.getCampaign();null===(t=this.view)||void 0===t||t.remove(),s&&(this.cachedViews.delete(s),this.unopenedPreloads.delete(s),this.readyCampaigns.delete(s),this.reinitializingCampaigns.delete(s),this.completedCampaigns.delete(s),this.pendingHostPageEventMessages.delete(s),this.closeInterceptReadyCampaigns.delete(s),this.view&&this.loadedViews.delete(this.view)),this.view=void 0},this._removeAllPreloadedViews=()=>{this.unopenedPreloads.forEach((e=>{const t=this.cachedViews.get(e);null==t||t.remove(),this.cachedViews.delete(e),this.readyCampaigns.delete(e),this.reinitializingCampaigns.delete(e),this.completedCampaigns.delete(e),this.pendingHostPageEventMessages.delete(e),t&&this.loadedViews.delete(t)})),this.unopenedPreloads.clear()},this._removeAllViews=()=>{const e=new Set(this.cachedViews.values());this.view&&e.add(this.view),e.forEach((e=>e.remove())),e.forEach((e=>this.loadedViews.delete(e))),this.cachedViews.clear(),this.unopenedPreloads.clear(),this.readyCampaigns.clear(),this.reinitializingCampaigns.clear(),this.completedCampaigns.clear(),this.pendingHostPageEventMessages.clear(),this.closeInterceptReadyCampaigns.clear(),this.view=void 0},this._removePreloadListener=()=>{this.preloadListener&&(this.props.win.removeEventListener("message",this.preloadListener),this.preloadListener=void 0)},this._getActiveCampaign=()=>{var e;return null===(e=this.view)||void 0===e?void 0:e.getCampaign()},this._getCampaignBySource=e=>{if(e)for(const[t,n]of this.cachedViews)if(n.getIframe().contentWindow===e)return t},this._appendView=(e,t,n)=>s(this,void 0,void 0,(function*(){const{body:s}=this.props.win.document;"visible"===n&&(s.style.overflow="hidden");const i=(yield this.props.configs)[e];this.cachedViews.has(e)?"visible"===n&&(yield this._activateCampaign(e,t)):(this.props.msg.iframe.reset(),this.view=new o.default({campaign:e,params:t,subscribeToCloseEvent:this.modal.close,onIframeLoad:this._handleIframeLoad,config:i,pgdid:this.props.pgdid}),this._setViewVisibility(this.view,n),s.appendChild(this.view),this.cachedViews.set(e,this.view),this.props.msg.iframe.register(this.view.getIframe()))})),this._getPreloadCampaignId=e=>{const t=this.modal.getCampaign();if(t&&e[t])return t;const n=this._getCampaignIdsInDomOrder();for(const t of n)if(e[t])return t;return Object.keys(e)[0]},this._getCampaignIdsInDomOrder=()=>{const e=new Set;return this.props.win.document.querySelectorAll(`[${l.CLASSY_ATTR}], a[href*=${l.CLASSY_HREF}]`).forEach((t=>{const n=t.getAttribute(l.CLASSY_ATTR);if(n)return void e.add(n);if(!(t instanceof HTMLAnchorElement))return;const s=t.getAttribute("href");if(!s)return;const i=this._extractCampaignIdFromHref(s);i&&e.add(i)})),[...e]},this._extractCampaignIdFromHref=e=>{if(e.startsWith(`${l.CLASSY_HREF}=`))return e.split("=")[1]||null;(e.startsWith("/?")||e.startsWith("?"))&&(e="https://placeholder.com"+e);try{return new URL(e).searchParams.get(l.CLASSY_HREF)}catch(e){return null}},this._preloadIframes=()=>s(this,void 0,void 0,(function*(){const e=yield this.props.configs,t=this._getPreloadCampaignId(e);if(!t||this.destroyed)return;if(this.view)return;const n=["https://giving.gofundme.com/donate/embedded","https://giving.gofundme.com/embedded","https://giving.classy.org/embedded"].filter((e=>Boolean(e)));this.preloadListener=t=>{var s;if((t.origin===location.origin||n.some((e=>e.startsWith(t.origin))))&&(null===(s=t.data)||void 0===s?void 0:s.type)===r.DONATION_READY_MSG_FROM_APP)for(const n of this.unopenedPreloads){const s=this.cachedViews.get(n);if(!s)continue;const i=s.getIframe();
5if(i.contentWindow===t.source){const t=e[n];if(t&&i.contentWindow){this._postSDKInitMessage(s,t),this.readyCampaigns.add(n),this._flushHostPageEventMessages(n);const e=this._getActiveCampaign();e&&e!==n||(this.props.msg.iframe.setAppReady(),this.props.msg.iframe.register(i)),this.eg3SDKLoadTrackedCampaigns.has(n)||(this.eg3SDKLoadTrackedCampaigns.add(n),this.hostPageEventInstrumentation.track(d.eg3SDKLoadEvent,{campaignId:n,data:{entry_source:"hosted_checkout"}}))}break}}},this.props.win.addEventListener("message",this.preloadListener);const{body:s}=this.props.win.document;if(this.destroyed||this.view)return;const i=e[t],a=new o.default({campaign:t,params:this.modal.getParams(),subscribeToCloseEvent:this.modal.close,onIframeLoad:this._handleIframeLoad,config:i,pgdid:this.props.pgdid});this._setViewVisibility(a,"hidden"),s.appendChild(a),this.cachedViews.set(t,a),this.unopenedPreloads.add(t)})),this._shouldInterceptClose=()=>{const e=this.modal.getCampaign()||this._getActiveCampaign();return!!e&&this.closeInterceptReadyCampaigns.has(e)},this._sendDonationCloseRequestedEvent=()=>{const e=this.modal.getCampaign()||this._getActiveCampaign(),t=e?this.cachedViews.get(e):this.view,n=null==t?void 0:t.getIframe();e&&(null==n?void 0:n.contentWindow)&&this.readyCampaigns.has(e)?n.contentWindow.postMessage({type:r.DONATION_CLOSE_REQUESTED_MSG_TO_APP,payload:{}},"*"):this.modal.forceClose()},this._sendEmbeddedAppVisibleEvent=()=>{this.props.msg.iframe.sendMessage({type:r.EMBEDDED_APP_VISIBLE,payload:{}})},this._sendDonationParamsUpdate=e=>{this.props.msg.iframe.sendMessage({type:r.DONATION_PARAMS_UPDATE,payload:this.pendingInlineGridParams?{params:Object.assign(Object.assign({},e),this.pendingInlineGridParams),submit:!1}:{params:e}})},this.props=e,this.hostPageEventInstrumentation=(0,c.createHostPageEventInstrumentation)({sendAnalyticsEvent:e.sendAnalyticsEvent,sendMessage:this._sendHostPageEventMessage}),this.modal=new a.default({win:e.win,shouldInterceptClose:this._shouldInterceptClose,onCloseRequested:this._sendDonationCloseRequestedEvent}),this.modal.onLoad(this._onLoad),this.modal.subscribeToOpenEvent(this._subscribeToOpenEvent),this.modal.subscribeToCloseEvent(this._subscribeToCloseEvent),this.modal.subscribeToHoverEvent(this._subscribeToHoverEvent),this.props.msg.onDonationCloseInterceptReady((e=>{var t;const n=this._getCampaignBySource(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source);n&&this.closeInterceptReadyCampaigns.add(n)})),this.props.msg.onDonationCloseConfirmed((e=>{var t;const n=this._getCampaignBySource(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source),s=this.modal.getCampaign()||this._getActiveCampaign();n&&s&&n!==s||this.modal.forceClose()})),this.props.msg.onDonationReady((e=>s(this,void 0,void 0,(function*(){var t;const n=this._getCampaignBySource(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source),s=this.modal.getCampaign()||this._getActiveCampaign();if(n&&this.unopenedPreloads.has(n))return;if(n&&s&&n!==s)return void(this.cachedViews.get(n)!==this.view&&(yield this._initializeInactiveIframe(n,!0)));const i=n||s;if(!i)return;if(this.reinitializingCampaigns.has(i))return;this.props.msg.iframe.setAppReady();const o=(yield this.props.configs)[i];o&&(this.props.msg.iframe.sendSDKInitMessage(o),this.readyCampaigns.add(i),this._flushHostPageEventMessages(i),this.eg3SDKLoadTrackedCampaigns.has(i)||(this.eg3SDKLoadTrackedCampaigns.add(i),this.hostPageEventInstrumentation.track(d.eg3SDKLoadEvent,{campaignId:i,data:{entry_source:"hosted_checkout"}})),this.pendingParams&&this._sendDonationParamsUpdate(this.pendingParams))})))),this.props.msg.onDonationCompleted(this._handleDonationCompleted),this._preloadIframes().catch((e=>{console.warn("[SDK Preload] failed:",e)}))}destroy(){this.destroyed||(this.destroyed=!0,this.modal.getIsOpen()&&this.modal.forceClose(),this._removeAllViews(),this._removePreloadListener(),this.modal.destroy())}}},1127:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MODAL_CLOSE_EVENT=t.MODAL_HOVER_EVENT=t.MODAL_OPEN_EVENT=t.MODAL_LOAD_EVENT=void 0;const i=s(n(2979)),o=s(n(2179));t.MODAL_LOAD_EVENT="load",t.MODAL_OPEN_EVENT="open",t.MODAL_HOVER_EVENT="hover",t.MODAL_CLOSE_EVENT="close";t.default=class{constructor(e){this.destroyed=!1,this.prev=null,this._onNavPopstate=e=>{const{campaign:n}=e.data;n?(this._isOpen=!0,this.pubsub.publish({name:t.MODAL_OPEN_EVENT,data:this.nav.get()})):(this._isOpen=!1,this.pubsub.publish({name:t.MODAL_CLOSE_EVENT,data:this.nav.get()}))},this.open=(e,n)=>{if(this.lockBodyScroll(),this._isOpen)return;this.nav.setClassyParams(e,n);const s=this.nav.get();this.pubsub.publish({name:t.MODAL_OPEN_EVENT,data:Object.assign(Object.assign({},s),{params:Object.assign(Object.assign({},s.params),""===n.dedication&&{dedication:""})})}),this._isOpen=!0},this.subscribeToOpenEvent=e=>this.pubsub.subscribe(t.MODAL_OPEN_EVENT,e),this.close=()=>{var e,t,n,s;this._isOpen&&(null===(t=(e=this.props).shouldInterceptClose)||void 0===t?void 0:t.call(e))?null===(s=(n=this.props).onCloseRequested)||void 0===s||s.call(n):this._close()},this.forceClose=()=>{this._close()},this._close=()=>{this.unlockBodyScroll(),this._isOpen&&(this.nav.removeClassyParams(),this.pubsub.publish({name:t.MODAL_CLOSE_EVENT,data:this.nav.get()}),this._isOpen=!1)},this.subscribeToCloseEvent=e=>this.pubsub.subscribe(t.MODAL_CLOSE_EVENT,e),this.hover=(e,n)=>{this.pubsub.publish({name:t.MODAL_HOVER_EVENT,data:{campaign:e,params:n}})},this.subscribeToHoverEvent=e=>this.pubsub.subscribe(t.MODAL_HOVER_EVENT,e),this.unsubscribe=e=>{this.pubsub.unsubscribe(e)},this.onLoad=e=>{e({name:t.MODAL_LOAD_EVENT,data:this.nav.get()})},this.getParams=()=>this.nav.get().params,this.getCampaign=()=>this.nav.get().campaign,this.__handleKeydown=e=>{"Escape"!==e.key&&27!==e.keyCode||this.close()},this.setConfig=e=>{this.config=e},this.getConfig=()=>this.config,this.getIsOpen=()=>this._isOpen,this.sdk=()=>({open:this.open,close:this.close,hover:this.hover,isOpen:this.getIsOpen,getCampaign:this.getCampaign,getParams:this.getParams,getConfig:this.getConfig,setConfig:this.setConfig,subscribeToOpenEvent:this.subscribeToOpenEvent,subscribeToCloseEvent:this.subscribeToCloseEvent,subscribeToHoverEvent:this.subscribeToHoverEvent,unsubscribe:this.unsubscribe}),this.lockCount=0,this.scrollY=0,this.prev=null,this.props=e,this.nav=new i.default({win:this.props.win}),this.nav.onPopstate(this._onNavPopstate),this.pubsub=new o.default,this._isOpen=!!this.nav.get().campaign,this.props.win.addEventListener("keydown",this.__handleKeydown),document.addEventListener("keydown",this.__handleKeydown)}destroy(){this.destroyed||(this.destroyed=!0,this.props.win.removeEventListener("keydown",this.__handleKeydown),document.removeEventListener("keydown",this.__handleKeydown),this.pubsub.unsubscribeAll(),this._isOpen=!1)}lockBodyScroll(){this.lockCount+=1,this.lockCount>1||(this.scrollY=window.scrollY||window.pageYOffset||0,this.prev={position:document.body.style.position,top:document.body.style.top,left
5:document.body.style.left,right:document.body.style.right,width:document.body.style.width,overflow:document.body.style.overflow,touchAction:document.body.style.touchAction,overscrollBehavior:document.body.style.overscrollBehavior},document.body.style.position="fixed",document.body.style.top=`-${this.scrollY}px`,document.body.style.left="0",document.body.style.right="0",document.body.style.width="100%",document.body.style.overflow="hidden",document.body.style.touchAction="none",document.body.style.overscrollBehavior="none")}unlockBodyScroll(){0!==this.lockCount&&(this.lockCount-=1,this.lockCount>0||(this.prev?(document.body.style.position=this.prev.position,document.body.style.top=this.prev.top,document.body.style.left=this.prev.left,document.body.style.right=this.prev.right,document.body.style.width=this.prev.width,document.body.style.overflow=this.prev.overflow,document.body.style.touchAction=this.prev.touchAction,document.body.style.overscrollBehavior=this.prev.overscrollBehavior,this.prev=null):(document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.width="",document.body.style.overflow="",document.body.style.touchAction="",document.body.style.overscrollBehavior=""),window.scrollTo(0,this.scrollY)))}}},5864:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(862),i=n(8869);class o extends HTMLElement{constructor(e){super(),this.syncNarrowViewportScale=()=>this._syncNarrowViewportScale(),this.getIframe=()=>this.iframe,this.getCampaign=()=>this.props.campaign,this.getParams=()=>this.props.params,this._bindViewportEvents=()=>{var e;const t=this.ownerDocument.defaultView;null==t||t.addEventListener("resize",this.syncNarrowViewportScale),null===(e=null==t?void 0:t.visualViewport)||void 0===e||e.addEventListener("resize",this.syncNarrowViewportScale)},this._isContentPanelEnabled=()=>{if(!this.props.config)return!1;const e=(0,s.getComponentSectionByType)("checkout","content-pane",this.props.config);return!0===(null==e?void 0:e.props.enabled)},this._unbindEvents=()=>{var e;this.closeBtn.removeEventListener("click",this.props.subscribeToCloseEvent);const t=this.ownerDocument.defaultView;null==t||t.removeEventListener("resize",this.syncNarrowViewportScale),null===(e=null==t?void 0:t.visualViewport)||void 0===e||e.removeEventListener("resize",this.syncNarrowViewportScale)},this._syncNarrowViewportScale=()=>{const e=this.ownerDocument.defaultView,t=this.ownerDocument.documentElement.clientWidth||(null==e?void 0:e.innerWidth)||376;if(t>=376)return this.removeAttribute("data-eg-narrow-viewport"),this.style.removeProperty("--eg-modal-iframe-scale"),this.style.removeProperty("--eg-modal-iframe-layout-width"),void this.style.removeProperty("--eg-modal-iframe-layout-height");const n=t/400;this.setAttribute("data-eg-narrow-viewport",""),this.style.setProperty("--eg-modal-iframe-scale",String(n)),this.style.setProperty("--eg-modal-iframe-layout-width","400px"),this.style.setProperty("--eg-modal-iframe-layout-height",100/n+"%")},this._makeCSS=()=>{const e=document.createElement("style");return e.textContent="\n      .eg-modal {\n        position: fixed;\n        top: 0;\n        left: 0;\n        right: 0;\n        height: calc(100dvh - 45px);\n        background: rgba(26, 25, 25, 0.8);\n        z-index: 2147483645;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        pointer-events: auto;\n        padding-top: 45px;\n      }\n\n      .eg-modal--window {\n        position: relative;\n        height: 100%;\n        min-width: 0;\n        max-width: 100vw;\n        border-radius: 20px;\n        max-height: 680px;\n        pointer-events: auto;\n        display: flex;\n        flex-direction: column;\n      }\n\n      .eg-modal--close {\n        position: absolute;\n        top: -36px;\n        right: 0px;\n        cursor: pointer;\n        z-index: 2;\n        border: none;\n        background: transparent;\n        height: 24px;\n        color: var(--neutral-100, #FFF);;\n        text-align: center;\n        font-family: sans-serif;\n        font-size: 14px;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        transition: color 0.2s ease;\n      }\n\n      .eg-modal--close:hover {\n        opacity: 0.8;\n      }\n      .eg-modal--close-x {\n        font-size: 20px;\n        margin-left: 3px;\n        margin-bottom: 2px;\n      }\n\n      .eg-modal--iframe {\n        flex: 1;\n        width: var(--eg-modal-iframe-layout-width, 100%);\n        border: none;\n        border-radius: 20px;\n        z-index: 1;\n      }\n\n      :host([data-eg-narrow-viewport]) .eg-modal--iframe {\n        align-self: center;\n        flex: 0 0 var(--eg-modal-iframe-layout-height, 100%);\n        height: var(--eg-modal-iframe-layout-height, 100%);\n        max-width: none;\n        transform: scale(var(--eg-modal-iframe-scale, 1));\n        transform-origin: top center;\n      }\n\n      .eg-modal--loader {\n        position: absolute;\n        top: 0;\n        left: 0;\n        width: 100%;\n        height: 100%;\n        z-index: 2;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        animation: zoom-in 0.25s ease;\n        background: white;\n        border-radius: 20px;\n      }\n\n      .eg-modal--loader--inner {\n        padding: 48px;\n        background: white;\n        border-radius: 20px;\n        text-align: center;\n        color: #1B1918;\n      }\n\n      .eg-modal--loader--title {\n        font-size: 1.125em;\n        \n      }\n\n      .eg-modal--loader--body {\n        font-size: .85em;\n      }\n\n      @keyframes zoom-in {\n        0% {\n          transform: scale(0.5, 0.5);\n        }\n        100% {\n          transform: scale(1, 1);\n        }\n      }\n\n      @media (max-width: 783px) {\n        .eg-modal--window {\n          width: min(440px, 100vw) !important;\n        }\n      }\n    ",e},this._makeHTML=()=>{const e=document.createElement("div");e.setAttribute("class","eg-modal");const t=document.createElement("div");t.setAttribute("class","eg-modal--window");const n=this._isContentPanelEnabled()?"992px":"440px";return t.style.width=n,t.appendChild(this.closeBtn),t.appendChild(this.iframe),t.appendChild(this.loader),e.appendChild(t),e},this._makeIframe=()=>{var e;const t=document.createElement("iframe"),n=(null===(e=this.props.config)||void 0===e?void 0:e.organizationName)?`Donate to ${this.props.config.organizationName}`:"Donate";return t.setAttribute("frameborder","0"),t.setAttribute("allow","payment; clipboard-write; clipboard-read;"),t.setAttribute("allowfullscreen","true"),t.setAttribute("allowpaymentrequest","true"),t.setAttribute("class","eg-modal--iframe"),t.setAttribute("name",`eg-modal-iframe--${this.props.campaign}`),t.setAttribute("src",this._makeIframeSrc()),t.setAttribute("title",n),t},this._makeLoader=()=>{const e=document.createElement("div");return e.setAttribute("class","eg-modal--loader"),e.innerHTML='\n      <div class="eg-modal--loader--inner">\n      <svg xmlns="http://www.w3.org/2000/svg" width="3em" height="3em" viewBox="0 0 24 24">\n        <path fill="#425CCD" d="M10.72,19.9a8,8,0,0,1-6.5-9.79A7.77,7.77,0,0,1,10.4,4.16a8,8,0,0,1,9.49,6.52A1.54,1.54,0,0,0,21.38,12h.13a1.37,1.37,0,0,0,1.38-1.54,11,11,0,1,0-12.7,12.39A1.54,1.54,0,0,0,12,21.34h0A1.47,1.47,0,0,0,10.72,19.9Z">\n          <animateTransform attributeName="transform" dur="0.75s" repeatCount="indef
5inite" type="rotate" values="0 12 12;360 12 12" />\n        </path>\n      </svg>\n        <div class="eg-modal--loader--title">One moment, please</div>\n      </div>\n    ',e},this._makeCloseBtn=()=>{const e=document.createElement("button");return e.innerHTML='<span class="eg-modal--close-text">Close</span> <span class="eg-modal--close-x">&times;</span>',e.setAttribute("label","Close"),e.setAttribute("class","eg-modal--close"),e.addEventListener("click",this.props.subscribeToCloseEvent),e},this._makeIframeSrc=()=>`${(0,i.getIframeBaseUri)()}/?${new URLSearchParams(Object.assign(Object.assign(Object.assign({cid:this.props.campaign},this.props.params),this.props.pgdid&&{pgdid:this.props.pgdid}),{sdk_build:"a0578322",sdk_origin:(0,i.getSdkScriptOrigin)(),sdk_route:(0,i.getIframeRouteReason)()})).toString()}`,this.props=e;const t=this.attachShadow({mode:"open"});this.loader=this._makeLoader(),this.iframe=this._makeIframe(),this.closeBtn=this._makeCloseBtn(),t.append(this._makeCSS()),t.append(this._makeHTML()),this._syncNarrowViewportScale(),this._bindViewportEvents(),this.iframe.addEventListener("load",(()=>{var e,t;this.loader.remove(),null===(t=(e=this.props).onIframeLoad)||void 0===t||t.call(e,this.props.campaign)}))}disconnectedCallback(){this._unbindEvents()}}t.default=o,customElements.get("eg-modal")||customElements.define("eg-modal",o)},2979:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=s(n(2179)),o=n(1118),a="popstate";t.default=class{constructor(e){this.get=()=>this.state,this.setClassyParams=(e,t)=>{const n=this._getAllParams();delete n.campaign,this._pushState(Object.assign(Object.assign({campaign:e},n),t)),this.state=this._getState()},this.removeClassyParams=()=>{this._pushState(this.preserveParamsFromMount),this.state=this._getState()},this.onPopstate=e=>{this.pubsub.subscribe(a,e)},this._onPopstate=()=>{this.state=this._getState(),this.pubsub.publish({name:a,data:this.state})},this._getState=()=>({campaign:this._getCampaign(),params:this._getClassyParams()}),this._getCampaign=()=>this._getAllParams()[o.CAMPAIGN_PARAM]||void 0,this._getClassyParams=()=>{const e=this._getAllParams(),t=o.CLASSY_PARAMS.reduce(((t,n)=>{const s=e[n];return s&&(t[n]=s),t}),{}),n=Object.keys(e).filter((e=>e.startsWith("utm_"))).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{});return Object.assign(Object.assign({},t),n)},this._collectPreserveEligibleParamsFromUrl=()=>{const e=this._getAllParams(),t=new Set([o.C_SRC_PARAM,o.C_SRC2_PARAM,o.DEDICATION_PARAM,o.DESIGNATION_PARAM,o.RECURRING_END_DATE_PARAM]),n={};for(const s of Object.keys(e)){const i=e[s];if(!i)continue;const a=t.has(s),r=s.startsWith("utm_"),l=o.CLASSY_PARAMS.includes(s);(a||r||!l&&s!==o.CAMPAIGN_PARAM)&&(n[s]=i)}return n},this._getAllParams=()=>{const e=new URLSearchParams(this.props.win.location.search);return Object.fromEntries(e.entries())},this._pushState=e=>{const t=this._toQueryStr(e);this.props.win.history.pushState(void 0,"",t)},this._toQueryStr=e=>{const t=Object.keys(e),{pathname:n,hash:s}=this.props.win.location,i=s||"";if(0===t.length)return`${n}${i}`;return`${n}?${t.filter((t=>!!e[t])).map((t=>`${t}=${encodeURIComponent(e[t])}`)).join("&")}${i}`},this.props=e,this.preserveParamsFromMount=this._collectPreserveEligibleParamsFromUrl(),this.state=this._getState(),this.pubsub=new i.default,this.props.win.addEventListener(a,this._onPopstate)}}},1118:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CLASSY_PARAMS=t.RECURRING_END_DATE_PARAM=t.DEDICATION_TYPE_PARAM=t.DEDICATION_PARAM=t.DESIGNATION_PARAM=t.C_SRC2_PARAM=t.C_SRC_PARAM=t.UTM_PARAM=t.DONOR_PARAMS=t.COUNTRY=t.ZIP=t.STATE=t.CITY=t.STREET=t.PHONE=t.EMAIL=t.LAST=t.FIRST=t.CURRENCY_PARAM=t.PRESET4_PARAM=t.PRESET3_PARAM=t.PRESET2_PARAM=t.PRESET1_PARAM=t.AMOUNT_PARAM=t.FREQUENCY_PARAM=t.RECURRING_PARAM=t.CAMPAIGN_PARAM=void 0,t.CAMPAIGN_PARAM="campaign",t.RECURRING_PARAM="recurring",t.FREQUENCY_PARAM="frequency",t.AMOUNT_PARAM="amount",t.PRESET1_PARAM="preset1",t.PRESET2_PARAM="preset2",t.PRESET3_PARAM="preset3",t.PRESET4_PARAM="preset4",t.CURRENCY_PARAM="currency",t.FIRST="first",t.LAST="last",t.EMAIL="email",t.PHONE="phone",t.STREET="street",t.CITY="city",t.STATE="state",t.ZIP="zip",t.COUNTRY="country",t.DONOR_PARAMS=[t.FIRST,t.LAST,t.EMAIL,t.PHONE,t.STREET,t.CITY,t.STATE,t.ZIP,t.COUNTRY],t.UTM_PARAM="utm_*",t.C_SRC_PARAM="c_src",t.C_SRC2_PARAM="c_src2",t.DESIGNATION_PARAM="designation",t.DEDICATION_PARAM="dedication",t.DEDICATION_TYPE_PARAM="dedicationType",t.RECURRING_END_DATE_PARAM="recurringEnd
5Date",t.CLASSY_PARAMS=[t.RECURRING_PARAM,t.FREQUENCY_PARAM,t.RECURRING_END_DATE_PARAM,t.AMOUNT_PARAM,t.PRESET1_PARAM,t.PRESET2_PARAM,t.PRESET3_PARAM,t.PRESET4_PARAM,t.CURRENCY_PARAM,t.UTM_PARAM,t.C_SRC_PARAM,t.C_SRC2_PARAM,t.DESIGNATION_PARAM,t.DEDICATION_PARAM,t.DEDICATION_TYPE_PARAM,...t.DONOR_PARAMS]},3386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractClassyParamsFromHref=void 0;const s=n(1118);t.extractClassyParamsFromHref=e=>{const t=new URLSearchParams(e),n={};for(const[e,i]of t.entries())-1!==s.CLASSY_PARAMS.indexOf(e)&&(n[e]=i);return n}},2179:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.publish=e=>{const t=this.subscriptions[e.name];t&&Object.keys(t).forEach((n=>{t[n](e)}))},this.subscribe=(e,t)=>{this.subscriptions[e]||(this.subscriptions[e]={});const n=this.generateNextKey();return this.subscriptions[e][n]=t,`${e}.${n}`},this.generateNextKey=()=>{const e=this.currentKey+1;return this.currentKey=e,e},this.currentKey=0,this.subscriptions={}}unsubscribe(e){const[t,n]=e.split(".");return!(!this.subscriptions[t]||!this.subscriptions[t][n])&&(delete this.subscriptions[t][n],!0)}unsubscribeAll(){this.subscriptions={},this.currentKey=0}}},8369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertRgbOrRgbaToHex=t.convertRgbToHex=t.isHexColor=t.convertHexToRGB=t.convertRgbToRGBA=void 0;t.convertRgbToRGBA=(e,t=.1)=>{const n=e.match(/rgba?\((\d+), (\d+), (\d+)(?:, (\d*\.?\d+))?\)/);if(n){return`rgba(${n[1]}, ${n[2]}, ${n[3]}, ${t})`}return e};t.convertHexToRGB=e=>{let t,n,s;return 3===(e=e.replace(/^#/,"")).length?(t=parseInt(e[0]+e[0],16),n=parseInt(e[1]+e[1],16),s=parseInt(e[2]+e[2],16)):(t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),s=parseInt(e.slice(4,6),16)),`rgb(${t}, ${n}, ${s})`};t.isHexColor=e=>/^#([0-9A-F]{3}|[0-9A-F]{6})$/i.test(e);t.convertRgbToHex=e=>{const t=e.match(/rgba?\((\d+), (\d+), (\d+)(?:, (\d*\.?\d+))?\)/);if(!t)throw new Error("Invalid RGB or RGBA string");const n=parseInt(t[1],10),s=parseInt(t[2],10),i=parseInt(t[3],10),o=e=>{const t=e.toString(16);return 1===t.length?"0"+t:t};return`#${o(n)}${o(s)}${o(i)}`};t.convertRgbOrRgbaToHex=(e,t="#FFFFFF")=>{if(!e)return"";const n=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!n)throw new Error("Invalid RGB or RGBA format. Expected format: rgb(R, G, B) or rgba(R, G, B, A)");const s=parseInt(n[1],10),i=parseInt(n[2],10),o=parseInt(n[3],10),a=void 0!==n[4]?parseFloat(n[4]):1;if(a<0||a>1)throw new Error("Alpha must be between 0 and 1");const r=e=>{const t=e.toString(16).toUpperCase();return 1===t.length?`0${t}`:t};if(1===a)return`#${r(s)}${r(i)}${r(o)}`;const l=parseInt(t.substring(1,3),16),c=parseInt(t.substring(3,5),16),d=parseInt(t.substring(5,7),16),u=Math.round((1-a)*l+a*s),h=Math.round((1-a)*c+a*i),p=Math.round((1-a)*d+a*o);return`#${r(u)}${r(h)}${r(p)}`}},5318:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrencyDecimalPlaces=t.currencyDecimalMap=void 0,t.currencyDecimalMap=Object.freeze({BIF:0,CLP:0,COP:0,DJF:0,GNF:0,IDR:0,ISK:0,JPY:0,KMF:0,KRW:0,MGA:0,PYG:0,RWF:0,UGX:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0});t.getCurrencyDecimalPlaces=e=>{var n;return null!==(n=t.currencyDecimalMap[e.toUpperCase()])&&void 0!==n?n:2}},8869:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldSkipAutoInit=t.getSdkScriptOrigin=t.getIframeRouteReason=t.getIframeBaseUri=t.getBaseUri=t.setBaseUri=t.captureBaseUri=t.parseManualInitParam=void 0;let n=null,s=null;const i="/api/checkout/sdk/js/",o="https://giving.classy.org/embedded";function a(e){if(!e)return null;try{const t=new URL(e),n=t.pathname.replace(/\/$/,"");return`${t.origin}${n}`}catch(e){return null}}function r(e){const t=a(e);if(!t)return null;const n=["https://giving.gofundme.com/donate/embedded","https://giving.gofundme.com/embedded",o].filter((e=>Boolean(e))).find((e=>a(e)===t));return n||null}function l(e){if(!e)return!1;try{const t=new URL(e).searchParams.get("manual-init");return"true"===t||"1"===t||""===t}catch(e){return!1}}t.parseManualInitParam=l,t.captureBaseUri=function(e){const t="string"==typeof e?e:"undefined"!=typeof document&&document.currentScript?document.currentScript.src:"";return n=function(e){if(!e)return null;try{const t=new URL(e),n=t.pathname.indexOf(i);if(-1===n)return null;const s=t.pathname.slice(0,n);return r(`${t.origin}${s}`)}catch(e){return null}}(t),n},t.setBaseUri=function(e){s=r(e)},t.getBaseUri=function(){return s||n||"https://giving.gofundme.com/donate/embedded"},t.getIframeBaseUri=function(){return s||"https://giving.gofundme.com/donate/embedded"},t.getIframeRouteReason=function(){return s?"override":"default"},t.getSdkScriptOrigin=function(){return n?n===o?"legacy":"https://giving.gofundme.com/donate/embedded"===n?"monolith":"https://giving.gofundme.com/embedded"===n?"gfm":"none":"none"},t.shouldSkipAutoInit=function(){if("undefined"!=typeof document&&document.currentScript){return l(document.currentScript.src)}return!1}}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var o=t[s]={id:s,exports:{}};return e[s].call(o.exports,o,o.exports,n),o.exports}n.n=e=>
5{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;(()=>{"use strict";const e=n(4439);const t=n(8869);n(7910),"undefined"!=typeof window&&(0,t.captureBaseUri)();const s="undefined"!=typeof window&&(0,t.shouldSkipAutoInit)();if("undefined"!=typeof window&&(window.eg={init:t=>e.LifecycleManager.init(t),destroy:()=>e.LifecycleManager.destroy(),isInitialized:()=>e.LifecycleManager.isInitialized()},!s)){const t=()=>e.LifecycleManager.init({win:window});"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}})()})();
6//# sourceMappingURL=classy-embedded-sdk.js.map
7/*!
8 * jQuery JavaScript Library v1.11.0
9 * http://jquery.com/
10 *
11 * Includes Sizzle.js
12 * http://sizzlejs.com/
13 *
14 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
15 * Released under the MIT license
16 * http://jquery.org/license
17 *
18 * Date: 2014-01-23T21:02Z
19 */
20
21(function( global, factory ) {
22
23    if ( typeof module === "object" && typeof module.exports === "object" ) {
24        // For CommonJS and CommonJS-like environments where a proper window is present,
25        // execute the factory and get jQuery
26        // For environments that do not inherently posses a window with a document
27        // (such as Node.js), expose a jQuery-making factory as module.exports
28        // This accentuates the need for the creation of a real window
29        // e.g. var jQuery = require("jquery")(window);
30        // See ticket #14549 for more info
31        module.exports = global.document ?
32            factory( global, true ) :
33            function( w ) {
34                if ( !w.document ) {
35                    throw new Error( "jQuery requires a window with a document" );
36                }
37                return factory( w );
38            };
39    } else {
40        factory( global );
41    }
42
43// Pass this if window is not defined yet
44}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
45
46// Can't do this because several apps including ASP.NET trace
47// the stack via arguments.caller.callee and Firefox dies if
48// you try to trace through "use strict" call chains. (#13335)
49// Support: Firefox 18+
50//
51
52    var deletedIds = [];
53
54    var slice = deletedIds.slice;
55
56    var concat = deletedIds.concat;
57
58    var push = deletedIds.push;
59
60    var indexOf = deletedIds.indexOf;
61
62    var class2type = {};
63
64    var toString = class2type.toString;
65
66    var hasOwn = class2type.hasOwnProperty;
67
68    var trim = "".trim;
69
70    var support = {};
71
72
73
74    var
75        version = "1.11.0",
76
77    // Define a local copy of jQuery
78        jQuery = function( selector, context ) {
79            // The jQuery object is actually just the init constructor 'enhanced'
80            // Need init if jQuery is called (just allow error to be thrown if not included)
81            return new jQuery.fn.init( selector, context );
82        },
83
84    // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
85        rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
86
87    // Matches dashed string for camelizing
88        rmsPrefix = /^-ms-/,
89        rdashAlpha = /-([\da-z])/gi,
90
91    // Used by jQuery.camelCase as callback to replace()
92        fcamelCase = function( all, letter ) {
93            return letter.toUpperCase();
94        };
95
96    jQuery.fn = jQuery.prototype = {
97        // The current version of jQuery being used
98        jquery: version,
99
100        constructor: jQuery,
101
102        // Start with an empty selector
103        selector: "",
104
105        // The default length of a jQuery object is 0
106        length: 0,
107
108        toArray: function() {
109            return slice.call( this );
110        },
111
112        // Get the Nth element in the matched element set OR
113        // Get the whole matched element set as a clean array
114        get: function( num ) {
115            return num != null ?
116
117                // Return a 'clean' array
118                ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
119
120                // Return just the object
121                slice.call( this );
122        },
123
124        // Take an array of elements and push it onto the stack
125        // (returning the new matched element set)
126        pushStack: function( elems ) {
127
128            // Build a new jQuery matched element set
129            var ret = jQuery.merge( this.constructor(), elems );
130
131            // Add the old object onto the stack (as a reference)
vendor: 4,962 bytes, lines 132-285
132            ret.prevObject = this;
133            ret.context = this.context;
134
135            // Return the newly-formed element set
136            return ret;
137        },
138
139        // Execute a callback for every element in the matched set.
140        // (You can seed the arguments with an array of args, but this is
141        // only used internally.)
142        each: function( callback, args ) {
143            return jQuery.each( this, callback, args );
144        },
145
146        map: function( callback ) {
147            return this.pushStack( jQuery.map(this, function( elem, i ) {
148                return callback.call( elem, i, elem );
149            }));
150        },
151
152        slice: function() {
153            return this.pushStack( slice.apply( this, arguments ) );
154        },
155
156        first: function() {
157            return this.eq( 0 );
158        },
159
160        last: function() {
161            return this.eq( -1 );
162        },
163
164        eq: function( i ) {
165            var len = this.length,
166                j = +i + ( i < 0 ? len : 0 );
167            return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
168        },
169
170        end: function() {
171            return this.prevObject || this.constructor(null);
172        },
173
174        // For internal use only.
175        // Behaves like an Array's method, not like a jQuery method.
176        push: push,
177        sort: deletedIds.sort,
178        splice: deletedIds.splice
179    };
180
181    jQuery.extend = jQuery.fn.extend = function() {
182        var src, copyIsArray, copy, name, options, clone,
183            target = arguments[0] || {},
184            i = 1,
185            length = arguments.length,
186            deep = false;
187
188        // Handle a deep copy situation
189        if ( typeof target === "boolean" ) {
190            deep = target;
191
192            // skip the boolean and the target
193            target = arguments[ i ] || {};
194            i++;
195        }
196
197        // Handle case when target is a string or something (possible in deep copy)
198        if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
199            target = {};
200        }
201
202        // extend jQuery itself if only one argument is passed
203        if ( i === length ) {
204            target = this;
205            i--;
206        }
207
208        for ( ; i < length; i++ ) {
209            // Only deal with non-null/undefined values
210            if ( (options = arguments[ i ]) != null ) {
211                // Extend the base object
212                for ( name in options ) {
213                    src = target[ name ];
214                    copy = options[ name ];
215
216                    // Prevent never-ending loop
217                    if ( target === copy ) {
218                        continue;
219                    }
220
221                    // Recurse if we're merging plain objects or arrays
222                    if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
223                        if ( copyIsArray ) {
224                            copyIsArray = false;
225                            clone = src && jQuery.isArray(src) ? src : [];
226
227                        } else {
228                            clone = src && jQuery.isPlainObject(src) ? src : {};
229                        }
230
231                        // Never move original objects, clone them
232                        target[ name ] = jQuery.extend( deep, clone, copy );
233
234                        // Don't bring in undefined values
235                    } else if ( copy !== undefined ) {
236                        target[ name ] = copy;
237                    }
238                }
239            }
240        }
241
242        // Return the modified object
243        return target;
244    };
245
246    jQuery.extend({
247        // Unique for each copy of jQuery on the page
248        expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
249
250        // Assume jQuery is ready without the ready module
251        isReady: true,
252
253        error: function( msg ) {
254            throw new Error( msg );
255        },
256
257        noop: function() {},
258
259        // See test/unit/core.js for details concerning isFunction.
260        // Since version 1.3, DOM methods and functions like alert
261        // aren't supported. They return false on IE (#2968).
262        isFunction: function( obj ) {
263            return jQuery.type(obj) === "function";
264        },
265
266        isArray: Array.isArray || function( obj ) {
267            return jQuery.type(obj) === "array";
268        },
269
270        isWindow: function( obj ) {
271            /* jshint eqeqeq: false */
272            return obj != null && obj == obj.window;
273        },
274
275        isNumeric: function( obj ) {
276            // parseFloat NaNs numeric-cast false positives (null|true|false|"")
277            // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
278            // subtraction forces infinities to NaN
279            return obj - parseFloat( obj ) >= 0;
280        },
281
282        isEmptyObject: function( obj ) {
283            var name;
284            for ( name in obj ) {
285                return false;
286            }
287            return true;
288        },
289
290        isPlainObject: function( obj ) {
291            var key;
292
293            // Must be an Object.
294            // Because of IE, we also have to check the presence of the constructor property.
295            // Make sure that DOM nodes and window objects don't pass through, as well
296            if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
297                return false;
298            }
299
300            try {
301                // Not own constructor property must be Object
302                if ( obj.constructor &&
303                    !hasOwn.call(obj, "constructor") &&
304                    !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
305                    return false;
306                }
307            } catch ( e ) {
308                // IE8,9 Will throw exceptions on certain host objects #9897
309                return false;
310            }
311
312            // Support: IE<9
313            // Handle iteration over inherited properties before own properties.
314            if ( support.ownLast ) {
315                for ( key in obj ) {
316                    return hasOwn.call( obj, key );
317                }
318            }
319
320            // Own properties are enumerated firstly, so to speed up,
321            // if last one is own, then all properties are own.
322            for ( key in obj ) {}
323
324            return key === undefined || hasOwn.call( obj, key );
325        },
326
327        type: function( obj ) {
328            if ( obj == null ) {
329                return obj + "";
330            }
331            return typeof obj === "object" || typeof obj === "function" ?
332                class2type[ toString.call(obj) ] || "object" :
333                typeof obj;
334        },
335
336        // Evaluates a script in a global context
337        // Workarounds based on findings by Jim Driscoll
338        // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
339        globalEval: function( data ) {
340            if ( data && jQuery.trim( data ) ) {
341                // We use execScript on Internet Explorer
342                // We use an anonymous function so that context is window
343                // rather than jQuery in Firefox
344                ( window.execScript || function( data ) {
345                    window[ "eval" ].call( window, data );
346                } )( data );
347            }
348        },
349
350        // Convert dashed to camelCase; used by the css and data modules
351        // Microsoft forgot to hump their vendor prefix (#9572)
352        camelCase: function( string ) {
353            return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
354        },
355
356        nodeName: function( elem, name ) {
357            return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
358        },
359
360        // args is for internal usage only
361        each: function( obj, callback, args ) {
362            var value,
363                i = 0,
364                length = obj.length,
365                isArray = isArraylike( obj );
366
367            if ( args ) {
368                if ( isArray ) {
369                    for ( ; i < length; i++ ) {
370                        value = callback.apply( obj[ i ], args );
371
372                        if ( value === false ) {
373                            break;
374                        }
375                    }
376                } else {
377                    for ( i in obj ) {
378                        value = callback.apply( obj[ i ], args );
379
380                        if ( value === false ) {
381                            break;
382                        }
383                    }
384                }
385
386                // A special, fast, case for the most common use of each
387            } else {
388                if ( isArray ) {
389                    for ( ; i < length; i++ ) {
390                        value = callback.call( obj[ i ], i, obj[ i ] );
391
392                        if ( value === false ) {
393                            break;
394                        }
395                    }
396                } else {
397                    for ( i in obj ) {
398                        value = callback.call( obj[ i ], i, obj[ i ] );
399
400                        if ( value === false ) {
401                            break;
402                        }
403                    }
404                }
405            }
406
407            return obj;
408        },
409
410        // Use native String.trim function wherever possible
411        trim: trim && !trim.call("\uFEFF\xA0") ?
412            function( text ) {
413                return text == null ?
414                    "" :
415                    trim.call( text );
416            } :
417
418            // Otherwise use our own trimming functionality
419            function( text ) {
420                return text == null ?
421                    "" :
422                    ( text + "" ).replace( rtrim, "" );
423            },
424
425        // results is for internal usage only
426        makeArray: function( arr, results ) {
427            var ret = results || [];
428
429            if ( arr != null ) {
430                if ( isArraylike( Object(arr) ) ) {
431                    jQuery.merge( ret,
432                            typeof arr === "string" ?
433                            [ arr ] : arr
434                    );
435                } else {
436                    push.call( ret, arr );
437                }
438            }
439
440            return ret;
441        },
442
443        inArray: function( elem, arr, i ) {
444            var len;
445
446            if ( arr ) {
447                if ( indexOf ) {
448                    return indexOf.call( arr, elem, i );
449                }
450
451                len = arr.length;
452                i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
453
454                for ( ; i < len; i++ ) {
455                    // Skip accessing in sparse arrays
456                    if ( i in arr && arr[ i ] === elem ) {
457                        return i;
458                    }
459                }
460            }
461
462            return -1;
463        },
464
465        merge: function( first, second ) {
466            var len = +second.length,
467                j = 0,
468                i = first.length;
469
470            while ( j < len ) {
471                first[ i++ ] = second[ j++ ];
472            }
473
474            // Support: IE<9
475            // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
476            if ( len !== len ) {
477                while ( second[j] !== undefined ) {
478                    first[ i++ ] = second[ j++ ];
479                }
480            }
481
482            first.length = i;
483
484            return first;
485        },
486
487        grep: function( elems, callback, invert ) {
488            var callbackInverse,
489                matches = [],
490                i = 0,
491                length = elems.length,
492                callbackExpect = !invert;
493
494            // Go through the array, only saving the items
495            // that pass the validator function
496            for ( ; i < length; i++ ) {
497                callbackInverse = !callback( elems[ i ], i );
498                if ( callbackInverse !== callbackExpect ) {
499                    matches.push( elems[ i ] );
500                }
501            }
502
503            return matches;
504        },
505
506        // arg is for internal usage only
507        map: function( elems, callback, arg ) {
508            var value,
509                i = 0,
510                length = elems.length,
511                isArray = isArraylike( elems ),
512                ret = [];
513
514            // Go through the array, translating each of the items to their new values
515            if ( isArray ) {
516                for ( ; i < length; i++ ) {
517                    value = callback( elems[ i ], i, arg );
518
519                    if ( value != null ) {
520                        ret.push( value );
521                    }
522                }
523
524                // Go through every key on the object,
525            } else {
526                for ( i in elems ) {
527                    value = callback( elems[ i ], i, arg );
528
529                    if ( value != null ) {
530                        ret.push( value );
531                    }
532                }
533            }
534
535            // Flatten any nested arrays
536            return concat.apply( [], ret );
537        },
538
539        // A global GUID counter for objects
540        guid: 1,
541
542        // Bind a function to a context, optionally partially applying any
543        // arguments.
544        proxy: function( fn, context ) {
545            var args, proxy, tmp;
546
547            if ( typeof context === "string" ) {
548                tmp = fn[ context ];
549                context = fn;
550                fn = tmp;
551            }
552
553            // Quick check to determine if target is callable, in the spec
554            // this throws a TypeError, but we will just return undefined.
555            if ( !jQuery.isFunction( fn ) ) {
556                return undefined;
557            }
558
559            // Simulated bind
560            args = slice.call( arguments, 2 );
561            proxy = function() {
562                return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
563            };
564
565            // Set the guid of unique handler to the same of original handler, so it can be removed
566            proxy.guid = fn.guid = fn.guid || jQuery.guid++;
567
568            return proxy;
569        },
570
571        now: function() {
572            return +( new Date() );
573        },
574
575        // jQuery.support is not used in Core but other projects attach their
576        // properties to it so it needs to exist.
577        support: support
578    });
579
580// Populate the class2type map
581    jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
582        class2type[ "[object " + name + "]" ] = name.toLowerCase();
583    });
584
585    function isArraylike( obj ) {
586        var length = obj.length,
587            type = jQuery.type( obj );
588
589        if ( type === "function" || jQuery.isWindow( obj ) ) {
590            return false;
591        }
592
593        if ( obj.nodeType === 1 && length ) {
594            return true;
595        }
596
597        return type === "array" || length === 0 ||
598            typeof length === "number" && length > 0 && ( length - 1 ) in obj;
599    }
600    var Sizzle =
601        /*!
602         * Sizzle CSS Selector Engine v1.10.16
603         * http://sizzlejs.com/
604         *
605         * Copyright 2013 jQuery Foundation, Inc. and other contributors
606         * Released under the MIT license
607         * http://jquery.org/license
608         *
609         * Date: 2014-01-13
610         */
611        (function( window ) {
612
613            var i,
614                support,
615                Expr,
616                getText,
617                isXML,
618                compile,
619                outermostContext,
620                sortInput,
621                hasDuplicate,
622
623            // Local document vars
624                setDocument,
625                document,
626                docElem,
627                documentIsHTML,
628                rbuggyQSA,
629                rbuggyMatches,
630                matches,
631                contains,
632
633            // Instance-specific data
634                expando = "sizzle" + -(new Date()),
635                preferredDoc = window.document,
636                dirruns = 0,
637                done = 0,
638                classCache = createCache(),
639                tokenCache = createCache(),
640                compilerCache = createCache(),
641                sortOrder = function( a, b ) {
642                    if ( a === b ) {
643                        hasDuplicate = true;
644                    }
645                    return 0;
646                },
647
648            // General-purpose constants
649                strundefined = typeof undefined,
650                MAX_NEGATIVE = 1 << 31,
651
652            // Instance methods
653                hasOwn = ({}).hasOwnProperty,
654                arr = [],
655                pop = arr.pop,
656                push_native = arr.push,
657                push = arr.push,
658                slice = arr.slice,
659            // Use a stripped-down indexOf if we can't use a native one
660                indexOf = arr.indexOf || function( elem ) {
661                    var i = 0,
662                        len = this.length;
663                    for ( ; i < len; i++ ) {
664                        if ( this[i] === elem ) {
665                            return i;
666                        }
667                    }
668                    return -1;
669                },
670
671                booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
672
673            // Regular expressions
674
675            // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
676                whitespace = "[\\x20\\t\\r\\n\\f]",
677            // http://www.w3.org/TR/css3-syntax/#characters
678                characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
679
680            // Loosely modeled on CSS identifier characters
681            // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
682            // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
683                identifier = characterEncoding.replace( "w", "w#" ),
684
685            // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
686                attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
687                    "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
688
689            // Prefer arguments quoted,
690            //   then not containing pseudos/brackets,
691            //   then attribute selectors/non-parenthetical expressions,
692            //   then anything else
693            // These preferences are here to reduce the number of selectors
694            //   needing tokenize in the PSEUDO preFilter
695                pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
696
697            // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
698                rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
699
700                rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
701                rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
702
703                rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
704
705                rpseudo = new RegExp( pseudos ),
706                ridentifier = new RegExp( "^" + identifier + "$" ),
707
708                matchExpr = {
709                    "ID": new RegExp( "^#(" + characterEncoding + ")" ),
710                    "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
711                    "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
712                    "ATTR": new RegExp( "^" + attributes ),
713                    "PSEUDO": new RegExp( "^" + pseudos ),
714                    "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
715                        "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
716                        "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
717                    "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
718                    // For use in libraries implementing .is()
719                    // We use this for POS matching in `select`
720                    "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
721                        whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
722                },
723
724                rinputs = /^(?:input|select|textarea|button)$/i,
725                rheader = /^h\d$/i,
726
727                rnative = /^[^{]+\{\s*\[native \w/,
728
729            // Easily-parseable/retrievable ID or TAG or CLASS selectors
730                rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
731
732                rsibling = /[+~]/,
733                rescape = /'|\\/g,
734
735            // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
736                runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
737                funescape = function( _, escaped, escapedWhitespace ) {
738                    var high = "0x" + escaped - 0x10000;
739                    // NaN means non-codepoint
740                    // Support: Firefox
741                    // Workaround erroneous numeric interpretation of +"0x"
742                    return high !== high || escapedWhitespace ?
743                        escaped :
744                            high < 0 ?
745                        // BMP codepoint
746                        String.fromCharCode( high + 0x10000 ) :
747                        // Supplemental Plane codepoint (surrogate pair)
748                        String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
749                };
750
751// Optimize for push.apply( _, NodeList )
752            try {
753                push.apply(
754                    (arr = slice.call( preferredDoc.childNodes )),
755                    preferredDoc.childNodes
756                );
757                // Support: Android<4.0
758                // Detect silently failing push.apply
759                arr[ preferredDoc.childNodes.length ].nodeType;
760            } catch ( e ) {
761                push = { apply: arr.length ?
762
763                    // Leverage slice if possible
764                    function( target, els ) {
765                        push_native.apply( target, slice.call(els) );
766                    } :
767
768                    // Support: IE<9
769                    // Otherwise append directly
770                    function( target, els ) {
771                        var j = target.length,
772                            i = 0;
773                        // Can't trust NodeList.length
774                        while ( (target[j++] = els[i++]) ) {}
775                        target.length = j - 1;
776                    }
777                };
778            }
779
780            function Sizzle( selector, context, results, seed ) {
781                var match, elem, m, nodeType,
782                // QSA vars
783                    i, groups, old, nid, newContext, newSelector;
784
785                if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
786                    setDocument( context );
787                }
788
789                context = context || document;
790                results = results || [];
791
792                if ( !selector || typeof selector !== "string" ) {
793                    return results;
794                }
795
796                if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
797                    return [];
798                }
799
800                if ( documentIsHTML && !seed ) {
801
802                    // Shortcuts
803                    if ( (match = rquickExpr.exec( selector )) ) {
804                        // Speed-up: Sizzle("#ID")
805                        if ( (m = match[1]) ) {
806                            if ( nodeType === 9 ) {
807                                elem = context.getElementById( m );
808                                // Check parentNode to catch when Blackberry 4.6 returns
809                                // nodes that are no longer in the document (jQuery #6963)
810                                if ( elem && elem.parentNode ) {
811                                    // Handle the case where IE, Opera, and Webkit return items
812                                    // by name instead of ID
813                                    if ( elem.id === m ) {
814                                        results.push( elem );
815                                        return results;
816                                    }
817                                } else {
818                                    return results;
819                                }
820                            } else {
821                                // Context is not a document
822                                if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
823                                    contains( context, elem ) && elem.id === m ) {
824                                    results.push( elem );
825                                    return results;
826                                }
827                            }
828
829                            // Speed-up: Sizzle("TAG")
830                        } else if ( match[2] ) {
831                            push.apply( results, context.getElementsByTagName( selector ) );
832                            return results;
833
834                            // Speed-up: Sizzle(".CLASS")
835                        } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
836                            push.apply( results, context.getElementsByClassName( m ) );
837                            return results;
838                        }
839                    }
840
841                    // QSA path
842                    if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
843                        nid = old = expando;
844                        newContext = context;
845                        newSelector = nodeType === 9 && selector;
846
847                        // qSA works strangely on Element-rooted queries
848                        // We can work around this by specifying an extra ID on the root
849                        // and working up from there (Thanks to Andrew Dupont for the technique)
850                        // IE 8 doesn't work on object elements
851                        if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
852                            groups = tokenize( selector );
853
854                            if ( (old = context.getAttribute("id")) ) {
855                                nid = old.replace( rescape, "\\$&" );
856                            } else {
857                                context.setAttribute( "id", nid );
858                            }
859                            nid = "[id='" + nid + "'] ";
860
861                            i = groups.length;
862                            while ( i-- ) {
863                                groups[i] = nid + toSelector( groups[i] );
864                            }
865                            newContext = rsibling.test( selector ) && testC
vendor: 6,011 bytes, lines 865-1027
865ontext( context.parentNode ) || context;
866                            newSelector = groups.join(",");
867                        }
868
869                        if ( newSelector ) {
870                            try {
871                                push.apply( results,
872                                    newContext.querySelectorAll( newSelector )
873                                );
874                                return results;
875                            } catch(qsaError) {
876                            } finally {
877                                if ( !old ) {
878                                    context.removeAttribute("id");
879                                }
880                            }
881                        }
882                    }
883                }
884
885                // All others
886                return select( selector.replace( rtrim, "$1" ), context, results, seed );
887            }
888
889            /**
890             * Create key-value caches of limited size
891             * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
892             *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
893             *	deleting the oldest entry
894             */
895            function createCache() {
896                var keys = [];
897
898                function cache( key, value ) {
899                    // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
900                    if ( keys.push( key + " " ) > Expr.cacheLength ) {
901                        // Only keep the most recent entries
902                        delete cache[ keys.shift() ];
903                    }
904                    return (cache[ key + " " ] = value);
905                }
906                return cache;
907            }
908
909            /**
910             * Mark a function for special use by Sizzle
911             * @param {Function} fn The function to mark
912             */
913            function markFunction( fn ) {
914                fn[ expando ] = true;
915                return fn;
916            }
917
918            /**
919             * Support testing using an element
920             * @param {Function} fn Passed the created div and expects a boolean result
921             */
922            function assert( fn ) {
923                var div = document.createElement("div");
924
925                try {
926                    return !!fn( div );
927                } catch (e) {
928                    return false;
929                } finally {
930                    // Remove from its parent by default
931                    if ( div.parentNode ) {
932                        div.parentNode.removeChild( div );
933                    }
934                    // release memory in IE
935                    div = null;
936                }
937            }
938
939            /**
940             * Adds the same handler for all of the specified attrs
941             * @param {String} attrs Pipe-separated list of attributes
942             * @param {Function} handler The method that will be applied
943             */
944            function addHandle( attrs, handler ) {
945                var arr = attrs.split("|"),
946                    i = attrs.length;
947
948                while ( i-- ) {
949                    Expr.attrHandle[ arr[i] ] = handler;
950                }
951            }
952
953            /**
954             * Checks document order of two siblings
955             * @param {Element} a
956             * @param {Element} b
957             * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
958             */
959            function siblingCheck( a, b ) {
960                var cur = b && a,
961                    diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
962                        ( ~b.sourceIndex || MAX_NEGATIVE ) -
963                        ( ~a.sourceIndex || MAX_NEGATIVE );
964
965                // Use IE sourceIndex if available on both nodes
966                if ( diff ) {
967                    return diff;
968                }
969
970                // Check if b follows a
971                if ( cur ) {
972                    while ( (cur = cur.nextSibling) ) {
973                        if ( cur === b ) {
974                            return -1;
975                        }
976                    }
977                }
978
979                return a ? 1 : -1;
980            }
981
982            /**
983             * Returns a function to use in pseudos for input types
984             * @param {String} type
985             */
986            function createInputPseudo( type ) {
987                return function( elem ) {
988                    var name = elem.nodeName.toLowerCase();
989                    return name === "input" && elem.type === type;
990                };
991            }
992
993            /**
994             * Returns a function to use in pseudos for buttons
995             * @param {String} type
996             */
997            function createButtonPseudo( type ) {
998                return function( elem ) {
999                    var name = elem.nodeName.toLowerCase();
1000                    return (name === "input" || name === "button") && elem.type === type;
1001                };
1002            }
1003
1004            /**
1005             * Returns a function to use in pseudos for positionals
1006             * @param {Function} fn
1007             */
1008            function createPositionalPseudo( fn ) {
1009                return markFunction(function( argument ) {
1010                    argument = +argument;
1011                    return markFunction(function( seed, matches ) {
1012                        var j,
1013                            matchIndexes = fn( [], seed.length, argument ),
1014                            i = matchIndexes.length;
1015
1016                        // Match elements found at the specified indexes
1017                        while ( i-- ) {
1018                            if ( seed[ (j = matchIndexes[i]) ] ) {
1019                                seed[j] = !(matches[j] = seed[j]);
1020                            }
1021                        }
1022                    });
1023                });
1024            }
1025
1026            /**
1027             * Checks a node for validity as a Sizzle context
1028             * @param {Element|Object=} context
1029             * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1030             */
1031            function testContext( context ) {
1032                return context && typeof context.getElementsByTagName !== strundefined && context;
1033            }
1034
1035// Expose support vars for convenience
1036            support = Sizzle.support = {};
1037
1038            /**
1039             * Detects XML nodes
1040             * @param {Element|Object} elem An element or a document
1041             * @returns {Boolean} True iff elem is a non-HTML XML node
1042             */
1043            isXML = Sizzle.isXML = function( elem ) {
1044                // documentElement is verified for cases where it doesn't yet exist
1045                // (such as loading iframes in IE - #4833)
1046                var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1047                return documentElement ? documentElement.nodeName !== "HTML" : false;
1048            };
1049
1050            /**
1051             * Sets document-related variables once based on the current document
1052             * @param {Element|Object} [doc] An element or document object to use to set the document
1053             * @returns {Object} Returns the current document
1054             */
1055            setDocument = Sizzle.setDocument = function( node ) {
1056                var hasCompare,
1057                    doc = node ? node.ownerDocument || node : preferredDoc,
1058                    parent = doc.defaultView;
1059
1060                // If no document and documentElement is available, return
1061                if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1062                    return document;
1063                }
1064
1065                // Set our document
1066                document = doc;
1067                docElem = doc.documentElement;
1068
1069                // Support tests
1070                documentIsHTML = !isXML( doc );
1071
1072                // Support: IE>8
1073                // If iframe document is assigned to "document" variable and if iframe has been reloaded,
1074                // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
1075                // IE6-8 do not support the defaultView property so parent will be undefined
1076                if ( parent && parent !== parent.top ) {
1077                    // IE11 does not have attachEvent, so all must suffer
1078                    if ( parent.addEventListener ) {
1079                        parent.addEventListener( "unload", function() {
1080                            setDocument();
1081                        }, false );
1082                    } else if ( parent.attachEvent ) {
1083                        parent.attachEvent( "onunload", function() {
1084                            setDocument();
1085                        });
1086                    }
1087                }
1088
1089                /* Attributes
1090                 ---------------------------------------------------------------------- */
1091
1092                // Support: IE<8
1093                // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
1094                support.attributes = assert(function( div ) {
1095                    div.className = "i";
1096                    return !div.getAttribute("className");
1097                });
1098
1099                /* getElement(s)By*
1100                 ---------------------------------------------------------------------- */
1101
1102                // Check if getElementsByTagName("*") returns only elements
1103                support.getElementsByTagName = assert(function( div ) {
1104                    div.appendChild( doc.createComment("") );
1105                    return !div.getElementsByTagName("*").length;
1106                });
1107
1108                // Check if getElementsByClassName can be trusted
1109                support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
1110                    div.innerHTML = "<div class='a'></div><div class='a i'></div>";
1111
1112                    // Support: Safari<4
1113                    // Catch class over-caching
1114                    div.firstChild.className = "i";
vendor: 25,290 bytes, lines 1115-1679
1115                    // Support: Opera<10
1116                    // Catch gEBCN failure to find non-leading classes
1117                    return div.getElementsByClassName("i").length === 2;
1118                });
1119
1120                // Support: IE<10
1121                // Check if getElementById returns elements by name
1122                // The broken getElementById methods don't pick up programatically-set names,
1123                // so use a roundabout getElementsByName test
1124                support.getById = assert(function( div ) {
1125                    docElem.appendChild( div ).id = expando;
1126                    return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
1127                });
1128
1129                // ID find and filter
1130                if ( support.getById ) {
1131                    Expr.find["ID"] = function( id, context ) {
1132                        if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
1133                            var m = context.getElementById( id );
1134                            // Check parentNode to catch when Blackberry 4.6 returns
1135                            // nodes that are no longer in the document #6963
1136                            return m && m.parentNode ? [m] : [];
1137                        }
1138                    };
1139                    Expr.filter["ID"] = function( id ) {
1140                        var attrId = id.replace( runescape, funescape );
1141                        return function( elem ) {
1142                            return elem.getAttribute("id") === attrId;
1143                        };
1144                    };
1145                } else {
1146                    // Support: IE6/7
1147                    // getElementById is not reliable as a find shortcut
1148                    delete Expr.find["ID"];
1149
1150                    Expr.filter["ID"] =  function( id ) {
1151                        var attrId = id.replace( runescape, funescape );
1152                        return function( elem ) {
1153                            var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
1154                            return node && node.value === attrId;
1155                        };
1156                    };
1157                }
1158
1159                // Tag
1160                Expr.find["TAG"] = support.getElementsByTagName ?
1161                    function( tag, context ) {
1162                        if ( typeof context.getElementsByTagName !== strundefined ) {
1163                            return context.getElementsByTagName( tag );
1164                        }
1165                    } :
1166                    function( tag, context ) {
1167                        var elem,
1168                            tmp = [],
1169                            i = 0,
1170                            results = context.getElementsByTagName( tag );
1171
1172                        // Filter out possible comments
1173                        if ( tag === "*" ) {
1174                            while ( (elem = results[i++]) ) {
1175                                if ( elem.nodeType === 1 ) {
1176                                    tmp.push( elem );
1177                                }
1178                            }
1179
1180                            return tmp;
1181                        }
1182                        return results;
1183                    };
1184
1185                // Class
1186                Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1187                    if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
1188                        return context.getElementsByClassName( className );
1189                    }
1190                };
1191
1192                /* QSA/matchesSelector
1193                 ---------------------------------------------------------------------- */
1194
1195                // QSA and matchesSelector support
1196
1197                // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1198                rbuggyMatches = [];
1199
1200                // qSa(:focus) reports false when true (Chrome 21)
1201                // We allow this because of a bug in IE8/9 that throws an error
1202                // whenever `document.activeElement` is accessed on an iframe
1203                // So, we allow :focus to pass through QSA all the time to avoid the IE error
1204                // See http://bugs.jquery.com/ticket/13378
1205                rbuggyQSA = [];
1206
1207                if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
1208                    // Build QSA regex
1209                    // Regex strategy adopted from Diego Perini
1210                    assert(function( div ) {
1211                        // Select is set to empty string on purpose
1212                        // This is to test IE's treatment of not explicitly
1213                        // setting a boolean content attribute,
1214                        // since its presence should be enough
1215                        // http://bugs.jquery.com/ticket/12359
1216                        div.innerHTML = "<select t=''><option selected=''></option></select>";
1217
1218                        // Support: IE8, Opera 10-12
1219                        // Nothing should be selected when empty strings follow ^= or $= or *=
1220                        if ( div.querySelectorAll("[t^='']").length ) {
1221                            rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1222                        }
1223
1224                        // Support: IE8
1225                        // Boolean attributes and "value" are not treated correctly
1226                        if ( !div.querySelectorAll("[selected]").length ) {
1227                            rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1228                        }
1229
1230                        // Webkit/Opera - :checked should return selected option elements
1231                        // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1232                        // IE8 throws error here and will not see later tests
1233                        if ( !div.querySelectorAll(":checked").length ) {
1234                            rbuggyQSA.push(":checked");
1235                        }
1236                    });
1237
1238                    assert(function( div ) {
1239                        // Support: Windows 8 Native Apps
1240                        // The type and name attributes are restricted during .innerHTML assignment
1241                        var input = doc.createElement("input");
1242                        input.setAttribute( "type", "hidden" );
1243                        div.appendChild( input ).setAttribute( "name", "D" );
1244
1245                        // Support: IE8
1246                        // Enforce case-sensitivity of name attribute
1247                        if ( div.querySelectorAll("[name=d]").length ) {
1248                            rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1249                        }
1250
1251                        // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1252                        // IE8 throws error here and will not see later tests
1253                        if ( !div.querySelectorAll(":enabled").length ) {
1254                            rbuggyQSA.push( ":enabled", ":disabled" );
1255                        }
1256
1257                        // Opera 10-11 does not throw on post-comma invalid pseudos
1258                        div.querySelectorAll("*,:x");
1259                        rbuggyQSA.push(",.*:");
1260                    });
1261                }
1262
1263                if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
1264                    docElem.mozMatchesSelector ||
1265                    docElem.oMatchesSelector ||
1266                    docElem.msMatchesSelector) )) ) {
1267
1268                    assert(function( div ) {
1269                        // Check to see if it's possible to do matchesSelector
1270                        // on a disconnected node (IE 9)
1271                        support.disconnectedMatch = matches.call( div, "div" );
1272
1273                        // This should fail with an exception
1274                        // Gecko does not error, returns false instead
1275                        matches.call( div, "[s!='']:x" );
1276                        rbuggyMatches.push( "!=", pseudos );
1277                    });
1278                }
1279
1280                rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1281                rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1282
1283                /* Contains
1284                 ---------------------------------------------------------------------- */
1285                hasCompare = rnative.test( docElem.compareDocumentPosition );
1286
1287                // Element contains another
1288                // Purposefully does not implement inclusive descendent
1289                // As in, an element does not contain itself
1290                contains = hasCompare || rnative.test( docElem.contains ) ?
1291                    function( a, b ) {
1292                        var adown = a.nodeType === 9 ? a.documentElement : a,
1293                            bup = b && b.parentNode;
1294                        return a === bup || !!( bup && bup.nodeType === 1 && (
1295                            adown.contains ?
1296                                adown.contains( bup ) :
1297                                a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1298                            ));
1299                    } :
1300                    function( a, b ) {
1301                        if ( b ) {
1302                            while ( (b = b.parentNode) ) {
1303                                if ( b === a ) {
1304                                    return true;
1305                                }
1306                            }
1307                        }
1308                        return false;
1309                    };
1310
1311                /* Sorting
1312                 ---------------------------------------------------------------------- */
1313
1314                // Document order sorting
1315                sortOrder = hasCompare ?
1316                    function( a, b ) {
1317
1318                        // Flag for duplicate removal
1319                        if ( a === b ) {
1320                            hasDuplicate = true;
1321                            return 0;
1322                        }
1323
1324                        // Sort on method existence if only one input has compareDocumentPosition
1325                        var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1326                        if ( compare ) {
1327                            return compare;
1328                        }
1329
1330                        // Calculate position if both inputs belong to the same document
1331                        compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1332                            a.compareDocumentPosition( b ) :
1333
1334                            // Otherwise we know they are disconnected
1335                            1;
1336
1337                        // Disconnected nodes
1338                        if ( compare & 1 ||
1339                            (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1340
1341                            // Choose the first element that is related to our preferred document
1342                            if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1343                                return -1;
1344                            }
1345                            if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1346                                return 1;
1347                            }
1348
1349                            // Maintain original order
1350                            return sortInput ?
1351                                ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1352                                0;
1353                        }
1354
1355                        return compare & 4 ? -1 : 1;
1356                    } :
1357                    function( a, b ) {
1358                        // Exit early if the nodes are identical
1359                        if ( a === b ) {
1360                            hasDuplicate = true;
1361                            return 0;
1362                        }
1363
1364                        var cur,
1365                            i = 0,
1366                            aup = a.parentNode,
1367                            bup = b.parentNode,
1368                            ap = [ a ],
1369                            bp = [ b ];
1370
1371                        // Parentless nodes are either documents or disconnected
1372                        if ( !aup || !bup ) {
1373                            return a === doc ? -1 :
1374                                    b === doc ? 1 :
1375                                aup ? -1 :
1376                                    bup ? 1 :
1377                                        sortInput ?
1378                                            ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1379                                            0;
1380
1381                            // If the nodes are siblings, we can do a quick check
1382                        } else if ( aup === bup ) {
1383                            return siblingCheck( a, b );
1384                        }
1385
1386                        // Otherwise we need full lists of their ancestors for comparison
1387                        cur = a;
1388                        while ( (cur = cur.parentNode) ) {
1389                            ap.unshift( cur );
1390                        }
1391                        cur = b;
1392                        while ( (cur = cur.parentNode) ) {
1393                            bp.unshift( cur );
1394                        }
1395
1396                        // Walk down the tree looking for a discrepancy
1397                        while ( ap[i] === bp[i] ) {
1398                            i++;
1399                        }
1400
1401                        return i ?
1402                            // Do a sibling check if the nodes have a common ancestor
1403                            siblingCheck( ap[i], bp[i] ) :
1404
1405                            // Otherwise nodes in our document sort first
1406                                ap[i] === preferredDoc ? -1 :
1407                                bp[i] === preferredDoc ? 1 :
1408                            0;
1409                    };
1410
1411                return doc;
1412            };
1413
1414            Sizzle.matches = function( expr, elements ) {
1415                return Sizzle( expr, null, null, elements );
1416            };
1417
1418            Sizzle.matchesSelector = function( elem, expr ) {
1419                // Set document vars if needed
1420                if ( ( elem.ownerDocument || elem ) !== document ) {
1421                    setDocument( elem );
1422                }
1423
1424                // Make sure that attribute selectors are quoted
1425                expr = expr.replace( rattributeQuotes, "='$1']" );
1426
1427                if ( support.matchesSelector && documentIsHTML &&
1428                    ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1429                    ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
1430
1431                    try {
1432                        var ret = matches.call( elem, expr );
1433
1434                        // IE 9's matchesSelector returns false on disconnected nodes
1435                        if ( ret || support.disconnectedMatch ||
1436                            // As well, disconnected nodes are said to be in a document
1437                            // fragment in IE 9
1438                            elem.document && elem.document.nodeType !== 11 ) {
1439                            return ret;
1440                        }
1441                    } catch(e) {}
1442                }
1443
1444                return Sizzle( expr, document, null, [elem] ).length > 0;
1445            };
1446
1447            Sizzle.contains = function( context, elem ) {
1448                // Set document vars if needed
1449                if ( ( context.ownerDocument || context ) !== document ) {
1450                    setDocument( context );
1451                }
1452                return contains( context, elem );
1453            };
1454
1455            Sizzle.attr = function( elem, name ) {
1456                // Set document vars if needed
1457                if ( ( elem.ownerDocument || elem ) !== document ) {
1458                    setDocument( elem );
1459                }
1460
1461                var fn = Expr.attrHandle[ name.toLowerCase() ],
1462                // Don't get fooled by Object.prototype properties (jQuery #13807)
1463                    val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1464                        fn( elem, name, !documentIsHTML ) :
1465                        undefined;
1466
1467                return val !== undefined ?
1468                    val :
1469                        support.attributes || !documentIsHTML ?
1470                    elem.getAttribute( name ) :
1471                        (val = elem.getAttributeNode(name)) && val.specified ?
1472                    val.value :
1473                    null;
1474            };
1475
1476            Sizzle.error = function( msg ) {
1477                throw new Error( "Syntax error, unrecognized expression: " + msg );
1478            };
1479
1480            /**
1481             * Document sorting and removing duplicates
1482             * @param {ArrayLike} results
1483             */
1484            Sizzle.uniqueSort = function( results ) {
1485                var elem,
1486                    duplicates = [],
1487                    j = 0,
1488                    i = 0;
1489
1490                // Unless we *know* we can detect duplicates, assume their presence
1491                hasDuplicate = !support.detectDuplicates;
1492                sortInput = !support.sortStable && results.slice( 0 );
1493                results.sort( sortOrder );
1494
1495                if ( hasDuplicate ) {
1496                    while ( (elem = results[i++]) ) {
1497                        if ( elem === results[ i ] ) {
1498                            j = duplicates.push( i );
1499                        }
1500                    }
1501                    while ( j-- ) {
1502                        results.splice( duplicates[ j ], 1 );
1503                    }
1504                }
1505
1506                // Clear input after sorting to release objects
1507                // See https://github.com/jquery/sizzle/pull/225
1508                sortInput = null;
1509
1510                return results;
1511            };
1512
1513            /**
1514             * Utility function for retrieving the text value of an array of DOM nodes
1515             * @param {Array|Element} elem
1516             */
1517            getText = Sizzle.getText = function( elem ) {
1518                var node,
1519                    ret = "",
1520                    i = 0,
1521                    nodeType = elem.nodeType;
1522
1523                if ( !nodeType ) {
1524                    // If no nodeType, this is expected to be an array
1525                    while ( (node = elem[i++]) ) {
1526                        // Do not traverse comment nodes
1527                        ret += getText( node );
1528                    }
1529                } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1530                    // Use textContent for elements
1531                    // innerText usage removed for consistency of new lines (jQuery #11153)
1532                    if ( typeof elem.textContent === "string" ) {
1533                        return elem.textContent;
1534                    } else {
1535                        // Traverse its children
1536                        for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1537                            ret += getText( elem );
1538                        }
1539                    }
1540                } else if ( nodeType === 3 || nodeType === 4 ) {
1541                    return elem.nodeValue;
1542                }
1543                // Do not include comment or processing instruction nodes
1544
1545                return ret;
1546            };
1547
1548            Expr = Sizzle.selectors = {
1549
1550                // Can be adjusted by the user
1551                cacheLength: 50,
1552
1553                createPseudo: markFunction,
1554
1555                match: matchExpr,
1556
1557                attrHandle: {},
1558
1559                find: {},
1560
1561                relative: {
1562                    ">": { dir: "parentNode", first: true },
1563                    " ": { dir: "parentNode" },
1564                    "+": { dir: "previousSibling", first: true },
1565                    "~": { dir: "previousSibling" }
1566                },
1567
1568                preFilter: {
1569                    "ATTR": function( match ) {
1570                        match[1] = match[1].replace( runescape, funescape );
1571
1572                        // Move the given value to match[3] whether quoted or unquoted
1573                        match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
1574
1575                        if ( match[2] === "~=" ) {
1576                            match[3] = " " + match[3] + " ";
1577                        }
1578
1579                        return match.slice( 0, 4 );
1580                    },
1581
1582                    "CHILD": function( match ) {
1583                        /* matches from matchExpr["CHILD"]
1584                         1 type (only|nth|...)
1585                         2 what (child|of-type)
1586                         3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1587                         4 xn-component of xn+y argument ([+-]?\d*n|)
1588                         5 sign of xn-component
1589                         6 x of xn-component
1590                         7 sign of y-component
1591                         8 y of y-component
1592                         */
1593                        match[1] = match[1].toLowerCase();
1594
1595                        if ( match[1].slice( 0, 3 ) === "nth" ) {
1596                            // nth-* requires argument
1597                            if ( !match[3] ) {
1598                                Sizzle.error( match[0] );
1599                            }
1600
1601                            // numeric x and y parameters for Expr.filter.CHILD
1602                            // remember that false/true cast respectively to 0/1
1603                            match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1604                            match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1605
1606                            // other types prohibit arguments
1607                        } else if ( match[3] ) {
1608                            Sizzle.error( match[0] );
1609                        }
1610
1611                        return match;
1612                    },
1613
1614                    "PSEUDO": function( match ) {
1615                        var excess,
1616                            unquoted = !match[5] && match[2];
1617
1618                        if ( matchExpr["CHILD"].test( match[0] ) ) {
1619                            return null;
1620                        }
1621
1622                        // Accept quoted arguments as-is
1623                        if ( match[3] && match[4] !== undefined ) {
1624                            match[2] = match[4];
1625
1626                            // Strip excess characters from unquoted arguments
1627                        } else if ( unquoted && rpseudo.test( unquoted ) &&
1628                            // Get excess from tokenize (recursively)
1629                            (excess = tokenize( unquoted, true )) &&
1630                            // advance to the next closing parenthesis
1631                            (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1632
1633                            // excess is a negative index
1634                            match[0] = match[0].slice( 0, excess );
1635                            match[2] = unquoted.slice( 0, excess );
1636                        }
1637
1638                        // Return only captures needed by the pseudo filter method (type and argument)
1639                        return match.slice( 0, 3 );
1640                    }
1641                },
1642
1643                filter: {
1644
1645                    "TAG": function( nodeNameSelector ) {
1646                        var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1647                        return nodeNameSelector === "*" ?
1648                            function() { return true; } :
1649                            function( elem ) {
1650                                return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1651                            };
1652                    },
1653
1654                    "CLASS": function( className ) {
1655                        var pattern = classCache[ className + " " ];
1656
1657                        return pattern ||
1658                            (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1659                            classCache( className, function( elem ) {
1660                                return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
1661                            });
1662                    },
1663
1664                    "ATTR": function( name, operator, check ) {
1665                        return function( elem ) {
1666                            var result = Sizzle.attr( elem, name );
1667
1668                            if ( result == null ) {
1669                                return operator === "!=";
1670                            }
1671                            if ( !operator ) {
1672                                return true;
1673                            }
1674
1675                            result += "";
1676
1677                            return operator === "=" ? result === check :
1678                                    operator === "!=" ? result !== check :
1679                                    operator === "^=" ? check && result.indexOf( check ) 
1679=== 0 :
1680                                    operator === "*=" ? check && result.indexOf( check ) > -1 :
1681                                    operator === "$=" ? check && result.slice( -check.length ) === check :
1682                                    operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
1683                                    operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1684                                false;
1685                        };
1686                    },
1687
1688                    "CHILD": function( type, what, argument, first, last ) {
1689                        var simple = type.slice( 0, 3 ) !== "nth",
1690                            forward = type.slice( -4 ) !== "last",
1691                            ofType = what === "of-type";
1692
1693                        return first === 1 && last === 0 ?
1694
1695                            // Shortcut for :nth-*(n)
1696                            function( elem ) {
1697                                return !!elem.parentNode;
1698                            } :
1699
1700                            function( elem, context, xml ) {
1701                                var cache, outerCache, node, diff, nodeIndex, start,
1702                                    dir = simple !== forward ? "nextSibling" : "previousSibling",
1703                                    parent = elem.parentNode,
1704                                    name = ofType && elem.nodeName.toLowerCase(),
1705                                    useCache = !xml && !ofType;
1706
1707                                if ( parent ) {
1708
1709                                    // :(first|last|only)-(child|of-type)
1710                                    if ( simple ) {
1711                                        while ( dir ) {
1712                                            node = elem;
1713                                            while ( (node = node[ dir ]) ) {
1714                                                if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
1715                                                    return false;
1716                                                }
1717                                            }
1718                                            // Reverse direction for :only-* (if we haven't yet done so)
1719                                            start = dir = type === "only" && !start && "nextSibling";
1720                                        }
1721                                        return true;
1722                                    }
1723
1724                                    start = [ forward ? parent.firstChild : parent.lastChild ];
1725
1726                                    // non-xml :nth-child(...) stores cache data on `parent`
1727                                    if ( forward && useCache ) {
1728                                        // Seek `elem` from a previously-cached index
1729                                        outerCache = parent[ expando ] || (parent[ expando ] = {});
1730                                        cache = outerCache[ type ] || [];
1731                                        nodeIndex = cache[0] === dirruns && cache[1];
1732                                        diff = cache[0] === dirruns && cache[2];
1733                                        node = nodeIndex && parent.childNodes[ nodeIndex ];
1734
1735                                        while ( (node = ++nodeIndex && node && node[ dir ] ||
1736
1737                                            // Fallback to seeking `elem` from the start
1738                                            (diff = nodeIndex = 0) || start.pop()) ) {
1739
1740                                            // When found, cache indexes on `parent` and break
1741                                            if ( node.nodeType === 1 && ++diff && node === elem ) {
1742                                                outerCache[ type ] = [ dirruns, nodeIndex, diff ];
1743                                                break;
1744                                            }
1745                                        }
1746
1747                                        // Use previously-cached element index if available
1748                                    } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
1749                                        diff = cache[1];
1750
1751                                        // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
1752                                    } else {
1753                                        // Use the same loop as above to seek `elem` from the start
1754                                        while ( (node = ++nodeIndex && node && node[ dir ] ||
1755                                            (diff = nodeIndex = 0) || start.pop()) ) {
1756
1757                                            if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
1758                                                // Cache the index of each encountered element
1759                                                if ( useCache ) {
1760                                                    (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
1761                                                }
1762
1763                                                if ( node === elem ) {
1764                                                    break;
1765                                                }
1766                                            }
1767                                        }
1768                                    }
1769
1770                                    // Incorporate the offset, then check against cycle size
1771                                    diff -= last;
1772                                    return diff === first || ( diff % first === 0 && diff / first >= 0 );
1773                                }
1774                            };
1775                    },
1776
1777                    "PSEUDO": function( pseudo, argument ) {
1778                        // pseudo-class names are case-insensitive
1779                        // http://www.w3.org/TR/selectors/#pseudo-classe
vendor: 39,958 bytes, lines 1779-2679
1779s
1780                        // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1781                        // Remember that setFilters inherits from pseudos
1782                        var args,
1783                            fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1784                                Sizzle.error( "unsupported pseudo: " + pseudo );
1785
1786                        // The user may use createPseudo to indicate that
1787                        // arguments are needed to create the filter function
1788                        // just as Sizzle does
1789                        if ( fn[ expando ] ) {
1790                            return fn( argument );
1791                        }
1792
1793                        // But maintain support for old signatures
1794                        if ( fn.length > 1 ) {
1795                            args = [ pseudo, pseudo, "", argument ];
1796                            return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1797                                markFunction(function( seed, matches ) {
1798                                    var idx,
1799                                        matched = fn( seed, argument ),
1800                                        i = matched.length;
1801                                    while ( i-- ) {
1802                                        idx = indexOf.call( seed, matched[i] );
1803                                        seed[ idx ] = !( matches[ idx ] = matched[i] );
1804                                    }
1805                                }) :
1806                                function( elem ) {
1807                                    return fn( elem, 0, args );
1808                                };
1809                        }
1810
1811                        return fn;
1812                    }
1813                },
1814
1815                pseudos: {
1816                    // Potentially complex pseudos
1817                    "not": markFunction(function( selector ) {
1818                        // Trim the selector passed to compile
1819                        // to avoid treating leading and trailing
1820                        // spaces as combinators
1821                        var input = [],
1822                            results = [],
1823                            matcher = compile( selector.replace( rtrim, "$1" ) );
1824
1825                        return matcher[ expando ] ?
1826                            markFunction(function( seed, matches, context, xml ) {
1827                                var elem,
1828                                    unmatched = matcher( seed, null, xml, [] ),
1829                                    i = seed.length;
1830
1831                                // Match elements unmatched by `matcher`
1832                                while ( i-- ) {
1833                                    if ( (elem = unmatched[i]) ) {
1834                                        seed[i] = !(matches[i] = elem);
1835                                    }
1836                                }
1837                            }) :
1838                            function( elem, context, xml ) {
1839                                input[0] = elem;
1840                                matcher( input, null, xml, results );
1841                                return !results.pop();
1842                            };
1843                    }),
1844
1845                    "has": markFunction(function( selector ) {
1846                        return function( elem ) {
1847                            return Sizzle( selector, elem ).length > 0;
1848                        };
1849                    }),
1850
1851                    "contains": markFunction(function( text ) {
1852                        return function( elem ) {
1853                            return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1854                        };
1855                    }),
1856
1857                    // "Whether an element is represented by a :lang() selector
1858                    // is based solely on the element's language value
1859                    // being equal to the identifier C,
1860                    // or beginning with the identifier C immediately followed by "-".
1861                    // The matching of C against the element's language value is performed case-insensitively.
1862                    // The identifier C does not have to be a valid language name."
1863                    // http://www.w3.org/TR/selectors/#lang-pseudo
1864                    "lang": markFunction( function( lang ) {
1865                        // lang value must be a valid identifier
1866                        if ( !ridentifier.test(lang || "") ) {
1867                            Sizzle.error( "unsupported lang: " + lang );
1868                        }
1869                        lang = lang.replace( runescape, funescape ).toLowerCase();
1870                        return function( elem ) {
1871                            var elemLang;
1872                            do {
1873                                if ( (elemLang = documentIsHTML ?
1874                                    elem.lang :
1875                                    elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1876
1877                                    elemLang = elemLang.toLowerCase();
1878                                    return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1879                                }
1880                            } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1881                            return false;
1882                        };
1883                    }),
1884
1885                    // Miscellaneous
1886                    "target": function( elem ) {
1887                        var hash = window.location && window.location.hash;
1888                        return hash && hash.slice( 1 ) === elem.id;
1889                    },
1890
1891                    "root": function( elem ) {
1892                        return elem === docElem;
1893                    },
1894
1895                    "focus": function( elem ) {
1896                        return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1897                    },
1898
1899                    // Boolean properties
1900                    "enabled": function( elem ) {
1901                        return elem.disabled === false;
1902                    },
1903
1904                    "disabled": function( elem ) {
1905                        return elem.disabled === true;
1906                    },
1907
1908                    "checked": function( elem ) {
1909                        // In CSS3, :checked should return both checked and selected elements
1910                        // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1911                        var nodeName = elem.nodeName.toLowerCase();
1912                        return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
1913                    },
1914
1915                    "selected": function( elem ) {
1916                        // Accessing this property makes selected-by-default
1917                        // options in Safari work properly
1918                        if ( elem.parentNode ) {
1919                            elem.parentNode.selectedIndex;
1920                        }
1921
1922                        return elem.selected === true;
1923                    },
1924
1925                    // Contents
1926                    "empty": function( elem ) {
1927                        // http://www.w3.org/TR/selectors/#empty-pseudo
1928                        // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1929                        //   but not by others (comment: 8; processing instruction: 7; etc.)
1930                        // nodeType < 6 works because attributes (2) do not appear as children
1931                        for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1932                            if ( elem.nodeType < 6 ) {
1933                                return false;
1934                            }
1935                        }
1936                        return true;
1937                    },
1938
1939                    "parent": function( elem ) {
1940                        return !Expr.pseudos["empty"]( elem );
1941                    },
1942
1943                    // Element/input types
1944                    "header": function( elem ) {
1945                        return rheader.test( elem.nodeName );
1946                    },
1947
1948                    "input": function( elem ) {
1949                        return rinputs.test( elem.nodeName );
1950                    },
1951
1952                    "button": function( elem ) {
1953                        var name = elem.nodeName.toLowerCase();
1954                        return name === "input" && elem.type === "button" || name === "button";
1955                    },
1956
1957                    "text": function( elem ) {
1958                        var attr;
1959                        return elem.nodeName.toLowerCase() === "input" &&
1960                            elem.type === "text" &&
1961
1962                            // Support: IE<8
1963                            // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
1964                            ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
1965                    },
1966
1967                    // Position-in-collection
1968                    "first": createPositionalPseudo(function() {
1969                        return [ 0 ];
1970                    }),
1971
1972                    "last": createPositionalPseudo(function( matchIndexes, length ) {
1973                        return [ length - 1 ];
1974                    }),
1975
1976                    "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
1977                        return [ argument < 0 ? argument + length : argument ];
1978                    }),
1979
1980                    "even": createPositionalPseudo(function( matchIndexes, length ) {
1981                        var i = 0;
1982                        for ( ; i < length; i += 2 ) {
1983                            matchIndexes.push( i );
1984                        }
1985                        return matchIndexes;
1986                    }),
1987
1988                    "odd": createPositionalPseudo(function( matchIndexes, length ) {
1989                        var i = 1;
1990                        for ( ; i < length; i += 2 ) {
1991                            matchIndexes.push( i );
1992                        }
1993                        return matchIndexes;
1994                    }),
1995
1996                    "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
1997                        var i = argument < 0 ? argument + length : argument;
1998                        for ( ; --i >= 0; ) {
1999                            matchIndexes.push( i );
2000                        }
2001                        return matchIndexes;
2002                    }),
2003
2004                    "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2005                        var i = argument < 0 ? argument + length : argument;
2006                        for ( ; ++i < length; ) {
2007                            matchIndexes.push( i );
2008                        }
2009                        return matchIndexes;
2010                    })
2011                }
2012            };
2013
2014            Expr.pseudos["nth"] = Expr.pseudos["eq"];
2015
2016// Add button/input type pseudos
2017            for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2018                Expr.pseudos[ i ] = createInputPseudo( i );
2019            }
2020            for ( i in { submit: true, reset: true } ) {
2021                Expr.pseudos[ i ] = createButtonPseudo( i );
2022            }
2023
2024// Easy API for creating new setFilters
2025            function setFilters() {}
2026            setFilters.prototype = Expr.filters = Expr.pseudos;
2027            Expr.setFilters = new setFilters();
2028
2029            function tokenize( selector, parseOnly ) {
2030                var matched, match, tokens, type,
2031                    soFar, groups, preFilters,
2032                    cached = tokenCache[ selector + " " ];
2033
2034                if ( cached ) {
2035                    return parseOnly ? 0 : cached.slice( 0 );
2036                }
2037
2038                soFar = selector;
2039                groups = [];
2040                preFilters = Expr.preFilter;
2041
2042                while ( soFar ) {
2043
2044                    // Comma and first run
2045                    if ( !matched || (match = rcomma.exec( soFar )) ) {
2046                        if ( match ) {
2047                            // Don't consume trailing commas as valid
2048                            soFar = soFar.slice( match[0].length ) || soFar;
2049                        }
2050                        groups.push( (tokens = []) );
2051                    }
2052
2053                    matched = false;
2054
2055                    // Combinators
2056                    if ( (match = rcombinators.exec( soFar )) ) {
2057                        matched = match.shift();
2058                        tokens.push({
2059                            value: matched,
2060                            // Cast descendant combinators to space
2061                            type: match[0].replace( rtrim, " " )
2062                        });
2063                        soFar = soFar.slice( matched.length );
2064                    }
2065
2066                    // Filters
2067                    for ( type in Expr.filter ) {
2068                        if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2069                            (match = preFilters[ type ]( match ))) ) {
2070                            matched = match.shift();
2071                            tokens.push({
2072                                value: matched,
2073                                type: type,
2074                                matches: match
2075                            });
2076                            soFar = soFar.slice( matched.length );
2077                        }
2078                    }
2079
2080                    if ( !matched ) {
2081                        break;
2082                    }
2083                }
2084
2085                // Return the length of the invalid excess
2086                // if we're just parsing
2087                // Otherwise, throw an error or return tokens
2088                return parseOnly ?
2089                    soFar.length :
2090                    soFar ?
2091                        Sizzle.error( selector ) :
2092                        // Cache the tokens
2093                        tokenCache( selector, groups ).slice( 0 );
2094            }
2095
2096            function toSelector( tokens ) {
2097                var i = 0,
2098                    len = tokens.length,
2099                    selector = "";
2100                for ( ; i < len; i++ ) {
2101                    selector += tokens[i].value;
2102                }
2103                return selector;
2104            }
2105
2106            function addCombinator( matcher, combinator, base ) {
2107                var dir = combinator.dir,
2108                    checkNonElements = base && dir === "parentNode",
2109                    doneName = done++;
2110
2111                return combinator.first ?
2112                    // Check against closest ancestor/preceding element
2113                    function( elem, context, xml ) {
2114                        while ( (elem = elem[ dir ]) ) {
2115                            if ( elem.nodeType === 1 || checkNonElements ) {
2116                                return matcher( elem, context, xml );
2117                            }
2118                        }
2119                    } :
2120
2121                    // Check against all ancestor/preceding elements
2122                    function( elem, context, xml ) {
2123                        var oldCache, outerCache,
2124                            newCache = [ dirruns, doneName ];
2125
2126                        // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
2127                        if ( xml ) {
2128                            while ( (elem = elem[ dir ]) ) {
2129                                if ( elem.nodeType === 1 || checkNonElements ) {
2130                                    if ( matcher( elem, context, xml ) ) {
2131                                        return true;
2132                                    }
2133                                }
2134                            }
2135                        } else {
2136                            while ( (elem = elem[ dir ]) ) {
2137                                if ( elem.nodeType === 1 || checkNonElements ) {
2138                                    outerCache = elem[ expando ] || (elem[ expando ] = {});
2139                                    if ( (oldCache = outerCache[ dir ]) &&
2140                                        oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2141
2142                                        // Assign to newCache so results back-propagate to previous elements
2143                                        return (newCache[ 2 ] = oldCache[ 2 ]);
2144                                    } else {
2145                                        // Reuse newcache so results back-propagate to previous elements
2146                                        outerCache[ dir ] = newCache;
2147
2148                                        // A match means we're done; a fail means we have to keep checking
2149                                        if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2150                                            return true;
2151                                        }
2152                                    }
2153                                }
2154                            }
2155                        }
2156                    };
2157            }
2158
2159            function elementMatcher( matchers ) {
2160                return matchers.length > 1 ?
2161                    function( elem, context, xml ) {
2162                        var i = matchers.length;
2163                        while ( i-- ) {
2164                            if ( !matchers[i]( elem, context, xml ) ) {
2165                                return false;
2166                            }
2167                        }
2168                        return true;
2169                    } :
2170                    matchers[0];
2171            }
2172
2173            function condense( unmatched, map, filter, context, xml ) {
2174                var elem,
2175                    newUnmatched = [],
2176                    i = 0,
2177                    len = unmatched.length,
2178                    mapped = map != null;
2179
2180                for ( ; i < len; i++ ) {
2181                    if ( (elem = unmatched[i]) ) {
2182                        if ( !filter || filter( elem, context, xml ) ) {
2183                            newUnmatched.push( elem );
2184                            if ( mapped ) {
2185                                map.push( i );
2186                            }
2187                        }
2188                    }
2189                }
2190
2191                return newUnmatched;
2192            }
2193
2194            function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2195                if ( postFilter && !postFilter[ expando ] ) {
2196                    postFilter = setMatcher( postFilter );
2197                }
2198                if ( postFinder && !postFinder[ expando ] ) {
2199                    postFinder = setMatcher( postFinder, postSelector );
2200                }
2201                return markFunction(function( seed, results, context, xml ) {
2202                    var temp, i, elem,
2203                        preMap = [],
2204                        postMap = [],
2205                        preexisting = results.length,
2206
2207                    // Get initial elements from seed or context
2208                        elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2209
2210                    // Prefilter to get matcher input, preserving a map for seed-results synchronization
2211                        matcherIn = preFilter && ( seed || !selector ) ?
2212                            condense( elems, preMap, preFilter, context, xml ) :
2213                            elems,
2214
2215                        matcherOut = matcher ?
2216                            // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2217                                postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2218
2219                            // ...intermediate processing is necessary
2220                            [] :
2221
2222                            // ...otherwise use results directly
2223                            results :
2224                            matcherIn;
2225
2226                    // Find primary matches
2227                    if ( matcher ) {
2228                        matcher( matcherIn, matcherOut, context, xml );
2229                    }
2230
2231                    // Apply postFilter
2232                    if ( postFilter ) {
2233                        temp = condense( matcherOut, postMap );
2234                        postFilter( temp, [], context, xml );
2235
2236                        // Un-match failing elements by moving them back to matcherIn
2237                        i = temp.length;
2238                        while ( i-- ) {
2239                            if ( (elem = temp[i]) ) {
2240                                matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2241                            }
2242                        }
2243                    }
2244
2245                    if ( seed ) {
2246                        if ( postFinder || preFilter ) {
2247                            if ( postFinder ) {
2248                                // Get the final matcherOut by condensing this intermediate into postFinder contexts
2249                                temp = [];
2250                                i = matcherOut.length;
2251                                while ( i-- ) {
2252                                    if ( (elem = matcherOut[i]) ) {
2253                                        // Restore matcherIn since elem is not yet a final match
2254                                        temp.push( (matcherIn[i] = elem) );
2255                                    }
2256                                }
2257                                postFinder( null, (matcherOut = []), temp, xml );
2258                            }
2259
2260                            // Move matched elements from seed to results to keep them synchronized
2261                            i = matcherOut.length;
2262                            while ( i-- ) {
2263                                if ( (elem = matcherOut[i]) &&
2264                                    (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
2265
2266                                    seed[temp] = !(results[temp] = elem);
2267                                }
2268                            }
2269                        }
2270
2271                        // Add elements to results, through postFinder if defined
2272                    } else {
2273                        matcherOut = condense(
2274                                matcherOut === results ?
2275                                matcherOut.splice( preexisting, matcherOut.length ) :
2276                                matcherOut
2277                        );
2278                        if ( postFinder ) {
2279                            postFinder( null, results, matcherOut, xml );
2280                        } else {
2281                            push.apply( results, matcherOut );
2282                        }
2283                    }
2284                });
2285            }
2286
2287            function matcherFromTokens( tokens ) {
2288                var checkContext, matcher, j,
2289                    len = tokens.length,
2290                    leadingRelative = Expr.relative[ tokens[0].type ],
2291                    implicitRelative = leadingRelative || Expr.relative[" "],
2292                    i = leadingRelative ? 1 : 0,
2293
2294                // The foundational matcher ensures that elements are reachable from top-level context(s)
2295                    matchContext = addCombinator( function( elem ) {
2296                        return elem === checkContext;
2297                    }, implicitRelative, true ),
2298                    matchAnyContext = addCombinator( function( elem ) {
2299                        return indexOf.call( checkContext, elem ) > -1;
2300                    }, implicitRelative, true ),
2301                    matchers = [ function( elem, context, xml ) {
2302                        return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2303                            (checkContext = context).nodeType ?
2304                                matchContext( elem, context, xml ) :
2305                                matchAnyContext( elem, context, xml ) );
2306                    } ];
2307
2308                for ( ; i < len; i++ ) {
2309                    if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2310                        matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2311                    } else {
2312                        matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2313
2314                        // Return special upon seeing a positional matcher
2315                        if ( matcher[ expando ] ) {
2316                            // Find the next relative operator (if any) for proper handling
2317                            j = ++i;
2318                            for ( ; j < len; j++ ) {
2319                                if ( Expr.relative[ tokens[j].type ] ) {
2320                                    break;
2321                                }
2322                            }
2323                            return setMatcher(
2324                                    i > 1 && elementMatcher( matchers ),
2325                                    i > 1 && toSelector(
2326                                    // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2327                                    tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2328                                ).replace( rtrim, "$1" ),
2329                                matcher,
2330                                    i < j && matcherFromTokens( tokens.slice( i, j ) ),
2331                                    j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2332                                    j < len && toSelector( tokens )
2333                            );
2334                        }
2335                        matchers.push( matcher );
2336                    }
2337                }
2338
2339                return elementMatcher( matchers );
2340            }
2341
2342            function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2343                var bySet = setMatchers.length > 0,
2344                    byElement = elementMatchers.length > 0,
2345                    superMatcher = function( seed, context, xml, results, outermost ) {
2346                        var elem, j, matcher,
2347                            matchedCount = 0,
2348                            i = "0",
2349                            unmatched = seed && [],
2350                            setMatched = [],
2351                            contextBackup = outermostContext,
2352                        // We must always have either seed elements or outermost context
2353                            elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2354                        // Use integer dirruns iff this is the outermost matcher
2355                            dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2356                            len = elems.length;
2357
2358                        if ( outermost ) {
2359                            outermostContext = context !== document && context;
2360                        }
2361
2362                        // Add elements passing elementMatchers directly to results
2363                        // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
2364                        // Support: IE<9, Safari
2365                        // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2366                        for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2367                            if ( byElement && elem ) {
2368                                j = 0;
2369                                while ( (matcher = elementMatchers[j++]) ) {
2370                                    if ( matcher( elem, context, xml ) ) {
2371                                        results.push( elem );
2372                                        break;
2373                                    }
2374                                }
2375                                if ( outermost ) {
2376                                    dirruns = dirrunsUnique;
2377                                }
2378                            }
2379
2380                            // Track unmatched elements for set filters
2381                            if ( bySet ) {
2382                                // They will have gone through all possible matchers
2383                                if ( (elem = !matcher && elem) ) {
2384                                    matchedCount--;
2385                                }
2386
2387                                // Lengthen the array for every element, matched or not
2388                                if ( seed ) {
2389                                    unmatched.push( elem );
2390                                }
2391                            }
2392                        }
2393
2394                        // Apply set filters to unmatched elements
2395                        matchedCount += i;
2396                        if ( bySet && i !== matchedCount ) {
2397                            j = 0;
2398                            while ( (matcher = setMatchers[j++]) ) {
2399                                matcher( unmatched, setMatched, context, xml );
2400                            }
2401
2402                            if ( seed ) {
2403                                // Reintegrate element matches to eliminate the need for sorting
2404                                if ( matchedCount > 0 ) {
2405                                    while ( i-- ) {
2406                                        if ( !(unmatched[i] || setMatched[i]) ) {
2407                                            setMatched[i] = pop.call( results );
2408                                        }
2409                                    }
2410                                }
2411
2412                                // Discard index placeholder values to get only actual matches
2413                                setMatched = condense( setMatched );
2414                            }
2415
2416                            // Add matches to results
2417                            push.apply( results, setMatched );
2418
2419                            // Seedless set matches succeeding multiple successful matchers stipulate sorting
2420                            if ( outermost && !seed && setMatched.length > 0 &&
2421                                ( matchedCount + setMatchers.length ) > 1 ) {
2422
2423                                Sizzle.uniqueSort( results );
2424                            }
2425                        }
2426
2427                        // Override manipulation of globals by nested matchers
2428                        if ( outermost ) {
2429                            dirruns = dirrunsUnique;
2430                            outermostContext = contextBackup;
2431                        }
2432
2433                        return unmatched;
2434                    };
2435
2436                return bySet ?
2437                    markFunction( superMatcher ) :
2438                    superMatcher;
2439            }
2440
2441            compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
2442                var i,
2443                    setMatchers = [],
2444                    elementMatchers = [],
2445                    cached = compilerCache[ selector + " " ];
2446
2447                if ( !cached ) {
2448                    // Generate a function of recursive functions that can be used to check each element
2449                    if ( !group ) {
2450                        group = tokenize( selector );
2451                    }
2452                    i = group.length;
2453                    while ( i-- ) {
2454                        cached = matcherFromTokens( group[i] );
2455                        if ( cached[ expando ] ) {
2456                            setMatchers.push( cached );
2457                        } else {
2458                            elementMatchers.push( cached );
2459                        }
2460                    }
2461
2462                    // Cache the compiled function
2463                    cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2464                }
2465                return cached;
2466            };
2467
2468            function multipleContexts( selector, contexts, results ) {
2469                var i = 0,
2470                    len = contexts.length;
2471                for ( ; i < len; i++ ) {
2472                    Sizzle( selector, contexts[i], results );
2473                }
2474                return results;
2475            }
2476
2477            function select( selector, context, results, seed ) {
2478                var i, tokens, token, type, find,
2479                    match = tokenize( selector );
2480
2481                if ( !seed ) {
2482                    // Try to minimize operations if there is only one group
2483                    if ( match.length === 1 ) {
2484
2485                        // Take a shortcut and set the context if the root selector is an ID
2486                        tokens = match[0] = match[0].slice( 0 );
2487                        if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2488                            support.getById && context.nodeType === 9 && documentIsHTML &&
2489                            Expr.relative[ tokens[1].type ] ) {
2490
2491                            context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2492                            if ( !context ) {
2493                                return results;
2494                            }
2495                            selector = selector.slice( tokens.shift().value.length );
2496                        }
2497
2498                        // Fetch a seed set for right-to-left matching
2499                        i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2500                        while ( i-- ) {
2501                            token = tokens[i];
2502
2503                            // Abort if we hit a combinator
2504                            if ( Expr.relative[ (type = token.type) ] ) {
2505                                break;
2506                            }
2507                            if ( (find = Expr.find[ type ]) ) {
2508                                // Search, expanding context for leading sibling combinators
2509                                if ( (seed = find(
2510                                    token.matches[0].replace( runescape, funescape ),
2511                                        rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2512                                )) ) {
2513
2514                                    // If seed is empty or no tokens remain, we can return early
2515                                    tokens.splice( i, 1 );
2516                                    selector = seed.length && toSelector( tokens );
2517                                    if ( !selector ) {
2518                                        push.apply( results, seed );
2519                                        return results;
2520                                    }
2521
2522                                    break;
2523                                }
2524                            }
2525                        }
2526                    }
2527                }
2528
2529                // Compile and execute a filtering function
2530                // Provide `match` to avoid retokenization if we modified the selector above
2531                compile( selector, match )(
2532                    seed,
2533                    context,
2534                    !documentIsHTML,
2535                    results,
2536                        rsibling.test( selector ) && testContext( context.parentNode ) || context
2537                );
2538                return results;
2539            }
2540
2541// One-time assignments
2542
2543// Sort stability
2544            support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2545
2546// Support: Chrome<14
2547// Always assume duplicates if they aren't passed to the comparison function
2548            support.detectDuplicates = !!hasDuplicate;
2549
2550// Initialize against the default document
2551            setDocument();
2552
2553// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2554// Detached nodes confoundingly follow *each other*
2555            support.sortDetached = assert(function( div1 ) {
2556                // Should return 1, but returns 4 (following)
2557                return div1.compareDocumentPosition( document.createElement("div") ) & 1;
2558            });
2559
2560// Support: IE<8
2561// Prevent attribute/property "interpolation"
2562// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2563            if ( !assert(function( div ) {
2564                div.innerHTML = "<a href='#'></a>";
2565                return div.firstChild.getAttribute("href") === "#" ;
2566            }) ) {
2567                addHandle( "type|href|height|width", function( elem, name, isXML ) {
2568                    if ( !isXML ) {
2569                        return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2570                    }
2571                });
2572            }
2573
2574// Support: IE<9
2575// Use defaultValue in place of getAttribute("value")
2576            if ( !support.attributes || !assert(function( div ) {
2577                div.innerHTML = "<input/>";
2578                div.firstChild.setAttribute( "value", "" );
2579                return div.firstChild.getAttribute( "value" ) === "";
2580            }) ) {
2581                addHandle( "value", function( elem, name, isXML ) {
2582                    if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2583                        return elem.defaultValue;
2584                    }
2585                });
2586            }
2587
2588// Support: IE<9
2589// Use getAttributeNode to fetch booleans when getAttribute lies
2590            if ( !assert(function( div ) {
2591                return div.getAttribute("disabled") == null;
2592            }) ) {
2593                addHandle( booleans, function( elem, name, isXML ) {
2594                    var val;
2595                    if ( !isXML ) {
2596                        return elem[ name ] === true ? name.toLowerCase() :
2597                                (val = elem.getAttributeNode( name )) && val.specified ?
2598                            val.value :
2599                            null;
2600                    }
2601                });
2602            }
2603
2604            return Sizzle;
2605
2606        })( window );
2607
2608
2609
2610    jQuery.find = Sizzle;
2611    jQuery.expr = Sizzle.selectors;
2612    jQuery.expr[":"] = jQuery.expr.pseudos;
2613    jQuery.unique = Sizzle.uniqueSort;
2614    jQuery.text = Sizzle.getText;
2615    jQuery.isXMLDoc = Sizzle.isXML;
2616    jQuery.contains = Sizzle.contains;
2617
2618
2619
2620    var rneedsContext = jQuery.expr.match.needsContext;
2621
2622    var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
2623
2624
2625
2626    var risSimple = /^.[^:#\[\.,]*$/;
2627
2628// Implement the identical functionality for filter and not
2629    function winnow( elements, qualifier, not ) {
2630        if ( jQuery.isFunction( qualifier ) ) {
2631            return jQuery.grep( elements, function( elem, i ) {
2632                /* jshint -W018 */
2633                return !!qualifier.call( elem, i, elem ) !== not;
2634            });
2635
2636        }
2637
2638        if ( qualifier.nodeType ) {
2639            return jQuery.grep( elements, function( elem ) {
2640                return ( elem === qualifier ) !== not;
2641            });
2642
2643        }
2644
2645        if ( typeof qualifier === "string" ) {
2646            if ( risSimple.test( qualifier ) ) {
2647                return jQuery.filter( qualifier, elements, not );
2648            }
2649
2650            qualifier = jQuery.filter( qualifier, elements );
2651        }
2652
2653        return jQuery.grep( elements, function( elem ) {
2654            return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
2655        });
2656    }
2657
2658    jQuery.filter = function( expr, elems, not ) {
2659        var elem = elems[ 0 ];
2660
2661        if ( not ) {
2662            expr = ":not(" + expr + ")";
2663        }
2664
2665        return elems.length === 1 && elem.nodeType === 1 ?
2666            jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2667            jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2668                return elem.nodeType === 1;
2669            }));
2670    };
2671
2672    jQuery.fn.extend({
2673        find: function( selector ) {
2674            var i,
2675                ret = [],
2676                self = this,
2677                len = self.length;
2678
2679            if ( typeof selector !== "string" ) {
2680                return this.pushStack( jQuery( selector ).filter(function() {
2681                    for ( i = 0; i < len; i++ ) {
2682                        if ( jQuery.contains( self[ i ], this ) ) {
2683                            return true;
2684                        }
2685                    }
2686                }) );
2687            }
2688
2689            for ( i = 0; i < len; i++ ) {
2690                jQuery.find( selector, self[ i ], ret );
2691            }
2692
2693            // Needed because $( selector, context ) becomes $( context ).find( selector )
2694            ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
2695            ret.selector = this.selector ? this.selector + " " + selector : selector;
2696            return ret;
2697        },
2698        filter: function( selector ) {
2699            return this.pushStack( winnow(this, selector || [], false) );
2700        },
2701        not: function( selector ) {
2702            return this.pushStack( winnow(this, selector || [], true) );
2703        },
2704        is: function( selector ) {
2705            return !!winnow(
2706                this,
2707
2708                // If this is a positional/relative selector, check membership in the returned set
2709                // so $("p:first").is("p:last") won't return true for a doc with two "p".
2710                    typeof selector === "string" && rneedsContext.test( selector ) ?
2711                    jQuery( selector ) :
2712                    selector || [],
2713                false
2714            ).length;
2715        }
2716    });
2717
2718
2719// Initialize a jQuery object
2720
2721
2722// A central reference to the root jQuery(document)
2723    var rootjQuery,
2724
2725    // Use the correct document accordingly with window argument (sandbox)
2726        document = window.document,
2727
2728    // A simple way to check for HTML strings
2729    // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2730    // Strict HTML recognition (#11290: must start with <)
2731        rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
2732
2733        init = jQuery.fn.init = function( selector, context ) {
2734            var match, elem;
2735
2736            // HANDLE: $(""), $(null), $(undefined), $(false)
2737            if ( !selector ) {
2738                return this;
2739            }
2740
2741            // Handle HTML strings
2742            if ( typeof selector === "string" ) {
2743                if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
2744                    // Assume that strings that start and end with <> are HTML and skip the regex check
2745                    match = [ null, selector, null ];
2746
2747                } else {
2748                    match = rquickExpr.exec( selector );
2749                }
2750
2751                // Match html or make sure no context is specified for #id
2752                if ( match && (match[1] || !context) ) {
2753
2754                    // HANDLE: $(html) -> $(array)
2755                    if ( match[1] ) {
2756                        context = context instanceof jQuery ? context[0] : context;
2757
2758                        // scripts is true for back-compat
2759                        // Intentionally let the error be thrown if parseHTML is not present
2760                        jQuery.merge( this, jQuery.parseHTML(
2761                            match[1],
2762                                context && context.nodeType ? context.ownerDocument || context : document,
2763                            true
2764                        ) );
2765
2766                        // HANDLE: $(html, props)
2767                        if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
2768                            for ( match in context ) {
2769                                // Properties of context are called as methods if possible
2770                                if ( jQuery.isFunction( this[ match ] ) ) {
2771                                    this[ match ]( context[ match ] );
2772
2773                                    // ...and otherwise set as attributes
2774                                } else {
2775                                    this.attr( match, context[ match ] );
2776                                }
2777                            }
2778                        }
2779
2780                        return this;
2781
2782                        // HANDLE: $(#id)
2783                    } else {
2784                        elem = document.getElementById( match[2] );
2785
2786                        // Check parentNode to catch when Blackberry 4.6 returns
2787                        // nodes that are no longer in the document #6963
2788                        if ( elem && elem.parentNode ) {
2789                            // Handle the case where IE and Opera return items
2790                            // by name instead of ID
2791                            if ( elem.id !== match[2] ) {
2792                                return rootjQuery.find( selector );
2793                            }
2794
2795                            // Otherwise, we inject the element directly into the jQuery object
2796                            this.length = 1;
2797                            this[0] = elem;
2798                        }
2799
2800                        this.context = document;
2801                        this.selector = selector;
2802                        return this;
2803                    }
2804
2805                    // HANDLE: $(expr, $(...))
2806                } else if ( !context || context.jquery ) {
2807                    return ( context || rootjQuery ).find( selector );
2808
2809                    // HANDLE: $(expr, context)
2810                    // (which is just equivalent to: $(context).find(expr)
2811                } else {
2812                    return this.constructor( context ).find( selector );
2813                }
2814
2815                // HANDLE: $(DOMElement)
2816            } else if ( selector.nodeType ) {
2817                this.context = this[0] = selector;
2818                this.length = 1;
2819                return this;
2820
2821                // HANDLE: $(function)
2822                // Shortcut for document ready
2823            } else if ( jQuery.isFunction( selector ) ) {
2824                return typeof rootjQuery.ready !== "undefined" ?
2825                    rootjQuery.ready( selector ) :
2826                    // Execute immediately if ready is not present
2827                    selector( jQuery );
2828            }
2829
2830            if ( selector.selector !== undefined ) {
2831                this.selector = selector.selector;
2832                this.context = selector.context;
2833            }
2834
2835            return jQuery.makeArray( selector, this );
2836        };
2837
2838// Give the init function the jQuery prototype for later instantiation
2839    init.prototype = jQuery.fn;
2840
2841// Initialize central reference
2842    rootjQuery = jQuery( document );
2843
2844
2845    var rparentsprev = /^(?:parents|prev(?:Until|All))/,
2846    // methods guaranteed to produce a unique set when starting from a unique set
2847        guaranteedUnique = {
2848            children: true,
2849            contents: true,
2850            next: true,
2851            prev: true
2852        };
2853
2854    jQuery.extend({
2855        dir: function( elem, dir, until ) {
2856            var matched = [],
2857                cur = elem[ dir ];
2858
2859            while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
2860                if ( cur.nodeType === 1 ) {
2861                    matched.push( cur );
2862                }
2863                cur = cur[dir];
2864            }
2865            return matched;
2866        },
2867
2868        sibling: function( n, elem ) {
2869            var r = [];
2870
2871            for ( ; n; n = n.nextSibling ) {
2872                if ( n.nodeType === 1 && n !== elem ) {
2873                    r.push( n );
2874                }
2875            }
2876
2877            return r;
2878        }
2879    });
2880
2881    jQuery.fn.extend({
2882        has: function( target ) {
2883            var i,
2884                targets = jQuery( target, this ),
2885                len = targets.length;
2886
2887            return this.filter(function() {
2888                for ( i = 0; i < len; i++ ) {
2889                    if ( jQuery.contains( this, targets[i] ) ) {
2890                        return true;
2891                    }
2892                }
2893            });
2894        },
2895
2896        closest: function( selectors, context ) {
2897            var cur,
2898                i = 0,
2899                l = this.length,
2900                matched = [],
2901                pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
2902                    jQuery( selectors, context || this.context ) :
2903                    0;
2904
2905            for ( ; i < l; i++ ) {
2906                for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
2907                    // Always skip document fragments
2908                    if ( cur.nodeType < 11 && (pos ?
2909                        pos.index(cur) > -1 :
2910
2911                        // Don't pass non-elements to Sizzle
2912                        cur.nodeType === 1 &&
2913                        jQuery.find.matchesSelector(cur, selectors)) ) {
2914
2915                        matched.push( cur );
2916                        break;
2917                    }
2918                }
2919            }
2920
2921            return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
2922        },
2923
2924        // Determine the position of an element within
2925        // the matched set of elements
2926        index: function( elem ) {
2927
2928            // No argument, return index in parent
2929            if ( !elem ) {
2930                return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
2931            }
2932
2933            // index in selector
2934            if ( typeof elem === "string" ) {
2935                return jQuery.inArray( this[0], jQuery( elem ) );
2936            }
2937
2938            // Locate the position of the desired element
2939            return jQuery.inArray(
2940                // If it receives a jQuery object, the first element is used
2941                elem.jquery ? elem[0] : elem, this );
2942        },
2943
2944        add: function( selector, context ) {
2945            return this.pushStack(
2946                jQuery.unique(
2947                    jQuery.merge( this.get(), jQuery( selector, context ) )
2948                )
2949            );
2950        },
2951
2952        addBack: function( selector ) {
2953            return this.add( selector == null ?
2954                    this.prevObject : this.prevObject.filter(selector)
2955            );
2956        }
2957    });
2958
2959    function sibling( cur, dir ) {
2960        do {
2961            cur = cur[ dir ];
2962        } while ( cur && cur.nodeType !== 1 );
2963
2964        return cur;
2965    }
2966
2967    jQuery.each({
2968        parent: function( elem ) {
2969            var parent = elem.parentNode;
2970            return parent && parent.nodeType !== 11 ? parent : null;
2971        },
2972        parents: function( elem ) {
2973            return jQuery.dir( elem, "parentNode" );
2974        },
2975        parentsUntil: function( elem, i, until ) {
2976            return jQuery.dir( elem, "parentNode", until );
2977        },
2978        next: function( elem ) {
2979            return sibling( elem, "nextSibling" );
2980        },
2981        prev: function( elem ) {
2982            return sibling( elem, "previousSibling" );
2983        },
2984        nextAll: function( elem ) {
2985            return jQuery.dir( elem, "nextSibling" );
2986        },
2987        prevAll: function( elem ) {
2988            return jQuery.dir( elem, "previousSibling" );
2989        },
2990        nextUntil: function( elem, i, until ) {
2991            return jQuery.dir( elem, "nextSibling", until );
2992        },
2993        prevUntil: function( elem, i, until ) {
2994            return jQuery.dir( elem, "previousSibling", until );
2995        },
2996        siblings: function( elem ) {
2997            return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
2998        },
2999        children: function( elem ) {
3000            return jQuery.sibling( elem.firstChild );
3001        },
3002        contents: function( elem ) {
3003            return jQuery.nodeName( elem, "iframe" ) ?
3004                elem.contentDocument || elem.contentWindow.document :
3005                jQuery.merge( [], elem.childNodes );
3006        }
3007    }, function( name, fn ) {
3008        jQuery.fn[ name ] = function( until, selector ) {
3009            var ret = jQuery.map( this, fn, until );
3010
3011            if ( name.slice( -5 ) !== "Until" ) {
3012                selector = until;
3013            }
3014
3015            if ( selector && typeof selector === "string" ) {
3016                ret = jQuery.filter( selector, ret );
3017            }
3018
3019            if ( this.length > 1 ) {
3020                // Remove duplicates
3021                if ( !guaranteedUnique[ name ] ) {
3022                    ret = jQuery.unique( ret );
3023                }
3024
3025                // Reverse order for parents* and prev-derivatives
3026                if ( rparentsprev.test( name ) ) {
3027                    ret = ret.reverse();
3028                }
3029            }
3030
3031            return this.pushStack( ret );
3032        };
3033    });
3034    var rnotwhite = (/\S+/g);
3035
3036
3037
3038// String to Object options format cache
3039    var optionsCache = {};
3040
3041// Convert String-formatted options into Object-formatted ones and store in cache
3042    function createOptions( options ) {
3043        var object = optionsCache[ options ] = {};
3044        jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
3045            object[ flag ] = true;
3046        });
3047        return object;
3048    }
3049
3050    /*
3051     * Create a callback list using the following parameters:
3052     *
3053     *	options: an optional list of space-separated options that will change how
3054     *			the callback list behaves or a more traditional option object
3055     *
3056     * By default a callback list will act like an event callback list and can be
3057     * "fired" multiple times.
3058     *
3059     * Possible options:
3060     *
3061     *	once:			will ensure the callback list can only be fired once (like a Deferred)
3062     *
3063     *	memory:			will keep track of previous values and will call any callback added
3064     *					after the list has been fired right away with the latest "memorized"
3065     *					values (like a Deferred)
3066     *
3067     *	unique:			will ensure a callback can only be added once (no duplicate in the list)
3068     *
3069     *	stopOnFalse:	interrupt callings when a callback returns false
3070     *
3071     */
3072    jQuery.Callbacks = function( options ) {
3073
3074        // Convert options from String-formatted to Object-formatted if needed
3075        // (we check in cache first)
3076        options = typeof options === "string" ?
3077            ( optionsCache[ options ] || createOptions( options ) ) :
3078            jQuery.extend( {}, options );
3079
3080        var // Flag to know if list is currently firing
3081            firing,
3082        // Last fire value (for non-forgettable lists)
3083            memory,
3084        // Flag to know if list was already fired
3085            fired,
3086        // End of the loop when firing
3087            firingLength,
3088        // Index of currently firing callback (modified by remove if needed)
3089            firingIndex,
3090        // First callback to fire (used internally by add and fireWith)
3091            firingStart,
3092        // Actual callback list
3093            list = [],
vendor: 12,051 bytes, lines 3094-3371
3094        // Stack of fire calls for repeatable lists
3095            stack = !options.once && [],
3096        // Fire callbacks
3097            fire = function( data ) {
3098                memory = options.memory && data;
3099                fired = true;
3100                firingIndex = firingStart || 0;
3101                firingStart = 0;
3102                firingLength = list.length;
3103                firing = true;
3104                for ( ; list && firingIndex < firingLength; firingIndex++ ) {
3105                    if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
3106                        memory = false; // To prevent further calls using add
3107                        break;
3108                    }
3109                }
3110                firing = false;
3111                if ( list ) {
3112                    if ( stack ) {
3113                        if ( stack.length ) {
3114                            fire( stack.shift() );
3115                        }
3116                    } else if ( memory ) {
3117                        list = [];
3118                    } else {
3119                        self.disable();
3120                    }
3121                }
3122            },
3123        // Actual Callbacks object
3124            self = {
3125                // Add a callback or a collection of callbacks to the list
3126                add: function() {
3127                    if ( list ) {
3128                        // First, we save the current length
3129                        var start = list.length;
3130                        (function add( args ) {
3131                            jQuery.each( args, function( _, arg ) {
3132                                var type = jQuery.type( arg );
3133                                if ( type === "function" ) {
3134                                    if ( !options.unique || !self.has( arg ) ) {
3135                                        list.push( arg );
3136                                    }
3137                                } else if ( arg && arg.length && type !== "string" ) {
3138                                    // Inspect recursively
3139                                    add( arg );
3140                                }
3141                            });
3142                        })( arguments );
3143                        // Do we need to add the callbacks to the
3144                        // current firing batch?
3145                        if ( firing ) {
3146                            firingLength = list.length;
3147                            // With memory, if we're not firing then
3148                            // we should call right away
3149                        } else if ( memory ) {
3150                            firingStart = start;
3151                            fire( memory );
3152                        }
3153                    }
3154                    return this;
3155                },
3156                // Remove a callback from the list
3157                remove: function() {
3158                    if ( list ) {
3159                        jQuery.each( arguments, function( _, arg ) {
3160                            var index;
3161                            while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3162                                list.splice( index, 1 );
3163                                // Handle firing indexes
3164                                if ( firing ) {
3165                                    if ( index <= firingLength ) {
3166                                        firingLength--;
3167                                    }
3168                                    if ( index <= firingIndex ) {
3169                                        firingIndex--;
3170                                    }
3171                                }
3172                            }
3173                        });
3174                    }
3175                    return this;
3176                },
3177                // Check if a given callback is in the list.
3178                // If no argument is given, return whether or not list has callbacks attached.
3179                has: function( fn ) {
3180                    return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
3181                },
3182                // Remove all callbacks from the list
3183                empty: function() {
3184                    list = [];
3185                    firingLength = 0;
3186                    return this;
3187                },
3188                // Have the list do nothing anymore
3189                disable: function() {
3190                    list = stack = memory = undefined;
3191                    return this;
3192                },
3193                // Is it disabled?
3194                disabled: function() {
3195                    return !list;
3196                },
3197                // Lock the list in its current state
3198                lock: function() {
3199                    stack = undefined;
3200                    if ( !memory ) {
3201                        self.disable();
3202                    }
3203                    return this;
3204                },
3205                // Is it locked?
3206                locked: function() {
3207                    return !stack;
3208                },
3209                // Call all callbacks with the given context and arguments
3210                fireWith: function( context, args ) {
3211                    if ( list && ( !fired || stack ) ) {
3212                        args = args || [];
3213                        args = [ context, args.slice ? args.slice() : args ];
3214                        if ( firing ) {
3215                            stack.push( args );
3216                        } else {
3217                            fire( args );
3218                        }
3219                    }
3220                    return this;
3221                },
3222                // Call all the callbacks with the given arguments
3223                fire: function() {
3224                    self.fireWith( this, arguments );
3225                    return this;
3226                },
3227                // To know if the callbacks have already been called at least once
3228                fired: function() {
3229                    return !!fired;
3230                }
3231            };
3232
3233        return self;
3234    };
3235
3236
3237    jQuery.extend({
3238
3239        Deferred: function( func ) {
3240            var tuples = [
3241                    // action, add listener, listener list, final state
3242                    [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
3243                    [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
3244                    [ "notify", "progress", jQuery.Callbacks("memory") ]
3245                ],
3246                state = "pending",
3247                promise = {
3248                    state: function() {
3249                        return state;
3250                    },
3251                    always: function() {
3252                        deferred.done( arguments ).fail( arguments );
3253                        return this;
3254                    },
3255                    then: function( /* fnDone, fnFail, fnProgress */ ) {
3256                        var fns = arguments;
3257                        return jQuery.Deferred(function( newDefer ) {
3258                            jQuery.each( tuples, function( i, tuple ) {
3259                                var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3260                                // deferred[ done | fail | progress ] for forwarding actions to newDefer
3261                                deferred[ tuple[1] ](function() {
3262                                    var returned = fn && fn.apply( this, arguments );
3263                                    if ( returned && jQuery.isFunction( returned.promise ) ) {
3264                                        returned.promise()
3265                                            .done( newDefer.resolve )
3266                                            .fail( newDefer.reject )
3267                                            .progress( newDefer.notify );
3268                                    } else {
3269                                        newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
3270                                    }
3271                                });
3272                            });
3273                            fns = null;
3274                        }).promise();
3275                    },
3276                    // Get a promise for this deferred
3277                    // If obj is provided, the promise aspect is added to the object
3278                    promise: function( obj ) {
3279                        return obj != null ? jQuery.extend( obj, promise ) : promise;
3280                    }
3281                },
3282                deferred = {};
3283
3284            // Keep pipe for back-compat
3285            promise.pipe = promise.then;
3286
3287            // Add list-specific methods
3288            jQuery.each( tuples, function( i, tuple ) {
3289                var list = tuple[ 2 ],
3290                    stateString = tuple[ 3 ];
3291
3292                // promise[ done | fail | progress ] = list.add
3293                promise[ tuple[1] ] = list.add;
3294
3295                // Handle state
3296                if ( stateString ) {
3297                    list.add(function() {
3298                        // state = [ resolved | rejected ]
3299                        state = stateString;
3300
3301                        // [ reject_list | resolve_list ].disable; progress_list.lock
3302                    }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3303                }
3304
3305                // deferred[ resolve | reject | notify ]
3306                deferred[ tuple[0] ] = function() {
3307                    deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
3308                    return this;
3309                };
3310                deferred[ tuple[0] + "With" ] = list.fireWith;
3311            });
3312
3313            // Make the deferred a promise
3314            promise.promise( deferred );
3315
3316            // Call given func if any
3317            if ( func ) {
3318                func.call( deferred, deferred );
3319            }
3320
3321            // All done!
3322            return deferred;
3323        },
3324
3325        // Deferred helper
3326        when: function( subordinate /* , ..., subordinateN */ ) {
3327            var i = 0,
3328                resolveValues = slice.call( arguments ),
3329                length = resolveValues.length,
3330
3331            // the count of uncompleted subordinates
3332                remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3333
3334            // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
3335                deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3336
3337            // Update function for both resolve and progress values
3338                updateFunc = function( i, contexts, values ) {
3339                    return function( value ) {
3340                        contexts[ i ] = this;
3341                        values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3342                        if ( values === progressValues ) {
3343                            deferred.notifyWith( contexts, values );
3344
3345                        } else if ( !(--remaining) ) {
3346                            deferred.resolveWith( contexts, values );
3347                        }
3348                    };
3349                },
3350
3351                progressValues, progressContexts, resolveContexts;
3352
3353            // add listeners to Deferred subordinates; treat others as resolved
3354            if ( length > 1 ) {
3355                progressValues = new Array( length );
3356                progressContexts = new Array( length );
3357                resolveContexts = new Array( length );
3358                for ( ; i < length; i++ ) {
3359                    if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3360                        resolveValues[ i ].promise()
3361                            .done( updateFunc( i, resolveContexts, resolveValues ) )
3362                            .fail( deferred.reject )
3363                            .progress( updateFunc( i, progressContexts, progressValues ) );
3364                    } else {
3365                        --remaining;
3366                    }
3367                }
3368            }
3369
3370            // if we're not waiting on anything, resolve the master
3371            if ( !remaining ) {
3372                deferred.resolveWith( resolveContexts, resolveValues );
3373            }
3374
3375            return deferred.promise();
3376        }
3377    });
3378
3379
3380// The deferred used on DOM ready
3381    var readyList;
3382
3383    jQuery.fn.ready = function( fn ) {
3384        // Add the callback
3385        jQuery.ready.promise().done( fn );
3386
3387        return this;
3388    };
3389
3390    jQuery.extend({
3391        // Is the DOM ready to be used? Set to true once it occurs.
3392        isReady: false,
3393
3394        // A counter to track how many items to wait for before
3395        // the ready event fires. See #6781
3396        readyWait: 1,
3397
3398        // Hold (or release) the ready event
3399        holdReady: function( hold ) {
3400            if ( hold ) {
3401                jQuery.readyWait++;
3402            } else {
3403                jQuery.ready( true );
3404            }
3405        },
3406
3407        // Handle when the DOM is ready
3408        ready: function( wait ) {
3409
3410            // Abort if there are pending holds or we're already ready
3411            if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3412                return;
3413            }
3414
3415            // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
3416            if ( !document.body ) {
3417                return setTimeout( jQuery.ready );
3418            }
3419
3420            // Remember that the DOM is ready
3421            jQuery.isReady = true;
3422
3423            // If a normal DOM Ready event fired, decrement, and wait if need be
3424            if ( wait !== true && --jQuery.readyWait > 0 ) {
3425                return;
3426            }
3427
3428            // If there are functions bound, to execute
3429            readyList.resolveWith( document, [ jQuery ] );
3430
3431            // Trigger any bound ready events
3432            if ( jQuery.fn.trigger ) {
3433                jQuery( document ).trigger("ready").off("ready");
3434            }
3435        }
3436    });
3437
3438    /**
3439     * Clean-up method for dom ready events
3440     */
3441    function detach() {
3442        if ( document.addEventListener ) {
3443            document.removeEventListener( "DOMContentLoaded", completed, false );
3444            window.removeEventListener( "load", completed, false );
3445
3446        } else {
3447            document.detachEvent( "onreadystatechange", completed );
3448            window.detachEvent( "onload", completed );
3449        }
3450    }
3451
3452    /**
3453     * The ready event handler and self cleanup method
3454     */
3455    function completed() {
3456        // readyState === "complete" is good enough for us to call the dom ready in oldIE
3457        if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
3458            detach();
3459            jQuery.ready();
3460        }
3461    }
3462
3463    jQuery.ready.promise = function( obj ) {
3464        if ( !readyList ) {
3465
3466            readyList = jQuery.Deferred();
3467
3468            // Catch cases where $(document).ready() is called after the browser event has already occurred.
3469            // we once tried to use readyState "interactive" here, but it caused issues like the one
3470            // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
3471            if ( document.readyState === "complete" ) {
3472                // Handle it asynchronously to allow scripts the opportunity to delay ready
3473                setTimeout( jQuery.ready );
3474
3475                // Standards-based browsers support DOMContentLoaded
3476            } else if ( document.addEventListener ) {
3477                // Use the handy event callback
3478                document.addEventListener( "DOMContentLoaded", completed, false );
3479
3480                // A fallback to window.onload, that will always work
3481                window.addEventListener( "load", completed, false );
3482
3483                // If IE event model is used
3484            } else {
3485                // Ensure firing before onload, maybe late but safe also for iframes
3486                document.attachEvent( "onreadystatechange", completed );
3487
3488                // A fallback to window.onload, that will always work
3489                window.attachEvent( "onload", completed );
3490
3491                // If IE and not a frame
3492                // continually check to see if the document is ready
3493                var top = false;
3494
3495                try {
3496                    top = window.frameElement == null && document.documentElement;
3497                } catch(e) {}
3498
3499                if ( top && top.doScroll ) {
3500                    (function doScrollCheck() {
3501                        if ( !jQuery.isReady ) {
3502
3503                            try {
3504                                // Use the trick by Diego Perini
3505                                // http://javascript.nwbox.com/IEContentLoaded/
3506                                top.doScroll("left");
3507                            } catch(e) {
3508                                return setTimeout( doScrollCheck, 50 );
3509                            }
3510
3511                            // detach all dom ready events
3512                            detach();
3513
3514                            // and execute any waiting functions
3515                            jQuery.ready();
3516                        }
3517                    })();
3518                }
3519            }
3520        }
3521        return readyList.promise( obj );
3522    };
3523
3524
3525    var strundefined = typeof undefined;
3526
3527
3528
3529// Support: IE<9
3530// Iteration over object's inherited properties before its own
3531    var i;
3532    for ( i in jQuery( support ) ) {
3533        break;
3534    }
3535    support.ownLast = i !== "0";
3536
3537// Note: most support tests are defined in their respective modules.
3538// false until the test is run
3539    support.inlineBlockNeedsLayout = false;
3540
3541    jQuery(function() {
3542        // We need to execute this one support test ASAP because we need to know
3543        // if body.style.zoom needs to be set.
3544
3545        var container, div,
3546            body = document.getElementsByTagName("body")[0];
3547
3548        if ( !body ) {
3549            // Return for frameset docs that don't have a body
3550            return;
3551        }
3552
3553        // Setup
3554        container = document.createElement( "div" );
3555        container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
3556
3557        div = document.createElement( "div" );
3558        body.appendChild( container ).appendChild( div );
3559
3560        if ( typeof div.style.zoom !== strundefined ) {
3561            // Support: IE<8
3562            // Check if natively block-level elements act like inline-block
3563            // elements when setting their display to 'inline' and giving
3564            // them layout
3565            div.style.cssText = "border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1";
3566
3567            if ( (support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 )) ) {
3568                // Prevent IE 6 from affecting layout for positioned elements #11048
3569                // Prevent IE from shrinking the body in IE 7 mode #12869
3570                // Support: IE<8
3571                body.style.zoom = 1;
3572            }
3573        }
3574
3575        body.removeChild( container );
3576
3577        // Null elements to avoid leaks in IE
3578        container = div = null;
3579    });
3580
3581
3582
3583
3584    (function() {
3585        var div = document.createElement( "div" );
3586
3587        // Execute the test only if not already executed in another module.
3588        if (support.deleteExpando == null) {
3589            // Support: IE<9
3590            support.deleteExpando = true;
3591            try {
3592                delete div.test;
3593            } catch( e ) {
3594                support.deleteExpando = false;
3595            }
3596        }
3597
3598        // Null elements to avoid leaks in IE.
3599        div = null;
3600    })();
3601
3602
3603    /**
3604     * Determines whether an object can have data
3605     */
3606    jQuery.acceptData = function( elem ) {
3607        var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
3608            nodeType = +elem.nodeType || 1;
3609
3610        // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
3611        return nodeType !== 1 && nodeType !== 9 ?
3612            false :
3613
3614            // Nodes accept data unless otherwise specified; rejection can be conditional
3615            !noData || noData !== true && elem.getAttribute("classid") === noData;
3616    };
3617
3618
3619    var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
3620        rmultiDash = /([A-Z])/g;
3621
3622    function dataAttr( elem, key, data ) {
3623        // If nothing was found internally, try to fetch any
3624        // data from the HTML5 data-* attribute
3625        if ( data === undefined && elem.nodeType === 1 ) {
3626
3627            var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
3628
3629            data = elem.getAttribute( name );
3630
3631            if ( typeof data === "string" ) {
3632                try {
3633                    data = data === "true" ? true :
3634                            data === "false" ? false :
3635                            data === "null" ? null :
3636                        // Only convert to a number if it doesn't change the string
3637                            +data + "" === data ? +data :
3638                        rbrace.test( data ) ? jQuery.parseJSON( data ) :
3639                            data;
3640                } catch( e ) {}
3641
3642                // Make sure we set the data so it isn't changed later
3643                jQuery.data( elem, key, data );
3644
3645            } else {
3646                data = undefined;
3647            }
3648        }
3649
3650        return data;
3651    }
3652
3653// checks a cache object for emptiness
3654    function isEmptyDataObject( obj ) {
3655        var name;
3656        for ( name in obj ) {
3657
3658            // if the public data object is empty, the private is still empty
3659            if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
3660                continue;
3661            }
3662            if ( name !== "toJSON" ) {
3663                return false;
3664            }
3665        }
3666
3667        return true;
3668    }
3669
3670    function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
3671        if ( !jQuery.acceptData( elem ) ) {
3672            return;
3673        }
3674
3675        var ret, thisCache,
3676            internalKey = jQuery.expando,
3677
3678        // We have to handle DOM nodes and JS objects differently because IE6-7
3679        // can't GC object references properly across the DOM-JS boundary
3680            isNode = elem.nodeType,
3681
3682        // Only DOM nodes need the global jQuery cache; JS object data is
3683        // attached directly to the object so GC can occur automatically
3684            cache = isNode ? jQuery.cache : elem,
3685
3686        // Only defining an ID for JS objects if its cache already exists allows
3687        // the code to shortcut on the same path as a DOM node with no cache
3688            id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
3689
3690        // Avoid doing any more work than we need to when trying to get data on an
3691        // object that has no data at all
3692        if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
3693            return;
3694        }
3695
3696        if ( !id ) {
3697            // Only DOM nodes need a new unique ID for each element since their data
3698            // ends up in the global cache
3699            if ( isNode ) {
3700                id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
3701            } else {
3702                id = internalKey;
3703            }
3704        }
3705
3706        if ( !cache[ id ] ) {
3707            // Avoid exposing jQuery metadata on plain JS objects when the object
3708            // is serialized using JSON.stringify
3709            cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
3710        }
3711
3712        // An object can be passed to jQuery.data instead of a key/value pair; this gets
3713        // shallow copied over onto the existing cache
3714        if ( typeof name === "object" || typeof name === "function" ) {
3715            if ( pvt ) {
3716                cache[ id ] = jQuery.extend( cache[ id ], name );
3717            } else {
3718                cache[ id ].data = jQuery.extend( cache[ id ].data, name );
3719            }
3720        }
3721
3722        thisCache = cache[ id ];
3723
3724        // jQuery data() is stored in a separate object inside the object's internal data
3725        // cache in order to avoid key collisions between internal data and user-defined
3726        // data.
3727        if ( !pvt ) {
3728            if ( !thisCache.data ) {
3729                thisCache.data = {};
3730            }
3731
3732            thisCache = thisCache.data;
3733        }
3734
3735        if ( data !== undefined ) {
3736            thisCache[ jQuery.camelCase( name ) ] = data;
3737        }
3738
3739        // Check for both converted-to-camel and non-converted data property names
3740        // If a data property was specified
3741        if ( typeof name === "string" ) {
3742
3743            // First Try to find as-is property data
3744            ret = thisCache[ name ];
3745
3746            // Test for null|undefined property data
3747            if ( ret == null ) {
3748
3749                // Try to find the camelCased property
3750                ret = thisCache[ jQuery.camelCase( name ) ];
3751            }
3752        } else {
3753            ret = thisCache;
3754        }
3755
3756        return ret;
3757    }
3758
3759    function internalRemoveData( elem, name, pvt ) {
3760        if ( !jQuery.acceptData( elem ) ) {
3761            return;
3762        }
3763
3764        var thisCache, i,
3765            isNode = elem.nodeType,
3766
3767        // See jQuery.data for more information
3768            cache = isNode ? jQuery.cache : elem,
3769            id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
3770
3771        // If there is already no cache entry for this object, there is no
3772        // purpose in continuing
3773        if ( !cache[ id ] ) {
3774            return;
3775        }
3776
3777        if ( name ) {
3778
3779            thisCache = pvt ? cache[ id ] : cache[ id ].data;
3780
3781            if ( thisCache ) {
3782
3783                // Support array or space separated string names for data keys
3784                if ( !jQuery.isArray( name ) ) {
3785
3786                    // try the string as a key before any manipulation
3787                    if ( name in thisCache ) {
3788                        name = [ name ];
3789                    } else {
3790
3791                        // split the camel cased version by spaces unless a key with the spaces exists
3792                        name = jQuery.camelCase( name );
3793                        if ( name in thisCache ) {
3794                            name = [ name ];
3795                        } else {
3796                            name = name.split(" ");
3797                        }
3798                    }
3799                } else {
3800                    // If "name" is an array of keys...
3801                    // When data is initially created, via ("key", "val") signature,
3802                    // keys will be converted to camelCase.
3803                    // Since there is no way to tell _how_ a key was added, remove
3804                    // both plain key and camelCase key. #12786
3805                    // This will only penalize the array argument path.
3806                    name = name.concat( jQuery.map( name, jQuery.camelCase ) );
3807                }
3808
3809                i = name.length;
3810                while ( i-- ) {
3811                    delete thisCache[ name[i] ];
3812                }
3813
3814                // If there is no data left in the cache, we want to continue
3815                // and let the cache object itself get destroyed
3816                if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
3817                    return;
3818                }
3819            }
3820        }
3821
3822        // See jQuery.data for more information
3823        if ( !pvt ) {
3824            delete cache[ id ].data;
3825
3826            // Don't destroy the parent cache unless the internal data object
3827            // had been the only thing left in it
3828            if ( !isEmptyDataObject( cache[ id ] ) ) {
3829                return;
3830            }
3831        }
3832
3833        // Destroy the cache
3834        if ( isNode ) {
3835            jQuery.cleanData( [ elem ], true );
3836
3837            // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
3838            /* jshint eqeqeq: false */
3839        } else if ( support.deleteExpando || cache != cache.window ) {
3840            /* jshint eqeqeq: true */
3841            delete cache[ id ];
3842
3843            // When all else fails, null
3844        } else {
3845            cache[ id ] = null;
3846        }
3847    }
3848
3849    jQuery.extend({
3850        cache: {},
3851
3852        // The following elements (space-suffixed to avoid Object.prototype collisions)
3853        // throw uncatchable exceptions if you attempt to set expando properties
3854        noData: {
3855            "applet ": true,
3856            "embed ": true,
3857            // ...but Flash objects (which have this classid) *can* handle expandos
3858            "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
3859        },
3860
3861        hasData: function( elem ) {
3862            elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
3863            return !!elem && !isEmptyDataObject( elem );
3864        },
3865
3866        data: function( elem, name, data ) {
3867            return internalData( elem, name, data );
3868        },
3869
3870        removeData: function( elem, name ) {
3871            return internalRemoveData( elem, name );
3872        },
3873
3874        // For internal use only.
3875        _data: function( elem, name, data ) {
3876            return internalData( elem, name, data, true );
3877        },
3878
3879        _removeData: function( elem, name ) {
3880            return internalRemoveData( elem, name, true );
3881        }
3882    });
3883
3884    jQuery.fn.extend({
3885        data: function( key, value ) {
3886            var i, name, data,
3887                elem = this[0],
3888                attrs = elem && elem.attributes;
3889
3890            // Special expections of .data basically thwart jQuery.access,
3891            // so implement the relevant behavior ourselves
3892
3893            // Gets all values
3894            if ( key === undefined ) {
3895                if ( this.length ) {
3896                    data = jQuery.data( elem );
3897
3898                    if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
3899                        i = attrs.length;
3900                        while ( i-- ) {
3901                            name = attrs[i].name;
3902
vendor: 5,799 bytes, lines 3903-4083
3903                            if ( name.indexOf("data-") === 0 ) {
3904                                name = jQuery.camelCase( name.slice(5) );
3905
3906                                dataAttr( elem, name, data[ name ] );
3907                            }
3908                        }
3909                        jQuery._data( elem, "parsedAttrs", true );
3910                    }
3911                }
3912
3913                return data;
3914            }
3915
3916            // Sets multiple values
3917            if ( typeof key === "object" ) {
3918                return this.each(function() {
3919                    jQuery.data( this, key );
3920                });
3921            }
3922
3923            return arguments.length > 1 ?
3924
3925                // Sets one value
3926                this.each(function() {
3927                    jQuery.data( this, key, value );
3928                }) :
3929
3930                // Gets one value
3931                // Try to fetch any internally stored data first
3932                elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
3933        },
3934
3935        removeData: function( key ) {
3936            return this.each(function() {
3937                jQuery.removeData( this, key );
3938            });
3939        }
3940    });
3941
3942
3943    jQuery.extend({
3944        queue: function( elem, type, data ) {
3945            var queue;
3946
3947            if ( elem ) {
3948                type = ( type || "fx" ) + "queue";
3949                queue = jQuery._data( elem, type );
3950
3951                // Speed up dequeue by getting out quickly if this is just a lookup
3952                if ( data ) {
3953                    if ( !queue || jQuery.isArray(data) ) {
3954                        queue = jQuery._data( elem, type, jQuery.makeArray(data) );
3955                    } else {
3956                        queue.push( data );
3957                    }
3958                }
3959                return queue || [];
3960            }
3961        },
3962
3963        dequeue: function( elem, type ) {
3964            type = type || "fx";
3965
3966            var queue = jQuery.queue( elem, type ),
3967                startLength = queue.length,
3968                fn = queue.shift(),
3969                hooks = jQuery._queueHooks( elem, type ),
3970                next = function() {
3971                    jQuery.dequeue( elem, type );
3972                };
3973
3974            // If the fx queue is dequeued, always remove the progress sentinel
3975            if ( fn === "inprogress" ) {
3976                fn = queue.shift();
3977                startLength--;
3978            }
3979
3980            if ( fn ) {
3981
3982                // Add a progress sentinel to prevent the fx queue from being
3983                // automatically dequeued
3984                if ( type === "fx" ) {
3985                    queue.unshift( "inprogress" );
3986                }
3987
3988                // clear up the last queue stop function
3989                delete hooks.stop;
3990                fn.call( elem, next, hooks );
3991            }
3992
3993            if ( !startLength && hooks ) {
3994                hooks.empty.fire();
3995            }
3996        },
3997
3998        // not intended for public consumption - generates a queueHooks object, or returns the current one
3999        _queueHooks: function( elem, type ) {
4000            var key = type + "queueHooks";
4001            return jQuery._data( elem, key ) || jQuery._data( elem, key, {
4002                empty: jQuery.Callbacks("once memory").add(function() {
4003                    jQuery._removeData( elem, type + "queue" );
4004                    jQuery._removeData( elem, key );
4005                })
4006            });
4007        }
4008    });
4009
4010    jQuery.fn.extend({
4011        queue: function( type, data ) {
4012            var setter = 2;
4013
4014            if ( typeof type !== "string" ) {
4015                data = type;
4016                type = "fx";
4017                setter--;
4018            }
4019
4020            if ( arguments.length < setter ) {
4021                return jQuery.queue( this[0], type );
4022            }
4023
4024            return data === undefined ?
4025                this :
4026                this.each(function() {
4027                    var queue = jQuery.queue( this, type, data );
4028
4029                    // ensure a hooks for this queue
4030                    jQuery._queueHooks( this, type );
4031
4032                    if ( type === "fx" && queue[0] !== "inprogress" ) {
4033                        jQuery.dequeue( this, type );
4034                    }
4035                });
4036        },
4037        dequeue: function( type ) {
4038            return this.each(function() {
4039                jQuery.dequeue( this, type );
4040            });
4041        },
4042        clearQueue: function( type ) {
4043            return this.queue( type || "fx", [] );
4044        },
4045        // Get a promise resolved when queues of a certain type
4046        // are emptied (fx is the type by default)
4047        promise: function( type, obj ) {
4048            var tmp,
4049                count = 1,
4050                defer = jQuery.Deferred(),
4051                elements = this,
4052                i = this.length,
4053                resolve = function() {
4054                    if ( !( --count ) ) {
4055                        defer.resolveWith( elements, [ elements ] );
4056                    }
4057                };
4058
4059            if ( typeof type !== "string" ) {
4060                obj = type;
4061                type = undefined;
4062            }
4063            type = type || "fx";
4064
4065            while ( i-- ) {
4066                tmp = jQuery._data( elements[ i ], type + "queueHooks" );
4067                if ( tmp && tmp.empty ) {
4068                    count++;
4069                    tmp.empty.add( resolve );
4070                }
4071            }
4072            resolve();
4073            return defer.promise( obj );
4074        }
4075    });
4076    var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
4077
4078    var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4079
4080    var isHidden = function( elem, el ) {
4081        // isHidden might be called from jQuery#filter function;
4082        // in that case, element will be second argument
4083        elem = el || elem;
4084        return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
4085    };
4086
4087
4088
4089// Multifunctional method to get and set values of a collection
4090// The value/s can optionally be executed if it's a function
4091    var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4092        var i = 0,
4093            length = elems.length,
4094            bulk = key == null;
4095
4096        // Sets many values
4097        if ( jQuery.type( key ) === "object" ) {
4098            chainable = true;
4099            for ( i in key ) {
4100                jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
4101            }
4102
4103            // Sets one value
4104        } else if ( value !== undefined ) {
4105            chainable = true;
4106
4107            if ( !jQuery.isFunction( value ) ) {
4108                raw = true;
4109            }
4110
4111            if ( bulk ) {
4112                // Bulk operations run against the entire set
4113                if ( raw ) {
4114                    fn.call( elems, value );
4115                    fn = null;
4116
4117                    // ...except when executing function values
4118                } else {
4119                    bulk = fn;
4120                    fn = function( elem, key, value ) {
4121                        return bulk.call( jQuery( elem ), value );
4122                    };
4123                }
4124            }
4125
4126            if ( fn ) {
4127                for ( ; i < length; i++ ) {
4128                    fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
4129                }
4130            }
4131        }
4132
4133        return chainable ?
4134            elems :
4135
4136            // Gets
4137            bulk ?
4138                fn.call( elems ) :
4139                length ? fn( elems[0], key ) : emptyGet;
4140    };
4141    var rcheckableType = (/^(?:checkbox|radio)$/i);
4142
4143
4144
4145    (function() {
4146        var fragment = document.createDocumentFragment(),
4147            div = document.createElement("div"),
4148            input = document.createElement("input");
4149
4150        // Setup
4151        div.setAttribute( "className", "t" );
4152        div.innerHTML = "  <link/><table></table><a href='/a'>a</a>";
4153
4154        // IE strips leading whitespace when .innerHTML is used
4155        support.leadingWhitespace = div.firstChild.nodeType === 3;
4156
4157        // Make sure that tbody elements aren't automatically inserted
4158        // IE will insert them into empty tables
4159        support.tbody = !div.getElementsByTagName( "tbody" ).length;
4160
4161        // Make sure that link elements get serialized correctly by innerHTML
4162        // This requires a wrapper element in IE
4163        support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
4164
4165        // Makes sure cloning an html5 element does not cause problems
4166        // Where outerHTML is undefined, this still works
4167        support.html5Clone =
4168            document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
4169
4170        // Check if a disconnected checkbox will retain its checked
4171        // value of true after appended to the DOM (IE6/7)
4172        input.type = "checkbox";
4173        input.checked = true;
4174        fragment.appendChild( input );
4175        support.appendChecked = input.checked;
4176
4177        // Make sure textarea (and checkbox) defaultValue is properly cloned
4178        // Support: IE6-IE11+
4179        div.innerHTML = "<textarea>x</textarea>";
4180        support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4181
4182        // #11217 - WebKit loses check when the name is after the checked attribute
4183        fragment.appendChild( div );
4184        div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
4185
4186        // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
4187        // old WebKit doesn't clone checked state correctly in fragments
4188        support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4189
4190        // Support: IE<9
4191        // Opera does not clone events (and typeof div.attachEvent === undefined).
4192        // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
4193        support.noCloneEvent = true;
4194        if ( div.attachEvent ) {
4195            div.attachEvent( "onclick", function() {
4196                support.noCloneEvent = false;
4197            });
4198
4199            div.cloneNode( true ).click();
4200        }
4201
4202        // Execute the test only if not already executed in another module.
4203        if (support.deleteExpando == null) {
4204            // Support: IE<9
4205            support.deleteExpando = true;
4206            try {
4207                delete div.test;
4208            } catch( e ) {
4209                support.deleteExpando = false;
4210            }
4211        }
4212
4213        // Null elements to avoid leaks in IE.
4214        fragment = div = input = null;
4215    })();
4216
4217
4218    (function() {
4219        var i, eventName,
4220            div = document.createElement( "div" );
4221
4222        // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
4223        for ( i in { submit: true, change: true, focusin: true }) {
4224            eventName = "on" + i;
4225
4226            if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
4227                // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
4228                div.setAttribute( eventName, "t" );
4229                support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
4230            }
4231        }
4232
4233        // Null elements to avoid leaks in IE.
4234        div = null;
4235    })();
4236
4237
4238    var rformElems = /^(?:input|select|textarea)$/i,
4239        rkeyEvent = /^key/,
4240        rmouseEvent = /^(?:mouse|contextmenu)|click/,
4241        rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
4242        rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
4243
4244    function returnTrue() {
4245        return true;
4246    }
4247
4248    function returnFalse() {
4249        return false;
4250    }
4251
4252    function safeActiveElement() {
4253        try {
4254            return document.activeElement;
4255        } catch ( err ) { }
4256    }
4257
4258    /*
4259     * Helper functions for managing events -- not part of the public interface.
4260     * Props to Dean Edwards' addEvent library for many of the ideas.
4261     */
4262    jQuery.event = {
4263
4264        global: {},
4265
4266        add: function( elem, types, handler, data, selector ) {
4267            var tmp, events, t, handleObjIn,
4268                special, eventHandle, handleObj,
4269                handlers, type, namespaces, origType,
4270                elemData = jQuery._data( elem );
4271
4272            // Don't attach events to noData or text/comment nodes (but allow plain objects)
4273            if ( !elemData ) {
4274                return;
4275            }
4276
4277            // Caller can pass in an object of custom data in lieu of the handler
4278            if ( handler.handler ) {
4279                handleObjIn = handler;
4280                handler = handleObjIn.handler;
4281                selector = handleObjIn.selector;
4282            }
4283
4284            // Make sure that the handler has a unique ID, used to find/remove it later
4285            if ( !handler.guid ) {
4286                handler.guid = jQuery.guid++;
4287            }
4288
4289            // Init the element's event structure and main handler, if this is the first
4290            if ( !(events = elemData.events) ) {
4291                events = elemData.events = {};
4292            }
4293            if ( !(eventHandle = elemData.handle) ) {
4294                eventHandle = elemData.handle = function( e ) {
4295                    // Discard the second event of a jQuery.event.trigger() and
4296                    // when an event is called after a page has unloaded
4297                    return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
4298                        jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
4299                        undefined;
4300                };
4301                // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
4302                eventHandle.elem = elem;
4303            }
4304
4305            // Handle multiple events separated by a space
4306            types = ( types || "" ).match( rnotwhite ) || [ "" ];
4307            t = types.length;
4308            while ( t-- ) {
4309                tmp = rtypenamespace.exec( types[t] ) || [];
4310                type = origType = tmp[1];
4311                namespaces = ( tmp[2] || "" ).split( "." ).sort();
4312
4313                // There *must* be a type, no attaching namespace-only handlers
4314                if ( !type ) {
4315                    continue;
4316                }
4317
4318                // If event changes its type, use the special event handlers for the changed type
4319                special = jQuery.event.special[ type ] || {};
4320
4321                // If selector defined, determine special event api type, otherwise given type
4322                type = ( selector ? special.delegateType : special.bindType ) || type;
4323
4324                // Update special based on newly reset type
4325                special = jQuery.event.special[ type ] || {};
4326
4327                // handleObj is passed to all event handlers
4328                handleObj = jQuery.extend({
4329                    type: type,
4330                    origType: origType,
4331                    data: data,
4332                    handler: handler,
4333                    guid: handler.guid,
4334                    selector: selector,
4335                    needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4336                    namespace: namespaces.join(".")
4337                }, handleObjIn );
4338
4339                // Init the event handler queue if we're the first
4340                if ( !(handlers = events[ type ]) ) {
4341                    handlers = events[ type ] = [];
4342                    handlers.delegateCount = 0;
4343
4344                    // Only use addEventListener/attachEvent if the special events handler returns false
4345                    if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4346                        // Bind the global event handler to the element
4347                        if ( elem.addEventListener ) {
4348                            elem.addEventListener( type, eventHandle, false );
4349
4350                        } else if ( elem.attachEvent ) {
4351                            elem.attachEvent( "on" + type, eventHandle );
4352                        }
4353                    }
4354                }
4355
4356                if ( special.add ) {
4357                    special.add.call( elem, handleObj );
4358
4359                    if ( !handleObj.handler.guid ) {
4360                        handleObj.handler.guid = handler.guid;
4361                    }
4362                }
4363
4364                // Add to the element's handler list, delegates in front
4365                if ( selector ) {
4366                    handlers.splice( handlers.delegateCount++, 0, handleObj );
4367                } else {
4368                    handlers.push( handleObj );
4369                }
4370
4371                // Keep track of which events have ever been used, for event optimization
4372                jQuery.event.global[ type ] = true;
4373            }
4374
4375            // Nullify elem to prevent memory leaks in IE
4376            elem = null;
4377        },
4378
4379        // Detach an event or set of events from an element
4380        remove: function( elem, types, handler, selector, mappedTypes ) {
4381            var j, handleObj, tmp,
4382                origCount, t, events,
4383                special, handlers, type,
4384                namespaces, origType,
4385                elemData = jQuery.hasData( elem ) && jQuery._data( elem );
4386
4387            if ( !elemData || !(events = elemData.events) ) {
4388                return;
4389            }
4390
vendor: 11,384 bytes, lines 4391-4657
4391            // Once for each type.namespace in types; type may be omitted
4392            types = ( types || "" ).match( rnotwhite ) || [ "" ];
4393            t = types.length;
4394            while ( t-- ) {
4395                tmp = rtypenamespace.exec( types[t] ) || [];
4396                type = origType = tmp[1];
4397                namespaces = ( tmp[2] || "" ).split( "." ).sort();
4398
4399                // Unbind all events (on this namespace, if provided) for the element
4400                if ( !type ) {
4401                    for ( type in events ) {
4402                        jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4403                    }
4404                    continue;
4405                }
4406
4407                special = jQuery.event.special[ type ] || {};
4408                type = ( selector ? special.delegateType : special.bindType ) || type;
4409                handlers = events[ type ] || [];
4410                tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
4411
4412                // Remove matching events
4413                origCount = j = handlers.length;
4414                while ( j-- ) {
4415                    handleObj = handlers[ j ];
4416
4417                    if ( ( mappedTypes || origType === handleObj.origType ) &&
4418                        ( !handler || handler.guid === handleObj.guid ) &&
4419                        ( !tmp || tmp.test( handleObj.namespace ) ) &&
4420                        ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
4421                        handlers.splice( j, 1 );
4422
4423                        if ( handleObj.selector ) {
4424                            handlers.delegateCount--;
4425                        }
4426                        if ( special.remove ) {
4427                            special.remove.call( elem, handleObj );
4428                        }
4429                    }
4430                }
4431
4432                // Remove generic event handler if we removed something and no more handlers exist
4433                // (avoids potential for endless recursion during removal of special event handlers)
4434                if ( origCount && !handlers.length ) {
4435                    if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4436                        jQuery.removeEvent( elem, type, elemData.handle );
4437                    }
4438
4439                    delete events[ type ];
4440                }
4441            }
4442
4443            // Remove the expando if it's no longer used
4444            if ( jQuery.isEmptyObject( events ) ) {
4445                delete elemData.handle;
4446
4447                // removeData also checks for emptiness and clears the expando if empty
4448                // so use it instead of delete
4449                jQuery._removeData( elem, "events" );
4450            }
4451        },
4452
4453        trigger: function( event, data, elem, onlyHandlers ) {
4454            var handle, ontype, cur,
4455                bubbleType, special, tmp, i,
4456                eventPath = [ elem || document ],
4457                type = hasOwn.call( event, "type" ) ? event.type : event,
4458                namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
4459
4460            cur = tmp = elem = elem || document;
4461
4462            // Don't do events on text and comment nodes
4463            if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
4464                return;
4465            }
4466
4467            // focus/blur morphs to focusin/out; ensure we're not firing them right now
4468            if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
4469                return;
4470            }
4471
4472            if ( type.indexOf(".") >= 0 ) {
4473                // Namespaced trigger; create a regexp to match event type in handle()
4474                namespaces = type.split(".");
4475                type = namespaces.shift();
4476                namespaces.sort();
4477            }
4478            ontype = type.indexOf(":") < 0 && "on" + type;
4479
4480            // Caller can pass in a jQuery.Event object, Object, or just an event type string
4481            event = event[ jQuery.expando ] ?
4482                event :
4483                new jQuery.Event( type, typeof event === "object" && event );
4484
4485            // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
4486            event.isTrigger = onlyHandlers ? 2 : 3;
4487            event.namespace = namespaces.join(".");
4488            event.namespace_re = event.namespace ?
4489                new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
4490                null;
4491
4492            // Clean up the event in case it is being reused
4493            event.result = undefined;
4494            if ( !event.target ) {
4495                event.target = elem;
4496            }
4497
4498            // Clone any incoming data and prepend the event, creating the handler arg list
4499            data = data == null ?
4500                [ event ] :
4501                jQuery.makeArray( data, [ event ] );
4502
4503            // Allow special events to draw outside the lines
4504            special = jQuery.event.special[ type ] || {};
4505            if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
4506                return;
4507            }
4508
4509            // Determine event propagation path in advance, per W3C events spec (#9951)
4510            // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
4511            if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
4512
4513                bubbleType = special.delegateType || type;
4514                if ( !rfocusMorph.test( bubbleType + type ) ) {
4515                    cur = cur.parentNode;
4516                }
4517                for ( ; cur; cur = cur.parentNode ) {
4518                    eventPath.push( cur );
4519                    tmp = cur;
4520                }
4521
4522                // Only add window if we got to document (e.g., not plain obj or detached DOM)
4523                if ( tmp === (elem.ownerDocument || document) ) {
4524                    eventPath.push( tmp.defaultView || tmp.parentWindow || window );
4525                }
4526            }
4527
4528            // Fire handlers on the event path
4529            i = 0;
4530            while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
4531
4532                event.type = i > 1 ?
4533                    bubbleType :
4534                    special.bindType || type;
4535
4536                // jQuery handler
4537                handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
4538                if ( handle ) {
4539                    handle.apply( cur, data );
4540                }
4541
4542                // Native handler
4543                handle = ontype && cur[ ontype ];
4544                if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
4545                    event.result = handle.apply( cur, data );
4546                    if ( event.result === false ) {
4547                        event.preventDefault();
4548                    }
4549                }
4550            }
4551            event.type = type;
4552
4553            // If nobody prevented the default action, do it now
4554            if ( !onlyHandlers && !event.isDefaultPrevented() ) {
4555
4556                if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
4557                    jQuery.acceptData( elem ) ) {
4558
4559                    // Call a native DOM method on the target with the same name name as the event.
4560                    // Can't use an .isFunction() check here because IE6/7 fails that test.
4561                    // Don't do default actions on window, that's where global variables be (#6170)
4562                    if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
4563
4564                        // Don't re-trigger an onFOO event when we call its FOO() method
4565                        tmp = elem[ ontype ];
4566
4567                        if ( tmp ) {
4568                            elem[ ontype ] = null;
4569                        }
4570
4571                        // Prevent re-triggering of the same event, since we already bubbled it above
4572                        jQuery.event.triggered = type;
4573                        try {
4574                            elem[ type ]();
4575                        } catch ( e ) {
4576                            // IE<9 dies on focus/blur to hidden element (#1486,#12518)
4577                            // only reproducible on winXP IE8 native, not IE9 in IE8 mode
4578                        }
4579                        jQuery.event.triggered = undefined;
4580
4581                        if ( tmp ) {
4582                            elem[ ontype ] = tmp;
4583                        }
4584                    }
4585                }
4586            }
4587
4588            return event.result;
4589        },
4590
4591        dispatch: function( event ) {
4592
4593            // Make a writable jQuery.Event from the native event object
4594            event = jQuery.event.fix( event );
4595
4596            var i, ret, handleObj, matched, j,
4597                handlerQueue = [],
4598                args = slice.call( arguments ),
4599                handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
4600                special = jQuery.event.special[ event.type ] || {};
4601
4602            // Use the fix-ed jQuery.Event rather than the (read-only) native event
4603            args[0] = event;
4604            event.delegateTarget = this;
4605
4606            // Call the preDispatch hook for the mapped type, and let it bail if desired
4607            if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
4608                return;
4609            }
4610
4611            // Determine handlers
4612            handlerQueue = jQuery.event.handlers.call( this, event, handlers );
4613
4614            // Run delegates first; they may want to stop propagation beneath us
4615            i = 0;
4616            while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
4617                event.currentTarget = matched.elem;
4618
4619                j = 0;
4620                while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
4621
4622                    // Triggered event must either 1) have no namespace, or
4623                    // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
4624                    if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
4625
4626                        event.handleObj = handleObj;
4627                        event.data = handleObj.data;
4628
4629                        ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
4630                            .apply( matched.elem, args );
4631
4632                        if ( ret !== undefined ) {
4633                            if ( (event.result = ret) === false ) {
4634                                event.preventDefault();
4635                                event.stopPropagation();
4636                            }
4637                        }
4638                    }
4639                }
4640            }
4641
4642            // Call the postDispatch hook for the mapped type
4643            if ( special.postDispatch ) {
4644                special.postDispatch.call( this, event );
4645            }
4646
4647            return event.result;
4648        },
4649
4650        handlers: function( event, handlers ) {
4651            var sel, handleObj, matches, i,
4652                handlerQueue = [],
4653                delegateCount = handlers.delegateCount,
4654                cur = event.target;
4655
4656            // Find delegate handlers
4657            // Black-hole SVG <use> instance trees (#13180)
4658            // Avoid non-left-click bubbling in Firefox (#3861)
4659            if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
4660
4661                /* jshint eqeqeq: false */
4662                for ( ; cur != this; cur = cur.parentNode || this ) {
4663                    /* jshint eqeqeq: true */
4664
4665                    // Don't check non-elements (#13208)
4666                    // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
4667                    if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
4668                        matches = [];
4669                        for ( i = 0; i < delegateCount; i++ ) {
4670                            handleObj = handlers[ i ];
4671
4672                            // Don't conflict with Object.prototype properties (#13203)
4673                            sel = handleObj.selector + " ";
4674
4675                            if ( matches[ sel ] === undefined ) {
4676                                matches[ sel ] = handleObj.needsContext ?
4677                                    jQuery( sel, this ).index( cur ) >= 0 :
4678                                    jQuery.find( sel, this, null, [ cur ] ).length;
4679                            }
4680                            if ( matches[ sel ] ) {
4681                                matches.push( handleObj );
4682                            }
4683                        }
4684                        if ( matches.length ) {
4685                            handlerQueue.push({ elem: cur, handlers: matches });
4686                        }
4687                    }
4688                }
4689            }
4690
4691            // Add the remaining (directly-bound) handlers
4692            if ( delegateCount < handlers.length ) {
4693                handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
4694            }
4695
4696            return handlerQueue;
4697        },
4698
4699        fix: function( event ) {
4700            if ( event[ jQuery.expando ] ) {
4701                return event;
4702            }
4703
4704            // Create a writable copy of the event object and normalize some properties
4705            var i, prop, copy,
4706                type = event.type,
4707                originalEvent = event,
4708                fixHook = this.fixHooks[ type ];
4709
4710            if ( !fixHook ) {
4711                this.fixHooks[ type ] = fixHook =
4712                    rmouseEvent.test( type ) ? this.mouseHooks :
4713                        rkeyEvent.test( type ) ? this.keyHooks :
4714                        {};
4715            }
4716            copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
4717
4718            event = new jQuery.Event( originalEvent );
4719
4720            i = copy.length;
4721            while ( i-- ) {
4722                prop = copy[ i ];
4723                event[ prop ] = originalEvent[ prop ];
4724            }
4725
4726            // Support: IE<9
4727            // Fix target property (#1925)
4728            if ( !event.target ) {
4729                event.target = originalEvent.srcElement || document;
4730            }
4731
4732            // Support: Chrome 23+, Safari?
4733            // Target should not be a text node (#504, #13143)
4734            if ( event.target.nodeType === 3 ) {
4735                event.target = event.target.parentNode;
4736            }
4737
4738            // Support: IE<9
4739            // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
4740            event.metaKey = !!event.metaKey;
4741
4742            return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
4743        },
4744
4745        // Includes some event props shared by KeyEvent and MouseEvent
4746        props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
4747
4748        fixHooks: {},
4749
4750        keyHooks: {
4751            props: "char charCode key keyCode".split(" "),
4752            filter: function( event, original ) {
4753
4754                // Add which for key events
4755                if ( event.which == null ) {
4756                    event.which = original.charCode != null ? original.charCode : original.keyCode;
4757                }
4758
4759                return event;
4760            }
4761        },
4762
4763        mouseHooks: {
4764            props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
4765            filter: function( event, original ) {
4766                var body, eventDoc, doc,
4767                    button = original.button,
4768                    fromElement = original.fromElement;
4769
4770                // Calculate pageX/Y if missing and clientX/Y available
4771                if ( event.pageX == null && original.clientX != null ) {
4772                    eventDoc = event.target.ownerDocument || document;
4773                    doc = eventDoc.documentElement;
4774                    body = eventDoc.body;
4775
4776                    event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
4777                    event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
4778                }
4779
4780                // Add relatedTarget, if necessary
4781                if ( !event.relatedTarget && fromElement ) {
4782                    event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
4783                }
4784
4785                // Add which for click: 1 === left; 2 === middle; 3 === right
4786                // Note: button is not normalized, so don't use it
4787                if ( !event.which && button !== undefined ) {
4788                    event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
4789                }
4790
4791                return event;
4792            }
4793        },
4794
4795        special: {
4796            load: {
4797                // Prevent triggered image.load events from bubbling to window.load
4798                noBubble: true
4799            },
4800            focus: {
4801                // Fire native event if possible so blur/focus sequence is correct
4802                trigger: function() {
4803                    if ( this !== safeActiveElement() && this.focus ) {
4804                        try {
4805                            this.focus();
4806                            return false;
4807                        } catch ( e ) {
4808                            // Support: IE<9
4809                            // If we error on focus to hidden element (#1486, #12518),
4810                            // let .trigger() run the handlers
4811                        }
4812                    }
4813                },
4814                delegateType: "focusin"
4815            },
4816            blur: {
4817                trigger: function() {
4818                    if ( this === safeActiveElement() && this.blur ) {
4819                        this.blur();
4820                        return false;
4821                    }
4822                },
4823                delegateType: "focusout"
4824            },
4825            click: {
4826                // For checkbox, fire native event so checked state will be right
4827                trigger: function() {
4828                    if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
4829                        this.click();
4830                        return false;
4831                    }
4832                },
4833
4834                // For cross-browser consistency, don't fire native .click() on links
4835                _default: function( event ) {
4836                    return jQuery.nodeName( event.target, "a" );
4837                }
4838            },
4839
4840            beforeunload: {
4841                postDispatch: function( event ) {
4842
4843                    // Even when returnValue equals to undefined Firefox will still show alert
4844                    if ( event.result !== undefined ) {
4845                        event.originalEvent.returnValue = event.result;
4846                    }
4847                }
4848            }
4849        },
4850
4851        simulate: function( type, elem, event, bubble ) {
4852            // Piggyback on a donor event to simulate a different one.
4853            // Fake originalEvent to avoid donor's stopPropagation, but if the
4854            // simulated event prevents default then we do the same on the donor.
4855            var e = jQuery.extend(
4856                new jQuery.Event(),
4857                event,
4858                {
4859                    type: type,
4860                    isSimulated: true,
4861                    originalEvent: {}
4862                }
4863            );
4864            if ( bubble ) {
4865                jQuery.event.trigger( e, null, elem );
4866            } else {
4867                jQuery.event.dispatch.call( elem, e );
4868            }
4869            if ( e.isDefaultPrevented() ) {
4870                event.preventDefault();
4871            }
4872        }
4873    };
4874
4875    jQuery.removeEvent = document.removeEventListener ?
4876        function( elem, type, handle ) {
4877            if ( elem.removeEventListener ) {
4878                elem.removeEventListener( type, handle, false );
4879            }
4880        } :
4881        function( elem, type, handle ) {
4882            var name = "on" + type;
4883
4884            if ( elem.detachEvent ) {
4885
4886                // #8545, #7054, preventing memory leaks for custom events in IE6-8
4887                // detachEvent needed property on element, by name of that event, to properly expose it to GC
4888                if ( typeof elem[ name ] === strundefined ) {
4889                    elem[ name ] = null;
4890                }
4891
4892                elem.detachEvent( name, handle );
4893            }
4894        };
4895
4896    jQuery.Event = function( src, props ) {
4897        // Allow instantiation without the 'new' keyword
4898        if ( !(this instanceof jQuery.Event) ) {
4899            return new jQuery.Event( src, props );
4900        }
4901
4902        // Event object
4903        if ( src && src.type ) {
4904            this.originalEvent = src;
4905            this.type = src.type;
4906
4907            // Events bubbling up the document may have been marked as prevented
4908            // by a handler lower down the tree; reflect the correct value.
4909            this.isDefaultPrevented = src.defaultPrevented ||
4910                src.defaultPrevented === undefined && (
4911                // Support: IE < 9
4912                src.returnValue === false ||
4913                // Support: Android < 4.0
4914                src.getPreventDefault && src.getPreventDefault() ) ?
4915                returnTrue :
4916                returnFalse;
4917
4918            // Event type
4919        } else {
4920            this.type = src;
4921        }
4922
4923        // Put explicitly provided properties onto the event object
4924        if ( props ) {
4925            jQuery.extend( this, props );
4926        }
4927
4928        // Create a timestamp if incoming event doesn't have one
4929        this.timeStamp = src && src.timeStamp || jQuery.now();
4930
4931        // Mark it as fixed
4932        this[ jQuery.expando ] = true;
4933    };
4934
4935// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
4936// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
4937    jQuery.Event.prototype = {
4938        isDefaultPrevented: returnFalse,
4939        isPropagationStopped: returnFalse,
4940        isImmediatePropagationStopped: returnFalse,
4941
4942        preventDefault: function() {
4943            var e = this.originalEvent;
4944
4945            this.isDefaultPrevented = returnTrue;
4946            if ( !e ) {
4947                return;
4948            }
4949
4950            // If preventDefault exists, run it on the original event
4951            if ( e.preventDefault ) {
4952                e.preventDefault();
4953
vendor: 12,587 bytes, lines 4954-5274
4954                // Support: IE
4955                // Otherwise set the returnValue property of the original event to false
4956            } else {
4957                e.returnValue = false;
4958            }
4959        },
4960        stopPropagation: function() {
4961            var e = this.originalEvent;
4962
4963            this.isPropagationStopped = returnTrue;
4964            if ( !e ) {
4965                return;
4966            }
4967            // If stopPropagation exists, run it on the original event
4968            if ( e.stopPropagation ) {
4969                e.stopPropagation();
4970            }
4971
4972            // Support: IE
4973            // Set the cancelBubble property of the original event to true
4974            e.cancelBubble = true;
4975        },
4976        stopImmediatePropagation: function() {
4977            this.isImmediatePropagationStopped = returnTrue;
4978            this.stopPropagation();
4979        }
4980    };
4981
4982// Create mouseenter/leave events using mouseover/out and event-time checks
4983    jQuery.each({
4984        mouseenter: "mouseover",
4985        mouseleave: "mouseout"
4986    }, function( orig, fix ) {
4987        jQuery.event.special[ orig ] = {
4988            delegateType: fix,
4989            bindType: fix,
4990
4991            handle: function( event ) {
4992                var ret,
4993                    target = this,
4994                    related = event.relatedTarget,
4995                    handleObj = event.handleObj;
4996
4997                // For mousenter/leave call the handler if related is outside the target.
4998                // NB: No relatedTarget if the mouse left/entered the browser window
4999                if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
5000                    event.type = handleObj.origType;
5001                    ret = handleObj.handler.apply( this, arguments );
5002                    event.type = fix;
5003                }
5004                return ret;
5005            }
5006        };
5007    });
5008
5009// IE submit delegation
5010    if ( !support.submitBubbles ) {
5011
5012        jQuery.event.special.submit = {
5013            setup: function() {
5014                // Only need this for delegated form submit events
5015                if ( jQuery.nodeName( this, "form" ) ) {
5016                    return false;
5017                }
5018
5019                // Lazy-add a submit handler when a descendant form may potentially be submitted
5020                jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
5021                    // Node name check avoids a VML-related crash in IE (#9807)
5022                    var elem = e.target,
5023                        form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
5024                    if ( form && !jQuery._data( form, "submitBubbles" ) ) {
5025                        jQuery.event.add( form, "submit._submit", function( event ) {
5026                            event._submit_bubble = true;
5027                        });
5028                        jQuery._data( form, "submitBubbles", true );
5029                    }
5030                });
5031                // return undefined since we don't need an event listener
5032            },
5033
5034            postDispatch: function( event ) {
5035                // If form was submitted by the user, bubble the event up the tree
5036                if ( event._submit_bubble ) {
5037                    delete event._submit_bubble;
5038                    if ( this.parentNode && !event.isTrigger ) {
5039                        jQuery.event.simulate( "submit", this.parentNode, event, true );
5040                    }
5041                }
5042            },
5043
5044            teardown: function() {
5045                // Only need this for delegated form submit events
5046                if ( jQuery.nodeName( this, "form" ) ) {
5047                    return false;
5048                }
5049
5050                // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
5051                jQuery.event.remove( this, "._submit" );
5052            }
5053        };
5054    }
5055
5056// IE change delegation and checkbox/radio fix
5057    if ( !support.changeBubbles ) {
5058
5059        jQuery.event.special.change = {
5060
5061            setup: function() {
5062
5063                if ( rformElems.test( this.nodeName ) ) {
5064                    // IE doesn't fire change on a check/radio until blur; trigger it on click
5065                    // after a propertychange. Eat the blur-change in special.change.handle.
5066                    // This still fires onchange a second time for check/radio after blur.
5067                    if ( this.type === "checkbox" || this.type === "radio" ) {
5068                        jQuery.event.add( this, "propertychange._change", function( event ) {
5069                            if ( event.originalEvent.propertyName === "checked" ) {
5070                                this._just_changed = true;
5071                            }
5072                        });
5073                        jQuery.event.add( this, "click._change", function( event ) {
5074                            if ( this._just_changed && !event.isTrigger ) {
5075                                this._just_changed = false;
5076                            }
5077                            // Allow triggered, simulated change events (#11500)
5078                            jQuery.event.simulate( "change", this, event, true );
5079                        });
5080                    }
5081                    return false;
5082                }
5083                // Delegated event; lazy-add a change handler on descendant inputs
5084                jQuery.event.add( this, "beforeactivate._change", function( e ) {
5085                    var elem = e.target;
5086
5087                    if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
5088                        jQuery.event.add( elem, "change._change", function( event ) {
5089                            if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
5090                                jQuery.event.simulate( "change", this.parentNode, event, true );
5091                            }
5092                        });
5093                        jQuery._data( elem, "changeBubbles", true );
5094                    }
5095                });
5096            },
5097
5098            handle: function( event ) {
5099                var elem = event.target;
5100
5101                // Swallow native change events from checkbox/radio, we already triggered them above
5102                if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
5103                    return event.handleObj.handler.apply( this, arguments );
5104                }
5105            },
5106
5107            teardown: function() {
5108                jQuery.event.remove( this, "._change" );
5109
5110                return !rformElems.test( this.nodeName );
5111            }
5112        };
5113    }
5114
5115// Create "bubbling" focus and blur events
5116    if ( !support.focusinBubbles ) {
5117        jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
5118
5119            // Attach a single capturing handler on the document while someone wants focusin/focusout
5120            var handler = function( event ) {
5121                jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
5122            };
5123
5124            jQuery.event.special[ fix ] = {
5125                setup: function() {
5126                    var doc = this.ownerDocument || this,
5127                        attaches = jQuery._data( doc, fix );
5128
5129                    if ( !attaches ) {
5130                        doc.addEventListener( orig, handler, true );
5131                    }
5132                    jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
5133                },
5134                teardown: function() {
5135                    var doc = this.ownerDocument || this,
5136                        attaches = jQuery._data( doc, fix ) - 1;
5137
5138                    if ( !attaches ) {
5139                        doc.removeEventListener( orig, handler, true );
5140                        jQuery._removeData( doc, fix );
5141                    } else {
5142                        jQuery._data( doc, fix, attaches );
5143                    }
5144                }
5145            };
5146        });
5147    }
5148
5149    jQuery.fn.extend({
5150
5151        on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
5152            var type, origFn;
5153
5154            // Types can be a map of types/handlers
5155            if ( typeof types === "object" ) {
5156                // ( types-Object, selector, data )
5157                if ( typeof selector !== "string" ) {
5158                    // ( types-Object, data )
5159                    data = data || selector;
5160                    selector = undefined;
5161                }
5162                for ( type in types ) {
5163                    this.on( type, selector, data, types[ type ], one );
5164                }
5165                return this;
5166            }
5167
5168            if ( data == null && fn == null ) {
5169                // ( types, fn )
5170                fn = selector;
5171                data = selector = undefined;
5172            } else if ( fn == null ) {
5173                if ( typeof selector === "string" ) {
5174                    // ( types, selector, fn )
5175                    fn = data;
5176                    data = undefined;
5177                } else {
5178                    // ( types, data, fn )
5179                    fn = data;
5180                    data = selector;
5181                    selector = undefined;
5182                }
5183            }
5184            if ( fn === false ) {
5185                fn = returnFalse;
5186            } else if ( !fn ) {
5187                return this;
5188            }
5189
5190            if ( one === 1 ) {
5191                origFn = fn;
5192                fn = function( event ) {
5193                    // Can use an empty set, since event contains the info
5194                    jQuery().off( event );
5195                    return origFn.apply( this, arguments );
5196                };
5197                // Use same guid so caller can remove using origFn
5198                fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
5199            }
5200            return this.each( function() {
5201                jQuery.event.add( this, types, fn, data, selector );
5202            });
5203        },
5204        one: function( types, selector, data, fn ) {
5205            return this.on( types, selector, data, fn, 1 );
5206        },
5207        off: function( types, selector, fn ) {
5208            var handleObj, type;
5209            if ( types && types.preventDefault && types.handleObj ) {
5210                // ( event )  dispatched jQuery.Event
5211                handleObj = types.handleObj;
5212                jQuery( types.delegateTarget ).off(
5213                    handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
5214                    handleObj.selector,
5215                    handleObj.handler
5216                );
5217                return this;
5218            }
5219            if ( typeof types === "object" ) {
5220                // ( types-object [, selector] )
5221                for ( type in types ) {
5222                    this.off( type, selector, types[ type ] );
5223                }
5224                return this;
5225            }
5226            if ( selector === false || typeof selector === "function" ) {
5227                // ( types [, fn] )
5228                fn = selector;
5229                selector = undefined;
5230            }
5231            if ( fn === false ) {
5232                fn = returnFalse;
5233            }
5234            return this.each(function() {
5235                jQuery.event.remove( this, types, fn, selector );
5236            });
5237        },
5238
5239        trigger: function( type, data ) {
5240            return this.each(function() {
5241                jQuery.event.trigger( type, data, this );
5242            });
5243        },
5244        triggerHandler: function( type, data ) {
5245            var elem = this[0];
5246            if ( elem ) {
5247                return jQuery.event.trigger( type, data, elem, true );
5248            }
5249        }
5250    });
5251
5252
5253    function createSafeFragment( document ) {
5254        var list = nodeNames.split( "|" ),
5255            safeFrag = document.createDocumentFragment();
5256
5257        if ( safeFrag.createElement ) {
5258            while ( list.length ) {
5259                safeFrag.createElement(
5260                    list.pop()
5261                );
5262            }
5263        }
5264        return safeFrag;
5265    }
5266
5267    var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5268            "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
5269        rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
5270        rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
5271        rleadingWhitespace = /^\s+/,
5272        rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
5273        rtagName = /<([\w:]+)/,
5274        rtbody = /<tbody/i,
5275        rhtml = /<|&#?\w+;/,
5276        rnoInnerhtml = /<(?:script|style|link)/i,
5277    // checked="checked" or checked
5278        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5279        rscriptType = /^$|\/(?:java|ecma)script/i,
5280        rscriptTypeMasked = /^true\/(.*)/,
5281        rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
5282
5283    // We have to close these tags to support XHTML (#13200)
5284        wrapMap = {
5285            option: [ 1, "<select multiple='multiple'>", "</select>" ],
5286            legend: [ 1, "<fieldset>", "</fieldset>" ],
5287            area: [ 1, "<map>", "</map>" ],
5288            param: [ 1, "<object>", "</object>" ],
5289            thead: [ 1, "<table>", "</table>" ],
5290            tr: [ 2, "<table><tbody>", "</tbody></table>" ],
5291            col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
5292            td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
5293
5294            // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
5295            // unless wrapped in a div with non-breaking characters in front of it.
5296            _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>"  ]
5297        },
5298        safeFragment = createSafeFragment( document ),
5299        fragmentDiv = safeFragment.appendChild( document.createElement("div") );
5300
5301    wrapMap.optgroup = wrapMap.option;
5302    wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5303    wrapMap.th = wrapMap.td;
5304
5305    function getAll( context, tag ) {
5306        var elems, elem,
5307            i = 0,
5308            found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
5309                    typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
5310                undefined;
5311
5312        if ( !found ) {
5313            for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
5314                if ( !tag || jQuery.nodeName( elem, tag ) ) {
5315                    found.push( elem );
5316                } else {
5317                    jQuery.merge( found, getAll( elem, tag ) );
5318                }
5319            }
5320        }
5321
5322        return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
5323            jQuery.merge( [ context ], found ) :
5324            found;
5325    }
5326
5327// Used in buildFragment, fixes the defaultChecked property
5328    function fixDefaultChecked( elem ) {
5329        if ( rcheckableType.test( elem.type ) ) {
5330            elem.defaultChecked = elem.checked;
5331        }
5332    }
5333
5334// Support: IE<8
5335// Manipulating tables requires a tbody
5336    function manipulationTarget( elem, content ) {
5337        return jQuery.nodeName( elem, "table" ) &&
5338            jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
5339
5340            elem.getElementsByTagName("tbody")[0] ||
5341            elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
5342            elem;
5343    }
5344
5345// Replace/restore the type attribute of script elements for safe DOM manipulation
5346    function disableScript( elem ) {
5347        elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
5348        return elem;
5349    }
5350    function restoreScript( elem ) {
5351        var match = rscriptTypeMasked.exec( elem.type );
5352        if ( match ) {
5353            elem.type = match[1];
5354        } else {
5355            elem.removeAttribute("type");
5356        }
5357        return elem;
5358    }
5359
5360// Mark scripts as having already been evaluated
5361    function setGlobalEval( elems, refElements ) {
5362        var elem,
5363            i = 0;
5364        for ( ; (elem = elems[i]) != null; i++ ) {
5365            jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
5366        }
5367    }
5368
5369    function cloneCopyEvent( src, dest ) {
5370
5371        if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
5372            return;
5373        }
5374
5375        var type, i, l,
5376            oldData = jQuery._data( src ),
5377            curData = jQuery._data( dest, oldData ),
5378            events = oldData.events;
5379
5380        if ( events ) {
5381            delete curData.handle;
5382            curData.events = {};
5383
5384            for ( type in events ) {
5385                for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5386                    jQuery.event.add( dest, type, events[ type ][ i ] );
5387                }
5388            }
5389        }
5390
5391        // make the cloned public data object a copy from the original
5392        if ( curData.data ) {
5393            curData.data = jQuery.extend( {}, curData.data );
5394        }
5395    }
5396
5397    function fixCloneNodeIssues( src, dest ) {
5398        var nodeName, e, data;
5399
5400        // We do not need to do anything for non-Elements
5401        if ( dest.nodeType !== 1 ) {
5402            return;
5403        }
5404
5405        nodeName = dest.nodeName.toLowerCase();
5406
5407        // IE6-8 copies events bound via attachEvent when using cloneNode.
5408        if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
5409            data = jQuery._data( dest );
5410
5411            for ( e in data.events ) {
5412                jQuery.removeEvent( dest, e, data.handle );
5413            }
5414
5415            // Event data gets referenced instead of copied if the expando gets copied too
5416            dest.removeAttribute( jQuery.expando );
5417        }
5418
5419        // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
5420        if ( nodeName === "script" && dest.text !== src.text ) {
5421            disableScript( dest ).text = src.text;
5422            restoreScript( dest );
5423
5424            // IE6-10 improperly clones children of object elements using classid.
5425            // IE10 throws NoModificationAllowedError if parent is null, #12132.
5426        } else if ( nodeName === "object" ) {
5427            if ( dest.parentNode ) {
5428                dest.outerHTML = src.outerHTML;
5429            }
5430
5431            // This path appears unavoidable for IE9. When cloning an object
5432            // element in IE9, the outerHTML strategy above is not sufficient.
5433            // If the src has innerHTML and the destination does not,
5434            // copy the src.innerHTML into the dest.innerHTML. #10324
5435            if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
5436                dest.innerHTML = src.innerHTML;
5437            }
5438
5439        } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5440            // IE6-8 fails to persist the checked state of a cloned checkbox
5441            // or radio button. Worse, IE6-7 fail to give the cloned element
5442            // a checked appearance if the defaultChecked value isn't also set
5443
5444            dest.defaultChecked = dest.checked = src.checked;
5445
5446            // IE6-7 get confused and end up setting the value of a cloned
5447            // checkbox/radio button to an empty string instead of "on"
5448            if ( dest.value !== src.value ) {
5449                dest.value = src.value;
5450            }
5451
5452            // IE6-8 fails to return the selected option to the default selected
5453            // state when cloning options
5454        } else if ( nodeName === "option" ) {
5455            dest.defaultSelected = dest.selected = src.defaultSelected;
5456
5457            // IE6-8 fails to set the defaultValue to the correct value when
5458            // cloning other types of input fields
5459        } else if ( nodeName === "input" || nodeName === "textarea" ) {
5460            dest.defaultValue = src.defaultValue;
5461        }
5462    }
5463
5464    jQuery.extend({
5465        clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5466            var destElements, node, clone, i, srcElements,
5467                inPage = jQuery.contains( elem.ownerDocument, elem );
5468
5469            if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
5470                clone = elem.cloneNode( true );
5471
5472                // IE<=8 does not properly clone detached, unknown element nodes
5473            } else {
5474                fragmentDiv.innerHTML = elem.outerHTML;
5475                fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
5476            }
5477
5478            if ( (!support.noCloneEvent || !support.noCloneChecked) &&
5479                (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
5480
5481                // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
5482                destElements = getAll( clone );
5483                srcElements = getAll( elem );
5484
5485                // Fix all IE cloning issues
5486                for ( i = 0; (node = srcElements[i]) != null; ++i ) {
5487                    // Ensure that the destination node is not null; Fixes #9587
5488                    if ( destElements[i] ) {
5489                        fixCloneNodeIssues( node, destElements[i] );
5490                    }
5491                }
5492            }
5493
5494            // Copy the events from the original to the clone
5495            if ( dataAndEvents ) {
5496                if ( deepDataAndEvents ) {
5497                    srcElements = srcElements || getAll( elem );
5498                    destElements = destElements || getAll( clone );
5499
5500                    for ( i = 0; (node = srcElements[i]) != null; i++ ) {
5501                        cloneCopyEvent( node, destElements[i] );
5502                    }
5503                } else {
5504                    cloneCopyEvent( elem, clone );
5505                }
5506            }
5507
5508            // Preserve script evaluation history
5509            destElements = getAll( clone, "script" );
5510            if ( destElements.length > 0 ) {
5511                setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
5512            }
5513
5514            destElements = srcElements = node = null;
5515
5516            // Return the cloned set
5517            return clone;
5518        },
5519
5520        buildFragment: function( elems, context, scripts, selection ) {
5521            var j, elem, contains,
5522                tmp, tag, tbody, wrap,
5523                l = elems.length,
5524
5525            // Ensure a safe fragment
5526                safe = createSafeFragment( context ),
5527
5528                nodes = [],
5529                i = 0;
5530
5531            for ( ; i < l; i++ ) {
5532                elem = elems[ i ];
5533
5534                if ( elem || elem === 0 ) {
5535
5536                    // Add nodes directly
5537                    if ( jQuery.type( elem ) === "object" ) {
5538                        jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
5539
5540                        // Convert non-html into a text node
5541                    } else if ( !rhtml.test( elem ) ) {
5542                        nodes.push( context.createTextNode( elem ) );
5543
5544                        // Convert html into DOM nodes
5545                    } else {
5546                        tmp = tmp || safe.appendChild( context.createElement("div") );
5547
5548                        // Deserialize a standard representation
5549                        tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
5550                        wrap = wrapMap[ tag ] || wrapMap._default;
5551
5552                        tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
5553
5554                        // Descend through wrappers to the right content
5555                        j = wrap[0];
5556                        while ( j-- ) {
5557                            tmp = tmp.lastChild;
5558                        }
5559
5560                        // Manually add leading whitespace removed by IE
5561                        if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
5562                            nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
5563                        }
5564
5565                        // Remove IE's autoinserted <tbody> from table fragments
5566                        if ( !support.tbody ) {
5567
5568                            // String was a <table>, *may* have spurious <tbody>
5569                            elem = tag === "table" && !rtbody.test( elem ) ?
5570                                tmp.firstChild :
5571
5572                                // String was a bare <thead> or <tfoot>
5573                                    wrap[1] === "<table>" && !rtbody.test( elem ) ?
5574                                tmp :
5575                                0;
5576
5577                            j = elem && elem.childNodes.length;
5578                            while ( j-- ) {
5579                                if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
5580                                    elem.removeChild( tbody );
5581                                }
5582                            }
5583                        }
5584
5585                        jQuery.merge( nodes, tmp.childNodes );
5586
5587                        // Fix #12392 for WebKit and IE > 9
5588                        tmp.textContent = "";
5589
5590                        // Fix #12392 for oldIE
5591                        while ( tmp.firstChild ) {
5592                            tmp.removeChild( tmp.firstChild );
5593                        }
5594
5595                        // Remember the top-level container for proper cleanup
5596                        tmp = safe.lastChild;
5597                    }
5598                }
5599            }
5600
5601            // Fix #11356: Clear elements from fragment
5602            if ( tmp ) {
5603                safe.removeChild( tmp );
5604            }
5605
5606            // Reset defaultChecked for any radios and checkboxes
5607            // about to be appended to the DOM in IE 6/7 (#8060)
5608            if ( !support.appendChecked ) {
5609                jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
5610            }
5611
5612            i = 0;
5613            while ( (elem = nodes[ i++ ]) ) {
5614
5615                // #4087 - If origin and destination elements are the same, and this is
5616                // that element, do not do anything
5617                if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
5618                    continue;
5619                }
5620
5621                contains = jQuery.contains( elem.ownerDocument, elem );
5622
5623                // Append to fragment
5624                tmp = getAll( safe.appendChild( elem ), "script" );
5625
5626                // Preserve script evaluation history
5627                if ( contains ) {
5628                    setGlobalEval( tmp );
5629                }
5630
5631                // Capture executables
5632                if ( scripts ) {
5633                    j = 0;
5634                    while ( (elem = tmp[ j++ ]) ) {
5635                        if ( rscriptType.test( elem.type || "" ) ) {
5636                            scripts.push( elem );
5637                        }
5638                    }
5639                }
5640            }
5641
5642            tmp = null;
5643
5644            return safe;
5645        },
5646
5647        cleanData: function( elems, /* internal */ acceptData ) {
5648            var elem, type, id, data,
5649                i = 0,
5650                internalKey = jQuery.expando,
5651                cache = jQuery.cache,
5652                deleteExpando = support.deleteExpando,
5653                special = jQuery.event.special;
5654
5655            for ( ; (elem = elems[i]) != null; i++ ) {
5656                if ( acceptData || jQuery.acceptData( elem ) ) {
5657
5658                    id = elem[ internalKey ];
5659                    data = id && cache[ id ];
5660
5661                    if ( data ) {
5662                        if ( data.events ) {
5663                            for ( type in data.events ) {
5664                                if ( special[ type ] ) {
5665                                    jQuery.event.remove( elem, type );
5666
5667                                    // This is a shortcut to avoid jQuery.event.remove's overhead
5668                                } else {
5669                                    jQuery.removeEvent( elem, type, data.handle );
5670                                }
5671                            }
5672                        }
5673
5674                        // Remove cache only if it was not already removed by jQuery.event.remove
5675                        if ( cache[ id ] ) {
5676
5677                            delete cache[ id ];
5678
5679                            // IE does not allow us to delete expando properties from nodes,
5680                            // nor does it have a removeAttribute function on Document nodes;
5681                            // we must handle all of these cases
5682                            if ( deleteExpando ) {
5683                                delete elem[ internalKey ];
5684
5685                            } else if ( typeof elem.removeAttribute !== strundefined ) {
5686                                elem.removeAttribute( internalKey );
5687
5688                            } else {
5689                                elem[ internalKey ] = null;
5690                            }
5691
5692                            deletedIds.push( id );
5693                        }
5694                    }
5695                }
5696            }
5697        }
5698    });
5699
5700    jQuery.fn.extend({
5701        text: function( value ) {
5702            return access( this, function( value ) {
5703                return value === undefined ?
5704                    jQuery.text( this ) :
5705                    this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
5706            }, null, value, arguments.length );
5707        },
5708
5709        append: function() {
5710            return this.domManip( arguments, function( elem ) {
5711                if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5712                    var target = manipulationTarget( this, elem );
5713                    target.appendChild( elem );
5714                }
5715            });
5716        },
5717
5718        prepend: function() {
5719            return this.domManip( arguments, function( elem ) {
5720                if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5721                    var target = manipulationTarget( this, elem );
5722                    target.insertBefore( elem, target.firstChild );
5723                }
5724            });
5725        },
5726
5727        before: function() {
5728            return this.domManip( arguments, function( elem ) {
5729                if ( this.parentNode ) {
5730                    this.parentNode.insertBefore( elem, this );
5731                }
5732            });
5733        },
5734
5735        after: function() {
5736            return this.domManip( arguments, function( elem ) {
5737                if ( this.parentNode ) {
5738                    this.parentNode.insertBefore( elem, this.nextSibling );
5739                }
5740            });
5741        },
5742
5743        remove: function( selector, keepData /* Internal Use Only */ ) {
5744            var elem,
5745                elems = selector ? jQuery.filter( selector, this ) : this,
5746                i = 0;
5747
5748            for ( ; (elem = elems[i]) != null; i++ ) {
5749
5750                if ( !keepData && elem.nodeType === 1 ) {
5751                    jQuery.cleanData( getAll( elem ) );
5752                }
5753
5754                if ( elem.parentNode ) {
5755                    if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
5756                        setGlobalEval( getAll( elem, "script" ) );
5757                    }
5758                    elem.parentNode.removeChild( elem );
5759                }
5760            }
5761
5762            return this;
5763        },
5764
5765        empty: function() {
5766            var elem,
5767                i = 0;
5768
5769            for ( ; (elem = this[i]) != null; i++ ) {
5770                // Remove element nodes and prevent memory leaks
5771                if ( elem.nodeType === 1 ) {
5772                    jQuery.cleanData( getAll( elem, false ) );
5773                }
5774
5775                // Remove any remaining nodes
5776                while ( elem.firstChild ) {
5777                    elem.removeChild( elem.firstChild );
5778                }
5779
5780                // If this is a select, ensure that it displays empty (#12336)
5781                // Support: IE<9
5782                if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
5783                    elem.options.length = 0;
5784                }
5785            }
5786
5787            return this;
5788        },
5789
5790        clone: function( dataAndEvents, deepDataAndEvents ) {
5791            dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5792            deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5793
5794            return this.map(function() {
5795                return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5796            });
5797        },
5798
5799        html: function( value ) {
5800            return access( this, function( value ) {
5801                var elem = this[ 0 ] || {},
5802                    i = 0,
5803                    l = this.length;
5804
5805                if ( value === undefined ) {
5806                    return elem.nodeType === 1 ?
5807                        elem.innerHTML.replace( rinlinejQuery, "" ) :
5808                        undefined;
5809                }
5810
5811                // See if we can take a shortcut and just use innerHTML
5812                if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5813                    ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
5814                    ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
5815                    !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
5816
5817                    value = value.replace( rxhtmlTag, "<$1></$2>" );
5818
5819                    try {
5820                        for (; i < l; i++ ) {
5821                            // Remove element nodes and prevent memory leaks
5822                            elem = this[i] || {};
5823                            if ( elem.nodeType === 1 ) {
5824                                jQuery.cleanData( getAll( elem, false ) );
5825                                elem.innerHTML = value;
5826                            }
5827                        }
5828
5829                        elem = 0;
5830
5831                        // If using innerHTML throws an exception, use the fallback method
5832                    } catch(e) {}
5833                }
5834
5835                if ( elem ) {
5836                    this.empty().append( value );
5837                }
5838            }, null, value, arguments.length );
5839        },
5840
5841        replaceWith: function() {
5842            var arg = arguments[ 0 ];
5843
5844            // Make the changes, replacing each context element with the new content
5845            this.domManip( arguments, function( elem ) {
5846                arg = this.parentNode;
5847
5848                jQuery.cleanData( getAll( this ) );
5849
5850                if ( arg ) {
5851                    arg.replaceChild( elem, this );
5852                }
5853            });
5854
5855            // Force removal if there was no new content (e.g., from empty arguments)
5856            return arg && (arg.length || arg.nodeType) ? this : this.remove();
5857        },
5858
5859        detach: function( selector ) {
5860            return this.remove( selector, true );
5861        },
5862
5863        domManip: function( args, callback ) {
5864
5865            // Flatten any nested arrays
5866            args = concat.apply( [], args );
5867
5868            var first, node, hasScripts,
5869                scripts, doc, fragment,
5870                i = 0,
5871                l = this.length,
5872                set = this,
5873                iNoClone = l - 1,
5874                value = args[0],
5875                isFunction = jQuery.isFunction( value );
5876
5877            // We can't cloneNode fragments that contain checked, in WebKit
5878            if ( isFunction ||
5879                ( l > 1 && typeof value === "string" &&
5880                    !support.checkClone && rchecked.test( value ) ) ) {
5881                return this.each(function( index ) {
5882                    var self = set.eq( index );
5883                    if ( isFunction ) {
5884                        args[0] = value.call( this, index, self.html() );
5885                    }
5886                    self.domManip( args, callback );
5887                });
5888            }
5889
5890            if ( l ) {
5891                fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
5892                first = fragment.firstChild;
5893
5894                if ( fragment.childNodes.length === 1 ) {
5895                    fragment = first;
5896                }
5897
5898                if ( first ) {
5899                    scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5900                    hasScripts = scripts.length;
5901
5902                    // Use the original fragment for the last item instead of the first because it can end up
5903                    // being emptied incorrectly in certain situations (#8070).
5904                    for ( ; i < l; i++ ) {
5905                        node = fragment;
5906
5907                        if ( i !== iNoClone ) {
5908                            node = jQuery.clone( node, true, true );
5909
5910                            // Keep references to cloned scripts for later restoration
5911                            if ( hasScripts ) {
5912                                jQuery.merge( scripts, getAll( node, "script" ) );
5913                            }
5914                        }
5915
5916                        callback.call( this[i], node, i );
5917                    }
5918
5919                    if ( hasScripts ) {
5920                        doc = scripts[ scripts.length - 1 ].ownerDocument;
5921
5922                        // Reenable scripts
5923                        jQuery.map( scripts, restoreScript );
5924
5925                        // Evaluate executable scripts on first document insertion
5926                        for ( i = 0; i < hasScripts; i++ ) {
5927                            node = scripts[ i ];
5928                            if ( rscriptType.test( node.type || "" ) &&
5929                                !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
5930
5931                                if ( node.src ) {
5932                                    // Optional AJAX dependency, but won't run scripts if not present
5933                                    if ( jQuery._evalUrl ) {
5934                                        jQuery._evalUrl( node.src );
5935                                    }
5936                                } else {
5937                                    jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
5938                                }
5939                            }
5940                        }
5941                    }
5942
5943                    // Fix #11809: Avoid leaking memory
5944                    fragment = first = null;
5945                }
5946            }
5947
5948            return this;
5949        }
5950    });
5951
5952    jQuery.each({
5953        appendTo: "append",
5954        prependTo: "prepend",
5955        insertBefore: "before",
5956        insertAfter: "after",
5957        replaceAll: "replaceWith"
5958    }, function( name, original ) {
5959        jQuery.fn[ name ] = function( selector ) {
5960            var elems,
5961                i = 0,
5962                ret = [],
5963                insert = jQuery( selector ),
5964                last = insert.length - 1;
5965
5966            for ( ; i <= last; i++ ) {
5967                elems = i === last ? this : this.clone(true);
5968                jQuery( insert[i] )[ original ]( elems );
5969
5970                // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
5971                push.apply( ret, elems.get() );
5972            }
5973
5974            return this.pushStack( ret );
5975        };
5976    });
5977
5978
5979    var iframe,
5980        elemdisplay = {};
5981
5982    /**
5983     * Retrieve the actual display of a element
5984     * @param {String} name nodeName of the element
5985     * @param {Object} doc Document object
5986     */
5987// Called only from within defaultDisplay
5988    function actualDisplay( name, doc ) {
5989        var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
5990
5991        // getDefaultComputedStyle might be reliably used only on attached element
5992            display = window.getDefaultComputedStyle ?
5993
5994                // Use of this method is a temporary fix (more like optmization) until something better comes along,
5995                // since it was removed from specification and supported only in FF
5996                window.getDefaultComputedStyle( elem[ 0 ] ).display : jQuery.css( elem[ 0 ], "display" );
5997
5998        // We don't have any data stored on the element,
5999        // so use "detach" method as fast way to get rid of the element
6000        elem.detach();
6001
6002        return display;
6003    }
6004
6005    /**
6006     * Try to determine the default display value of an element
6007     * @param {String} nodeName
6008     */
6009    function defaultDisplay( nodeName ) {
6010        var doc = document,
6011            display = elemdisplay[ nodeName ];
6012
6013        if ( !display ) {
6014            display = actualDisplay( nodeName, doc );
6015
6016            // If the simple way fails, read from inside an iframe
6017            if ( display === "none" || !display ) {
6018
6019                // Use the already-created iframe if possible
6020                iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
6021
6022                // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
6023                doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
6024
6025                // Support: IE
6026                doc.write();
6027                doc.close();
6028
6029                display = actualDisplay( nodeName, doc );
6030                iframe.detach();
6031            }
6032
6033            // Store the correct default display
6034            elemdisplay[ nodeName ] = display;
6035        }
6036
6037        return display;
6038    }
6039
6040
6041    (function() {
6042        var a, shrinkWrapBlocksVal,
6043            div = document.createElement( "div" ),
6044            divReset =
6045                "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" +
6046                "display:block;padding:0;margin:0;border:0";
6047
6048        // Setup
6049        div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
6050        a = div.getElementsByTagName( "a" )[ 0 ];
6051
6052        a.style.cssText = "float:left;opacity:.5";
6053
6054        // Make sure that element opacity exists
6055        // (IE uses filter instead)
6056        // Use a regex to work around a WebKit issue. See #5145
6057        support.opacity = /^0.5/.test( a.style.opacity );
6058
6059        // Verify style float existence
6060        // (IE uses styleFloat instead of cssFloat)
6061        support.cssFloat = !!a.style.cssFloat;
6062
6063        div.style.backgroundClip = "content-box";
6064        div.cloneNode( true ).style.backgroundClip = "";
6065        support.clearCloneStyle = div.style.backgroundClip === "content-box";
6066
6067        // Null elements to avoid leaks in IE.
6068        a = div = null;
6069
6070        support.shrinkWrapBlocks = function() {
6071            var body, container, div, containerStyles;
6072
6073            if ( shrinkWrapBlocksVal == null ) {
6074                body = document.getElementsByTagName( "body" )[ 0 ];
6075                if ( !body ) {
6076                    // Test fired too early or in an unsupported environment, exit.
6077                    return;
6078                }
6079
6080                containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px";
6081                container = document.createElement( "div" );
6082                div = document.createElement( "div" );
6083
6084                body.appendChild( container ).appendChild( div );
6085
6086                // Will be changed later if needed.
6087                shrinkWrapBlocksVal = false;
6088
6089                if ( typeof div.style.zoom !== strundefined ) {
6090                    // Support: IE6
6091                    // Check if elements with layout shrink-wrap their children
6092                    div.style.cssText = divReset + ";width:1px;padding:1px;zoom:1";
6093                    div.innerHTML = "<div></div>";
6094                    div.firstChild.style.width = "5px";
6095                    shrinkWrapBlocksVal = div.offsetWidth !== 3;
6096                }
6097
6098                body.removeChild( container );
6099
6100                // Null elements to avoid leaks in IE.
6101                body = container = div = null;
6102            }
6103
6104            return shrinkWrapBlocksVal;
6105        };
6106
6107    })();
6108    var rmargin = (/^margin/);
6109
6110    var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6111
6112
6113
6114    var getStyles, curCSS,
6115        rposition = /^(top|right|bottom|left)$/;
6116
6117    if ( window.getComputedStyle ) {
6118        getStyles = function( elem ) {
6119            return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
6120        };
6121
6122        curCSS = function( elem, name, computed ) {
6123            var width, minWidth, maxWidth, ret,
6124                style = elem.style;
6125
6126            computed = computed || getStyles( elem );
6127
6128            // getPropertyValue is only needed for .css('filter') in IE9, see #12537
6129            ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
6130
6131            if ( computed ) {
6132
6133                if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
6134                    ret = jQuery.style( elem, name );
6135                }
6136
6137                // A tribute to the "awesome hack by Dean Edwards"
6138                // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
6139                // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
6140                // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
6141                if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
6142
6143                    // Remember the original values
6144                    width = style.width;
6145                    minWidth = style.minWidth;
6146                    maxWidth = style.maxWidth;
6147
6148                    // Put in the new values to get a computed value out
6149                    style.minWidth = style.maxWidth = style.width = ret;
6150                    ret = computed.width;
6151
6152                    // Revert the changed values
6153                    style.width = width;
6154                    style.minWidth = minWidth;
6155                    style.maxWidth = maxWidth;
6156                }
6157            }
6158
6159            // Support: IE
6160            // IE returns zIndex value as an integer.
6161            return ret === undefined ?
6162                ret :
6163                ret + "";
6164        };
6165    } else if ( document.documentElement.currentStyle ) {
6166        getStyles = function( elem ) {
6167            return elem.currentStyle;
6168        };
6169
6170        curCSS = function( elem, name, computed ) {
6171            var left, rs, rsLeft, ret,
6172                style = elem.style;
6173
6174            computed = computed || getStyles( elem );
6175            ret = computed ? computed[ name ] : undefined;
6176
6177            // Avoid setting ret to empty string here
6178            // so we don't default to auto
6179            if ( ret == null && style && style[ name ] ) {
6180                ret = style[ name ];
6181            }
6182
6183            // From the awesome hack by Dean Edwards
6184            // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6185
6186            // If we're not dealing with a regular pixel number
6187            // but a number that has a weird ending, we need to convert it to pixels
6188            // but not position css attributes, as those are proportional to the parent element instead
6189            // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
6190            if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
6191
6192                // Remember the original values
6193                left = style.left;
6194                rs = elem.runtimeStyle;
6195                rsLeft = rs && rs.left;
6196
6197                // Put in the new values to get a computed value out
6198                if ( rsLeft ) {
6199                    rs.left = elem.currentStyle.left;
6200                }
6201                style.left = name === "fontSize" ? "1em" : ret;
6202                ret = style.pixelLeft + "px";
6203
6204                // Revert the changed values
6205                style.left = left;
6206                if ( rsLeft ) {
6207                    rs.left = rsLeft;
6208                }
6209            }
6210
6211            // Support: IE
6212            // IE returns zIndex value as an integer.
6213            return ret === undefined ?
6214                ret :
6215                ret + "" || "auto";
6216        };
6217    }
6218
6219
6220
6221
6222    function addGetHookIf( conditionFn, hookFn ) {
6223        // Define the hook, we'll check on the first run if it's really needed.
6224        return {
6225            get: function() {
6226                var condition = conditionFn();
6227
6228                if ( condition == null ) {
6229                    // The test was not ready at this point; screw the hook this time
6230                    // but check again when needed next time.
6231                    return;
6232                }
6233
6234                if ( condition ) {
6235                    // Hook not needed (or it's not possible to use it due to missing dependency),
6236                    // remove it.
6237                    // Since there are no other hooks for marginRight, remove the whole object.
6238                    delete this.get;
6239                    return;
6240                }
6241
6242                // Hook needed; redefine it so that the support test is not executed again.
6243
6244                return (this.get = hookFn).apply( this, arguments );
6245            }
6246        };
6247    }
6248
6249
6250    (function() {
6251        var a, reliableHiddenOffsetsVal, boxSizingVal, boxSizingReliableVal,
6252            pixelPositionVal, reliableMarginRightVal,
6253            div = document.createElement( "div" ),
6254            containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px",
6255            divReset =
6256                "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" +
6257                "display:block;padding:0;margin:0;border:0";
6258
6259        // Setup
6260        div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
6261        a = div.getElementsByTagName( "a" )[ 0 ];
6262
6263        a.style.cssText = "float:left;opacity:.5";
6264
6265        // Make sure that element opacity exists
6266        // (IE uses filter instead)
6267        // Use a regex to work around a WebKit issue. See #5145
6268        support.opacity = /^0.5/.test( a.style.opacity );
6269
6270        // Verify style float existence
6271        // (IE uses styleFloat instead of cssFloat)
6272        support.cssFloat = !!a.style.cssFloat;
6273
6274        div.style.backgroundClip = "content-box";
6275        div.cloneNode( true ).style.backgroundClip = "";
6276        support.clearCloneStyle = div.style.backgroundClip === "content-box";
6277
6278        // Null elements to avoid leaks in IE.
6279        a = div = null;
6280
6281        jQuery.extend(support, {
6282            reliableHiddenOffsets: function() {
6283                if ( reliableHiddenOffsetsVal != null ) {
6284                    return reliableHiddenOffsetsVal;
6285                }
6286
6287                var container, tds, isSupported,
6288                    div = document.createElement( "div" ),
6289                    body = document.getElementsByTagName( "body" )[ 0 ];
6290
6291                if ( !body ) {
6292                    // Return for frameset docs that don't have a body
6293                    return;
6294                }
6295
6296                // Setup
6297                div.setAttribute( "className", "t" );
6298                div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
6299
6300                container = document.createElement( "div" );
6301                container.style.cssText = containerStyles;
6302
6303                body.appendChild( container ).appendChild( div );
6304
6305                // Support: IE8
6306                // Check if table cells still have offsetWidth/Height when they are set
6307                // to display:none and there are still other visible table cells in a
6308                // table row; if so, offsetWidth/Height are not reliable for use when
6309                // determining if an element has been hidden directly using
6310                // display:none (it is still safe to use offsets if a parent element is
6311                // hidden; don safety goggles and see bug #4512 for more information).
6312                div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
6313                tds = div.getElementsByTagName( "td" );
6314                tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
6315                isSupported = ( tds[ 0 ].offsetHeight === 0 );
6316
6317                tds[ 0 ].style.display = "";
6318                tds[ 1 ].style.display = "none";
6319
6320                // Support: IE8
6321                // Check if empty table cells still have offsetWidth/Height
6322                reliableHiddenOffsetsVal = isSupported && ( tds[ 0 ].offsetHeight === 0 );
6323
6324                body.removeChild( container );
6325
6326                // Null elements to avoid leaks in IE.
6327                div = body = null;
6328
6329                return reliableHiddenOffsetsVal;
6330            },
6331
6332            boxSizing: function() {
6333                if ( boxSizingVal == null ) {
6334                    computeStyleTests();
6335                }
6336                return boxSizingVal;
6337            },
6338
6339            boxSizingReliable: function() {
6340                if ( boxSizingReliableVal == null ) {
6341                    computeStyleTests();
6342                }
6343                return boxSizingReliableVal;
6344            },
6345
6346            pixelPosition: function() {
6347                if ( pixelPositionVal == null ) {
6348                    computeStyleTests();
6349                }
6350                return pixelPositionVal;
6351            },
6352
6353            reliableMarginRight: function() {
6354                var body, container, div, marginDiv;
6355
6356                // Use window.getComputedStyle because jsdom on node.js will break without it.
6357                if ( reliableMarginRightVal == null && window.getComputedStyle ) {
6358                    body = document.getElementsByTagName( "body" )[ 0 ];
6359                    if ( !body ) {
6360                        // Test fired too early or in an unsupported environment, exit.
6361                        return;
6362                    }
6363
6364                    container = document.createElement( "div" );
6365                    div = document.createElement( "div" );
6366                    container.style.cssText = containerStyles;
6367
6368                    body.appendChild( container ).appendChild( div );
6369
6370                    // Check if div with explicit width and no margin-right incorrectly
6371                    // gets computed margin-right based on width of container. (#3333)
6372                    // Fails in WebKit before Feb 2011 nightlies
6373                    // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6374                    marginDiv = div.appendChild( document.createElement( "div" ) );
6375                    marginDiv.style.cssText = div.style.cssText = divReset;
6376                    marginDiv.style.marginRight = marginDiv.style.width = "0";
6377                    div.style.width = "1px";
6378
6379                    reliableMarginRightVal =
6380                        !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
6381
6382                    body.removeChild( container );
6383                }
6384
6385                return reliableMarginRightVal;
6386            }
6387        });
6388
6389        function computeStyleTests() {
6390            var container, div,
6391                body = document.getElementsByTagName( "body" )[ 0 ];
6392
6393            if ( !body ) {
6394                // Test fired too early or in an unsupported environment, exit.
6395                return;
6396            }
6397
6398            container = document.createElement( "div" );
6399            div = document.createElement( "div" );
6400            container.style.cssText = containerStyles;
6401
6402            body.appendChild( container ).appendChild( div );
6403
6404            div.style.cssText =
6405                "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
6406                "position:absolute;display:block;padding:1px;border:1px;width:4px;" +
6407                "margin-top:1%;top:1%";
6408
6409            // Workaround failing boxSizing test due to offsetWidth returning wrong value
6410            // with some non-1 values of body zoom, ticket #13543
6411            jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
6412                boxSizingVal = div.offsetWidth === 4;
6413            });
6414
6415            // Will be changed later if needed.
6416            boxSizingReliableVal = true;
6417            pixelPositionVal = false;
6418            reliableMarginRightVal = true;
6419
6420            // Use window.getComputedStyle because jsdom on node.js will break without it.
6421            if ( window.getComputedStyle ) {
6422                pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
6423                boxSizingReliableVal =
6424                    ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
6425            }
6426
6427            body.removeChild( container );
6428
6429            // Null elements to avoid leaks in IE.
6430            div = body = null;
6431        }
6432
6433    })();
6434
6435
6436// A method for quickly swapping in/out CSS properties to get correct calculations.
6437    jQuery.swap = function( elem, options, callback, args ) {
6438        var ret, name,
6439            old = {};
6440
6441        // Remember the old values, and insert the new ones
6442        for ( name in options ) {
6443            old[ name ] = elem.style[ name ];
6444            elem.style[ name ] = options[ name ];
6445        }
6446
6447        ret = callback.apply( elem, args || [] );
6448
6449        // Revert the old values
6450        for ( name in options ) {
6451            elem.style[ name ] = old[ name ];
6452        }
6453
6454        return ret;
6455    };
6456
6457
6458    var
6459        ralpha = /alpha\([^)]*\)/i,
6460        ropacity = /opacity\s*=\s*([^)]*)/,
6461
6462    // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
6463    // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6464        rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6465        rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
6466        rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
6467
6468        cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6469        cssNormalTransform = {
6470            letterSpacing: 0,
6471            fontWeight: 400
6472        },
6473
6474        cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
6475
6476
6477// return a css property mapped to a potentially vendor prefixed property
6478    function vendorPropName( style, name ) {
6479
6480        // shortcut for names that are not vendor prefixed
6481        if ( name in style ) {
6482            return name;
6483        }
6484
6485        // check for vendor prefixed names
6486        var capName = name.charAt(0).toUpperCase() + name.slice(1),
6487            origName = name,
6488            i = cssPrefixes.length;
6489
6490        while ( i-- ) {
6491            name = cssPrefixes[ i ] + capName;
6492            if ( name in style ) {
6493                return name;
6494            }
6495        }
6496
6497        return origName;
6498    }
6499
6500    function showHide( elements, show ) {
6501        var display, elem, hidden,
6502            values = [],
6503            index = 0,
6504            length = elements.length;
6505
6506        for ( ; index < length; index++ ) {
6507            elem = elements[ index ];
6508            if ( !elem.style ) {
6509                continue;
6510            }
6511
6512            values[ index ] = jQuery._data( elem, "olddisplay" );
6513            display = elem.style.display;
6514            if ( show ) {
6515                // Reset the inline display of this element to learn if it is
6516                // being hidden by cascaded rules or not
6517                if ( !values[ index ] && display === "none" ) {
6518                    elem.style.display = "";
6519                }
6520
6521                // Set elements which have been overridden with display: none
6522                // in a stylesheet to whatever the default browser style is
6523                // for such an element
6524                if ( elem.style.display === "" && isHidden( elem ) ) {
6525                    values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
6526                }
6527            } else {
6528
6529                if ( !values[ index ] ) {
6530                    hidden = isHidden( elem );
6531
6532                    if ( display && display !== "none" || !hidden ) {
6533                        jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
6534                    }
6535                }
6536            }
6537        }
6538
6539        // Set the display of most of the elements in a second loop
6540        // to avoid the constant reflow
6541        for ( index = 0; index < length; index++ ) {
6542            elem = elements[ index ];
6543            if ( !elem.style ) {
6544                continue;
6545            }
6546            if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6547                elem.style.display = show ? values[ index ] || "" : "none";
6548            }
6549        }
6550
6551        return elements;
6552    }
6553
6554    function setPositiveNumber( elem, value, subtract ) {
6555        var matches = rnumsplit.exec( value );
6556        return matches ?
6557            // Guard against undefined "subtract", e.g., when used as in cssHooks
6558            Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
6559            value;
6560    }
6561
6562    function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
6563        var i = extra === ( isBorderBox ? "border" : "content" ) ?
6564                // If we already have the right measurement, avoid augmentation
6565                4 :
6566                // Otherwise initialize for horizontal or vertical properties
6567                    name === "width" ? 1 : 0,
6568
6569            val = 0;
6570
6571        for ( ; i < 4; i += 2 ) {
6572            // both box models exclude margin, so add it if we want it
6573            if ( extra === "margin" ) {
6574                val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
6575            }
6576
6577            if ( isBorderBox ) {
6578                // border-box includes padding, so remove it if we want content
6579                if ( extra === "content" ) {
6580                    val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6581                }
6582
6583                // at this point, extra isn't border nor margin, so remove border
6584                if ( extra !== "margin" ) {
6585                    val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6586                }
6587            } else {
6588                // at this point, extra isn't content, so add padding
6589                val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6590
6591                // at this point, extra isn't content nor padding, so add border
6592                if ( extra !== "padding" ) {
6593                    val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6594                }
6595            }
6596        }
6597
6598        return val;
6599    }
6600
6601    function getWidthOrHeight( elem, name, extra ) {
6602
6603        // Start with offset property, which is equivalent to the border-box value
6604        var valueIsBorderBox = true,
6605            val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
6606            styles = getStyles( elem ),
6607            isBorderBox = support.boxSizing() && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6608
6609        // some non-html elements return undefined for offsetWidth, so check for null/undefined
6610        // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
6611        // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
6612        if ( val <= 0 || val == null ) {
6613            // Fall back to computed then uncomputed css if necessary
6614            val = curCSS( elem, name, styles );
6615            if ( val < 0 || val == null ) {
6616                val = elem.style[ name ];
6617            }
6618
6619            // Computed unit is not pixels. Stop here and return.
6620            if ( rnumnonpx.test(val) ) {
6621                return val;
6622            }
6623
6624            // we need the check for style in case a browser which returns unreliable values
6625            // for getComputedStyle silently falls back to the reliable elem.style
6626            valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
6627
6628            // Normalize "", auto, and prepare for extra
6629            val = parseFloat( val ) || 0;
6630        }
6631
6632        // use the active box-sizing model to add/subtract irrelevant styles
6633        return ( val +
6634            augmentWidthOrHeight(
6635                elem,
6636                name,
6637                    extra || ( isBorderBox ? "border" : "content" ),
6638                valueIsBorderBox,
6639                styles
6640            )
6641            ) + "px";
6642    }
6643
6644    jQuery.extend({
6645        // Add in style property hooks for overriding the default
6646        // behavior of getting and setting a style property
6647        cssHooks: {
6648            opacity: {
6649                get: function( elem, computed ) {
6650                    if ( computed ) {
6651                        // We should always get a number back from opacity
6652                        var ret = curCSS( elem, "opacity" );
6653                        return ret === "" ? "1" : ret;
6654                    }
6655                }
6656            }
6657        },
6658
6659        // Don't automatically add "px" to these possibly-unitless properties
6660        cssNumber: {
6661            "columnCount": true,
6662            "fillOpacity": true,
6663            "fontWeight": true,
6664            "lineHeight": true,
6665            "opacity": true,
6666            "order": true,
6667            "orphans": true,
6668            "widows": true,
6669            "zIndex": true,
6670            "zoom": true
6671        },
6672
6673        // Add in properties whose names you wish to fix before
6674        // setting or getting the value
6675        cssProps: {
6676            // normalize float css property
6677            "float": support.cssFloat ? "cssFloat" : "styleFloat"
6678        },
6679
6680        // Get and set the style property on a DOM Node
6681        style: function( elem, name, value, extra ) {
6682            // Don't set styles on text and comment nodes
6683            if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6684                return;
6685            }
6686
6687            // Make sure that we're working with the right name
6688            var ret, type, hooks,
6689                origName = jQuery.camelCase( name ),
6690                style = elem.style;
6691
6692            name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
6693
6694            // gets hook for the prefixed version
6695            // followed by the unprefixed version
6696            hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6697
6698            // Check if we're setting a value
6699            if ( value !== undefined ) {
6700                type = typeof value;
6701
6702                // convert relative number strings (+= or -=) to relative numbers. #7345
6703                if ( type === "string" && (ret = rrelNum.exec( value )) ) {
6704                    value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
6705                    // Fixes bug #9237
6706                    type = "number";
6707                }
6708
6709                // Make sure that null and NaN values aren't set. See: #7116
6710                if ( value == null || value !== value ) {
6711                    return;
6712                }
6713
6714                // If a number was passed in, add 'px' to the (except for certain CSS properties)
6715                if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
6716                    value += "px";
6717                }
6718
6719                // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
6720                // but it would mean to define eight (for every problematic property) identical functions
6721                if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
6722                    style[ name ] = "inherit";
6723                }
6724
6725                // If a hook was provided, use that value, otherwise just set the specified value
6726                if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
6727
6728                    // Support: IE
6729                    // Swallow errors from 'invalid' CSS values (#5509)
6730                    try {
6731                        // Support: Chrome, Safari
6732                        // Setting style to blank string required to delete "style: x !important;"
6733                        style[ name ] = "";
6734                        style[ name ] = value;
6735                    } catch(e) {}
6736                }
6737
6738            } else {
6739                // If a hook was provided get the non-computed value from there
6740                if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
6741                    return ret;
6742                }
6743
6744                // Otherwise just get the value from the style object
6745                return style[ name ];
6746            }
6747        },
6748
6749        css: function( elem, name, extra, styles ) {
6750            var num, val, hooks,
6751                origName = jQuery.camelCase( name );
6752
6753            // Make sure that we're working with the right name
6754            name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
6755
6756            // gets hook for the prefixed version
6757            // followed by the unprefixed version
6758            hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6759
6760            // If a hook was provided get the computed value from there
6761            if ( hooks && "get" in hooks ) {
6762                val = hooks.get( elem, true, extra );
6763            }
6764
6765            // Otherwise, if a way to get the computed value exists, use that
6766            if ( val === undefined ) {
6767                val = curCSS( elem, name, styles );
6768            }
6769
6770            //convert "normal" to computed value
6771            if ( val === "normal" && name in cssNormalTransform ) {
6772                val = cssNormalTransform[ name ];
6773            }
6774
6775            // Return, converting to number if forced or a qualifier was provided and val looks numeric
6776            if ( extra === "" || extra ) {
6777                num = parseFloat( val );
6778                return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
6779            }
6780            return val;
6781        }
6782    });
6783
6784    jQuery.each([ "height", "width" ], function( i, name ) {
6785        jQuery.cssHooks[ name ] = {
6786            get: function( elem, computed, extra ) {
6787                if ( computed ) {
6788                    // certain elements can have dimension info if we invisibly show them
6789                    // however, it must have a current display style that would benefit from this
6790                    return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
6791                        jQuery.swap( elem, cssShow, function() {
6792                            return getWidthOrHeight( elem, name, extra );
6793                        }) :
6794                        getWidthOrHeight( elem, name, extra );
6795                }
6796            },
6797
6798            set: function( elem, value, extra ) {
6799                var styles = extra && getStyles( elem );
6800                return setPositiveNumber( elem, value, extra ?
6801                        augmentWidthOrHeight(
6802                            elem,
6803                            name,
6804                            extra,
6805                                support.boxSizing() && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6806                            styles
6807                        ) : 0
6808                );
6809            }
6810        };
6811    });
6812
6813    if ( !support.opacity ) {
6814        jQuery.cssHooks.opacity = {
6815            get: function( elem, computed ) {
6816                // IE uses filters for opacity
6817                return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
6818                    ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
6819                    computed ? "1" : "";
6820            },
6821
6822            set: function( elem, value ) {
6823                var style = elem.style,
6824                    currentStyle = elem.currentStyle,
6825                    opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
6826                    filter = currentStyle && currentStyle.filter || style.filter || "";
6827
6828                // IE has trouble with opacity if it does not have layout
6829                // Force it by setting the zoom level
6830                style.zoom = 1;
6831
6832                // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
6833                // if value === "", then remove inline opacity #12685
6834                if ( ( value >= 1 || value === "" ) &&
6835                    jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
6836                    style.removeAttribute ) {
6837
6838                    // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
6839                    // if "filter:" is present at all, clearType is disabled, we want to avoid this
6840                    // style.removeAttribute is IE Only, but so apparently is this code path...
6841                    style.removeAttribute( "filter" );
6842
6843                    // if there is no filter style applied in a css rule or unset inline opacity, we are done
6844                    if ( value === "" || currentStyle && !currentStyle.filter ) {
6845                        return;
6846                    }
6847                }
6848
6849                // otherwise, set new filter values
6850                style.filter = ralpha.test( filter ) ?
6851                    filter.replace( ralpha, opacity ) :
6852                    filter + " " + opacity;
6853            }
6854        };
6855    }
6856
6857    jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
6858        function( elem, computed ) {
6859            if ( computed ) {
6860                // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6861                // Work around by temporarily setting element display to inline-block
6862                return jQuery.swap( elem, { "display": "inline-block" },
6863                    curCSS, [ elem, "marginRight" ] );
6864            }
6865        }
6866    );
6867
6868// These hooks are used by animate to expand properties
6869    jQuery.each({
6870        margin: "",
6871        padding: "",
6872        border: "Width"
6873    }, function( prefix, suffix ) {
6874        jQuery.cssHooks[ prefix + suffix ] = {
6875            expand: function( value ) {
6876                var i = 0,
6877                    expanded = {},
6878
6879                // assumes a single number if not a string
6880                    parts = typeof value === "string" ? value.split(" ") : [ value ];
6881
6882                for ( ; i < 4; i++ ) {
6883                    expanded[ prefix + cssExpand[ i ] + suffix ] =
6884                        parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6885                }
6886
6887                return expanded;
6888            }
6889        };
6890
6891        if ( !rmargin.test( prefix ) ) {
6892            jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6893        }
6894    });
6895
6896    jQuery.fn.extend({
6897        css: function( name, value ) {
6898            return access( this, function( elem, name, value ) {
6899                var styles, len,
6900                    map = {},
6901                    i = 0;
6902
6903                if ( jQuery.isArray( name ) ) {
6904                    styles = getStyles( elem );
6905                    len = name.length;
6906
6907                    for ( ; i < len; i++ ) {
6908                        map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6909                    }
6910
6911                    return map;
6912                }
6913
6914                return value !== undefined ?
6915                    jQuery.style( elem, name, value ) :
6916                    jQuery.css( elem, name );
6917            }, name, value, arguments.length > 1 );
6918        },
6919        show: function() {
6920            return showHide( this, true );
6921        },
6922        hide: function() {
6923            return showHide( this );
6924        },
6925        toggle: function( state ) {
6926            if ( typeof state === "boolean" ) {
6927                return state ? this.show() : this.hide();
6928            }
6929
6930            return this.each(function() {
6931                if ( isHidden( this ) ) {
6932                    jQuery( this ).show();
6933                } else {
6934                    jQuery( this ).hide();
6935                }
6936            });
6937        }
6938    });
6939
6940
6941    function Tween( elem, options, prop, end, easing ) {
6942        return new Tween.prototype.init( elem, options, prop, end, easing );
6943    }
6944    jQuery.Tween = Tween;
6945
6946    Tween.prototype = {
6947        constructor: Tween,
6948        init: function( elem, options, prop, end, easing, unit ) {
6949            this.elem = elem;
6950            this.prop = prop;
6951            this.easing = easing || "swing";
6952            this.options = options;
6953            this.start = this.now = this.cur();
6954            this.end = end;
6955            this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
6956        },
6957        cur: function() {
6958            var hooks = Tween.propHooks[ this.prop ];
6959
6960            return hooks && hooks.get ?
6961                hooks.get( this ) :
6962                Tween.propHooks._default.get( this );
6963        },
6964        run: function( percent ) {
6965            var eased,
6966                hooks = Tween.propHooks[ this.prop ];
6967
6968            if ( this.options.duration ) {
6969                this.pos = eased = jQuery.easing[ this.easing ](
6970                    percent, this.options.duration * percent, 0, 1, this.options.duration
6971                );
6972            } else {
6973                this.pos = eased = percent;
6974            }
6975            this.now = ( this.end - this.start ) * eased + this.start;
6976
6977            if ( this.options.step ) {
6978                this.options.step.call( this.elem, this.now, this );
6979            }
6980
6981            if ( hooks && hooks.set ) {
6982                hooks.set( this );
6983            } else {
6984                Tween.propHooks._default.set( this );
6985            }
6986            return this;
6987        }
6988    };
6989
6990    Tween.prototype.init.prototype = Tween.prototype;
6991
6992    Tween.propHooks = {
6993        _default: {
6994            get: function( tween ) {
6995                var result;
6996
6997                if ( tween.elem[ tween.prop ] != null &&
6998                    (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
6999                    return tween.elem[ tween.prop ];
7000                }
7001
7002                // passing an empty string as a 3rd parameter to .css will automatically
7003                // attempt a parseFloat and fallback to a string if the parse fails
7004                // so, simple values such as "10px" are parsed to Float.
7005                // complex values such as "rotate(1rad)" are returned as is.
7006                result = jQuery.css( tween.elem, tween.prop, "" );
7007                // Empty strings, null, undefined and "auto" are converted to 0.
7008                return !result || result === "auto" ? 0 : result;
7009            },
7010            set: function( tween ) {
7011                // use step hook for back compat - use cssHook if its there - use .style if its
7012                // available and use plain properties where available
7013                if ( jQuery.fx.step[ tween.prop ] ) {
7014                    jQuery.fx.step[ tween.prop ]( tween );
7015                } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
7016                    jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
7017                } else {
7018                    tween.elem[ tween.prop ] = tween.now;
7019                }
7020            }
7021        }
7022    };
7023
7024// Support: IE <=9
7025// Panic based approach to setting things on disconnected nodes
7026
7027    Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
7028        set: function( tween ) {
7029            if ( tween.elem.nodeType && tween.elem.parentNode ) {
7030                tween.elem[ tween.prop ] = tween.now;
7031            }
7032        }
7033    };
7034
7035    jQuery.easing = {
7036        linear: function( p ) {
7037            return p;
7038        },
7039        swing: function( p ) {
7040            return 0.5 - Math.cos( p * Math.PI ) / 2;
7041        }
7042    };
7043
7044    jQuery.fx = Tween.prototype.init;
7045
7046// Back Compat <1.8 extension point
7047    jQuery.fx.step = {};
7048
7049
7050
7051
7052    var
7053        fxNow, timerId,
7054        rfxtypes = /^(?:toggle|show|hide)$/,
7055        rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
7056        rrun = /queueHooks$/,
7057        animationPrefilters = [ defaultPrefilter ],
7058        tweeners = {
7059            "*": [ function( prop, value ) {
7060                var tween = this.createTween( prop, value ),
7061                    target = tween.cur(),
7062                    parts = rfxnum.exec( value ),
7063                    unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
7064
7065                // Starting value computation is required for potential unit mismatches
7066                    start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
7067                        rfxnum.exec( jQuery.css( tween.elem, prop ) ),
7068                    scale = 1,
7069                    maxIterations = 20;
7070
7071                if ( start && start[ 3 ] !== unit ) {
7072                    // Trust units reported by jQuery.css
7073                    unit = unit || start[ 3 ];
7074
7075                    // Make sure we update the tween properties later on
7076                    parts = parts || [];
7077
7078                    // Iteratively approximate from a nonzero starting point
7079                    start = +target || 1;
7080
7081                    do {
7082                        // If previous iteration zeroed out, double until we get *something*
7083                        // Use a string for doubling factor so we don't accidentally see scale as unchanged below
7084                        scale = scale || ".5";
7085
7086                        // Adjust and apply
7087                        start = start / scale;
7088                        jQuery.style( tween.elem, prop, start + unit );
7089
7090                        // Update scale, tolerating zero or NaN from tween.cur()
7091                        // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
7092                    } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
7093                }
7094
7095                // Update tween properties
7096                if ( parts ) {
7097                    start = tween.start = +start || +target || 0;
7098                    tween.unit = unit;
7099                    // If a +=/-= token was provided, we're doing a relative animation
7100                    tween.end = parts[ 1 ] ?
7101                        start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
7102                        +parts[ 2 ];
7103                }
7104
7105                return tween;
7106            } ]
7107        };
7108
7109// Animations created synchronously will run synchronously
7110    function createFxNow() {
7111        setTimeout(function() {
7112            fxNow = undefined;
7113        });
7114        return ( fxNow = jQuery.now() );
7115    }
7116
7117// Generate parameters to create a standard animation
7118    function genFx( type, includeWidth ) {
7119        var which,
7120            attrs = { height: type },
7121            i = 0;
7122
7123        // if we include width, step value is 1 to do all cssExpand values,
7124        // if we don't include width, step value is 2 to skip over Left and Right
7125        includeWidth = includeWidth ? 1 : 0;
7126        for ( ; i < 4 ; i += 2 - includeWidth ) {
7127            which = cssExpand[ i ];
7128            attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
7129        }
7130
7131        if ( includeWidth ) {
7132            attrs.opacity = attrs.width = type;
7133        }
7134
7135        return attrs;
7136    }
7137
7138    function createTween( value, prop, animation ) {
7139        var tween,
7140            collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
7141            index = 0,
7142            length = collection.length;
7143        for ( ; index < length; index++ ) {
7144            if ( (tween = collection[ index ].call( animation, prop, value )) ) {
7145
7146                // we're done with this property
7147                return tween;
7148            }
7149        }
7150    }
7151
7152    function defaultPrefilter( elem, props, opts ) {
7153        /* jshint validthis: true */
7154        var prop, value, toggle, tween, hooks, oldfire, display, dDisplay,
7155            anim = this,
7156            orig = {},
7157            style = elem.style,
7158            hidden = elem.nodeType && isHidden( elem ),
7159            dataShow = jQuery._data( elem, "fxshow" );
7160
7161        // handle queue: false promises
7162        if ( !opts.queue ) {
7163            hooks = jQuery._queueHooks( elem, "fx" );
7164            if ( hooks.unqueued == null ) {
7165                hooks.unqueued = 0;
7166                oldfire = hooks.empty.fire;
7167                hooks.empty.fire = function() {
7168                    if ( !hooks.unqueued ) {
7169                        oldfire();
7170                    }
7171                };
7172            }
7173            hooks.unqueued++;
7174
7175            anim.always(function() {
7176                // doing this makes sure that the complete handler will be called
7177                // before this completes
7178                anim.always(function() {
7179                    hooks.unqueued--;
7180                    if ( !jQuery.queue( elem, "fx" ).length ) {
7181                        hooks.empty.fire();
7182                    }
7183                });
7184            });
7185        }
7186
7187        // height/width overflow pass
7188        if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
7189            // Make sure that nothing sneaks out
7190            // Record all 3 overflow attributes because IE does not
7191            // change the overflow attribute when overflowX and
7192            // overflowY are set to the same value
7193            opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
7194
7195            // Set display property to inline-block for height/width
7196            // animations on inline elements that are having width/height animated
7197            display = jQuery.css( elem, "display" );
7198            dDisplay = defaultDisplay( elem.nodeName );
7199            if ( display === "none" ) {
7200                display = dDisplay;
7201            }
7202            if ( display === "inline" &&
7203                jQuery.css( elem, "float" ) === "none" ) {
7204
7205                // inline-level elements accept inline-block;
7206                // block-level elements need to be inline with layout
7207                if ( !support.inlineBlockNeedsLayout || dDisplay === "inline" ) {
7208                    style.display = "inline-block";
7209                } else {
7210                    style.zoom = 1;
7211                }
7212            }
7213        }
7214
7215        if ( opts.overflow ) {
7216            style.overflow = "hidden";
7217            if ( !support.shrinkWrapBlocks() ) {
7218                anim.always(function() {
7219                    style.overflow = opts.overflow[ 0 ];
7220                    style.overflowX = opts.overflow[ 1 ];
7221                    style.overflowY = opts.overflow[ 2 ];
7222                });
7223            }
7224        }
7225
7226        // show/hide pass
7227        for ( prop in props ) {
7228            value = props[ prop ];
7229            if ( rfxtypes.exec( value ) ) {
7230                delete props[ prop ];
7231                toggle = toggle || value === "toggle";
7232                if ( value === ( hidden ? "hide" : "show" ) ) {
7233
7234                    // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
7235                    if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
7236                        hidden = true;
7237                    } else {
7238                        continue;
7239                    }
7240                }
7241                orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
7242            }
7243        }
7244
7245        if ( !jQuery.isEmptyObject( orig ) ) {
7246            if ( dataShow ) {
7247                if ( "hidden" in dataShow ) {
7248                    hidden = dataShow.hidden;
7249                }
7250            } else {
7251                dataShow = jQuery._data( elem, "fxshow", {} );
7252            }
7253
7254            // store state if its toggle - enables .stop().toggle() to "reverse"
7255            if ( toggle ) {
7256                dataShow.hidden = !hidden;
7257            }
7258            if ( hidden ) {
7259                jQuery( elem ).show();
7260            } else {
7261                anim.done(function() {
7262                    jQuery( elem ).hide();
7263                });
7264            }
7265            anim.done(function() {
7266                var prop;
7267                jQuery._removeData( elem, "fxshow" );
7268                for ( prop in orig ) {
7269                    jQuery.style( elem, prop, orig[ prop ] );
7270                }
7271            });
7272            for ( prop in orig ) {
7273                tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
7274
7275                if ( !( prop in dataShow ) ) {
7276                    dataShow[ prop ] = tween.start;
7277                    if ( hidden ) {
7278                        tween.end = tween.start;
7279                        tween.start = prop === "width" || prop === "height" ? 1 : 0;
7280                    }
7281                }
7282            }
7283        }
7284    }
7285
7286    function propFilter( props, specialEasing ) {
7287        var index, name, easing, value, hooks;
7288
7289        // camelCase, specialEasing and expand cssHook pass
7290        for ( index in props ) {
7291            name = jQuery.camelCase( index );
7292            easing = specialEasing[ name ];
7293            value = props[ index ];
7294            if ( jQuery.isArray( value ) ) {
7295                easing = value[ 1 ];
7296                value = props[ index ] = value[ 0 ];
7297            }
7298
7299            if ( index !== name ) {
7300                props[ name ] = value;
7301                delete props[ index ];
7302            }
7303
7304            hooks = jQuery.cssHooks[ name ];
7305            if ( hooks && "expand" in hooks ) {
7306                value = hooks.expand( value );
7307                delete props[ name ];
7308
7309                // not quite $.extend, this wont overwrite keys already present.
7310                // also - reusing 'index' from above because we have the correct "name"
7311                for ( index in value ) {
7312                    if ( !( index in props ) ) {
7313                        props[ index ] = value[ index ];
7314                        specialEasing[ index ] = easing;
7315                    }
7316                }
7317            } else {
7318                specialEasing[ name ] = easing;
7319            }
7320        }
7321    }
7322
7323    function Animation( elem, properties, options ) {
7324        var result,
7325            stopped,
7326            index = 0,
7327            length = animationPrefilters.length,
7328            deferred = jQuery.Deferred().always( function() {
7329                // don't match elem in the :animated selector
7330                delete tick.elem;
7331            }),
7332            tick = function() {
7333                if ( stopped ) {
7334                    return false;
vendor: 8,150 bytes, lines 7335-7552
7335                }
7336                var currentTime = fxNow || createFxNow(),
7337                    remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7338                // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
7339                    temp = remaining / animation.duration || 0,
7340                    percent = 1 - temp,
7341                    index = 0,
7342                    length = animation.tweens.length;
7343
7344                for ( ; index < length ; index++ ) {
7345                    animation.tweens[ index ].run( percent );
7346                }
7347
7348                deferred.notifyWith( elem, [ animation, percent, remaining ]);
7349
7350                if ( percent < 1 && length ) {
7351                    return remaining;
7352                } else {
7353                    deferred.resolveWith( elem, [ animation ] );
7354                    return false;
7355                }
7356            },
7357            animation = deferred.promise({
7358                elem: elem,
7359                props: jQuery.extend( {}, properties ),
7360                opts: jQuery.extend( true, { specialEasing: {} }, options ),
7361                originalProperties: properties,
7362                originalOptions: options,
7363                startTime: fxNow || createFxNow(),
7364                duration: options.duration,
7365                tweens: [],
7366                createTween: function( prop, end ) {
7367                    var tween = jQuery.Tween( elem, animation.opts, prop, end,
7368                            animation.opts.specialEasing[ prop ] || animation.opts.easing );
7369                    animation.tweens.push( tween );
7370                    return tween;
7371                },
7372                stop: function( gotoEnd ) {
7373                    var index = 0,
7374                    // if we are going to the end, we want to run all the tweens
7375                    // otherwise we skip this part
7376                        length = gotoEnd ? animation.tweens.length : 0;
7377                    if ( stopped ) {
7378                        return this;
7379                    }
7380                    stopped = true;
7381                    for ( ; index < length ; index++ ) {
7382                        animation.tweens[ index ].run( 1 );
7383                    }
7384
7385                    // resolve when we played the last frame
7386                    // otherwise, reject
7387                    if ( gotoEnd ) {
7388                        deferred.resolveWith( elem, [ animation, gotoEnd ] );
7389                    } else {
7390                        deferred.rejectWith( elem, [ animation, gotoEnd ] );
7391                    }
7392                    return this;
7393                }
7394            }),
7395            props = animation.props;
7396
7397        propFilter( props, animation.opts.specialEasing );
7398
7399        for ( ; index < length ; index++ ) {
7400            result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
7401            if ( result ) {
7402                return result;
7403            }
7404        }
7405
7406        jQuery.map( props, createTween, animation );
7407
7408        if ( jQuery.isFunction( animation.opts.start ) ) {
7409            animation.opts.start.call( elem, animation );
7410        }
7411
7412        jQuery.fx.timer(
7413            jQuery.extend( tick, {
7414                elem: elem,
7415                anim: animation,
7416                queue: animation.opts.queue
7417            })
7418        );
7419
7420        // attach callbacks from options
7421        return animation.progress( animation.opts.progress )
7422            .done( animation.opts.done, animation.opts.complete )
7423            .fail( animation.opts.fail )
7424            .always( animation.opts.always );
7425    }
7426
7427    jQuery.Animation = jQuery.extend( Animation, {
7428        tweener: function( props, callback ) {
7429            if ( jQuery.isFunction( props ) ) {
7430                callback = props;
7431                props = [ "*" ];
7432            } else {
7433                props = props.split(" ");
7434            }
7435
7436            var prop,
7437                index = 0,
7438                length = props.length;
7439
7440            for ( ; index < length ; index++ ) {
7441                prop = props[ index ];
7442                tweeners[ prop ] = tweeners[ prop ] || [];
7443                tweeners[ prop ].unshift( callback );
7444            }
7445        },
7446
7447        prefilter: function( callback, prepend ) {
7448            if ( prepend ) {
7449                animationPrefilters.unshift( callback );
7450            } else {
7451                animationPrefilters.push( callback );
7452            }
7453        }
7454    });
7455
7456    jQuery.speed = function( speed, easing, fn ) {
7457        var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7458            complete: fn || !fn && easing ||
7459                jQuery.isFunction( speed ) && speed,
7460            duration: speed,
7461            easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
7462        };
7463
7464        opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
7465                opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
7466
7467        // normalize opt.queue - true/undefined/null -> "fx"
7468        if ( opt.queue == null || opt.queue === true ) {
7469            opt.queue = "fx";
7470        }
7471
7472        // Queueing
7473        opt.old = opt.complete;
7474
7475        opt.complete = function() {
7476            if ( jQuery.isFunction( opt.old ) ) {
7477                opt.old.call( this );
7478            }
7479
7480            if ( opt.queue ) {
7481                jQuery.dequeue( this, opt.queue );
7482            }
7483        };
7484
7485        return opt;
7486    };
7487
7488    jQuery.fn.extend({
7489        fadeTo: function( speed, to, easing, callback ) {
7490
7491            // show any hidden elements after setting opacity to 0
7492            return this.filter( isHidden ).css( "opacity", 0 ).show()
7493
7494                // animate to the value specified
7495                .end().animate({ opacity: to }, speed, easing, callback );
7496        },
7497        animate: function( prop, speed, easing, callback ) {
7498            var empty = jQuery.isEmptyObject( prop ),
7499                optall = jQuery.speed( speed, easing, callback ),
7500                doAnimation = function() {
7501                    // Operate on a copy of prop so per-property easing won't be lost
7502                    var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7503
7504                    // Empty animations, or finishing resolves immediately
7505                    if ( empty || jQuery._data( this, "finish" ) ) {
7506                        anim.stop( true );
7507                    }
7508                };
7509            doAnimation.finish = doAnimation;
7510
7511            return empty || optall.queue === false ?
7512                this.each( doAnimation ) :
7513                this.queue( optall.queue, doAnimation );
7514        },
7515        stop: function( type, clearQueue, gotoEnd ) {
7516            var stopQueue = function( hooks ) {
7517                var stop = hooks.stop;
7518                delete hooks.stop;
7519                stop( gotoEnd );
7520            };
7521
7522            if ( typeof type !== "string" ) {
7523                gotoEnd = clearQueue;
7524                clearQueue = type;
7525                type = undefined;
7526            }
7527            if ( clearQueue && type !== false ) {
7528                this.queue( type || "fx", [] );
7529            }
7530
7531            return this.each(function() {
7532                var dequeue = true,
7533                    index = type != null && type + "queueHooks",
7534                    timers = jQuery.timers,
7535                    data = jQuery._data( this );
7536
7537                if ( index ) {
7538                    if ( data[ index ] && data[ index ].stop ) {
7539                        stopQueue( data[ index ] );
7540                    }
7541                } else {
7542                    for ( index in data ) {
7543                        if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7544                            stopQueue( data[ index ] );
7545                        }
7546                    }
7547                }
7548
7549                for ( index = timers.length; index--; ) {
7550                    if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
7551                        timers[ index ].anim.stop( gotoEnd );
7552                        dequeue = false;
7553                        timers.splice( index, 1 );
7554                    }
7555                }
7556
7557                // start the next in the queue if the last step wasn't forced
7558                // timers currently will call their complete callbacks, which will dequeue
7559                // but only if they were gotoEnd
7560                if ( dequeue || !gotoEnd ) {
7561                    jQuery.dequeue( this, type );
7562                }
7563            });
7564        },
7565        finish: function( type ) {
7566            if ( type !== false ) {
7567                type = type || "fx";
7568            }
7569            return this.each(function() {
7570                var index,
7571                    data = jQuery._data( this ),
7572                    queue = data[ type + "queue" ],
7573                    hooks = data[ type + "queueHooks" ],
7574                    timers = jQuery.timers,
7575                    length = queue ? queue.length : 0;
7576
7577                // enable finishing flag on private data
7578                data.finish = true;
7579
7580                // empty the queue first
7581                jQuery.queue( this, type, [] );
7582
7583                if ( hooks && hooks.stop ) {
7584                    hooks.stop.call( this, true );
7585                }
7586
7587                // look for any active animations, and finish them
7588                for ( index = timers.length; index--; ) {
7589                    if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
7590                        timers[ index ].anim.stop( true );
7591                        timers.splice( index, 1 );
7592                    }
7593                }
7594
7595                // look for any animations in the old queue and finish them
7596                for ( index = 0; index < length; index++ ) {
7597                    if ( queue[ index ] && queue[ index ].finish ) {
7598                        queue[ index ].finish.call( this );
7599                    }
7600                }
7601
7602                // turn off finishing flag
7603                delete data.finish;
7604            });
7605        }
7606    });
7607
7608    jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
7609        var cssFn = jQuery.fn[ name ];
7610        jQuery.fn[ name ] = function( speed, easing, callback ) {
7611            return speed == null || typeof speed === "boolean" ?
7612                cssFn.apply( this, arguments ) :
7613                this.animate( genFx( name, true ), speed, easing, callback );
7614        };
7615    });
7616
7617// Generate shortcuts for custom animations
7618    jQuery.each({
7619        slideDown: genFx("show"),
7620        slideUp: genFx("hide"),
7621        slideToggle: genFx("toggle"),
7622        fadeIn: { opacity: "show" },
7623        fadeOut: { opacity: "hide" },
7624        fadeToggle: { opacity: "toggle" }
7625    }, function( name, props ) {
7626        jQuery.fn[ name ] = function( speed, easing, callback ) {
7627            return this.animate( props, speed, easing, callback );
7628        };
7629    });
7630
7631    jQuery.timers = [];
7632    jQuery.fx.tick = function() {
7633        var timer,
7634            timers = jQuery.timers,
7635            i = 0;
7636
7637        fxNow = jQuery.now();
7638
7639        for ( ; i < timers.length; i++ ) {
7640            timer = timers[ i ];
7641            // Checks the timer has not already been removed
7642            if ( !timer() && timers[ i ] === timer ) {
7643                timers.splice( i--, 1 );
7644            }
7645        }
7646
7647        if ( !timers.length ) {
7648            jQuery.fx.stop();
7649        }
7650        fxNow = undefined;
7651    };
7652
7653    jQuery.fx.timer = function( timer ) {
7654        jQuery.timers.push( timer );
7655        if ( timer() ) {
7656            jQuery.fx.start();
7657        } else {
7658            jQuery.timers.pop();
7659        }
7660    };
7661
7662    jQuery.fx.interval = 13;
7663
7664    jQuery.fx.start = function() {
7665        if ( !timerId ) {
7666            timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
7667        }
7668    };
7669
7670    jQuery.fx.stop = function() {
7671        clearInterval( timerId );
7672        timerId = null;
7673    };
7674
7675    jQuery.fx.speeds = {
7676        slow: 600,
7677        fast: 200,
7678        // Default speed
7679        _default: 400
7680    };
7681
7682
7683// Based off of the plugin by Clint Helfers, with permission.
7684// http://blindsignals.com/index.php/2009/07/jquery-delay/
7685    jQuery.fn.delay = function( time, type ) {
7686        time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7687        type = type || "fx";
7688
7689        return this.queue( type, function( next, hooks ) {
7690            var timeout = setTimeout( next, time );
7691            hooks.stop = function() {
7692                clearTimeout( timeout );
7693            };
7694        });
7695    };
7696
7697
7698    (function() {
7699        var a, input, select, opt,
7700            div = document.createElement("div" );
7701
7702        // Setup
7703        div.setAttribute( "className", "t" );
7704        div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
7705        a = div.getElementsByTagName("a")[ 0 ];
7706
7707        // First batch of tests.
7708        select = document.createElement("select");
7709        opt = select.appendChild( document.createElement("option") );
7710        input = div.getElementsByTagName("input")[ 0 ];
7711
7712        a.style.cssText = "top:1px";
7713
7714        // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
7715        support.getSetAttribute = div.className !== "t";
7716
7717        // Get the style information from getAttribute
7718        // (IE uses .cssText instead)
7719        support.style = /top/.test( a.getAttribute("style") );
7720
7721        // Make sure that URLs aren't manipulated
7722        // (IE normalizes it by default)
7723        support.hrefNormalized = a.getAttribute("href") === "/a";
7724
7725        // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
7726        support.checkOn = !!input.value;
7727
7728        // Make sure that a selected-by-default option has a working selected property.
7729        // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
7730        support.optSelected = opt.selected;
7731
7732        // Tests for enctype support on a form (#6743)
7733        support.enctype = !!document.createElement("form").enctype;
7734
7735        // Make sure that the options inside disabled selects aren't marked as disabled
7736        // (WebKit marks them as disabled)
7737        select.disabled = true;
7738        support.optDisabled = !opt.disabled;
7739
7740        // Support: IE8 only
7741        // Check if we can trust getAttribute("value")
7742        input = document.createElement( "input" );
7743        input.setAttribute( "value", "" );
7744        support.input = input.getAttribute( "value" ) === "";
7745
7746        // Check if an input maintains its value after becoming a radio
7747        input.value = "t";
7748        input.setAttribute( "type", "radio" );
7749        support.radioValue = input.value === "t";
7750
7751        // Null elements to avoid leaks in IE.
7752        a = input = select = opt = div = null;
7753    })();
7754
7755
7756    var rreturn = /\r/g;
7757
7758    jQuery.fn.extend({
7759        val: function( value ) {
7760            var hooks, ret, isFunction,
7761                elem = this[0];
7762
7763            if ( !arguments.length ) {
7764                if ( elem ) {
7765                    hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7766
7767                    if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
7768                        return ret;
7769                    }
7770
7771                    ret = elem.value;
7772
7773                    return typeof ret === "string" ?
7774                        // handle most common string cases
7775                        ret.replace(rreturn, "") :
7776                        // handle cases where value is null/undef or number
7777                            ret == null ? "" : ret;
7778                }
7779
7780                return;
7781            }
7782
7783            isFunction = jQuery.isFunction( value );
7784
7785            return this.each(function( i ) {
7786                var val;
7787
7788                if ( this.nodeType !== 1 ) {
7789                    return;
7790                }
7791
7792                if ( isFunction ) {
7793                    val = value.call( this, i, jQuery( this ).val() );
7794                } else {
7795                    val = value;
7796                }
7797
7798                // Treat null/undefined as ""; convert numbers to string
7799                if ( val == null ) {
7800                    val = "";
7801                } else if ( typeof val === "number" ) {
7802                    val += "";
7803                } else if ( jQuery.isArray( val ) ) {
7804                    val = jQuery.map( val, function( value ) {
7805                        return value == null ? "" : value + "";
7806                    });
7807                }
7808
7809                hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7810
7811                // If set returns undefined, fall back to normal setting
7812                if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
7813                    this.value = val;
7814                }
7815            });
7816        }
7817    });
7818
7819    jQuery.extend({
7820        valHooks: {
7821            option: {
7822                get: function( elem ) {
7823                    var val = jQuery.find.attr( elem, "value" );
7824                    return val != null ?
7825                        val :
7826                        jQuery.text( elem );
7827                }
7828            },
7829            select: {
7830                get: function( elem ) {
7831                    var value, option,
7832                        options = elem.options,
7833                        index = elem.selectedIndex,
7834                        one = elem.type === "select-one" || index < 0,
7835                        values = one ? null : [],
7836                        max = one ? index + 1 : options.length,
7837                        i = index < 0 ?
7838                            max :
7839                            one ? index : 0;
7840
7841                    // Loop through all the selected options
7842                    for ( ; i < max; i++ ) {
7843                        option = options[ i ];
7844
7845                        // oldIE doesn't update selected after form reset (#2551)
7846                        if ( ( option.selected || i === index ) &&
7847                            // Don't return options that are disabled or in a disabled optgroup
7848                            ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
7849                            ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
7850
7851                            // Get the specific value for the option
7852                            value = jQuery( option ).val();
7853
7854                            // We don't need an array for one selects
7855                            if ( one ) {
7856                                return value;
7857                            }
7858
7859                            // Multi-Selects return an array
7860                            values.push( value );
7861                        }
7862                    }
7863
7864                    return values;
7865                },
7866
7867                set: function( elem, value ) {
7868                    var optionSet, option,
7869                        options = elem.options,
7870                        values = jQuery.makeArray( value ),
7871                        i = options.length;
7872
7873                    while ( i-- ) {
7874                        option = options[ i ];
7875
7876                        if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
7877
7878                            // Support: IE6
7879                            // When new option element is added to select box we need to
7880                            // force reflow of newly added node in order to workaround delay
7881                            // of initialization properties
7882                            try {
7883                                option.selected = optionSet = true;
7884
7885                            } catch ( _ ) {
7886
7887                                // Will be executed only in IE6
7888                                option.scrollHeight;
7889                            }
7890
7891                        } else {
7892                            option.selected = false;
7893                        }
7894                    }
7895
7896                    // Force browsers to behave consistently when non-matching value is set
7897                    if ( !optionSet ) {
7898                        elem.selectedIndex = -1;
7899                    }
7900
7901                    return options;
7902                }
7903            }
7904        }
7905    });
7906
7907// Radios and checkboxes getter/setter
7908    jQuery.each([ "radio", "checkbox" ], function() {
7909        jQuery.valHooks[ this ] = {
7910            set: function( elem, value ) {
7911                if ( jQuery.isArray( value ) ) {
7912                    return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
7913                }
7914            }
7915        };
7916        if ( !support.checkOn ) {
7917            jQuery.valHooks[ this ].get = function( elem ) {
7918                // Support: Webkit
7919                // "" is returned instead of "on" if a value isn't specified
7920                return elem.getAttribute("value") === null ? "on" : elem.value;
7921            };
7922        }
7923    });
7924
7925
7926
7927
7928    var nodeHook, boolHook,
7929        attrHandle = jQuery.expr.attrHandle,
7930        ruseDefault = /^(?:checked|selected)$/i,
7931        getSetAttribute = support.getSetAttribute,
7932        getSetInput = support.input;
7933
7934    jQuery.fn.extend({
7935        attr: function( name, value ) {
7936            return access( this, jQuery.attr, name, value, arguments.length > 1 );
7937        },
7938
7939        removeAttr: function( name ) {
7940            return this.each(function() {
7941                jQuery.removeAttr( this, name );
7942            });
7943        }
7944    });
7945
7946    jQuery.extend({
7947        attr: function( elem, name, value ) {
7948            var hooks, ret,
7949                nType = elem.nodeType;
7950
7951            // don't get/set attributes on text, comment and attribute nodes
7952            if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
7953                return;
7954            }
7955
7956            // Fallback to prop when attributes are not supported
7957            if ( typeof elem.getAttribute === strundefined ) {
7958                return jQuery.prop( elem, name, value );
7959            }
7960
7961            // All attributes are lowercase
7962            // Grab necessary hook if one is defined
7963            if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7964                name = name.toLowerCase();
7965                hooks = jQuery.attrHooks[ name ] ||
7966                    ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
7967            }
7968
7969            if ( value !== undefined ) {
7970
7971                if ( value === null ) {
7972                    jQuery.removeAttr( elem, name );
7973
7974                } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
7975                    return ret;
7976
7977                } else {
7978                    elem.setAttribute( name, value + "" );
7979                    return value;
7980                }
7981
7982            } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
7983                return ret;
7984
7985            } else {
7986                ret = jQuery.find.attr( elem, name );
7987
7988                // Non-existent attributes return null, we normalize to undefined
7989                return ret == null ?
7990                    undefined :
7991                    ret;
7992            }
7993        },
7994
7995        removeAttr: function( elem, value ) {
7996            var name, propName,
7997                i = 0,
7998                attrNames = value && value.match( rnotwhite );
7999
8000            if ( attrNames && elem.nodeType === 1 ) {
8001                while ( (name = attrNames[i++]) ) {
8002                    propName = jQuery.propFix[ name ] || name;
8003
8004                    // Boolean attributes get special treatment (#10870)
8005                    if ( jQuery.expr.match.bool.test( name ) ) {
8006                        // Set corresponding property to false
8007                        if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
8008                            elem[ propName ] = false;
8009                            // Support: IE<9
8010                            // Also clear defaultChecked/defaultSelected (if appropriate)
8011                        } else {
8012                            elem[ jQuery.camelCase( "default-" + name ) ] =
8013                                elem[ propName ] = false;
8014                        }
8015
8016                        // See #9699 for explanation of this approach (setting first, then removal)
8017                    } else {
8018                        jQuery.attr( elem, name, "" );
8019                    }
8020
8021                    elem.removeAttribute( getSetAttribute ? name : propName );
8022                }
8023            }
8024        },
8025
8026        attrHooks: {
8027            type: {
8028                set: function( elem, value ) {
8029                    if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
8030                        // Setting the type on a radio button after the value resets the value in IE6-9
8031                        // Reset value to default in case type is set after value during creation
8032                        var val = elem.value;
8033                        elem.setAttribute( "type", value );
8034                        if ( val ) {
8035                            elem.value = val;
8036                        }
8037                        return value;
8038                    }
8039                }
8040            }
8041        }
8042    });
8043
8044// Hook for boolean attributes
8045    boolHook = {
8046        set: function( elem, value, name ) {
8047            if ( value === false ) {
8048                // Remove boolean attributes when set to false
8049                jQuery.removeAttr( elem, name );
8050            } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
8051                // IE<8 needs the *property* name
8052                elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
8053
8054                // Use defaultChecked and defaultSelected for oldIE
8055            } else {
8056                elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
8057            }
8058
8059            return name;
8060        }
8061    };
8062
8063// Retrieve booleans specially
8064    jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
8065
8066        var getter = attrHandle[ name ] || jQuery.find.attr;
8067
8068        attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
8069            function( elem, name, isXML ) {
8070                var ret, handle;
8071                if ( !isXML ) {
8072                    // Avoid an infinite loop by temporarily removing this function from the getter
8073                    handle = attrHandle[ name ];
8074                    attrHandle[ name ] = ret;
8075                    ret = getter( elem, name, isXML ) != null ?
8076                        name.toLowerCase() :
8077                        null;
8078                    attrHandle[ name ] = handle;
8079                }
8080                return ret;
8081            } :
8082            function( elem, name, isXML ) {
8083                if ( !isXML ) {
8084                    return elem[ jQuery.camelCase( "default-" + name ) ] ?
8085                        name.toLowerCase() :
8086                        null;
8087                }
8088            };
8089    });
8090
8091// fix oldIE attroperties
8092    if ( !getSetInput || !getSetAttribute ) {
8093        jQuery.attrHooks.value = {
8094            set: function( elem, value, name ) {
8095                if ( jQuery.nodeName( elem, "input" ) ) {
8096                    // Does not return so that setAttribute is also used
8097                    elem.defaultValue = value;
8098                } else {
8099                    // Use nodeHook if defined (#1954); otherwise setAttribute is fine
8100                    return nodeHook && nodeHook.set( elem, value, name );
8101                }
8102            }
8103        };
8104    }
8105
8106// IE6/7 do not support getting/setting some attributes with get/setAttribute
8107    if ( !getSetAttribute ) {
8108
8109        // Use this for any attribute in IE6/7
8110        // This fixes almost every IE6/7 issue
8111        nodeHook = {
8112            set: function( elem, value, name ) {
8113                // Set the existing or create a new attribute node
8114                var ret = elem.getAttributeNode( name );
8115                if ( !ret ) {
8116                    elem.setAttributeNode(
8117                        (ret = elem.ownerDocument.createAttribute( name ))
8118                    );
8119                }
8120
8121                ret.value = value += "";
8122
8123                // Break association with cloned elements by also using setAttribute (#9646)
8124                if ( name === "value" || value === elem.getAttribute( name ) ) {
8125                    return value;
8126                }
8127            }
8128        };
8129
8130        // Some attributes are constructed with empty-string values when not defined
8131        attrHandle.id = attrHandle.name = attrHandle.coords =
8132            function( elem, name, isXML ) {
8133                var ret;
8134                if ( !isXML ) {
8135                    return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
8136                        ret.value :
8137                        null;
8138                }
8139            };
8140
8141        // Fixing value retrieval on a button requires this module
8142        jQuery.valHooks.button = {
8143            get: function( elem, name ) {
8144                var ret = elem.getAttributeNode( name );
8145                if ( ret && ret.specified ) {
8146                    return ret.value;
8147                }
8148            },
8149            set: nodeHook.set
8150        };
8151
8152        // Set contenteditable to false on removals(#10429)
8153        // Setting to empty string throws an error as an invalid value
8154        jQuery.attrHooks.contenteditable = {
8155            set: function( elem, value, name ) {
8156                nodeHook.set( elem, value === "" ? false : value, name );
8157            }
8158        };
8159
8160        // Set width and height to auto instead of 0 on empty string( Bug #8150 )
8161        // This is for removals
8162        jQuery.each([ "width", "height" ], function( i, name ) {
8163            jQuery.attrHooks[ name ] = {
8164                set: function( elem, value ) {
8165                    if ( value === "" ) {
8166                        elem.setAttribute( name, "auto" );
8167                        return value;
8168                    }
8169                }
8170            };
8171        });
8172    }
8173
8174    if ( !support.style ) {
8175        jQuery.attrHooks.style = {
8176            get: function( elem ) {
8177                // Return undefined in the case of empty string
8178                // Note: IE uppercases css property names, but if we were to .toLowerCase()
8179                // .cssText, that would destroy case senstitivity in URL's, like in "background"
8180                return elem.style.cssText || undefined;
8181            },
8182            set: function( elem, value ) {
8183                return ( elem.style.cssText = value + "" );
8184            }
8185        };
8186    }
8187
8188
8189
8190
8191    var rfocusable = /^(?:input|select|textarea|button|object)$/i,
8192        rclickable = /^(?:a|area)$/i;
8193
8194    jQuery.fn.extend({
8195        prop: function( name, value ) {
8196            return access( this, jQuery.prop, name, value, arguments.length > 1 );
8197        },
8198
8199        removeProp: function( name ) {
8200            name = jQuery.propFix[ name ] || name;
8201            return this.each(function() {
8202                // try/catch handles cases where IE balks (such as removing a property on window)
8203                try {
8204                    this[ name ] = undefined;
8205                    delete this[ name ];
8206                } catch( e ) {}
8207            });
8208        }
8209    });
8210
8211    jQuery.extend({
8212        propFix: {
8213            "for": "htmlFor",
8214            "class": "className"
8215        },
8216
8217        prop: function( elem, name, value ) {
8218            var ret, hooks, notxml,
8219                nType = elem.nodeType;
8220
8221            // don't get/set properties on text, comment and attribute nodes
8222            if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
8223                return;
8224            }
8225
8226            notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
8227
8228            if ( notxml ) {
8229                // Fix name and attach hooks
8230                name = jQuery.propFix[ name ] || name;
8231                hooks = jQuery.propHooks[ name ];
8232            }
8233
8234            if ( value !== undefined ) {
8235                return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
8236                    ret :
8237                    ( elem[ name ] = value );
8238
8239            } else {
8240                return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
8241                    ret :
8242                    elem[ name ];
8243            }
8244        },
8245
8246        propHooks: {
8247            tabIndex: {
8248                get: function( elem ) {
8249                    // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
8250                    // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
8251                    // Use proper attribute retrieval(#12072)
8252                    var tabindex = jQuery.find.attr( elem, "tabindex" );
8253
8254                    return tabindex ?
8255                        parseInt( tabindex, 10 ) :
8256                            rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
8257                        0 :
8258                        -1;
8259                }
8260            }
8261        }
8262    });
8263
8264// Some attributes require a special call on IE
8265// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
8266    if ( !support.hrefNormalized ) {
8267        // href/src property should get the full normalized URL (#10299/#12915)
8268        jQuery.each([ "href", "src" ], function( i, name ) {
8269            jQuery.propHooks[ name ] = {
8270                get: function( elem ) {
8271                    return elem.getAttribute( name, 4 );
8272                }
8273            };
8274        });
8275    }
8276
8277// Support: Safari, IE9+
8278// mis-reports the default selected property of an option
8279// Accessing the parent's selectedIndex property fixes it
8280    if ( !support.optSelected ) {
8281        jQuery.propHooks.selected = {
8282            get: function( elem ) {
8283                var parent = elem.parentNode;
8284
8285                if ( parent ) {
8286                    parent.selectedIndex;
8287
8288                    // Make sure that it also works with optgroups, see #5701
8289                    if ( parent.parentNode ) {
8290                        parent.parentNode.selectedIndex;
8291                    }
8292                }
8293                return null;
8294            }
8295        };
8296    }
8297
8298    jQuery.each([
8299        "tabIndex",
8300        "readOnly",
8301        "maxLength",
8302        "cellSpacing",
8303        "cellPadding",
8304        "rowSpan",
8305        "colSpan",
8306        "useMap",
8307        "frameBorder",
8308        "contentEditable"
8309    ], function() {
8310        jQuery.propFix[ this.toLowerCase() ] = this;
8311    });
8312
8313// IE6/7 call enctype encoding
8314    if ( !support.enctype ) {
8315        jQuery.propFix.enctype = "encoding";
8316    }
8317
8318
8319
8320
8321    var rclass = /[\t\r\n\f]/g;
8322
8323    jQuery.fn.extend({
8324        addClass: function( value ) {
8325            var classes, elem, cur, clazz, j, finalValue,
8326                i = 0,
8327                len = this.length,
8328                proceed = typeof value === "string" && value;
8329
8330            if ( jQuery.isFunction( value ) ) {
8331                return this.each(function( j ) {
8332                    jQuery( this ).addClass( value.call( this, j, this.className ) );
8333                });
8334            }
8335
8336            if ( proceed ) {
8337                // The disjunction here is for better compressibility (see removeClass)
8338                classes = ( value || "" ).match( rnotwhite ) || [];
8339
8340                for ( ; i < len; i++ ) {
8341                    elem = this[ i ];
8342                    cur = elem.nodeType === 1 && ( elem.className ?
8343                        ( " " + elem.className + " " ).replace( rclass, " " ) :
8344                        " "
8345                        );
8346
8347                    if ( cur ) {
8348                        j = 0;
8349                        while ( (clazz = classes[j++]) ) {
8350                            if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8351                                cur += clazz + " ";
8352                            }
8353                        }
8354
8355                        // only assign if different to avoid unneeded rendering.
8356                        finalValue = jQuery.trim( cur );
8357                        if ( elem.className !== finalValue ) {
8358                            elem.className = finalValue;
8359                        }
8360                    }
8361                }
8362            }
8363
8364            return this;
8365        },
8366
8367        removeClass: function( value ) {
8368            var classes, elem, cur, clazz, j, finalValue,
8369                i = 0,
8370                len = this.length,
8371                proceed = arguments.length === 0 || typeof value === "string" && value;
8372
8373            if ( jQuery.isFunction( value ) ) {
8374                return this.each(function( j ) {
8375                    jQuery( this ).removeClass( value.call( this, j, this.className ) );
8376                });
8377            }
8378            if ( proceed ) {
8379                classes = ( value || "" ).match( rnotwhite ) || [];
8380
8381                for ( ; i < len; i++ ) {
8382                    elem = this[ i ];
8383                    // This expression is here for better compressibility (see addClass)
8384                    cur = elem.nodeType === 1 && ( elem.className ?
8385                        ( " " + elem.className + " " ).replace( rclass, " " ) :
8386                        ""
8387                        );
8388
8389                    if ( cur ) {
8390                        j = 0;
8391                        while ( (clazz = classes[j++]) ) {
8392                            // Remove *all* instances
8393                            while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
8394                                cur = cur.replace( " " + clazz + " ", " " );
8395                            }
8396                        }
8397
8398                        // only assign if different to avoid unneeded rendering.
8399                        finalValue = value ? jQuery.trim( cur ) : "";
8400                        if ( elem.className !== finalValue ) {
8401                            elem.className = finalValue;
8402                        }
8403                    }
8404                }
8405            }
8406
8407            return this;
8408        },
8409
8410        toggleClass: function( value, stateVal ) {
8411            var type = typeof value;
8412
8413            if ( typeof stateVal === "boolean" && type === "string" ) {
8414                return stateVal ? this.addClass( value ) : this.removeClass( value );
8415            }
8416
8417            if ( jQuery.isFunction( value ) ) {
8418                return this.each(function( i ) {
8419                    jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
8420                });
8421            }
8422
8423            return this.each(function() {
8424                if ( type === "string" ) {
8425                    // toggle individual class names
8426                    var className,
8427                        i = 0,
8428                        self = jQuery( this ),
8429                        classNames = value.match( rnotwhite ) || [];
8430
8431                    while ( (className = classNames[ i++ ]) ) {
8432                        // check each className given, space separated list
8433                        if ( self.hasClass( className ) ) {
8434                            self.removeClass( className );
8435                        } else {
8436                            self.addClass( className );
8437                        }
8438                    }
8439
8440                    // Toggle whole class name
8441                } else if ( type === strundefined || type === "boolean" ) {
8442                    if ( this.className ) {
8443                        // store className if set
8444                        jQuery._data( this, "__className__", this.className );
8445                    }
8446
8447                    // If the element has a class name or if we're passed "false",
8448                    // then remove the whole classname (if there was one, the above saved it).
8449                    // Otherwise bring back whatever was previously saved (if anything),
8450                    // falling back to the empty string if nothing was stored.
8451                    this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
8452                }
8453            });
8454        },
8455
8456        hasClass: function( selector ) {
8457            var className = " " + selector + " ",
8458                i = 0,
8459                l = this.length;
8460            for ( ; i < l; i++ ) {
8461                if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
8462                    return true;
8463                }
8464            }
8465
8466            return false;
8467        }
8468    });
8469
8470
8471
8472
8473// Return jQuery for attributes-only inclusion
8474
8475
8476    jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
8477        "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
8478        "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
8479
8480        // Handle event binding
8481        jQuery.fn[ name ] = function( data, fn ) {
8482            return arguments.length > 0 ?
8483                this.on( name, null, data, fn ) :
8484                this.trigger( name );
8485        };
8486    });
8487
8488    jQuery.fn.extend({
8489        hover: function( fnOver, fnOut ) {
8490            return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
8491        },
8492
8493        bind: function( types, data, fn ) {
8494            return this.on( types, null, data, fn );
8495        },
8496        unbind: function( types, fn ) {
8497            return this.off( types, null, fn );
8498        },
8499
8500        delegate: function( selector, types, data, fn ) {
8501            return this.on( types, selector, data, fn );
8502        },
8503        undelegate: function( selector, types, fn ) {
8504            // ( namespace ) or ( selector, types [, fn] )
8505            return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
8506        }
8507    });
8508
8509
8510    var nonce = jQuery.now();
8511
8512    var rquery = (/\?/);
8513
8514
8515
8516    var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
8517
8518    jQuery.parseJSON = function( data ) {
8519        // Attempt to parse using the native JSON parser first
8520        if ( window.JSON && window.JSON.parse ) {
8521            // Support: Android 2.3
8522            // Workaround failure to string-cast null input
8523            return window.JSON.parse( data + "" );
8524        }
8525
8526        var requireNonComma,
8527            depth = null,
8528            str = jQuery.trim( data + "" );
8529
8530        // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
8531        // after removing valid tokens
8532        return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
8533
8534            // Force termination if we see a misplaced comma
8535            if ( requireNonComma && comma ) {
8536                depth = 0;
8537            }
8538
8539            // Perform no more replacements after returning to outermost depth
8540            if ( depth === 0 ) {
8541                return token;
8542            }
8543
8544            // Commas must not follow "[", "{", or ","
8545            requireNonComma = open || comma;
8546
8547            // Determine new depth
8548            // array/object open ("[" or "{"): depth += true - false (increment)
8549            // array/object close ("]" or "}"): depth += false - true (decrement)
8550            // other cases ("," or primitive): depth += true - true (numeric cast)
8551            depth += !close - !open;
8552
8553            // Remove this token
8554            return "";
8555        }) ) ?
8556            ( Function( "return " + str ) )() :
8557            jQuery.error( "Invalid JSON: " + data );
8558    };
8559
8560
8561// Cross-browser xml parsing
8562    jQuery.parseXML = function( data ) {
8563        var xml, tmp;
8564        if ( !data || typeof data !== "string" ) {
8565            return null;
8566        }
8567        try {
8568            if ( window.DOMParser ) { // Standard
8569                tmp = new DOMParser();
8570                xml = tmp.parseFromString( data, "text/xml" );
8571            } else { // IE
8572                xml = new ActiveXObject( "Microsoft.XMLDOM" );
8573                xml.async = "false";
8574                xml.loadXML( data );
8575            }
8576        } catch( e ) {
8577            xml = undefined;
8578        }
8579        if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
8580            jQuery.error( "Invalid XML: " + data );
8581        }
8582        return xml;
8583    };
8584
8585
8586    var
8587    // Document location
8588        ajaxLocParts,
8589        ajaxLocation,
8590
8591        rhash = /#.*$/,
8592        rts = /([?&])_=[^&]*/,
8593        rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
8594    // #7653, #8125, #8152: local protocol detection
8595        rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8596        rnoContent = /^(?:GET|HEAD)$/,
8597        rprotocol = /^\/\//,
8598        rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
8599
8600    /* Prefilters
8601     * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8602     * 2) These are called:
8603     *    - BEFORE asking for a transport
8604     *    - AFTER param serialization (s.data is a string if s.processData is true)
8605     * 3) key is the dataType
8606     * 4) the catchall symbol "*" can be used
8607     * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8608     */
8609        prefilters = {},
8610
8611    /* Transports bindings
8612     * 1) key is the dataType
8613     * 2) the catchall symbol "*" can be used
8614     * 3) selection will start with transport dataType and THEN go to "*" if needed
8615     */
8616        transports = {},
8617
8618    // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8619        allTypes = "*/".concat("*");
8620
8621// #8138, IE may throw an exception when accessing
8622// a field from window.location if document.domain has been set
8623    try {
8624        ajaxLocation = location.href;
8625    } catch( e ) {
8626        // Use the href attribute of an A element
8627        // since IE will modify it given document.location
8628        ajaxLocation = document.createElement( "a" );
8629        ajaxLocation.href = "";
8630        ajaxLocation = ajaxLocation.href;
8631    }
8632
8633// Segment location into parts
8634    ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
8635
8636// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8637    function addToPrefiltersOrTransports( structure ) {
8638
8639        // dataTypeExpression is optional and defaults to "*"
8640        return function( dataTypeExpression, func ) {
8641
8642            if ( typeof dataTypeExpression !== "string" ) {
8643                func = dataTypeExpression;
8644                dataTypeExpression = "*";
8645            }
8646
8647            var dataType,
8648                i = 0,
8649                dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
8650
8651            if ( jQuery.isFunction( func ) ) {
8652                // For each dataType in the dataTypeExpression
vendor: 11,165 bytes, lines 8653-8971
8653                while ( (dataType = dataTypes[i++]) ) {
8654                    // Prepend if requested
8655                    if ( dataType.charAt( 0 ) === "+" ) {
8656                        dataType = dataType.slice( 1 ) || "*";
8657                        (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
8658
8659                        // Otherwise append
8660                    } else {
8661                        (structure[ dataType ] = structure[ dataType ] || []).push( func );
8662                    }
8663                }
8664            }
8665        };
8666    }
8667
8668// Base inspection function for prefilters and transports
8669    function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8670
8671        var inspected = {},
8672            seekingTransport = ( structure === transports );
8673
8674        function inspect( dataType ) {
8675            var selected;
8676            inspected[ dataType ] = true;
8677            jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
8678                var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8679                if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8680                    options.dataTypes.unshift( dataTypeOrTransport );
8681                    inspect( dataTypeOrTransport );
8682                    return false;
8683                } else if ( seekingTransport ) {
8684                    return !( selected = dataTypeOrTransport );
8685                }
8686            });
8687            return selected;
8688        }
8689
8690        return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
8691    }
8692
8693// A special extend for ajax options
8694// that takes "flat" options (not to be deep extended)
8695// Fixes #9887
8696    function ajaxExtend( target, src ) {
8697        var deep, key,
8698            flatOptions = jQuery.ajaxSettings.flatOptions || {};
8699
8700        for ( key in src ) {
8701            if ( src[ key ] !== undefined ) {
8702                ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
8703            }
8704        }
8705        if ( deep ) {
8706            jQuery.extend( true, target, deep );
8707        }
8708
8709        return target;
8710    }
8711
8712    /* Handles responses to an ajax request:
8713     * - finds the right dataType (mediates between content-type and expected dataType)
8714     * - returns the corresponding response
8715     */
8716    function ajaxHandleResponses( s, jqXHR, responses ) {
8717        var firstDataType, ct, finalDataType, type,
8718            contents = s.contents,
8719            dataTypes = s.dataTypes;
8720
8721        // Remove auto dataType and get content-type in the process
8722        while ( dataTypes[ 0 ] === "*" ) {
8723            dataTypes.shift();
8724            if ( ct === undefined ) {
8725                ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
8726            }
8727        }
8728
8729        // Check if we're dealing with a known content-type
8730        if ( ct ) {
8731            for ( type in contents ) {
8732                if ( contents[ type ] && contents[ type ].test( ct ) ) {
8733                    dataTypes.unshift( type );
8734                    break;
8735                }
8736            }
8737        }
8738
8739        // Check to see if we have a response for the expected dataType
8740        if ( dataTypes[ 0 ] in responses ) {
8741            finalDataType = dataTypes[ 0 ];
8742        } else {
8743            // Try convertible dataTypes
8744            for ( type in responses ) {
8745                if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
8746                    finalDataType = type;
8747                    break;
8748                }
8749                if ( !firstDataType ) {
8750                    firstDataType = type;
8751                }
8752            }
8753            // Or just use first one
8754            finalDataType = finalDataType || firstDataType;
8755        }
8756
8757        // If we found a dataType
8758        // We add the dataType to the list if needed
8759        // and return the corresponding response
8760        if ( finalDataType ) {
8761            if ( finalDataType !== dataTypes[ 0 ] ) {
8762                dataTypes.unshift( finalDataType );
8763            }
8764            return responses[ finalDataType ];
8765        }
8766    }
8767
8768    /* Chain conversions given the request and the original response
8769     * Also sets the responseXXX fields on the jqXHR instance
8770     */
8771    function ajaxConvert( s, response, jqXHR, isSuccess ) {
8772        var conv2, current, conv, tmp, prev,
8773            converters = {},
8774        // Work with a copy of dataTypes in case we need to modify it for conversion
8775            dataTypes = s.dataTypes.slice();
8776
8777        // Create converters map with lowercased keys
8778        if ( dataTypes[ 1 ] ) {
8779            for ( conv in s.converters ) {
8780                converters[ conv.toLowerCase() ] = s.converters[ conv ];
8781            }
8782        }
8783
8784        current = dataTypes.shift();
8785
8786        // Convert to each sequential dataType
8787        while ( current ) {
8788
8789            if ( s.responseFields[ current ] ) {
8790                jqXHR[ s.responseFields[ current ] ] = response;
8791            }
8792
8793            // Apply the dataFilter if provided
8794            if ( !prev && isSuccess && s.dataFilter ) {
8795                response = s.dataFilter( response, s.dataType );
8796            }
8797
8798            prev = current;
8799            current = dataTypes.shift();
8800
8801            if ( current ) {
8802
8803                // There's only work to do if current dataType is non-auto
8804                if ( current === "*" ) {
8805
8806                    current = prev;
8807
8808                    // Convert response if prev dataType is non-auto and differs from current
8809                } else if ( prev !== "*" && prev !== current ) {
8810
8811                    // Seek a direct converter
8812                    conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8813
8814                    // If none found, seek a pair
8815                    if ( !conv ) {
8816                        for ( conv2 in converters ) {
8817
8818                            // If conv2 outputs current
8819                            tmp = conv2.split( " " );
8820                            if ( tmp[ 1 ] === current ) {
8821
8822                                // If prev can be converted to accepted input
8823                                conv = converters[ prev + " " + tmp[ 0 ] ] ||
8824                                    converters[ "* " + tmp[ 0 ] ];
8825                                if ( conv ) {
8826                                    // Condense equivalence converters
8827                                    if ( conv === true ) {
8828                                        conv = converters[ conv2 ];
8829
8830                                        // Otherwise, insert the intermediate dataType
8831                                    } else if ( converters[ conv2 ] !== true ) {
8832                                        current = tmp[ 0 ];
8833                                        dataTypes.unshift( tmp[ 1 ] );
8834                                    }
8835                                    break;
8836                                }
8837                            }
8838                        }
8839                    }
8840
8841                    // Apply converter (if not an equivalence)
8842                    if ( conv !== true ) {
8843
8844                        // Unless errors are allowed to bubble, catch and return them
8845                        if ( conv && s[ "throws" ] ) {
8846                            response = conv( response );
8847                        } else {
8848                            try {
8849                                response = conv( response );
8850                            } catch ( e ) {
8851                                return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
8852                            }
8853                        }
8854                    }
8855                }
8856            }
8857        }
8858
8859        return { state: "success", data: response };
8860    }
8861
8862    jQuery.extend({
8863
8864        // Counter for holding the number of active queries
8865        active: 0,
8866
8867        // Last-Modified header cache for next request
8868        lastModified: {},
8869        etag: {},
8870
8871        ajaxSettings: {
8872            url: ajaxLocation,
8873            type: "GET",
8874            isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
8875            global: true,
8876            processData: true,
8877            async: true,
8878            contentType: "application/x-www-form-urlencoded; charset=UTF-8",
8879            /*
8880             timeout: 0,
8881             data: null,
8882             dataType: null,
8883             username: null,
8884             password: null,
8885             cache: null,
8886             throws: false,
8887             traditional: false,
8888             headers: {},
8889             */
8890
8891            accepts: {
8892                "*": allTypes,
8893                text: "text/plain",
8894                html: "text/html",
8895                xml: "application/xml, text/xml",
8896                json: "application/json, text/javascript"
8897            },
8898
8899            contents: {
8900                xml: /xml/,
8901                html: /html/,
8902                json: /json/
8903            },
8904
8905            responseFields: {
8906                xml: "responseXML",
8907                text: "responseText",
8908                json: "responseJSON"
8909            },
8910
8911            // Data converters
8912            // Keys separate source (or catchall "*") and destination types with a single space
8913            converters: {
8914
8915                // Convert anything to text
8916                "* text": String,
8917
8918                // Text to html (true = no transformation)
8919                "text html": true,
8920
8921                // Evaluate text as a json expression
8922                "text json": jQuery.parseJSON,
8923
8924                // Parse text as xml
8925                "text xml": jQuery.parseXML
8926            },
8927
8928            // For options that shouldn't be deep extended:
8929            // you can add your own custom options here if
8930            // and when you create one that shouldn't be
8931            // deep extended (see ajaxExtend)
8932            flatOptions: {
8933                url: true,
8934                context: true
8935            }
8936        },
8937
8938        // Creates a full fledged settings object into target
8939        // with both ajaxSettings and settings fields.
8940        // If target is omitted, writes into ajaxSettings.
8941        ajaxSetup: function( target, settings ) {
8942            return settings ?
8943
8944                // Building a settings object
8945                ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
8946
8947                // Extending ajaxSettings
8948                ajaxExtend( jQuery.ajaxSettings, target );
8949        },
8950
8951        ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
8952        ajaxTransport: addToPrefiltersOrTransports( transports ),
8953
8954        // Main method
8955        ajax: function( url, options ) {
8956
8957            // If url is an object, simulate pre-1.5 signature
8958            if ( typeof url === "object" ) {
8959                options = url;
8960                url = undefined;
8961            }
8962
8963            // Force options to be an object
8964            options = options || {};
8965
8966            var // Cross-domain detection vars
8967                parts,
8968            // Loop variable
8969                i,
8970            // URL without anti-cache param
8971                cacheURL,
8972            // Response headers as string
8973                responseHeadersString,
8974            // timeout handle
8975                timeoutTimer,
8976
8977            // To know if global events are to be dispatched
8978                fireGlobals,
8979
8980                transport,
8981            // Response headers
8982                responseHeaders,
8983            // Create the final options object
8984                s = jQuery.ajaxSetup( {}, options ),
8985            // Callbacks context
8986                callbackContext = s.context || s,
8987            // Context for global events is callbackContext if it is a DOM node or jQuery collection
8988                globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
8989                    jQuery( callbackContext ) :
8990                    jQuery.event,
8991            // Deferreds
8992                deferred = jQuery.Deferred(),
8993                completeDeferred = jQuery.Callbacks("once memory"),
8994            // Status-dependent callbacks
8995                statusCode = s.statusCode || {},
8996            // Headers (they are sent all at once)
8997                requestHeaders = {},
8998                requestHeadersNames = {},
8999            // The jqXHR state
9000                state = 0,
9001            // Default abort message
9002                strAbort = "canceled",
9003            // Fake xhr
9004                jqXHR = {
9005                    readyState: 0,
9006
9007                    // Builds headers hashtable if needed
9008                    getResponseHeader: function( key ) {
9009                        var match;
9010                        if ( state === 2 ) {
9011                            if ( !responseHeaders ) {
9012                                responseHeaders = {};
9013                                while ( (match = rheaders.exec( responseHeadersString )) ) {
9014                                    responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
9015                                }
9016                            }
9017                            match = responseHeaders[ key.toLowerCase() ];
9018                        }
9019                        return match == null ? null : match;
9020                    },
9021
9022                    // Raw string
9023                    getAllResponseHeaders: function() {
9024                        return state === 2 ? responseHeadersString : null;
9025                    },
9026
9027                    // Caches the header
9028                    setRequestHeader: function( name, value ) {
9029                        var lname = name.toLowerCase();
9030                        if ( !state ) {
9031                            name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
9032                            requestHeaders[ name ] = value;
9033                        }
9034                        return this;
9035                    },
9036
9037                    // Overrides response content-type header
9038                    overrideMimeType: function( type ) {
9039                        if ( !state ) {
9040                            s.mimeType = type;
9041                        }
9042                        return this;
9043                    },
9044
9045                    // Status-dependent callbacks
9046                    statusCode: function( map ) {
9047                        var code;
9048                        if ( map ) {
9049                            if ( state < 2 ) {
9050                                for ( code in map ) {
9051                                    // Lazy-add the new callback in a way that preserves old ones
9052                                    statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
9053                                }
9054                            } else {
9055                                // Execute the appropriate callbacks
9056                                jqXHR.always( map[ jqXHR.status ] );
9057                            }
9058                        }
9059                        return this;
9060                    },
9061
9062                    // Cancel the request
9063                    abort: function( statusText ) {
9064                        var finalText = statusText || strAbort;
9065                        if ( transport ) {
9066                            transport.abort( finalText );
9067                        }
9068                        done( 0, finalText );
9069                        return this;
9070                    }
9071                };
9072
9073            // Attach deferreds
9074            deferred.promise( jqXHR ).complete = completeDeferred.add;
9075            jqXHR.success = jqXHR.done;
9076            jqXHR.error = jqXHR.fail;
9077
9078            // Remove hash character (#7531: and string promotion)
9079            // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
9080            // Handle falsy url in the settings object (#10093: consistency with old signature)
9081            // We also use the url parameter if available
9082            s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
9083
9084            // Alias method option to type as per ticket #12004
9085            s.type = options.method || options.type || s.method || s.type;
9086
9087            // Extract dataTypes list
9088            s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
9089
9090            // A cross-domain request is in order when we have a protocol:host:port mismatch
9091            if ( s.crossDomain == null ) {
9092                parts = rurl.exec( s.url.toLowerCase() );
9093                s.crossDomain = !!( parts &&
9094                    ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
9095                        ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
9096                        ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
9097                    );
9098            }
9099
9100            // Convert data if not already a string
9101            if ( s.data && s.processData && typeof s.data !== "string" ) {
9102                s.data = jQuery.param( s.data, s.traditional );
9103            }
9104
9105            // Apply prefilters
9106            inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
9107
9108            // If request was aborted inside a prefilter, stop there
9109            if ( state === 2 ) {
9110                return jqXHR;
9111            }
9112
9113            // We can fire global events as of now if asked to
9114            fireGlobals = s.global;
9115
9116            // Watch for a new set of requests
9117            if ( fireGlobals && jQuery.active++ === 0 ) {
9118                jQuery.event.trigger("ajaxStart");
9119            }
9120
9121            // Uppercase the type
9122            s.type = s.type.toUpperCase();
9123
9124            // Determine if request has content
9125            s.hasContent = !rnoContent.test( s.type );
9126
9127            // Save the URL in case we're toying with the If-Modified-Since
9128            // and/or If-None-Match header later on
9129            cacheURL = s.url;
9130
9131            // More options handling for requests with no content
9132            if ( !s.hasContent ) {
9133
9134                // If data is available, append data to url
9135                if ( s.data ) {
vendor: 11,465 bytes, lines 9136-9461
9136                    cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
9137                    // #9682: remove data so that it's not used in an eventual retry
9138                    delete s.data;
9139                }
9140
9141                // Add anti-cache in url if needed
9142                if ( s.cache === false ) {
9143                    s.url = rts.test( cacheURL ) ?
9144
9145                        // If there is already a '_' parameter, set its value
9146                        cacheURL.replace( rts, "$1_=" + nonce++ ) :
9147
9148                        // Otherwise add one to the end
9149                        cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
9150                }
9151            }
9152
9153            // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9154            if ( s.ifModified ) {
9155                if ( jQuery.lastModified[ cacheURL ] ) {
9156                    jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
9157                }
9158                if ( jQuery.etag[ cacheURL ] ) {
9159                    jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
9160                }
9161            }
9162
9163            // Set the correct header, if data is being sent
9164            if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
9165                jqXHR.setRequestHeader( "Content-Type", s.contentType );
9166            }
9167
9168            // Set the Accepts header for the server, depending on the dataType
9169            jqXHR.setRequestHeader(
9170                "Accept",
9171                    s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
9172                    s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
9173                    s.accepts[ "*" ]
9174            );
9175
9176            // Check for headers option
9177            for ( i in s.headers ) {
9178                jqXHR.setRequestHeader( i, s.headers[ i ] );
9179            }
9180
9181            // Allow custom headers/mimetypes and early abort
9182            if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
9183                // Abort if not done already and return
9184                return jqXHR.abort();
9185            }
9186
9187            // aborting is no longer a cancellation
9188            strAbort = "abort";
9189
9190            // Install callbacks on deferreds
9191            for ( i in { success: 1, error: 1, complete: 1 } ) {
9192                jqXHR[ i ]( s[ i ] );
9193            }
9194
9195            // Get transport
9196            transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
9197
9198            // If no transport, we auto-abort
9199            if ( !transport ) {
9200                done( -1, "No Transport" );
9201            } else {
9202                jqXHR.readyState = 1;
9203
9204                // Send global event
9205                if ( fireGlobals ) {
9206                    globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
9207                }
9208                // Timeout
9209                if ( s.async && s.timeout > 0 ) {
9210                    timeoutTimer = setTimeout(function() {
9211                        jqXHR.abort("timeout");
9212                    }, s.timeout );
9213                }
9214
9215                try {
9216                    state = 1;
9217                    transport.send( requestHeaders, done );
9218                } catch ( e ) {
9219                    // Propagate exception as error if not done
9220                    if ( state < 2 ) {
9221                        done( -1, e );
9222                        // Simply rethrow otherwise
9223                    } else {
9224                        throw e;
9225                    }
9226                }
9227            }
9228
9229            // Callback for when everything is done
9230            function done( status, nativeStatusText, responses, headers ) {
9231                var isSuccess, success, error, response, modified,
9232                    statusText = nativeStatusText;
9233
9234                // Called once
9235                if ( state === 2 ) {
9236                    return;
9237                }
9238
9239                // State is "done" now
9240                state = 2;
9241
9242                // Clear timeout if it exists
9243                if ( timeoutTimer ) {
9244                    clearTimeout( timeoutTimer );
9245                }
9246
9247                // Dereference transport for early garbage collection
9248                // (no matter how long the jqXHR object will be used)
9249                transport = undefined;
9250
9251                // Cache response headers
9252                responseHeadersString = headers || "";
9253
9254                // Set readyState
9255                jqXHR.readyState = status > 0 ? 4 : 0;
9256
9257                // Determine if successful
9258                isSuccess = status >= 200 && status < 300 || status === 304;
9259
9260                // Get response data
9261                if ( responses ) {
9262                    response = ajaxHandleResponses( s, jqXHR, responses );
9263                }
9264
9265                // Convert no matter what (that way responseXXX fields are always set)
9266                response = ajaxConvert( s, response, jqXHR, isSuccess );
9267
9268                // If successful, handle type chaining
9269                if ( isSuccess ) {
9270
9271                    // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9272                    if ( s.ifModified ) {
9273                        modified = jqXHR.getResponseHeader("Last-Modified");
9274                        if ( modified ) {
9275                            jQuery.lastModified[ cacheURL ] = modified;
9276                        }
9277                        modified = jqXHR.getResponseHeader("etag");
9278                        if ( modified ) {
9279                            jQuery.etag[ cacheURL ] = modified;
9280                        }
9281                    }
9282
9283                    // if no content
9284                    if ( status === 204 || s.type === "HEAD" ) {
9285                        statusText = "nocontent";
9286
9287                        // if not modified
9288                    } else if ( status === 304 ) {
9289                        statusText = "notmodified";
9290
9291                        // If we have data, let's convert it
9292                    } else {
9293                        statusText = response.state;
9294                        success = response.data;
9295                        error = response.error;
9296                        isSuccess = !error;
9297                    }
9298                } else {
9299                    // We extract error from statusText
9300                    // then normalize statusText and status for non-aborts
9301                    error = statusText;
9302                    if ( status || !statusText ) {
9303                        statusText = "error";
9304                        if ( status < 0 ) {
9305                            status = 0;
9306                        }
9307                    }
9308                }
9309
9310                // Set data for the fake xhr object
9311                jqXHR.status = status;
9312                jqXHR.statusText = ( nativeStatusText || statusText ) + "";
9313
9314                // Success/Error
9315                if ( isSuccess ) {
9316                    deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
9317                } else {
9318                    deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
9319                }
9320
9321                // Status-dependent callbacks
9322                jqXHR.statusCode( statusCode );
9323                statusCode = undefined;
9324
9325                if ( fireGlobals ) {
9326                    globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
9327                        [ jqXHR, s, isSuccess ? success : error ] );
9328                }
9329
9330                // Complete
9331                completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
9332
9333                if ( fireGlobals ) {
9334                    globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
9335                    // Handle the global AJAX counter
9336                    if ( !( --jQuery.active ) ) {
9337                        jQuery.event.trigger("ajaxStop");
9338                    }
9339                }
9340            }
9341
9342            return jqXHR;
9343        },
9344
9345        getJSON: function( url, data, callback ) {
9346            return jQuery.get( url, data, callback, "json" );
9347        },
9348
9349        getScript: function( url, callback ) {
9350            return jQuery.get( url, undefined, callback, "script" );
9351        }
9352    });
9353
9354    jQuery.each( [ "get", "post" ], function( i, method ) {
9355        jQuery[ method ] = function( url, data, callback, type ) {
9356            // shift arguments if data argument was omitted
9357            if ( jQuery.isFunction( data ) ) {
9358                type = type || callback;
9359                callback = data;
9360                data = undefined;
9361            }
9362
9363            return jQuery.ajax({
9364                url: url,
9365                type: method,
9366                dataType: type,
9367                data: data,
9368                success: callback
9369            });
9370        };
9371    });
9372
9373// Attach a bunch of functions for handling common AJAX events
9374    jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
9375        jQuery.fn[ type ] = function( fn ) {
9376            return this.on( type, fn );
9377        };
9378    });
9379
9380
9381    jQuery._evalUrl = function( url ) {
9382        return jQuery.ajax({
9383            url: url,
9384            type: "GET",
9385            dataType: "script",
9386            async: false,
9387            global: false,
9388            "throws": true
9389        });
9390    };
9391
9392
9393    jQuery.fn.extend({
9394        wrapAll: function( html ) {
9395            if ( jQuery.isFunction( html ) ) {
9396                return this.each(function(i) {
9397                    jQuery(this).wrapAll( html.call(this, i) );
9398                });
9399            }
9400
9401            if ( this[0] ) {
9402                // The elements to wrap the target around
9403                var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
9404
9405                if ( this[0].parentNode ) {
9406                    wrap.insertBefore( this[0] );
9407                }
9408
9409                wrap.map(function() {
9410                    var elem = this;
9411
9412                    while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
9413                        elem = elem.firstChild;
9414                    }
9415
9416                    return elem;
9417                }).append( this );
9418            }
9419
9420            return this;
9421        },
9422
9423        wrapInner: function( html ) {
9424            if ( jQuery.isFunction( html ) ) {
9425                return this.each(function(i) {
9426                    jQuery(this).wrapInner( html.call(this, i) );
9427                });
9428            }
9429
9430            return this.each(function() {
9431                var self = jQuery( this ),
9432                    contents = self.contents();
9433
9434                if ( contents.length ) {
9435                    contents.wrapAll( html );
9436
9437                } else {
9438                    self.append( html );
9439                }
9440            });
9441        },
9442
9443        wrap: function( html ) {
9444            var isFunction = jQuery.isFunction( html );
9445
9446            return this.each(function(i) {
9447                jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
9448            });
9449        },
9450
9451        unwrap: function() {
9452            return this.parent().each(function() {
9453                if ( !jQuery.nodeName( this, "body" ) ) {
9454                    jQuery( this ).replaceWith( this.childNodes );
9455                }
9456            }).end();
9457        }
9458    });
9459
9460
9461    jQuery.expr.filters.hidden = function( elem ) {
9462        // Support: Opera <= 12.12
9463        // Opera reports offsetWidths and offsetHeights less than zero on some elements
9464        return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
9465            (!support.reliableHiddenOffsets() &&
9466                ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
9467    };
9468
9469    jQuery.expr.filters.visible = function( elem ) {
9470        return !jQuery.expr.filters.hidden( elem );
9471    };
9472
9473
9474
9475
9476    var r20 = /%20/g,
9477        rbracket = /\[\]$/,
9478        rCRLF = /\r?\n/g,
9479        rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
9480        rsubmittable = /^(?:input|select|textarea|keygen)/i;
9481
9482    function buildParams( prefix, obj, traditional, add ) {
9483        var name;
9484
9485        if ( jQuery.isArray( obj ) ) {
9486            // Serialize array item.
9487            jQuery.each( obj, function( i, v ) {
9488                if ( traditional || rbracket.test( prefix ) ) {
9489                    // Treat each array item as a scalar.
9490                    add( prefix, v );
9491
9492                } else {
9493                    // Item is non-scalar (array or object), encode its numeric index.
9494                    buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
9495                }
9496            });
9497
9498        } else if ( !traditional && jQuery.type( obj ) === "object" ) {
9499            // Serialize object item.
9500            for ( name in obj ) {
9501                buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
9502            }
9503
9504        } else {
9505            // Serialize scalar item.
9506            add( prefix, obj );
9507        }
9508    }
9509
9510// Serialize an array of form elements or a set of
9511// key/values into a query string
9512    jQuery.param = function( a, traditional ) {
9513        var prefix,
9514            s = [],
9515            add = function( key, value ) {
9516                // If value is a function, invoke it and return its value
9517                value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
9518                s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
9519            };
9520
9521        // Set traditional to true for jQuery <= 1.3.2 behavior.
9522        if ( traditional === undefined ) {
9523            traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
9524        }
9525
9526        // If an array was passed in, assume that it is an array of form elements.
9527        if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
9528            // Serialize the form elements
9529            jQuery.each( a, function() {
9530                add( this.name, this.value );
9531            });
9532
9533        } else {
9534            // If traditional, encode the "old" way (the way 1.3.2 or older
9535            // did it), otherwise encode params recursively.
9536            for ( prefix in a ) {
9537                buildParams( prefix, a[ prefix ], traditional, add );
9538            }
9539        }
9540
9541        // Return the resulting serialization
9542        return s.join( "&" ).replace( r20, "+" );
9543    };
9544
9545    jQuery.fn.extend({
9546        serialize: function() {
9547            return jQuery.param( this.serializeArray() );
9548        },
9549        serializeArray: function() {
9550            return this.map(function() {
9551                // Can add propHook for "elements" to filter or add form elements
9552                var elements = jQuery.prop( this, "elements" );
9553                return elements ? jQuery.makeArray( elements ) : this;
9554            })
9555                .filter(function() {
9556                    var type = this.type;
9557                    // Use .is(":disabled") so that fieldset[disabled] works
9558                    return this.name && !jQuery( this ).is( ":disabled" ) &&
9559                        rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
9560                        ( this.checked || !rcheckableType.test( type ) );
9561                })
9562                .map(function( i, elem ) {
9563                    var val = jQuery( this ).val();
9564
9565                    return val == null ?
9566                        null :
9567                        jQuery.isArray( val ) ?
9568                            jQuery.map( val, function( val ) {
9569                                return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
9570                            }) :
9571                        { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
9572                }).get();
9573        }
9574    });
9575
9576
9577// Create the request object
9578// (This is still attached to ajaxSettings for backward compatibility)
9579    jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
9580        // Support: IE6+
9581        function() {
9582
9583            // XHR cannot access local files, always use ActiveX for that case
9584            return !this.isLocal &&
9585
9586                // Support: IE7-8
9587                // oldIE XHR does not support non-RFC2616 methods (#13240)
9588                // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
9589                // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
9590                // Although this check for six methods instead of eight
9591                // since IE also does not support "trace" and "connect"
9592                /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
9593
9594                createStandardXHR() || createActiveXHR();
9595        } :
9596        // For all other browsers, use the standard XMLHttpRequest object
9597        createStandardXHR;
9598
9599    var xhrId = 0,
9600        xhrCallbacks = {},
9601        xhrSupported = jQuery.ajaxSettings.xhr();
9602
9603// Support: IE<10
9604// Open requests must be manually aborted on unload (#5280)
9605    if ( window.ActiveXObject ) {
9606        jQuery( window ).on( "unload", function() {
9607            for ( var key in xhrCallbacks ) {
9608                xhrCallbacks[ key ]( undefined, true );
9609            }
9610        });
9611    }
9612
9613// Determine support properties
9614    support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
9615    xhrSupported = support.ajax = !!xhrSupported;
9616
9617// Create transport if the browser can provide an xhr
9618    if ( xhrSupported ) {
9619
9620        jQuery.ajaxTransport(function( options ) {
9621            // Cross domain only allowed if supported through XMLHttpRequest
9622            if ( !options.crossDomain || support.cors ) {
9623
9624                var callback;
9625
9626                return {
9627                    send: function( headers, complete ) {
9628                        var i,
9629                            xhr = options.xhr(),
9630                            id = ++xhrId;
9631
9632                        // Open the socket
9633                        xhr.open( options.type, options.url, options.async, options.username, options.password );
9634
9635                        // Apply custom fields if provided
9636                        if ( options.xhrFields ) {
9637                            for ( i in options.xhrFields ) {
9638                                xhr[ i ] = options.xhrFields[ i ];
9639                            }
9640                        }
9641
9642                        // Override mime type if needed
9643                        if ( options.mimeType && xhr.overrideMimeType ) {
9644                            xhr.overrideMimeType( options.mimeType );
9645                        }
9646
9647                        // X-Requested-With header
9648                        // For cross-domain requests, seeing as conditions for a preflight are
9649                        // akin to a jigsaw puzzle, we simply never set it to be sure.
9650                        // (it can always be set on a per-request basis or even using ajaxSetup)
9651                        // For same-domain requests, won't change header if already provided.
9652                        if ( !options.crossDomain && !headers["X-Requested-With"] ) {
9653                            headers["X-Requested-With"] = "XMLHttpRequest";
9654                        }
9655
9656                        // Set headers
9657                        for ( i in headers ) {
9658                            // Support: IE<9
9659                            // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
9660                            // request header to a null-value.
9661                            //
9662                            // To keep consistent with other XHR implementations, cast the value
9663                            // to string and ignore `undefined`.
9664                            if ( headers[ i ] !== undefined ) {
9665                                xhr.setRequestHeader( i, headers[ i ] + "" );
9666                            }
9667                        }
9668
9669                        // Do send the request
9670                        // This may raise an exception which is actually
9671                        // handled in jQuery.ajax (so no try/catch here)
9672                        xhr.send( ( options.hasContent && options.data ) || null );
9673
9674                        // Listener
9675                        callback = function( _, isAbort ) {
9676                            var status, statusText, responses;
9677
9678                            // Was never called and is aborted or complete
9679                            if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
9680                                // Clean up
9681                                delete xhrCallbacks[ id ];
9682                                callback = undefined;
9683                                xhr.onreadystatechange = jQuery.noop;
9684
9685                                // Abort manually if needed
9686                                if ( isAbort ) {
9687                                    if ( xhr.readyState !== 4 ) {
9688                                        xhr.abort();
9689                                    }
9690                                } else {
9691                                    responses = {};
9692                                    status = xhr.status;
9693
9694                                    // Support: IE<10
9695                                    // Accessing binary-data responseText throws an exception
9696                                    // (#11426)
9697                                    if ( typeof xhr.responseText === "string" ) {
9698                                        responses.text = xhr.responseText;
9699                                    }
9700
9701                                    // Firefox throws an exception when accessing
9702                                    // statusText for faulty cross-domain requests
9703                                    try {
9704                                        statusText = xhr.statusText;
9705                                    } catch( e ) {
9706                                        // We normalize with Webkit giving an empty statusText
9707                                        statusText = "";
9708                                    }
9709
9710                                    // Filter status for non standard behaviors
9711
9712                                    // If the request is local and we have data: assume a success
9713                                    // (success with no data won't get notified, that's the best we
9714                                    // can do given current implementations)
9715                                    if ( !status && options.isLocal && !options.crossDomain ) {
9716                                        status = responses.text ? 200 : 404;
9717                                        // IE - #1450: sometimes returns 1223 when it should be 204
9718                                    } else if ( status === 1223 ) {
9719                                        status = 204;
9720                                    }
9721                                }
9722                            }
9723
9724                            // Call complete if needed
9725                            if ( responses ) {
9726                                complete( status, statusText, responses, xhr.getAllResponseHeaders() );
9727                            }
9728                        };
9729
9730                        if ( !options.async ) {
9731                            // if we're in sync mode we fire the callback
9732                            callback();
9733                        } else if ( xhr.readyState === 4 ) {
9734                            // (IE6 & IE7) if it's in cache and has been
9735                            // retrieved directly we need to fire the callback
9736                            setTimeout( callback );
9737                        } else {
9738                            // Add to the list of active xhr callbacks
9739                            xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
9740                        }
9741                    },
9742
9743                    abort: function() {
9744                        if ( callback ) {
9745                            callback( undefined, true );
9746                        }
9747                    }
9748                };
9749            }
9750        });
9751    }
9752
9753// Functions to create xhrs
9754    function createStandardXHR() {
9755        try {
9756            return new window.XMLHttpRequest();
9757        } catch( e ) {}
9758    }
9759
9760    function createActiveXHR() {
9761        try {
9762            return new window.ActiveXObject( "Microsoft.XMLHTTP" );
9763        } catch( e ) {}
9764    }
9765
9766
9767
9768
9769// Install script dataType
9770    jQuery.ajaxSetup({
9771        accepts: {
9772            script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
9773        },
9774        contents: {
9775            script: /(?:java|ecma)script/
9776        },
9777        converters: {
9778            "text script": function( text ) {
9779                jQuery.globalEval( text );
9780                return text;
9781            }
9782        }
9783    });
9784
9785// Handle cache's special case and global
9786    jQuery.ajaxPrefilter( "script", function( s ) {
9787        if ( s.cache === undefined ) {
9788            s.cache = false;
9789        }
9790        if ( s.crossDomain ) {
9791            s.type = "GET";
9792            s.global = false;
9793        }
9794    });
9795
9796// Bind script tag hack transport
9797    jQuery.ajaxTransport( "script", function(s) {
9798
9799        // This transport only deals with cross domain requests
9800        if ( s.crossDomain ) {
9801
9802            var script,
9803                head = document.head || jQuery("head")[0] || document.documentElement;
9804
9805            return {
9806
9807                send: function( _, callback ) {
9808
9809                    script = document.createElement("script");
9810
9811                    script.async = true;
9812
9813                    if ( s.scriptCharset ) {
9814                        script.charset = s.scriptCharset;
9815                    }
9816
9817                    script.src = s.url;
9818
9819                    // Attach handlers for all browsers
9820                    script.onload = script.onreadystatechange = function( _, isAbort ) {
9821
9822                        if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
9823
9824                            // Handle memory leak in IE
9825                            script.onload = script.onreadystatechange = null;
9826
9827                            // Remove the script
9828                            if ( script.parentNode ) {
9829                                script.parentNode.removeChild( script );
9830                            }
9831
9832                            // Dereference the script
9833                            script = null;
9834
9835                            // Callback if not abort
9836                            if ( !isAbort ) {
9837                                callback( 200, "success" );
9838                            }
9839                        }
9840                    };
9841
9842                    // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
9843                    // Use native DOM manipulation to avoid our domManip AJAX trickery
9844                    head.insertBefore( script, head.firstChild );
9845                },
9846
9847                abort: function() {
9848                    if ( script ) {
9849                        script.onload( undefined, true );
9850                    }
9851                }
9852            };
9853        }
9854    });
9855
9856
9857
9858
9859    var oldCallbacks = [],
9860        rjsonp = /(=)\?(?=&|$)|\?\?/;
9861
9862// Default jsonp settings
9863    jQuery.ajaxSetup({
9864        jsonp: "callback",
9865        jsonpCallback: function() {
9866            var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
9867            this[ callback ] = true;
9868            return callback;
9869        }
9870    });
9871
9872// Detect, normalize options and install callbacks for jsonp requests
9873    jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
9874
9875        var callbackName, overwritten, responseContainer,
9876            jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
9877                "url" :
9878                typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
9879                );
9880
9881        // Handle iff the expected data type is "jsonp" or we have a parameter to set
9882        if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
9883
9884            // Get callback name, remembering preexisting value associated with it
9885            callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
9886                s.jsonpCallback() :
9887                s.jsonpCallback;
9888
9889            // Insert callback into url or form data
9890            if ( jsonProp ) {
9891                s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
9892            } else if ( s.jsonp !== false ) {
9893                s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
9894            }
9895
9896            // Use data converter to retrieve json after script execution
9897            s.converters["script json"] = function() {
9898                if ( !responseContainer ) {
9899                    jQuery.error( callbackName + " was not called" );
9900                }
9901                return responseContainer[ 0 ];
9902            };
9903
9904            // force json dataType
9905            s.dataTypes[ 0 ] = "json";
9906
9907            // Install callback
9908            overwritten = window[ callbackName ];
9909            window[ callbackName ] = function() {
9910                responseContainer = arguments;
9911            };
9912
9913            // Clean-up function (fires after converters)
9914            jqXHR.always(function() {
9915                // Restore preexisting value
9916                window[ callbackName ] = overwritten;
9917
9918                // Save back as free
9919                if ( s[ callbackName ] ) {
9920                    // make sure that re-using the options doesn't screw things around
9921                    s.jsonpCallback = originalSettings.jsonpCallback;
9922
9923                    // save the callback name for future use
9924                    oldCallbacks.push( callbackName );
9925                }
9926
9927                // Call if it was a function and we have a response
9928                if ( responseContainer && jQuery.isFunction( overwritten ) ) {
9929                    overwritten( responseContainer[ 0 ] );
9930                }
9931
9932                responseContainer = overwritten = undefined;
9933            });
9934
9935            // Delegate to script
9936            return "script";
9937        }
9938    });
9939
9940
9941
9942
9943// data: string of html
9944// context (optional): If specified, the fragment will be created in this context, defaults to document
9945// keepScripts (optional): If true, will include scripts passed in the html string
9946    jQuery.parseHTML = function( data, context, keepScripts ) {
9947        if ( !data || typeof data !== "string" ) {
9948            return null;
9949        }
9950        if ( typeof context === "boolean" ) {
9951            keepScripts = context;
9952            context = false;
9953        }
9954        context = context || document;
9955
9956        var parsed = rsingleTag.exec( data ),
9957            scripts = !keepScripts && [];
9958
9959        // Single tag
9960        if ( parsed ) {
9961            return [ context.createElement( parsed[1] ) ];
9962        }
9963
9964        parsed = jQuery.buildFragment( [ data ], context, scripts );
9965
9966        if ( scripts && scripts.length ) {
9967            jQuery( scripts ).remove();
9968        }
9969
9970        return jQuery.merge( [], parsed.childNodes );
9971    };
9972
9973
9974// Keep a copy of the old load method
9975    var _load = jQuery.fn.load;
9976
9977    /**
9978     * Load a url into a page
9979     */
9980    jQuery.fn.load = function( url, params, callback ) {
9981        if ( typeof url !== "string" && _load ) {
9982            return _load.apply( this, arguments );
9983        }
9984
9985        var selector, response, type,
9986            self = this,
9987            off = url.indexOf(" ");
9988
9989        if ( off >= 0 ) {
9990            selector = url.slice( off, url.length );
9991            url = url.slice( 0, off );
9992        }
9993
9994        // If it's a function
9995        if ( jQuery.isFunction( params ) ) {
9996
9997            // We assume that it's the callback
9998            callback = params;
9999            params = undefined;
10000
10001            // Otherwise, build a param string
10002        } else if ( params && typeof params === "object" ) {
10003            type = "POST";
10004        }
10005
10006        // If we have elements to modify, make the request
10007        if ( self.length > 0 ) {
10008            jQuery.ajax({
10009                url: url,
10010
10011                // if "type" variable is undefined, then "GET" method will be used
10012                type: type,
10013                dataType: "html",
10014                data: params
10015            }).done(function( responseText ) {
10016
10017                // Save response for use in complete callback
10018                response = arguments;
10019
10020                self.html( selector ?
10021
10022                    // If a selector was specified, locate the right elements in a dummy div
10023                    // Exclude scripts to avoid IE 'Permission Denied' errors
10024                    jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
10025
10026                    // Otherwise use the full result
10027                    responseText );
10028
10029            }).complete( callback && function( jqXHR, status ) {
10030                self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
10031            });
10032        }
10033
10034        return this;
10035    };
10036
10037
10038
10039
10040    jQuery.expr.filters.animated = function( elem ) {
10041        return jQuery.grep(jQuery.timers, function( fn ) {
10042            return elem === fn.elem;
10043        }).length;
10044    };
10045
10046
10047
10048
10049
10050    var docElem = window.document.documentElement;
10051
10052    /**
10053     * Gets a window from an element
10054     */
10055    function getWindow( elem ) {
10056        return jQuery.isWindow( elem ) ?
10057            elem :
10058                elem.nodeType === 9 ?
10059            elem.defaultView || elem.parentWindow :
10060            false;
10061    }
10062
10063    jQuery.offset = {
10064        setOffset: function( elem, options, i ) {
10065            var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
10066                position = jQuery.css( elem, "position" ),
10067                curElem = jQuery( elem ),
10068                props = {};
10069
10070            // set position first, in-case top/left are set even on static elem
10071            if ( position === "static" ) {
10072                elem.style.position = "relative";
10073            }
10074
10075            curOffset = curElem.offset();
10076            curCSSTop = jQuery.css( elem, "top" );
10077            curCSSLeft = jQuery.css( elem, "left" );
10078            calculatePosition = ( position === "absolute" || position === "fixed" ) &&
10079                jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
10080
10081            // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
10082            if ( calculatePosition ) {
10083                curPosition = curElem.position();
10084                curTop = curPosition.top;
10085                curLeft = curPosition.left;
10086            } else {
10087                curTop = parseFloat( curCSSTop ) || 0;
10088                curLeft = parseFloat( curCSSLeft ) || 0;
10089            }
10090
10091            if ( jQuery.isFunction( options ) ) {
10092                options = options.call( elem, i, curOffset );
10093            }
10094
10095            if ( options.top != null ) {
10096                props.top = ( options.top - curOffset.top ) + curTop;
10097            }
10098            if ( options.left != null ) {
10099                props.left = ( options.left - curOffset.left ) + curLeft;
10100            }
10101
10102            if ( "using" in options ) {
10103                options.using.call( elem, props );
10104            } else {
10105                curElem.css( props );
10106            }
10107        }
10108    };
10109
10110    jQuery.fn.extend({
10111        offset: function( options ) {
10112            if ( arguments.length ) {
10113                return options === undefined ?
10114                    this :
10115                    this.each(function( i ) {
10116                        jQuery.offset.setOffset( this, options, i );
10117                    });
10118            }
10119
10120            var docElem, win,
10121                box = { top: 0, left: 0 },
10122                elem = this[ 0 ],
10123                doc = elem && elem.ownerDocument;
10124
10125            if ( !doc ) {
10126                return;
10127            }
10128
10129            docElem = doc.documentElement;
10130
10131            // Make sure it's not a disconnected DOM node
10132            if ( !jQuery.contains( docElem, elem ) ) {
10133                return box;
10134            }
10135
10136            // If we don't have gBCR, just use 0,0 rather than error
10137            // BlackBerry 5, iOS 3 (original iPhone)
10138            if ( typeof elem.getBoundingClientRect !== strundefined ) {
10139                box = elem.getBoundingClientRect();
10140            }
10141            win = getWindow( doc );
10142            return {
10143                top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),
10144                left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
10145            };
10146        },
10147
10148        position: function() {
10149            if ( !this[ 0 ] ) {
10150                return;
10151            }
10152
10153            var offsetParent, offset,
10154                parentOffset = { top: 0, left: 0 },
10155                elem = this[ 0 ];
10156
10157            // fixed elements are offset from window (parentOffset = {top:0, left
10157: 0}, because it is its only offset parent
10158            if ( jQuery.css( elem, "position" ) === "fixed" ) {
10159                // we assume that getBoundingClientRect is available when computed position is fixed
10160                offset = elem.getBoundingClientRect();
10161            } else {
10162                // Get *real* offsetParent
10163                offsetParent = this.offsetParent();
10164
10165                // Get correct offsets
10166                offset = this.offset();
10167                if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
10168                    parentOffset = offsetParent.offset();
10169                }
10170
10171                // Add offsetParent borders
10172                parentOffset.top  += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
10173                parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
10174            }
10175
10176            // Subtract parent offsets and element margins
10177            // note: when an element has margin: auto the offsetLeft and marginLeft
10178            // are the same in Safari causing offset.left to incorrectly be 0
10179            return {
10180                top:  offset.top  - parentOffset.top - jQuery.css( elem, "marginTop", true ),
10181                left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
10182            };
10183        },
10184
10185        offsetParent: function() {
10186            return this.map(function() {
10187                var offsetParent = this.offsetParent || docElem;
10188
10189                while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
10190                    offsetParent = offsetParent.offsetParent;
10191                }
10192                return offsetParent || docElem;
10193            });
10194        }
10195    });
10196
10197// Create scrollLeft and scrollTop methods
10198    jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
10199        var top = /Y/.test( prop );
10200
10201        jQuery.fn[ method ] = function( val ) {
10202            return access( this, function( elem, method, val ) {
10203                var win = getWindow( elem );
10204
10205                if ( val === undefined ) {
10206                    return win ? (prop in win) ? win[ prop ] :
10207                        win.document.documentElement[ method ] :
10208                        elem[ method ];
10209                }
10210
10211                if ( win ) {
10212                    win.scrollTo(
10213                        !top ? val : jQuery( win ).scrollLeft(),
10214                        top ? val : jQuery( win ).scrollTop()
10215                    );
10216
10217                } else {
10218                    elem[ method ] = val;
10219                }
10220            }, method, val, arguments.length, null );
10221        };
10222    });
10223
10224// Add the top/left cssHooks using jQuery.fn.position
10225// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
10226// getComputedStyle returns percent when specified for top/left/bottom/right
10227// rather than make the css module depend on the offset module, we just check for it here
10228    jQuery.each( [ "top", "left" ], function( i, prop ) {
10229        jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
10230            function( elem, computed ) {
10231                if ( computed ) {
10232                    computed = curCSS( elem, prop );
10233                    // if curCSS returns percentage, fallback to offset
10234                    return rnumnonpx.test( computed ) ?
10235                        jQuery( elem ).position()[ prop ] + "px" :
10236                        computed;
10237                }
10238            }
10239        );
10240    });
10241
10242
10243// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10244    jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10245        jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
10246            // margin is only for outerHeight, outerWidth
10247            jQuery.fn[ funcName ] = function( margin, value ) {
10248                var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
10249                    extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
10250
10251                return access( this, function( elem, type, value ) {
10252                    var doc;
10253
10254                    if ( jQuery.isWindow( elem ) ) {
10255                        // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
10256                        // isn't a whole lot we can do. See pull request at this URL for discussion:
10257                        // https://github.com/jquery/jquery/pull/764
10258                        return elem.document.documentElement[ "client" + name ];
10259                    }
10260
10261                    // Get document width or height
10262                    if ( elem.nodeType === 9 ) {
10263                        doc = elem.documentElement;
10264
10265                        // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
10266                        // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
10267                        return Math.max(
10268                            elem.body[ "scroll" + name ], doc[ "scroll" + name ],
10269                            elem.body[ "offset" + name ], doc[ "offset" + name ],
10270                            doc[ "client" + name ]
10271                        );
10272                    }
10273
10274                    return value === undefined ?
10275                        // Get width or height on the element, requesting but not forcing parseFloat
10276                        jQuery.css( elem, type, extra ) :
10277
10278                        // Set width or height on the element
10279                        jQuery.style( elem, type, value, extra );
10280                }, type, chainable ? margin : undefined, chainable, null );
10281            };
10282        });
10283    });
10284
10285
10286// The number of elements contained in the matched element set
10287    jQuery.fn.size = function() {
10288        return this.length;
10289    };
10290
10291    jQuery.fn.andSelf = jQuery.fn.addBack;
10292
10293
10294
10295
10296// Register as a named AMD module, since jQuery can be concatenated with other
10297// files that may use define, but not via a proper concatenation script that
10298// understands anonymous AMD modules. A named AMD is safest and most robust
10299// way to register. Lowercase jquery is used because AMD module names are
10300// derived from file names, and jQuery is normally delivered in a lowercase
10301// file name. Do this after creating the global so that if an AMD module wants
10302// to call noConflict to hide this version of jQuery, it will work.
10303    if ( typeof define === "function" && define.amd ) {
10304        define( "jquery", [], function() {
10305            return jQuery;
10306        });
10307    }
10308
10309
10310
10311
10312    var
10313    // Map over jQuery in case of overwrite
10314        _jQuery = window.jQuery,
10315
10316    // Map over the $ in case of overwrite
10317        _$ = window.$;
10318
10319    jQuery.noConflict = function( deep ) {
10320        if ( window.$ === jQuery ) {
10321            window.$ = _$;
10322        }
10323
10324        if ( deep && window.jQuery === jQuery ) {
10325            window.jQuery = _jQuery;
10326        }
10327
10328        return jQuery;
10329    };
10330
10331// Expose jQuery and $ identifiers, even in
10332// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10333// and CommonJS for browser emulators (#13566)
10334    if ( typeof noGlobal === strundefined ) {
10335        window.jQuery = window.$ = jQuery;
10336    }
10337
10338
10339
10340
10341    return jQuery;
10342
10343}));
10344
10345
10346/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
10347 * Build: http://modernizr.com/download/#-backgroundsize-borderradiu
10347s-boxshadow-flexbox-flexboxlegacy-rgba-textshadow-cssanimations-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-touch-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes
10348 */
10349;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.flexbox=function(){return F("flexWrap")},q.flexboxlegacy=function(){return F("boxDirection")},q.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},q.rgba=function(){return z("background-color:rgba(150,255,150,.5)"),C(j.backgroundColor,"rgba")},q.backgroundsize=function(){return F("backgroundSize")}
10349,q.borderradius=function(){return F("borderRadius")},q.boxshadow=function(){return F("boxShadow")},q.textshadow=function(){return b.createElement("div").style.textShadow===""},q.cssanimations=function(){return F("animationName")},q.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return z((a+"-webkit- ".split(" ").join(b+a)+m.join(c+a)).slice(0,-a.length)),C(j.backgroundImage,"gradient")},q.cssreflections=function(){return F("boxReflect")},q.csstransforms=function(){return!!F("transform")},q.csstransforms3d=function(){var a=!!F("perspective");return a&&"webkitPerspective"in g.style&&w("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},q.csstransitions=function(){return F("transition")};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document);
10350/* ========================================================================
10351 * Bootstrap: alert.js v3.1.1
10352 * http://getbootstrap.com/javascript/#alerts
10353 * ========================================================================
10354 * Copyright 2011-2014 Twitter, Inc.
10355 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
10356 * ======================================================================== */
10357
10358
10359+function ($) {
10360  'use strict';
10361
10362  // ALERT CLASS DEFINITION
10363  // ======================
10364
10365  var dismiss = '[data-dismiss="alert"]'
10366  var Alert   = function (el) {
10367    $(el).on('click', dismiss, this.close)
10368  }
10369
10370  Alert.prototype.close = function (e) {
10371    var $this    = $(this)
10372    var selector = $this.attr('data-target')
10373
10374    if (!selector) {
10375      selector = $this.attr('href')
10376      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
10377    }
10378
10379    var $parent = $(selector)
10380
10381    if (e) e.preventDefault()
10382
10383    if (!$parent.length) {
10384      $parent = $this.hasClass('alert') ? $this : $this.parent()
10385    }
10386
10387    $parent.trigger(e = $.Event('close.bs.alert'))
10388
10389    if (e.isDefaultPrevented()) return
10390
10391    $parent.removeClass('in')
10392
10393    function removeElement() {
10394      $parent.trigger('closed.bs.alert').remove()
10395    }
10396
10397    $.support.transition && $parent.hasClass('fade') ?
10398      $parent
10399        .one($.support.transition.end, removeElement)
10400        .emulateTransitionEnd(150) :
10401      removeElement()
10402  }
10403
10404
10405  // ALERT PLUGIN DEFINITION
10406  // =======================
10407
10408  var old = $.fn.alert
10409
10410  $.fn.alert = function (option) {
10411    return this.each(function () {
10412      var $this = $(this)
10413      var data  = $this.data('bs.alert')
10414
10415      if (!data) $this.data('bs.alert', (data = new Alert(this)))
10416      if (typeof option == 'string') data[option].call($this)
10417    })
10418  }
10419
10420  $.fn.alert.Constructor = Alert
10421
10422
10423  // ALERT NO CONFLICT
10424  // =================
10425
10426  $.fn.alert.noConflict = function () {
10427    $.fn.alert = old
10428    return this
10429  }
10430
10431
10432  // ALERT DATA-API
10433  // ==============
10434
10435  $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
10436
10437}(jQuery);
10438
10439/* ========================================================================
10440 * Bootstrap: button.js v3.1.1
10441 * http://getbootstrap.com/javascript/#buttons
10442 * ========================================================================
10443 * Copyright 2011-2014 Twitter, Inc.
10444 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
10445 * ======================================================================== */
10446
10447
10448+function ($) {
10449  'use strict';
10450
10451  // BUTTON PUBLIC CLASS DEFINITION
10452  // ==============================
10453
10454  var Button = function (element, options) {
10455    this.$element  = $(element)
10456    this.options   = $.extend({}, Button.DEFAULTS, options)
10457    this.isLoading = false
10458  }
10459
10460  Button.DEFAULTS = {
10461    loadingText: 'loading...'
10462  }
10463
10464  Button.prototype.setState = function (state) {
10465    var d    = 'disabled'
10466    var $el  = this.$element
10467    var val  = $el.is('input') ? 'val' : 'html'
10468    var data = $el.data()
10469
10470    state = state + 'Text'
10471
10472    if (!data.resetText) $el.data('resetText', $el[val]())
10473
10474    $el[val](data[state] || this.options[state])
10475
10476    // push to event loop to allow forms to submit
10477    setTimeout($.proxy(function () {
10478      if (state == 'loadingText') {
10479        this.isLoading = true
10480        $el.addClass(d).attr(d, d)
10481      } else if (this.isLoading) {
10482        this.isLoading = false
10483        $el.removeClass(d).removeAttr(d)
10484      }
10485    }, this), 0)
10486  }
10487
10488  Button.prototype.toggle = function () {
10489    var changed = true
10490    var $parent = this.$element.closest('[data-toggle="buttons"]')
10491
10492    if ($parent.length) {
10493      var $input = this.$element.find('input')
10494      if ($input.prop('type') == 'radio') {
10495        if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
10496        else $parent.find('.active').removeClass('active')
10497      }
10498      if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
10499    }
10500
10501    if (changed) this.$element.toggleClass('active')
10502  }
10503
10504
10505  // BUTTON PLUGIN DEFINITION
10506  // ========================
10507
10508  var old = $.fn.button
10509
10510  $.fn.button = function (option) {
10511    return this.each(function () {
10512      var $this   = $(this)
10513      var data    = $this.data('bs.button')
10514      var options = typeof option == 'object' && option
10515
10516      if (!data) $this.data('bs.button', (data = new Button(this, options)))
10517
10518      if (option == 'toggle') data.toggle()
10519      else if (option) data.setState(option)
10520    })
10521  }
10522
10523  $.fn.button.Constructor = Button
10524
10525
10526  // BUTTON NO CONFLICT
10527  // ==================
10528
10529  $.fn.button.noConflict = function () {
10530    $.fn.button = old
10531    return this
10532  }
10533
10534
10535  // BUTTON DATA-API
10536  // ===============
10537
10538  $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
10539    var $btn = $(e.target)
10540    if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
10541    $btn.button('toggle')
10542    e.preventDefault()
10543  })
10544
10545}(jQuery);
10546
10547/* ========================================================================
10548 * Bootstrap: dropdown.js v3.1.1
10549 * http://getbootstrap.com/javascript/#dropdowns
10550 * ========================================================================
10551 * Copyright 2011-2014 Twitter, Inc.
10552 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
10553 * ======================================================================== */
10554
10555
10556+function ($) {
10557  'use strict';
10558
10559  // DROPDOWN CLASS DEFINITION
10560  // =========================
10561
10562  var backdrop = '.dropdown-backdrop'
10563  var toggle   = '[data-toggle=dropdown]'
10564  var Dropdown = function (element) {
10565    $(element).on('click.bs.dropdown', this.toggle)
10566  }
10567
10568  Dropdown.prototype.toggle = function (e) {
10569    var $this = $(this)
10570
10571    if ($this.is('.disabled, :disabled')) return
10572
10573    var $parent  = getParent($this)
10574    var isActive = $parent.hasClass('open')
10575
10576    clearMenus()
10577
10578    if (!isActive) {
10579      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
10580        // if mobile we use a backdrop because click events don't delegate
10581        $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
10582      }
10583
10584      var relatedTarget = { relatedTarget: this }
10585      $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
10586
10587      if (e.isDefaultPrevented()) return
10588
10589      $parent
10590        .toggleClass('open')
10591        .trigger('shown.bs.dropdown', relatedTarget)
10592
10593      $this.focus()
10594    }
10595
10596    return false
10597  }
10598
10599  Dropdown.prototype.keydown = function (e) {
10600    if (!/(38|40|27)/.test(e.keyCode)) return
10601
10602    var $this = $(this)
10603
10604    e.preventDefault()
10605    e.stopPropagation()
10606
10607    if ($this.is('.disabled, :disabled')) return
10608
10609    var $parent  = getParent($this)
10610    var isActive = $parent.hasClass('open')
10611
10612    if (!isActive || (isActive && e.keyCode == 27)) {
10613      if (e.which == 27) $parent.find(toggle).focus()
10614      return $this.click()
10615    }
10616
10617    var desc = ' li:not(.divider):visible a'
10618    var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
10619
10620    if (!$items.length) return
10621
10622    var index = $items.index($items.filter(':focus'))
10623
10624    if (e.keyCode == 38 && index > 0)                 index--                        // up
10625    if (e.keyCode == 40 && index < $items.length - 1) index++                        // down
10626    if (!~index)                                      index = 0
10627
10628    $items.eq(index).focus()
10629  }
10630
10631  function clearMenus(e) {
10632    $(backdrop).remove()
10633    $(toggle).each(function () {
10634      var $parent = getParent($(this))
10635      var relatedTarget = { relatedTarget: this }
10636      if (!$parent.hasClass('open')) return
10637      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
10638      if (e.isDefaultPrevented()) return
10639      $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
10640    })
10641  }
10642
10643  function getParent($this) {
10644    var selector = $this.attr('data-target')
10645
10646    if (!selector) {
10647      selector = $this.attr('href')
10648      selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
10649    }
10650
10651    var $parent = selector && $(selector)
10652
10653    return $parent && $parent.length ? $parent : $this.parent()
10654  }
10655
10656
10657  // DROPDOWN PLUGIN DEFINITION
10658  // ==========================
10659
10660  var old = $.fn.dropdown
10661
10662  $.fn.dropdown = function (option) {
10663    return this.each(function () {
10664      var $this = $(this)
10665      var data  = $this.data('bs.dropdown')
10666
10667      if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
10668      if (typeof option == 'string') data[option].call($this)
10669    })
10670  }
10671
10672  $.fn.dropdown.Constructor = Dropdown
10673
10674
10675  // DROPDOWN NO CONFLICT
10676  // ====================
10677
10678  $.fn.dropdown.noConflict = function () {
10679    $.fn.dropdown = old
10680    return this
10681  }
10682
10683
10684  // APPLY TO STANDARD DROPDOWN ELEMENTS
10685  // ===================================
10686
10687  $(document)
10688    .on('click.bs.dropdown.data-api', clearMenus)
10689    .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
10690    .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
10691    .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
10692
10693}(jQuery);
10694
10695/* ========================================================================
10696 * Bootstrap: modal.js v3.1.1
10697 * http://getbootstrap.com/javascript/#modals
10698 * ========================================================================
10699 * Copyright 2011-2014 Twitter, Inc.
10700 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
10701 * ======================================================================== */
10702
10703
10704+function ($) {
10705  'use strict';
10706
10707  // MODAL CLASS DEFINITION
10708  // ======================
10709
10710  var Modal = function (element, options) {
10711    this.options   = options
10712    this.$element  = $(element)
10713    this.$backdrop =
10714    this.isShown   = null
10715
10716    if (this.options.remote) {
10717      this.$element
10718        .find('.modal-content')
10719        .load(this.options.remote, $.proxy(function () {
10720          this.$element.trigger('loaded.bs.modal')
10721        }, this))
10722    }
10723  }
10724
10725  Modal.DEFAULTS = {
10726    backdrop: true,
10727    keyboard: true,
10728    show: true
10729  }
10730
10731  Modal.prototype.toggle = function (_relatedTarget) {
10732    return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
10733  }
10734
10735  Modal.prototype.show = function (_relatedTarget) {
10736    var that = this
10737    var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
10738
10739    this.$element.trigger(e)
10740
10741    if (this.isShown || e.isDefaultPrevented()) return
10742
10743    this.isShown = true
10744
10745    this.escape()
10746
10747    this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
10748
10749    this.backdrop(function () {
10750      var transition = $.support.transition && that.$element.hasClass('fade')
10751
10752      if (!that.$element.parent().length) {
10753        that.$element.appendTo(document.body) // don't move modals dom position
10754      }
10755
10756      that.$element
10757        .show()
10758        .scrollTop(0)
10759
10760      if (transition) {
10761        that.$element[0].offsetWidth // force reflow
10762      }
10763
10764      that.$element
10765        .addClass('in')
10766        .attr('aria-hidden', false)
10767
10768      that.enforceFocus()
10769
10770      var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
10771
10772      transition ?
10773        that.$element.find('.modal-dialog') // wait for modal to slide in
10774          .one($.support.transition.end, function () {
10775            that.$element.focus().trigger(e)
10776          })
10777          .emulateTransitionEnd(300) :
10778        that.$element.focus().trigger(e)
10779    })
10780  }
10781
10782  Modal.prototype.hide = function (e) {
10783    if (e) e.preventDefault()
10784
10785    e = $.Event('hide.bs.modal')
10786
10787    this.$element.trigger(e)
10788
10789    if (!this.isShown || e.isDefaultPrevented()) return
10790
10791    this.isShown = false
10792
10793    this.escape()
10794
10795    $(document).off('focusin.bs.modal')
10796
10797    this.$element
10798      .removeClass('in')
10799      .attr('aria-hidden', true)
10800      .off('click.dismiss.bs.modal')
10801
10802    $.support.transition && this.$element.hasClass('fade') ?
10803      this.$element
10804        .one($.support.transition.end, $.proxy(this.hideModal, this))
10805        .emulateTransitionEnd(300) :
10806      this.hideModal()
10807  }
10808
10809  Modal.prototype.enforceFocus = function () {
10810    $(document)
10811      .off('focusin.bs.modal') // guard against infinite focus loop
10812      .on('focusin.bs.modal', $.proxy(function (e) {
10813        if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
10814          this.$element.focus()
10815        }
10816      }, this))
10817  }
10818
10819  Modal.prototype.escape = function () {
10820    if (this.isShown && this.options.keyboard) {
10821      this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
10822        e.which == 27 && this.hide()
10823      }, this))
10824    } else if (!this.isShown) {
10825      this.$element.off('keyup.dismiss.bs.modal')
10826    }
10827  }
10828
10829  Modal.prototype.hideModal = function () {
10830    var that = this
10831	/* NOTE: hack modal: do NOT hide modal as it prevents videos to play on iOS */
10832    // this.$element.hide()
10833    this.backdrop(function () {
10834      that.removeBackdrop()
10835      that.$element.trigger('hidden.bs.modal')
10836    })
10837  }
10838
10839  Modal.prototype.removeBackdrop = function () {
10840    this.$backdrop && this.$backdrop.remove()
10841    this.$backdrop = null
10842  }
10843
10844  Modal.prototype.backdrop = function (callback) {
10845    var animate = this.$element.hasClass('fade') ? 'fade' : ''
10846
10847    if (this.isShown && this.options.backdrop) {
10848      var doAnimate = $.support.transition && animate
10849
10850      this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
10851        .appendTo(document.body)
10852
10853      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
10854        if (e.target !== e.currentTarget) return
10855        this.options.backdrop == 'static'
10856          ? this.$element[0].focus.call(this.$element[0])
10857          : this.hide.call(this)
10858      }, this))
10859
10860      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
10861
10862      this.$backdrop.addClass('in')
10863
10864      if (!callback) return
10865
10866      doAnimate ?
10867        this.$backdrop
10868          .one($.support.transition.end, callback)
10869          .emulateTransitionEnd(150) :
10870        callback()
10871
10872    } else if (!this.isShown && this.$backdrop) {
10873      this.$backdrop.removeClass('in')
10874
10875      $.support.transition && this.$element.hasClass('fade') ?
10876        this.$backdrop
10877          .one($.support.transition.end, callback)
10878          .emulateTransitionEnd(150) :
10879        callback()
10880
10881    } else if (callback) {
10882      callback()
10883    }
10884  }
10885
10886
10887  // MODAL PLUGIN DEFINITION
10888  // =======================
10889
10890  var old = $.fn.modal
10891
10892  $.fn.modal = function (option, _relatedTarget) {
10893    return this.each(function () {
10894      var $this   = $(this)
10895      var data    = $this.data('bs.modal')
10896      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
10897
10898      if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
10899      if (typeof option == 'string') data[option](_relatedTarget)
10900      else if (options.show) data.show(_relatedTarget)
10901    })
10902  }
10903
10904  $.fn.modal.Constructor = Modal
10905
10906
10907  // MODAL NO CONFLICT
10908  // =================
10909
10910  $.fn.modal.noConflict = function () {
10911    $.fn.modal = old
10912    return this
10913  }
10914
10915
10916  // MODAL DATA-API
10917  // ==============
10918
10919  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
10920    var $this   = $(this)
10921    var href    = $this.attr('href')
10922    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
10923    var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
10924
10925    if ($this.is('a')) e.preventDefault()
10926
10927    $target
10928      .modal(option, this)
10929      .one('hide', function () {
10930        $this.is(':visible') && $this.focus()
10931      })
10932  })
10933
10934  $(document)
10935    .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
10936    .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
10937
10938}(jQuery);
10939
10940/* ========================================================================
10941 * Bootstrap: tooltip.js v3.1.1
10942 * http://getbootstrap.com/javascript/#tooltip
10943 * Inspired by the original jQuery.tipsy by Jason Frame
10944 * ========================================================================
10945 * Copyright 2011-2014 Twitter, Inc.
10946 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
10947 * ======================================================================== */
10948
10949
10950+function ($) {
10951  'use strict';
10952
10953  // TOOLTIP PUBLIC CLASS DEFINITION
10954  // ===============================
10955
10956  var Tooltip = function (element, options) {
10957    this.type       =
10958    this.options    =
10959    this.enabled    =
10960    this.timeout    =
10961    this.hoverState =
10962    this.$element   = null
10963
10964    this.init('tooltip', element, options)
10965  }
10966
10967  Tooltip.DEFAULTS = {
10968    animation: true,
10969    placement: 'top',
10970    selector: false,
10971    template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
10972    trigger: 'hover focus',
10973    title: '',
10974    delay: 0,
10975    html: false,
10976    container: false
10977  }
10978
10979  Tooltip.prototype.init = function (type, element, options) {
10980    this.enabled  = true
10981    this.type     = type
10982    this.$element = $(element)
10983    this.options  = this.getOptions(options)
10984
10985    var triggers = this.options.trigger.split(' ')
10986
10987    for (var i = triggers.length; i--;) {
10988      var trigger = triggers[i]
10989
10990      if (trigger == 'click') {
10991        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
10992      } else if (trigger != 'manual') {
10993        var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
10994        var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
10995
10996        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
10997        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
10998      }
10999    }
11000
11001    this.options.selector ?
11002      (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
11003      this.fixTitle()
11004  }
11005
11006  Tooltip.prototype.getDefaults = function () {
11007    return Tooltip.DEFAULTS
11008  }
11009
11010  Tooltip.prototype.getOptions = function (options) {
11011    options = $.extend({}, this.getDefaults(), this.$element.data(), options)
11012
11013    if (options.delay && typeof options.delay == 'number') {
11014      options.delay = {
11015        show: options.delay,
11016        hide: options.delay
11017      }
11018    }
11019
11020    return options
11021  }
11022
11023  Tooltip.prototype.getDelegateOptions = function () {
11024    var options  = {}
11025    var defaults = this.getDefaults()
11026
11027    this._options && $.each(this._options, function (key, value) {
11028      if (defaults[key] != value) options[key] = value
11029    })
11030
11031    return options
11032  }
11033
11034  Tooltip.prototype.enter = function (obj) {
11035    var self = obj instanceof this.constructor ?
11036      obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
11037
11038    clearTimeout(self.timeout)
11039
11040    self.hoverState = 'in'
11041
11042    if (!self.options.delay || !self.options.delay.show) return self.show()
11043
11044    self.timeout = setTimeout(function () {
11045      if (self.hoverState == 'in') self.show()
11046    }, self.options.delay.show)
11047  }
11048
11049  Tooltip.prototype.leave = function (obj) {
11050    var self = obj instanceof this.constructor ?
11051      obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
11052
11053    clearTimeout(self.timeout)
11054
11055    self.hoverState = 'out'
11056
11057    if (!self.options.delay || !self.options.delay.hide) return self.hide()
11058
11059    self.timeout = setTimeout(function () {
11060      if (self.hoverState == 'out') self.hide()
11061    }, self.options.delay.hide)
11062  }
11063
11064  Tooltip.prototype.show = function () {
11065    var e = $.Event('show.bs.' + this.type)
11066
11067    if (this.hasContent() && this.enabled) {
11068      this.$element.trigger(e)
11069
11070      if (e.isDefaultPrevented()) return
11071      var that = this;
11072
11073      var $tip = this.tip()
11074
11075      this.setContent()
11076
11077      if (this.options.animation) $tip.addClass('fade')
11078
11079      var placement = typeof this.options.placement == 'function' ?
11080        this.options.placement.call(this, $tip[0], this.$element[0]) :
11081        this.options.placement
11082
11083      var autoToken = /\s?auto?\s?/i
11084      var autoPlace = autoToken.test(placement)
11085      if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
11086
11087      $tip
11088        .detach()
11089        .css({ top: 0, left: 0, display: 'block' })
11090        .addClass(placement)
11091
11092      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
11093
11094      var pos          = this.getPosition()
11095      var actualWidth  = $tip[0].offsetWidth
11096      var actualHeight = $tip[0].offsetHeight
11097
11098      if (autoPlace) {
11099        var $parent = this.$element.parent()
11100
11101        var orgPlacement = placement
11102        var docScroll    = document.documentElement.scrollTop || document.body.scrollTop
11103        var parentWidth  = this.options.container == 'body' ? window.innerWidth  : $parent.outerWidth()
11104        var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
11105        var parentLeft   = this.options.container == 'body' ? 0 : $parent.offset().left
11106
11107        placement = placement == 'bottom' && pos.top   + pos.height  + actualHeight - docScroll > parentHeight  ? 'top'    :
11108                    placement == 'top'    && pos.top   - docScroll   - actualHeight < 0                         ? 'bottom' :
11109                    placement == 'right'  && pos.right + actualWidth > parentWidth                              ? 'left'   :
11110                    placement == 'left'   && pos.left  - actualWidth < parentLeft                               ? 'right'  :
11111                    placement
11112
11113        $tip
11114          .removeClass(orgPlacement)
11115          .addClass(placement)
11116      }
11117
11118      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
11119
11120      this.applyPlacement(calculatedOffset, placement)
11121      this.hoverState = null
11122
11123      var complete = function() {
11124        that.$element.trigger('shown.bs.' + that.type)
11125      }
11126
11127      $.support.transition && this.$tip.hasClass('fade') ?
11128        $tip
11129          .one($.support.transition.end, complete)
11130          .emulateTransitionEnd(150) :
11131        complete()
11132    }
11133  }
11134
11135  Tooltip.prototype.applyPlacement = function (offset, placement) {
11136    var replace
11137    var $tip   = this.tip()
11138    var width  = $tip[0].offsetWidth
11139    var height = $tip[0].offsetHeight
11140
11141    // manually read margins because getBoundingClientRect includes difference
11142    var marginTop = parseInt($tip.css('margin-top'), 10)
11143    var marginLeft = parseInt($tip.css('margin-left'), 10)
11144
11145    // we must check for NaN for ie 8/9
11146    if (isNaN(marginTop))  marginTop  = 0
11147    if (isNaN(marginLeft)) marginLeft = 0
11148
11149    offset.top  = offset.top  + marginTop
11150    offset.left = offset.left + marginLeft
11151
11152    // $.fn.offset doesn't round pixel values
11153    // so we use setOffset directly with our own function B-0
11154    $.offset.setOffset($tip[0], $.extend({
11155      using: function (props) {
11156        $tip.css({
11157          top: Math.round(props.top),
11158          left: Math.round(props.left)
11159        })
11160      }
11161    }, offset), 0)
11162
11163    $tip.addClass('in')
11164
11165    // check to see if placing tip in new offset caused the tip to resize itself
11166    var actualWidth  = $tip[0].offsetWidth
11167    var actualHeight = $tip[0].offsetHeight
11168
11169    if (placement == 'top' && actualHeight != height) {
11170      replace = true
11171      offset.top = offset.top + height - actualHeight
11172    }
11173
11174    if (/bottom|top/.test(placement)) {
11175      var delta = 0
11176
11177      if (offset.left < 0) {
11178        delta       = offset.left * -2
11179        offset.left = 0
11180
11181        $tip.offset(offset)
11182
11183        actualWidth  = $tip[0].offsetWidth
11184        actualHeight = $tip[0].offsetHeight
11185      }
11186
11187      this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
11188    } else {
11189      this.replaceArrow(actualHeight - height, actualHeight, 'top')
11190    }
11191
11192    if (replace) $tip.offset(offset)
11193  }
11194
11195  Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
11196    this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
11197  }
11198
11199  Tooltip.prototype.setContent = function () {
11200    var $tip  = this.tip()
11201    var title = this.getTitle()
11202
11203    $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
11204    $tip.removeClass('fade in top bottom left right')
11205  }
11206
11207  Tooltip.prototype.hide = function () {
11208    var that = this
11209    var $tip = this.tip()
11210    var e    = $.Event('hide.bs.' + this.type)
11211
11212    function complete() {
11213      if (that.hoverState != 'in') $tip.detach()
11214      that.$element.trigger('hidden.bs.' + that.type)
11215    }
11216
11217    this.$element.trigger(e)
11218
11219    if (e.isDefaultPrevented()) return
11220
11221    $tip.removeClass('in')
11222
11223    $.support.transition && this.$tip.hasClass('fade') ?
11224      $tip
11225        .one($.support.transition.end, complete)
11226        .emulateTransitionEnd(150) :
11227      complete()
11228
11229    this.hoverState = null
11230
11231    return this
11232  }
11233
11234  Tooltip.prototype.fixTitle = function () {
11235    var $e = this.$element
11236    if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
11237      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
11238    }
11239  }
11240
11241  Tooltip.prototype.hasContent = function () {
11242    return this.getTitle()
11243  }
11244
11245  Tooltip.prototype.getPosition = function () {
11246    var el = this.$element[0]
11247    return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
11248      width: el.offsetWidth,
11249      height: el.offsetHeight
11250    }, this.$element.offset())
11251  }
11252
11253  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
11254    return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2  } :
11255           placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2  } :
11256           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
11257        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width   }
11258  }
11259
11260  Tooltip.prototype.getTitle = function () {
11261    var title
11262    var $e = this.$element
11263    var o  = this.options
11264
11265    title = $e.
11265attr('data-original-title')
11266      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
11267
11268    return title
11269  }
11270
11271  Tooltip.prototype.tip = function () {
11272    return this.$tip = this.$tip || $(this.options.template)
11273  }
11274
11275  Tooltip.prototype.arrow = function () {
11276    return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
11277  }
11278
11279  Tooltip.prototype.validate = function () {
11280    if (!this.$element[0].parentNode) {
11281      this.hide()
11282      this.$element = null
11283      this.options  = null
11284    }
11285  }
11286
11287  Tooltip.prototype.enable = function () {
11288    this.enabled = true
11289  }
11290
11291  Tooltip.prototype.disable = function () {
11292    this.enabled = false
11293  }
11294
11295  Tooltip.prototype.toggleEnabled = function () {
11296    this.enabled = !this.enabled
11297  }
11298
11299  Tooltip.prototype.toggle = function (e) {
11300    var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
11301    self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
11302  }
11303
11304  Tooltip.prototype.destroy = function () {
11305    clearTimeout(this.timeout)
11306    this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
11307  }
11308
11309
11310  // TOOLTIP PLUGIN DEFINITION
11311  // =========================
11312
11313  var old = $.fn.tooltip
11314
11315  $.fn.tooltip = function (option) {
11316    return this.each(function () {
11317      var $this   = $(this)
11318      var data    = $this.data('bs.tooltip')
11319      var options = typeof option == 'object' && option
11320
11321      if (!data && option == 'destroy') return
11322      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
11323      if (typeof option == 'string') data[option]()
11324    })
11325  }
11326
11327  $.fn.tooltip.Constructor = Tooltip
11328
11329
11330  // TOOLTIP NO CONFLICT
11331  // ===================
11332
11333  $.fn.tooltip.noConflict = function () {
11334    $.fn.tooltip = old
11335    return this
11336  }
11337
11338}(jQuery);
11339
11340/* ========================================================================
11341 * Bootstrap: tab.js v3.1.1
11342 * http://getbootstrap.com/javascript/#tabs
11343 * ========================================================================
11344 * Copyright 2011-2014 Twitter, Inc.
11345 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
11346 * ======================================================================== */
11347
11348
11349+function ($) {
11350  'use strict';
11351
11352  // TAB CLASS DEFINITION
11353  // ====================
11354
11355  var Tab = function (element) {
11356    this.element = $(element)
11357  }
11358
11359  Tab.prototype.show = function () {
11360    var $this    = this.element
11361    var $ul      = $this.closest('ul:not(.dropdown-menu)')
11362    var selector = $this.data('target')
11363
11364    if (!selector) {
11365      selector = $this.attr('href')
11366      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
11367    }
11368
11369    if ($this.parent('li').hasClass('active')) return
11370
11371    var previous = $ul.find('.active:last a')[0]
11372    var e        = $.Event('show.bs.tab', {
11373      relatedTarget: previous
11374    })
11375
11376    $this.trigger(e)
11377
11378    if (e.isDefaultPrevented()) return
11379
11380    var $target = $(selector)
11381
11382    this.activate($this.parent('li'), $ul)
11383    this.activate($target, $target.parent(), function () {
11384      $this.trigger({
11385        type: 'shown.bs.tab',
11386        relatedTarget: previous
11387      })
11388    })
11389  }
11390
11391  Tab.prototype.activate = function (element, container, callback) {
11392    var $active    = container.find('> .active')
11393    var transition = callback
11394      && $.support.transition
11395      && $active.hasClass('fade')
11396
11397    function next() {
11398      $active
11399        .removeClass('active')
11400        .find('> .dropdown-menu > .active')
11401        .removeClass('active')
11402
11403      element.addClass('active')
11404
11405      if (transition) {
11406        element[0].offsetWidth // reflow for transition
11407        element.addClass('in')
11408      } else {
11409        element.removeClass('fade')
11410      }
11411
11412      if (element.parent('.dropdown-menu')) {
11413        element.closest('li.dropdown').addClass('active')
11414      }
11415
11416      callback && callback()
11417    }
11418
11419    transition ?
11420      $active
11421        .one($.support.transition.end, next)
11422        .emulateTransitionEnd(150) :
11423      next()
11424
11425    $active.removeClass('in')
11426  }
11427
11428
11429  // TAB PLUGIN DEFINITION
11430  // =====================
11431
11432  var old = $.fn.tab
11433
11434  $.fn.tab = function ( option ) {
11435    return this.each(function () {
11436      var $this = $(this)
11437      var data  = $this.data('bs.tab')
11438
11439      if (!data) $this.data('bs.tab', (data = new Tab(this)))
11440      if (typeof option == 'string') data[option]()
11441    })
11442  }
11443
11444  $.fn.tab.Constructor = Tab
11445
11446
11447  // TAB NO CONFLICT
11448  // ===============
11449
11450  $.fn.tab.noConflict = function () {
11451    $.fn.tab = old
11452    return this
11453  }
11454
11455
11456  // TAB DATA-API
11457  // ============
11458  $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {    
11459    if (!$(this).parents('#global-menu')) {
11460      e.preventDefault();
11461    }
11462    $(this).tab('show');
11463  })
11464
11465}(jQuery);
11466
11467/* ========================================================================
11468 * Bootstrap: collapse.js v3.1.1
11469 * http://getbootstrap.com/javascript/#collapse
11470 * ========================================================================
11471 * Copyright 2011-2014 Twitter, Inc.
11472 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
11473 * ======================================================================== */
11474
11475
11476+function ($) {
11477  'use strict';
11478
11479  // COLLAPSE PUBLIC CLASS DEFINITION
11480  // ================================
11481
11482  var Collapse = function (element, options) {
11483    this.$element      = $(element)
11484    this.options       = $.extend({}, Collapse.DEFAULTS, options)
11485    this.transitioning = null
11486
11487    if (this.options.parent) this.$parent = $(this.options.parent)
11488    if (this.options.toggle) this.toggle()
11489  }
11490
11491  Collapse.DEFAULTS = {
11492    toggle: true
11493  }
11494
11495  Collapse.prototype.dimension = function () {
11496    var hasWidth = this.$element.hasClass('width')
11497    return hasWidth ? 'width' : 'height'
11498  }
11499
11500  Collapse.prototype.show = function () {
11501    if (this.transitioning || this.$element.hasClass('in')) return
11502
11503    var startEvent = $.Event('show.bs.collapse')
11504    this.$element.trigger(startEvent)
11505    if (startEvent.isDefaultPrevented()) return
11506
11507    var actives = this.$parent && this.$parent.find('> .panel > .in')
11508
11509    if (actives && actives.length) {
11510      var hasData = actives.data('bs.collapse')
11511      if (hasData && hasData.transitioning) return
11512      actives.collapse('hide')
11513      hasData || actives.data('bs.collapse', null)
11514    }
11515
11516    var dimension = this.dimension()
11517
11518    this.$element
11519      .removeClass('collapse')
11520      .addClass('collapsing')
11521      [dimension](0)
11522
11523    this.transitioning = 1
11524
11525    var complete = function () {
11526      this.$element
11527        .removeClass('collapsing')
11528        .addClass('collapse in')
11529        [dimension]('auto')
11530      this.transitioning = 0
11531      this.$element.trigger('shown.bs.collapse')
11532    }
11533
11534    if (!$.support.transition) return complete.call(this)
11535
11536    var scrollSize = $.camelCase(['scroll', dimension].join('-'))
11537
11538    this.$element
11539      .one($.support.transition.end, $.proxy(complete, this))
11540      .emulateTransitionEnd(350)
11541      [dimension](this.$element[0][scrollSize])
11542  }
11543
11544  Collapse.prototype.hide = function () {
11545    if (this.transitioning || !this.$element.hasClass('in')) return
11546
11547    var startEvent = $.Event('hide.bs.collapse')
11548    this.$element.trigger(startEvent)
11549    if (startEvent.isDefaultPrevented()) return
11550
11551    var dimension = this.dimension()
11552
11553    this.$element
11554      [dimension](this.$element[dimension]())
11555      [0].offsetHeight
11556
11557    this.$element
11558      .addClass('collapsing')
11559      .removeClass('collapse')
11560      .removeClass('in')
11561
11562    this.transitioning = 1
11563
11564    var complete = function () {
11565      this.transitioning = 0
11566      this.$element
11567        .trigger('hidden.bs.collapse')
11568        .removeClass('collapsing')
11569        .addClass('collapse')
11570    }
11571
11572    if (!$.support.transition) return complete.call(this)
11573
11574    this.$element
11575      [dimension](0)
11576      .one($.support.transition.end, $.proxy(complete, this))
11577      .emulateTransitionEnd(350)
11578  }
11579
11580  Collapse.prototype.toggle = function () {
11581    this[this.$element.hasClass('in') ? 'hide' : 'show']()
11582  }
11583
11584
11585  // COLLAPSE PLUGIN DEFINITION
11586  // ==========================
11587
11588  var old = $.fn.collapse
11589
11590  $.fn.collapse = function (option) {
11591    return this.each(function () {
11592      var $this   = $(this)
11593      var data    = $this.data('bs.collapse')
11594      var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
11595
11596      if (!data && options.toggle && option == 'show') option = !option
11597      if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
11598      if (typeof option == 'string') data[option]()
11599    })
11600  }
11601
11602  $.fn.collapse.Constructor = Collapse
11603
11604
11605  // COLLAPSE NO CONFLICT
11606  // ====================
11607
11608  $.fn.collapse.noConflict = function () {
11609    $.fn.collapse = old
11610    return this
11611  }
11612
11613
11614  // COLLAPSE DATA-API
11615  // =================
11616
11617  $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
11618    var $this   = $(this), href
11619    var target  = $this.attr('data-target')
11620        || e.preventDefault()
11621        || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
11622    var $target = $(target)
11623    var data    = $target.data('bs.collapse')
11624    var option  = data ? 'toggle' : $this.data()
11625    var parent  = $this.attr('data-parent')
11626    var $parent = parent && $(parent)
11627
11628    if (!data || !data.transitioning) {
11629      if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
11630      $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
11631    }
11632
11633    $target.collapse(option)
11634  })
11635
11636}(jQuery);
11637
11638/* ========================================================================
11639 * Bootstrap: transition.js v3.1.1
11640 * http://getbootstrap.com/javascript/#transitions
11641 * ========================================================================
11642 * Copyright 2011-2014 Twitter, Inc.
11643 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
11644 * ======================================================================== */
11645
11646
11647+function ($) {
11648  'use strict';
11649
11650  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
11651  // ============================================================
11652
11653  function transitionEnd() {
11654    var el = document.createElement('bootstrap')
11655
11656    var transEndEventNames = {
11657      'WebkitTransition' : 'webkitTransitionEnd',
11658      'MozTransition'    : 'transitionend',
11659      'OTransition'      : 'oTransitionEnd otransitionend',
11660      'transition'       : 'transitionend'
11661    }
11662
11663    for (var name in transEndEventNames) {
11664      if (el.style[name] !== undefined) {
11665        return { end: transEndEventNames[name] }
11666      }
11667    }
11668
11669    return false // explicit for ie8 (  ._.)
11670  }
11671
11672  // http://blog.alexmaccaw.com/css-transitions
11673  $.fn.emulateTransitionEnd = function (duration) {
11674    var called = false, $el = this
11675    $(this).one($.support.transition.end, function () { called = true })
11676    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
11677    setTimeout(callback, duration)
11678    return this
11679  }
11680
11681  $(function () {
11682    $.support.transition = transitionEnd()
11683  })
11684
11685}(jQuery);
11686
11687/*!
11688 * selectivizr v1.0.2 - (c) Keith Clark, freely distributable under the terms of the MIT license.
11689 * selectivizr.com
11690 */
11691(function(j){function A(a){return a.replace(B,h).replace(C,function(a,d,b){for(var a=b.split(","),b=0,e=a.length;b<e;b++){var s=D(a[b].replace(E,h).replace(F,h))+o,l=[];a[b]=s.replace(G,function(a,b,c,d,e){if(b){if(l.length>0){var a=l,f,e=s.substring(0,e).replace(H,i);if(e==i||e.charAt(e.length-1)==o)e+="*";try{f=t(e)}catch(k){}if(f){e=0;for(c=f.length;e<c;e++){for(var d=f[e],h=d.className,j=0,m=a.length;j<m;j++){var g=a[j];if(!RegExp("(^|\\s)"+g.className+"(\\s|$)").test(d.className)&&g.b&&(g.b===!0||g.b(d)===!0))h=u(h,g.className,!0)}d.className=h}}l=[]}return b}else{if(b=c?I(c):!v||v.test(d)?{className:w(d),b:!0}:null)return l.push(b),"."+b.className;return a}})}return d+a.join(",")})}function I(a){var c=!0,d=w(a.slice(1)),b=a.substring(0,5)==":not(",e,f;b&&(a=a.slice(5,-1));var l=a.indexOf("(");l>-1&&(a=a.substring(0,l));if(a.charAt(0)==":")switch(a.slice(1)){case "root":c=function(a){return b?a!=p:a==p};break;case "target":if(m==8){c=function(a){function c(){var d=location.hash,e=d.slice(1);return b?d==i||a.id!=e:d!=i&&a.id==e}k(j,"hashchange",function(){g(a,d,c())});return c()};break}return!1;case "checked":c=function(a){J.test(a.type)&&k(a,"propertychange",function(){event.propertyName=="checked"&&g(a,d,a.checked!==b)});return a.checked!==b};break;case "disabled":b=!b;case "enabled":c=function(c){if(K.test(c.tagName))return k(c,"propertychange",function(){event.propertyName=="$disabled"&&g(c,d,c.a===b)}),q.push(c),c.a=c.disabled,c.disabled===b;return a==":enabled"?b:!b};break;case "focus":e="focus",f="blur";case "hover":e||(e="mouseenter",f="mouseleave");c=function(a){k(a,b?f:e,function(){g(a,d,!0)});k(a,b?e:f,function(){g(a,d,!1)});return b};break;default:if(!L.test(a))return!1}return{className:d,b:c}}function w(a){return M+"-"+(m==6&&N?O++:a.replace(P,function(a){return a.charCodeAt(0)}))}function D(a){return a.replace(x,h).replace(Q,o)}function g(a,c,d){var b=a.className,c=u(b,c,d);if(c!=b)a.className=c,a.parentNode.className+=i}function u(a,c,d){var b=RegExp("(^|\\s)"+c+"(\\s|$)"),e=b.test(a);return d?e?a:a+o+c:e?a.replace(b,h).replace(x,h):a}function k(a,c,d){a.attachEvent("on"+c,d)}function r(a,c){if(/^https?:\/\//i.test(a))return c.substring(0,c.indexOf("/",8))==a.substring(0,a.indexOf("/",8))?a:null;if(a.charAt(0)=="/")return c.substring(0,c.indexOf("/",8))+a;var d=c.split(/[?#]/)[0];a.charAt(0)!="?"&&d.charAt(d.length-1)!="/"&&(d=d.substring(0,d.lastIndexOf("/")+1));return d+a}function y(a){if(a)return n.open("GET",a,!1),n.send(),(n.status==200?n.responseText:i).replace(R,i).replace(S,function(c,d,b,e,f){return y(r(b||f,a))}).replace(T,function(c,d,b){d=d||i;return" url("+d+r(b,a)+d+") "});return i}function U(){var a,c;a=f.getElementsByTagName("BASE");for(var d=a.length>0?a[0].href:f.location.href,b=0;b<f.styleSheets.length;b++)if(c=f.styleSheets[b],c.href!=i&&(a=r(c.href,d)))c.cssText=A(y(a));q.length>0&&setInterval(function(){for(var a=0,c=q.length;a<c;a++){var b=q[a];if(b.disabled!==b.a)b.disabled?(b.disabled=!1,b.a=!0,b.disabled=!0):b.a=b.disabled}},250)}if(!/*@cc_on!@*/true){var f=document,p=f.documentElement,n=function(){if(j.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return null}}(),m=/MSIE (\d+)/.exec(navigator.userAgent)[1];if(!(f.compatMode!="CSS1Compat"||m<6||m>8||!n)){var z={NW:"*.Dom.select",MooTools:"$$",DOMAssistant:"*.$",Prototype:"$$",YAHOO:"*.util.Selector.query",Sizzle:"*",jQuery:"*",dojo:"*.query"},t,q=[],O=0,N=!0,M="slvzr",R=/(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g,S=/@import\s*(?:(?
11691:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))[^;]*;/g,T=/\burl\(\s*(["']?)(?!data:)([^"')]+)\1\s*\)/g,L=/^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/,B=/:(:first-(?:line|letter))/g,C=/(^|})\s*([^\{]*?[\[:][^{]+)/g,G=/([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g,H=/(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g,P=/[^\w-]/g,K=/^(INPUT|SELECT|TEXTAREA|BUTTON)$/,J=/^(checkbox|radio)$/,v=m>6?/[\$\^*]=(['"])\1/:null,E=/([(\[+~])\s+/g,F=/\s+([)\]+~])/g,Q=/\s+/g,x=/^\s*((?:[\S\s]*\S)?)\s*$/,i="",o=" ",h="$1";(function(a,c){function d(){try{p.doScroll("left")}catch(a){setTimeout(d,50);return}b("poll")}function b(d){if(!(d.type=="readystatechange"&&f.readyState!="complete")&&((d.type=="load"?a:f).detachEvent("on"+d.type,b,!1),!e&&(e=!0)))c.call(a,d.type||d)}var e=!1,g=!0;if(f.readyState=="complete")c.call(a,i);else{if(f.createEventObject&&p.doScroll){try{g=!a.frameElement}catch(h){}g&&d()}k(f,"readystatechange",b);k(a,"load",b)}})(j,function(){for(var a in z){var c,d,b=j;if(j[a]){for(c=z[a].replace("*",a).split(".");(d=c.shift())&&(b=b[d]););if(typeof b=="function"){t=b;U();break}}}})}}})(this);
11692/*! Video.js v4.7.0 Copyright 2014 Brightcove, Inc. https://github.com/videojs/video.js/blob/master/LICENSE */
11693(function() {var b=void 0,f=!0,k=null,l=!1;function m(){return function(){}}function p(a){return function(){return this[a]}}function r(a){return function(){return a}}var s;document.createElement("video");document.createElement("audio");document.createElement("track");function t(a,c,d){if("string"===typeof a){0===a.indexOf("#")&&(a=a.slice(1));if(t.Ca[a])return t.Ca[a];a=t.w(a)}if(!a||!a.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return a.player||new t.Player(a,c,d)}
11694var videojs=window.videojs=t;t.Wb="4.7";t.Tc="https:"==document.location.protocol?"https://":"http://";t.options={techOrder:["html5","flash"],html5:{},flash:{},width:300,height:150,defaultVolume:0,playbackRates:[],children:{mediaLoader:{},posterImage:{},textTrackDisplay:{},loadingSpinner:{},bigPlayButton:{},controlBar:{},errorDisplay:{}},language:document.getElementsByTagName("html")[0].getAttribute("lang")||navigator.Wa&&navigator.Wa[0]||navigator.te||navigator.language||"en",languages:{},notSupportedMessage:"No compatible source was found for this video."};
11695"GENERATED_CDN_VSN"!==t.Wb&&(videojs.options.flash.swf=t.Tc+"vjs.zencdn.net/"+t.Wb+"/video-js.swf");t.Ca={};"function"===typeof define&&define.amd?define([],function(){return videojs}):"object"===typeof exports&&"object"===typeof module&&(module.exports=videojs);t.ra=t.CoreObject=m();
11696t.ra.extend=function(a){var c,d;a=a||{};c=a.init||a.j||this.prototype.init||this.prototype.j||m();d=function(){c.apply(this,arguments)};d.prototype=t.h.create(this.prototype);d.prototype.constructor=d;d.extend=t.ra.extend;d.create=t.ra.create;for(var e in a)a.hasOwnProperty(e)&&(d.prototype[e]=a[e]);return d};t.ra.create=function(){var a=t.h.create(this.prototype);this.apply(a,arguments);return a};
11697t.d=function(a,c,d){if(t.h.isArray(c))return u(t.d,a,c,d);var e=t.getData(a);e.F||(e.F={});e.F[c]||(e.F[c]=[]);d.z||(d.z=t.z++);e.F[c].push(d);e.Y||(e.disabled=l,e.Y=function(c){if(!e.disabled){c=t.rc(c);var d=e.F[c.type];if(d)for(var d=d.slice(0),j=0,n=d.length;j<n&&!c.yc();j++)d[j].call(a,c)}});1==e.F[c].length&&(a.addEventListener?a.addEventListener(c,e.Y,l):a.attachEvent&&a.attachEvent("on"+c,e.Y))};
11698t.p=function(a,c,d){if(t.uc(a)){var e=t.getData(a);if(e.F){if(t.h.isArray(c))return u(t.p,a,c,d);if(c){var g=e.F[c];if(g){if(d){if(d.z)for(e=0;e<g.length;e++)g[e].z===d.z&&g.splice(e--,1)}else e.F[c]=[];t.lc(a,c)}}else for(g in e.F)c=g,e.F[c]=[],t.lc(a,c)}}};t.lc=function(a,c){var d=t.getData(a);0===d.F[c].length&&(delete d.F[c],a.removeEventListener?a.removeEventListener(c,d.Y,l):a.detachEvent&&a.detachEvent("on"+c,d.Y));t.Ib(d.F)&&(delete d.F,delete d.Y,delete d.disabled);t.Ib(d)&&t.Fc(a)};
11699t.rc=function(a){function c(){return f}function d(){return l}if(!a||!a.Jb){var e=a||window.event;a={};for(var g in e)"layerX"!==g&&("layerY"!==g&&"keyboardEvent.keyLocation"!==g)&&("returnValue"==g&&e.preventDefault||(a[g]=e[g]));a.target||(a.target=a.srcElement||document);a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;a.preventDefault=function(){e.preventDefault&&e.preventDefault();a.returnValue=l;a.yd=c;a.defaultPrevented=f};a.yd=d;a.defaultPrevented=l;a.stopPropagation=function(){e.stopPropagation&&
11700e.stopPropagation();a.cancelBubble=f;a.Jb=c};a.Jb=d;a.stopImmediatePropagation=function(){e.stopImmediatePropagation&&e.stopImmediatePropagation();a.yc=c;a.stopPropagation()};a.yc=d;if(a.clientX!=k){g=document.documentElement;var h=document.body;a.pageX=a.clientX+(g&&g.scrollLeft||h&&h.scrollLeft||0)-(g&&g.clientLeft||h&&h.clientLeft||0);a.pageY=a.clientY+(g&&g.scrollTop||h&&h.scrollTop||0)-(g&&g.clientTop||h&&h.clientTop||0)}
11700a.which=a.charCode||a.keyCode;a.button!=k&&(a.button=a.button&1?0:a.button&
117014?1:a.button&2?2:0)}return a};t.l=function(a,c){var d=t.uc(a)?t.getData(a):{},e=a.parentNode||a.ownerDocument;"string"===typeof c&&(c={type:c,target:a});c=t.rc(c);d.Y&&d.Y.call(a,c);if(e&&!c.Jb()&&c.bubbles!==l)t.l(e,c);else if(!e&&!c.defaultPrevented&&(d=t.getData(c.target),c.target[c.type])){d.disabled=f;if("function"===typeof c.target[c.type])c.target[c.type]();d.disabled=l}return!c.defaultPrevented};
11702t.V=function(a,c,d){function e(){t.p(a,c,e);d.apply(this,arguments)}if(t.h.isArray(c))return u(t.V,a,c,d);e.z=d.z=d.z||t.z++;t.d(a,c,e)};function u(a,c,d,e){t.jc.forEach(d,function(d){a(c,d,e)})}var w=Object.prototype.hasOwnProperty;t.e=function(a,c){var d;c=c||{};d=document.createElement(a||"div");t.h.Z(c,function(a,c){-1!==a.indexOf("aria-")||"role"==a?d.setAttribute(a,c):d[a]=c});return d};t.ba=function(a){return a.charAt(0).toUpperCase()+a.slice(1)};t.h={};
11703t.h.create=Object.create||function(a){function c(){}c.prototype=a;return new c};t.h.Z=function(a,c,d){for(var e in a)w.call(a,e)&&c.call(d||this,e,a[e])};t.h.A=function(a,c){if(!c)return a;for(var d in c)w.call(c,d)&&(a[d]=c[d]);return a};t.h.md=function(a,c){var d,e,g;a=t.h.copy(a);for(d in c)w.call(c,d)&&(e=a[d],g=c[d],a[d]=t.h.Ua(e)&&t.h.Ua(g)?t.h.md(e,g):c[d]);return a};t.h.copy=function(a){return t.h.A({},a)};
11704t.h.Ua=function(a){return!!a&&"object"===typeof a&&"[object Object]"===a.toString()&&a.constructor===Object};t.h.isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};t.bind=function(a,c,d){function e(){return c.apply(a,arguments)}c.z||(c.z=t.z++);e.z=d?d+"_"+c.z:c.z;return e};t.va={};t.z=1;t.expando="vdata"+(new Date).getTime();t.getData=function(a){var c=a[t.expando];c||(c=a[t.expando]=t.z++,t.va[c]={});return t.va[c]};
11705t.uc=function(a){a=a[t.expando];return!(!a||t.Ib(t.va[a]))};t.Fc=function(a){var c=a[t.expando];if(c){delete t.va[c];try{delete a[t.expando]}catch(d){a.removeAttribute?a.removeAttribute(t.expando):a[t.expando]=k}}};t.Ib=function(a){for(var c in a)if(a[c]!==k)return l;return f};t.n=function(a,c){-1==(" "+a.className+" ").indexOf(" "+c+" ")&&(a.className=""===a.className?c:a.className+" "+c)};
11706t.q=function(a,c){var d,e;if(-1!=a.className.indexOf(c)){d=a.className.split(" ");for(e=d.length-1;0<=e;e--)d[e]===c&&d.splice(e,1);a.className=d.join(" ")}};t.B=t.e("video");t.M=navigator.userAgent;t.Zc=/iPhone/i.test(t.M);t.Yc=/iPad/i.test(t.M);t.$c=/iPod/i.test(t.M);t.Xc=t.Zc||t.Yc||t.$c;var aa=t,x;var y=t.M.match(/OS (\d+)_/i);x=y&&y[1]?y[1]:b;aa.ke=x;t.Vc=/Android/i.test(t.M);var ba=t,z;var A=t.M.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i),B,C;
11707A?(B=A[1]&&parseFloat(A[1]),C=A[2]&&parseFloat(A[2]),z=B&&C?parseFloat(A[1]+"."+A[2]):B?B:k):z=k;ba.Vb=z;t.ad=t.Vc&&/webkit/i.test(t.M)&&2.3>t.Vb;t.Wc=/Firefox/i.test(t.M);t.le=/Chrome/i.test(t.M);t.fc=!!("ontouchstart"in window||window.Uc&&document instanceof window.Uc);t.Hc=function(a,c){t.h.Z(c,function(c,e){e===k||"undefined"===typeof e||e===l?a.removeAttribute(c):a.setAttribute(c,e===f?"":e)})};
11708t.Aa=function(a){var c,d,e,g;c={};if(a&&a.attributes&&0<a.attributes.length){d=a.attributes;for(var h=d.length-1;0<=h;h--){e=d[h].name;g=d[h].value;if("boolean"===typeof a[e]||-1!==",autoplay,controls,loop,muted,default,".indexOf(","+e+","))g=g!==k?f:l;c[e]=g}}return c};
11709t.ne=function(a,c){var d="";document.defaultView&&document.defaultView.getComputedStyle?d=document.defaultView.getComputedStyle(a,"").getPropertyValue(c):a.currentStyle&&(d=a["client"+c.substr(0,1).toUpperCase()+c.substr(1)]+"px");return d};t.Hb=function(a,c){c.firstChild?c.insertBefore(a,c.firstChild):c.appendChild(a)};t.Qa={};t.w=function(a){0===a.indexOf("#")&&(a=a.slice(1));return document.getElementById(a)};
11710t.za=function(a,c){c=c||a;var d=Math.floor(a%60),e=Math.floor(a/60%60),g=Math.floor(a/3600),h=Math.floor(c/60%60),j=Math.floor(c/3600);if(isNaN(a)||Infinity===a)g=e=d="-";g=0<g||0<j?g+":":"";return g+(((g||10<=h)&&10>e?"0"+e:e)+":")+(10>d?"0"+d:d)};t.gd=function(){document.body.focus();document.onselectstart=r(l)};t.ge=function(){document.onselectstart=r(f)};t.trim=function(a){return(a+"").replace(/^\s+|\s+$/g,"")};t.round=function(a,c){c||(c=0);return Math.round(a*Math.pow(10,c))/Math.pow(10,c)};
11711t.Ab=function(a,c){return{length:1,start:function(){return a},end:function(){return c}}};
11712t.get=function(a,c,d,e){var g,h,j,n;d=d||m();"undefined"===typeof XMLHttpRequest&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");});h=new XMLHttpRequest;j=t.Sd(a);n=window.location;j.protocol+j.host!==n.protocol+n.host&&window.XDomainRequest&&!("withCredentials"in
11713h)?(h=new window.XDomainRequest,h.onload=function(){c(h.responseText)},h.onerror=d,h.onprogress=m(),h.ontimeout=d):(g="file:"==j.protocol||"file:"==n.protocol,h.onreadystatechange=function(){4===h.readyState&&(200===h.status||g&&0===h.status?c(h.responseText):d(h.responseText))});try{h.open("GET",a,f),e&&(h.withCredentials=f)}catch(q){d(q);return}try{h.send()}catch(v){d(v)}};
11714t.Xd=function(a){try{var c=window.localStorage||l;c&&(c.volume=a)}catch(d){22==d.code||1014==d.code?t.log("LocalStorage Full (VideoJS)",d):18==d.code?t.log("LocalStorage not allowed (VideoJS)",d):t.log("LocalStorage Error (VideoJS)",d)}};t.tc=function(a){a.match(/^https?:\/\//)||(a=t.e("div",{innerHTML:'<a href="'+a+'">x</a>'}).firstChild.href);return a};
11715t.Sd=function(a){var c,d,e,g;g="protocol hostname port pathname search hash host".split(" ");d=t.e("a",{href:a});
11715if(e=""===d.host&&"file:"!==d.protocol)c=t.e("div"),c.innerHTML='<a href="'+a+'"></a>',d=c.firstChild,c.setAttribute("style","display:none; position:absolute;"),document.body.appendChild(c);a={};for(var h=0;h<g.length;h++)a[g[h]]=d[g[h]];e&&document.body.removeChild(c);return a};function D(){}var E=window.console||{log:D,warn:D,error:D};
11716function F(a,c){var d=Array.prototype.slice.call(c);a?d.unshift(a.toUpperCase()+":"):a="log";t.log.history.push(d);d.unshift("VIDEOJS:");if(E[a].apply)E[a].apply(E,d);else E[a](d.join(" "))}t.log=function(){F(k,arguments)};t.log.history=[];t.log.error=function(){F("error",arguments)};t.log.warn=function(){F("warn",arguments)};
11717t.ud=function(a){var c,d;a.getBoundingClientRect&&a.parentNode&&(c=a.getBoundingClientRect());if(!c)return{left:0,top:0};a=document.documentElement;d=document.body;return{left:t.round(c.left+(window.pageXOffset||d.scrollLeft)-(a.clientLeft||d.clientLeft||0)),top:t.round(c.top+(window.pageYOffset||d.scrollTop)-(a.clientTop||d.clientTop||0))}};t.jc={};t.jc.forEach=function(a,c,d){if(t.h.isArray(a)&&c instanceof Function)for(var e=0,g=a.length;e<g;++e)c.call(d||t,a[e],e,a);return a};t.qa={};
11718t.qa.Nb=function(a,c){var d,e,g;a=t.h.copy(a);for(d in c)c.hasOwnProperty(d)&&(e=a[d],g=c[d],a[d]=t.h.Ua(e)&&t.h.Ua(g)?t.qa.Nb(e,g):c[d]);return a};
11719t.a=t.ra.extend({j:function(a,c,d){this.c=a;this.k=t.h.copy(this.k);c=this.options(c);this.U=c.id||(c.el&&c.el.id?c.el.id:a.id()+"_component_"+t.z++);this.Fd=c.name||k;this.b=c.el||this.e();this.N=[];this.Ra={};this.Sa={};this.wc();this.J(d);if(c.Gc!==l){var e,g;e=t.bind(this.m(),this.m().reportUserActivity);this.d("touchstart",function(){e();clearInterval(g);g=setInterval(e,250)});a=function(){e();clearInterval(g)};this.d("touchmove",e);this.d("touchend",a);this.d("touchcancel",a)}}});s=t.a.prototype;
11720s.dispose=function(){this.l({type:"dispose",bubbles:l});if(this.N)for(var a=this.N.length-1;0<=a;a--)this.N[a].dispose&&this.N[a].dispose();this.Sa=this.Ra=this.N=k;this.p();this.b.parentNode&&this.b.parentNode.removeChild(this.b);t.Fc(this.b);this.b=k};s.c=f;s.m=p("c");s.options=function(a){return a===b?this.k:this.k=t.qa.Nb(this.k,a)};s.e=function(a,c){return t.e(a,c)};s.s=function(a){var c=this.c.language(),d=this.c.Wa();return d&&d[c]&&d[c][a]?d[c][a]:a};s.w=p("b");
11721s.ja=function(){return this.v||this.b};s.id=p("U");s.name=p("Fd");s.children=p("N");s.wd=function(a){return this.Ra[a]};s.ka=function(a){return this.Sa[a]};s.R=function(a,c){var d,e;"string"===typeof a?(e=a,c=c||{},d=c.componentClass||t.ba(e),c.name=e,d=new window.videojs[d](this.c||this,c)):d=a;this.N.push(d);"function"===typeof d.id&&(this.Ra[d.id()]=d);(e=e||d.name&&d.name())&&(this.Sa[e]=d);"function"===typeof d.el&&d.el()&&this.ja().appendChild(d.el());return d};
11722s.removeChild=function(a){"string"===typeof a&&(a=this.ka(a));if(a&&this.N){for(var c=l,d=this.N.length-1;0<=d;d--)if(this.N[d]===a){c=f;this.N.splice(d,1);break}c&&(this.Ra[a.id]=k,this.Sa[a.name]=k,(c=a.w())&&c.parentNode===this.ja()&&this.ja().removeChild(a.w()))}};s.wc=function(){var a,c,d,e;a=this;if(c=this.options().children)if(t.h.isArray(c))for(var g=0;g<c.length;g++)d=c[g],"string"==typeof d?(e=d,d={}):e=d.name,a[e]=a.R(e,d);else t.h.Z(c,function(c,d){d!==l&&(a[c]=a.R(c,d))})};s.T=r("");
11723s.d=function(a,c){t.d(this.b,a,t.bind(this,c));return this};s.p=function(a,c){t.p(this.b,a,c);return this};s.V=function(a,c){t.V(this.b,a,t.bind(this,c));return this};s.l=function(a){t.l(this.b,a);return this};s.J=function(a){a&&(this.la?a.call(this):(this.cb===b&&(this.cb=[]),this.cb.push(a)));return this};s.Ha=function(){this.la=f;var a=this.cb;if(a&&0<a.length){for(var c=0,d=a.length;c<d;c++)a[c].call(this);this.cb=[];this.l("ready")}};s.n=function(a){t.n(this.b,a);return this};
11724s.q=function(a){t.q(this.b,a);return this};s.show=function(){this.b.style.display="block";return this};s.X=function(){this.b.style.display="none";return this};function G(a){a.q("vjs-lock-showing")}s.disable=function(){this.X();this.show=m()};s.width=function(a,c){return H(this,"width",a,c)};s.height=function(a,c){return H(this,"height",a,c)};s.pd=function(a,c){return this.width(a,f).height(c)};
11725function H(a,c,d,e){if(d!==b)return a.b.style[c]=-1!==(""+d).indexOf("%")||-1!==(""+d).indexOf("px")?d:"auto"===d?"":d+"px",e||a.l("resize"),a;if(!a.b)return 0;d=a.b.style[c];e=d.indexOf("px");return-1!==e?parseInt(d.slice(0,e),10):parseInt(a.b["offset"+t.ba(c)],10)}
11726function I(a){var c,d,e,g,h,j,n,q;c=0;d=k;a.d("touchstart",function(a){1===a.touches.length&&(d=a.touches[0],c=(new Date).getTime(),g=f)});a.d("touchmove",function(a){1<a.touches.length?g=l:d&&(j=a.touches[0].pageX-d.pageX,n=a.touches[0].pageY-d.pageY,q=Math.sqrt(j*j+n*n),22<q&&(g=l))});h=function(){g=l};a.d("touchleave",h);a.d("touchcancel",h);a.d("touchend",function(a){d=k;g===f&&(e=(new Date).getTime()-c,250>e&&(a.preventDefault(),this.l("tap")))})}
11727t.t=t.a.extend({j:function(a,c){t.a.call(this,a,c);I(this);this.d("tap",this.r);this.d("click",this.r);this.d("focus",this.Za);this.d("blur",this.Ya)}});s=t.t.prototype;
11728s.e=function(a,c){var d;c=t.h.A({className:this.T(),role:"button","aria-live":"polite",tabIndex:0},c);d=t.a.prototype.e.call(this,a,c);c.innerHTML||(this.v=t.e("div",{className:"vjs-control-content"}),this.yb=t.e("span",{className:"vjs-control-text",innerHTML:this.s(this.ua)||"Need Text"}),this.v.appendChild(this.yb),d.appendChild(this.v));return d};s.T=function(){return"vjs-control "+t.a.prototype.T.call(this)};s.r=m();s.Za=function(){t.d(document,"keyup",t.bind(this,this.ea))};
11729s.ea=function(a){if(32==a.which||13==a.which)a.preventDefault(),this.r()};s.Ya=function(){t.p(document,"keyup",t.bind(this,this.ea))};
11730t.Q=t.a.extend({j:function(a,c){t.a.call(this,a,c);this.fd=this.ka(this.k.barName);this.handle=this.ka(this.k.handleName);this.d("mousedown",this.$a);this.d("touchstart",this.$a);this.d("focus",this.Za);this.d("blur",this.Ya);this.d("click",this.r);this.c.d("controlsvisible",t.bind(this,this.update));a.d(this.Cc,t.bind(this,this.update));this.S={};this.S.move=t.bind(this,this.ab);this.S.end=t.bind(this,this.Ob)}});s=t.Q.prototype;
11731s.e=function(a,c){c=c||{};c.className+=" vjs-slider";c=t.h.A({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},c);return t.a.prototype.e.call(this,a,c)};s.$a=function(a){a.preventDefault();t.gd();this.n("vjs-sliding");t.d(document,"mousemove",this.S.move);t.d(document,"mouseup",this.S.end);t.d(document,"touchmove",this.S.move);t.d(document,"touchend",this.S.end);this.ab(a)};s.ab=m();
11732s.Ob=function(){t.ge();this.q("vjs-sliding");t.p(document,"mousemove",this.S.move,l);t.p(document,"mouseup",this.S.end,l);t.p(document,"touchmove",this.S.move,l);t.p(document,"touchend",this.S.end,l);this.update()};s.update=function(){if(this.b){var a,c=this.Gb(),d=this.handle,e=this.fd;isNaN(c)&&(c=0);a=c;if(d){a=this.b.offsetWidth;var g=d.w().offsetWidth;a=g?g/a:0;c*=1-a;a=c+a/2;d.w().style.left=t.round(100*c,2)+"%"}e&&(e.w().style.width=t.round(100*a,2)+"%")}};
11733function J(a,c){var d,e,g,h;d=a.b;e=t.ud(d);h=g=d.offsetWidth;d=a.handle;if(a.options().vertical)return h=e.top,e=c.changedTouches?c.changedTouches[0].pageY:c.pageY,d&&(d=d.w().offsetHeight,h+=d/2,g-=d),Math.max(0,Math.min(1,(h-e+g)/g));g=e.left;e=c.changedTouches?c.changedTouches[0].pageX:c.pageX;d&&(d=d.w().offsetWidth,g+=d/2,h-=d);return Math.max(0,Math.min(1,(e-g)/h))}s.Za=function(){t.d(document,"keyup",t.bind(this,this.ea))};
11734s.ea=function(a){if(37==a.which||40==a.which)a.preventDefault(),this.Kc();else if(38==a.which||39==a.which)a.preventDefault(),this.Lc()};s.Ya=function(){t.p(document,"keyup",t.bind(this,this.ea))};s.r=function(a){a.stopImmediatePropagation();a.preventDefault()};t.$=t.a.extend();t.$.prototype.defaultValue=0;
11735t.$.prototype.e=function(a,c){c=c||{};c.className+=" vjs-slider-handle";c=t.h.A({innerHTML:'<span class="vjs-control-text">'+this.defaultValue+"</span>"},c);return t.a.prototype.e.call(this,"div",c)};t.ha=t.a.extend();function ca(a,c){a.R(c);c.d("click",t.bind(a,function(){G(this)}))}
11736t.ha.prototype.e=function(){var a=this.options().mc||"ul";this.v=t.e(a,{className:"vjs-menu-content"});a=t.a.prototype.e.call(this,"div",{append:this.v,className:"vjs-menu"});a.appendChild(this.v);t.d(a,"click",function(a){a.preventDefault();a.stopImmediatePropagation()});return a};t.I=t.t.extend({j:function(a,c){t.t.call(this,a,c);this.selected(c.selected)}});t.I.prototype.e=function(a,c){return t.t.prototype.e.call(this,"li",t.h.A({className:"vjs-menu-item",innerHTML:this.k.label},c))};
11737t.I.prototype.r=function(){this.selected(f)};t.I.prototype.selected=function(a){a?(this.n("vjs-selected"),this.b.setAttribute("aria-selected",f)):(this.q("vjs-selected"),this.b.setAttribute("aria-selected",l))};t.L=t.t.extend({j:function(a,c){t.t.call(this,a,c);this.Ba=this.xa();this.R(this.Ba);this.O&&0===this.O.length&&this.X();this.d("keyup",this.ea);this.b.setAttribute("aria-haspopup",f);this.b.setAttribute("role","button")}});s=t.L.prototype;s.ta=l;
11738s.xa=function(){var a=new t.ha(this.c);this.options().title&&a.ja().appendChild(t.e("li",{className:"vjs-menu-title",innerHTML:t.ba(this.options().title),de:-1}));if(this.O=this.createItems())for(var c=0;c<this.O.length;c++)ca(a,this.O[c]);return a};s.wa=m();s.T=function(){return this.className+" vjs-menu-button "+t.t.prototype.T.call(this)};s.Za=m();s.Ya=m();s.r=function(){this.V("mouseout",t.bind(this,function(){G(this.Ba);this.b.blur()}));this.ta?K(this):L(this)};
11739s.ea=function(a){a.preventDefault();32==a.which||13==a.which?this.ta?K(this):L(this):27==a.which&&this.ta&&K(this)};function L(a){a.ta=f;a.Ba.n("vjs-lock-showing");a.b.setAttribute("aria-pressed",f);a.O&&0<a.O.length&&a.O[0].w().focus()}function K(a){a.ta=l;G(a.Ba);a.b.setAttribute("aria-pressed",l)}
11739t.G=function(a){"number"===typeof a?this.code=a:"string"===typeof a?this.message=a:"object"===typeof a&&t.h.A(this,a);this.message||(this.message=t.G.nd[this.code]||"")};t.G.prototype.code=0;
11740t.G.prototype.message="";t.G.prototype.status=k;t.G.Ta="MEDIA_ERR_CUSTOM MEDIA_ERR_ABORTED MEDIA_ERR_NETWORK MEDIA_ERR_DECODE MEDIA_ERR_SRC_NOT_SUPPORTED MEDIA_ERR_ENCRYPTED".split(" ");
11741t.G.nd={1:"You aborted the video playback",2:"A network error caused the video download to fail part-way.",3:"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.",4:"The video could not be loaded, either because the server or network failed or because the format is not supported.",5:"The video is encrypted and we do not have the keys to decrypt it."};for(var M=0;M<t.G.Ta.length;M++)t.G[t.G.Ta[M]]=M,t.G.prototype[t.G.Ta[M]]=M;
11742var N,O,P,Q;
11743N=["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror".split(" "),"webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror".split(" "),"webkitRequestFullScreen webkitCancelFullScreen webkitCurrentFullScreenElement webkitCancelFullScreen webkitfullscreenchange webkitfullscreenerror".split(" "),"mozRequestFullScreen mozCancelFullScreen mozFullScreenElement mozFullScreenEnabled mozfullscreenchange mozfullscreenerror".split(" "),"msRequestFullscreen msExitFullscreen msFullscreenElement msFullscreenEnabled MSFullscreenChange MSFullscreenError".split(" ")];
11744O=N[0];for(Q=0;Q<N.length;Q++)if(N[Q][1]in document){P=N[Q];break}if(P){t.Qa.Fb={};for(Q=0;Q<P.length;Q++)t.Qa.Fb[O[Q]]=P[Q]}
11745t.Player=t.a.extend({j:function(a,c,d){this.P=a;a.id=a.id||"vjs_video_"+t.z++;this.ee=a&&t.Aa(a);c=t.h.A(da(a),c);this.Va=c.language||t.options.language;this.Dd=c.languages||t.options.languages;this.C={};this.Dc=c.poster;this.zb=c.controls;a.controls=l;c.Gc=l;t.a.call(this,this,c,d);this.controls()?this.n("vjs-controls-enabled"):this.n("vjs-controls-disabled");t.Ca[this.U]=this;c.plugins&&t.h.Z(c.plugins,function(a,c){this[a](c)},this);var e,g,h,j,n,q;e=t.bind(this,this.reportUserActivity);this.d("mousedown",
11746function(){e();clearInterval(g);g=setInterval(e,250)});this.d("mousemove",function(a){if(a.screenX!=n||a.screenY!=q)n=a.screenX,q=a.screenY,e()});this.d("mouseup",function(){e();clearInterval(g)});this.d("keydown",e);this.d("keyup",e);h=setInterval(t.bind(this,function(){this.pa&&(this.pa=l,this.userActive(f),clearTimeout(j),j=setTimeout(t.bind(this,function(){this.pa||this.userActive(l)}),2E3))}),250);this.d("dispose",function(){clearInterval(h);clearTimeout(j)})}});s=t.Player.prototype;
11747s.language=function(a){if(a===b)return this.Va;this.Va=a;return this};s.Wa=p("Dd");s.k=t.options;s.dispose=function(){this.l("dispose");this.p("dispose");t.Ca[this.U]=k;this.P&&this.P.player&&(this.P.player=k);this.b&&this.b.player&&(this.b.player=k);clearInterval(this.bb);this.Ea();this.i&&this.i.dispose();t.a.prototype.dispose.call(this)};
11748function da(a){var c={sources:[],tracks:[]};t.h.A(c,t.Aa(a));if(a.hasChildNodes()){var d,e,g,h;a=a.childNodes;g=0;for(h=a.length;g<h;g++)d=a[g],e=d.nodeName.toLowerCase(),"source"===e?c.sources.push(t.Aa(d)):"track"===e&&c.tracks.push(t.Aa(d))}return c}
11749s.e=function(){var a=this.b=t.a.prototype.e.call(this,"div"),c=this.P,d;c.removeAttribute("width");c.removeAttribute("height");if(c.hasChildNodes()){var e,g,h,j,n;e=c.childNodes;g=e.length;for(n=[];g--;)h=e[g],j=h.nodeName.toLowerCase(),"track"===j&&n.push(h);for(e=0;e<n.length;e++)c.removeChild(n[e])}d=t.Aa(c);t.h.Z(d,function(c){a.setAttribute(c,d[c])});c.id+="_html5_api";c.className="vjs-tech";c.player=a.player=this;this.n("vjs-paused");this.width(this.k.width,f);this.height(this.k.height,f);c.parentNode&&
11750c.parentNode.insertBefore(a,c);t.Hb(c,a);this.b=a;this.d("loadstart",this.Kd);this.d("waiting",this.Qd);this.d(["canplay","canplaythrough","playing","ended"],this.Pd);this.d("seeking",this.Nd);this.d("seeked",this.Md);this.d("ended",this.Gd);this.d("play",this.Qb);this.d("firstplay",this.Id);this.d("pause",this.Pb);this.d("progress",this.Ld);
11750this.d("durationchange",this.Ac);this.d("fullscreenchange",this.Jd);return a};
11751function R(a,c,d){a.i&&(a.la=l,a.Lb&&(a.Lb=l,clearInterval(a.bb)),a.Mb&&S(a),a.i.dispose(),a.i=l);"Html5"!==c&&a.P&&(t.g.Cb(a.P),a.P=k);a.fb=c;a.la=l;var e=t.h.A({source:d,parentEl:a.b},a.k[c.toLowerCase()]);d&&(a.oc=d.type,d.src==a.C.src&&0<a.C.currentTime&&(e.startTime=a.C.currentTime),a.C.src=d.src);a.i=new window.videojs[c](a,e);a.i.J(function(){this.c.Ha();if(!this.o.progressEvents){var a=this.c;a.Lb=f;a.bb=setInterval(t.bind(a,function(){var a=this.bufferedPercent();this.C.bufferedPercent!=
11752a&&this.l("progress");this.C.bufferedPercent=a;1==a&&clearInterval(this.bb)}),500);a.i&&a.i.V("progress",function(){this.o.progressEvents=f;var a=this.c;a.Lb=l;clearInterval(a.bb)})}this.o.timeupdateEvents||(a=this.c,a.Mb=f,a.d("play",a.Oc),a.d("pause",a.Ea),a.i&&a.i.V("timeupdate",function(){this.o.timeupdateEvents=f;S(this.c)}))})}function S(a){a.Mb=l;a.Ea();a.p("play",a.Oc);a.p("pause",a.Ea)}s.Oc=function(){this.nc&&this.Ea();this.nc=setInterval(t.bind(this,function(){this.l("timeupdate")}),250)};
11753s.Ea=function(){clearInterval(this.nc);this.l("timeupdate")};s.Kd=function(){this.error(k);this.paused()?(ea(this,l),this.V("play",function(){ea(this,f)})):this.l("firstplay")};s.vc=l;function ea(a,c){c!==b&&a.vc!==c&&((a.vc=c)?(a.n("vjs-has-started"),a.l("firstplay")):a.q("vjs-has-started"))}s.Qb=function(){this.q("vjs-paused");this.n("vjs-playing")};s.Qd=function(){this.n("vjs-waiting")};s.Pd=function(){this.q("vjs-waiting")};s.Nd=function(){this.n("vjs-seeking")};s.Md=function(){this.q("vjs-seeking")};
11754s.Id=function(){this.k.starttime&&this.currentTime(this.k.starttime);this.n("vjs-has-started")};s.Pb=function(){this.q("vjs-playing");this.n("vjs-paused")};s.Ld=function(){1==this.bufferedPercent()&&this.l("loadedalldata")};s.Gd=function(){this.k.loop&&(this.currentTime(0),this.play())};s.Ac=function(){var a=T(this,"duration");a&&(0>a&&(a=Infinity),this.duration(a),Infinity===a?this.n("vjs-live"):this.q("vjs-live"))};s.Jd=function(){this.isFullscreen()?this.n("vjs-fullscreen"):this.q("vjs-fullscreen")};
11755function U(a,c,d){if(a.i&&!a.i.la)a.i.J(function(){this[c](d)});else try{a.i[c](d)}catch(e){throw t.log(e),e;}}function T(a,c){if(a.i&&a.i.la)try{return a.i[c]()}catch(d){throw a.i[c]===b?t.log("Video.js: "+c+" method not defined for "+a.fb+" playback technology.",d):"TypeError"==d.name?(t.log("Video.js: "+c+" unavailable on "+a.fb+" playback technology element.",d),a.i.la=l):t.log(d),d;}}s.play=function(){U(this,"play");return this};s.pause=function(){U(this,"pause");return this};
11756s.paused=function(){return T(this,"paused")===l?l:f};s.currentTime=function(a){return a!==b?(U(this,"setCurrentTime",a),this.Mb&&this.l("timeupdate"),this):this.C.currentTime=T(this,"currentTime")||0};s.duration=function(a){if(a!==b)return this.C.duration=parseFloat(a),this;this.C.duration===b&&this.Ac();return this.C.duration||0};s.remainingTime=function(){return this.duration()-this.currentTime()};s.buffered=function(){var a=T(this,"buffered");if(!a||!a.length)a=t.Ab(0,0);return a};
11757s.bufferedPercent=function(){var a=this.duration(),c=this.buffered(),d=0,e,g;if(!a)return 0;for(var h=0;h<c.length;h++)e=c.start(h),g=c.end(h),g>a&&(g=a),d+=g-e;return d/a};s.volume=function(a){if(a!==b)return a=Math.max(0,Math.min(1,parseFloat(a))),this.C.volume=a,U(this,"setVolume",a),t.Xd(a),this;a=parseFloat(T(this,"volume"));return isNaN(a)?1:a};s.muted=function(a){return a!==b?(U(this,"setMuted",a),this):T(this,"muted")||l};s.Fa=function(){return T(this,"supportsFullScreen")||l};s.xc=l;
11758s.isFullscreen=function(a){return a!==b?(this.xc=!!a,this):this.xc};s.isFullScreen=function(a){t.log.warn('player.isFullScreen() has been deprecated, use player.isFullscreen() with a lowercase "s")');return this.isFullscreen(a)};
11759s.requestFullscreen=function(){var a=t.Qa.Fb;this.isFullscreen(f);a?(t.d(document,a.fullscreenchange,t.bind(this,function(c){this.isFullscreen(document[a.fullscreenElement]);this.isFullscreen()===l&&t.p(document,a.fullscreenchange,arguments.callee);this.l("fullscreenchange")})),this.b[a.requestFullscreen]()):this.i.Fa()?U(this,"enterFullScreen"):(this.qc(),this.l("fullscreenchange"));return this};
11760s.exitFullscreen=function(){var a=t.Qa.Fb;this.isFullscreen(l);if(a)document[a.exitFullscreen]();
11760else this.i.Fa()?U(this,"exitFullScreen"):(this.Db(),this.l("fullscreenchange"));return this};s.qc=function(){this.zd=f;this.qd=document.documentElement.style.overflow;t.d(document,"keydown",t.bind(this,this.sc));document.documentElement.style.overflow="hidden";t.n(document.body,"vjs-full-window");this.l("enterFullWindow")};
11761s.sc=function(a){27===a.keyCode&&(this.isFullscreen()===f?this.exitFullscreen():this.Db())};s.Db=function(){this.zd=l;t.p(document,"keydown",this.sc);document.documentElement.style.overflow=this.qd;t.q(document.body,"vjs-full-window");this.l("exitFullWindow")};
11762s.src=function(a){if(a===b)return T(this,"src");t.h.isArray(a)?fa(this,a):"string"===typeof a?this.src({src:a}):a instanceof Object&&(a.type&&!window.videojs[this.fb].canPlaySource(a)?fa(this,[a]):(this.C.src=a.src,this.oc=a.type||"",this.J(function(){U(this,"src",a.src);"auto"==this.k.preload&&this.load();this.k.autoplay&&this.play()})));return this};
11763function fa(a,c){var d;a:{d=0;for(var e=a.k.techOrder;d<e.length;d++){var g=t.ba(e[d]),h=window.videojs[g];if(h){if(h.isSupported())for(var j=0,n=c;j<n.length;j++){var q=n[j];if(h.canPlaySource(q)){d={source:q,i:g};break a}}}else t.log.error('The "'+g+'" tech is undefined. Skipped browser support check for that tech.')}d=l}d?d.i===a.fb?a.src(d.source):R(a,d.i,d.source):(a.error({code:4,message:a.options().notSupportedMessage}),a.Ha())}s.load=function(){U(this,"load");return this};
11764s.currentSrc=function(){return T(this,"currentSrc")||this.C.src||""};s.ld=function(){return this.oc||""};s.Da=function(a){return a!==b?(U(this,"setPreload",a),this.k.preload=a,this):T(this,"preload")};s.autoplay=function(a){return a!==b?(U(this,"setAutoplay",a),this.k.autoplay=a,this):T(this,"autoplay")};s.loop=function(a){return a!==b?(U(this,"setLoop",a),this.k.loop=a,this):T(this,"loop")};s.poster=function(a){if(a===b)return this.Dc;this.Dc=a;U(this,"setPoster",a);this.l("posterchange")};
11765s.controls=function(a){return a!==b?(a=!!a,this.zb!==a&&((this.zb=a)?(this.q("vjs-controls-disabled"),this.n("vjs-controls-enabled"),this.l("controlsenabled")):(this.q("vjs-controls-enabled"),this.n("vjs-controls-disabled"),this.l("controlsdisabled"))),this):this.zb};t.Player.prototype.Ub;s=t.Player.prototype;
11766s.usingNativeControls=function(a){return a!==b?(a=!!a,this.Ub!==a&&((this.Ub=a)?(this.n("vjs-using-native-controls"),this.l("usingnativecontrols")):(this.q("vjs-using-native-controls"),this.l("usingcustomcontrols"))),this):this.Ub};s.da=k;s.error=function(a){if(a===b)return this.da;if(a===k)return this.da=a,this.q("vjs-error"),this;this.da=a instanceof t.G?a:new t.G(a);this.l("error");this.n("vjs-error");t.log.error("(CODE:"+this.da.code+" "+t.G.Ta[this.da.code]+")",this.da.message,this.da);return this};
11767s.ended=function(){return T(this,"ended")};s.seeking=function(){return T(this,"seeking")};s.pa=f;s.reportUserActivity=function(){this.pa=f};s.Tb=f;s.userActive=function(a){return a!==b?(a=!!a,a!==this.Tb&&((this.Tb=a)?(this.pa=f,this.q("vjs-user-inactive"),this.n("vjs-user-active"),this.l("useractive")):(this.pa=l,this.i&&this.i.V("mousemove",function(a){a.stopPropagation();a.preventDefault()}),this.q("vjs-user-active"),this.n("vjs-user-inactive"),this.l("userinactive"))),this):this.Tb};
11768s.playbackRate=function(a){return a!==b?(U(this,"setPlaybackRate",a),this):this.i&&this.i.o&&this.i.o.playbackRate?T(this,"playbackRate"):1};t.Ka=t.a.extend();t.Ka.prototype.k={oe:"play",children:{playToggle:{},currentTimeDisplay:{},timeDivider:{},durationDisplay:{},remainingTimeDisplay:{},liveDisplay:{},progressControl:{},fullscreenToggle:{},volumeControl:{},muteToggle:{},playbackRateMenuButton:{}}};t.Ka.prototype.e=function(){return t.e("div",{className:"vjs-control-bar"})};
11769t.Zb=t.a.extend({j:function(a,c){t.a.call(this,a,c)}});t.Zb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-live-controls vjs-control"});this.v=t.e("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.s("Stream Type")+"</span>"+this.s("LIVE"),"aria-live":"off"});a.appendChild(this.v);return a};t.bc=t.t.extend({j:function(a,c){t.t.call(this,a,c);a.d("play",t.bind(this,this.Qb));a.d("pause",t.bind(this,this.Pb))}});s=t.bc.prototype;s.ua="Play";
11770s.T=function(){return"vjs-play-control "+t.t.prototype.T.call(this)};s.r=function(){this.c.paused()?this.c.play():this.c.pause()};s.Qb=function(){t.q(this.b,"vjs-paused");t.n(this.b,"vjs-playing");this.b.children[0].children[0].innerHTML=this.s("Pause")};s.Pb=function(){t.q(this.b,"vjs-playing");t.n(this.b,"vjs-paused");this.b.children[0].children[0].innerHTML=this.s("Play")};
11770t.ib=t.a.extend({j:function(a,c){t.a.call(this,a,c);a.d("timeupdate",t.bind(this,this.ga))}});
11771t.ib.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});this.v=t.e("div",{className:"vjs-current-time-display",innerHTML:'<span class="vjs-control-text">Current Time </span>0:00',"aria-live":"off"});a.appendChild(this.v);return a};t.ib.prototype.ga=function(){var a=this.c.eb?this.c.C.currentTime:this.c.currentTime();this.v.innerHTML='<span class="vjs-control-text">'+this.s("Current Time")+"</span> "+t.za(a,this.c.duration())};
11772t.jb=t.a.extend({j:function(a,c){t.a.call(this,a,c);a.d("timeupdate",t.bind(this,this.ga))}});t.jb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});this.v=t.e("div",{className:"vjs-duration-display",innerHTML:'<span class="vjs-control-text">'+this.s("Duration Time")+"</span> 0:00","aria-live":"off"});a.appendChild(this.v);return a};
11773t.jb.prototype.ga=function(){var a=this.c.duration();a&&(this.v.innerHTML='<span class="vjs-control-text">'+this.s("Duration Time")+"</span> "+t.za(a))};t.hc=t.a.extend({j:function(a,c){t.a.call(this,a,c)}});t.hc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-time-divider",innerHTML:"<div><span>/</span></div>"})};t.qb=t.a.extend({j:function(a,c){t.a.call(this,a,c);a.d("timeupdate",t.bind(this,this.ga))}});
11774t.qb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});this.v=t.e("div",{className:"vjs-remaining-time-display",innerHTML:'<span class="vjs-control-text">'+this.s("Remaining Time")+"</span> -0:00","aria-live":"off"});a.appendChild(this.v);return a};t.qb.prototype.ga=function(){this.c.duration()&&(this.v.innerHTML='<span class="vjs-control-text">'+this.s("Remaining Time")+"</span> -"+t.za(this.c.remainingTime()))};
11775t.La=t.t.extend({j:function(a,c){t.t.call(this,a,c)}});t.La.prototype.ua="Fullscreen";t.La.prototype.T=function(){return"vjs-fullscreen-control "+t.t.prototype.T.call(this)};t.La.prototype.r=function(){this.c.isFullscreen()?(this.c.exitFullscreen(),this.yb.innerHTML=this.s("Fullscreen")):(this.c.requestFullscreen(),this.yb.innerHTML=this.s("Non-Fullscreen"))};t.pb=t.a.extend({j:function(a,c){t.a.call(this,a,c)}});t.pb.prototype.k={children:{seekBar:{}}};
11776t.pb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-progress-control vjs-control"})};t.dc=t.Q.extend({j:function(a,c){t.Q.call(this,a,c);a.d("timeupdate",t.bind(this,this.oa));a.J(t.bind(this,this.oa))}});s=t.dc.prototype;s.k={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"};s.Cc="timeupdate";s.e=function(){return t.Q.prototype.e.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})};
11777s.oa=function(){var a=this.c.eb?this.c.C.currentTime:this.c.currentTime();this.b.setAttribute("aria-valuenow",t.round(100*this.Gb(),2));this.b.setAttribute("aria-valuetext",t.za(a,this.c.duration()))};s.Gb=function(){return this.c.currentTime()/this.c.duration()};s.$a=function(a){t.Q.prototype.$a.call(this,a);this.c.eb=f;this.ie=!this.c.paused();this.c.pause()};s.ab=function(a){a=J(this,a)*this.c.duration();a==this.c.duration()&&(a-=0.1);this.c.currentTime(a)};
11778s.Ob=function(a){t.Q.prototype.Ob.call(this,a);this.c.eb=l;this.ie&&this.c.play()};s.Lc=function(){this.c.currentTime(this.c.currentTime()+5)};s.Kc=function(){this.c.currentTime(this.c.currentTime()-5)};t.mb=t.a.extend({j:function(a,c){t.a.call(this,a,c);a.d("progress",t.bind(this,this.update))}});t.mb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.s("Loaded")+"</span>: 0%</span>"})};
11779t.mb.prototype.update=function(){var a,c,d,e,g=this.c.buffered();a=this.c.duration();var h,j=this.c;h=j.buffered();j=j.duration();h=h.end(h.length-1);h>j&&(h=j);j=this.b.children;this.b.style.width=100*(h/a||0)+"%";for(a=0;a<g.length;a++)c=g.start(a),d=g.end(a),(e=j[a])||(e=this.b.appendChild(t.e())),e.style.left=100*(c/h||0)+"%",e.style.width=100*((d-c)/h||0)+"%";for(a=j.length;a>g.length;a--)this.b.removeChild(j[a-1])};t.ac=t.a.extend({j:function(a,c){t.a.call(this,a,c)}});
11780t.ac.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-play-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.s("Progress")+"</span>: 0%</span>"})};t.Na=t.$.extend({j:function(a,c){t.$.call(this,a,c);a.d("timeupdate",t.bind(this,this.ga))}});t.Na.prototype.defaultValue="00:00";t.Na.prototype.e=function(){return t.$.prototype.e.call(this,"div",{className:"vjs-seek-handle","aria-live":"off"})};
11781t.Na.prototype.ga=function(){var a=this.c.eb?this.c.C.currentTime:this.c.currentTime();this.b.innerHTML='<span class="vjs-control-text">'+t.za(a,this.c.duration())+"</span>"};t.sb=t.a.extend({j:function(a,c){t.a.call(this,a,c);a.i&&(a.i.o&&a.i.o.volumeControl===l)&&this.n("vjs-hidden");a.d("loadstart",t.bind(this,function(){a.i.o&&a.i.o.volumeControl===l?this.n("vjs-hidden"):this.q("vjs-hidden")}))}});t.sb.prototype.k={children:{volumeBar:{}}};
11782t.sb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-control vjs-control"})};t.rb=t.Q.extend({j:function(a,c){t.Q.call(this,a,c);a.d("volumechange",t.bind(this,this.oa));a.J(t.bind(this,this.oa))}});s=t.rb.prototype;s.oa=function(){this.b.setAttribute("aria-valuenow",t.round(100*this.c.volume(),2));this.b.setAttribute("aria-valuetext",t.round(100*this.c.volume(),2)+"%")};s.k={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"};
11783s.Cc="volumechange";s.e=function(){return t.Q.prototype.e.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})};s.ab=function(a){this.c.muted()&&this.c.muted(l);this.c.volume(J(this,a))};s.Gb=function(){return this.c.muted()?0:this.c.volume()};s.Lc=function(){this.c.volume(this.c.volume()+0.1)};s.Kc=function(){this.c.volume(this.c.volume()-0.1)};
11783t.ic=t.a.extend({j:function(a,c){t.a.call(this,a,c)}});
11784t.ic.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})};t.tb=t.$.extend();t.tb.prototype.defaultValue="00:00";t.tb.prototype.e=function(){return t.$.prototype.e.call(this,"div",{className:"vjs-volume-handle"})};
11785t.ia=t.t.extend({j:function(a,c){t.t.call(this,a,c);a.d("volumechange",t.bind(this,this.update));a.i&&(a.i.o&&a.i.o.volumeControl===l)&&this.n("vjs-hidden");a.d("loadstart",t.bind(this,function(){a.i.o&&a.i.o.volumeControl===l?this.n("vjs-hidden"):this.q("vjs-hidden")}))}});t.ia.prototype.e=function(){return t.t.prototype.e.call(this,"div",{className:"vjs-mute-control vjs-control",innerHTML:'<div><span class="vjs-control-text">'+this.s("Mute")+"</span></div>"})};
11786t.ia.prototype.r=function(){this.c.muted(this.c.muted()?l:f)};t.ia.prototype.update=function(){var a=this.c.volume(),c=3;0===a||this.c.muted()?c=0:0.33>a?c=1:0.67>a&&(c=2);this.c.muted()?this.b.children[0].children[0].innerHTML!=this.s("Unmute")&&(this.b.children[0].children[0].innerHTML=this.s("Unmute")):this.b.children[0].children[0].innerHTML!=this.s("Mute")&&(this.b.children[0].children[0].innerHTML=this.s("Mute"));for(a=0;4>a;a++)t.q(this.b,"vjs-vol-"+a);t.n(this.b,"vjs-vol-"+c)};
11787t.sa=t.L.extend({j:function(a,c){t.L.call(this,a,c);a.d("volumechange",t.bind(this,this.update));a.i&&(a.i.o&&a.i.o.Rc===l)&&this.n("vjs-hidden");a.d("loadstart",t.bind(this,function(){a.i.o&&a.i.o.Rc===l?this.n("vjs-hidden"):this.q("vjs-hidden")}));this.n("vjs-menu-button")}});t.sa.prototype.xa=function(){var a=new t.ha(this.c,{mc:"div"}),c=new t.rb(this.c,t.h.A({vertical:f},this.k.ue));a.R(c);return a};t.sa.prototype.r=function(){t.ia.prototype.r.call(this);t.L.prototype.r.call(this)};
11788t.sa.prototype.e=function(){return t.t.prototype.e.call(this,"div",{className:"vjs-volume-menu-button vjs-menu-button vjs-control",innerHTML:'<div><span class="vjs-control-text">'+this.s("Mute")+"</span></div>"})};t.sa.prototype.update=t.ia.prototype.update;t.cc=t.L.extend({j:function(a,c){t.L.call(this,a,c);this.Qc();this.Pc();a.d("loadstart",t.bind(this,this.Qc));a.d("ratechange",t.bind(this,this.Pc))}});s=t.cc.prototype;
11789s.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-playback-rate vjs-menu-button vjs-control",innerHTML:'<div class="vjs-control-content"><span class="vjs-control-text">'+this.s("Playback Rate")+"</span></div>"});this.zc=t.e("div",{className:"vjs-playback-rate-value",innerHTML:1});a.appendChild(this.zc);return a};s.xa=function(){var a=new t.ha(this.m()),c=this.m().options().playbackRates;if(c)for(var d=c.length-1;0<=d;d--)a.R(new t.ob(this.m(),{rate:c[d]+"x"}));return a};
11790s.oa=function(){this.w().setAttribute("aria-valuenow",this.m().playbackRate())};s.r=function(){for(var a=this.m().playbackRate(),c=this.m().options().playbackRates,d=c[0],e=0;e<c.length;e++)if(c[e]>a){d=c[e];break}this.m().playbackRate(d)};function ga(a){return a.m().i&&a.m().i.o.playbackRate&&a.m().options().playbackRates&&0<a.m().options().playbackRates.length}s.Qc=function(){ga(this)?this.q("vjs-hidden"):this.n("vjs-hidden")};
11791s.Pc=function(){ga(this)&&(this.zc.innerHTML=this.m().playbackRate()+"x")};t.ob=t.I.extend({mc:"button",j:function(a,c){var d=this.label=c.rate,e=this.Ec=parseFloat(d,10);c.label=d;c.selected=1===e;t.I.call(this,a,c);this.m().d("ratechange",t.bind(this,this.update))}});t.ob.prototype.r=function(){t.I.prototype.r.call(this);this.m().playbackRate(this.Ec)};t.ob.prototype.update=function(){this.selected(this.m().playbackRate()==this.Ec)};
11792t.Ma=t.t.extend({j:function(a,c){t.t.call(this,a,c);a.poster()&&this.src(a.poster());(!a.poster()||!a.controls())&&this.X();a.d("posterchange",t.bind(this,function(){this.src(a.poster())}));a.d("play",t.bind(this,this.X))}});var ha="backgroundSize"in t.B.style;t.Ma.prototype.e=function(){var a=t.e("div",{className:"vjs-poster",tabIndex:-1});ha||a.appendChild(t.e("img"));return a};t.Ma.prototype.src=function(a){var c=this.w();a!==b&&(ha?c.style.backgroundImage='url("'+a+'")':c.firstChild.src=a)};
11793t.Ma.prototype.r=function(){this.m().controls()&&this.c.play()};
11793t.$b=t.a.extend({j:function(a,c){t.a.call(this,a,c)}});t.$b.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-loading-spinner"})};t.gb=t.t.extend();t.gb.prototype.e=function(){return t.t.prototype.e.call(this,"div",{className:"vjs-big-play-button",innerHTML:'<span aria-hidden="true"></span>',"aria-label":"play video"})};t.gb.prototype.r=function(){this.c.play()};
11794t.kb=t.a.extend({j:function(a,c){t.a.call(this,a,c);this.update();a.d("error",t.bind(this,this.update))}});t.kb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-error-display"});this.v=t.e("div");a.appendChild(this.v);return a};t.kb.prototype.update=function(){this.m().error()&&(this.v.innerHTML=this.s(this.m().error().message))};
11795t.u=t.a.extend({j:function(a,c,d){c=c||{};c.Gc=l;t.a.call(this,a,c,d);var e,g;g=this;e=this.m();a=function(){if(e.controls()&&!e.usingNativeControls()){var a;g.d("mousedown",g.r);g.d("touchstart",function(){a=this.c.userActive()});g.d("touchmove",function(){a&&this.m().reportUserActivity()});g.d("touchend",function(a){a.preventDefault()});I(g);g.d("tap",g.Od)}};c=t.bind(g,g.Ud);this.J(a);e.d("controlsenabled",a);e.d("controlsdisabled",c);this.J(function(){this.networkState&&0<this.networkState()&&
11796this.m().l("loadstart")})}});s=t.u.prototype;s.Ud=function(){this.p("tap");this.p("touchstart");this.p("touchmove");this.p("touchleave");this.p("touchcancel");this.p("touchend");this.p("click");this.p("mousedown")};s.r=function(a){0===a.button&&this.m().controls()&&(this.m().paused()?this.m().play():this.m().pause())};s.Od=function(){this.m().userActive(!this.m().userActive())};s.Ic=m();s.o={volumeControl:f,fullscreenResize:l,playbackRate:l,progressEvents:l,timeupdateEvents:l};t.media={};
11797t.g=t.u.extend({j:function(a,c,d){this.o.volumeControl=t.g.jd();this.o.playbackRate=t.g.hd();this.o.movingMediaElementInDOM=!t.Xc;this.o.fullscreenResize=f;t.u.call(this,a,c,d);for(d=t.g.lb.length-1;0<=d;d--)t.d(this.b,t.g.lb[d],t.bind(this,this.sd));if((c=c.source)&&this.b.currentSrc!==c.src)this.b.src=c.src;if(t.fc&&a.options().nativeControlsForTouch!==l){var e,g,h,j;e=this;g=this.m();c=g.controls();e.b.controls=!!c;h=function(){e.b.controls=f};j=function(){e.b.controls=l};g.d("controlsenabled",
11798h);g.d("controlsdisabled",j);c=function(){g.p("controlsenabled",h);g.p("controlsdisabled",j)};e.d("dispose",c);g.d("usingcustomcontrols",c);g.usingNativeControls(f)}a.J(function(){this.P&&(this.k.autoplay&&this.paused())&&(delete this.P.poster,this.play())});this.Ha()}});s=t.g.prototype;s.dispose=function(){t.g.Cb(this.b);t.u.prototype.dispose.call(this)};
11799s.e=function(){var a=this.c,c=a.P,d;if(!c||this.o.movingMediaElementInDOM===l)c?(d=c.cloneNode(l),t.g.Cb(c),c=d,a.P=k):(c=t.e("video"),t.Hc(c,t.h.A(a.ee||{},{id:a.id()+"_html5_api","class":"vjs-tech"}))),c.player=a,t.Hb(c,a.w());d=["autoplay","preload","loop","muted"];for(var e=d.length-1;0<=e;e--){var g=d[e],h={};"undefined"!==typeof a.k[g]&&(h[g]=a.k[g]);t.Hc(c,h)}return c};s.sd=function(a){"error"==a.type?this.m().error(this.error().code):(a.bubbles=l,this.m().l(a))};s.play=function(){this.b.play()};
11800s.pause=function(){this.b.pause()};s.paused=function(){return this.b.paused};s.currentTime=function(){return this.b.currentTime};s.Wd=function(a){try{this.b.currentTime=a}catch(c){t.log(c,"Video is not ready. (Video.js)")}};s.duration=function(){return this.b.duration||0};s.buffered=function(){return this.b.buffered};s.volume=function(){return this.b.volume};s.be=function(a){this.b.volume=a};s.muted=function(){return this.b.muted};s.Zd=function(a){this.b.muted=a};s.width=function(){return this.b.offsetWidth};
11801s.height=function(){return this.b.offsetHeight};s.Fa=function(){return"function"==typeof this.b.webkitEnterFullScreen&&(/Android/.test(t.M)||!/Chrome|Mac OS X 10.5/.test(t.M))?f:l};s.pc=function(){var a=this.b;a.paused&&a.networkState<=a.je?(this.b.play(),setTimeout(function(){a.pause();a.webkitEnterFullScreen()},0)):a.webkitEnterFullScreen()};s.td=function(){this.b.webkitExitFullScreen()};s.src=function(a){this.b.src=a};s.load=function(){this.b.load()};s.currentSrc=function(){return this.b.currentSrc};
11802s.poster=function(){return this.b.poster};s.Ic=function(a){this.b.poster=a};s.Da=function(){return this.b.Da};s.ae=function(a){this.b.Da=a};s.autoplay=function(){return this.b.autoplay};s.Vd=function(a){this.b.autoplay=a};s.controls=function(){return this.b.controls};s.loop=function(){return this.b.loop};s.Yd=function(a){this.b.loop=a};s.error=function(){return this.b.error};s.seeking=function(){return this.b.seeking};s.ended=function(){return this.b.ended};s.playbackRate=function(){return this.b.playbackRate};
11803s.$d=function(a){this.b.playbackRate=a};s.networkState=function(){return this.b.networkState};t.g.isSupported=function(){try{t.B.volume=0.5}catch(a){return l}return!!t.B.canPlayType};t.g.wb=function(a){try{return!!t.B.canPlayType(a.type)}catch(c){return""}};t.g.jd=function(){var a=t.B.volume;t.B.volume=a/2+0.1;return a!==t.B.volume};t.g.hd=function(){var a=t.B.playbackRate;t.B.playbackRate=a/2+0.1;return a!==t.B.playbackRate};var V,ia=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,ja=/^video\/mp4/i;
11804t.g.Bc=function(){4<=t.Vb&&(V||(V=t.B.constructor.prototype.canPlayType),t.B.constructor.prototype.canPlayType=function(a){return a&&ia.test(a)?"maybe":V.call(this,a)});t.ad&&(V||(V=t.B.constructor.prototype.canPlayType),t.B.constructor.prototype.canPlayType=function(a){return a&&ja.test(a)?"maybe":V.call(this,a)})};t.g.he=function(){var a=t.B.constructor.prototype.canPlayType;t.B.constructor.prototype.canPlayType=V;V=k;return a};t.g.Bc();t.g.lb="loadstart suspend abort error emptied stalled loadedmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate progress play pause ratechange volumechange".split(" ");
11805t.g.Cb=function(a){if(a){a.player=k;for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src");if("function"===typeof a.load)try{a.load()}catch(c){}}};
11806t.f=t.u.extend({j:function(a,c,d){t.u.call(this,a,c,d);var e=c.source;d=c.parentEl;var g=this.b=t.e("div",{id:a.id()+"_temp_flash"}),h=a.id()+"_flash_api",j=a.k,j=t.h.A({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:j.autoplay,preload:j.Da,loop:j.loop,muted:j.muted},c.flashVars),n=t.h.A({wmode:"opaque",bgcolor:"#000000"},c.params),h=t.h.A({id:h,name:h,"class":"vjs-tech"},c.attributes);e&&(e.type&&t.f.Bd(e.type)?
11807(e=t.f.Mc(e.src),j.rtmpConnection=encodeURIComponent(e.xb),j.rtmpStream=encodeURIComponent(e.Sb)):j.src=encodeURIComponent(t.tc(e.src)));t.Hb(g,d);c.startTime&&this.J(function(){this.load();this.play();this.currentTime(c.startTime)});t.Wc&&this.J(function(){t.d(this.w(),"mousemove",t.bind(this,function(){this.m().l({type:"mousemove",bubbles:l})}))});a.d("stageclick",a.reportUserActivity);this.b=t.f.rd(c.swf,g,j,n,h)}});t.f.prototype.dispose=function(){t.u.prototype.dispose.call(this)};
11808t.f.prototype.play=function(){this.b.vjs_play()};t.f.prototype.pause=function(){this.b.vjs_pause()};t.f.prototype.src=function(a){if(a===b)return this.currentSrc();t.f.Ad(a)?(a=t.f.Mc(a),this.qe(a.xb),this.re(a.Sb)):(a=t.tc(a),this.b.vjs_src(a));if(this.c.autoplay()){var c=this;setTimeout(function(){c.play()},0)}};t.f.prototype.setCurrentTime=function(a){this.Ed=a;this.b.vjs_setProperty("currentTime",a)};t.f.prototype.currentTime=function(){return this.seeking()?this.Ed||0:this.b.vjs_getProperty("currentTime")};
11809t.f.prototype.currentSrc=function(){var a=this.b.vjs_getProperty("currentSrc");if(a==k){var c=this.rtmpConnection(),d=this.rtmpStream();c&&d&&(a=t.f.ce(c,d))}return a};t.f.prototype.load=function(){this.b.vjs_load()};t.f.prototype.poster=function(){this.b.vjs_getProperty("poster")};t.f.prototype.setPoster=m();t.f.prototype.buffered=function(){return t.Ab(0,this.b.vjs_getProperty("buffered"))};t.f.prototype.Fa=r(l);t.f.prototype.pc=r(l);
11810function ka(){var a=W[X],c=a.charAt(0).toUpperCase()+a.slice(1);la["set"+c]=function(c){return this.b.vjs_setProperty(a,c)}}function ma(a){la[a]=function(){return this.b.vjs_getProperty(a)}}
11811var la=t.f.prototype,W="rtmpConnection rtmpStream preload defaultPlaybackRate playbackRate autoplay loop mediaGroup controller controls volume muted defaultMuted".split(" "),na="error networkState readyState seeking initialTime duration startOffsetTime paused played seekable ended videoTracks audioTracks videoWidth videoHeight textTracks".split(" "),X;for(X=0;X<W.length;X++)ma(W[X]),ka();for(X=0;X<na.length;X++)ma(na[X]);t.f.isSupported=function(){return 10<=t.f.version()[0]};
11812t.f.wb=function(a){if(!a.type)return"";a=a.type.replace(/;.*/,"").toLowerCase();if(a in t.f.vd||a in t.f.Nc)return"maybe"};t.f.vd={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"};t.f.Nc={"rtmp/mp4":"MP4","rtmp/flv":"FLV"};t.f.onReady=function(a){var c;if(c=(a=t.w(a))&&a.parentNode&&a.parentNode.player)a.player=c,t.f.checkReady(c.i)};t.f.checkReady=function(a){a.w()&&(a.w().vjs_getProperty?a.Ha():setTimeout(function(){t.f.checkReady(a)},50))};t.f.onEvent=function(a,c){t.w(a).player.l(c)};
11813t.f.onError=function(a,c){var d=t.w(a).player,e="FLASH: "+c;"srcnotfound"==c?d.error({code:4,message:e}):d.error(e)};t.f.version=function(){var a="0,0,0";try{a=(new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(c){try{navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(a=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(d){}}return a.split(",")};
11814t.f.rd=function(a,c,d,e,g){a=t.f.xd(a,d,e,g);a=t.e("div",{innerHTML:a}).childNodes[0];d=c.parentNode;c.parentNode.replaceChild(a,c);var h=d.childNodes[0];setTimeout(function(){h.style.display="block"},1E3);return a};
11815t.f.xd=function(a,c,d,e){var g="",h="",j="";c&&t.h.Z(c,function(a,c){g+=a+"="+c+"&amp;"});d=t.h.A({movie:a,flashvars:g,allowScriptAccess:"always",allowNetworking:"all"},d);t.h.Z(d,function(a,c){h+='<param name="'+a+'" value="'+c+'" />'});e=t.h.A({data:a,width:"100%",height:"100%"},e);t.h.Z(e,function(a,c){j+=a+'="'+c+'" '});return'<object type="application/x-shockwave-flash"'+j+">"+h+"</object>"};t.f.ce=function(a,c){return a+"&"+c};
11816t.f.Mc=function(a){var c={xb:"",Sb:""};if(!a)return c;var d=a.indexOf("&"),e;-1!==d?e=d+1:(d=e=a.lastIndexOf("/")+1,0===d&&(d=e=a.length));c.xb=a.substring(0,d);c.Sb=a.substring(e,a.length);return c};t.f.Bd=function(a){return a in t.f.Nc};t.f.cd=/^rtmp[set]?:\/\//i;t.f.Ad=function(a){return t.f.cd.test(a)};
11817t.bd=t.a.extend({j:function(a,c,d){t.a.call(this,a,c,d);if(!a.k.sources||0===a.k.sources.length){c=0;for(d=a.k.techOrder;c<d.length;c++){var e=t.ba(d[c]),g=window.videojs[e];if(g&&g.isSupported()){R(a,e);break}}}else a.src(a.k.sources)}});t.Player.prototype.textTracks=function(){return this.Ga=this.Ga||[]};
11818function oa(a,c,d,e,g){var h=a.Ga=a.Ga||[];g=g||{};g.kind=c;g.label=d;g.language=e;c=t.ba(c||"subtitles");var j=new window.videojs[c+"Track"](a,g);h.push(j);j.Bb()&&a.J(function(){setTimeout(function(){Y(j.m(),j.id())},0)})}function Y(a,c,d){for(var e=a.Ga,g=0,h=e.length,j,n;g<h;g++)j=e[g],j.id()===c?(j.show(),n=j):d&&(j.K()==d&&0<j.mode())&&j.disable();(c=n?n.K():d?d:l)&&a.l(c+"trackchange")}
11819t.D=t.a.extend({j:function(a,c){t.a.call(this,a,c);this.U=c.id||"vjs_"+c.kind+"_"+c.language+"_"+t.z++;this.Jc=c.src;this.od=c["default"]||c.dflt;this.fe=c.title;this.Va=c.srclang;this.Cd=c.label;this.ca=[];this.ub=[];this.ma=this.na=0;this.c.d("fullscreenchange",t.bind(this,this.ed))}});s=t.D.prototype;s.K=p("H");s.src=p("Jc");s.Bb=p("od");s.title=p("fe");s.language=p("Va");s.label=p("Cd");s.kd=p("ca");s.dd=p("ub");s.readyState=p("na");s.mode=p("ma");
11820s.ed=function(){this.b.style.fontSize=this.c.isFullScreen()?140*(screen.width/this.c.width())+"%":""};s.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-"+this.H+" vjs-text-track"})};s.show=function(){pa(this);this.ma=2;t.a.prototype.show.call(this)};s.X=function(){pa(this);this.ma=1;t.a.prototype.X.call(this)};
11821s.disable=function(){2==this.ma&&this.X();this.c.p("timeupdate",t.bind(this,this.update,this.U));this.c.p("ended",t.bind(this,this.reset,this.U));this.reset();this.c.ka("textTrackDisplay").removeChild(this);this.ma=0};function pa(a){0===a.na&&a.load();0===a.ma&&(a.c.d("timeupdate",t.bind(a,a.update,a.U)),a.c.d("ended",t.bind(a,a.reset,a.U)),("captions"===a.H||"subtitles"===a.H)&&a.c.ka("textTrackDisplay").R(a))}
11822s.load=function(){0===this.na&&(this.na=1,t.get(this.Jc,t.bind(this,this.Rd),t.bind(this,this.Hd)))};s.Hd=function(a){this.error=a;this.na=3;this.l("error")};s.Rd=function(a){var c,d;a=a.split("\n");for(var e="",g=1,h=a.length;g<h;g++)if(e=t.trim(a[g])){-1==e.indexOf("--\x3e")?(c=e,e=t.trim(a[++g])):c=this.ca.length;c={id:c,index:this.ca.length};d=e.split(/[\t ]+/);c.startTime=qa(d[0]);c.ya=qa(d[2]);for(d=[];a[++g]&&(e=t.trim(a[g]));)d.push(e);c.text=d.join("<br/>");this.ca.push(c)}this.na=2;this.l("loaded")};
11823function qa(a){var c=a.split(":");a=0;var d,e,g;3==c.length?(d=c[0],e=c[1],c=c[2]):(d=0,e=c[0],c=c[1]);c=c.split(/\s+/);c=c.splice(0,1)[0];c=c.split(/\.|,/);g=parseFloat(c[1]);c=c[0];a+=3600*parseFloat(d);a+=60*parseFloat(e);a+=parseFloat(c);g&&(a+=g/1E3);return a}
11824s.update=function(){if(0<this.ca.length){var a=this.c.options().trackTimeOffset||0,a=this.c.currentTime()+a;if(this.Rb===b||a<this.Rb||this.Xa<=a){var c=this.ca,d=this.c.duration(),e=0,g=l,h=[],j,n,q,v;a>=this.Xa||this.Xa===b?v=this.Eb!==b?this.Eb:0:(g=f,v=this.Kb!==b?this.Kb:c.length-1);for(;;){q=c[v];if(q.ya<=a)e=Math.max(e,q.ya),q.Pa&&(q.Pa=l);else if(a<q.startTime){if(d=Math.min(d,q.startTime),q.Pa&&(q.Pa=l),!g)break}else g?(h.splice(0,0,q),n===b&&(n=v),j=v):(h.push(q),j===b&&(j=v),n=v),d=Math.min(d,
11825q.ya),e=Math.max(e,q.startTime),q.Pa=f;if(g)if(0===v)break;else v--;else if(v===c.length-1)break;else v++}this.ub=h;this.Xa=d;this.Rb=e;this.Eb=j;this.Kb=n;j=this.ub;n="";a=0;for(c=j.length;a<c;a++)n+='<span class="vjs-tt-cue">'+j[a].text+"</span>";this.b.innerHTML=n;this.l("cuechange")}}};s.reset=function(){this.Xa=0;this.Rb=this.c.duration();this.Kb=this.Eb=0};t.Xb=t.D.extend();t.Xb.prototype.H="captions";t.ec=t.D.extend();t.ec.prototype.H="subtitles";t.Yb=t.D.extend();t.Yb.prototype.H="chapters";
11826t.gc=t.a.extend({j:function(a,c,d){t.a.call(this,a,c,d);if(a.k.tracks&&0<a.k.tracks.length){c=this.c;a=a.k.tracks;for(var e=0;e<a.length;e++)d=a[e],oa(c,d.kind,d.label,d.language,d)}}});t.gc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-text-track-display"})};t.aa=t.I.extend({j:function(a,c){var d=this.fa=c.track;c.label=d.label();c.selected=d.Bb();t.I.call(this,a,c);this.c.d(d.K()+"trackchange",t.bind(this,this.update))}});
11827t.aa.prototype.r=function(){t.I.prototype.r.call(this);Y(this.c,this.fa.U,this.fa.K())};t.aa.prototype.update=function(){this.selected(2==this.fa.mode())};t.nb=t.aa.extend({j:function(a,c){c.track={K:function(){return c.kind},m:a,label:function(){return c.kind+" off"},Bb:r(l),mode:r(l)};t.aa.call(this,a,c);this.selected(f)}});t.nb.prototype.r=function(){t.aa.prototype.r.call(this);Y(this.c,this.fa.U,this.fa.K())};
11828t.nb.prototype.update=function(){for(var a=this.c.textTracks(),c=0,d=a.length,e,g
11828=f;c<d;c++)e=a[c],e.K()==this.fa.K()&&2==e.mode()&&(g=l);this.selected(g)};t.W=t.L.extend({j:function(a,c){t.L.call(this,a,c);1>=this.O.length&&this.X()}});t.W.prototype.wa=function(){var a=[],c;a.push(new t.nb(this.c,{kind:this.H}));for(var d=0;d<this.c.textTracks().length;d++)c=this.c.textTracks()[d],c.K()===this.H&&a.push(new t.aa(this.c,{track:c}));return a};
11829t.Ia=t.W.extend({j:function(a,c,d){t.W.call(this,a,c,d);this.b.setAttribute("aria-label","Captions Menu")}});t.Ia.prototype.H="captions";t.Ia.prototype.ua="Captions";t.Ia.prototype.className="vjs-captions-button";t.Oa=t.W.extend({j:function(a,c,d){t.W.call(this,a,c,d);this.b.setAttribute("aria-label","Subtitles Menu")}});t.Oa.prototype.H="subtitles";t.Oa.prototype.ua="Subtitles";t.Oa.prototype.className="vjs-subtitles-button";
11830t.Ja=t.W.extend({j:function(a,c,d){t.W.call(this,a,c,d);this.b.setAttribute("aria-label","Chapters Menu")}});s=t.Ja.prototype;s.H="chapters";s.ua="Chapters";s.className="vjs-chapters-button";s.wa=function(){for(var a=[],c,d=0;d<this.c.textTracks().length;d++)c=this.c.textTracks()[d],c.K()===this.H&&a.push(new t.aa(this.c,{track:c}));return a};
11831s.xa=function(){for(var a=this.c.textTracks(),c=0,d=a.length,e,g,h=this.O=[];c<d;c++)if(e=a[c],e.K()==this.H)if(0===e.readyState())e.load(),e.d("loaded",t.bind(this,this.xa));else{g=e;break}a=this.Ba;a===b&&(a=new t.ha(this.c),a.ja().appendChild(t.e("li",{className:"vjs-menu-title",innerHTML:t.ba(this.H),de:-1})));if(g){e=g.ca;for(var j,c=0,d=e.length;c<d;c++)j=e[c],j=new t.hb(this.c,{track:g,cue:j}),h.push(j),a.R(j);this.R(a)}0<this.O.length&&this.show();return a};
11832t.hb=t.I.extend({j:function(a,c){var d=this.fa=c.track,e=this.cue=c.cue,g=a.currentTime();c.label=e.text;c.selected=e.startTime<=g&&g<e.ya;t.I.call(this,a,c);d.d("cuechange",t.bind(this,this.update))}});t.hb.prototype.r=function(){t.I.prototype.r.call(this);this.c.currentTime(this.cue.startTime);this.update(this.cue.startTime)};t.hb.prototype.update=function(){var a=this.cue,c=this.c.currentTime();this.selected(a.startTime<=c&&c<a.ya)};
11833t.h.A(t.Ka.prototype.k.children,{subtitlesButton:{},captionsButton:{},chaptersButton:{}});
11834if("undefined"!==typeof window.JSON&&"function"===window.JSON.parse)t.JSON=window.JSON;else{t.JSON={};var Z=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;t.JSON.parse=function(a,c){function d(a,e){var j,n,q=a[e];if(q&&"object"===typeof q)for(j in q)Object.prototype.hasOwnProperty.call(q,j)&&(n=d(q,j),n!==b?q[j]=n:delete q[j]);return c.call(a,e,q)}var e;a=String(a);Z.lastIndex=0;Z.test(a)&&(a=a.replace(Z,function(a){return"\\u"+("0000"+a.charCo
11834deAt(0).toString(16)).slice(-4)}));
11835if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof c?d({"":e},""):e;throw new SyntaxError("JSON.parse(): invalid or malformed JSON data");}}
11836t.kc=function(){var a,c,d=document.getElementsByTagName("video");if(d&&0<d.length)for(var e=0,g=d.length;e<g;e++)if((c=d[e])&&c.getAttribute)c.player===b&&(a=c.getAttribute("data-setup"),a!==k&&(a=t.JSON.parse(a||"{}"),videojs(c,a)));else{t.vb();break}else t.Sc||t.vb()};t.vb=function(){setTimeout(t.kc,1)};"complete"===document.readyState?t.Sc=f:t.V(window,"load",function(){t.Sc=f});t.vb();t.Td=function(a,c){t.Player.prototype[a]=c};var ra=this;function $(a,c){var d=a.split("."),e=ra;!(d[0]in e)&&e.execScript&&e.execScript("var "+d[0]);for(var g;d.length&&(g=d.shift());)!d.length&&c!==b?e[g]=c:e=e[g]?e[g]:e[g]={}};$("videojs",t);$("_V_",t);$("videojs.options",t.options);$("videojs.players",t.Ca);$("videojs.TOUCH_ENABLED",t.fc);$("videojs.cache",t.va);$("videojs.Component",t.a);t.a.prototype.player=t.a.prototype.m;t.a.prototype.options=t.a.prototype.options;t.a.prototype.init=t.a.prototype.j;t.a.prototype.dispose=t.a.prototype.dispose;t.a.prototype.createEl=t.a.prototype.e;t.a.prototype.contentEl=t.a.prototype.ja;t.a.prototype.el=t.a.prototype.w;t.a.prototype.addChild=t.a.prototype.R;
11837t.a.prototype.getChild=t.a.prototype.ka;t.a.prototype.getChildById=t.a.prototype.wd;t.a.prototype.children=t.a.prototype.children;t.a.prototype.initChildren=t.a.prototype.wc;t.a.prototype.removeChild=t.a.prototype.removeChild;t.a.prototype.on=t.a.prototype.d;t.a.prototype.off=t.a.prototype.p;t.a.prototype.one=t.a.prototype.V;t.a.prototype.trigger=t.a.prototype.l;t.a.prototype.triggerReady=t.a.prototype.Ha;t.a.prototype.show=t.a.prototype.show;t.a.prototype.hide=t.a.prototype.X;
11838t.a.prototype.width=t.a.prototype.width;t.a.prototype.height=t.a.prototype.height;t.a.prototype.dimensions=t.a.prototype.pd;t.a.prototype.ready=t.a.prototype.J;t.a.prototype.addClass=t.a.prototype.n;t.a.prototype.removeClass=t.a.prototype.q;t.a.prototype.buildCSSClass=t.a.prototype.T;t.a.prototype.localize=t.a.prototype.s;t.Player.prototype.ended=t.Player.prototype.ended;t.Player.prototype.enterFullWindow=t.Player.prototype.qc;t.Player.prototype.exitFullWindow=t.Player.prototype.Db;
11839t.Player.prototype.preload=t.Player.prototype.Da;t.Player.prototype.remainingTime=t.Player.prototype.remainingTime;t.Player.prototype.supportsFullScreen=t.Player.prototype.Fa;t.Player.prototype.currentType=t.Player.prototype.ld;t.Player.prototype.language=t.Player.prototype.language;t.Player.prototype.languages=t.Player.prototype.Wa;$("videojs.MediaLoader",t.bd);$("videojs.TextTrackDisplay",t.gc);$("videojs.ControlBar",t.Ka);$("videojs.Button",t.t);$("videojs.PlayToggle",t.bc);
11840$("videojs.FullscreenToggle",t.La);$("videojs.BigPlayButton",t.gb);$("videojs.LoadingSpinner",t.$b);$("videojs.CurrentTimeDisplay",t.ib);$("videojs.DurationDisplay",t.jb);$("videojs.TimeDivider",t.hc);$("videojs.RemainingTimeDisplay",t.qb);$("videojs.LiveDisplay",t.Zb);$("videojs.ErrorDisplay",t.kb);$("videojs.Slider",t.Q);$("videojs.ProgressControl",t.pb);$("videojs.SeekBar",t.dc);$("videojs.LoadProgressBar",t.mb);$("videojs.PlayProgressBar",t.ac);$("videojs.SeekHandle",t.Na);
11841$("videojs.VolumeControl",t.sb);$("videojs.VolumeBar",t.rb);$("videojs.VolumeLevel",t.ic);$("videojs.VolumeMenuButton",t.sa);$("videojs.VolumeHandle",t.tb);$("videojs.MuteToggle",t.ia);$("videojs.PosterImage",t.Ma);$("videojs.Menu",t.ha);$("videojs.MenuItem",t.I);$("videojs.MenuButton",t.L);$("videojs.PlaybackRateMenuButton",t.cc);t.L.prototype.createItems=t.L.prototype.wa;t.W.prototype.createItems=t.W.prototype.wa;t.Ja.prototype.createItems=t.Ja.prototype.wa;$("videojs.SubtitlesButton",t.Oa);
11842$("videojs.CaptionsButton",t.Ia);$("videojs.ChaptersButton",t.Ja);$("videojs.MediaTechController",t.u);t.u.prototype.features=t.u.prototype.o;t.u.prototype.o.volumeControl=t.u.prototype.o.Rc;t.u.prototype.o.fullscreenResize=t.u.prototype.o.me;t.u.prototype.o.progressEvents=t.u.prototype.o.pe;t.u.prototype.o.timeupdateEvents=t.u.prototype.o.se;t.u.prototype.setPoster=t.u.prototype.Ic;$("videojs.Html5",t.g);t.g.Events=t.g.lb;t.g.isSupported=t.g.isSupported;t.g.canPlaySource=t.g.wb;
11843t.g.patchCanPlayType=t.g.Bc;t.g.unpatchCanPlayType=t.g.he;t.g.prototype.setCurrentTime=t.g.prototype.Wd;t.g.prototype.setVolume=t.g.prototype.be;t.g.prototype.setMuted=t.g.prototype.Zd;t.g.prototype.setPreload=t.g.prototype.ae;t.g.prototype.setAutoplay=t.g.prototype.Vd;t.g.prototype.setLoop=t.g.prototype.Yd;t.g.prototype.enterFullScreen=t.g.prototype.pc;t.g.prototype.exitFullScreen=t.g.prototype.td;t.g.prototype.playbackRate=t.g.prototype.playbackRate;t.g.prototype.setPlaybackRate=t.g.prototype.$d;
11844$("videojs.Flash",t.f);t.f.isSupported=t.f.isSupported;t.f.canPlaySource=t.f.wb;t.f.onReady=t.f.onReady;$("videojs.TextTrack",t.D);t.D.prototype.label=t.D.prototype.label;t.D.prototype.kind=t.D.prototype.K;t.D.prototype.mode=t.D.prototype.mode;t.D.prototype.cues=t.D.prototype.kd;t.D.prototype.activeCues=t.D.prototype.dd;$("videojs.CaptionsTrack",t.Xb);$("videojs.SubtitlesTrack",t.ec);$("videojs.ChaptersTrack",t.Yb);$("videojs.autoSetup",t.kc);$("videojs.plugin",t.Td);$("videojs.createTimeRange",t.Ab);
11845$("videojs.util",t.qa);t.qa.mergeOptions=t.qa.Nb;})();
11846
11847
11848/* videoJS-youtube plugin */
11849!function(){function addEventListener(element,event,cb){element.addEventListener?element.addEventListener(event,cb,!0):element.attachEvent(event,cb)}function setInnerText(element,text){if("undefined"==typeof element)return!1;var textProperty="innerText"in element?"innerText":"textContent";try{element[textProperty]=text}catch(anException){element.setAttribute("innerText",text)}}videojs.Youtube=videojs.MediaTechController.extend({init:function(player,options,ready){if(videojs.MediaTechController.call(this,player,options,ready),this.features.progressEvents=!1,this.features.timeupdateEvents=!1,"undefined"!=typeof options.source)for(var key in options.source)options.source.hasOwnProperty(key)&&(player.options()[key]=options.source[key]);this.onWaiting=this.onWaiting.bind(this),this.userQuality=videojs.Youtube.convertQualityName(player.options().quality),this.player_=player,this.playerEl_=document.getElementById(player.id()),this.playerEl_.className+=" vjs-youtube",this.qual
11849ityButton=document.createElement("div"),this.qualityButton.setAttribute("class","vjs-quality-button vjs-menu-button vjs-control"),this.qualityButton.setAttribute("tabindex",0);var qualityContent=document.createElement("div");this.qualityButton.appendChild(qualityContent),this.qualityTitle=document.createElement("span"),qualityContent.appendChild(this.qualityTitle),"undefined"!==player.options().quality&&setInnerText(this.qualityTitle,player.options().quality||"auto");var qualityMenu=document.createElement("div");if(qualityMenu.setAttribute("class","vjs-menu"),this.qualityButton.appendChild(qualityMenu),this.qualityMenuContent=document.createElement("ul"),this.qualityMenuContent.setAttribute("class","vjs-menu-content"),qualityMenu.appendChild(this.qualityMenuContent),this.id_=this.player_.id()+"_youtube_api",this.el_=videojs.Component.prototype.createEl("iframe",{id:this.id_,className:"vjs-tech",scrolling:"no",marginWidth:0,marginHeight:0,frameBorder:0}),this.el_.setAttribute("allowFullScreen",""),this.playerEl_.insertBefore(this.el_,this.playerEl_.firstChild),/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var ieVersion=Number(RegExp.$1);this.addIframeBlocker(ieVersion)}else/(iPad|iPhone|iPod|android)/g.test(navigator.userAgent)||(this.el_.className+=" onDesktop",this.addIframeBlocker());this.parseSrc(player.options().src),this.playOnReady=this.player_.options().autoplay||!1,this.forceSSL=!("undefined"!=typeof this.player_.options().forceSSL&&this.player_.options().forceSSL!==!0),this.forceHTML5=!("undefined"!=typeof this.player_.options().forceHTML5&&this.player_.options().forceHTML5!==!0),this.updateIframeSrc();var self=this;player.ready(function(){var controlBar=self.playerEl_.querySelectorAll(".vjs-control-bar")[0];controlBar.appendChild(self.qualityButton),self.playOnReady&&!self.player_.options().ytcontrols&&("undefined"!=typeof self.player_.loadingSpinner&&self.player_.loadingSpinner.show(),"undefined"!=typeof self.player_.bigPlayButton&&self.player_.bigPlayButton.hide()),player.trigger("loadstart")}),this.on("dispose",function(){this.ytplayer&&this.ytplayer.destroy(),this.player_.options().ytcontrols||this.player_.off(this.onWaiting),this.playerEl_.querySelectorAll(".vjs-poster")[0].style.backgroundImage="none",this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.qualityButton.parentNode.removeChild(this.qualityButton),"undefined"!=typeof this.player_.loadingSpinner&&this.player_.loadingSpinner.hide(),"undefined"!=typeof this.player_.bigPlayButton&&this.player_.bigPlayButton.hide(),this.iframeblocker&&this.playerEl_.removeChild(this.iframeblocker)})}}),videojs.Youtube.prototype.updateIframeSrc=function(){var params={enablejsapi:1,iv_load_policy:3,playerapiid:this.id(),disablekb:1,wmode:"transparent",controls:this.player_.options().ytcontrols?1:0,html5:this.player_.options().forceHTML5?1:null,playsinline:this.player_.options().playsInline?1:0,showinfo:0,modestbranding:1,rel:0,autoplay:this.playOnReady?1:0,loop:this.player_.options().loop?1:0,list:this.playlistId,vq:this.userQuality,origin:window.location.protocol+"//"+window.location.host};"file:"===window.location.protocol&&delete params.origin;for(var prop in params)!params.hasOwnProperty(prop)||"undefined"!=typeof params[prop]&&null!==params[prop]||delete params[prop];var self=this;if(null===this.videoId)this.el_.src="about:blank",setTimeout(function(){self.triggerReady()},500);else if(this.el_.src=(this.forceSSL||"file:"===window.location.protocol?"https:":window.location.protocol)+"//www.youtube.com/embed/"+this.videoId+"?"+videojs.Youtube.makeQueryString(params),this.player_.options().ytcontrols?this.player_.controls(!1):"undefined"==typeof this.player_.poster()&&setTimeout(function(){var posterEl=self.playerEl_.querySelectorAll(".vjs-poster")[0];posterEl.style.backgroundImage="url(https://img.youtube.com/vi/"+self.videoId+"/0.jpg)",posterEl.style.display=""},100),this.player_.on("waiting",this.onWaiting),videojs.Youtube.apiReady)this.loadYoutube();else if(videojs.Youtube.loadingQueue.push(this),!videojs.Youtube.apiLoading){var tag=document.createElement("script");tag.onerror=function(e){self.onError(e)},tag.src=this.forceSSL||"file:"===window.location.protocol?"https://www.youtube.com/iframe_api":"//www.youtube.com/iframe_api";var firstScriptTag=document.getElementsByTagName("script")[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag),videojs.Youtube.apiLoading=!0}},videojs.Youtube.prototype.onWaiting=function(){this.player_.bigPlayButton.hide()},videojs.Youtube.prototype.addIframeBlocker=function(ieVersion){this.iframeblocker=videojs.Component.prototype.createEl("div"),this.iframeblocker.className="iframeblocker",this.iframeblocker.style.position="absolute",this.iframeblocker.style.left=0,this.iframeblocker.style.right=0,this.iframeblocker.style.top=0,this.iframeblocker.style.bottom=0,this.iframeblocker.style.zIndex=9999,ieVersion&&9>ieVersion?this.iframeblocker.style.opacity=.01:this.iframeblocker.style.background="rgba(255, 255, 255, 0.01)";var self=this;addEventListener(this.iframeblocker,"mousemove",function(e){self.player_.userActive()||self.player_.userActive(!0),e.stopPropagation(),e.preventDefault()}),addEventListener(this.iframeblocker,"click",function(){self.paused()?self.play():self.pause()}),this.playerEl_.insertBefore(this.iframeblocker,this.el_.nextSibling)},videojs.Youtube.prototype.parseSrc=function(src){if(this.srcVal=src,src){var regId=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,match=src.match(regId);this.videoId=match&&11===match[2].length?match[2]:null;var regPlaylist=/[?&]list=([^#\&\?]+)/;match=src.match(regPlaylist),null!==match&&match.length>1?this.playlistId=match[1]:this.playlistId&&delete this.playlistId;var regVideoQuality=/[?&]vq=([^#\&\?]+)/;match=src.match(regVideoQuality),null!==match&&match.length>
118491&&(this.userQuality=match[1],setInnerText(this.qualityTitle,videojs.Youtube.parseQualityName(this.userQuality)))}},videojs.Youtube.prototype.src=function(src){if("undefined"!=typeof src){if(this.parseSrc(src),"about:blank"===this.el_.src)return void this.updateIframeSrc();delete this.defaultQuality,null!==this.videoId&&(this.player_.options().autoplay?this.ytplayer.loadVideoById({videoId:this.videoId,suggestedQuality:this.userQuality}):this.ytplayer.cueVideoById({videoId:this.videoId,suggestedQuality:this.userQuality}),this.playerEl_.querySelectorAll(".vjs-poster")[0].style.backgroundImage="url(https://img.youtube.com/vi/"+this.videoId+"/0.jpg)",this.player_.poster("https://img.youtube.com/vi/"+this.videoId+"/0.jpg"))}return this.srcVal},videojs.Youtube.prototype.load=function(){},videojs.Youtube.prototype.play=function(){null!==this.videoId&&(this.updateQualities(),this.player_.options().ytcontrols||this.player_.trigger("waiting"),this.isReady_?(this.ytplayer.setVolume(100*this.player_.volume()),this.volumeVal>0?this.ytplayer.unMute():this.ytplayer.mute(),this.ytplayer.playVideo()):this.playOnReady=!0)},videojs.Youtube.prototype.pause=function(){this.ytplayer.pauseVideo()},videojs.Youtube.prototype.paused=function(){return this.ytplayer?this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING:!0},videojs.Youtube.prototype.currentTime=function(){return this.ytplayer&&this.ytplayer.getCurrentTime?this.ytplayer.getCurrentTime():0},videojs.Youtube.prototype.setCurrentTime=function(seconds){this.ytplayer.seekTo(seconds,!0),this.player_.trigger("timeupdate")},videojs.Youtube.prototype.duration=function(){return this.ytplayer&&this.ytplayer.getDuration?this.ytplayer.getDuration():0},videojs.Youtube.prototype.currentSrc=function(){return this.srcVal},videojs.Youtube.prototype.volume=function(){return this.ytplayer&&isNaN(this.volumeVal)&&(this.volumeVal=this.ytplayer.getVolume()/100,this.player_.volume(this.volumeVal)),this.volumeVal},videojs.Youtube.prototype.setVolume=function(percentAsDecimal){"undefined"!=typeof percentAsDecimal&&percentAsDecimal!==this.volumeVal&&(this.ytplayer.setVolume(100*percentAsDecimal),this.volumeVal=percentAsDecimal,this.player_.trigger("volumechange"))},videojs.Youtube.prototype.muted=function(){return this.mutedVal},videojs.Youtube.prototype.setMuted=function(muted){muted?(this.ytplayer.mute(),this.player_.volume(0)):(this.ytplayer.unMute(),this.player_.volume(this.volumeVal)),this.mutedVal=muted,this.player_.trigger("volumechange")},videojs.Youtube.prototype.buffered=function(){if(this.ytplayer&&this.ytplayer.getVideoBytesLoaded){var loadedBytes=this.ytplayer.getVideoBytesLoaded(),totalBytes=this.ytplayer.getVideoBytesTotal();if(!loadedBytes||!totalBytes)return 0;var duration=this.ytplayer.getDuration(),secondsBuffered=loadedBytes/totalBytes*duration,secondsOffset=this.ytplayer.getVideoStartBytes()/totalBytes*duration;return videojs.createTimeRange(secondsOffset,secondsOffset+secondsBuffered)}return videojs.createTimeRange(0,0)},videojs.Youtube.prototype.Fa=function(){return false},videojs.Youtube.isSupported=function(){return!0},videojs.Youtube.canPlaySource=function(srcObj){return"video/youtube"===srcObj.type},videojs.Youtube.canControlVolume=function(){return!0},videojs.Youtube.loadingQueue=[],videojs.Youtube.prototype.loadYoutube=function(){this.ytplayer=new YT.Player(this.id_,{events:{onReady:function(e){e.target.vjsTech.onReady()},onStateChange:function(e){e.target.vjsTech.onStateChange(e.data)},onPlaybackQualityChange:function(e){e.target.vjsTech.onPlaybackQualityChange(e.data)},onError:function(e){e.target.vjsTech.onError(e.data)}}}),this.ytplayer.vjsTech=this},videojs.Youtube.makeQueryString=function(args){var array=[];for(var key in args)args.hasOwnProperty(key)&&array.push(key+"="+args[key]);return array.join("&")},window.onYouTubeIframeAPIReady=function(){for(var yt;yt=videojs.Youtube.loadingQueue.shift();)yt.loadYoutube();videojs.Youtube.loadingQueue=[],videojs.Youtube.apiReady=!0},videojs.Youtube.prototype.onReady=function(){this.isReady_=!0,this.triggerReady(),this.player_.trigger("loadedmetadata"),"undefined"!=typeof this.player_.loadingSpinner&&this.player_.loadingSpinner.hide(),this.player_.options().muted&&this.setMuted(!0),this.playOnReady&&(this.playOnReady=!1,this.play())},videojs.Youtube.prototype.updateQualities=function(){function setupEventListener(el){addEventListener(el,"click",function(){var quality=this.getAttribute("data-val");self.ytplayer.setPlaybackQuality(quality),self.userQuality=quality,setInnerText(self.qualityTitle,videojs.Youtube.parseQualityName(quality));var selected=self.qualityMenuContent.querySelector(".vjs-selected");selected&&videojs.Youtube.removeClass(selected,"vjs-selected"),videojs.Youtube.addClass(this,"vjs-selected")})}if("undefined"!=typeof this.ytplayer&&"undefined"!=typeof this.ytplayer.getAvailableQualityLevels){var qualities=this.ytplayer.getAvailableQualityLevels(),self=this;if(qualities.indexOf(this.userQuality)<0&&setInnerText(self.qualityTitle,videojs.Youtube.parseQualityName(this.defaultQuality)
11849),0===qualities.length)this.qualityButton.style.display="none";else{for(this.qualityButton.style.display="";this.qualityMenuContent.hasChildNodes();)this.qualityMenuContent.removeChild(this.qualityMenuContent.lastChild);for(var i=0;i<qualities.length;++i){var el=document.createElement("li");el.setAttribute("class","vjs-menu-item"),setInnerText(el,videojs.Youtube.parseQualityName(qualities[i])),el.setAttribute("data-val",qualities[i]),qualities[i]===this.quality&&videojs.Youtube.addClass(el,"vjs-selected"),setupEventListener(el),this.qualityMenuContent.appendChild(el)}}}},videojs.Youtube.prototype.onStateChange=function(state){if(state!==this.lastState){switch(state){case-1:this.player_.trigger("durationchange");break;case YT.PlayerState.ENDED:this.player_.options().ytcontrols||(this.playerEl_.querySelectorAll(".vjs-poster")[0].style.display="block","undefined"!=typeof this.player_.bigPlayButton&&this.player_.bigPlayButton.show()),this.player_.trigger("ended");break;case YT.PlayerState.PLAYING:this.play(),this.player_.trigger("timeupdate"),this.player_.trigger("durationchange"),this.player_.trigger("playing"),this.player_.trigger("play");break;case YT.PlayerState.PAUSED:this.pause(),this.player_.trigger("pause");break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate"),this.player_.options().ytcontrols||this.player_.trigger("waiting");break;case YT.PlayerState.CUED:}this.lastState=state}},videojs.Youtube.convertQualityName=function(name){switch(name){case"144p":return"tiny";case"240p":return"small";case"360p":return"medium";case"480p":return"large";case"720p":return"hd720";case"1080p":return"hd1080"}return"auto"},videojs.Youtube.parseQualityName=function(name){switch(name){case"tiny":return"144p";case"small":return"240p";case"medium":return"360p";case"large":return"480p";case"hd720":return"720p";case"hd1080":return"1080p"}return"auto"},videojs.Youtube.prototype.onPlaybackQualityChange=function(quality){if("undefined"!=typeof this.defaultQuality||(this.defaultQuality=quality,"undefined"==typeof this.userQuality)){switch(this.quality=quality,setInnerText(this.qual
11849ityTitle,videojs.Youtube.parseQualityName(quality)),quality){case"medium":this.player_.videoWidth=480,this.player_.videoHeight=360;break;case"large":this.player_.videoWidth=640,this.player_.videoHeight=480;break;case"hd720":this.player_.videoWidth=960,this.player_.videoHeight=720;break;case"hd1080":this.player_.videoWidth=1440,this.player_.videoHeight=1080;break;case"highres":this.player_.videoWidth=1920,this.player_.videoHeight=1080;break;case"small":this.player_.videoWidth=320,this.player_.videoHeight=240;break;case"tiny":this.player_.videoWidth=144,this.player_.videoHeight=108;break;default:this.player_.videoWidth=0,this.player_.videoHeight=0}this.player_.trigger("ratechange")}},videojs.Youtube.prototype.onError=function(error){this.player_.error(error),(100===error||101===error||150===error)&&(this.player_.bigPlayButton.hide(),this.player_.loadingSpinner.hide(),this.player_.posterImage.hide())},videojs.Youtube.addClass=function(element,classToAdd){-1===(" "+element.className+" ").indexOf(" "+classToAdd+" ")&&(element.className=""===element.className?classToAdd:element.className+" "+classToAdd)},videojs.Youtube.removeClass=function(element,classToRemove){var classNames,i;if(-1!==element.className.indexOf(classToRemove)){for(classNames=element.className.split(" "),i=classNames.length-1;i>=0;i--)classNames[i]===classToRemove&&classNames.splice(i,1);element.className=classNames.join(" ")}};var style=document.createElement("style"),def=" .vjs-youtube .vjs-poster { background-size: 100%!important; }.vjs-youtube .vjs-poster, .vjs-youtube .vjs-loading-spinner, .vjs-youtube .vjs-text-track-display{    pointer-events: none !important; }.vjs-youtube.vjs-user-active .iframeblocker { display: none; }.vjs-youtube.vjs-user-inactive .vjs-tech.onDesktop { pointer-events: none; }.vjs-quality-button > div:first-child > span:first-child { position:relative;top:7px }";style.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(style),style.styleSheet?style.styleSheet.cssText=def:style.appendChild(document.createTextNode(def)),Array.prototype.indexOf||(Array.prototype.indexOf=function(elt){var len=this.length>>>0,from=Number(arguments[1])||0;for(from=0>from?Math.ceil(from):Math.floor(from),0>from&&(from+=len);len>from;from++)if(from in this&&this[from]===elt)return from;return-1})}();
11850/* videoJS-vimeo plugin */
11851!function(){var a={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3};videojs.Vimeo=videojs.MediaTechController.extend({init:function(a,b,c){if(videojs.MediaTechController.call(this,a,b,c),"undefined"!=typeof b.source)for(var d in b.source)a.options()[d]=b.source[d];this.player_=a,this.player_el_=document.getElementById(this.player_.id()),this.player_.controls(!1),this.id_=this.player_.id()+"_vimeo_api",this.el_=videojs.Component.prototype.createEl("iframe",{id:this.id_,className:"vjs-tech",scrolling:"no",marginWidth:0,marginHeight:0,frameBorder:0}),this.el_.setAttribute("webkitAllowFullScreen",""),this.el_.setAttribute("mozallowfullscreen",""),this.el_.setAttribute("allowFullScreen",""),this.player_el_.insertBefore(this.el_,this.player_el_.firstChild);var e="file:"===document.location.protocol?"http:":document.location.protocol;this.baseUrl=e+"//player.vimeo.com/video/",this.vimeo={},this.vimeoInfo={};var f=this;this.el_.attachEvent?this.el_.attachEvent("onload",vjs.bind(f,f.onLoad)):this.el_.onload=function(){f.onLoad()},this.startMuted=a.options().muted,this.src(a.options().src)}}),videojs.Vimeo.prototype.dispose=function(){this.vimeo.removeEvent("ready"),this.vimeo.api("unload"),delete this.vimeo,this.el_.parentNode.removeChild(this.el_),videojs.MediaTechController.prototype.dispose.call(this)},videojs.Vimeo.prototype.src=function(a){this.isReady_=!1;var b=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/,c=a.match(b);c&&(this.videoId=c[5]);var d={api:1,byline:0,portrait:0,show_title:0,show_byline:0,show_portait:0,fullscreen:1,player_id:this.id_,autoplay:this.player_.options().autoplay?1:0,loop:this.player_.options().loop?1:0,color:this.player_.options().color||""};"#"===d.color.substring(0,1)&&(d.color=d.color.substring(1)),this.el_.src=this.baseUrl+this.videoId+"?"+videojs.Vimeo.makeQueryString(d)},videojs.Vimeo.prototype.load=function(){},videojs.Vimeo.prototype.play=function(){this.vimeo.api("play")},videojs.Vimeo.prototype.pause=function(){this.vimeo.api("pause")},videojs.Vimeo.prototype.paused=function(){return this.vimeoInfo.state!==a.PLAYING&&this.vimeoInfo.state!==a.BUFFERING},videojs.Vimeo.prototype.currentTime=function(){return this.vimeoInfo.time||0},videojs.Vimeo.prototype.setCurrentTime=function(a){this.vimeo.api("seekTo",a),this.player_.trigger("timeupdate")},videojs.Vimeo.prototype.duration=function(){return this.vimeoInfo.duration||0},videojs.Vimeo.prototype.buffered=function(){return videojs.createTimeRange(0,this.vimeoInfo.buffered*this.vimeoInfo.duration||0)},videojs.Vimeo.prototype.volume=function(){return this.vimeoInfo.muted?this.vimeoInfo.muteVolume:this.vimeoInfo.volume},videojs.Vimeo.prototype.setVolume=function(a){this.vimeo.api("setvolume",a),this.vimeoInfo.volume=a,this.player_.trigger("volumechange")},videojs.Vimeo.prototype.currentSrc=function(){return this.el_.src},videojs.Vimeo.prototype.muted=function(){return this.vimeoInfo.muted||!1},videojs.Vimeo.prototype.setMuted=function(a){a?(this.vimeoInfo.muteVolume=this.vimeoInfo.volume,this.setVolume(0)):this.setVolume(this.vimeoInfo.muteVolume),this.vimeoInfo.muted=a,this.player_.trigger("volumechange")},videojs.Vimeo.prototype.onReady=function(){this.isReady_=!0,this.triggerReady(),this.player_.trigger("loadedmetadata"),this.startMuted&&(this.setMuted(!0),this.startMuted=!1)},videojs.Vimeo.prototype.onLoad=function(){this.vimeo&&this.vimeo.api&&(this.vimeo.api("unload"),delete this.vimeo),this.vimeo=$f(this.el_),this.vimeoInfo={state:a.UNSTARTED,volume:1,muted:!1,muteVolume:1,time:0,duration:0,buffered:0,url:this.baseUrl+this.videoId,error:null};var b=this;this.vimeo.addEvent("ready",function(a){b.onReady(),b.vimeo.addEvent("loadProgress",function(a,c){b.onLoadProgress(a)}),b.vimeo.addEvent("playProgress",function(a,c){b.onPlayProgress(a)}),b.vimeo.addEvent("play",function(a){b.onPlay()}),b.vimeo.addEvent("pause",function(a){b.onPause()}),b.vimeo.addEvent("finish",function(a){b.onFinish()}),b.vimeo.addEvent("seek",function(a,c){b.onSeek(a)})})},videojs.Vimeo.prototype.onLoadProgress=function(a){var b=!this.vimeoInfo.duration;this.vimeoInfo.duration=a.duration,this.vimeoInfo.buffered=a.percent,this.player_.trigger("progress"),b&&this.player_.trigger("durationchange")},videojs.Vimeo.prototype.onPlayProgress=function(a){this.vimeoInfo.time=a.seconds,this.player_.trigger("timeupdate")},videojs.Vimeo.prototype.onPlay=function(){this.vimeoInfo.state=a.PLAYING,this.player_.trigger("play")},videojs.Vimeo.prototype.onPause=function(){this.vimeoInfo.state=a.PAUSED,this.player_.trigger("pause")},videojs.Vimeo.prototype.onFinish=function(){this.vimeoInfo.state=a.ENDED,this.player_.trigger("ended")},videojs.Vimeo.prototype.onSeek=function(a){this.player_.trigger("seeking"),this.vimeoInfo.time=a.seconds,this.player_.trigger("timeupdate"),this.player_.trigger("seeked")},videojs.Vimeo.prototype.onError=function(a){this.player_.error=a,this.player_.trigger("error")},videojs.Vimeo.isSupported=function(){var a=videojs.Flash.version()[0]>=10;if(!a){var b=-1!=navigator.userAgent.indexOf("Opera");if(b)return!1;var c=-1!=navigator.userAgent.indexOf("Mac OS X"),d=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;if(c&&d)return!1;var e=/Trident\/([\d\.]+)/;if(e.test(navigator.userAgent)){var f;if(null!=e.exec(navigator.userAgent)&&(f=parseFloat(RegExp.$1)),f&&7>f)return!1}}return!0},videojs.Vimeo.prototype.supportsFullScreen=function(){return!1},videojs.Vimeo.canPlaySource=function(a){return"video/vimeo"==a.type},videojs.Vimeo.makeQueryString=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")};(function(){function a(b){return new a.fn.init(b)}function g(a,b,c){if(!c.contentWindow.postMessage)return!1;var d=JSON.stringify({method:a,value:b});c.contentWindow.postMessage(d,f)}function h(a){var b,c;try{b=JSON.parse(a.data),c=b.event||b.method}catch(e){}
11851if("ready"!=c||d||(d=!0),!/^https?:\/\/player.vimeo.com/.test(a.origin))return!1;"*"===f&&(f=a.origin);var g=b.value,h=b.data,i=""===i?null:b.player_id,k=j(c,i),l=[];return k?(void 0!==g&&l.push(g),h&&l.push(h),i&&l.push(i),l.length>0?k.apply(null,l):k.call()):!1}function i(a,c,d){d?(b[d]||(b[d]={}),b[d][a]=c):b[a]=c}function j(a,c){return c&&b[c]?b[c][a]:b[a]}function k(a,c){if(c&&b[c]){if(!b[c][a])return!1;b[c][a]=null}else{if(!b[a])return!1;b[a]=null}return!0}function l(a){return!!(a&&a.constructor&&a.call&&a.apply)}var b={},d=!1,f=(Array.prototype.slice,"*");return a.fn=a.prototype={element:null,init:function(a){return"string"==typeof a&&(a=document.getElementById(a)),this.element=a,this},api:function(a,b){if(!this.element||!a)return!1;var c=this,d=c.element,e=""!==d.id?d.id:null,f=l(b)?null:b,h=l(b)?b:null;return h&&i(a,h,e),g(a,f,d),c},addEvent:function(a,b){if(!this.element)return!1;var c=this,e=c.element,f=""!==e.id?e.id:null;return i(a,b,f),"ready"!=a?g("addEventListener",a,e):"ready"==a&&d&&b.call(null,f),c},removeEvent:function(a){if(!this.element)return!1;var b=this,c=b.element,d=""!==c.id?c.id:null,e=k(a,d);"ready"!=a&&e&&g("removeEventListener",a,c)}},a.fn.init.prototype=a.fn,window.addEventListener?window.addEventListener("message",h,!1):window.attachEvent("onmessage",h),window.Froogaloop=window.$f=a})()}();
11852
11853
11854/*!
11855 * Returns true if element is visible, else returns false.
11856 * @returns {boolean}
11857 */
11858$.fn.isOnScreen = function(){
11859    var win = $(window);
11860    var viewport = {
11861        top: win.scrollTop(),
11862        left: win.scrollLeft()
11863    };
11864    viewport.right = viewport.left + win.width();
11865    viewport.bottom = viewport.top + win.height();
11866
11867    var bounds = this.offset();
11868    bounds.right = bounds.left + this.outerWidth();
11869    bounds.bottom = bounds.top + this.outerHeight();
11870
11871    return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
11872};
11873
11874
11875/*!
11876* isMobile.js v0.3.2
11877*
11878* A simple library to detect Apple phones and tablets,
11879* Android phones and tablets, other mobile devices (like blackberry, mini-opera and windows phone),
11880* and any kind of seven inch device, via user agent sniffing.
11881*
11882* @author: Kai Mallea ([email protected])
11883*
11884* @license: http://creativecommons.org/publicdomain/zero/1.0/
11885*/
11886!function(a){var b=/iPhone/i,c=/iPod/i,d=/iPad/i,e=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,f=/Android/i,g=/IEMobile/i,h=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,i=/BlackBerry/i,j=/Opera Mini/i,k=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,l=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),m=function(a,b){return a.test(b)},n=function(a){var n=a||navigator.userAgent;this.apple={phone:m(b,n),ipod:m(c,n),tablet:m(d,n),device:m(b,n)||m(c,n)||m(d,n)},this.android={phone:m(e,n),tablet:!m(e,n)&&m(f,n),device:m(e,n)||m(f,n)},this.windows={phone:m(g,n),tablet:m(h,n),device:m(g,n)||m(h,n)},this.other={blackberry:m(i,n),opera:m(j,n),firefox:m(k,n),device:m(i,n)||m(j,n)||m(k,n)},this.seven_inch=m(l,n),this.any=this.apple.device||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet},o=new n;o.Class=n,"undefined"!=typeof module&&module.exports?module.exports=o:"function"==typeof define&&define.amd?define(o):a.isMobile=o}(this);
11887
11888
11889/*! http://mths.be/placeholder v2.0.8 by @mathias */
11890(function(e,t,n){function c(e){var t={};
11890var r=/^jQuery\d+$/;n.each(e.attributes,function(e,n){if(n.specified&&!r.test(n.name)){t[n.name]=n.value}});return t}function h(e,t){var r=this;var i=n(r);if(r.value==i.attr("placeholder")&&i.hasClass("placeholder")){if(i.data("placeholder-password")){i=i.hide().next().show().attr("id",i.removeAttr("id").data("placeholder-id"));if(e===true){return i[0].value=t}i.focus()}else{r.value="";i.removeClass("placeholder");r==d()&&r.select()}}}function p(){var e;var t=this;var r=n(t);var i=this.id;if(t.value==""){if(t.type=="password"){if(!r.data("placeholder-textinput")){try{e=r.clone().attr({type:"text"})}catch(s){e=n("<input>").attr(n.extend(c(this),{type:"text"}))}e.removeAttr("name").data({"placeholder-password":r,"placeholder-id":i}).bind("focus.placeholder",h);r.data({"placeholder-textinput":e,"placeholder-id":i}).before(e)}r=r.removeAttr("id").hide().prev().attr("id",i).show()}r.addClass("placeholder");r[0].value=r.attr("placeholder")}else{r.removeClass("placeholder")}}function d(){try{return t.activeElement}catch(e){}}var r=Object.prototype.toString.call(e.operamini)=="[object OperaMini]";var i="placeholder"in t.createElement("input")&&!r;var s="placeholder"in t.createElement("textarea")&&!r;var o=n.fn;var u=n.valHooks;var a=n.propHooks;var f;var l;if(i&&s){l=o.placeholder=function(){return this};l.input=l.textarea=true}else{l=o.placeholder=function(){var e=this;e.filter((i?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":h,"blur.placeholder":p}).data("placeholder-enabled",true).trigger("blur.placeholder");return e};l.input=i;l.textarea=s;f={get:function(e){var t=n(e);var r=t.data("placeholder-password");if(r){return r[0].value}return t.data("placeholder-enabled")&&t.hasClass("placeholder")?"":e.value},set:function(e,t){var r=n(e);var i=r.data("placeholder-password");if(i){return i[0].value=t}if(!r.data("placeholder-enabled")){return e.value=t}if(t==""){e.value=t;if(e!=d()){p.call(e)}}else if(r.hasClass("placeholder")){h.call(e,true,t)||(e.value=t)}else{e.value=t}return r}};if(!i){u.input=f;a.value=f}if(!s){u.textarea=f;a.value=f}n(function(){n(t).delegate("form","submit.placeholder",function(){var e=n(".placeholder",this).each(h);setTimeout(function(){e.each(p)},10)})});n(e).bind("beforeunload.placeholder",function(){n(".placeholder").each(function(){this.value=""})})}})(this,document,jQuery)
11891
11892
11893/*!
11894 * CSS Browser Selector v0.4.0 (Nov 02, 2010)
11895 * Rafael Lima (http://rafael.adm.br)
11896 * http://rafael.adm.br/css_browser_selector
11897 * License: http://creativecommons.org/licenses/by/2.5/
11898 * Contributors: http://rafael.adm.br/css_browser_selector#contributors
11899*/
11900function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);
11901
11902
11903/*! Backstretch - v2.0.4 - 2013-06-19
11904* http://srobbin.com/jquery-plugins/backstretch/
11905* Copyright (c) 2013 Scott Robbin; Licensed MIT */
11906(function(a,d,p){a.fn.backstretch=function(c,b){(c===p||0===c.length)&&a.error("No images were supplied for Backstretch");0===a(d).scrollTop()&&d.scrollTo(0,0);return this.each(function(){var d=a(this),g=d.data("backstretch");if(g){if("string"==typeof c&&"function"==typeof g[c]){g[c](b);return}b=a.extend(g.options,b);g.destroy(!0)}g=new q(this,c,b);d.data("backstretch",g)})};a.backstretch=function(c,b){return a("body").backstretch(c,b).data("backstretch")};a.expr[":"].backstretch=function(c){return a(c).data("backstretch")!==p};a.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5E3,fade:0};var r={left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},s={position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxHeight:"none",maxWidth:"none",zIndex:-999999},q=function(c,b,e){this.options=a.extend({},a.fn.backstretch.defaults,e||{});this.images=a.isArray(b)?b:[b];a.each(this.images,function(){a("<img />")[0].src=this});this.isBody=c===document.body;this.$container=a(c);this.$root=this.isBody?l?a(d):a(document):this.$container;c=this.$container.children(".backstretch").first();this.$wrap=c.length?c:a('<div class="backstretch"></div>').css(r).appendTo(this.$container);this.isBody||(c=this.$container.css("position"),b=this.$container.css("zIndex"),this.$container.css({position:"static"===c?"relative":c,zIndex:"auto"===b?0:b,background:"none"}),this.$wrap.css({zIndex:-999998}));this.$wrap.css({position:this.isBody&&l?"fixed":"absolute"});this.index=0;this.show(this.index);a(d).on("resize.backstretch",a.proxy(this.resize,this)).on("orientationchange.backstretch",a.proxy(function(){this.isBody&&0===d.pageYOffset&&(d.scrollTo(0,1),this.resize())},this))};q.prototype={resize:function(){try{var a={left:0,top:0},b=this.isBody?this.$root.width():this.$root.innerWidth(),e=b,g=this.isBody?d.innerHeight?d.innerHeight:this.$root.height():this.$root.innerHe
11906ight(),j=e/this.$img.data("ratio"),f;j>=g?(f=(j-g)/2,this.options.centeredY&&(a.top="-"+f+"px")):(j=g,e=j*this.$img.data("ratio"),f=(e-b)/2,this.options.centeredX&&(a.left="-"+f+"px"));this.$wrap.css({width:b,height:g}).find("img:not(.deleteable)").css({width:e,height:j}).css(a)}catch(h){}return this},show:function(c){if(!(Math.abs(c)>this.images.length-1)){var b=this,e=b.$wrap.find("img").addClass("deleteable"),d={relatedTarget:b.$container[0]};b.$container.trigger(a.Event("backstretch.before",d),[b,c]);this.index=c;clearInterval(b.interval);b.$img=a("<img />").css(s).bind("load",function(f){var h=this.width||a(f.target).width();f=this.height||a(f.target).height();a(this).data("ratio",h/f);a(this).fadeIn(b.options.speed||b.options.fade,function(){e.remove();b.paused||b.cycle();a(["after","show"]).each(function(){b.$container.trigger(a.Event("backstretch."+this,d),[b,c])})});b.resize()}).appendTo(b.$wrap);b.$img.attr("src",b.images[c]);return b}},next:function(){return this.show(this.index<this.images.length-1?this.index+1:0)},prev:function(){return this.show(0===this.index?this.images.length-1:this.index-1)},pause:function(){this.paused=!0;return this},resume:function(){this.paused=!1;this.next();return this},cycle:function(){1<this.images.length&&(clearInterval(this.interval),this.interval=setInterval(a.proxy(function(){this.paused||this.next()},this),this.options.duration));return this},destroy:function(c){a(d).off("resize.backstretch orientationchange.backstretch");clearInterval(this.interval);c||this.$wrap.remove();this.$container.removeData("backstretch")}};var l,f=navigator.userAgent,m=navigator.platform,e=f.match(/AppleWebKit\/([0-9]+)/),e=!!e&&e[1],h=f.match(/Fennec\/([0-9]+)/),h=!!h&&h[1],n=f.match(/Opera Mobi\/([0-9]+)/),t=!!n&&n[1],k=f.match(/MSIE ([0-9]+)/),k=!!k&&k[1];l=!((-1<m.indexOf("iPhone")||-1<m.indexOf("iPad")||-1<m.indexOf("iPod"))&&e&&534>e||d.operamini&&"[object OperaMini]"==={}.toString.call(d.operamini)||n&&7458>t||-1<f.indexOf("Android")&&e&&533>e||h&&6>h||"palmGetResource"in d&&e&&534>e||-1<f.indexOf("MeeGo")&&-1<f.indexOf("NokiaBrowser/8.5.0")||k&&6>=k)})(jQuery,window);
11907
11908
11909/* Carousel */
11910"function"!==typeof Object.create&&(Object.create=function(f){function g(){}g.prototype=f;return new g});
11911(function(f,g,k){var l={init:function(a,b){this.$elem=f(b);this.options=f.extend({},f.fn.owlCarousel.options,this.$elem.data(),a);this.userOptions=a;this.loadContent()},loadContent:function(){function a(a){var d,e="";if("function"===typeof b.options.jsonSuccess)b.options.jsonSuccess.apply(this,[a]);else{for(d in a.owl)a.owl.hasOwnProperty(d)&&(e+=a.owl[d].item);b.$elem.html(e)}b.logIn()}var b=this,e;"function"===typeof b.options.beforeInit&&b.options.beforeInit.apply(this,[b.$elem]);"string"===typeof b.options.jsonPath?
11912    (e=b.options.jsonPath,f.getJSON(e,a)):b.logIn()},logIn:function(){this.$elem.data("owl-originalStyles",this.$elem.attr("style"));this.$elem.data("owl-originalClasses",this.$elem.attr("class"));this.$elem.css({opacity:0});this.orignalItems=this.options.items;this.checkBrowser();this.wrapperWidth=0;this.checkVisible=null;this.setVars()},setVars:function(){if(0===this.$elem.children().length)return!1;this.baseClass();this.eventTypes();this.$userItems=this.$elem.children();this.itemsAmount=this.$userItems.length;
11913    this.wrapItems();this.$owlItems=this.$elem.find(".owl-item");this.$owlWrapper=this.$elem.find(".owl-wrapper");this.playDirection="next";this.prevItem=0;this.prevArr=[0];this.currentItem=0;this.customEvents();this.onStartup()},onStartup:function(){this.updateItems();this.calculateAll();this.buildControls();this.updateControls();this.response();this.moveEvents();this.stopOnHover();this.owlStatus();!1!==this.options.transitionStyle&&this.transitionTypes(this.options.transitionStyle);!0===this.options.autoPlay&&
11914(this.options.autoPlay=5E3);this.play();this.$elem.find(".owl-wrapper").css("display","block");this.$elem.is(":visible")?this.$elem.css("opacity",1):this.watchVisibility();this.onstartup=!1;this.eachMoveUpdate();"function"===typeof this.options.afterInit&&this.options.afterInit.apply(this,[this.$elem])},eachMoveUpdate:function(){!0===this.options.lazyLoad&&this.lazyLoad();!0===this.options.autoHeight&&this.autoHeight();this.onVisibleItems();"function"===typeof this.options.afterAction&&this.options.afterAction.apply(this,
11915    [this.$elem])}
11915,updateVars:function(){"function"===typeof this.options.beforeUpdate&&this.options.beforeUpdate.apply(this,[this.$elem]);this.watchVisibility();this.updateItems();this.calculateAll();this.updatePosition();this.updateControls();this.eachMoveUpdate();"function"===typeof this.options.afterUpdate&&this.options.afterUpdate.apply(this,[this.$elem])},reload:function(){var a=this;g.setTimeout(function(){a.updateVars()},0)},watchVisibility:function(){var a=this;if(!1===a.$elem.is(":visible"))a.$elem.css({opacity:0}),
11916    g.clearInterval(a.autoPlayInterval),g.clearInterval(a.checkVisible);else return!1;a.checkVisible=g.setInterval(function(){a.$elem.is(":visible")&&(a.reload(),a.$elem.animate({opacity:1},200),g.clearInterval(a.checkVisible))},500)},wrapItems:function(){this.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>');this.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">');this.wrapperOuter=this.$elem.find(".owl-wrapper-outer");this.$elem.css("display","block")},
11917    baseClass:function(){var a=this.$elem.hasClass(this.options.baseClass),b=this.$elem.hasClass(this.options.theme);a||this.$elem.addClass(this.options.baseClass);b||this.$elem.addClass(this.options.theme)},updateItems:function(){var a,b;if(!1===this.options.responsive)return!1;if(!0===this.options.singleItem)return this.options.items=this.orignalItems=1,this.options.itemsCustom=!1,this.options.itemsDesktop=!1,this.options.itemsDesktopSmall=!1,this.options.itemsTablet=!1,this.options.itemsTabletSmall=
11918        !1,this.options.itemsMobile=!1;a=f(this.options.responsiveBaseWidth).width();a>(this.options.itemsDesktop[0]||this.orignalItems)&&(this.options.items=this.orignalItems);if(!1!==this.options.itemsCustom)for(this.options.itemsCustom.sort(function(a,b){return a[0]-b[0]}),b=0;b<this.options.itemsCustom.length;b+=1)this.options.itemsCustom[b][0]<=a&&(this.options.items=this.options.itemsCustom[b][1]);else a<=this.options.itemsDesktop[0]&&!1!==this.options.itemsDesktop&&(this.options.items=this.options.itemsDesktop[1]),
11919        a<=this.options.itemsDesktopSmall[0]&&!1!==this.options.itemsDesktopSmall&&(this.options.items=this.options.itemsDesktopSmall[1]),a<=this.options.itemsTablet[0]&&!1!==this.options.itemsTablet&&(this.options.items=this.options.itemsTablet[1]),a<=this.options.itemsTabletSmall[0]&&!1!==this.options.itemsTabletSmall&&(this.options.items=this.options.itemsTabletSmall[1]),a<=this.options.itemsMobile[0]&&!1!==this.options.itemsMobile&&(this.options.items=this.options.itemsMobile[1]);this.options.items>this.itemsAmount&&
11920        !0===this.options.itemsScaleUp&&(this.options.items=this.itemsAmount)},response:function(){var a=this,b,e;if(!0!==a.options.responsive)return!1;e=f(g).width();a.resizer=function(){f(g).width()!==e&&(!1!==a.options.autoPlay&&g.clearInterval(a.autoPlayInterval),g.clearTimeout(b),b=g.setTimeout(function(){e=f(g).width();a.updateVars()},a.options.responsiveRefreshRate))};f(g).resize(a.resizer)},updatePosition:function(){this.jumpTo(this.currentItem);!1!==this.options.autoPlay&&this.checkAp()},appendItemsSizes:function(){var a=
11921        this,b=0,e=a.itemsAmount-a.options.items;a.$owlItems.each(function(c){var d=f(this);d.css({width:a.itemWidth}).data("owl-item",Number(c));if(0===c%a.options.items||c===e)c>e||(b+=1);d.data("owl-roundPages",b)})},appendWrapperSizes:function(){this.$owlWrapper.css({width:this.$owlItems.length*this.itemWidth*2,left:0});this.appendItemsSizes()},calculateAll:function(){this.calculateWidth();this.appendWrapperSizes();this.loops();this.max()},calculateWidth:function(){this.itemWidth=Math.round(this.$elem.width()/
11922        this.options.items)},max:function(){var a=-1*(this.itemsAmount*this.itemWidth-this.options.items*this.itemWidth);this.options.items>this.itemsAmount?this.maximumPixels=a=this.maximumItem=0:(this.maximumItem=this.itemsAmount-this.options.items,this.maximumPixels=a);return a},min:function(){return 0},loops:function(){var a=0,b=0,e,c;this.positionsInArray=[0];this.pagesInArray=[];for(e=0;e<this.itemsAmount;e+=1)b+=this.itemWidth,this.positionsInArray.push(-b),!0===this.options.scrollPerPage&&(c=f(this.$owlItems[e]),
11923        c=c.data("owl-roundPages"),c!==a&&(this.pagesInArray[a]=this.positionsInArray[e],a=c))},buildControls:function(){if(!0===this.options.navigation||!0===this.options.pagination)this.owlControls=f('<div class="owl-control
11923s"/>').toggleClass("clickable",!this.browser.isTouch).appendTo(this.$elem);!0===this.options.pagination&&this.buildPagination();!0===this.options.navigation&&this.buildButtons()},buildButtons:function(){var a=this,b=f('<div class="owl-buttons"/>');a.owlControls.append(b);a.buttonPrev=
11924        f("<div/>",{"class":"owl-prev",html:a.options.navigationText[0]||""});a.buttonNext=f("<div/>",{"class":"owl-next",html:a.options.navigationText[1]||""});b.append(a.buttonPrev).append(a.buttonNext);b.on("touchstart.owlControls mousedown.owlControls",'div[class^="owl"]',function(a){a.preventDefault()});b.on("touchend.owlControls mouseup.owlControls",'div[class^="owl"]',function(b){b.preventDefault();f(this).hasClass("owl-next")?a.next():a.prev()})},buildPagination:function(){var a=this;a.paginationWrapper=
11925        f('<div class="owl-pagination"/>');a.owlControls.append(a.paginationWrapper);a.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(b){b.preventDefault();Number(f(this).data("owl-page"))!==a.currentItem&&a.goTo(Number(f(this).data("owl-page")),!0)})},updatePagination:function(){var a,b,e,c,d,g;if(!1===this.options.pagination)return!1;this.paginationWrapper.html("");a=0;b=this.itemsAmount-this.itemsAmount%this.options.items;for(c=0;c<this.itemsAmount;c+=1)0===c%this.options.items&&
11926    (a+=1,b===c&&(e=this.itemsAmount-this.options.items),d=f("<div/>",{"class":"owl-page"}),g=f("<span></span>",{text:!0===this.options.paginationNumbers?a:"","class":!0===this.options.paginationNumbers?"owl-numbers":""}),d.append(g),d.data("owl-page",b===c?e:c),d.data("owl-roundPages",a),this.paginationWrapper.append(d));this.checkPagination()},checkPagination:function(){var a=this;if(!1===a.options.pagination)return!1;a.paginationWrapper.find(".owl-page").each(function(){f(this).data("owl-roundPages")===
11927    f(a.$owlItems[a.currentItem]).data("owl-roundPages")&&(a.paginationWrapper.find(".owl-page").removeClass("active"),f(this).addClass("active"))})},checkNavigation:function(){if(!1===this.options.navigation)return!1;!1===this.options.rewindNav&&(0===this.currentItem&&0===this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.addClass("disabled")):0===this.currentItem&&0!==this.maximumItem?(this.buttonPrev.addClass("disabled"),this.buttonNext.removeClass("disabled")):this.currentItem===
11928        this.maximumItem?(this.buttonPrev.removeClass("disabled"),this.buttonNext.addClass("disabled")):0!==this.currentItem&&this.currentItem!==this.maximumItem&&(this.buttonPrev.removeClass("disabled"),this.buttonNext.removeClass("disabled")))},updateControls:function(){this.updatePagination();this.checkNavigation();this.owlControls&&(this.options.items>=this.itemsAmount?this.owlControls.hide():this.owlControls.show())},destroyControls:function(){this.owlControls&&this.owlControls.remove()},next:function(a){if(this.isTransition)return!1;
11929        this.currentItem+=!0===this.options.scrollPerPage?this.options.items:1;if(this.currentItem>this.maximumItem+(!0===this.options.scrollPerPage?this.options.items-1:0))if(!0===this.options.rewindNav)this.currentItem=0,a="rewind";else return this.currentItem=this.maximumItem,!1;this.goTo(this.currentItem,a)},prev:function(a){if(this.isTransition)return!1;this.currentItem=!0===this.options.scrollPerPage&&0<this.currentItem&&this.currentItem<this.options.items?0:this.currentItem-(!0===this.options.scrollPerPage?
11930        this.options.items:1);if(0>this.currentItem)if(!0===this.options.rewindNav)this.currentItem=this.maximumItem,a="rewind";else return this.currentItem=0,!1;this.goTo(this.currentItem,a)},goTo:function(a,b,e){var c=this;if(c.isTransition)return!1;"function"===typeof c.options.beforeMove&&c.options.beforeMove.apply(this,[c.$elem]);a>=c.maximumItem?a=c.maximumItem:0>=a&&(a=0);c.currentItem=c.owl.currentItem=a;if(!1!==c.options.transitionStyle&&"drag"!==e&&1===c.options.items&&!0===c.browser.support3d)return c.swapSpeed(0),
11931            !0===c.browser.support3d?c.transition3d(c.positionsInArray[a]):c.css2slide(c.positionsInArray[a],1),c.afterGo(),c.singleItemTransition(),!1;a=c.positionsInArray[a];!0===c.browser.support3d?(c.isCss3Finish=!1,!0===b?(c.swapSpeed("paginationSpeed"),g.setTimeout(function(){c.isCss3Finish=!0},c.options.paginationSpeed)):"rewind"===b?(c.swapSpeed(c.options.rewindSpeed),g.setTimeout(function(){c.isCss3Finish=!0},c.options.rewindSpeed)):(c.swapSpeed("slideSpeed"),g.setTimeout(function(){c.isCss3Finish=!0},
11932        c.options.slideSpeed)),c.transition3d(a)):!0===b?c.css2slide(a,c.options.paginationSpeed):"rewind"===b?c.css2slide(a,c.options.rewindSpeed):c.css2slide(a,c.options.slideSpeed);c.afterGo()},jumpTo:function(a){"function"===typeof this.options.beforeMove&&this.options.beforeMove.apply(this,[this.$elem]);a>=this.maximumItem||-1===a?a=this.maximumItem:0>=a&&(a=0);this.swapSpeed(0);!0===this.browser.support3d?this.transition3d(this.positionsInArray[a]):this.css2slide(this.positionsInArray[a],1);this.currentItem=
11933        this.owl.currentItem=a;this.afterGo()},afterGo:function(){this.prevArr.push(this.currentItem);this.prevItem=this.owl.prevItem=this.prevArr[this.prevArr.length-2];this.prevArr.shift(0);this.prevItem!==this.currentItem&&(this.checkPagination(),this.checkNavigation(),this.eachMoveUpdate(),!1!==this.options.autoPlay&&this.checkAp());"function"===typeof this.options.afterMove&&this.prevItem!==this.currentItem&&this.options.afterMove.apply(this,[this.$elem])},stop:function(){this.apStatus="stop";g.clearInterval(this.autoPlayInterval)},
11934    checkAp:function(){"stop"!==this.apStatus&&this.play()},play:function(){var a=this;a.apStatus="play";if(!1===a.options.autoPlay)return!1;g.clearInterval(a.autoPlayInterval);a.autoPlayInterval=g.setInterval(function(){a.next(!0)},a.options.autoPlay)},swapSpeed:function(a){"slideSpeed"===a?this.$owlWrapper.css(this.addCssSpeed(this.options.slideSpeed)):"paginationSpeed"===a?this.$owlWrapper.css(this.addCssSpeed(this.options.paginationSpeed)):"string"!==typeof a&&this.$owlWrapper.css(this.addCssSpeed(a))},
11935    addCssSpeed:function(a){return{"-webkit-transition":"all "+a+"ms ease","-moz-transition":"all "+a+"ms ease","-o-transition":"all "+a+"ms ease",transition:"all "+a+"ms ease"}},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"",transition:""}},doTranslate:function(a){return{"-webkit-transform":"translate3d("+a+"px, 0px, 0px)","-moz-transform":"translate3d("+a+"px, 0px, 0px)","-o-transform":"translate3d("+a+"px, 0px, 0px)","-ms-transform":"translate3d("+
11936        a+"px, 0px, 0px)",transform:"translate3d("+a+"px, 0px,0px)"}},transition3d:function(a){this.$owlWrapper.css(this.doTranslate(a))},css2move:function(a){this.$owlWrapper.css({left:a})},css2slide:function(a,b){var e=this;e.isCssFinish=!1;e.$owlWrapper.stop(!0,!0).animate({left:a},{duration:b||e.options.slideSpeed,complete:function(){e.isCssFinish=!0}})},checkBrowser:function(){var a=k.createElement("div");a.style.cssText="  -moz-transform:translate3d(0px, 0px, 0px); -ms-transform:translate3d(0px, 0px, 0px); -o-transform:translate3d(0px, 0px, 0px); -webkit-transform:translate3d(0px, 0px, 0px); transform:translate3d(0px, 0px, 0px)";
11937        a=a.style.cssText.match(/translate3d\(0px, 0px, 0px\)/g);
11937this.browser={support3d:null!==a&&1===a.length,isTouch:"ontouchstart"in g||g.navigator.msMaxTouchPoints}},moveEvents:function(){if(!1!==this.options.mouseDrag||!1!==this.options.touchDrag)this.gestures(),this.disabledEvents()},eventTypes:function(){var a=["s","e","x"];this.ev_types={};!0===this.options.mouseDrag&&!0===this.options.touchDrag?a=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"]:
11938            !1===this.options.mouseDrag&&!0===this.options.touchDrag?a=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"]:!0===this.options.mouseDrag&&!1===this.options.touchDrag&&(a=["mousedown.owl","mousemove.owl","mouseup.owl"]);this.ev_types.start=a[0];this.ev_types.move=a[1];this.ev_types.end=a[2]},disabledEvents:function(){this.$elem.on("dragstart.owl",function(a){a.preventDefault()});this.$elem.on("mousedown.disableTextSelect",function(a){return f(a.target).is("input, textarea, select, option")})},
11939    gestures:function(){function a(a){if(void 0!==a.touches)return{x:a.touches[0].pageX,y:a.touches[0].pageY};if(void 0===a.touches){if(void 0!==a.pageX)return{x:a.pageX,y:a.pageY};if(void 0===a.pageX)return{x:a.clientX,y:a.clientY}}}function b(a){"on"===a?(f(k).on(d.ev_types.move,e),f(k).on(d.ev_types.end,c)):"off"===a&&(f(k).off(d.ev_types.move),f(k).off(d.ev_types.end))}function e(b){b=b.originalEvent||b||g.event;d.newPosX=a(b).x-h.offsetX;d.newPosY=a(b).y-h.offsetY;d.newRelativeX=d.newPosX-h.relativePos;
11940        "function"===typeof d.options.startDragging&&!0!==h.dragging&&0!==d.newRelativeX&&(h.dragging=!0,d.options.startDragging.apply(d,[d.$elem]));(8<d.newRelativeX||-8>d.newRelativeX)&&!0===d.browser.isTouch&&(void 0!==b.preventDefault?b.preventDefault():b.returnValue=!1,h.sliding=!0);(10<d.newPosY||-10>d.newPosY)&&!1===h.sliding&&f(k).off("touchmove.owl");d.newPosX=Math.max(Math.min(d.newPosX,d.newRelativeX/5),d.maximumPixels+d.newRelativeX/5);!0===d.browser.support3d?d.transition3d(d.newPosX):d.css2move(d.newPosX)}
11941        function c(a){a=a.originalEvent||a||g.event;var c;a.target=a.target||a.srcElement;h.dragging=!1;!0!==d.browser.isTouch&&d.$owlWrapper.removeClass("grabbing");d.dragDirection=0>d.newRelativeX?d.owl.dragDirection="left":d.owl.dragDirection="right";0!==d.newRelativeX&&(c=d.getNewPosition(),d.goTo(c,!1,"drag"),h.targetElement===a.target&&!0!==d.browser.isTouch&&(f(a.target).on("click.disable",function(a){a.stopImmediatePropagation();a.stopPropagation();a.preventDefault();f(a.target).off("click.disable")}),
11942            a=f._data(a.target,"events").click,c=a.pop(),a.splice(0,0,c)));b("off")}var d=this,h={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};d.isCssFinish=!0;d.$elem.on(d.ev_types.start,".owl-wrapper",function(c){c=c.originalEvent||c||g.event;var e;if(3===c.which)return!1;if(!(d.itemsAmount<=d.options.items)){if(!1===d.isCssFinish&&!d.options.dragBeforeAnimFinish||!1===d.isCss3Finish&&!d.options.dragBeforeAnimFinish)return!1;
11943            !1!==d.options.autoPlay&&g.clearInterval(d.autoPlayInterval);!0===d.browser.isTouch||d.$owlWrapper.hasClass("grabbing")||d.$owlWrapper.addClass("grabbing");d.newPosX=0;d.newRelativeX=0;f(this).css(d.removeTransition());e=f(this).position();h.relativePos=e.left;h.offsetX=a(c).x-e.left;h.offsetY=a(c).y-e.top;b("on");h.sliding=!1;h.targetElement=c.target||c.srcElement}})},getNewPosition:function(){var a=this.closestItem();a>this.maximumItem?a=this.currentItem=this.maximumItem:0<=this.newPosX&&(this.currentItem=
11944        a=0);return a},closestItem:function(){var a=this,b=!0===a.options.scrollPerPage?a.pagesInArray:a.positionsInArray,e=a.newPosX,c=null;f.each(b,function(d,g){e-a.itemWidth/20>b[d+1]&&e-a.itemWidth/20<g&&"left"===a.moveDirection()?(c=g,a.currentItem=!0===a.options.scrollPerPage?f.inArray(c,a.positionsInArray):d):e+a.itemWidth/20<g&&e+a.itemWidth/20>(b[d+1]||b[d]-a.itemWidth)&&"right"===a.moveDirection()&&(!0===a.options.scrollPerPage?(c=b[d+1]||b[b.length-1],a.currentItem=f.inArray(c,a.positionsInArray)):
11945        (c=b[d+1],a.currentItem=d+1))});return a.currentItem},moveDirection:function(){var a;0>this.newRelativeX?(a="right",this.playDirection="next"):(a="left",this.playDirection="prev");return a},customEvents:function(){var a=this;a.$elem.on("owl.next",function(){a.next()});a.$elem.on("owl.prev",function(){a.prev()});a.$elem.on("owl.play",function(b,e){a.options.autoPlay=e;a.play();a.hoverStatus="play"});a.$elem.on("owl.stop",function(){a.stop();a.hoverStatus="stop"});a.$elem.on("owl.goTo",function(b,e){a.goTo(e)});
11946        a.$elem.on("owl.jumpTo",function(b,e){a.jumpTo(e)})},stopOnHover:function(){var a=this;!0===a.options.stopOnHover&&!0!==a.browser.isTouch&&!1!==a.options.autoPlay&&(a.$elem.on("mouseover",function(){a.stop()}),a.$elem.on("mouseout",function(){"stop"!==a.hoverStatus&&a.play()}))},lazyLoad:function(){var a,b,e,c,d;if(!1===this.options.lazyLoad)return!1;for(a=0;a<this.itemsAmount;a+=1)b=f(this.$owlItems[a]),"loaded"!==b.data("owl-loaded")&&(e=b.data("owl-item"),c=b.find(".lazyOwl"),"string"!==typeof c.data("src")?
11947        b.data("owl-loaded","loaded"):(void 0===b.data("owl-loaded")&&(c.hide(),b.addClass("loading").data("owl-loaded","checked")),(d=!0===this.options.lazyFollow?e>=this.currentItem:!0)&&e<this.currentItem+this.options.items&&c.length&&this.lazyPreload(b,c)))},lazyPreload:function(a,b){function e(){a.data("owl-loaded","loaded").removeClass("loading");b.removeAttr("data-src");"fade"===d.options.lazyEffect?b.fadeIn(400):b.show();"function"===typeof d.options.afterLazyLoad&&d.options.afterLazyLoad.apply(this,
11948        [d.$elem])}function c(){f+=1;d.completeImg(b.get(0))||!0===k?e():100>=f?g.setTimeout(c,100):e()}var d=this,f=0,k;"DIV"===b.prop("tagName")?(b.css("background-image","url("+b.data("src")+")"),k=!0):b[0].src=b.data("src");c()},autoHeight:function(){function a(){var a=f(e.$owlItems[e.currentItem]).height();e.wrapperOuter.css("height",a+"px");e.wrapperOuter.hasClass("autoHeight")||g.setTimeout(function(){e.wrapperOuter.addClass("autoHeight")},0)}function b(){d+=1;e.completeImg(c.get(0))?a():100>=d?g.setTimeout(b,
11949        100):e.wrapperOuter.css("height","")}var e=this,c=f(e.$owlItems[e.currentItem]).find("img"),d;void 0!==c.get(0)?(d=0,b()):a()},completeImg:function(a){return!a.complete||"undefined"!==typeof a.naturalWi
11949dth&&0===a.naturalWidth?!1:!0},onVisibleItems:function(){var a;!0===this.options.addClassActive&&this.$owlItems.removeClass("active");this.visibleItems=[];for(a=this.currentItem;a<this.currentItem+this.options.items;a+=1)this.visibleItems.push(a),!0===this.options.addClassActive&&f(this.$owlItems[a]).addClass("active");
11950        this.owl.visibleItems=this.visibleItems},transitionTypes:function(a){this.outClass="owl-"+a+"-out";this.inClass="owl-"+a+"-in"},singleItemTransition:function(){var a=this,b=a.outClass,e=a.inClass,c=a.$owlItems.eq(a.currentItem),d=a.$owlItems.eq(a.prevItem),f=Math.abs(a.positionsInArray[a.currentItem])+a.positionsInArray[a.prevItem],g=Math.abs(a.positionsInArray[a.currentItem])+a.itemWidth/2;a.isTransition=!0;a.$owlWrapper.addClass("owl-origin").css({"-webkit-transform-origin":g+"px","-moz-perspective-origin":g+
11951        "px","perspective-origin":g+"px"});d.css({position:"relative",left:f+"px"}).addClass(b).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){a.endPrev=!0;d.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");a.clearTransStyle(d,b)});c.addClass(e).on("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){a.endCurrent=!0;c.off("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend");a.clearTransStyle(c,e)})},clearTransStyle:function(a,
11952                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             b){a.css({position:"",left:""}).removeClass(b);this.endPrev&&this.endCurrent&&(this.$owlWrapper.removeClass("owl-origin"),this.isTransition=this.endCurrent=this.endPrev=!1)},owlStatus:function(){this.owl={userOptions:this.userOptions,baseElement:this.$elem,userItems:this.$userItems,owlItems:this.$owlItems,currentItem:this.currentItem,prevItem:this.prevItem,visibleItems:this.visibleItems,isTouch:this.browser.isTouch,browser:this.browser,dragDirection:this.dragDirection}},clearEvents:function(){this.$elem.off(".owl owl mousedown.disableTextSelect");
11953        f(k).off(".owl owl");f(g).off("resize",this.resizer)},unWrap:function(){0!==this.$elem.children().length&&(this.$owlWrapper.unwrap(),this.$userItems.unwrap().unwrap(),this.owlControls&&this.owlControls.remove());this.clearEvents();this.$elem.attr("style",this.$elem.data("owl-originalStyles")||"").attr("class",this.$elem.data("owl-originalClasses"))},destroy:function(){this.stop();g.clearInterval(this.checkVisible);this.unWrap();this.$elem.removeData()},reinit:function(a){a=f.extend({},this.userOptions,
11954        a);this.unWrap();this.init(a,this.$elem)},addItem:function(a,b){var e;if(!a)return!1;if(0===this.$elem.children().length)return this.$elem.append(a),this.setVars(),!1;this.unWrap();e=void 0===b||-1===b?-1:b;e>=this.$userItems.length||-1===e?this.$userItems.eq(-1).after(a):this.$userItems.eq(e).before(a);this.setVars()},removeItem:function(a){if(0===this.$elem.children().length)return!1;a=void 0===a||-1===a?-1:a;this.unWrap();this.$userItems.eq(a).remove();this.setVars()}};f.fn.owlCarousel=function(a){return this.each(function(){if(!0===
11955    f(this).data("owl-init"))return!1;f(this).data("owl-init",!0);var b=Object.create(l);b.init(a,this);f.data(this,"owlCarousel",b)})};f.fn.owlCarousel.options={items:5,itemsCustom:!1,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,itemsScaleUp:!1,slideSpeed:200,paginationSpeed:800,rewindSpeed:1E3,autoPlay:!1,stopOnHover:!1,navigation:!1,navigationText:["prev","next"],rewindNav:!0,scrollPerPage:!1,pagination:!0,paginationNumbers:!1,
11956    responsive:!0,responsiveRefreshRate:200,responsiveBaseWidth:g,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:!1,lazyFollow:!0,lazyEffect:"fade",autoHeight:!1,jsonPath:!1,jsonSuccess:!1,dragBeforeAnimFinish:!0,mouseDrag:!0,touchDrag:!0,addClassActive:!1,transitionStyle:!1,beforeUpdate:!1,afterUpdate:!1,beforeInit:!1,afterInit:!1,beforeMove:!1,afterMove:!1,afterAction:!1,startDragging:!1,afterLazyLoad:!1}})(jQuery,window,document);
11957/*! iFrame Resizer (iframeSizer.min.js ) - v2.8.4 - 2015-02-20
11958 *  Desc: Force cross domain iframes to size to content.
11959 *  Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame.
11960 *  Copyright: (c) 2015 David J. Bradshaw - [email protected]
11961 *  License: MIT
11962 */
11963
11964!function(){"use strict";function a(a,b,c){"addEventListener"in window?a.addEventListener(b,c,!1):"attachEvent"in window&&a.attachEvent("on"+b,c)}function b(){var a,b=["moz","webkit","o","ms"];for(a=0;a<b.length&&!A;a+=1)A=window[b[a]+"RequestAnimationFrame"];A||e(" RequestAnimationFrame not supported")}function c(){var a="Host page";return window.top!==window.self&&(a=window.parentIFrame?window.parentIFrame.getId():"Nested host page"),a}function d(a){return w+"["+c()+"]"+a}function e(a){C.log&&"object"==typeof window.console&&console.log(d(a))}function f(a){"object"==typeof window.console&&console.warn(d(a)
11964)}function g(a){function b(){function a(){k(F),i(),C.resizedCallback(F)}g("Height"),g("Width"),l(a,F,"resetPage")}function c(a){var b=a.id;e(" Removing iFrame: "+b),a.parentNode.removeChild(a),C.closedCallback(b),e(" --")}function d(){var a=E.substr(x).split(":");return{iframe:document.getElementById(a[0]),id:a[0],height:a[1],width:a[2],type:a[3]}}function g(a){var b=Number(C["max"+a]),c=Number(C["min"+a]),d=a.toLowerCase(),f=Number(F[d]);if(c>b)throw new Error("Value for min"+a+" can not be greater than max"+a);e(" Checking "+d+" is in range "+c+"-"+b),c>f&&(f=c,e(" Set "+d+" to min value")),f>b&&(f=b,e(" Set "+d+" to max value")),F[d]=""+f}function m(){var b=a.origin,c=F.iframe.src.split("/").slice(0,3).join("/");if(C.checkOrigin&&(e(" Checking connection is from: "+c),""+b!="null"&&b!==c))throw new Error("Unexpected message received from: "+b+" for "+F.iframe.id+". Message was: "+a.data+". This error can be disabled by adding the checkOrigin: false option.");return!0}function n(){return w===(""+E).substr(0,x)}function o(){var a=F.type in{"true":1,"false":1};return a&&e(" Ignoring init message from meta parent page"),a}function p(a){return E.substr(E.indexOf(":")+v+a)}function q(a){e(" MessageCallback passed: {iframe: "+F.iframe.id+", message: "+a+"}"),C.messageCallback({iframe:F.iframe,message:JSON.parse(a)}),e(" --")}function r(){if(null===F.iframe)throw new Error("iFrame ("+F.id+") does not exist on "+y);return!0}function s(a){var b=a.getBoundingClientRect();return h(),{x:parseInt(b.left,10)+parseInt(z.x,10),y:parseInt(b.top,10)+parseInt(z.y,10)}}function u(a){function b(){z=g,A(),e(" --")}function c(){return{x:Number(F.width)+d.x,y:Number(F.height)+d.y}}var d=a?s(F.iframe):{x:0,y:0},g=c();e(" Reposition requested from iFrame (offset x:"+d.x+" y:"+d.y+")"),window.top!==window.self?window.parentIFrame?a?parentIFrame.scrollToOffset(g.x,g.y):parentIFrame.scrollTo(F.width,F.height):f(" Unable to scroll to requested position, window.parentIFrame not found"):b()}function A(){!1!==C.scrollCallback(z)&&i()}function B(a){function b(a){var b=s(a);e(" Moving to in page link (#"+c+") at x: "+b.x+" y: "+b.y),z={x:b.x,y:b.y},A(),e(" --")}var c=a.split("#")[1]||"",d=decodeURIComponent(c),f=document.getElementById(d)||document.getElementsByName(d)[0];window.top!==window.self?window.parentIFrame?parentIFrame.moveToAnchor(c):e(" In page link #"+c+" not found and window.parentIFrame not found"):f?b(f):e(" In page link #"+c+" not found")}function D(){switch(F.type){case"close":c(F.iframe),C.resizedCallback(F);break;case"message":q(p(6));break;case"scrollTo":u(!1);break;case"scrollToOffset":u(!0);break;case"inPageLink":B(p(9));break;case"reset":j(F);break;case"init":b(),C.initCallback(F.iframe);break;default:b()}}var E=a.data,F={};n()&&(e(" Received: "+E),F=d(),!o()&&r()&&m()&&(D(),t=!1))}function h(){null===z&&(z={x:void 0!==window.pageXOffset?window.pageXOffset:document.documentElement.scrollLeft,y:void 0!==window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop},e(" Get page position: "+z.x+","+z.y))}function i(){null!==z&&(window.scrollTo(z.x,z.y),e(" Set page position: "+z.x+","+z.y),z=null)}function j(a){function b(){k(a),m("reset","reset",a.iframe)}e(" Size reset requested by "+("init"===a.type?"host page":"iFrame")),h(),l(b,a,"init")}function k(a){function b(b){a.iframe.style[b]=a[b]+"px",e(" IFrame ("+a.iframe.id+") "+b+" set to "+a[b]+"px")}C.sizeHeight&&b("height"),C.sizeWidth&&b("width")}function l(a,b,c){c!==b.type&&A?(e(" Requesting animation frame"),A(a)):a()}function m(a,b,c){e("["+a+"] Sending msg to iframe ("+b+")"),c.contentWindow.postMessage(w+b,"*")}function n(){function b(){function a(a){1/0!==C[a]&&0!==C[a]&&(i.style[a]=C[a]+"px",e(" Set "+a+" = "+C[a]+"px"))}a("maxHeight"),a("minHeight"),a("maxWidth"),a("minWidth")}function c(a){return""===a&&(i.id=a="iFrameResizer"+s++,e(" Added missing iframe ID: "+a+" ("+i.src+")")),a}function d(){e(" IFrame scrolling "+(C.scrolling?"enabled":"disabled")+" for "+k),i.style.overflow=!1===C.scrolling?"hidden":"auto",i.scrolling=!1===C.scrolling?"no":"yes"}function f(){("number"==typeof C.bodyMargin||"0"===C.bodyMargin)&&(C.bodyMarginV1=C.bodyMargin,C.bodyMargin=""+C.bodyMargin+"px")}function g(){return k+":"+C.bodyMarginV1+":"+C.sizeWidth+":"+C.log+":"+C.interval+":"+C.enablePublicMethods+":"+C.autoResize+":"+C.bodyMargin+":"+C.heightCalculationMethod+":"+C.bodyBackgroun
11964d+":"+C.bodyPadding+":"+C.tolerance+":"+C.enableInPageLinks}function h(b){a(i,"load",function(){var a=t;m("iFrame.onload",b,i),!a&&C.heightCalculationMethod in B&&j({iframe:i,height:0,width:0,type:"init"})}),m("init",b,i)}var i=this,k=c(i.id);d(),b(),f(),h(g())}function o(a){if("object"!=typeof a)throw new TypeError("Options is not an object.")}function p(a){a=a||{},o(a);for(var b in D)D.hasOwnProperty(b)&&(C[b]=a.hasOwnProperty(b)?a[b]:D[b])}function q(){function a(a){if(!a.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==a.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+a.tagName+">.");n.call(a)}return function(b,c){switch(p(b),typeof c){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(c||"iframe"),a);break;case"object":a(c);break;default:throw new TypeError("Unexpected data type ("+typeof c+").")}}}function r(a){a.fn.iFrameResize=function(a){return p(a),this.filter("iframe").each(n).end()}}var s=0,t=!0,u="message",v=u.length,w="[iFrameSizer]",x=w.length,y="",z=null,A=window.requestAnimationFrame,B={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},C={},D={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,enableInPageLinks:!1,enablePublicMethods:!1,heightCalculationMethod:"offset",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,closedCallback:function(){},initCallback:function(){},messageCallback:function(){},resizedCallback:function(){},scrollCallback:function(){return!0}};b(),a(window,"message",g),window.jQuery&&r(jQuery),"function"==typeof define&&define.amd?define([],q):"object"==typeof module&&"object"==typeof module.exports?module.exports=q():window.iFrameResize=q()}();
11965//# sourceMappingURL=iframeResizer.map
11966/*jslint browser: true, devel: true, nomen: true*/
11967/*global $, Modernizr, mejs, isMobile*/
11968var PAWS = {};
11969
11970/**
11971 * @Helpers Object
11972 * Holds any helper functions.
11973*/
11974
11975PAWS.helpers = {
11976    pauseVideos: function () {
11977        'use strict';
11978
11979
11980        if (PAWS.helpers.isIpad() === true) {
11981            // If device is ipad the we use youtube API to pause the video currently playing
11982            PAWS.youtubePlayer.pausevideo();
11983        }
11984        $.each(window._V_.players, function (i, player) {
11985            player.pause();
11986        });
11987    },
11988    viewPortWidth: function () {
11989        'use strict';
11990        return $(window).width();
11991    },
11992    viewPortHeight: function () {
11993        'use strict';
11994        return $(window).height();
11995    },
11996    isSupported: function (a) {
11997        'use strict';
11998        return Modernizr[a];
11999    },
12000    isMobile: function () {
12001        'use strict';
12002        return isMobile.any;
12003    },
12004    isIpad: function () {
12005        'use strict';
12006        return isMobile.apple.tablet;
12007    },
12008    isStorageSupported: function () {
12009        'use strict';
12010        return typeof Storage !== 'undefined';
12011    },
12012	storageSetItem: function (key, value) {
12013		'use strict';
12014		try {
12015			localStorage.setItem(key, value);
12016		} catch (err) {}
12017		
12018	},
12019    inArray: function (array, k) {
12020        'use strict';
12021        var i = 0;
12022        for (i; i < array.length; i += 1) {
12023            if (array[i] === k) {
12024                return true;
12025            }
12026        }
12027        return false;
12028    }
12029};
12030
12031
12032/**
12033 * @dropdownWidget module
12034 * Initialises a "fake" dropdown list widget.
12035*/
12036PAWS.dropdownWidget = (function () {
12037    'use strict';
12038
12039    var $element,
12040        $dropList;
12041
12042    return {
12043        init: function (options) {
12044            var defaults = {
12045                    element: '#location-dropdown',
12046                    collapsed: true,
12047                    width: '',
12048                    defaultValue: 'All'
12049                },
12050                that = this,
12051                element,
12052                handler,
12053                placeholder,
12054                dropList,
12055                selectedItem;
12056
12057            options = $.extend({}, defaults, options);
12058
12059            // Proceed only if element is in DOM.
12060            if ($(options.element).length > 0) {
12061                element = $(options.element);                        // The dropdown widget itself.
12062                handler = element.find('.handler');                  // The clickable element collapsing/uncollapsing the dropdown list.
12063                placeholder = handler.find('.placeholder');          // The placeholder of selected value.
12064                dropList = element.find('.droplist');                // The dropdown list containing all the options.
12065                selectedItem = dropList.find('ul li.selected');      // The selected item from the dropdown list.
12066
12067				$element = element;
12068				$dropList = dropList;
12069
12070				// Hide dropdown list by default.
12071				dropList.hide();
12072
12073				// Insert default value to placeholder.
12074				if (selectedItem.length > 0) {
12075					placeholder.html(selectedItem.text());
12076				} else {
12077					placeholder.html(options.defaultValue);
12078				}
12079
12080				// Decide if will be collapsed by default.
12081				if (options.collapsed === false) {
12082					element.addClass('uncollapsed');
12083					that.uncollapse(0);
12084				}
12085
12086				// Make widget of fixed width.
12087				if (options.width !== '') {
12088					element.
12089						addClass('fixed-width').
12090						css({
12091							width: options.width + 'px'
12092						});
12093				}
12094
12095				// Add event handlers.
12096				handler.on('click', function () {
12097					// Determine whether list is collapsed or not,
12098					// and act accordingly.
12099					if (dropList.is(':visible')) {
12100						that.collapse();
12101					} else {
12102						that.uncollapse();
12103					}
12104				});
12105
12106				$(document).on('click', function (e) {
12107					if (element.hasClass('open')) {
12108						if (!$(e.target).is('a')) {
12109							that.collapse(200);
12110						}
12111					}
12112				});
12113			}
12114
12115			return that;
12116		},
12117
12118		collapse: function (speed) {
12119			var that = this;
12120
12121			if (typeof $element !== 'undefined') {
12122				if (typeof speed === 'undefined') {
12123					speed = 400;
12124				}
12125
12126				$element.removeClass('uncollapsed');
12127
12128				$dropList.slideUp(speed, function () {
12129					$element.removeClass('open');
12130				});
12131			}
12132
12133			return that;
12134		},
12135
12136		uncollapse: function (speed) {
12137			var that = this,
12138				dropList = $element.find('.droplist'),
12139				selectedFilter = dropList.find('li.selected');
12140
12141			if (typeof $element !== 'undefined') {
12142				if (typeof speed === 'undefined') {
12143					speed = 400;
12144				}
12145
12146				$element.addClass('uncollapsed');
12147
12148				$dropList.slideDown(speed, function () {
12149					$element.addClass('open');
12150
12151					// Scroll to selected element of the dropdown list.
12152					if (selectedFilter.length > 0) {
12153						dropList.animate({
12154							scrollTop: selectedFilter.parent().scrollTop() + selectedFilter.offset().top - selectedFilter.parent().offset().top
12155						}, 200);
12156					}
12157				});
12158			}
12159
12160			return that;
12161		}
12162	};
12163}());
12164
12165
12166/**
12167 * @module forms
12168 * Initializes Forms.
12169 */
12170PAWS.forms = (function () {
12171	'use strict';
12172
12173	var instance = {};
12174
12175	instance.placeholder = function () {
12176		$('input, textarea').placeholder();
12177		return instance;
12178	};
12179
12180	return {
12181		placeholder: instance.placeholder
12182	};
12183}());
12184
12185
12186/**
12187 * @module filterDisable
12188 * Initializes attribute filters for dogs and cats.
12189 */
12190
12191PAWS.filterDisable = (function () {
12192	'use strict';
12193
12194	var catFilter = $("#cat-filter-label"),
12195        dogFilter = $("#dog-filter-label");
12196    
12197    return {
12198        init: function() {
12199           
12200            if (dogFilter.hasClass('checked')) {
12201                $("#attributes_filter_dogs, .size-filter, #more_options_link, .dogs-age").show();
12202                $("#attributes_filter_cats, .cats-age").hide();
12203                
12204                if ($('#more_options').hasClass('showMoreOptions')) {
12205                    $("#more_options").show();
12206                } else {
12207                    $("#more_options").hide();
12208                }
12209                
12210            } else if (catFilter.hasClass('checked')) {
12211                $("#attributes_filter_cats, #more_options_link, .cats-age").show();
12212                $("#attributes_filter_dogs, .size-filter, .dogs-age").hide();
12213                
12214                if ($('#more_options').hasClass('showMoreOptions')) {
12215                    $("#more_options").show();
12216                } else {
12217                    $("#more_options").hide();
12218                }
12219                
12220            } else{
12221                $("attributes_filter_cats, #attributes_filter_cats, #more_options_link, #more_options, .dogs-age, .cats-age").hide();
12222            }
12223        }
12224
12225    };
12226	
12227}(window));
12228
12229
12230/**
12231 * @module navigation
12232 * Initializes the global menu and handles its events.
12233 */
12234PAWS.navigation = (function (win) {
12235	'use strict';
12236
12237	var menu = $('#global-menu'),
12238		menuMainLinks = $('#global-menu ul > li'),
12239		homeMenu = $('#home-menu a'),
12240		currentTab = $('#global-menu ul > li.current'),
12241		menuBtn = $('#global-menu-btn'),
12242		menuBtnIcon = $('#nav-toggle-icon'),
12243		header = $('#header'),
12244		mainContent = $('#main'),
12245		topButton = document.getElementById('top-btn');
12246
12247	/**
12248	 * Handles cases when menu is 'open'.
12249	 */
12250	function handleMenuOpen() {
12251		header.removeClass('navbar-fixed-top');         // Remove fixed position from header.
12252		header.addClass('pos-relative');                // Add relative position to header.
12253		mainContent.addClass('no-margin');              // Remove margin-top from main content.
12254		win.scrollTo(0, 0);                             // Scroll at the top of page.
12255	}
12256
12257	/**
12258	 * Handles cases when menu is 'closed'.
12259	 */
12260	function handleMenuClose() {
12261		var interval = setInterval(function () {        // Set an interval waiting for the menu to collapse.
12262			if (!menu.hasClass('collapsing')) {
12263				header.removeClass('pos-relative');     // Remove relative position from header.
12264				header.addClass('navbar-fixed-top');    // Add fixed position to header.
12265				mainContent.removeClass('no-margin');   // Add margin-top (needed when fixed poisitioned) to header.
12266				clearInterval(interval);                // Clear the interval (Menu is collapsed now).
12267			}
12268		}, 1);
12269	}
12270
12271	/**
12272	 * Toggles Global Menu.
12273	 */
12274	function toggleMenu(speed) {
12275		if (typeof speed === 'undefined' || isNaN(speed)) {
12276			speed = 1000;
12277		}
12278
12279		if (!menu.hasClass('open')) {
12280			menu.addClass('open');
12281			menuBtnIcon.addClass('active');
12282			menuBtn.addClass('active');
12283			menu.slideDown(speed);
12284			// var navWrapper = $('#nav-wrapper');
12285			// if(navWrapper.hasClass('show-menu')) {
12286			// 	navWrapper.removeClass('show-menu');
12287			// }
12288		} else {
12289			menu.removeClass('open');
12290			menuBtnIcon.removeClass('active');
12291			menu.slideUp(speed, function () {
12292				menuBtn.removeClass('active');
12293			});
12294		}
12295	}
12296
12297	/**
12298	 * Creates menu accordion from the tabs content.
12299	 */
12300	function makeAccordion() {
12301		var globalMenu = $('#global-menu'),
12302			tabs = document.querySelectorAll('#global-menu ul li'),
12303			tabPanes = document.querySelectorAll('#global-menu .tab-content .tab-pane'),
12304			accordionButtons = globalMenu.find('ul li span'),
12305			accordionHeaders = globalMenu.find('ul li a'),
12306			tabsLen = tabPanes.length,
12307			i = 0,
12308			tab,
12309			nextTab,
12310			tabPane,
12311			accordionTpl;
12312
12313		// Generate the accordion templates and append them
12314		// after each tab element of the original menu.
12315		for (i; i < tabsLen; i += 1) {
12316			tab = tabs[i];
12317			tabPane = tabPanes[i];
12318			nextTab = $(tab).next();
12319			accordionTpl = '<li class="accordion-item col-xs-12">' + tabPanes[i].innerHTML + '</li>';
12320			$(tab).after(accordionTpl);
12321		}
12322
12323		globalMenu.find('ul li dl').removeClass('col-md-3');
12324
12325		// Attach click event on the "+" icon of the tab.
12326		globalMenu.on('click', 'ul li span', function () {
12327			var allAccordions = $('.accordion-item'),
12328				accordionToOpen = $(this).parent().next();
12329
12330			// Close all accordions except the open one.
12331			allAccordions.not(accordionToOpen).removeClass('open');
12332			accordionToOpen.toggleClass('open');
12333			win.scrollTo(0, 0);
12334
12335			// Deativate all accordion buttons &
12336			// toggle the clicked one.
12337			accordionButtons.not($(this)).removeClass('active');
12338			$(this).toggleClass('active');
12339
12340			// Toggle active accordions headers.
12341			accordionHeaders.not($(this).prev()).removeClass('active-header');
12342			$(this).prev().toggleClass('active-header');
12343		});
12344	}
12345
12346	/**
12347	 * Creates the Sign-up & Shop buttons copying them from super header inside the global menu.
12348	 */
12349	function makeHeaderButtons() {
12350		var originalButtons = $('#super-header').find('.buttons-box').html(),
12351			mobilePlaceholder = $('.buttons-box').find('div').eq(1);
12352
12353		mobilePlaceholder.append(originalButtons);
12354	}
12355
12356	/**
12357	 * Finds which tab is active on load and activates the appropriate tab-pane.
12358	 */
12359	function activateTab() {
12360		var activeTab = menu.find('ul li.active a'),
12361			activeTabTarget = activeTab.attr('data-target'),
12362			tabPane = menu.find('.tab-content ' + activeTabTarget);
12363
12364		tabPane.addClass('active');
12365	}
12366
12367	return {
12368		init: function () {
12369			makeAccordion();
12370			makeHeaderButtons();
12371			this.handleResponsiveMode();
12372
12373			// Open menu on page load for pages that have Tab Panes.
12374			if (PAWS.helpers.viewPortWidth() >= 992 && (!currentTab.hasClass('no-tab-pane') && !homeMenu.hasClass('current')) && menuMainLinks.hasClass('current') && menuMainLinks.hasClass('open')) {
12375				activateTab();
12376				toggleMenu(0);
12377				menuMainLinks.removeClass('no-arrow');
12378			} else if (PAWS.helpers.viewPortWidth() >= 992 && (!currentTab.hasClass('no-tab-pane') && !homeMenu.hasClass('current')) && menuMainLinks.hasClass('current')) {
12379				activateTab();
12380			} else {
12381				menuMainLinks.addClass('no-arrow');
12382			}
12383
12384			// Add click event on Menu button.
12385			menuBtn.on('click', toggleMenu);
12386
12387			// CHANGES: Menu tabs work on click now.
12388			/*menuMainLinks.on('mouseenter', function () {
12389				if (!PAWS.helpers.isMobile()) {
12390					$(this).tab('show');
12391				}
12392			});*/
12393		},
12394
12395		handleResponsiveMode: function () {
12396			var elA = $('#header').find('div').eq(0),                               // First "div" element of "#header".
12397				elB = $('#global-menu').find('div').eq(0).find('div').eq(0);        // First "div" element of first "div" element of "#global-menu".
12398
12399			if ($(win).width() <= 991) {
12400				elA.removeClass('container');
12401				elA.addClass('container-fluid');
12402
12403				elB.removeClass('container');
12404				elB.addClass('container-fluid full-width');
12405			} else {
12406				elA.addClass('container');
12407				elA.removeClass('container-fluid');
12408
12409				elB.removeClass('container-fluid full-width');
12410				elB.addClass('container');
12411			}
12412		},
12413
12414		// TODO: Remove if not needed.
12415		/*handleHeaderPos: function () {
12416			if (menu.hasClass('in') && $(win).width() >= 991) {
12417				if (menu.isOnScreen()) {
12418					header.removeClass('navbar-fixed-top');
12419					mainContent.addClass('no-margin');
12420				} else {
12421					header.addClass('navbar-fixed-top');
12422					mainContent.removeClass('no-margin');
12423					menuBtn.click();
12424				}
12425			} else {
12426				header.addClass('navbar-fixed-top');
12427			}
12428		},*/
12429
12430		scrollTo: function (options) {
12431			var defaults = {
12432				top: 0,
12433				speed: 700
12434			};
12435
12436			options = $.extend({}, defaults, options);
12437
12438			$('html, body').stop().animate({
12439				scrollTop: options.top
12440			}, options.speed);
12441
12442			return false;
12443		},
12444		
12445		scrollToElement: function (options) {
12446			var defaults = {
12447				element: '#top',
12448				speed: 400,
12449				topOffset: 0
12450			};
12451			
12452			options = $.extend({}, defaults, options);
12453			
12454			if ($(options.element).length > 0) {
12455				$('html, body').stop().animate({
12456					scrollTop: $(options.element).offset().top - options.topOffset
12457				}, options.speed);
12458			}
12459		},
12460
12461		showTopButton: function () {
12462			if (topButton && topButton.className !== 'visible') {
12463				topButton.className = 'visible';
12464			}
12465		},
12466
12467		hideTopButton: function () {
12468			if (topButton && topButton.className === 'visible') {
12469				topButton.className = '';
12470			}
12471		},
12472		makeStickyMenu: function (ele){
12473			var self = ele,
12474				menuBtn = $('#global-menu-btn'),
12475				menuBtnIcon = $('#nav-toggle-icon'),
12476				globalMenu = $('#global-menu'),
12477				navWrapper = $('#nav-wrapper');
12478
12479			if (self.scrollTop() > 44) {
12480				navWrapper.addClass('sticky');
12481				if(menuBtn.hasClass('active') && !$('input.gsc-input').is(':focus')) {
12482					if($('#global-menu').innerHeight() >= (PAWS.helpers.viewPortHeight() - 100)) {
12483						return false;
12484					}
12485					globalMenu.removeClass('open');
12486					menuBtn.removeClass('active');
12487					menuBtnIcon.removeClass('active');
12488					globalMenu.slideUp(1000, function () {
12489						globalMenu.removeClass('active');
12490					});
12491				}
12492			}
12493			if (self.scrollTop() < 44) {
12494				$('#nav-wrapper').removeClass('sticky');
12495			}
12496		}
12497
12498
12499	};
12500}(window));
12501
12502
12503/**
12504 * @module accordion
12505 * Initializes accordion groups.
12506 */
12507PAWS.accordion = (function () {
12508	'use strict';
12509
12510	return {
12511		init: function (elements, options) {
12512			var groups = document.querySelectorAll(elements),     // Node list of accorion groups.
12513				groupsCounter = 0,                                // Accordion groups counter.
12514				groupsLen = groups.length,                        // Accordion groups length.
12515				group,                                            // Single accordion group element.
12516				panels,                                           // Accordion group's panel items.
12517				panelsCounter,                                    // Accordion group's panel items couter.
12518				panelsLen,                                        // Accordion group's panel items length.
12519				panel,                                            // Single accordion panel item.
12520				panelNumber,                                      // Placeholder of the panel's heading number.
12521				panelHeading,                                     // Panel's heading (trigger element).
12522				panelBody,                                        // Panel's body element.
12523				groupID;                                          // Unique accordion group identifier.
12524
12525			// Loop through all accordion groups.
12526			for (groupsCounter; groupsCounter < groupsLen; groupsCounter += 1) {
12527				group = groups[groupsCounter];
12528
12529				group.id = 'accordion_' + groupsCounter;                                  // Set a unique identifier to each accordion group.
12530				groupID = group.id;                                                       // Assign identifier for later use.
12531
12532				panels = group.querySelectorAll('.panel');                                // Get all panels for each accordion group.
12533				panelsCounter = 0;                                                        // Initialize panels' counter.
12534				panelsLen = panels.length;                                                // Get total panels' length.
12535
12536				// Loop through all panels for each accordion group.
12537				for (panelsCounter; panelsCounter < panelsLen; panelsCounter += 1) {
12538					panel = panels[panelsCounter];
12539
12540					panelHeading = panel.querySelector('.panel-header');                  // Get heading element for each panel.
12541					panelHeading.href = '#' + groupID + '_panel_' + panelsCounter;        // Set 'href' attribute for each panel heading.
12542					panelNumber = panelHeading.querySelector('span');                     // Get number placeholder for each panel heading.
12543					panelNumber.innerHTML = panelsCounter + 1 + '.';                      // Populatenumber placeholder.
12544
12545					if (!options || !options.allowManyOpen ||
12546							options.allowManyOpen === false) {
12547						panelHeading.setAttribute('data-parent', '#' + groupID);          // Set 'data-parent' attribute for each panel heading.
12548					}
12549
12550					panelBody = panel.querySelector('.panel-body');                       // Get body element for each panel.
12551					panelBody.id = groupID + '_panel_' + panelsCounter;                   // Set 'id' attribute for each panel-body element.
12552
12553					// Determine if any panel will be open by default.
12554					if (options && options.openPanels) {
12555						if (PAWS.helpers.inArray(options.openPanels, panelsCounter)) {
12556							panelHeading.className = '';
12557							panelBody.className += ' in';
12558						}
12559					}
12560				}
12561			}
12562		}
12563	};
12564}());
12565
12566
12567/**
12568 * @module carousel
12569 * Initializes all carousel items.
12570 */
12571PAWS.carousel = (function () {
12572	'use strict';
12573
12574	var el;
12575
12576	return {
12577		init: function (element, options) {
12578			if ($(element).length > 0) {
12579				el = element;
12580				$(element).owlCarousel(options);
12581			}
12582		},
12583
12584		themeSelect: function (c) {
12585			$(el).addClass(c);
12586		},
12587
12588		makeCustomButtons: function () {
12589			var intervalID,
12590				carouselElm = $(el),
12591				buttons = carouselElm.find('.owl-buttons'),
12592				buttonsTemplate = buttons.html(),
12593				customButtons = carouselElm.parent().parent().parent().after('<div class="owl-custom-buttons"></div>'),
12594				customButtonsContainer = $('.owl-custom-buttons'),
12595				determineVisibility = function () {
12596					var origCtrls = carouselElm.find('.owl-controls'),
12597						origCtrlsNotVisible = !origCtrls.is(':visible');
12598
12599					if (origCtrlsNotVisible) {
12600						customButtonsContainer.hide();
12601					} else {
12602						customButtonsContainer.show();
12603					}
12604				};
12605
12606
12607			buttons.hide();
12608			customButtonsContainer.append(buttonsTemplate);
12609
12610			if (carouselElm.hasClass('aqua-theme')) {
12611				customButtonsContainer.addClass('aqua-theme');
12612			}
12613
12614			determineVisibility();
12615			$(window).on('resize', function () {
12616				clearTimeout(intervalID);
12617				intervalID = setTimeout(determineVisibility, 100);
12618			});
12619
12620			customButtonsContainer.find('.owl-prev').on('click', function () {
12621				carouselElm.trigger('owl.prev');
12622			});
12623
12624			customButtonsContainer.find('.owl-next').on('click', function () {
12625				carouselElm.trigger('owl.next');
12626			});
12627		},
12628
12629		hideEmptyLabels: function () {
12630			var containerEl = document.querySelector(el),
12631				labels = containerEl.querySelectorAll('.label'),
12632				i = 0,
12633				len = labels.length,
12634				label,
12635				labelTxt,
12636				labelNumber,
12637				isEmptyLabelTxt,
12638				isEmptyLabelNumber;
12639
12640			for (i; i < len; i += 1) {
12641				label = labels[i];
12642
12643				labelTxt = label.querySelector('.text') || '';
12644				labelNumber = label.querySelector('.number') || '';
12645				isEmptyLabelTxt = (labelTxt.innerHTML === '');
12646				isEmptyLabelNumber = (labelNumber.innerHTML === '');
12647
12648				if (isEmptyLabelTxt && isEmptyLabelNumber) {
12649					label.className += ' hidden';
12650					label.parentNode.querySelector('.overlay').className += ' hidden';
12651				}
12652			}
12653		},
12654
12655		syncPosition: function (el, elA, elB) {
12656			var sync1 = $(elA),
12657				sync2 = $(elB),
12658				sync2Item = sync2.find('.owl-item'),
12659				current;
12660
12661			function center(number) {
12662				var sync2visible = sync2.data('owlCarousel').owl.visibleItems,
12663					sync2VisibleLen = sync2visible.length,
12664					num = number,
12665					found = false,
12666					i;
12667
12668				for (i = 0; i < sync2VisibleLen; i += 1) {
12669					if (num === sync2visible[i]) {
12670						found = true;
12671					}
12672				}
12673
12674				if (found === false) {
12675					if (num > sync2visible[sync2visible.length - 1]) {
12676						sync2.trigger('owl.goTo', num - sync2visible.length + 2);
12677					} else {
12678						if ((num - 1) === -1) {
12679							num = 0;
12680						}
12681						sync2.trigger('owl.goTo', num);
12682					}
12683				} else if (num === sync2visible[sync2visible.length - 1]) {
12684					sync2.trigger('owl.goTo', sync2visible[1]);
12685				} else if (num === sync2visible[0]) {
12686					sync2.trigger('owl.goTo', num - 1);
12687				}
12688			}
12689
12690			current = el.currentItem;
12691
12692			sync2Item.removeClass('synced')
12693				.eq(current)
12694				.addClass('synced');
12695
12696			if (sync2.data('owlCarousel') !== undefined) {
12697				center(current);
12698			}
12699
12700			sync2.on('click', '.owl-item', function (e) {
12701				e.preventDefault();
12702				var number = $(this).data('owlItem');
12703				sync1.trigger('owl.goTo', number);
12704			});
12705		}
12706	};
12707}());
12708
12709
12710/**
12711 * @module fwBanner
12712 * Initializes full-width banners.
12713 */
12714PAWS.fwBanner = (function (doc) {
12715	'use strict';
12716
12717	/**
12718	 * Stretches out the background image of an element.
12719	 * The image is taken from the "data-bg" attribute.
12720	 * @deps backstretch plugin
12721	*/
12722	function backStretch(el) {
12723		var banners = doc.querySelectorAll(el),
12724			i = 0,
12725			len = banners.length,
12726			bgImg,
12727			banner;
12728
12729		if (banners.length > 0) {
12730			if (PAWS.helpers.isSupported('backgroundsize')) {
12731				for (i; i < len; i += 1) {
12732					banner = banners[i];
12733					bgImg = banner.getAttribute('data-bg');
12734
12735					banner.style.cssText += 'background-image: url(' + bgImg + ')';
12736					banner.className += ' bg-cover';
12737				}
12738			} else {
12739				for (i; i < len; i += 1) {
12740					banner = banners[i];
12741					bgImg = banner.getAttribute('data-bg');
12742					$(banner).backstretch(bgImg);
12743				}
12744			}
12745		}
12746	}
12747
12748	return {
12749		backStretch: backStretch
12750	};
12751}(document));
12752
12753
12754/**
12755 * @module pods
12756 * Initializes and handles pod elements.
12757 */
12758PAWS.pods = (function () {
12759	'use strict';
12760
12761	var instance = {};
12762
12763	/**
12764	 * Initializes pods and resets their heights.
12765	 * @param elements {NodeList}
12766	 */
12767	instance.init = function (elements) {
12768		instance.els = document.querySelectorAll(elements);
12769		instance.elsLen = instance.els.length;
12770
12771		var i = 0;
12772
12773		if (instance.elsLen > 0) {
12774			for (i; i < instance.elsLen; i += 1) {
12775				instance.els[i].style.height = 'auto';
12776			}
12777		}
12778
12779		return instance;
12780	};
12781
12782	/**
12783	 * Equalizes the pods heights.
12784	 */
12785	instance.equalHeights = function () {
12786		if (instance.elsLen > 1) {
12787			var pods = instance.els,
12788				podsLen = pods.length,
12789				arr = [],
12790				podHeight,
12791				podMaxHeight,
12792				i = 0,
12793				j = 0;
12794
12795			for (i; i < podsLen; i += 1) {
12796				podHeight = pods[i].offsetHeight;
12797				arr.push(podHeight);
12798			}
12799
12800			podMaxHeight = Math.max.apply(Math, arr);
12801			
12802			if (podMaxHeight > 0) {
12803				for (j; j < podsLen; j += 1) {
12804					pods[j].style.height = podMaxHeight + 'px';
12805				}
12806			}
12807		}
12808		return instance;
12809	};
12810
12811	/**
12812	 * Equalizes the pods heights when in inside header.
12813	 */
12814	instance.equalImgHeights = function () {
12815		if (instance.elsLen > 1) {
12816			var pods = instance.els,
12817				podsLen = pods.length,
12818				podMaxHeight,
12819				j = 0;
12820
12821			podMaxHeight =  $('.pod img').height();
12822
12823			for (j; j < podsLen; j += 1) {
12824				$(pods[j]).addClass('header-pod-margins');
12825				pods[j].style.height = podMaxHeight + 'px';
12826			}
12827		}
12828		return instance;
12829	};
12830
12831	/**
12832	 * Changes heights of pods to 'auto' on specific viewport sizes.
12833	 * @param {Number} vpw - Viewport width in pixels
12834	*/
12835	instance.automateHeights = function (vw) {
12836		if (PAWS.helpers.viewPortWidth() <= vw) {
12837			var pods = instance.els,
12838				podsLen = pods.length,
12839				i = 0;
12840
12841			for (i; i < podsLen; i += 1) {
12842				pods[i].style.height = 'auto';
12843			}
12844		}
12845		return instance;
12846	};
12847
12848	return {
12849		init: instance.init
12850	};
12851}());
12852
12853
12854/**
12855 * @module mediaArchive
12856 * Initializes Modals.
12857*/
12858PAWS.mediaArchive = (function (doc) {
12859	'use strict';
12860
12861	var instance = {};
12862
12863	instance.init = function (archiveSelector, modalSelector) {
12864		var archives = document.querySelectorAll(archiveSelector),
12865			modals = document.querySelectorAll(modalSelector),
12866			archivesLen,
12867			i = 0;
12868
12869		if (archives.length > 0 && modals.length > 0) {
12870			archivesLen = archives.length;
12871
12872			for (i; i < archivesLen; i += 1) {
12873				archives[i].setAttribute('data-target', '#mediaArchiveModal_' + i);
12874				modals[i].setAttribute('id', 'mediaArchiveModal_' + i);
12875			}
12876		}
12877
12878		return instance;
12879	};
12880
12881	instance.pausePlayersOnModalHidden = function () {
12882		var modals = $('.modal');
12883
12884		modals.on('hidden.bs.modal', function () {
12885			PAWS.helpers.pauseVideos();
12886		});
12887		return instance;
12888	};
12889
12890	return {
12891		init: instance.init
12892	};
12893}(document));
12894
12895
12896/**
12897 * @module googleSearch
12898 * Initializes Google Search.
12899*/
12900PAWS.googleSearch = (function () {
12901	'use strict';
12902
12903	/**
12904	 * Adds placeholder attribute to Google Search inout.
12905	 */
12906	function addPlaceholder() {
12907		var gsInputs = $('input.gsc-input');
12908
12909		gsInputs.attr('placeholder', 'Search...');
12910
12911        if($('.recently-adopted').length > 0) {
12912            $('.recently-adopted input.gsc-input').attr('placeholder', 'Search recent pets...')
12913        }
12914
12915		PAWS.forms.placeholder();
12916	}
12917
12918	return {
12919		init: function () {
12920			window.__gcse = {
12921				callback: addPlaceholder
12922			};
12923
12924			/* Put in comments the google custom search WE created */
12925			var cx = '015884992462997857117:7nelkfnbalq',
12926
12927			/*The following id is the google custom seach from PAWS*/
12928			//var cx = '008765681941548999195:0txz7loxt28',
12929				gcse = document.createElement('script'),
12930				s;
12931
12932			gcse.type = 'text/javascript';
12933			gcse.async = true;
12934			gcse.src = (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx;
12935			s = document.getElementsByTagName('script')[0];
12936			s.parentNode.insertBefore(gcse, s);
12937		}
12938	};
12939}());
12940
12941/**
12942 * @module accordionSections
12943 * Checks for sections inside accordion on panel-header click.
12944 */
12945PAWS.accordionSections = (function () {
12946	'use strict';
12947
12948	return {
12949		equalize: function () {
12950			if ($('.accordion').length > 0) {
12951				$('.panel a').click(function () {
12952					var thisPanel = $(this);
12953					setTimeout(function () {
12954						if (thisPanel.siblings('.in').length !== 0) {
12955							PAWS.pods.init('.accordion article').
12956								equalHeights().
12957								automateHeights(991);
12958						}
12959					}, 500);
12960				});
12961			}
12962		}
12963	};
12964}());
12965
12966
12967/**
12968 * @module rteTables
12969 * Handles table elements' (created by an RTE) style on desktop & mobile view.
12970 */
12971PAWS.rteTables = (function () {
12972	'use strict';
12973
12974	function createDynamicTables() {
12975		var mainContentTable = $('#main-content table'),
12976			newTable = [],
12977			j = 0,
12978			i = 0;
12979
12980		if (PAWS.helpers.viewPortWidth() < 992) {
12981			if (mainContentTable.length > 0 && $('.dynamic-table').length === 0) {
12982				mainContentTable.each(function () {
12983                    if($(this).hasClass('not-responsive-table') === false) {
12984                        if ($(this).hasClass('dynamic-table') === false && $('.new-tables' + j).length === 0) {
12985                        	if ($(this).hasClass('table-from-list')) {
12986                                $(this).wrap('<span class="new-table-wrapper new-tables' + j + ' table-from-list"></span>');
12987							} else {
12988                                $(this).wrap('<span class="new-table-wrapper new-tables' + j + '"></span>');
12989							}
12990                            $(this).hide();
12991                            j += 1;
12992                        }
12993                    } else {
12994                        // Apply Grey Background to tds of not responsive table only.
12995                        $(this).find('tr').each(function () {
12996                            $(this).children().each(function (index, el) {
12997                                if (index % 2 === 0) {
12998                                    $(this).addClass('grey-bg');
12999                                }
13000                            });
13001                        });
13002                    }
13003
13004				});
13005
13006				j = 0;
13007
13008				$('.new-table-wrapper').each(function () {
13009					var $this = $(this),
13010						$thisTr = $this.find('tr').first();
13011
13012					i = 0;
13013					newTable = [];
13014
13015					$thisTr.children().each(function () {
13016						// This runs as many times as the number of tds in one row.
13017						newTable[i] = '<table class="dynamic-table">';
13018
13019						$this.find('tr').each(function () {
13020							var trInLoop = $(this);
13021
13022							if (trInLoop.children('th').length > 0) {
13023								newTable[i] += '<thead>';
13024								newTable[i] += '<tr>';
13025								newTable[i] +=  '<th>' + trInLoop.children()[i].innerHTML + '</th>';
13026								newTable[i] += '</tr>';
13027								newTable[i] += '</thead>';
13028							} else {
13029								// We go inside every tr to create the new trs.
13030								if(trInLoop.children()[i].innerHTML !== '') {
13031                                    newTable[i] += '<tr>';
13032                                    newTable[i] += '<td>' + trInLoop.children()[i].innerHTML + '</td>';
13033                                    newTable[i] += '</tr>';
13034								}
13035							}
13036						});
13037
13038						newTable[i] += '</table>';
13039						i += 1;
13040					});
13041
13042					for (i = 0; i < newTable.length; i += 1) {
13043						$(this).append(newTable[i]);
13044					}
13045				});
13046
13047			} else if ($('.dynamic-table').length > 0) {
13048				PAWS.rteTables.styleOnResize();
13049			}
13050		} else {
13051			mainContentTable.each(function () {
13052                if($(this).hasClass('not-responsive-table') === false) {
13053                    PAWS.rteTables.styleOnResize();
13054                }
13055			});
13056		}
13057	}
13058
13059	return {
13060		createTableFromList: function () {
13061			var listCntr = $('.list-to-table'),
13062				listToTransform = listCntr.find('ul'),
13063				listElements = listToTransform.find('li'),
13064				listElementsLen = listElements.length,
13065				table,
13066				trow,
13067				rowsLen,
13068				tdLen,
13069				i=0,
13070				j=0;
13071
13072			if (listCntr.length > 0) {
13073				//First of all we have to decide the number of rows, which is li elements length / 4, as 4 will be the collumns of the table.
13074                rowsLen = Math.ceil(listElementsLen/4); //rounding up the result
13075				tdLen = rowsLen * 4;
13076                table = '<table class="table table-from-list"><tbody>';
13077                trow = '';
13078
13079                var flag = 0;
13080                for (i; i < rowsLen; i += 1) {
13081                    flag = 0;
13082                    trow += '<tr>';
13083                	for (j = 0; j < listElementsLen; j += 1) {
13084                		if ((j % rowsLen) === i) {
13085                            trow += '<td>' + listElements[j].innerHTML + '</td>';
13086                            flag +=1;
13087						}
13088                	}
13089
13090                    if (flag < 4 && listElementsLen > 9) {
13091                        // We have to add empty tds to fill in the last row
13092                        for (flag; flag < 4; flag += 1) {
13093                            trow += '<td></td>';
13094                        }
13095                    }
13096                    trow += '</tr>';
13097				}
13098                table += trow + '</tbody></table>';
13099
13100                listCntr.append($(table));
13101
13102			}
13103		},
13104		styleOnResize: function () {
13105			var mainContentTable = $('#main-content table');
13106			if (PAWS.helpers.viewPortWidth() >= 992) {
13107				mainContentTable.each(function () {
13108					// Apply Grey Background to tds.
13109					$(this).find('tr').each(function () {
13110						$(this).children().each(function (index, el) {
13111							if (index % 2 === 0) {
13112								$(this).addClass('grey-bg');
13113							}
13114						});
13115					});
13116
13117					// Show original Table and hide dynamically create tables.
13118					if ($(this).css('display') === 'none' && $(this).hasClass('dynamic-table') === false) {
13119						$(this).show();
13120					} else if ($(this).hasClass('dynamic-table')) {
13121						$(this).hide();
13122					}
13123				});
13124			} else {
13125
13126                 mainContentTable.each(function () {
13127                    if($(this).hasClass('not-responsive-table') === false) {
13128                        // All one collumn table are white.
13129                        $(this).find('td').removeClass('grey-bg');
13130                    }
13131                });
13132
13133				// Show dynamically createds tables and hide original tables.
13134				if (mainContentTable.length > 0 && $('#main-content').find('.dynamic-table').length === 0) {
13135					createDynamicTables();
13136				}
13137
13138				mainContentTable.each(function () {
13139                    if($(this).hasClass('not-responsive-table') === false) {
13140                        if ($(this).css('display') === 'none' && $(this).hasClass('dynamic-table') === true) {
13141                            $(this).show();
13142                        } else if ($(this).hasClass('dynamic-table') === false) {
13143                            $(this).hide();
13144                        }
13145                    }
13146				});
13147			}
13148		},
13149
13150		styleTables: function () {
13151			var mainContentTable = $('#main-content table');
13152			if (mainContentTable.length > 0) {
13153				createDynamicTables();
13154			}
13155		}
13156	};
13157}());
13158
13159
13160/**
13161 * @filters module
13162 * Handles filtering betwwen dogs and cats.
13163*/
13164PAWS.filters = (function () {
13165	'use strict';
13166
13167	function hideLazyLoadButton(button) {
13168		button.
13169			removeClass('visible').
13170			addClass('hidden');
13171	}
13172
13173	function showLazyLoadButton(button) {
13174		button.
13175			removeClass('hidden').
13176			addClass('visible');
13177	}
13178
13179	return {
13180		init: function (options) {
13181			var defaults = {
13182					panel: '.filters-panel-wrapper'
13183				},
13184				catsChangesCounter = 0,
13185				dogsChangesCounter = 0,
13186				petsChangesCounter = 0,
13187				selectedFilter,
13188				filterRadios,
13189				locationHash = location.hash,
13190				petsPlaceholder = $('#pets-placeholder'),
13191				errorMsg = petsPlaceholder.find('.error'),
13192				catsPlaceholder = petsPlaceholder.find('.cats'),
13193				dogsPlaceholder = petsPlaceholder.find('.dogs'),
13194				allpetsPlaceholder = petsPlaceholder.find('.allpets'),
13195				catsLoadMoreBtn = $('#cats-load-more-button'),
13196				dogsLoadMoreBtn = $('#dogs-load-more-button'),
13197				allpetsLoadMoreBtn = $('#allpets-load-more-button');
13198
13199			options = $.extend({}, defaults, options);
13200			
13201			// Proceed only if filters panel exists in DOM.
13202			if ($(options.panel).length > 0) {
13203                
13204				filterRadios = $(options.panel).find('input[type="radio"][name="type-filter"]');       // Find all the radio buttons inside filters panel.
13205                // Determine which filter to activate by default.
13206				// If a hashtag of values "dog" or "cat" is set on URL, use this to determine what to show.
13207				// Else if is stored on Web Storage, use this one.
13208				if (locationHash === '#dog' || location.hash === '#cat') {
13209					locationHash = locationHash.substr(locationHash.indexOf('#') + 1);
13210
13211					// Deactivate all options.
13212					filterRadios.prop('checked', false);
13213					filterRadios.next().removeClass('checked');
13214
13215					// Activate the option derived from localStorage.
13216					$('#' + locationHash + '-filter').prop('checked', true);
13217					$('#' + locationHash + '-filter-label').addClass('checked');
13218
13219					// Set selected filter from the URL hashtag.
13220					selectedFilter = locationHash;
13221
13222					// Check if Web Storage is supported and store the selected filter.
13223					if (PAWS.helpers.isStorageSupported()) {
13224						PAWS.helpers.storageSetItem('paws.filterSelected', selectedFilter);
13225					}
13226
13227					// Remove hashtag from URL
13228					if (history.pushState) {
13229						history.pushState('', document.title, window.location.pathname);
13230					} else {
13231						location.hash = '';
13232					}
13233                    PAWS.filterDisable.init();
13234				} else {
13235					// Remeber which filter was previously selected,
13236					// activate the appropriate cehcbox and
13237					// display the appropriate group of pets (cats vs dogs).
13238					if (PAWS.helpers.isStorageSupported()) {
13239					
13240						// Get the stored item from localStorage.
13241						selectedFilter = localStorage.getItem('paws.filterSelected');
13242
13243						if (selectedFilter !== null) {
13244							// If allpets is in storage and you are not on the Pets Available for Adoption page, then set cats
13245							if (selectedFilter == 'allpets' && $('#allpets-filter').length<=0) selectedFilter = 'cat';
13246							
13247							// Deactivate all options.
13248							filterRadios.prop('checked', false);
13249							filterRadios.next().removeClass('checked');
13250
13251							// Activate the option derived from localStorage.
13252							$('#' + selectedFilter + '-filter').prop('checked', true);
13253							$('#' + selectedFilter + '-filter-label').addClass('checked');
13254						}
13255						else {
13256							if ($('#allpets-filter').length>0) selectedFilter = 'allpets';
13257						}
13258					}
13259                    PAWS.filterDisable.init();
13260				}
13261
13262				// Decide what to show and hide.
13263				switch (selectedFilter) {
13264				case 'cat':
13265					catsPlaceholder.show();
13266					dogsPlaceholder.hide();
13267					allpetsPlaceholder.hide();
13268					showLazyLoadButton(catsLoadMoreBtn);
13269					hideLazyLoadButton(dogsLoadMoreBtn);
13270					hideLazyLoadButton(allpetsLoadMoreBtn);
13271					break;
13272				case 'dog':
13273					dogsPlaceholder.show();
13274					catsPlaceholder.hide();
13275					allpetsPlaceholder.hide();
13276					showLazyLoadButton(dogsLoadMoreBtn);
13277					hideLazyLoadButton(catsLoadMoreBtn);
13278					hideLazyLoadButton(allpetsLoadMoreBtn);
13279					break;
13280				case 'allpets':
13281					allpetsPlaceholder.show();
13282					catsPlaceholder.hide();
13283					dogsPlaceholder.hide();
13284					showLazyLoadButton(allpetsLoadMoreBtn);
13285					hideLazyLoadButton(catsLoadMoreBtn);
13286					hideLazyLoadButton(dogsLoadMoreBtn);
13287					break;
13288				}
13289				
13290				//When user comes back from the pet's single view it loads all cats that were shown before.
13291				if (location.hash == "#catsResults" || location.hash == "#dogsResults" || location.hash == "#allpetsResults"){
13292					if (PAWS.helpers.isStorageSupported()) {
13293						// Pets Available for Adoption
13294						if ($('#location-dropdown').length > 0) {
13295							// Get the stored item from localStorage.
13296							var resultsFilterCats = localStorage.getItem('paws.filterResultsCats');
13297							var resultsFilterDogs = localStorage.getItem('paws.filterResultsDogs');
13298							var resultsFilterAllpets = localStorage.getItem('paws.filterResultsAllpets');
13299							
13300							//Dogs
13301							if (resultsFilterDogs !== null) {
13302								dogsPlaceholder.append(resultsFilterDogs);
13303							}
13304							
13305							var filterJsonUrldogs = localStorage.getItem('paws.filterJsonUrldogs');
13306							if (filterJsonUrldogs === 'null') {
13307								dogsLoadMoreBtn.attr('data-url', null);
13308								dogsLoadMoreBtn.removeClass('visible').addClass('hidden');
13309							} else if (filterJsonUrldogs !== ''){
13310								dogsLoadMoreBtn.attr('data-url', filterJsonUrldogs);
13311							}
13312							
13313							//Cats
13314							if (resultsFilterCats !== null) {
13315								catsPlaceholder.append(resultsFilterCats);
13316							}	
13317							
13318							var filterJsonUrlcats = localStorage.getItem('paws.filterJsonUrlcats');
13319							if (filterJsonUrlcats === 'null') {
13320								catsLoadMoreBtn.attr('data-url', null);
13321								catsLoadMoreBtn.removeClass('visible').addClass('hidden');
13322							} else if (filterJsonUrlcats !== ''){
13323								catsLoadMoreBtn.attr('data-url', filterJsonUrlcats);
13324							}
13325							
13326							// All Pets
13327							if (resultsFilterAllpets !== null) {
13328								allpetsPlaceholder.append(resultsFilterAllpets);
13329							}	
13330							
13331							var filterJsonUrlallpets = localStorage.getItem('paws.filterJsonUrlallpets');
13332							if (filterJsonUrlallpets === 'null') {
13333								allpetsLoadMoreBtn.attr('data-url', null);
13334								allpetsLoadMoreBtn.removeClass('visible').addClass('hidden');
13335							} else if (filterJsonUrlallpets !== ''){
13336								allpetsLoadMoreBtn.attr('data-url', filterJsonUrlallpets);
13337							}
13338						}
13339						// Pets Available for Fostering
13340						else {
13341							// Get the stored item from localStorage.
13342							var resultsFilterCatsFoster = localStorage.getItem('paws.filterResultsCatsFoster');
13343							var resultsFilterDogsFoster = localStorage.getItem('paws.filterResultsDogsFoster');
13344							
13345							//Dogs
13346							if (resultsFilterDogsFoster !== null) {
13347								dogsPlaceholder.append(resultsFilterDogsFoster);
13348							}
13349							
13350							var filterJsonUrlFosterdogs = localStorage.getItem('paws.filterJsonUrlFosterdogs');
13351							if (filterJsonUrlFosterdogs === 'null') {
13352								dogsLoadMoreBtn.attr('data-url', null);
13353								dogsLoadMoreBtn.removeClass('visible').addClass('hidden');
13354							} else if (filterJsonUrlFosterdogs !== ''){
13355								dogsLoadMoreBtn.attr('data-url', filterJsonUrlFosterdogs);
13356							}
13357							
13358							//Cats
13359							if (resultsFilterCatsFoster !== null) {
13360								catsPlaceholder.append(resultsFilterCatsFoster);
13361							}	
13362							
13363							var filterJsonUrlFostercats = localStorage.getItem('paws.filterJsonUrlFostercats');
13364							if (filterJsonUrlFostercats === 'null') {
13365								catsLoadMoreBtn.attr('data-url', null);
13366								catsLoadMoreBtn.removeClass('visible').addClass('hidden');
13367							} else if (filterJsonUrlFostercats !== ''){
13368								catsLoadMoreBtn.attr('data-url', filterJsonUrlFostercats);
13369							}
13370						}
13371					}
13372				} else{
13373					// Pets Available for Adoption
13374					if ($('#location-dropdown').length > 0) {
13375						PAWS.helpers.storageSetItem('paws.filterResultsCats','');
13376						PAWS.helpers.storageSetItem('paws.filterJsonUrlcats','');
13377						PAWS.helpers.storageSetItem('paws.filterResultsDogs','');
13378						PAWS.helpers.storageSetItem('paws.filterJsonUrldogs','');
13379						PAWS.helpers.storageSetItem('paws.filterResultsAllpets','');
13380						PAWS.helpers.storageSetItem('paws.filterJsonUrlallpets','');
13381					}
13382					// Pets Available for Fostering
13383					else {
13384						PAWS.helpers.storageSetItem('paws.filterResultsCatsFoster','');
13385						PAWS.helpers.storageSetItem('paws.filterJsonUrlFostercats','');
13386						PAWS.helpers.storageSetItem('paws.filterResultsDogsFoster','');
13387						PAWS.helpers.storageSetItem('paws.filterJsonUrlFosterdogs','');
13388					}
13389				}
13390								
13391				
13392
13393				// Add event handler to radio buttons.
13394				filterRadios.on('change', function () {
13395					// Deactivate all radio buttons, activate the clicked one, hide error messages.
13396					filterRadios.next().removeClass('checked');
13397					$(this).next().addClass('checked');
13398					errorMsg.hide();
13399                    
13400                    PAWS.filterDisable.init();
13401 
13402					// Determine which elements to display and which to hide
13403					// according to user's selection.
13404					if ($(this).attr('id') === 'cat-filter') {
13405						// Check if Web Storage is supported and store the selected filter.
13406						if (PAWS.helpers.isStorageSupported()) {
13407							PAWS.helpers.storageSetItem('paws.filterSelected', 'cat');
13408						}
13409
13410						dogsPlaceholder.hide();
13411						allpetsPlaceholder.hide();
13412						catsPlaceholder.
13413							removeClass('afterAnim').
13414							addClass('beforeAnim').
13415							fadeIn().
13416							addClass('afterAnim');
13417
13418						hideLazyLoadButton(dogsLoadMoreBtn);
13419						hideLazyLoadButton(allpetsLoadMoreBtn);
13420
13421						if (typeof catsLoadMoreBtn.attr('data-url') !== 'undefined') {
13422							showLazyLoadButton(catsLoadMoreBtn);
13423						} else {
13424							hideLazyLoadButton(catsLoadMoreBtn);
13425						}
13426
13427						catsChangesCounter += 1;
13428						if (catsChangesCounter <= 1) {
13429							PAWS.pods.init('#pets-placeholder .cats .adopt-pet').
13430								equalHeights().
13431								automateHeights(767);
13432							PAWS.pods.init('#pets-placeholder .cats .pet-of-the-week').
13433								equalHeights().
13434								automateHeights(767);
13435						}
13436					} else if ($(this).attr('id') === 'dog-filter') {
13437						// Check if Web Storage is supported and store the selected filter.
13438						if (PAWS.helpers.isStorageSupported()) {
13439							PAWS.helpers.storageSetItem('paws.filterSelected', 'dog');
13440						}
13441
13442						catsPlaceholder.hide();
13443						allpetsPlaceholder.hide();
13444						dogsPlaceholder.
13445							removeClass('afterAnim').
13446							addClass('beforeAnim').
13447							fadeIn().
13448							addClass('afterAnim');
13449
13450						hideLazyLoadButton(catsLoadMoreBtn);
13451						hideLazyLoadButton(allpetsLoadMoreBtn);
13452
13453						if (typeof dogsLoadMoreBtn.attr('data-url') !== 'undefined') {
13454							showLazyLoadButton(dogsLoadMoreBtn);
13455						} else {
13456							hideLazyLoadButton(dogsLoadMoreBtn);
13457						}
13458
13459						dogsChangesCounter += 1;
13460						if (dogsChangesCounter <= 1) {
13461							PAWS.pods.init('#pets-placeholder .dogs .adopt-pet').
13462								equalHeights().
13463								automateHeights(767);
13464							PAWS.pods.init('#pets-placeholder .dogs .pet-of-the-week').
13465								equalHeights().
13466								automateHeights(767);
13467						}
13468					} else if ($(this).attr('id') === 'allpets-filter') {
13469						// Check if Web Storage is supported and store the selected filter.
13470						if (PAWS.helpers.isStorageSupported()) {
13471							PAWS.helpers.storageSetItem('paws.filterSelected', 'allpets');
13472						}
13473
13474						catsPlaceholder.hide();
13475						dogsPlaceholder.hide();
13476						allpetsPlaceholder.
13477							removeClass('afterAnim').
13478							addClass('beforeAnim').
13479							fadeIn().
13480							addClass('afterAnim');
13481
13482						hideLazyLoadButton(catsLoadMoreBtn);
13483						hideLazyLoadButton(dogsLoadMoreBtn);
13484
13485						if (typeof allpetsLoadMoreBtn.attr('data-url') !== 'undefined') {
13486							showLazyLoadButton(allpetsLoadMoreBtn);
13487						} else {
13488							hideLazyLoadButton(allpetsLoadMoreBtn);
13489						}
13490
13491						petsChangesCounter += 1;
13492						if (petsChangesCounter <= 1) {
13493							PAWS.pods.init('#pets-placeholder .allpets .adopt-pet').
13494								equalHeights().
13495								automateHeights(767);
13496							PAWS.pods.init('#pets-placeholder .allpets .pet-of-the-week').
13497								equalHeights().
13498								automateHeights(767);
13499						}
13500					}
13501				});
13502
13503				// data filters
13504				$('.data-filter').on('click', function (e) {
13505					e.preventDefault();
13506					if ($(this).attr('data-filter')) {
13507						window.location.href = $(this).attr('data-filter');
13508					}
13509				});
13510			}
13511		}
13512	};
13513}());
13514
13515/**
13516 * @filters module
13517 * Handles filtering between stories categories.
13518 */
13519PAWS.storiesFilters = (function () {
13520    'use strict';
13521
13522	function hideLazyLoadButton(button) {
13523        button.
13524        removeClass('visible').
13525        addClass('hidden');
13526    }
13527
13528    function showLazyLoadButton(button) {
13529        button.
13530        removeClass('hidden').
13531        addClass('visible');
13532    }
13533
13534    return {
13535        init: function (options) {
13536            var defaults = {
13537                    panel: '.filters-panel-wrapper'
13538                },
13539                adoptersChangesCounter = 0,
13540                volunteersChangesCounter = 0,
13541				fostersChangesCounter = 0,
13542				supportersChangesCounter = 0,
13543				membersChangesCounter = 0,
13544				otherChangesCounter = 0,
13545                allStoriesChangesCounter = 0,
13546                selectedFilter,
13547                filterRadios,
13548                storiesPlaceholder = $('#stories-placeholder'),
13549                errorMsg = storiesPlaceholder.find('.error'),
13550                allstoriesPlaceholder = storiesPlaceholder.find('.all_stories'),
13551                adoptersPlaceholder = storiesPlaceholder.find('.adopters'),
13552				volunteersPlaceholder = storiesPlaceholder.find('.volunteers'),
13553				fostersPlaceholder = storiesPlaceholder.find('.fosters'),
13554				supportersPlaceholder = storiesPlaceholder.find('.supporters'),
13555				membersPlaceholder = storiesPlaceholder.find('.members'),
13556				othersPlaceholder = storiesPlaceholder.find('.others'),
13557				allstoriesButton = $('.stories-categories').find('.load-more-button[data-type="all_stories"]'),
13558				adoptersButton = $('.stories-categories').find('.load-more-button[data-type="adopters"]'),
13559				volunteersButton = $('.stories-categories').find('.load-more-button[data-type="volunteers"]'),
13560				fostersButton = $('.stories-categories').find('.load-more-button[data-type="fosters"]'),
13561				supportersButton = $('.stories-categories').find('.load-more-button[data-type="supporters"]'),
13562				membersButton = $('.stories-categories').find('.load-more-button[data-type="members"]'),
13563				othersButton = $('.stories-categories').find('.load-more-button[data-type="others"]');
13564
13565
13566            options = $.extend({}, defaults, options);
13567
13568            // Proceed only if filters panel exists in DOM.
13569            if ($(options.panel).length > 0) {
13570                filterRadios = $(options.panel).find('input[type="radio"]');       // Find all the radio buttons inside filters panel.
13571                // Determine which filter to activate by default.
13572                    // Remember which filter was previously selected,
13573                    // activate the appropriate checkbox
13574                    if (PAWS.helpers.isStorageSupported()) {
13575                        // Get the stored item from localStorage.
13576                        selectedFilter = localStorage.getItem('paws.filterSelected');
13577
13578                        if (selectedFilter !== null) {
13579                            if (selectedFilter === 'all') {
13580                                selectedFilter = 'all';
13581							} else if(selectedFilter === 'adopter') {
13582                            	selectedFilter = 'adopter';
13583							} else if(selectedFilter === 'volunteer') {
13584                                selectedFilter = 'volunteer';
13585                            } else if(selectedFilter === 'foster') {
13586                                selectedFilter = 'foster';
13587                            } else if(selectedFilter === 'supporter') {
13588                                selectedFilter = 'supporter';
13589                            } else if(selectedFilter === 'member') {
13590                                selectedFilter = 'member';
13591                            } else if(selectedFilter === 'other') {
13592                                selectedFilter = 'other';
13593                            }
13594
13595                            // Deactivate all options.
13596                            filterRadios.prop('checked', false);
13597                            filterRadios.next().removeClass('checked');
13598
13599                            // Activate the option derived from localStorage.
13600                            $('#' + selectedFilter + '-filter').prop('checked', true);
13601                            $('#' + selectedFilter + '-filter-label').addClass('checked');
13602                        }
13603                        else {
13604                            if ($('#all-filter').length>0) selectedFilter = 'all';
13605                            $('#' + selectedFilter + '-filter').prop('checked', true);
13606                            $('#' + selectedFilter + '-filter-label').addClass('checked');
13607                        }
13608                    }
13609
13610                // Decide what to show and hide.
13611                switch (selectedFilter) {
13612					case 'all':
13613                        allstoriesPlaceholder.show();
13614                        storiesPlaceholder.find('article:not(.all_stories)').hide();
13615                        showLazyLoadButton(allstoriesButton);
13616                        hideLazyLoadButton($('.load-more-button:not([data-type="all_stories"])'));
13617                        break;
13618                    case 'adopter':
13619                        adoptersPlaceholder.show();
13620                        storiesPlaceholder.find('article:not(.adopters)').hide();
13621                        showLazyLoadButton(adoptersButton);
13622                        hideLazyLoadButton($('.load-more-button:not([data-type="adopters"])'));
13623                        break;
13624                    case 'volunteer':
13625                        volunteersPlaceholder.show();
13626                        storiesPlaceholder.find('article:not(.volunteers)').hide();
13627                        showLazyLoadButton(volunteersButton);
13628                        hideLazyLoadButton($('.load-more-button:not([data-type="volunteers"])'));
13629                        break;
13630                    case 'foster':
13631                        fostersPlaceholder.show();
13632                        storiesPlaceholder.find('article:not(.fosters)').hide();
13633                        showLazyLoadButton(fostersButton);
13634                        hideLazyLoadButton($('.load-more-button:not([data-type="fosters"])'));
13635                        break;
13636                    case 'supporter':
13637                        supportersPlaceholder.show();
13638                        storiesPlaceholder.find('article:not(.supporters)').hide();
13639                        showLazyLoadButton(supportersButton);
13640                        hideLazyLoadButton($('.load-more-button:not([data-type="supporters"])'));
13641                        break;
13642                    case 'member':
13643                        membersPlaceholder.show();
13644                        storiesPlaceholder.find('article:not(.members)').hide();
13645                        showLazyLoadButton(membersButton);
13646                        hideLazyLoadButton($('.load-more-button:not([data-type="members"])'));
13647                        break;
13648                    case 'other':
13649                        othersPlaceholder.show();
13650                        storiesPlaceholder.find('article:not(.others)').hide();
13651                        showLazyLoadButton(othersButton);
13652                        hideLazyLoadButton($('.load-more-button:not([data-type="others"])'));
13653                        break;
13654                }
13655
13656                // Make equal heights all pods on load
13657                PAWS.pods.init('#stories-placeholder .item > div').
13658                equalHeights().
13659                automateHeights(767);
13660
13661                // Add event handler to radio buttons.
13662                filterRadios.on('change', function () {
13663                    // Deactivate all radio buttons, activate the clicked one, hide error messages.
13664                    filterRadios.next().removeClass('checked');
13665                    $(this).next().addClass('checked');
13666                    errorMsg.hide();
13667
13668                    // Scroll to top of Stories on mobile
13669					if(PAWS.helpers.isMobile()) {
13670                        $('html, body').animate({scrollTop: storiesPlaceholder.offset().top}, 600);
13671					}
13672
13673                    // Determine which elements to display and which to hide
13674                    // according to user's selection.
13675                    if ($(this).attr('id') === 'all-filter') {
13676                        // Check if Web Storage is supported and store the selected filter.
13677                        if (PAWS.helpers.isStorageSupported()) {
13678                            PAWS.helpers.storageSetItem('paws.filterSelected', 'all');
13679                        }
13680
13681                        storiesPlaceholder.find('article:not(.all_stories)').hide();
13682                        allstoriesPlaceholder.
13683                        removeClass('afterAnim').
13684                        addClass('beforeAnim').
13685                        fadeIn().
13686                        addClass('afterAnim');
13687
13688                        hideLazyLoadButton($('.load-more-button:not([data-type="all_stories"])'));
13689
13690                        if (typeof allstoriesButton.attr('data-url') !== 'undefined') {
13691                            showLazyLoadButton(allstoriesButton);
13692                        } else {
13693                            hideLazyLoadButton(allstoriesButton);
13694                        }
13695
13696                        allStoriesChangesCounter += 1;
13697                        if (allStoriesChangesCounter <= 1) {
13698                            PAWS.pods.init('#stories-placeholder .all_stories .item > div').
13699                            equalHeights().
13700                            automateHeights(767);
13701                        }
13702                    } else if ($(this).attr('id') === 'adopter-filter') {
13703                        // Check if Web Storage is supported and store the selected filter.
13704                        if (PAWS.helpers.isStorageSupported()) {
13705                            PAWS.helpers.storageSetItem('paws.filterSelected', 'adopter');
13706                        }
13707
13708                        storiesPlaceholder.find('article:not(.adopters)').hide();
13709                        adoptersPlaceholder.
13710                        removeClass('afterAnim').
13711                        addClass('beforeAnim').
13712                        fadeIn().
13713                        addClass('afterAnim');
13714
13715                        hideLazyLoadButton($('.load-more-button:not([data-type="adopters"])'));
13716
13717                        if (typeof adoptersButton.attr('data-url') !== 'undefined') {
13718                            showLazyLoadButton(adoptersButton);
13719                        } else {
13720                            hideLazyLoadButton(adoptersButton);
13721                        }
13722
13723                        adoptersChangesCounter += 1;
13724                        if (adoptersChangesCounter <= 1) {
13725                            PAWS.pods.init('#stories-placeholder .adopters .item > div').
13726                            equalHeights().
13727                            automateHeights(767);
13728                        }
13729                    } else if ($(this).attr('id') === 'volunteer-filter') {
13730                        // Check if Web Storage is supported and store the selected filter.
13731                        if (PAWS.helpers.isStorageSupported()) {
13732                            PAWS.helpers.storageSetItem('paws.filterSelected', 'volunteer');
13733                        }
13734
13735                        storiesPlaceholder.find('article:not(.volunteers)').hide();
13736                        volunteersPlaceholder.
13737                        removeClass('afterAnim').
13738                        addClass('beforeAnim').
13739                        fadeIn().
13740                        addClass('afterAnim');
13741
13742                        hideLazyLoadButton($('.load-more-button:not([data-type="volunteers"])'));
13743
13744                        if (typeof volunteersButton.attr('data-url') !== 'undefined') {
13745                            showLazyLoadButton(volunteersButton);
13746                        } else {
13747                            hideLazyLoadButton(volunteersButton);
13748                        }
13749
13750                        volunteersChangesCounter += 1;
13751                        if (volunteersChangesCounter <= 1) {
13752                            PAWS.pods.init('#stories-placeholder .volunteers .item > div').
13753                            equalHeights().
13754                            automateHeights(767);
13755                        }
13756                    } else if ($(this).attr('id') === 'foster-filter') {
13757                        // Check if Web Storage is supported and store the selected filter.
13758                        if (PAWS.helpers.isStorageSupported()) {
13759                            PAWS.helpers.storageSetItem('paws.filterSelected', 'foster');
13760                        }
13761
13762                        storiesPlaceholder.find('article:not(.fosters)').hide();
13763                      	fostersPlaceholder.
13764                        removeClass('afterAnim').
13765                        addClass('beforeAnim').
13766                        fadeIn().
13767                        addClass('afterAnim');
13768
13769                        hideLazyLoadButton($('.load-more-button:not([data-type="fosters"])'));
13770
13771                        if (typeof fostersButton.attr('data-url') !== 'undefined') {
13772                            showLazyLoadButton(fostersButton);
13773                        } else {
13774                            hideLazyLoadButton(fostersButton);
13775                        }
13776
13777                        fostersChangesCounter += 1;
13778                        if (fostersChangesCounter <= 1) {
13779                            PAWS.pods.init('#stories-placeholder .fosters .item > div').
13780                            equalHeights().
13781                            automateHeights(767);
13782                        }
13783                    } else if ($(this).attr('id') === 'supporter-filter') {
13784                        // Check if Web Storage is supported and store the selected filter.
13785                        if (PAWS.helpers.isStorageSupported()) {
13786                            PAWS.helpers.storageSetItem('paws.filterSelected', 'supporter');
13787                        }
13788
13789                        storiesPlaceholder.find('article:not(.supporters)').hide();
13790                        supportersPlaceholder.
13791                        removeClass('afterAnim').
13792                        addClass('beforeAnim').
13793                        fadeIn().
13794                        addClass('afterAnim');
13795
13796                        hideLazyLoadButton($('.load-more-button:not([data-type="supporters"])'));
13797
13798                        if (typeof supportersButton.attr('data-url') !== 'undefined') {
13799                            showLazyLoadButton(supportersButton);
13800                        } else {
13801                            hideLazyLoadButton(supportersButton);
13802                        }
13803
13804                        supportersChangesCounter += 1;
13805                        if (supportersChangesCounter <= 1) {
13806                            PAWS.pods.init('#stories-placeholder .supp
13806orters .item > div').
13807                            equalHeights().
13808                            automateHeights(767);
13809                        }
13810                    } else if ($(this).attr('id') === 'member-filter') {
13811                        // Check if Web Storage is supported and store the selected filter.
13812                        if (PAWS.helpers.isStorageSupported()) {
13813                            PAWS.helpers.storageSetItem('paws.filterSelected', 'member');
13814                        }
13815
13816                        storiesPlaceholder.find('article:not(.members)').hide();
13817                        membersPlaceholder.
13818                        removeClass('afterAnim').
13819                        addClass('beforeAnim').
13820                        fadeIn().
13821                        addClass('afterAnim');
13822
13823                        hideLazyLoadButton($('.load-more-button:not([data-type="members"])'));
13824
13825                        if (typeof membersButton.attr('data-url') !== 'undefined') {
13826                            showLazyLoadButton(membersButton);
13827                        } else {
13828                            hideLazyLoadButton(membersButton);
13829                        }
13830
13831                        membersChangesCounter += 1;
13832                        if (membersChangesCounter <= 1) {
13833                            PAWS.pods.init('#stories-placeholder .members .item > div').
13834                            equalHeights().
13835                            automateHeights(767);
13836                        }
13837                    } else if ($(this).attr('id') === 'other-filter') {
13838                        // Check if Web Storage is supported and store the selected filter.
13839                        if (PAWS.helpers.isStorageSupported()) {
13840                            PAWS.helpers.storageSetItem('paws.filterSelected', 'other');
13841                        }
13842
13843                        storiesPlaceholder.find('article:not(.others)').hide();
13844                        othersPlaceholder.
13845                        removeClass('afterAnim').
13846                        addClass('beforeAnim').
13847                        fadeIn().
13848                        addClass('afterAnim');
13849
13850                        hideLazyLoadButton($('.load-more-button:not([data-type="others"])'));
13851
13852                        if (typeof othersButton.attr('data-url') !== 'undefined') {
13853                            showLazyLoadButton(othersButton);
13854                        } else {
13855                            hideLazyLoadButton(othersButton);
13856                        }
13857
13858                        otherChangesCounter += 1;
13859                        if (otherChangesCounter <= 1) {
13860                            PAWS.pods.init('#stories-placeholder .others .item > div').
13861                            equalHeights().
13862                            automateHeights(767);
13863                        }
13864                    }
13865                });
13866            }
13867        }
13868    };
13869}());
13870
13871
13872// Share your Story filtering fields
13873PAWS.storyFormfields = (function () {
13874    'use strict';
13875
13876    if($('.pet_fields').length > 0) {
13877        var $petFields = $('.pet_fields')[0].outerHTML;
13878    }
13879    return {
13880        hideFields: function () {
13881          var filterRadios = $('.share_story_filters .type-filter').find('input[type="radio"]'),
13882			  additional_fields_wrapper = $('.categories-wrapper'),
13883			  adopter_fields = additional_fields_wrapper.find('.adopter'),
13884			  volunteer_fields = additional_fields_wrapper.find('.volunteer'),
13885			  foster_fields = additional_fields_wrapper.find('.foster'),
13886			  supporter_fields = additional_fields_wrapper.find('.supporter'),
13887			  member_fields = additional_fields_wrapper.find('.members'),
13888              other_fields = additional_fields_wrapper.find('.other');
13889
13890          	$('.story-form').find('select:visible').chosen({disable_search_threshold: 10});
13891
13892          // No category Selected initially
13893            filterRadios.next().removeClass('checked');
13894            additional_fields_wrapper.hide();
13895
13896            // Add event handler to radio buttons.
13897            filterRadios.on('change', function () {
13898                // Deactivate all radio buttons, activate the clicked one, hide error messages.
13899                filterRadios.next().removeClass('checked');
13900                $(this).next().addClass('checked');
13901
13902                // Scroll to top of Stories on mobile
13903                if(PAWS.helpers.isMobile()) {
13904                    $('html, body').animate({scrollTop: $('.additional_fields').offset().top}, 600);
13905                }
13906
13907                // Determine which elements to display and which to hide
13908                // according to user's selection.
13909                if ($(this).attr('id') === 'adopter-filter') {
13910                    additional_fields_wrapper.show();
13911                    additional_fields_wrapper.children('div:not(.adopter)').hide();
13912                    adopter_fields.
13913                    removeClass('afterAnim').
13914                    addClass('beforeAnim').
13915                    fadeIn().
13916                    addClass('afterAnim');
13917
13918                } else if ($(this).attr('id') === 'volunteer-filter') {
13919                    additional_fields_wrapper.show();
13920                    additional_fields_wrapper.children('div:not(.volunteer)').hide();
13921                    volunteer_fields.
13922                    removeClass('afterAnim').
13923                    addClass('beforeAnim').
13924                    fadeIn().
13925                    addClass('afterAnim');
13926
13927                } else if ($(this).attr('id') === 'foster-filter') {
13928                    additional_fields_wrapper.show();
13929                    additional_fields_wrapper.children('div:not(.foster)').hide();
13930                    foster_fields.
13931                    removeClass('afterAnim').
13932                    addClass('beforeAnim').
13933                    fadeIn().
13934                    addClass('afterAnim');
13935
13936                } else if ($(this).attr('id') === 'supporter-filter') {
13937                    additional_fields_wrapper.show();
13938                    additional_fields_wrapper.children('div:not(.supporter)').hide();
13939                    supporter_fields.
13940                    removeClass('afterAnim').
13941                    addClass('beforeAnim').
13942                    fadeIn().
13943                    addClass('afterAnim');
13944
13945                } else if ($(this).attr('id') === 'member-filter') {
13946                    additional_fields_wrapper.show();
13947                    additional_fields_wrapper.children('div:not(.members)').hide();
13948                    member_fields.
13949                    removeClass('afterAnim').
13950                    addClass('beforeAnim').
13951                    fadeIn().
13952                    addClass('afterAnim');
13953
13954                } else if ($(this).attr('id') === 'other-filter') {
13955                    additional_fields_wrapper.show();
13956                    additional_fields_wrapper.children('div:not(.other)').hide();
13957                    other_fields.
13958                    removeClass('afterAnim').
13959                    addClass('beforeAnim').
13960                    fadeIn().
13961                    addClass('afterAnim');
13962
13963                }
13964            });
13965        },
13966        updateFields: function () {
13967			var petFieldsCont = $('.pet_fields'),
13968				petFieldsHtml = $petFields,
13969                petsSelect = $('#adopterspetsnumber');
13970                petFieldsCont.hide();
13971
13972				petsSelect.on('change', function () {
13973					var petsNum = parseInt($(this).val()),
13974						i = 0,
13975                        docFragment = '',
13976						petsNodes = $('.pet_fields .pet').length;
13977
13978                    petFieldsCont.show();
13979
13980                    if(petsNodes <= petsNum) {
13981                    	i = petsNodes;
13982					} else {
13983                        i = petsNodes;
13984                        $('.pet_fields .pet').slice(petsNum - petsNodes).remove();
13985					}
13986
13987					for(i;i<petsNum; i += 1) {
13988                        var number = '<span class="number">'+ (i+1) +'</span>';
13989                        petFieldsHtml = petFieldsHtml.replace('<span class="number">' + i +'</span>', number);
13990                        docFragment += petFieldsHtml;
13991					}
13992					if(petsNodes < petsNum) {
13993                        petFieldsCont.append($(docFragment));
13994                        petFieldsCont.find('select:visible').chosen({disable_search_threshold: 10});
13995					}
13996                });
13997
13998				$(document).on('change', '.disaster', function () {
13999					if($(this).val() == 'yes') {
14000						$(this).closest('.pet').find('#rescuemission').parent().show();
14001                        $(this).closest('.pet').find('#rescuestory').parent().show();
14002					} else {
14003                        $(this).closest('.pet').find('#rescuemission').parent().hide();
14004                        $(this).closest('.pet').find('#rescuestory').parent().hide();
14005					}
14006                });
14007
14008				$(document).on('change', '.injury', function () {
14009					if($(this).val() == 'yes') {
14010						$(this).closest('.pet').find('#injurystory').parent().show();
14011					} else {
14012                        $(this).closest('.pet').find('#injurystory').parent().hide();
14013					}
14014				});
14015
14016
14017        }
14018    };
14019}());
14020
14021PAWS.storiesLoader = (function () {
14022    'use strict';
14023
14024    function storyPodsSuccess(data, containerEl, callback) {
14025        var i = 0,
14026            storiesLen = data.stories.length,
14027            storyPod,
14028            template,
14029            storyFirstname,
14030            storyLastname,
14031            storyImage,
14032            storyIntro,
14033            storyURL,
14034            storyRelationtype,
14035            storyRelationtypeID,
14036        	docFragment = '';
14037
14038        // Lopp through the stories array fetched from the JSON object.
14039        for (i; i < storiesLen; i += 1) {
14040            storyPod = data.stories[i];
14041
14042            if(storyPod.storyImage) {
14043                storyImage = storyPod.storyImage;
14044			} else {
14045            	storyImage = 'fileadmin/media/stories/default_img.jpg';
14046			}
14047
14048            storyFirstname = storyPod.storyFirstname;
14049            storyLastname = storyPod.storyLastname;
14050            storyIntro = storyPod.storyIntro;
14051            storyRelationtype = storyPod.storyRelationtype;
14052            storyURL = storyPod.storyURL;
14053            storyRelationtypeID = storyPod.storyRelationtypeID;
14054
14055            // Generate the element's template and populate with the values we got from JSON object.
14056            template = '<div class="col-lg-3 col-sm-4">' +
14057                '<div class="item color' + storyRelationtypeID +'">' +
14058				'<div>' +
14059                '<a href="' + storyURL + '">' +
14060				'<div class="head">' +
14061                '<img src="' + storyImage + '" class="img-responsive" alt="' + storyLastname + '"/>' +
14062                '<span class="label">' + storyRelationtype + '</span>' +
14063				'</div>' +
14064                '<div class="body">' +
14065                '<h3>' + storyFirstname + ' ' + storyLastname + '</h3>' +
14066                '<p>' + storyIntro + '</p>' +
14067                '</div>' +
14068				'</a>' +
14069                '</div>' +
14070                '</div>'+
14071				'</div>';
14072
14073            docFragment += template;
14074        }
14075
14076        // Append to DOM the "docFragment" avoiding to manipulate
14077        $('.' + containerEl).append(docFragment);
14078
14079        // When all finished run the callback function.
14080        if (typeof callback !== 'undefined' && typeof callback === 'function') {
14081            callback();
14082        }
14083    }
14084
14085    var loadMoreBtn = $('.load-more-button'),
14086        jsonUrl;
14087
14088    // Add event handler on "Load More" button.
14089    loadMoreBtn.on('click', function (e) {
14090        e.preventDefault();
14091
14092        var that = $(this),
14093			type = that.attr('data-type');
14094
14095        // Get the data-attribute from the button.
14096        jsonUrl = that.attr('data-url');
14097
14098        // Make the request for the pets JSON object.
14099        $.ajax({
14100            url: jsonUrl,
14101            method: 'get'
14102        }).done(function (data) {
14103            // If request is successfull populate DOM with the new elements.
14104            storyPodsSuccess(data, type, function () {
14105                // When DOM manipulation is finished...
14106                // First make elements the same height.
14107                setTimeout(function () {
14108                    PAWS.pods.init('#stories-placeholder .item > div').
14109                    equalHeights().
14110                    automateHeights(767);
14111                },250);
14112
14113                // Set the data attribute value of the button.
14114                that.attr('data-url', data.jsonUrl);
14115
14116                // Hide the "Load More" button if the url we get from JSON object is set to null.
14117                if (data.jsonUrl === null) {
14118					that.removeClass('visible').addClass('hidden');
14119                }
14120            });
14121        }).error(function () {
14122            // If request fails for any reason display an error message.
14123            console.log('There was an unexpected error. Please try again.');
14124        });
14125    });
14126});
14127
14128
14129
14130/**
14131 * @module petsLoader
14132 * Do lazy loading for Alumni/Recently adopted pets.
14133 */
14134PAWS.petsLoader = (function () {
14135	'use strict';
14136
14137	var petsPlaceholderCont = $('#pets-placeholder'),                 // Container element. Holds newly created DOM elements and error message.
14138		errorPlaceholder = petsPlaceholderCont.find('.error'),        // Holds error message.
14139		preloader = petsPlaceholderCont.find('.preloader');           // Preloader element.
14140
14141	if ($('.filters-panel').length > 0) {}
14142	// Else if you are on a Pets Category list
14143	else if ($('.pets-category-list').length > 0) {
14144		// Find data-ID plugin on Page
14145		var petsCategoryListPlugin = $('.pets-category-list');
14146		$.each( petsCategoryListPlugin, function() {
14147		  var dataID = $(this).find('.lazyload-button').attr('data-ID');
14148		  
14149			// When user comes back from the pet's single view it loads all cats that were shown before.
14150			if (location.hash == "#petsResults"){
14151				if (PAWS.helpers.isStorageSupported()) {
14152					var catsPlaceholder = $(this).find('.cats'),
14153						catsLoadMoreBtn = $(this).find('.lazyload-button');
14154					// Get the stored item from localStorage.
14155					var resultsFilterCats = localStorage.getItem('paws.filterResultsPetsCategory_'+dataID);
14156					if (resultsFilterCats !== null) {
14157						catsPlaceholder.append(resultsFilterCats);
14158					}	
14159					
14160					var filterJsonUrlPetsCategory = localStorage.getItem('paws.filterJsonUrlPetsCategory_'+dataID);
14161					if (filterJsonUrlPetsCategory === 'null') {
14162						catsLoadMoreBtn.attr('data-url', null);
14163						catsLoadMoreBtn.removeClass('visible').addClass('hidden');
14164					} else if (filterJsonUrlPetsCategory !== ''){
14165						catsLoadMoreBtn.attr('data-url', filterJsonUrlPetsCategory);
14166					}
14167				}
14168			} else{
14169				PAWS.helpers.storageSetItem('paws.filterResultsPetsCategory_'+dataID,'');
14170				PAWS.helpers.storageSetItem('paws.filterJsonUrlPetsCategory_'+dataID,'');
14171			}
14172		});
14173	}
14174	// Iitialize Recently Adopted Pets when user comes back from the pet's single view it loads all pets that were shown before.
14175	else if ($('.pets-available-adoption').length > 0) {
14176		//When user comes back from the pet's single view it loads all cats that were shown before.
14177		if (location.hash == "#petsResults"){
14178			if (PAWS.helpers.isStorageSupported()) {
14179				var petsPlaceholder = $('#pets-placeholder'),
14180					catsPlaceholder = petsPlaceholder.find('.cats'),
14181					catsLoadMoreBtn = $('#cats-load-more-button');
14182				// Get the stored item from localStorage.
14183				var resultsFilterCats = localStorage.getItem('paws.filterResultsPets');
14184				
14185				if (resultsFilterCats !== null) {
14186					catsPlaceholder.append(resultsFilterCats);
14187				}	
14188				
14189				var filterJsonUrlPets = localStorage.getItem('paws.filterJsonUrlPets');
14190				if (filterJsonUrlPets === 'null') {
14191					catsLoadMoreBtn.attr('data-url', null);
14192					catsLoadMoreBtn.removeClass('visible').addClass('hidden');
14193				} else if (filterJsonUrlPets !== ''){
14194					catsLoadMoreBtn.attr('data-url', filterJsonUrlPets);
14195				}
14196			}
14197		} else{
14198			PAWS.helpers.storageSetItem('paws.filterResultsPets','');
14199			PAWS.helpers.storageSetItem('paws.filterJsonUrlPets','');
14200		}
14201	}
14202	// Else you are on the Alumni page
14203	else if ($('#pets-placeholder').length > 0) {
14204		//When user comes back from the pet's single view it loads all cats that were shown before.
14205		if (location.hash == "#petsResults"){
14206			if (PAWS.helpers.isStorageSupported()) {
14207				var petsPlaceholder = $('#pets-placeholder'),
14208					alumniPlaceholder = petsPlaceholder.find('article'),
14209					alumniLoadMoreBtn = $('#load-more-button');
14210				// Get the stored item from localStorage.
14211				var resultsFilterAlumni = localStorage.getItem('paws.filterResultsAlumni');
14212				
14213				if (resultsFilterAlumni !== null) {
14214					alumniPlaceholder.append(resultsFilterAlumni);
14215				}	
14216				
14217				var filterJsonUrlAlumni = localStorage.getItem('paws.filterJsonUrlAlumni');
14218				if (filterJsonUrlAlumni === 'null') {
14219					alumniLoadMoreBtn.attr('data-url', null);
14220					alumniLoadMoreBtn.removeClass('visible').addClass('hidden');
14221				} else if (filterJsonUrlAlumni !== ''){
14222					alumniLoadMoreBtn.attr('data-url', filterJsonUrlAlumni);
14223				}
14224			}
14225		} else{
14226			PAWS.helpers.storageSetItem('paws.filterResultsAlumni','');
14227			PAWS.helpers.storageSetItem('paws.filterJsonUrlAlumni','');
14228		}
14229	}
14230	
14231	
14232	/**
14233	 * Prepare for pets request and
14234	 * @param {Function} callback: Callback function that executes after "prepareRequest" is completed.
14235	 */
14236	function prepareRequest(callback) {
14237		// Display preloader.
14238		preloader.show();
14239
14240		// When all finished run the callback function.
14241		if (typeof callback !== 'undefined' && typeof callback === 'function') {
14242			callback();
14243		}
14244	}
14245
14246	/**
14247	 * Handles a successfull request for mixed pets (Alumni & Recently Adopted).
14248	 * Generates pets templates and appends to DOM.
14249	 * @param {Object} data: The data sent from the request.
14250	 * @param {Function} callback: Callback function that executes after "mixedPetsHandleSuccess" is completed.
14251	 */
14252	function mixedPetsHandleSuccess(data, callback) {
14253		var petsPlaceholder = petsPlaceholderCont.find('article'),
14254			i = 0,
14255			petsLen = data.pets.length,
14256			petItem,
14257			template,
14258			petImg,
14259			petName,
14260			petDescription,
14261			petUrl,
14262			timestamp,
14263			docFragment = '';
14264
14265		// Always hide the error message.
14266		errorPlaceholder.hide();
14267
14268		// Generate a new timestamp which will be used as
14269		// a "clsas" attribute on the new fetched DOM elements.
14270		// This way we know which are the new elements added on DOM.
14271		timestamp = new Date().getTime();
14272
14273		// Lopp through the pets array fetched from the JSON object.
14274		for (i; i < petsLen; i += 1) {
14275			petItem = data.pets[i];
14276
14277			petImg = petItem.image;                     // Pet's image path.
14278			petName = petItem.name;                     // Pet's name.
14279			petDescription = petItem.poddescription;    // Pet's description.
14280			petUrl = petItem.url;                       // Pet's profile URL.
14281
14282			// Generate the element's template and populate with the values we got from JSON object.
14283			template = '<div class="col-md-4 col-sm-6 col-sm-offset-0 circle-img-pod ' + timestamp + '">' +
14284					'<div class="white-bg">' +
14285						'<div class="img">' +
14286							'<a href="' + petUrl + '">' +
14287								'<img src="' + petImg + '" class="center-block" width="200" height="200" alt="' + petName + '"/>' +
14288							'</a>' +
14289						'</div>' +
14290						'<h4 class="text-center">' + petName + '</h4>' +
14291						'<p>' + petDescription + '</p>' +
14292						'<a href="' + petUrl + '">Read more</a>' +
14293					'</div>' +
14294				'</div>';
14295
14296			docFragment += template;
14297		}
14298		
14299		if (PAWS.helpers.isStorageSupported()) {
14300			PAWS.helpers.storageSetItem('paws.filterResultsAlumni', localStorage.getItem('paws.filterResultsAlumni')+docFragment);
14301		}
14302
14303		// Hide preloader.
14304		preloader.hide();
14305
14306		// Append to DOM the "docFragment" avoiding to manipulate
14307		// the DOM inside the "for" loop.
14308		petsPlaceholder.append(docFragment);
14309
14310		// Find all new added elements and display them
14311		// with a nice "fade and scale" effect.
14312		$('.' + timestamp).
14313			css({
14314				'transition': 'transform 0.35s ease',
14315				'-webkit-transition': '-webkit-transform 0.35s ease',
14316				'transform': 'scale(0)',
14317				'-webkit-transform': 'scale(0)'
14318			}).
14319			hide().
14320			fadeIn().
14321			css({
14322				'transform': 'scale(1.0)',
14323				'-webkit-transform': 'scale(1.0)'
14324			});
14325
14326		// When all finished run the callback function.
14327		if (typeof callback !== 'undefined' && typeof callback === 'function') {
14328			callback();
14329		}
14330	}
14331
14332	/**
14333	 * Handles a successfull request for filtered pets (Pets available for adoption).
14334	 * Generates pets templates and appends to DOM.
14335	 * @param {Object} data: The data sent from the request.
14336	 * @param {String} typeOfPet: The type of pet ("cats" or "dogs"). Necessary in order to know which placeholder the fetched elements will be appended on.
14337	 * @param {Function} callback: Callback function that executes after "filteredPetsHandlelSuccess" is completed.
14338	 */
14339	function filteredPetsHandlelSuccess(data, typeOfPet, callback, dataID) {
14340		var catsPlaceholder = petsPlaceholderCont.find('article.cats'),
14341			dogsPlaceholder = petsPlaceholderCont.find('article.dogs'),
14342			allpetsPlaceholder = petsPlaceholderCont.find('article.allpets'),
14343			i = 0,
14344			petsLen = data.pets.length,
14345			petItem,
14346			petImg,
14347			petName,
14348			petSupplementInfo,
14349			petUrl,
14350			template,
14351			timestamp,
14352			catsDocFragment = '',
14353			dogsDocFragment = '',
14354			allpetsDocFragment = '',
14355			petDate,
14356			petCategory,
14357			petBgcolor,
14358			petFontcolor,
14359			petShowtag,
14360			petBondedPetName,
14361			petBondedURL;
14362			
14363		// If you are on a Pets Category list
14364		if ($('.pets-category-list').length > 0) {
14365			var catsPlaceholder = $('#categoryPlugin_'+dataID).find('.cats');
14366		}
14367		
14368		// Always hide the error message.
14369		errorPlaceholder.hide();
14370
14371		// Generate a new timestamps which will be used as
14372		// a "clsas" attribute on the new fetched DOM elements.
14373		// This way we know which are the new elements added on DOM.
14374		timestamp = new Date().getTime();
14375
14376		// Lopp through the pets array fetched from the JSON object.
14377		for (i = 0; i < petsLen; i += 1) {
14378			petItem = data.pets[i];
14379
14380			petImg = petItem.image;                    // Pet's image path.
14381			petName = petItem.name;                    // Pet's name.
14382			petUrl = petItem.url;                      // Pet's profile URL.
14383			petDate = petItem.petDate;                 // Pet's Date
14384			petCategory = petItem.category;            // Pet's Category
14385			petBgcolor = petItem.bgcolor;              // Pet's Category Bgcolor
14386			petFontcolor = petItem.fontcolor;          // Pet's Category Fontcolor
14387			petShowtag = petItem.showtag;          	   // Pet's Category Showtag
14388			petBondedPetName = petItem.bondedPetName;  // Pet's Bonded Pet Name
14389			petBondedURL = petItem.bondedURL;          // Pet's Bonded Pet URL
14390
14391            // Pet's uspplement info (location or foster type).
14392			petSupplementInfo =
14393                ((petItem.location !== null) ? petItem.location : 'n/a') ||
14394                ((petItem.fostertype !== null) ? petItem.fostertype : 'n/a');
14395			
14396			// Generate the element's template and populate with the values we got from JSON object.
14397			template = '<div class="col-lg-3 col-sm-4 text-center">' +
14398						'<div class="adopt-pet ' + timestamp + '">' +
14399							'<a href="' + petUrl + '">' +
14400								'<div class="img">';
14401			if (petCategory != "")
14402				if (petShowtag)
14403					template += '<div class="copy-cntr" style="background-color: ' + petBgcolor + ';">' +
14404						'<h5 style="color: ' + petFontcolor + ';">' + petCategory + '</h5></div>';
14405
14406			template += '<img src="' + petImg + '" width="200" height="200" alt="' + petName + '"/>' +
14407								'</div>' +
14408								'<h3>' + petName + '</h3>';
14409
14410			if (petDate !== undefined) { 								
14411				template += '<h6><span></span>Adopted on</h6>'+
14412							'<p>' + petDate + '</p>';
14413			}
14414			else template += '<h6><span></span>' + petSupplementInfo + '</h6>';
14415			template += 	'</a>';
14416
14417            if (petBondedPetName !== undefined && petBondedURL !== undefined && petBondedPetName !== "" && petBondedURL != "") {
14418			    template += 	'(bonded with <a href="' + petBondedURL + '">' + petBondedPetName + '</a>)';
14419            }
14420
14421			template += 	'</div>' +
14422					'</div>';
14423
14424			switch (typeOfPet) {
14425			case 'cats':
14426				catsDocFragment += template;
14427				break;
14428			case 'dogs':
14429				dogsDocFragment += template;
14430				break;
14431			case 'allpets':
14432				allpetsDocFragment += template;
14433				break;
14434			}
14435		}
14436		
14437		if (PAWS.helpers.isStorageSupported()) {
14438			// If Pets Filters exits, then you are on the Pets Available for Adoption or for Fostering pages
14439			if ($('.filters-panel').length > 0) {
14440				switch (typeOfPet) {
14441				case 'cats':
14442					// Pets Available for Adoption
14443					if ($('#location-dropdown').length > 0)
14444						PAWS.helpers.storageSetItem('paws.filterResultsCats', localStorage.getItem('paws.filterResultsCats')+catsDocFragment);
14445					// Pets Available for Fostering
14446					else 
14447						PAWS.helpers.storageSetItem('paws.filterResultsCatsFoster', localStorage.getItem('paws.filterResultsCatsFoster')+catsDocFragment);
14448					break;
14449				case 'dogs':
14450					// Pets Available for Adoption
14451					if ($('#location-dropdown').length > 0)
14452						PAWS.helpers.storageSetItem('paws.filterResultsDogs', localStorage.getItem('paws.filterResultsDogs')+dogsDocFragment);
14453					// Pets Available for Fostering
14454					else
14455						PAWS.helpers.storageSetItem('paws.filterResultsDogsFoster', localStorage.getItem('paws.filterResultsDogsFoster')+dogsDocFragment);
14456					break;
14457				case 'allpets':
14458					// Pets Available for Adoption
14459					if ($('#location-dropdown').length > 0)
14460						PAWS.helpers.storageSetItem('paws.filterResultsAllpets', localStorage.getItem('paws.filterResultsAllpets')+allpetsDocFragment);
14461					break;
14462				}
14463			}
14464			// Else if you are on a Pets Category list
14465			else if ($('.pets-category-list').length > 0) {
14466				PAWS.helpers.storageSetItem('paws.filterResultsPetsCategory_'+dataID, localStorage.getItem('paws.filterResultsPetsCategory_'+dataID)+catsDocFragment);
14467			}
14468			// Else you are on the Recently Adopted Pets page
14469			else {
14470				PAWS.helpers.storageSetItem('paws.filterResultsPets', localStorage.getItem('paws.filterResultsPets')+catsDocFragment);
14471			}
14472		}
14473
14474
14475		// Hide preloader.
14476		preloader.hide();
14477
14478		// Append to DOM the "catsPlaceholder" and "dogsPlaceholder"
14479		// avoiding to manipulate the DOM inside the "for" loop.
14480		catsPlaceholder.append(catsDocFragment);
14481		dogsPlaceholder.append(dogsDocFragment);
14482		allpetsPlaceholder.append(allpetsDocFragment);
14483
14484		// Find all new added elements and display them
14485		// with a nice "fade and scale" effect.
14486		$('.' + timestamp).
14487			css({
14488				'transition': 'transform 0.35s ease',
14489				'-webkit-transition': '-webkit-transform 0.35s ease',
14490				'transform': 'scale(0)',
14491				'-webkit-transform': 'scale(0)'
14492			}).
14493			hide().
14494			fadeIn().
14495			css({
14496				'transform': 'scale(1.0)',
14497				'-webkit-transform': 'scale(1.0)'
14498			});
14499
14500		// When all finished run the callback function.
14501		if (typeof callback !== 'undefined' && typeof callback === 'function') {
14502			callback();
14503		}
14504	}
14505
14506	/**
14507	 * Generates error message.
14508	 * @param {String} errMsg
14509	 */
14510	function handleError(errMsg) {
14511		// Generate the error maessage tempalte.
14512		var alertTemplate = '<div class="col-md-12">' +
14513								'<div class="alert alert-danger alert-dismissible" role="alert">' +
14514									'<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>' +
14515									'<p class="text-center">' + errMsg + '</p>' +
14516								'</div>' +
14517							'</div>';
14518
14519		// Hide the preloader.
14520		preloader.hide();
14521
14522		// Display the error message with a nice "fade" effect.
14523		errorPlaceholder.html(alertTemplate).hide().fadeIn(400);
14524	}
14525
14526	return {
14527		mixedPetsLoad_init: function () {
14528			var loadMoreBtn = $('#load-more-button'),               // "Load More" button.
14529                jsonUrl;
14530
14531			// Add event handler on "Load More" button.
14532			loadMoreBtn.on('click', function (e) {
14533				e.preventDefault();
14534
14535				var that = $(this);
14536
14537				location.hash = '#petsResults';
14538				
14539				// Get the data-attribute from the button.
14540                jsonUrl = that.attr('data-url');             // data-url
14541
14542				// Make the request for the pets JSON object.
14543				prepareRequest(function () {
14544					$.ajax({
14545						url: jsonUrl,
14546						method: 'post'
14547					}).done(function (data) {
14548						// If request is successfull populate DOM with the new elements.
14549						mixedPetsHandleSuccess(data, function () {
14550							// When DOM manipulation is finished...
14551							// First make elements the same height.
14552							PAWS.pods.init('.circle-img-pod').
14553								equalHeights().
14554								automateHeights(767);
14555
14556							// Set the data attribute value of the button.
14557                            that.attr('data-url', data.jsonUrl);
14558							
14559							if (PAWS.helpers.isStorageSupported()) {
14560								PAWS.helpers.storageSetItem('paws.filterJsonUrlAlumni', data.jsonUrl);
14561							}
14562
14563							// Hide the "Load More" button if the url we get from JSON object is set to null.
14564							// This means that there are no more pets to display.
14565							if (data.jsonUrl === null) {
14566								that.hide();
14567							}
14568						});
14569					}).error(function () {
14570						// If request fails for any reason display an error message.
14571						handleError('There was an unexpected error. Please try again.');
14572					});
14573				});
14574			});
14575		},
14576
14577		filteredPetsLoad_init: function () {
14578            var loadMoreBtn = $('#cats-load-more-button, #dogs-load-more-button, #allpets-load-more-button'),    // "Load More" button.
14579                jsonUrl;                                                              // Request Url
14580
14581			loadMoreBtn.on('click', function (e) {
14582				e.preventDefault();
14583
14584				var that = $(this),
14585					typeOfPet;
14586				
14587				var dataID = '';
14588				// If you are on a Pets Category list
14589				if ($('.pets-category-list').length > 0) {
14590					dataID = that.attr('data-ID');
14591					preloader = $('#categoryPlugin_'+dataID).find('.preloader');
14592				}
14593
14594				if ($('.filters-panel').length > 0) {
14595					// Determine type of pet (dog or cat).
14596					if (that.attr('id') === 'cats-load-more-button') {
14597						typeOfPet = 'cats';
14598						location.hash = '#catsResults';
14599					} else if (that.attr('id') === 'dogs-load-more-button') {
14600						typeOfPet = 'dogs';
14601						location.hash = '#dogsResults';
14602					} else if (that.attr('id') === 'allpets-load-more-button') {
14603						typeOfPet = 'allpets';
14604						location.hash = '#allpetsResults';
14605					}
14606				}
14607				// Else you are on the Recently Adopted Pets page
14608				else {
14609					typeOfPet = 'cats';
14610					location.hash = '#petsResults';
14611				}
14612								
14613				
14614
14615				// Get the data-attribute from the button.
14616                jsonUrl = that.attr('data-url');            // data-url
14617				
14618				// Make the request for the pets JSON object.
14619				prepareRequest(function () {
14620					$.ajax({
14621						url: jsonUrl,
14622						method: 'post'
14623					}).done(function (data) {
14624						filteredPetsHandlelSuccess(data, typeOfPet, function () {
14625							var buttonID = that.attr('id'),
14626								str = buttonID.substr(0, buttonID.indexOf('-'));
14627
14628							// When DOM manipulation is finished...
14629							// First make elements the same height.
14630							PAWS.pods.init('#pets-placeholder .' + str + ' .adopt-pet').
14631								equalHeights().
14632								automateHeights(767);
14633
14634							// Set the data attribute value of the button.
14635                            that.attr('data-url', data.jsonUrl);          // data-url
14636							
14637							if (PAWS.helpers.isStorageSupported()) {
14638								// If Pets Filters exits, then you are on the Pets Available for Adoption or for Fostering pages
14639								if ($('.filters-panel').length > 0) {
14640									// Pets Available for Adoption
14641									if ($('#location-dropdown').length > 0)
14642										PAWS.helpers.storageSetItem('paws.filterJsonUrl'+typeOfPet, data.jsonUrl);
14643									// Pets Available for Fostering
14644									else 
14645										PAWS.helpers.storageSetItem('paws.filterJsonUrlFoster'+typeOfPet, data.jsonUrl);
14646								}
14647								// Else if you are on a Pets Category list
14648								else if ($('.pets-category-list').length > 0) {
14649									PAWS.helpers.storageSetItem('paws.filterJsonUrlPetsCategory_'+dataID, data.jsonUrl);
14650								}
14651								// Else you are on the Recently Adopted Pets page
14652								else {
14653									PAWS.helpers.storageSetItem('paws.filterJsonUrlPets', data.jsonUrl);
14654								}
14655							}
14656
14657							// Hide the "Load More" button if the url we get from JSON object is set to null.
14658							// This means that there are no more pets to display.
14659							if (data.jsonUrl === null) {
14660								that.removeClass('visible').addClass('hidden');
14661							}
14662						}, dataID);
14663					}).error(function () {
14664						// If request fails for any reason...
14665						// ...display an error message.
14666						handleError('There was an unexpected error. Please try again.');
14667					});
14668				});
14669			});
14670		}
14671	};
14672}());
14673
14674
14675/**
14676 * @module imgFloats
14677 * Checks for images floated left - right inside 'p' and adds clearfix class to the parent p
14678 */
14679PAWS.clearFloats = (function () {
14680	'use strict';
14681
14682	return {
14683		imgClearfix: function () {
14684			var rteParaImg = $('#main-content p img'),
14685				i = 0;
14686
14687			for (i; i < rteParaImg.length; i = i + 1) {
14688				if ($(rteParaImg[i]).hasClass('img-left') === true ||  $(rteParaImg[i]).hasClass('img-right') === true) {
14689					$(rteParaImg[i]).parent().addClass('clearfix');
14690				}
14691			}
14692		},
14693
14694		btnClearfix: function () {
14695			var pBtn = $('p.button'),
14696				lgpBtn = $('p.button-vert-lg'),
14697				i = 0;
14698
14699			for (i; i < pBtn.length; i += 1) {
14700				if (($(pBtn[i]).next().hasClass('button') === false) && ($(pBtn[i]).next().hasClass('button-vert-lg') === false)) {
14701					$(pBtn[i]).addClass('clearfix bottom-margin');
14702				}
14703			}
14704
14705			i = 0;
14706
14707			for (i; i < lgpBtn.length; i += 1) {
14708				if (($(lgpBtn[i]).next().hasClass('button') === false) && ($(lgpBtn[i]).next().hasClass('button-vert-lg') === false)) {
14709					$(lgpBtn[i]).addClass('clearfix bottom-margin');
14710				}
14711			}
14712		}
14713	};
14714}());
14715
14716
14717/**
14718 * @module calendar
14719 * 
14720 */
14721PAWS.calendar = (function () {
14722	'use strict';
14723
14724	var calendarFrame = $('#calendar-iframe'),    // Iframe that holds the calendar.
14725		loaded = false;                           // Flag used to denote that calendar's iframe is loaded.
14726
14727	/**	
14728	 * Sets the domain name of the page.
14729	 * This should run only when parent window and iframe
14730	 * are hosted on the same domain to comply with Same-origin policy.
14731	 * @param {String}
14731 domainName The domain name we wish to set.	
14732	 */
14733	function setDomain(domainName) {
14734		if (calendarFrame.length > 0) {
14735			try {
14736				document.domain = domainName;
14737			} catch (err) {
14738				console.error(err);
14739			}
14740		}
14741	}
14742	
14743	/**	
14744	 * Sets calendar's iframe dimensions.
14745	 * @returns {Boolean} Return false if variable loaded is false.	
14746	 */
14747	function setCalendarDimensions() {
14748		if (loaded === true) {
14749			calendarFrame.css({
14750				height: calendarFrame.contents().find('body').height()
14751			});
14752		}
14753		return false;
14754	}
14755
14756	return {
14757		init: function () {
14758			// Set domain name. !!!Necessary to work properly.
14759			setDomain('pawschicago.org');
14760
14761			calendarFrame.css({
14762				opacity: 0
14763			});
14764		},
14765
14766		loadFrame: function (callback) {
14767			calendarFrame.load(function () {
14768				// Set "loaded" flag to true.
14769				loaded = true;
14770
14771				// NOTE: This should run only when parent window and iframe
14772				// are hosted on the same domain to comply with Same-origin policy.
14773				try {
14774					// Display calendar iframe
14775					// Set calendar's iframe body styles.
14776					calendarFrame.
14777						css({
14778							opacity: 1
14779						}).
14780						contents().find('body').css({
14781							overflow: 'hidden'
14782						});
14783
14784					// After calendar is loaded run callback functions.
14785					if (typeof callback !== 'undefined' && typeof callback === 'function') {
14786						callback();
14787					}
14788				} catch (err) {
14789					console.error(err);
14790				}
14791			});
14792		},
14793
14794		setHeight: setCalendarDimensions
14795	};
14796}());
14797
14798
14799/**
14800 * @module youtubePlayer
14801 * Initialize youtube player for ipad users and provide functionality for playing and pausing a video
14802 */
14803PAWS.youtubePlayer = (function () {
14804    'use strict';
14805
14806    var instance = {},
14807        contentdivs,
14808        player;
14809
14810    return {
14811        /* Function to transform video tag to iframe */
14812        createIframe: function () {
14813            var $video = $('.video-js');
14814            var i = 1;
14815            $.each($video, function () {
14816                var thisIframe = $(this)[0].querySelector('iframe');
14817                thisIframe.id = "video" + i;
14818                thisIframe.src = thisIframe.src.replace('controls=0', 'controls=1');
14819                thisIframe.width = '100%';
14820                thisIframe.height = '400px';
14821                var videoContainer = $(this).parents('.video-content');
14822                $(videoContainer).removeClass('video-content');
14823                $(videoContainer).addClass('video-container');
14824                $(videoContainer).html('');
14825                $(videoContainer).append(thisIframe);
14826                i += 1;
14827            });
14828
14829            PAWS.youtubePlayer.onYouTubeIframeAPIReady();
14830
14831        },
14832
14833        /*** Youtube script to find all iframes inside slider #slider1 and instantiate a Youtube API player object for each iframe ***/
14834        /*** This code should proceed the initialization code for Featured Content Slider below, not following it ***/
14835        onYouTubeIframeAPIReady : function (){ // this function is called automatically when Youtube API is loaded (see: https://developers.google.com/youtube/iframe_api_reference)
14836            contentdivs = document.querySelectorAll('div.video-container'); //get all ".video-container" elements inside #slider1
14837            //alert(contentdivs.length);
14838            for (var i=0; i < contentdivs.length; i += 1){
14839                var tubeiframe = contentdivs[i].querySelector('iframe');
14840                //if iframe exists inside content div and it points to youtube
14841                if ( tubeiframe && (/youtube.com/i).test(tubeiframe.getAttribute('src')) ){
14842                    // instantiate a new Youtube API player on each Youtube iframe (its DOM object)
14843                    player = new YT.Player(tubeiframe, {
14844                        events: {
14845                            'onReady': function(e){e.target._donecheck = true} // indicate when video has done loading
14846                        }
14847                    });
14848                    contentdivs[i].youtubeplayer = player; // attach Youtube API player object to the corresponding content DIV
14849                }
14850            }
14851        },
14852        /* Function to trigger video play */
14853        playvideo : function (){
14854            if (player && player._donecheck === true){
14855                player.playVideo();
14856            }
14857        },
14858        /* Function to trigger video pause */
14859        pausevideo : function (){
14860            var i = 0;
14861            for (i = 0; i < contentdivs.length; i += 1){
14862                if (contentdivs[i].youtubeplayer && contentdivs[i].youtubeplayer._donecheck === true){
14863                    contentdivs[i].youtubeplayer.pauseVideo();
14864                }
14865            }
14866        }
14867    };
14868}());
14869
14870
14871/**
14872 * @module cookies
14873 * Functions used to set and read cookies throughout the website.
14874 */
14875PAWS.cookies = (function () {
14876	'use strict';
14877
14878	return {
14879		/* Set cookie function */
14880		setCookie: function (cname, cvalue, exdays) {
14881			var d = new Date();
14882
14883			d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
14884			var expires = "expires=" + d.toUTCString();
14885			document.cookie = cname + "=" + cvalue + "; " + expires;
14886		},
14887		/* Get cookie function */
14888		getCookie: function (cname) {
14889			var name = cname + "=";
14890			var ca = document.cookie.split(';');
14891			for (var i = 0; i < ca.length; i++) {
14892				var c = ca[i];
14893				while (c.charAt(0) == ' ') c = c.substring(1);
14894				if (c.indexOf(name) == 0) {
14895					return c.substring(name.length, c.length);
14896				}
14897			}
14898			return "";
14899		},
14900		/* Check cookie to see if the user has already agreed */
14901		hasAlreadyAgreed: function (cname) {
14902			if (PAWS.cookies.getCookie(cname)) {
14903				return true;
14904			}
14905			return false;
14906		}
14907};
14908}());
14909
14910/**
14911 * @module imageModal
14912 * Functionality to show modal with image on page load.
14913 */
14914PAWS.imageModal = (function () {
14915	'use strict';
14916
14917	/* Get the id of the lightbox modal on the current page. */
14918	function getLightboxId () {
14919		var curLightbox = $('.lightboxModal').attr('id');
14920		return curLightbox;
14921	}
14922
14923	/* Sets the width of lightbox modal. */
14924	function setBoxWidth (lightModal) {
14925        var lightImg = lightModal.find('img');
14926
14927	lightModal.find('.modal-dialog').css('max-width', lightImg.width());
14928        lightImg.on('load', function (){
14929            //if(lightImg.width() < 1000) {
14930                lightModal.find('.modal-dialog').css('max-width', lightImg.width());
14931            //}
14932		});
14933	}
14934
14935
14936	return {
14937		init: function (){
14938			var lightModal = $('.lightboxModal'),
14939				closeBtn = lightModal.find('.close'),
14940				curModalId = getLightboxId();
14941
14942			//Show lightbox modal if there is any on the page.
14943			if (lightModal.length > 0 && !PAWS.cookies.hasAlreadyAgreed(curModalId)) {
14944                setBoxWidth(lightModal);
14945                lightModal.modal('show');
14946				closeBtn.on('click', function (){
14947					PAWS.cookies.setCookie(curModalId, Date.now(), 1);
14948				});
14949			}
14950		}
14951	}
14952}());
14953/*jslint browser: true, devel: true, nomen: true*/
14954/*global PAWS, $*/
14955
14956/**
14957 * Initialize navigation.
14958 * @param nav {Object} -> "PAWS.navigation"
14959 */
14960(function (nav) {
14961	'use strict';
14962
14963	var topBtn = $('#top-btn, .csc-linkToTop a'),
14964		scrollDownBtn = $('.scroll-down'),
14965		anchorlinks = $('.csc-menu li a');
14966
14967	nav.init();
14968
14969	topBtn.on('click', function (e) {
14970		e.preventDefault();
14971		nav.scrollTo({
14972			top: 0,
14973			speed: 700
14974		});
14975	});
14976
14977	scrollDownBtn.on('click', function () {
14978		nav.scrollToElement({
14979			element: '.pod-carousel',
14980			speed: 500,
14981			topOffset: 15
14982		});
14983	});
14984
14985	anchorlinks.on('click', function () {
14986		var anchorDestination = $(this.hash);
14987		nav.scrollToElement({
14988			element: anchorDestination,
14989			speed: 500,
14990			opOffset: 15
14991		});
14992	});
14993
14994}(PAWS.navigation));
14995
14996
14997/**
14998 * Initialize Carousels.
14999 * @param initCarousel {Function} -> "PAWS.carousel.init"
15000 */
15001(function (initCarousel) {
15002	'use strict';
15003	
15004	var pawsTheme = 'paws-theme',
15005		pawsClass = 'paws-carousel',
15006		pawsRewindSpeed = 400,
15007		pawsPaginationSpeed = 500,
15008		pawsSlideSpeed = 500,
15009		autoplaySpeed = 0,
15010		splitAutoplaySpeed = 0,
15011		fullWidthAutoplaySpeed = 0,
15012		podsNum =0;
15013
15014
15015	if ($('#home-carousel').length > 0) {
15016		if ($('#home-carousel').attr('data-autoplay') !== undefined) {
15017			autoplaySpeed = $('#home-carousel').attr('data-autoplay') * 1000;
15018		}
15019	}
15020
15021	if ($('.split-carousel .paws-carousel').length > 0) {
15022		if ($('.split-carousel').attr('data-autoplay') !== undefined) {
15023			splitAutoplaySpeed = $('.split-carousel').attr('data-autoplay') * 1000;
15024		}
15025	}
15026
15027	if ($('.full-bg-carousel').length > 0) {
15028		if ($('.full-bg-carousel').attr('data-autoplay') !== undefined) {
15029			fullWidthAutoplaySpeed = $('.full-bg-carousel').attr('data-autoplay') * 1000;
15030		}
15031	}
15032
15033	if(autoplaySpeed == 0 || autoplaySpeed == null || autoplaySpeed == undefined) {
15034		autoplaySpeed = false;
15035	}
15036	if(splitAutoplaySpeed == 0 || splitAutoplaySpeed == null || splitAutoplaySpeed == undefined) {
15037		splitAutoplaySpeed = false;
15038	}
15039	if(fullWidthAutoplaySpeed == 0 || fullWidthAutoplaySpeed == null || fullWidthAutoplaySpeed == undefined) {
15040		fullWidthAutoplaySpeed = false;
15041	}
15042
15043	if($('.story-pods').length > 0) {
15044        podsNum = 3;
15045	} else {
15046        podsNum = 4;
15047	}
15048
15049	initCarousel('.full-bg-carousel', {
15050		theme: pawsTheme,
15051		baseClass: pawsClass,
15052		navigation: true,
15053		pagination: true,
15054		paginationSpeed: pawsPaginationSpeed,
15055		slideSpeed: pawsSlideSpeed,
15056		autoHeight: true,
15057		responsiveRefreshRate: 0,
15058		lazyLoad: true,
15059		items: 1,
15060		itemsDesktop: [1199, 1],
15061		itemsDesktopSmall: [979, 1],
15062		itemsTablet: [768, 1],
15063		itemsMobile: [479, 1],
15064		autoPlay: fullWidthAutoplaySpeed
15065	});
15066
15067	initCarousel('#home-carousel', {
15068		theme: pawsTheme,
15069		baseClass: pawsClass,
15070		navigation: true,
15071		pagination: true,
15072		paginationSpeed: pawsPaginationSpeed,
15073		slideSpeed: pawsSlideSpeed,
15074		lazyLoad: true,
15075		responsiveRefreshRate: 0,
15076		scrollPerPage : true,
15077		items: 3,
15078		itemsDesktop: [1199, 3],
15079		itemsDesktopSmall: [979, 3],
15080		itemsTablet: [768, 2],
15081		itemsMobile: [479, 1],
15082		autoPlay: autoplaySpeed
15083	});
15084
15085	initCarousel('.pod-carousel .paws-carousel', {
15086		theme: pawsTheme,
15087		baseClass: pawsClass,
15088		navigation: true,
15089		pagination: true,
15090		paginationSpeed: pawsPaginationSpeed,
15091		slideSpeed: pawsSlideSpeed,
15092		responsiveRefreshRate: 0,
15093		//autoHeight: true,
15094		scrollPerPage : true,
15095		items: podsNum,
15096		itemsDesktop: [1199, 3],
15097		itemsDesktopSmall: [979, 2],
15098		itemsTablet: [768, 2],
15099		itemsMobile: [479, 1],
15100		afterInit: function () {
15101			PAWS.carousel.makeCustomButtons();
15102		}
15103	});
15104
15105	initCarousel('.single-carousel .paws-carousel', {
15106		theme: pawsTheme,
15107		baseClass: pawsClass,
15108		navigation: true,
15109		pagination: true,
15110		paginationSpeed: pawsPaginationSpeed,
15111		slideSpeed: pawsSlideSpeed,
15112		autoHeight: true,
15113		responsiveRefreshRate: 0,
15114		lazyLoad: true,
15115		items: 1,
15116		itemsDesktop: [1199, 1],
15117		itemsDesktopSmall: [979, 1],
15118		itemsTablet: [768, 1],
15119		itemsMobile: [479, 1],
15120		afterInit: function (el) {
15121			if (el.hasClass('tiles')) {
15122				el.find('.owl-controls .owl-pagination').hide();
15123			}
15124		},
15125		afterAction: function (el) {
15126			if (el.hasClass('tiles')) {
15127				PAWS.carousel.syncPosition(this, '.single-carousel .paws-carousel', '.single-carousel-list');
15128			}
15129		},
15130        startDragging: function (el) {
15131            if ((el.find('.video-content')) || (el.find('.video-container'))) {
15132                PAWS.helpers.pauseVideos();
15133            }
15134        },
15135        afterMove: function (el) {
15136            if ((el.find('.video-content')) || (el.find('.video-container'))) {
15137                PAWS.helpers.pauseVideos();
15138            }
15139        }
15140	});
15141	
15142	initCarousel('.single-carousel-list', {
15143		theme: pawsTheme,
15144		baseClass: pawsClass,
15145		navigation: true,
15146		pagination: false,
15147		slideSpeed: pawsSlideSpeed,
15148		responsiveRefreshRate: 0,
15149		items: 5,
15150		itemsDesktop: [1600, 4],
15151		itemsDesktopSmall: [979, 3],
15152		afterInit: function (el) {
15153			el.find('.owl-item').eq(0).addClass('synced');
15154		}
15155	});
15156
15157	initCarousel('.thumb-carousel', {
15158		theme: pawsTheme,
15159		baseClass: pawsClass,
15160		navigation: true,
15161		pagination: false,
15162		slideSpeed: pawsSlideSpeed,
15163		rewindSpeed: pawsRewindSpeed,
15164		responsiveRefreshRate: 0,
15165		lazyLoad: true,
15166		autoHeight: true,
15167		items: 1,
15168		itemsDesktop: [1199, 1],
15169		itemsDesktopSmall: [979, 1],
15170		itemsTablet: [768, 1],
15171		itemsMobile: [479, 1],
15172		afterAction: function () {
15173			PAWS.carousel.syncPosition(this, '.thumb-carousel', '.thumb-carousel-list');
15174		}
15175	});
15176
15177	initCarousel('.thumb-carousel-list', {
15178		theme: pawsTheme,
15179		baseClass: pawsClass,
15180		navigation: true,
15181		pagination: false,
15182		slideSpeed: pawsSlideSpeed,
15183		responsiveRefreshRate: 0,
15184		lazyLoad: true,
15185		items: 6,
15186		itemsDesktop: [1199, 6],
15187		itemsDesktopSmall: [979, 4],
15188		itemsTablet: [768, 4],
15189		itemsMobile: [479, 3],
15190		afterInit: function (el) {
15191			el.find('.owl-item').eq(0).addClass('synced');
15192		}
15193	});
15194	
15195	initCarousel('.just-text-carousel', {
15196		theme: 'paws-theme',
15197		baseClass: 'paws-carousel',
15198        autoPlay: 10000,
15199        navigation: false,
15200        pagination: true,
15201		autoHeight: true,
15202		responsiveRefreshRate: 0,
15203		items: 1,
15204		itemsDesktop: [1199, 1],
15205		itemsDesktopSmall: [979, 1],
15206		itemsTablet: [768, 1],
15207		itemsMobile: [479, 1],
15208        afterInit: function (el) {
15209            var owl;
15210			
15211			el.one('click', '.owl-pagination', function () {
15212				owl = el.data('owl-carousel');
15213				
15214				if (owl.apStatus !== 'stop') {
15215					owl.stop();
15216				}
15217			});
15218        },
15219		startDragging: function (el) {
15220			var owl = el.data('owl-carousel');
15221			
15222			if (owl.apStatus !== 'stop') {
15223				owl.stop();
15224			}
15225		}
15226    });
15227
15228	initCarousel('.split-carousel .paws-carousel', {
15229		theme: pawsTheme,
15230		baseClass: pawsClass,
15231		navigation: true,
15232		pagination: true,
15233		paginationSpeed: pawsPaginationSpeed,
15234		slideSpeed: pawsSlideSpeed,
15235		autoHeight: true,
15236		responsiveRefreshRate: 0,
15237		lazyLoad: true,
15238		items: 1,
15239		itemsDesktop: [1199, 1],
15240		itemsDesktopSmall: [979, 1],
15241		itemsTablet: [768, 1],
15242		itemsMobile: [479, 1],
15243		autoPlay: splitAutoplaySpeed
15244	});
15245
15246    initCarousel('.pet-single-carousel', {
15247        theme: pawsTheme,
15248        baseClass: pawsClass,
15249        navigation: true,
15250        pagination: true,
15251        autoHeight: true,
15252		slideSpeed: pawsSlideSpeed,
15253		rewindSpeed: pawsRewindSpeed,
15254		lazyLoad: true,
15255        responsiveRefreshRate: 0,
15256        items: 1,
15257        itemsDesktop: [1199, 1],
15258        itemsDesktopSmall: [979, 1],
15259        itemsTablet: [768, 1],
15260        itemsMobile: [479, 1],
15261		afterMove: function (el) {
15262            if ((el.find('.video-content')) || (el.find('.video-container'))) {
15263                PAWS.helpers.pauseVideos();
15264            }
15265		}
15266    });
15267}(PAWS.carousel.init));
15268
15269
15270/**
15271 * Initialize rest of modules.
15272 * @param paws {Object} -> "PAWS"
15273 */
15274(function (paws) {
15275	'use strict';
15276
15277	// Initialize calendar.
15278	paws.calendar.init();
15279	paws.calendar.loadFrame(function () {
15280		paws.calendar.setHeight();
15281	});
15282
15283	// Initialize dropdown widgets for ... 
15284	// - Locations filtering
15285	// - Volunteers filtering
15286	
15287    paws.dropdownWidget.init({
15288		element: '#header-dropdown',
15289		collapsed: true,
15290		defaultValue: 'All'
15291	});
15292    
15293	
15294	// Initialize Filters.
15295	if(!($('.share_story_filters').length > 0)) {
15296        paws.filters.init({
15297            panel: '.filters-panel'
15298        });
15299	}
15300
15301	if($('.stories-categories').length > 0 ) {
15302        paws.storiesFilters.init({
15303            panel: '.filters-panel'
15304        });
15305    }
15306	
15307	// Initialize full width backgrounds.
15308	paws.fwBanner.backStretch('.full-bg');
15309
15310	// Initialize Accordions
15311	paws.accordion.init('.accordion', {
15312		openPanels: [],
15313		allowManyOpen: false
15314	});
15315
15316	// Initialize Google Search
15317	paws.googleSearch.init();
15318
15319	// Initialize Media Archive
15320	paws.mediaArchive.init('.media-pod a', '.modal').
15321		pausePlayersOnModalHidden();
15322
15323	if($('.story-form').length > 0) {
15324        PAWS.storyFormfields.hideFields();
15325        PAWS.storyFormfields.updateFields();
15326	}
15327	if($('#stories-placeholder').length > 0 ) {
15328        PAWS.storiesLoader();
15329	}
15330}(PAWS));
15331
15332
15333/**
15334 * Initialize lazy loading functionality.
15335 * @param lazyLoader {Object} -> "PAWS.petsLoader"
15336 */
15337(function (lazyLoader) {
15338	'use strict';
15339	
15340	var mixedPetsLoadButtonExists = $('#load-more-button').length > 0,
15341		filteredPetsLoadButtonExists = $('#cats-load-more-button, #dogs-load-more-button, #allpets-load-more-button').length > 0;
15342	
15343	if (mixedPetsLoadButtonExists) {
15344		lazyLoader.mixedPetsLoad_init();
15345	}
15346	
15347	if (filteredPetsLoadButtonExists) {
15348		lazyLoader.filteredPetsLoad_init();
15349	}
15350}(PAWS.petsLoader));
15351
15352
15353/**
15354 * Window object event handlers.
15355 * @param $win {Object} -> "$(window)"
15356 * @param paws {Object} -> "PAWS"
15357 */
15358(function ($win, paws) {
15359	'use strict';
15360
15361    $win.
15362        on('load', function () {
15363			var self = $(this);
15364			
15365	// Initialize image Modal.
15366	paws.imageModal.init();
15367	
15368			//Initialize youtube player for ipad
15369            if (PAWS.helpers.isIpad() === true) {
15370                PAWS.youtubePlayer.createIframe();
15371//                PAWS.youtubePlayer.onYouTubeIframeAPIReady();
15372            } else if ($('html').hasClass('ie8') === true) {
15373                //If IE8 we check for fullscreenchange event and we change the z-index of the container respectively
15374                if($('.video-js').length > 0) {
15375                    $('.video-js').each(function () {
15376                        videojs(this).on('fullscreenchange', function () {
15377                            if($('.vjs-fullscreen').length !== 0) {
15378                                $('.vjs-fullscreen').parents('.container').css('z-index', '11');
15379                                $('.vjs-fullscreen').parents('.container-fluid').css('z-index', '11');
15380                            } else {
15381                                $('.video-js').parents('.container').css('z-index', '0');
15382                                $('.video-js').parents('.container-fluid').css('z-index', '0');
15383                            }
15384                        });
15385                    });
15386                }
15387            }
15388
15389            // Initializes cover-pods and equalizes their heights.
15390			if ($('.cover-pod.with-icons').length > 0) {
15391
15392				paws.pods.init('.two-per-row.with-icons .white-bg').
15393					equalHeights().
15394					automateHeights(767);
15395
15396				paws.pods.init('.three-per-row.with-icons .white-bg').
15397					equalHeights().
15398					automateHeights(767);
15399
15400				paws.pods.init('.four-per-row.with-icons .white-bg').
15401					equalHeights().
15402					automateHeights(767);
15403			}
15404
15405			paws.pods.init('.cover-pod').
15406				equalHeights().
15407				automateHeights(767);
15408
15409            paws.pods.init('.main-header .pod').
15410				equalHeights().
15411				automateHeights(767);
15412
15413			paws.pods.init('.two-per-row').
15414				equalHeights().
15415				automateHeights(767);
15416
15417			paws.pods.init('.three-per-row').
15418				equalHeights().
15419				automateHeights(767);
15420
15421			paws.pods.init('.four-per-row').
15422				equalHeights().
15423				automateHeights(767);
15424
15425            paws.pods.init('.circle-img-pod').
15426                equalHeights().
15427                automateHeights(767);
15428
15429            paws.pods.init('.events-logos-cntr').
15430                equalHeights().
15431                automateHeights(767);
15432
15433            paws.pods.init('.adopt-pets-container .adopt-pet').
15434                equalHeights().
15435                automateHeights(767);
15436
15437            paws.pods.init('#pets-placeholder .dogs .adopt-pet').
15438                equalHeights().
15439                automateHeights(767);
15440
15441            paws.pods.init('#pets-placeholder .cats .adopt-pet').
15442                equalHeights().
15443                automateHeights(767);
15444				
15445			paws.pods.init('#pets-placeholder .allpets .adopt-pet').
15446                equalHeights().
15447                automateHeights(767);
15448
15449            paws.pods.init('#pets-placeholder .dogs .pet-of-the-week').
15450                equalHeights().
15451                automateHeights(767);
15452
15453            paws.pods.init('#pets-placeholder .cats .pet-of-the-week').
15454                equalHeights().
15455                automateHeights(767);
15456				
15457			paws.pods.init('#pets-placeholder .allpets .pet-of-the-week').
15458                equalHeights().
15459                automateHeights(767);
15460
15461            paws.pods.init('.foster-pod').
15462                equalHeights().
15463                automateHeights(767);
15464
15465            paws.pods.init('.paws-in-media.two-col-list .pod .text').
15466                equalHeights().
15467                automateHeights(767);
15468
15469            if (paws.helpers.viewPortWidth() >= 992) {
15470                paws.pods.init('.media-kit-cols').
15471                    equalHeights();
15472            }
15473
15474            if (paws.helpers.viewPortWidth() >= 480) {
15475                paws.pods.init('.pod-carousel .item > div').
15476                    equalHeights();
15477            }
15478
15479            if (paws.helpers.viewPortWidth() >= 992) {
15480                paws.accordionSections.equalize();
15481
15482                /* Check for sidebar image to inside page header */
15483                if (($('.inside-page-header .sidebar-adopt-pod').length === 0 && $('.inside-page-header .sidebar-general-pod').length === 0) &&
15484                    $('.inside-page-header .pod p a img').length > 0) {
15485                    paws.pods.init('.inside-page-header .pod').
15486                        equalImgHeights();
15487                } else {
15488                    paws.pods.init('.inside-page-header .pod').
15489                        equalHeights();
15490                }
15491            }
15492
15493            if (paws.helpers.viewPortWidth() >= 768) {
15494                paws.pods.init('.donate-pod').
15495                    equalHeights();
15496            }
15497            
15498            
15499            paws.rteTables.createTableFromList();
15500            paws.rteTables.styleTables();
15501            paws.clearFloats.imgClearfix();
15502            paws.clearFloats.btnClearfix();
15503
15504
15505			if($('#forms-iframe').length > 0) {
15506                $('#forms-iframe').iFrameResize();
15507			}
15508
15509			//Sticky Main Menu
15510			paws.navigation.makeStickyMenu(self);
15511
15512        }).
15513        on('scroll', function () {
15514            var self = $(this),
15515				windowWidth = $win.width();
15516
15517            if (self.scrollTop() > 1000) {
15518                paws.navigation.showTopButton();
15519            }
15520            if (self.scrollTop() < 500) {
15521                paws.navigation.hideTopButton();
15522            }
15523
15524			//Sticky Main Menu
15525			paws.navigation.makeStickyMenu(self);
15526
15527        }).
15528        on('resize', function () {
15529            var self = $(this),
15530				windowHeight = $win.height(),
15531                windowWidth = $win.width();
15532
15533            // Important: 'If' statement prevents IE8 bug that fires the 'resize' event
15534            // in an endless loop beacuse of the continuous page repaint.
15535            if (currentWindowHeight === undefined || currentWindowHeight !== windowHeight ||
15536                currentWindowWidth === undefined || currentWindowWidth !== windowWidth) {
15537                paws.navigation.handleResponsiveMode();
15538
15539                clearTimeout(resizeInterval);
15540
15541                resizeInterval = setTimeout(function () {
15542                    if ($('.cover-pod.with-icons').length > 0) {
15543
15544						paws.pods.init('.two-per-row.with-icons .white-bg').
15545							equalHeights().
15546							automateHeights(767);
15547
15548						paws.pods.init('.three-per-row.with-icons .white-bg').
15549							equalHeights().
15550							automateHeights(767);
15551
15552						paws.pods.init('.four-per-row.with-icons .white-bg').
15553							equalHeights().
15554							automateHeights(767);
15555					}
15556					paws.pods.init('.cover-pod').
15557						equalHeights().
15558						automateHeights(767);
15559
15560                    paws.pods.init('.main-header .pod').
15561						equalHeights().
15562						automateHeights(767);
15563
15564					paws.pods.init('.two-per-row').
15565						equalHeights().
15566						automateHeights(767);
15567
15568					paws.pods.init('.three-per-row').
15569						equalHeights().
15570						automateHeights(767);
15571
15572					paws.pods.init('.four-per-row').
15573						equalHeights().
15574						automateHeights(767);
15575
15576                    paws.pods.init('.donate-pod').
15577                        equalHeights().
15578                        automateHeights(767);
15579
15580                    paws.pods.init('.circle-img-pod').
15581                        equalHeights().
15582                        automateHeights(767);
15583
15584                    paws.pods.init('.events-logos-cntr').
15585                        equalHeights().
15586                        automateHeights(767);
15587
15588                    paws.pods.init('.adopt-pets-container .adopt-pet').
15589                        equalHeights().
15590                        automateHeights(767);
15591
15592                    paws.pods.init('#pets-placeholder .dogs .adopt-pet').
15593                        equalHeights().
15594                        automateHeights(767);
15595
15596                    paws.pods.init('#pets-placeholder .cats .adopt-pet').
15597                        equalHeights().
15598                        automateHeights(767);
15599						
15600					paws.pods.init('#pets-placeholder .allpets .adopt-pet').
15601                        equalHeights().
15602                        automateHeights(767);
15603						
15604
15605                    paws.pods.init('#pets-placeholder .dogs .pet-of-the-week').
15606                        equalHeights().
15607                        automateHeights(767);
15608
15609                    paws.pods.init('#pets-placeholder .cats .pet-of-the-week').
15610                        equalHeights().
15611                        automateHeights(767);
15612						
15613					paws.pods.init('#pets-placeholder .allpets .pet-of-the-week').
15614                        equalHeights().
15615                        automateHeights(767);
15616
15617                    paws.pods.init('.foster-pod').
15618                        equalHeights().
15619                        automateHeights(767);
15620
15621                    paws.pods.init('.media-kit-cols').
15622                        equalHeights().
15623                        automateHeights(992);
15624
15625                    paws.pods.init('.loc-time-pod .pod').
15626                        equalHeights().
15627                        automateHeights(992);
15628
15629                    paws.pods.init('.pod-carousel .item > div').
15630                        equalHeights().
15631                        automateHeights(479);
15632
15633                    paws.pods.init('.paws-in-media.two-col-list .pod .text').
15634                        equalHeights().
15635                        automateHeights(767);
15636
15637                    paws.pods.init('.accordion article').
15638                        equalHeights().
15639                        automateHeights(991);
15640
15641                    if($('#stories-placeholder').length > 0) {
15642                        PAWS.pods.init('#stories-placeholder .item > div').
15643                        equalHeights().
15644                        automateHeights(767);
15645					}
15646
15647                    if (($('.inside-page-header .sidebar-adopt-pod').length === 0 && $('.inside-page-header .sidebar-general-pod').length === 0) &&
15648                        $('.inside-page-header .pod p a img').length > 0) {
15649                        paws.pods.init('.inside-page-header .pod').
15650                            equalImgHeights().
15651                            automateHeights(991);
15652                    } else {
15653                        paws.pods.init('.inside-page-header .pod').
15654                            equalHeights().
15655                            automateHeights(991);
15656                    }
15657
15658                    paws.rteTables.styleOnResize();
15659
15660                    // Resize calendar iframe.
15661                    paws.calendar.setHeight();
15662
15663					//Sticky Main Menu
15664					paws.navigation.makeStickyMenu(self);
15665                }, 100);
15666
15667                currentWindowHeight = windowHeight;
15668                currentWindowWidth = windowWidth;
15669            }
15670        });
15671
15672	var resizeInterval,
15673		currentWindowHeight,
15674		currentWindowWidth;
15675}($(window), PAWS));
15676
15677
15678$(function () {
15679    
15680    /* More/Less Options link */
15681    if ($("#more_options_link").length > 0){   
15682        $('#more_options_link a').on('click', function () {
15683            event.preventDefault();
15684            $('#more_options').slideToggle();
15685            $('#more_options').toggleClass('showMoreOptions');
15686            $(this).html( $(this).html() == 'More Options <span class="farrow down"></span>' ? 'Less Options <span class="farrow up"></span>' : 'More Options <span class="farrow down"></span>');     
15687        });
15688    }
15689
15690    /* Drop Downs for filtering */
15691    if ($(".dropdown-widget").length > 0 ){
15692        $(".dropdown-widget").each(function(){
15693            if ($(this).find('li.selected')){
15694                $(this).find('.placeholder').html($(this).find('.selected').text());
15695            } else {
15696                $(this).find('.placeholder').html($(this).find('li.selected').first().text());
15697            }
15698        });        
15699    }
15700
15701    /* Gender Radio Buttons */
15702    if ($(".gender-filter").length > 0 ){
15703        $(".gender-filter").find('label').on('click', function () {
15704            $(".gender-filter").find('label').each(function(){
15705                $(this).removeClass('checked'); 
15706            })
15707            $(this).addClass('checked');
15708        });
15709    }
15710    
15711    $("#location-dropdown a, #more_options a").each(function(){
15712        $(this).on('click', function () {
15713            //event.preventDefault();
15714            $('#plfull').show();
15715        });
15716    });  
15717    
15718    
15719    
15720});
15721var scriptUrl = 'https:\/\/www.youtube.com\/s\/player\/7460dd14\/www-widgetapi.vflset\/www-widgetapi.js';try{var ttPolicy=window.trustedTypes.createPolicy("youtube-widget-api",{createScriptURL:function(x){return x}});scriptUrl=ttPolicy.createScriptURL(scriptUrl)}catch(e){}var YT;if(!window["YT"])YT={loading:0,loaded:0};var YTConfig;if(!window["YTConfig"])YTConfig={"host":"https://www.youtube.com"};
15722if(!YT.loading){YT.loading=1;(function(){var l=[];YT.ready=function(f){if(YT.loaded)f();else l.push(f)};window.onYTReady=function(){YT.loaded=1;var i=0;for(;i<l.length;i++)try{l[i]()}catch(e){}};YT.setConfig=function(c){var k;for(k in c)if(c.hasOwnProperty(k))YTConfig[k]=c[k]};var a=document.createElement("script");a.type="text/javascript";a.id="www-widgetapi-script";a.src=scriptUrl;a.async=true;var c=document.currentScript;if(c){var n=c.nonce||c.getAttribute("nonce");if(n)a.setAttribute("nonce",
15723n)}var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)})()};
15724
15725/******************************************
15726 * gigagit.com
15727 *
15728 * tinytooltip.js jQuery Plugin 
15729 *
15730 * @copyright       Copyright (c) 2020 GIGAGIT.
15731 * @license         License info
15732 * @link            https://www.gigagit.com
15733 * @version         Version 3.0.1
15734 *
15735 ******************************************/
15736+function(n){"use strict";function t(){var i=document.createElement("gg"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(i.style[t]!==undefined)return{end:n[t]};return!1}n.fn.ggEmulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one("ggTransitionEnd",function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){(n.support.transition=t(),n.support.transition)&&(n.event.special.ggTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("gg.tooltip"),f=typeof i=="object"&&i;(r||!/destroy|hide/.test(i))&&(r||u.data("gg.tooltip",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.cacheState=null;this.ajaxState=null;this.init("tooltip",n,t)},i;t.VERSION="3.0.0";t.TRANSITION_DURATION=250;t.MAXWIDTH=350;t.DEFAULT_TEMPLATE='<div class="tinytooltip" role="tooltip"><div class="tinytooltip-arrow-border"><div class="tinytooltip-arrow"><\/div><\/div><div class="tinytooltip-inner"><\/div><\/div>';t.POPOVER_TEMPLATE='<div class="tinypopover" role="tooltip"><div class="tinypopover-arrow-border"><div class="tinypopover-arrow"><\/div><\/div><div class="tinypopover-inner"><h3 class="tinypopover-title"><\/h3><div class="tinypopover-content"><\/div><\/div><\/div>';t.CLEARFIX='<div class="tinytooltip-clearfix"><\/div>';t.DEFAULTS={animation:!0,action:"tooltip",placement:"top",selector:!1,template:t.DEFAULT_TEMPLATE,skin:"default",trigger:"hover focus",delay:{show:0,hide:0},responsive:!0,title:"",content:"",html:!1,container:"body",viewport:{selector:"body",padding:0},ajax:!1,ajaxUrl:"",params:{},method:"GET",loading:"loading...",error:"error occurred",cache:!0,shadow:!0,opacity:.9,radius:4,borderRadius:4,border:!0,padding:8,width:0,minwidth:0,maxwidth:t.MAXWIDTH,textalign:"center",backcolor:"#000000",textcolor:"#ffffff",bordercolor:"#ffffff",titleBackcolor:"#f7f7f7",titleBordercolor:"#ebebeb",titleTextcolor:"#444444",contentBackcolor:"#ffffff",contentTextcolor:"#444444",menuLinkcolor:"#ffffff",menuHoverLinkcolor:"#000000",menuHoverBackcolor:"#ffffff",menuItemDividercolor:"#ffffff",arrowcolor:"#ffffff"};t.prototype.init=function(t,i,r){var o,s,u,e,f,h,c;if(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(n.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(o=this.options.trigger.split(" "),s=o.length;s--;)if(u=o[s],u=="click")this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else if(u=="hoverable"){e=this.tip();f=this;this.$element.on("mouseenter."+this.type,this.options.selector,n.proxy(this.enter,this));e.on("mouseleave."+this.type,this.options.selector,n.proxy(this.leave,this));this.$element.on("mouseleave."+this.type,this.options.selector,function(){var n=setTimeout(function(){e.trigger("mouseleave."+f.type)},f.options.delay.hide);e.on("mouseenter."+f.type,f.options.selector,function(){clearTimeout(n)})})}else if(u!="manual"){h=u=="hover"?"mouseenter":"focusin";c=u=="hover"?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,n.proxy(this.enter,this));this.$element.on(c+"."+this.type,this.options.selector,n.proxy(this.leave,this))}this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(i){return i=n.extend({},this.getDefaults(),this.$element.data(),i),i.delay=i.delay&&typeof i.delay=="number"?{show:i.delay,hide:i.delay}:{show:i.delayShow,hide:i.delayHide},i.borderRadius!=null&&(i.radius=i.borderRadius),i.minwidth!=null&&(i.width=i.minwidth),i.responsive?(i.placement=i.placement.replace(/auto/ig,"").trim(),i.placement==""?i.placement="auto":i.placement+=" auto"):i.placement=i.placement.replace(/auto/ig,"").trim(),i.action=i.action==null||i.action=="tooltip"?"tooltip":"popover",(i.skin==""||i.skin==null||i.skin==undefined)&&(i.skin="default"),i.skin=="default"&&(i.textalign=i.action=="popover"?"left"
15736:i.textalign,i.bordercolor=i.action=="popover"?"#cccccc":i.bordercolor),i.skin=="custom"&&i.action=="popover"&&this.$element.data("bordercolor")==null&&(i.bordercolor="#bbbbbb"),i.template=i.action==null||i.action=="tooltip"?t.DEFAULT_TEMPLATE:t.POPOVER_TEMPLATE,i};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("gg."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("gg."+this.type,i)),t instanceof n.Event&&(i.inState[t.type=="focusin"?"focus":"hover"]=!0),i.tip().hasClass("in")||i.hoverState=="in"){i.hoverState="in";return}if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)};t.prototype.isInStateTrue=function(){for(var n in this.inState)if(this.inState[n])return!0;return!1};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("gg."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("gg."+this.type,i)),t instanceof n.Event&&(i.inState[t.type=="focusout"?"focus":"hover"]=!1),i.ajaxState=null,!i.isInStateTrue()){if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)}};t.prototype.show=function(){var y=n.Event("show.gg."+this.type),p,v,g,u,nt,c;if(this.options.action=="tooltip"?!this.ajaxState&&this.options.ajax&&(this.options.cache?this.$element.attr("data-original-title")==""&&this.$element.attr("data-original-title",this.options.loading):this.$element.attr("data-original-title",this.options.loading)):this.options.action=="popover"&&!this.ajaxState&&this.options.ajax&&(this.options.cache?this.$element.attr("data-content")==null&&this.$element.attr("data-content",this.options.loading):this.$element.attr("data-content",this.options.loading)),this.hasContent()&&this.enabled){if(this.$element.trigger(y),p=n.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]),y.isDefaultPrevented()||!p)return;var l=this,e=this.tip(),w=this.getUID(this.type);this.setContent();e.attr("id",w);this.$element.attr("aria-describedby",w);this.options.animation&&e.addClass("fade");var i=typeof this.options.placement=="function"?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,b=/\s?auto?\s?/i,k=b.test(i);k&&(i=i.replace(b,"")||"top");e.detach().css({top:0,left:0,display:"block"}).addClass(i).data("gg."+this.type,this);this.options.container?e.appendTo(this.options.container):e.insertAfter(this.$element);this.$element.trigger("inserted.gg."+this.type);var h=n(document).width(),a=this.scrollbarWidth(),d=n(document).width()-n(window).width(),o=this.options.maxwidth;d>0&&(h=h-a);h>n(window).width()&&(h=n(window).width()-a);v=n(document).height();d>a&&(v=v-a);o!=0?(o*2>h?o=Math.floor(h/2-30):o-=30,o*1.5>h/2&&(o=Math.floor(h/2-30))):o=680>h?Math.floor(h/2-30):340;this.options.action=="tooltip"?e.find(".tinytooltip-inner").css({"min-width":this.options.width>o?o:this.options.width+"px","max-width":o+"px"}):this.options.action=="popover"&&(e.css({"min-width":this.options.width>o?o:this.options.width+"px","max-width":o+"px"}),e.find(".tinypopover-inner").css({"min-width":this.options.width>o?o:this.options.width+"px","max-width":o+"px"}));var r=this.getPosition(),f=e[0].offsetWidth,s=e[0].offsetHeight;if(k){g=i;u=this.getPosition(this.$viewport);switch(i){case"top-left":i=i=="top-left"&&r.top-s<u.top?"bottom-left":i;i=i=="top-left"&&r.right+f>u.width?"top-right":i;i=i=="bottom-left"&&r.right+f>u.width?"bottom-right":i;break;case"top":i=i=="top"&&r.top-s<u.top?"bottom":i;i=i=="bottom"&&r.left-f<u.left?"bottom-left":i=="bottom"&&r.right+f>u.width?"bottom-right":i;i=i=="top"&&r.left-f<u.left?"top-left":i=="top"&&r.right+f>u.width?"top-right":i;break;case"top-right":i=i=="top-right"&&r.top-s<u.top?"bottom-right":i;i=i=="top-right"&&r.left-f<u.left?"top-left":i;i=i=="bottom-right"&&r.left-f<u.left?"bottom-left":i;break;case"left-top":i=i=="left-top"&&r.top-s<u.top?"left-bottom":i;i=i=="left-top"&&r.left-f<u.left?"right-top":i;i=i=="left-bottom"&&r.left-f<u.left?"right-bottom":i;i=i=="right-top"&&r.right+f>u.width?"top-right":i;i=i=="right-bottom"&&r.right+f>u.width?"bottom-right":i;break;case"right-top":i=i=="right-top"&&r.top-s<u.top?"right-bottom":i;i=i=="right-top"&&r.right+f>u.width?"left-top":i;i=i=="right-bottom"&&r.right+f>u.width?"bottom-right":i;i=i=="left-top"&&r.left-f<u.left?"top-left":i;break;case"left":i=i=="left"&&r.left-f<u.left?"top-left":i;i=i=="top-left"&&r.top-s<u.top?"bottom-left":i;i=i=="top-left"&&r.right+f>u.width?"top-right":i;i=i=="bottom-left"&&r.right+f>u.width?"bottom-right":i;break;case"right":i=i=="right"&&r.right+f>u.width?"top-right":i;i=i=="top-right"&&r.top-s<u.top?"bottom-right":i;i=i=="top-right"&&r.left-f<u.left?"top-left":i;i=i=="bottom-right"&&r.left-f<u.left?"bottom-left":i;break;case"left-bottom":i=i=="left-bottom"&&r.bottom+s>u.bottom?"left-top":i;i=i=="left-top"&&r.left-f<u.left?"right-top":i;i=i=="left-bottom"&&r.left-f<u.left?"right-bottom":i;i=i=="right-top"&&r.right+f>u.width?"top-right":i;i=i=="right-bottom"&&r.right+f>u.width?"bottom-right":i;break;case"right-bottom":i=i=="right-bottom"&&r.bottom+s>u.bottom?"right-top":i;i=i=="right-top"&&r.right+f>u.width?"left-top":i;i=i=="right-bottom"&&r.right+f>u.width?"bottom-right":i;i=i=="left-top"&&r.left-f<u.left?"top-left":i;break;case"bottom-left":i=i=="bottom-left"&&r.bottom+s>u.bottom?"top-left":i;i=i=="bottom-left"&&r.right+f>u.width?"bottom-right":i;i=i=="top-left"&&r.right+f>u.width?"top-right":i;break;case"bottom":i=i=="bottom"&&r.bottom+s>u.bottom?"top":i;i=i=="bottom"&&r.left-f<u.left?"bottom-left":i=="bottom"&&r.right+f>u.width?"bottom-right":i;i=i=="top"&&r.left-f<u.left?"top-left":i=="top"&&r.right+f>u.width?"top-right":i;break;case"bottom-right":i=i=="bottom-right"&&r.bottom+s>u.bottom?"top-right":i;i=i=="bottom-right"&&r.left-f<u.left?"bottom-left":i;i=i=="top-right"&&r.left-f<u.left?"top-left":i}e.removeClass(g).addClass(i);r=this.getPosition();f=e[0].offsetWidth;s=e[0].offsetHeight}if(nt=this.getCalculatedOffset(i,r,f,s),this.applyPlacement(nt,i),e.attr("data-placement",i),c=function(){var n=l.hoverState;l.$element.trigger("shown.gg."+l.type);l.hoverState=null;n=="out"&&l.leave(l)},this.options.animation)switch(i){case"top":case"top-left":case"top-right":e.css({top:"-=20",opacity:0,display:"block"}
15736).animate({top:"+=20",opacity:this.options.opacity},t.TRANSITION_DURATION,function(){setTimeout(c,t.TRANSITION_DURATION)});break;case"bottom":case"bottom-left":case"bottom-right":e.css({top:"+=20",opacity:0,display:"block"}).animate({top:"-=20",opacity:this.options.opacity},t.TRANSITION_DURATION,function(){setTimeout(c,t.TRANSITION_DURATION)});break;case"left":case"left-top":case"left-bottom":e.css({left:"-=20",opacity:0,display:"block"}).animate({left:"+=20",opacity:this.options.opacity},t.TRANSITION_DURATION,function(){setTimeout(c,t.TRANSITION_DURATION)});break;case"right":case"right-top":case"right-bottom":e.css({left:"+=20",opacity:0,display:"block"}).animate({left:"-=20",opacity:this.options.opacity},t.TRANSITION_DURATION,function(){setTimeout(c,t.TRANSITION_DURATION)});break;default:c()}else n.support.transition&&this.$tip.hasClass("fade")?e.one("ggTransitionEnd",c).ggEmulateTransitionEnd(t.TRANSITION_DURATION):c()}this.ajaxState||this.setRemoteContent()};t.prototype.hide=function(i){function u(){f.hoverState!="in"&&r.detach();f.$element&&f.$element.removeAttr("aria-describedby").trigger("hidden.gg."+f.type);i&&i()}var f=this,r=n(this.$tip),e=n.Event("hide.gg."+this.type),o;if(this.$element.trigger(e),!e.isDefaultPrevented()){if(r.removeClass("in"),this.options.animation){o=r.attr("data-placement");switch(o){case"top":case"top-left":case"top-right":r.animate({top:"-=20",opacity:0},t.TRANSITION_DURATION,function(){setTimeout(u,t.TRANSITION_DURATION)});break;case"bottom":case"bottom-left":case"bottom-right":r.animate({top:"+=20",opacity:0},t.TRANSITION_DURATION,function(){setTimeout(u,t.TRANSITION_DURATION)});break;case"left":case"left-top":case"left-bottom":r.animate({left:"-=20",opacity:0},t.TRANSITION_DURATION,function(){setTimeout(u,t.TRANSITION_DURATION)});break;case"right":case"right-top":case"right-bottom":r.animate({left:"+=20",opacity:0},t.TRANSITION_DURATION,function(){setTimeout(u,t.TRANSITION_DURATION)});break;default:r.fadeOut(t.TRANSITION_DURATION,function(){n(this).css({opacity:0});u()})}}else n.support.transition&&r.hasClass("fade")?r.one("ggTransitionEnd",u).ggEmulateTransitionEnd(t.TRANSITION_DURATION):u();return this.hoverState=null,this}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),l=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),c,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top+=o;t.left+=s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");c=r[0].offsetWidth;f=r[0].offsetHeight;/top/.test(i)&&f!=e&&(t.top=t.top+e-f);u={top:0,left:0};u.left?t.left+=u.left:t.top+=u.top;var h=/top|bottom/.test(i),a=h?u.left*2-l+c:u.top*2-e+f,v=h?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(a,r[0][v],h,i);this.setStyles(i)};t.prototype.replaceArrow=function(n,t,i,r){var u=r=="bottom"||r=="bottom-left"||r=="top-left"?"left"
15736:"right";n>0&&this.arrow().css(i?u:"top",50*(1-n/t)+"%").css(i?"top":"left","")};t.prototype.setContent=function(){this.options.action=="tooltip"?this.setTinyTooltipContent():this.setPopoverContent()};t.prototype.setTinyTooltipContent=function(){var n=this.tip(),r=this.getTitle(),i;n.find(".tinytooltip-inner")[this.options.html?"html":"text"](r);n.find(".tinytooltip-inner").append(t.CLEARFIX);n.find(".tinytooltip-inner .tinytooltip-video").append(t.CLEARFIX);n.find(".tinytooltip-inner .tinytooltip-image").append(t.CLEARFIX);n.find(".tinytooltip-inner .tinytooltip-menu").append(t.CLEARFIX);n.removeClass("fade in top top-left top-right bottom bottom-left bottom-right left left-top left-bottom right right-top right-bottom");n.find(".tinytooltip-inner").css({padding:this.options.padding+"px","min-width":0,"max-width":this.options.maxwidth+"px"});i=!1;this.ajaxState==null&&this.options.ajax?this.cacheState&&(i=!0):i=!0;i&&n.find(".tinytooltip-inner").css({padding:this.options.padding+"px","min-width":this.options.width+"px","max-width":(this.options.width==0?this.options.maxwidth:this.options.width)+"px"})};t.prototype.setPopoverContent=function(){var n=this.tip(),u=this.getTitle(),r=this.getContent(),i;n.find(".tinypopover-title")[this.options.html?"html":"text"](u);n.find(".tinypopover-content").children().detach().end()[this.options.html?typeof r=="string"?"html":"append":"text"](r);n.find(".tinypopover-inner").append(t.CLEARFIX);n.find(".tinypopover-content").append(t.CLEARFIX);n.find(".tinypopover-inner .tinytooltip-video").append(t.CLEARFIX);n.find(".tinypopover-inner .tinytooltip-image").append(t.CLEARFIX);n.find(".tinypopover-inner .tinytooltip-menu").append(t.CLEARFIX);n.removeClass("fade in top top-left top-right bottom bottom-left bottom-right left left-top left-bottom right right-top right-bottom");n.find(".tinypopover-title").html()||n.find(".tinypopover-title").hide();n.css({"min-width":0,"max-width":this.options.maxwidth+"px"});n.find(".tinypopover-content").css({padding:this.options.padding+"px"});i=!1;this.ajaxState==null&&this.options.ajax?this.cacheState&&(i=!0):i=!0;i&&n.css({"min-width":this.options.width+"px","max-width":(this.options.width==0?this.options.maxwidth:this.options.width)+"px"})};t.prototype.setRemoteContent=function(){this.options.action=="tooltip"?this.setTinyTooltipRemoteContent():this.setPopoverRemoteContent()};t.prototype.setTinyTooltipRemoteContent=function(){var r,i;if(this.options.ajax){var f=this.tip(),t=this,u=t.$element;t.ajaxState=!0;r=typeof t.options.params=="function"?t.options.params.call(u[0]):t.options.params;t.cacheState!=null&&t.cacheState||(i=null,i=n.ajax({method:t.options.method,url:t.options.ajaxUrl,data:r,dataType:"json",cache:t.options.cache}),i.fail(function(){t.$element.attr("data-original-title",t.options.error);t.show();t.cacheState=!1;t.$element.attr("data-original-title",t.options.loading)}),i.done(function(n){var i=n.data;t.$element.attr("data-original-title",i);t.show();t.cacheState=t.options.cache;t.options.cache||t.$element.attr("data-original-title",t.options.loading)}))}};t.prototype.setPopoverRemoteContent=function(){var r,i;if(this.options.ajax){var f=this.tip(),t=this,u=t.$element;t.ajaxState=!0;r=typeof t.options.params=="function"?t.options.params.call(u[0]):t.options.params;t.cacheState!=null&&t.cacheState||(i=null,i=n.ajax({method:t.options.method,url:t.options.ajaxUrl,data:r,dataType:"json",cache:t.options.cache}),i.fail(function(){t.$element.attr("data-content",t.options.error);t.show();t.cacheState=!1;t.$element.attr("data-content",t.options.loading)}),i.done(function(n){var i=n.data;t.$element.attr("data-content",i);t.show();t.cacheState=t.options.cache;t.options.cache||t.$element.attr("data-content",t.options.loading)}))}};t.prototype.setStyles=function(n){this.options.action=="tooltip"?this.setTinyTooltipStyles(n):this.setPopoverStyles(n)};t.prototype.setTinyTooltipStyles=function(t){var i=this.tip(),r;this.options.skin!="custom"&&(i.addClass(this.options.skin),this.options.border||i.addClass("no-border"));this.options.skin!="custom"?i.find(".tinytooltip-inner").css({"border-radius":this.options.radius+"px","text-align":this.options.textalign}):i.find(".tinytooltip-inner").css({background:this.options.backcolor,color:this.options.textcolor,"border-width":this.options.border?"1px":0,"border-color":this.options.bordercolor,"border-radius":this.options.radius+"px","text-align":this.options.textalign});this.options.shadow||i.find(".tinytooltip-inner").css({"box-shadow":"none"});t=t=="bottom-left"||t=="bottom-right"?"bottom":t=="top-left"||t=="top-right"?"top":t=="left-bottom"||t=="left-top"?"left":t=="right-bottom"||t=="right-top"?"right":t;i.find(".tinytooltip-inner .tinytooltip-video > .tinytooltip-video-wrapper").css({width:i.width()-this.options.padding*2+"px"});this.options.skin=="custom"&&(i.find(".tinytooltip-arrow").css("border-"+t+"-color",this.options.backcolor),i.find(".tinytooltip-arrow-border").css("border-"+t+"-color",this.options.border?this.options.bordercolor:this.options.backcolor),r=this,i.find(".tinytooltip-inner > .tinytooltip-menu li a").each(function(){n(this).parent().css({"border-bottom-color":r.options.menuItemDividercolor});n(this).css({color:r.options.menuLinkcolor});n(this).on("mouseenter",function(){n(this).css({color:r.options.menuHoverLinkcolor,background:r.options.menuHoverBackcolor})});n(this).on("mouseleave",function(){n(this).css({color:r.options.menuLinkcolor,background:"none"})})}))};t.prototype.setPopoverStyles=function(n){var t=this.tip(),i=this.getTitle();this.options.skin!="custom"&&(t.addClass(this.options.skin),this.options.border||t.addClass("no-border"));this.options.shadow||t.find(".tinypopover-inner").css({"box-shadow":"none"});this.options.skin!="custom"?(t.find(".tinypopover-title").css({"border-radius":this.options.radius+"px "+this.options.radius+"px 0 0"}),t.find(".tinypopover-content").css({"border-radius":"0 0 "+this.options.radius+"px "+this.options.radius+"px"})):(t.find(".tinypopover-title").css({"background-color":this.options.titleBackcolor,color:this.options.titleTextcolor,"border-color":this.options.titleBackcolor,"border-bottom-color":this.options.titleBordercolor,"border-radius":this.options.radius+"px "+this.options.radius+"px 0 0"}),t.find(".tinypopover-content").css({"background-color":this.options.contentBackcolor,color:this.options.contentTextcolor,"border-radius":"0 0 "+this.options.radius+"px "+this.options.radius+"px"}));n=n=="bottom-left"||n=="bottom-right"?"bottom":n=="top-left"||n=="top-right"?"top":n=="left-bottom"||n=="left-top"?"left":n=="right-bottom"||n=="right-top"?"right":n;t.find(".tinypopover-inner .tinytooltip-video > .tinytooltip-video-wrapper").css({width:t.width()-this.options.padding*2+"px"});this.options.skin!="custom"?t.find(".tinypopover-inner").css({"border-radius":this.options.radius+"px","text-align":this.options.textalign}):(t.find(".tinypopover-arrow-border").css("border-"+n+"-color",this.options.border?this.options.bordercolor:this.options.titleBackcolor),/bottom|bottom-left|bottom-right|left-bottom|right-bottom/.test(n)?t.find(".tinypopover-arrow-border > .tinypopover-arrow").css("border-"+n+"-color",this.options.titleBackcolor):t.find(".tinypopover-arrow-border > .tinypopover-arrow").css("border-"+n+"-color",this.options.contentBackcolor),t.find(".tinypopover-title").html()==""&&(t.find(".tinypopover-arrow-border > .tinypopover-arrow").css("border-"+n+"-color",this.options.contentBackcolor),t.find(".tinypopover-arrow-border").css("border-"+n+"-color",this.options.border?this.options.bordercolor:this.options.contentBackcolor)),t.find(".tinypopover-inner").css({color:this.options.textcolor,"border-color":this.options.bordercolor,"border-width":this.options.border?"1px":0,"border-radius":this.options.radius+"px","text-align":this.options.textalign}))};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content)};t.prototype.getPosition=function(t){var u,s,e,k,d,p,w;t=t||this.$element;var i=t[0],h=i.tagName=="BODY",r=i.selector!=""?i.getBoundingClientRect():{width:n(window).width(),height:n(window).height()};r.width==null&&(r=n.extend({},r,{width:r.right-r.left,height:r.bottom-r.top}));var g=window.SVGElement&&i instanceof window.SVGElement,o=h?{top:0,left:0}:g?null:t.offset(),nt={scroll:h?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},tt=h?{width:n(window).width(),height:n(window).height()}:null;if(i.tagName=="AREA"){var b=i.parentElement.getAttribute("name"),c=n("img[usemap='#"+b+"']").offset().top,l=n("img[usemap='#"+b+"']").offset().left,a=i.getAttribute("shape").toLowerCase(),v=parseInt(i.getAttribute("coords").split(",")[0]),y=parseInt(i.getAttribute("coords").split(",")[1]),f=parseInt(i.getAttribute("coords").split(",")[2]),it=parseInt(i.getAttribute("coords").split(",")[3]||f);if(a=="rect"&&(o={top:parseInt(c+y),left:parseInt(l+v)},r={width:f-v,height:it-y}),a=="circle"&&(o={top:parseInt(c+y-f),left:parseInt(l+v-f)},r={width:f*2,height:f*2}),a=="poly"){for(u=[],s=i.getAttribute("coords").split(","),e=0;e<s.length;)u.push({x:parseInt(s[e]),y:parseInt(s[e+1])}),e=e+2;u.sort(function(n,t){var i=n.x,r=t.x;return i==r?0:i<r?1:-1});k=u[0].x;u.sort(function(n,t){var i=n.y,r=t.y;return i==r?0:i<r?1:-1});d=u[0].y;u.sort(function(n,t){var i=n.x,r=t.x;return i==r?0:i>r?1:-1});p=u[0].x;u.sort(function(n,t){var i=n.y,r=t.y;return i==r?0:i>r?1:-1});w=u[0].y;o={top:parseInt(c+w),left:parseInt(l+p)};r={width:k-p,height:d-w}}}return n.extend({},r,nt,tt,o)};t.prototype.getCalculatedOffset=function(n,t,i,r){return n=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-i/2}:n=="top"?{top:t.top-r,left:t.left+t.width/2-i/2}:n=="left"?{top:(this.options.action=="popover"?-8:0)+t.top+t.height/2-r/2,left:t.left-i}:n=="right"?{top:(this.options.action=="popover"?-8:0)+t.top+t.height/2-r/2,left:t.left+t.width}:n=="right-top"?{top:t.top-r+t.height+6,left:t.left+t.width}:n=="right-bottom"?{top:t.top-4,left:t.left+t.width}:n=="left-top"?{top:t.top-r+t.height+6,left:t.left-i}:n=="left-bottom"?{top:t.top-4,left:t.left-i}:n=="bottom-left"?{top:t.top+t.height,left:t.left}:n=="bottom-right"?{top:t.top+t.height,left:t.left+t.width-i}:n=="top-left"?{top:t.top-r,left:t.left}:n=="top-right"?{top:t.top-r,left:t.left+t.width-i}:""};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.right&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(Math.random()*1e6);while(document.getElementById(n));return n};t.prototype.tip=function(){if(!this.$tip&&(this.$tip=n(this.options.template),this.$tip.length!=1))throw new Error(this.t
15736ype+" `template` option must consist of exactly 1 top-level element!");return this.$tip};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find("."+this.options.action+"-arrow")};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&(i=n(t.currentTarget).data("gg."+this.type),i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("gg."+this.type,i)));t?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){var n=this;clearTimeout(this.timeout);this.hide(function(){n.$element.off("gg."+n.type).removeData("gg."+n.type);n.$tip&&n.$tip.detach();n.$tip=null;n.$arrow=null;n.$viewport=null;n.$element=null})};t.prototype.scrollbarWidth=function(){var t=n('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"><\/div>'),i,r;return n("body").append(t),i=n("div",t).innerWidth(),t.css("overflow","scroll"),r=n("div",t).innerWidth(),n(t).remove(),i-r};i=n.fn.tooltip;n.fn.tooltip=r;n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this};i=n.fn.tinytooltip;n.fn.tinytooltip=r;n.fn.tinytooltip.Constructor=t;n.fn.tinytooltip.noConflict=function(){return n.fn.tinytooltip=i,this}}(jQuery);

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.