1!function(t){"use strict";if("function"==typeof define&&define.amd)define(["jquery","Cookies"],t);else if("object"==typeof exports)module.exports=t();else{var e=window.Lang,n=window.Lang=t(jQuery,"undefined"!=typeof Cookies?Cookies:void 0);n.noConflict=function(){return window.Lang=e,n}}}((function(t,e){var n=function(){this._fireEvents=!0,this._dynamic={}};return n.prototype.init=function(n){var a,o,r,i,s=this;(n=n||{}).cookie=n.cookie||{},o=n.defaultLang,r=n.currentLang,i=n.allowCookieOverride,this.cookieName=n.cookie.name||"langCookie",this.cookieExpiry=n.cookie.expiry||365,this.cookiePath=n.cookie.path||"/",this._mutationCopies={append:t.fn.append,appendTo:t.fn.appendTo,prepend:t.fn.prepend,before:t.fn.before,after:t.fn.after,html:t.fn.html},t.fn.append=function(){return s._mutation(this,"append",arguments)},t.fn.appendTo=function(){return s._mutation(this,"appendTo",arguments)},t.fn.prepend=function(){return s._mutation(this,"prepend",arguments)},t.fn.before=function(){return s._mutation(this,"before",arguments)},t.fn.after=function(){return s._mutation(this,"after",arguments)},t.fn.html=function(){return s._mutation(this,"html",arguments)},this.defaultLang=o||"en",this.currentLang=o||"en",!i&&r||void 0===e||(a=e.get(this.cookieName))&&(r=a),t((function(){s._start(),r&&r!==s.defaultLang&&s.change(r)}))},n.prototype.pack={},n.prototype.attrList=["title","alt","placeholder","href"],n.prototype.dynamic=function(t,e){void 0!==t&&void 0!==e&&(this._dynamic[t]=e)},n.prototype.loadPack=function(t,e){var n=this;if(!t||!n._dynamic[t])throw"Cannot load language pack, no file path specified!";fetch(n._dynamic[t]).then((function(t){if(t.ok)return t.json()})).then((function(a){if(n.pack[t]=a,n.pack[t].regex){var o,r,i=n.pack[t].regex;for(r=0;r<i.length;r++)2===(o=i[r]).length?o[0]=new RegExp(o[0]):3===o.length&&(o[0]=new RegExp(o[0],o[1]),o.splice(1,1))}e&&e(!1,t,n._dynamic[t])})).catch((function(a){throw e&&e(!0,t,n._dynamic[t]),"Error loading language pack"+n._dynamic[t]}))},n.prototype._start=function(e){for(var n,a=void 0!==e?t(e).find("[lang]"):t(":not(html)[lang]"),o=a.length;o--;)n=t(a[o]),this._processElement(n)},n.prototype._processElement=function(t){t.attr("lang")===this.defaultLang&&(this._storeAttribs(t),this._storeContent(t))},n.prototype._storeAttribs=function(t){var e,n,a;for(e=0;e<this.attrList.length;e++)n=this.attrList[e],t.attr(n)&&((a=t.data("langAttr")||{})[n]=t.attr(n),t.data("langAttr",a))},n.prototype._storeContent=function(t){if(t.is("input"))switch(t.attr("type")){case"button":case"submit":case"hidden":case"reset":t.data("langVal",t.val())}else if(t.is("img"))t.data("langSrc",t.attr("src"));else{var e=this._getTextNodes(t);e&&t.data("langText",e)}},n.prototype._getTextNodes=function(e){var n=e.contents(),a=[];return t.each(n,(function(t,e){3===e.nodeType&&a.push({node:e,langDefaultText:e.data})})),1===a.length&&(a[0].langToken=e.data("langToken")),a},n.prototype._setTextNodes=function(e,n,a,o){var r,i,s,l,c,f=/<[^>]+>/g;for(r=0;r<n.length;r++)if(c=(i=n[r]).langToken,l=t.trim(i.langDefaultText),c?s=this.translate(c,a,o):l&&l.length>0&&(s=this.translate(l,a,o)),f.test(s))e[0].innerHTML=s;else if(s)try{i.node.data=i.node.data.split(t.trim(i.node.data)).join(s)}catch(t){}else console4jslang&&console.log&&l.length>0&&console.log('Translation for "'+l+'" not found!')},n.prototype._translateAttribs=function(t,e,n){var a,o,r=t.data("langAttr")||{};for(a in r)r.hasOwnProperty(a)&&t.attr(a)&&(e!==this.defaultLang?(o=this.translate(r[a],e,n))&&t.attr(a,o):t.attr(a,r[a]))},n.prototype._translateContent=function(t,e,n){var a,o,r;this.defaultLang;if(t.is("input"))switch(t.attr("type")){case"button":case"submit":case"hidden":case"reset":o=t.data("langVal"),r=t.data("langToken")||o,a=this.translate(r,e,n),t.val(a)}else t.is("img")?(o=t.data("langSrc"),r=t.data("langToken")||o,a=this.translate(r,e,n),t.attr("src",a)):(o=t.data("langText"),(r=t.data("langToken"))?(a=this.translate(r,e,n))&&(t[0].innerHTML=a):o&&this._setTextNodes(t,o,e,n))},n.prototype.getLangDataFromElement=function(t){return t.data("langDefaultData")},n.prototype.change=function(n,a,o){var r=this,i=n===this.defaultLang,s=this.pack[n],l=this._dynamic[n];if(!i&&!s&&!l)throw o&&o("No language pack defined for: "+n,n,a),'Attempt to change language to "'+n+'" but no language pack for that language is loaded!';if(s||!l){var c=!1,f=this.currentLang;this.currentLang!==n&&(this.beforeUpdate(f,n),c=!0),this.currentLang=n;for(var h,p=void 0!==a?t(a).find("[lang]"):t(":not(html)[lang]"),g=p.length;g--;)(h=t(p[g])).data("langScanned")&&h.attr("lang")===n||(h.data("langScanned",!0),this._translateElement(h,n,this.getLangDataFromElement(h)));c&&this.afterUpdate(f,n),void 0!==e&&e.set(r.cookieName,n,{expires:r.cookieExpiry,path:r.cookiePath}),o&&o(!1,n,a)}
1else this.loadPack(n,(function(t,e,i){t?o&&o("Language pack could not load from: "+i,n,a):r.change.call(r,n,a,o)}))},n.prototype._translateElement=function(t,e,n){this._translateAttribs(t,e,n),"false"!==t.attr("data-lang-content")&&this._translateContent(t,e,n),t.attr("lang",e)},n.prototype.getDataAtPath=function(t,e,n){var a,o=e;if(e instanceof Array){for(var r=[],i=0;i<e.length;i++){var s=e[i];r.push(this.getDataAtPath(t,s))}return r}if(null==t)return n;if(!o)return t;if("string"!=typeof o)throw new Error("Path argument must be a string");if(-1===o.indexOf("."))return void 0!==t[o]?t[o]:n;if("object"!=typeof t)return void 0!==n?n:void 0;const l=o.split(".");a=t;for(i=0;i<l.length;i++){if(!(a=a[l[i]])||"object"!=typeof a){i!==l.length-1&&(a=void 0);break}}return void 0!==a?a:n},n.prototype._parseTemplate=function(t,e){if(!t||!e)return t;var n=t;if(t&&t.indexOf("${"))for(var a,o=/\${([\s\S]+?)}/g;a=o.exec(t);){var r=a[0],i=a[1];n=n.replace(r,this.getDataAtPath(e,i))}return n},n.prototype.translate=function(t,e,n){var a="",o=e===this.defaultLang;return e=e||this.currentLang,this.pack[e]?((a=this._parseTemplate(this.pack[e].token[t],{data:n}))||(a=this._regexMatch(t,e)),a||o||console4jslang&&console.log&&"zh_cn"!=e&&console.log('Translation for "'+t+'" not found in language pack: '+e),a||t):t},n.prototype._regexMatch=function(t,e){var n,a,o,r,i,s;if(n=this.pack[e].regex)for(a=n.length,o=0;o<a;o++)if((s=(i=(r=n[o])[0]).exec(t))&&s[0])return t.replace(i,r[1]);return""},n.prototype.beforeUpdate=function(e,n){this._fireEvents&&t(this).triggerHandler("beforeUpdate",[e,n,this.pack[e],this.pack[n]])},n.prototype.afterUpdate=function(e,n){this._fireEvents&&t(this).triggerHandler("afterUpdate",[e,n,this.pack[e],this.pack[n]])},n.prototype.refresh=function(){this._fireEvents=!1,this.change(this.currentLang),this._fireEvents=!0},n.prototype._mutation=function(e,n,a){var o=this._mutationCopies[n].apply(e,a),r=this.currentLang,i=t(e);return i.attr("lang")&&(this._fireEvents=!1,this._translateElement(i,this.defaultLang,this.getLangDataFromElement(i)),this.change(this.defaultLang,i),this.currentLang=r,this._processElement(i),this._translateElement(i,this.currentLang,this.getLangDataFromElement(i))),this._start(i),this.change(this.currentLang,i),this._fireEvents=!0,o},n}));
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.