/*
 Ext.ux.form.LovCombo.js is licensed under the terms of the Open Source
 LGPL 3.0 license. Commercial use is permitted to the extent that the 
 code/component(s) do NOT become part of another Open Source or Commercially
 licensed development library or toolkit without explicit permission.

 License details: http://www.gnu.org/licenses/lgpl.html
*/
Ext.ns("Ext.ux");
Ext.ux.IconCombo=Ext.extend(Ext.form.ComboBox,{initComponent:function(){Ext.apply(this,{tpl:'<tpl for="."><div class="x-combo-list-item ux-icon-combo-item {'+this.iconClsField+'}">{'+this.displayField+"}</div></tpl>"});Ext.ux.IconCombo.superclass.initComponent.call(this)},onRender:function(b,g){Ext.ux.IconCombo.superclass.onRender.call(this,b,g);this.wrap.applyStyles({position:"relative"});this.el.addClass("ux-icon-combo-input");this.icon=Ext.DomHelper.append(this.el.up("div.x-form-field-wrap"),{tag:"div",
style:"position:absolute"})},afterRender:function(){Ext.ux.IconCombo.superclass.afterRender.apply(this,arguments);undefined!==this.value&&this.setValue(this.value)},setIconCls:function(){var b=this.store.query(this.valueField,this.getValue()).itemAt(0);if(b&&this.icon)this.icon.className="ux-icon-combo-icon "+b.get(this.iconClsField)},setValue:function(b){Ext.ux.IconCombo.superclass.setValue.call(this,b);this.setIconCls()},clearValue:function(){Ext.ux.IconCombo.superclass.clearValue.call(this);if(this.icon)this.icon.className=
""}});Ext.reg("iconcombo",Ext.ux.IconCombo);Ext.namespace("Ext.ux");
Ext.ux.IconDragSelector=function(b){function g(){v=[];l.all.each(function(a){v[v.length]=a.getRegion()});x=l.el.getRegion()}function i(){return false}function j(a){return!n||a.target==l.el.dom}function r(){l.on("containerclick",i,l,{single:true});if(o){o.dom.parentNode!==l.el.dom&&l.el.dom.appendChild(o.dom);o.setDisplayed("block")}else o=l.el.createChild({cls:"x-view-selector"});g();l.clearSelections()}function q(){var a=w.startXY,c=w.getXY(),d=Math.min(a[0],c[0]),e=Math.min(a[1],c[1]),f=Math.abs(a[0]-
c[0]);a=Math.abs(a[1]-c[1]);h.left=d;h.top=e;h.right=d+f;h.bottom=e+a;h.constrainTo(x);o.setRegion(h);d=0;for(e=v.length;d<e;d++){f=v[d];if((a=h.intersect(f))&&!f.selected){f.selected=true;l.select(d,true)}else if(!a&&f.selected){f.selected=false;l.deselect(d)}}}function t(){Ext.isIE||l.un("containerclick",i,l);o&&o.setDisplayed(false)}function s(a){w=new Ext.dd.DragTracker({onBeforeStart:j,onStart:r,onDrag:q,onEnd:t});w.initEl(a.el)}b=b||{};var l,o,w,v,x,h=new Ext.lib.Region(0,0,0,0),n=b.dragSafe===
true;this.init=function(a){l=a;l.on("render",s)}};if("function"!==typeof RegExp.escape)RegExp.escape=function(b){if("string"!==typeof b)return b;return b.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};Ext.ns("Ext.ux.form");
Ext.ux.form.LovCombo=Ext.extend(Ext.form.ComboBox,{checkField:"checked",separator:",",initComponent:function(){if(!this.tpl)this.tpl='<tpl for="."><div class="x-combo-list-item"><img class="ux-lovcombo-icon ux-lovcombo-icon-{[values.'+this.checkField+'?"checked":"unchecked"]}"><div class="ux-lovcombo-item-text">{'+(this.displayField||"text")+"}</div></div></tpl>";Ext.ux.form.LovCombo.superclass.initComponent.apply(this,arguments);this.on({scope:this,beforequery:this.onBeforeQuery,blur:this.onRealBlur});
this.onLoad=this.onLoad.createSequence(function(){if(this.el){var b=this.el.dom.value;this.el.dom.value="";this.el.dom.value=b}})},initEvents:function(){Ext.ux.form.LovCombo.superclass.initEvents.apply(this,arguments);this.keyNav.tab=false},clearValue:function(){this.value="";this.setRawValue(this.value);this.store.clearFilter();this.store.each(function(b){b.set(this.checkField,false)},this);if(this.hiddenField)this.hiddenField.value="";this.applyEmptyText()},getCheckedDisplay:function(){var b=RegExp(this.separator,
"g");return this.getCheckedValue(this.displayField).replace(b,this.separator+" ")},getCheckedValue:function(b){b=b||this.valueField;var g=[];(this.store.snapshot||this.store.data).each(function(i){i.get(this.checkField)&&g.push(i.get(b))},this);return g.join(this.separator)},onBeforeQuery:function(b){b.query=b.query.replace(RegExp(this.getCheckedDisplay()+"[ "+this.separator+"]*"),"")},onRealBlur:function(){this.list.hide();var b=this.getRawValue().split(RegExp(RegExp.escape(this.separator)+" *")),
g=[],i=this.store.snapshot||this.store.data;Ext.each(b,function(j){i.each(function(r){j===r.get(this.displayField)&&g.push(r.get(this.valueField))},this)},this);this.setValue(g.join(this.separator));this.store.clearFilter()},beforeBlur:Ext.emptyFn,onSelect:function(b,g){if(this.fireEvent("beforeselect",this,b,g)!==false){b.set(this.checkField,!b.get(this.checkField));this.store.isFiltered()&&this.doQuery(this.allQuery);this.setValue(this.getCheckedValue());this.fireEvent("select",this,b,g)}},setValue:function(b){if(b){b=
""+b;if(this.valueField){this.store.clearFilter();this.store.each(function(g){var i=!!b.match("(^|"+this.separator+")"+RegExp.escape(g.get(this.valueField))+"("+this.separator+"|$)");g.set(this.checkField,i)},this);this.value=this.getCheckedValue();this.setRawValue(this.getCheckedDisplay());if(this.hiddenField)this.hiddenField.value=this.value}else{this.value=b;this.setRawValue(b);if(this.hiddenField)this.hiddenField.value=b}this.el&&this.el.removeClass(this.emptyClass)}else this.clearValue()},selectAll:function(){this.store.each(function(b){b.set(this.checkField,
true)},this);this.doQuery(this.allQuery);this.setValue(this.getCheckedValue())},deselectAll:function(){this.clearValue()}});Ext.reg("lovcombo",Ext.ux.form.LovCombo);Ext.namespace("Ext.ux");
Ext.ux.MDHash=function(b,g,i,j){function r(h,n){var a=(h&65535)+(n&65535);return(h>>16)+(n>>16)+(a>>16)<<16|a&65535}function q(h,n,a,c,d,e){h=r(r(n,h),r(c,e));return r(h<<d|h>>>32-d,a)}function t(h,n,a,c,d,e,f){return q(n&a|~n&c,h,n,d,e,f)}function s(h,n,a,c,d,e,f){return q(n&c|a&~c,h,n,d,e,f)}function l(h,n,a,c,d,e,f){return q(a^(n|~c),h,n,d,e,f)}function o(h,n){h[n>>5]|=128<<n%32;h[(n+64>>>9<<4)+14]=n;for(var a=1732584193,c=-271733879,d=-1732584194,e=271733878,f=0;f<h.length;f+=16){var k=a,p=c,
m=d,u=e;a=t(a,c,d,e,h[f+0],7,-680876936);e=t(e,a,c,d,h[f+1],12,-389564586);d=t(d,e,a,c,h[f+2],17,606105819);c=t(c,d,e,a,h[f+3],22,-1044525330);a=t(a,c,d,e,h[f+4],7,-176418897);e=t(e,a,c,d,h[f+5],12,1200080426);d=t(d,e,a,c,h[f+6],17,-1473231341);c=t(c,d,e,a,h[f+7],22,-45705983);a=t(a,c,d,e,h[f+8],7,1770035416);e=t(e,a,c,d,h[f+9],12,-1958414417);d=t(d,e,a,c,h[f+10],17,-42063);c=t(c,d,e,a,h[f+11],22,-1990404162);a=t(a,c,d,e,h[f+12],7,1804603682);e=t(e,a,c,d,h[f+13],12,-40341101);d=t(d,e,a,c,h[f+14],
17,-1502002290);c=t(c,d,e,a,h[f+15],22,1236535329);a=s(a,c,d,e,h[f+1],5,-165796510);e=s(e,a,c,d,h[f+6],9,-1069501632);d=s(d,e,a,c,h[f+11],14,643717713);c=s(c,d,e,a,h[f+0],20,-373897302);a=s(a,c,d,e,h[f+5],5,-701558691);e=s(e,a,c,d,h[f+10],9,38016083);d=s(d,e,a,c,h[f+15],14,-660478335);c=s(c,d,e,a,h[f+4],20,-405537848);a=s(a,c,d,e,h[f+9],5,568446438);e=s(e,a,c,d,h[f+14],9,-1019803690);d=s(d,e,a,c,h[f+3],14,-187363961);c=s(c,d,e,a,h[f+8],20,1163531501);a=s(a,c,d,e,h[f+13],5,-1444681467);e=s(e,a,c,d,
h[f+2],9,-51403784);d=s(d,e,a,c,h[f+7],14,1735328473);c=s(c,d,e,a,h[f+12],20,-1926607734);a=q(c^d^e,a,c,h[f+5],4,-378558);e=q(a^c^d,e,a,h[f+8],11,-2022574463);d=q(e^a^c,d,e,h[f+11],16,1839030562);c=q(d^e^a,c,d,h[f+14],23,-35309556);a=q(c^d^e,a,c,h[f+1],4,-1530992060);e=q(a^c^d,e,a,h[f+4],11,1272893353);d=q(e^a^c,d,e,h[f+7],16,-155497632);c=q(d^e^a,c,d,h[f+10],23,-1094730640);a=q(c^d^e,a,c,h[f+13],4,681279174);e=q(a^c^d,e,a,h[f+0],11,-358537222);d=q(e^a^c,d,e,h[f+3],16,-722521979);c=q(d^e^a,c,d,h[f+
6],23,76029189);a=q(c^d^e,a,c,h[f+9],4,-640364487);e=q(a^c^d,e,a,h[f+12],11,-421815835);d=q(e^a^c,d,e,h[f+15],16,530742520);c=q(d^e^a,c,d,h[f+2],23,-995338651);a=l(a,c,d,e,h[f+0],6,-198630844);e=l(e,a,c,d,h[f+7],10,1126891415);d=l(d,e,a,c,h[f+14],15,-1416354905);c=l(c,d,e,a,h[f+5],21,-57434055);a=l(a,c,d,e,h[f+12],6,1700485571);e=l(e,a,c,d,h[f+3],10,-1894986606);d=l(d,e,a,c,h[f+10],15,-1051523);c=l(c,d,e,a,h[f+1],21,-2054922799);a=l(a,c,d,e,h[f+8],6,1873313359);e=l(e,a,c,d,h[f+15],10,-30611744);d=
l(d,e,a,c,h[f+6],15,-1560198380);c=l(c,d,e,a,h[f+13],21,1309151649);a=l(a,c,d,e,h[f+4],6,-145523070);e=l(e,a,c,d,h[f+11],10,-1120210379);d=l(d,e,a,c,h[f+2],15,718787259);c=l(c,d,e,a,h[f+9],21,-343485551);a=r(a,k);c=r(c,p);d=r(d,m);e=r(e,u)}return[a,c,d,e]}function w(h){for(var n=[],a=(1<<j)-1,c=0;c<h.length*j;c+=j)n[c>>5]|=(h.charCodeAt(c/j)&a)<<c%32;return n}function v(h){for(var n="",a=(1<<j)-1,c=0;c<h.length*32;c+=j)n+=String.fromCharCode(h[c>>5]>>>c%32&a);return n}function x(h){for(var n=i?"0123456789ABCDEF":
"0123456789abcdef",a="",c=0;c<h.length*4;c++)a+=n.charAt(h[c>>2]>>c%4*8+4&15)+n.charAt(h[c>>2]>>c%4*8&15);return a}g=g||false;i=i||false;j=j||8;return g?v(o(w(b),b.length*j)):x(o(w(b),b.length*j))};
Ext.ux.form.TinyMCETextArea=Ext.extend(Ext.form.TextArea,{wysiwygIntialized:false,intializationInProgress:false,lastHeight:null,lastFrameHeight:null,noWysiwyg:false,tinyMCEConfig:{},editor:undefined,disableEditor:false,constructor:function(b){b=b||{};Ext.applyIf(b,{hideMode:"offsets"});Ext.ux.form.TinyMCETextArea.superclass.constructor.call(this,b)},afterRender:function(){var b=this;Ext.ux.form.TinyMCETextArea.superclass.afterRender.call(this,arguments);b.on("blur",function(){var g=document.getElementById(b.getInputId());
if(b.wysiwygIntialized){var i=b.getEditor();if(i&&i.isHidden()){if(g)b.positionBeforeBlur={start:g.selectionStart,end:g.selectionEnd};i.load()}}else if(g)b.positionBeforeBlur={start:g.selectionStart,end:g.selectionEnd}},b);b.on("resize",function(g,i,j){!b.noWysiwyg&&!b.wysiwygIntialized?b.initEditor():b.syncEditorHeight(j)},b)},syncEditorHeight:function(b){this.lastHeight=b;if(this.wysiwygIntialized&&this.rendered){var g=tinymce.get(this.getInputId());if(g)if(!g.isHidden()){g=Ext.get(this.getInputId()+
"_ifr");var i=g.up(".mce-edit-area");i=i.up(".mce-container-body");b=b;var j=i.down(".mce-toolbar-grp");if(j)b-=j.getHeight();if(j=i.down(".mce-menubar"))b-=j.getHeight();if(i=i.down(".mce-statusbar"))b-=i.getHeight();this.lastFrameHeight=b-3;g.setHeight(b-3)}}},withEd:function(b){var g=this,i=this.getEditor();if(i)if(i.initialized){if(i.initialized){g.editor=i;b.call(g)}}else i.on("init",function(){g.withEd(b)},g)},getInputId:function(){return this.inputId||(this.inputId=this.id)},isDisabled:function(){return this.disabled},
insertAtCursor:function(b){var g=this.getEditor();g.execCommand("mceInsertContent",false,b);g.undoManager.clear()},initEditor:function(){var b=this;if(!(b.noWysiwyg||b.intializationInProgress||b.wysiwygIntialized)){b.intializationInProgress=true;if(b.tinyMCEConfig){var g=b.tinyMCEConfig;b.tinyMCEConfig={};b.tinyMCEConfig=Ext.clone(g)}else b.tinyMCEConfig={};b.tinyMCEConfig.mode="exact";b.tinyMCEConfig.resize=false;b.tinyMCEConfig.selector="textarea#"+b.getInputId();b.tinyMCEConfig.height=b.lastFrameHeight?
b.lastFrameHeight:30;var i=null;if(b.tinyMCEConfig.setup)i=b.tinyMCEConfig.setup;b.tinyMCEConfig.setup=function(j){if(!Ext.isDefined(b.editor))b.editor=j;j.on("init",function(){b.wysiwygIntialized=true;b.intializationInProgress=false;if(b.disableEditor||b.isDisabled())b.disable();b.fireEvent("initialized",b,j,{});if(b.lastHeight||b.height)setTimeout(function(){b.syncEditorHeight(b.lastHeight||b.height)},400)});i&&i(j)};tinymce.init(b.tinyMCEConfig);b.intializationInProgress=false;b.wysiwygIntialized=
true}},getEditor:function(){return tinymce.get(this.getInputId())},isEditorHidden:function(){if(!this.wysiwygIntialized)return true;var b=this.getEditor();if(!b)return true;return b.isHidden()},showEditor:function(){this.storedCursorPosition=null;if(this.wysiwygIntialized){var b=this.getEditor();if(b){b.show();b.nodeChanged();this.lastHeight&&this.syncEditorHeight(this.lastHeight)}}else{this.noWysiwyg=false;this.initEditor()}},hideEditor:function(){if(this.wysiwygIntialized){var b=this.getEditor();
if(b){var g=b.selection.getNode();if(!g||g.nodeName==="#document"||g.nodeName==="BODY"||g.nodeName==="body")b.hide();else{b.selection.collapse(true);b.execCommand("mceInsertContent",0,'<a id="_____sys__11223___"></a>');b.hide();b=document.getElementById(this.getInputId());g=-1;var i="";if(b){i=b.value;g=i.indexOf('<a id="_____sys__11223___"></a>')}if(g!==-1){var j=RegExp('<a id="_____sys__11223___"></a>',"g");i=i.replace(j,"");b.value=i;if(b.setSelectionRange){b.focus();b.setSelectionRange(g,g)}}}}}},
toggleEditor:function(){if(this.wysiwygIntialized)this.getEditor().isHidden()?this.showEditor():this.hideEditor();else this.showEditor()},removeEditor:function(){if(this.intializationInProgress)return this;if(!this.wysiwygIntialized)return this;var b=this.getEditor();if(b){b.save();b.destroy(false)}this.wysiwygIntialized=false;return this},setValue:function(b){var g=this;if(g.wysiwygIntialized)if(this.value!==b){this.value=b;if(this.rendered){var i=g.getEditor();i?g.setContent(i,b):tinyMCE.EditorManager.on("AddEditor",
function(){g.withEd(function(){var j=g.getEditor();g.setContent(j,b)})},this)}}return this.value},setContent:function(b,g){b.setContent(g===null||g===undefined?"":g,{format:"raw"});b.startContent=b.getContent({format:"raw"})},getValue:function(){var b=this.getEditor();if(b){if(!this.rendered||!b.initialized)return Ext.value(this.value,"");b=b.getContent();if(b===this.emptyText||b===undefined)b="";return b}},getRawValue:function(){var b=this.getEditor();if(b){if(!this.rendered||!b.initialized)return Ext.value(this.value,
"");b=b.getContent({format:"raw"});if(b===this.emptyText)b="";return b}},initValue:function(){if(this.rendered)if(this.value!==undefined)this.setValue(this.value);else{var b=this.getEl().value;b&&this.setValue(b)}else Ext.ux.TinyMCE.superclass.initValue.call(this)},focus:function(b,g){var i=this;if(i.isDisabled())return i;if(g){if(isNaN(g))g=10;setTimeout(function(){i.focus.call(i,b,false)},g);return i}if(!i.wysiwygIntialized)return Ext.ux.form.TinyMCETextArea.superclass.focus.call(this,arguments);
var j=i.getEditor();if(j&&!j.isHidden()){Ext.ux.form.TinyMCETextArea.superclass.focus.call(this,arguments);j.focus()}else return Ext.ux.form.TinyMCETextArea.superclass.focus.call(this,arguments);return i},enable:function(){var b=Ext.ux.form.TinyMCETextArea.superclass.enable.call(this,arguments);if(!b)return b;if(b=this.getEditor()){b.theme.panel.find("*").disabled(false);this.getEditorBody().setAttribute("contenteditable",true)}return this},disable:function(){var b=Ext.ux.form.TinyMCETextArea.superclass.disable.call(this,
arguments);if(!b)return b;if(b=this.getEditor()){b.theme.panel.find("*").disabled(true);this.getEditorBody().setAttribute("contenteditable",false)}return this},hide:function(){var b=this;Ext.ux.form.TinyMCETextArea.superclass.hide.call(this,arguments);var g=b.getEditor();g?g.hide():tinyMCE.EditorManager.on("AddEditor",function(){b.withEd(function(){b.getEditor().hide()})},this);return b},show:function(){Ext.ux.form.TinyMCETextArea.superclass.show.call(this,arguments);var b=this.getEditor();b&&b.show();
return this},storeCurrentSelection:function(){var b=false,g=this.getEditor();if(this.wysiwygIntialized)if(g&&!g.isHidden())b=true;var i=document.getElementById(this.getInputId());if(b)this.storedCursorPosition=g.selection.getBookmark("simple");else if(i)this.storedCursorPosition=this.positionBeforeBlur},restoreCurrentSelection:function(){if(this.storedCursorPosition){var b=false,g=this.getEditor();if(this.wysiwygIntialized)if(g&&!g.isHidden())b=true;var i=document.getElementById(this.getInputId());
if(b)g.selection.moveToBookmark(this.storedCursorPosition);else i&&i.setSelectionRange(this.storedCursorPosition.start,this.storedCursorPosition.end)}},insertText:function(b){var g=false,i=this.getEditor();if(this.wysiwygIntialized)if(i&&!i.isHidden())g=true;var j=document.getElementById(this.getInputId());if(g){i.focus();i.execCommand("mceInsertContent",0,b)}else if(j){j.focus();g=j.selectionStart+b.length;j.value=j.value.slice(0,j.selectionStart)+b+j.value.slice(j.selectionEnd);j.setSelectionRange(g,
g)}}});Ext.reg("zarafa.tinymcetextarea",Ext.ux.form.TinyMCETextArea);var XRegExp;if(XRegExp)throw Error("can't load XRegExp twice in the same frame");
(function(){function b(a,c){if(!XRegExp.isRegExp(a))throw TypeError("type RegExp expected");var d=a._xregexp;a=XRegExp(a.source,g(a)+(c||""));if(d)a._xregexp={source:d.source,captureNames:d.captureNames?d.captureNames.slice(0):null};return a}function g(a){return(a.global?"g":"")+(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.extended?"x":"")+(a.sticky?"y":"")}function i(a,c,d,e){var f=l.length,k,p,m;s=true;try{for(;f--;){m=l[f];if(d&m.scope&&(!m.trigger||m.trigger.call(e))){m.pattern.lastIndex=c;if((p=
m.pattern.exec(a))&&p.index===c){k={output:m.handler.call(e,p,d),match:p};break}}}}catch(u){throw u;}finally{s=false}return k}function j(a,c,d){if(Array.prototype.indexOf)return a.indexOf(c,d);for(d=d||0;d<a.length;d++)if(a[d]===c)return d;return-1}XRegExp=function(a,c){var d=[],e=XRegExp.OUTSIDE_CLASS,f=0,k,p;if(XRegExp.isRegExp(a)){if(c!==undefined)throw TypeError("can't supply flags when constructing one RegExp from another");return b(a)}if(s)throw Error("can't call the XRegExp constructor within token definition functions");
c=c||"";for(k={hasNamedCapture:false,captureNames:[],hasFlag:function(m){return c.indexOf(m)>-1},setFlag:function(m){c+=m}};f<a.length;)if(p=i(a,f,e,k)){d.push(p.output);f+=p.match[0].length||1}else if(p=o.exec.call(n[e],a.slice(f))){d.push(p[0]);f+=p[0].length}else{p=a.charAt(f);if(p==="[")e=XRegExp.INSIDE_CLASS;else if(p==="]")e=XRegExp.OUTSIDE_CLASS;d.push(p);f++}d=RegExp(d.join(""),o.replace.call(c,q,""));d._xregexp={source:a,captureNames:k.hasNamedCapture?k.captureNames:null};return d};XRegExp.version=
"1.5.0";XRegExp.INSIDE_CLASS=1;XRegExp.OUTSIDE_CLASS=2;var r=/\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g,q=/[^gimy]+|([\s\S])(?=[\s\S]*\1)/g,t=/^(?:[?*+]|{\d+(?:,\d*)?})\??/,s=false,l=[],o={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},w=o.exec.call(/()??/,"")[1]===undefined,v=function(){var a=/^/g;o.test.call(a,"");return!a.lastIndex}(),x=function(){var a=/x/g;o.replace.call("x",a,"");return!a.lastIndex}(),
h=RegExp.prototype.sticky!==undefined,n={};n[XRegExp.INSIDE_CLASS]=/^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/;n[XRegExp.OUTSIDE_CLASS]=/^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/;XRegExp.addToken=function(a,c,d,e){l.push({pattern:b(a,"g"+(h?"y":"")),handler:c,scope:d||XRegExp.OUTSIDE_CLASS,trigger:e||null})};XRegExp.cache=function(a,c){var d=a+"/"+(c||"");return XRegExp.cache[d]||
(XRegExp.cache[d]=XRegExp(a,c))};XRegExp.copyAsGlobal=function(a){return b(a,"g")};XRegExp.escape=function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};XRegExp.execAt=function(a,c,d,e){c=b(c,"g"+(e&&h?"y":""));c.lastIndex=d=d||0;a=c.exec(a);return e?a&&a.index===d?a:null:a};XRegExp.freezeTokens=function(){XRegExp.addToken=function(){throw Error("can't run addToken after freezeTokens");}};XRegExp.isRegExp=function(a){return Object.prototype.toString.call(a)==="[object RegExp]"};XRegExp.iterate=
function(a,c,d,e){for(var f=b(c,"g"),k=-1,p;p=f.exec(a);){d.call(e,p,++k,a,f);f.lastIndex===p.index&&f.lastIndex++}if(c.global)c.lastIndex=0};XRegExp.matchChain=function(a,c){return function d(e,f){var k=c[f].regex?c[f]:{regex:c[f]},p=b(k.regex,"g"),m=[],u;for(u=0;u<e.length;u++)XRegExp.iterate(e[u],p,function(y){m.push(k.backref?y[k.backref]||"":y[0])});return f===c.length-1||!m.length?m:d(m,f+1)}([a],0)};RegExp.prototype.apply=function(a,c){return this.exec(c[0])};RegExp.prototype.call=function(a,
c){return this.exec(c)};RegExp.prototype.exec=function(a){var c=o.exec.apply(this,arguments),d;if(c){if(!w&&c.length>1&&j(c,"")>-1){d=RegExp(this.source,o.replace.call(g(this),"g",""));o.replace.call(a.slice(c.index),d,function(){for(var f=1;f<arguments.length-2;f++)if(arguments[f]===undefined)c[f]=undefined})}if(this._xregexp&&this._xregexp.captureNames)for(var e=1;e<c.length;e++)if(d=this._xregexp.captureNames[e-1])c[d]=c[e];!v&&this.global&&!c[0].length&&this.lastIndex>c.index&&this.lastIndex--}return c};
if(!v)RegExp.prototype.test=function(a){(a=o.exec.call(this,a))&&this.global&&!a[0].length&&this.lastIndex>a.index&&this.lastIndex--;return!!a};String.prototype.match=function(a){XRegExp.isRegExp(a)||(a=RegExp(a));if(a.global){var c=o.match.apply(this,arguments);a.lastIndex=0;return c}return a.exec(this)};String.prototype.replace=function(a,c){var d=XRegExp.isRegExp(a),e,f;if(d&&typeof c.valueOf()==="string"&&c.indexOf("${")===-1&&x)return o.replace.apply(this,arguments);if(d){if(a._xregexp)e=a._xregexp.captureNames}else a+=
"";if(typeof c==="function")f=o.replace.call(this,a,function(){if(e){arguments[0]=new String(arguments[0]);for(var k=0;k<e.length;k++)if(e[k])arguments[0][e[k]]=arguments[k+1]}if(d&&a.global)a.lastIndex=arguments[arguments.length-2]+arguments[0].length;return c.apply(null,arguments)});else{f=this+"";f=o.replace.call(f,a,function(){var k=arguments;return o.replace.call(c,r,function(p,m,u){if(m)switch(m){case "$":return"$";case "&":return k[0];case "`":return k[k.length-1].slice(0,k[k.length-2]);case "'":return k[k.length-
1].slice(k[k.length-2]+k[0].length);default:u="";m=+m;if(!m)return p;for(;m>k.length-3;){u=String.prototype.slice.call(m,-1)+u;m=Math.floor(m/10)}return(m?k[m]||"":"$")+u}else{m=+u;if(m<=k.length-3)return k[m];m=e?j(e,u):-1;return m>-1?k[m+1]:p}})})}if(d&&a.global)a.lastIndex=0;return f};String.prototype.split=function(a,c){if(!XRegExp.isRegExp(a))return o.split.apply(this,arguments);var d=this+"",e=[],f=0,k,p;if(c===undefined||+c<0)c=Infinity;else{c=Math.floor(+c);if(!c)return[]}for(a=XRegExp.copyAsGlobal(a);k=
a.exec(d);){if(a.lastIndex>f){e.push(d.slice(f,k.index));k.length>1&&k.index<d.length&&Array.prototype.push.apply(e,k.slice(1));p=k[0].length;f=a.lastIndex;if(e.length>=c)break}a.lastIndex===k.index&&a.lastIndex++}if(f===d.length){if(!o.test.call(a,"")||p)e.push("")}else e.push(d.slice(f));return e.length>c?e.slice(0,c):e};XRegExp.addToken(/\(\?#[^)]*\)/,function(a){return o.test.call(t,a.input.slice(a.index+a[0].length))?"":"(?:)"});XRegExp.addToken(/\((?!\?)/,function(){this.captureNames.push(null);
return"("});XRegExp.addToken(/\(\?<([$\w]+)>/,function(a){this.captureNames.push(a[1]);this.hasNamedCapture=true;return"("});XRegExp.addToken(/\\k<([\w$]+)>/,function(a){var c=j(this.captureNames,a[1]);return c>-1?"\\"+(c+1)+(isNaN(a.input.charAt(a.index+a[0].length))?"":"(?:)"):a[0]});XRegExp.addToken(/\[\^?]/,function(a){return a[0]==="[]"?"\\b\\B":"[\\s\\S]"});XRegExp.addToken(/^\(\?([imsx]+)\)/,function(a){this.setFlag(a[1]);return""});XRegExp.addToken(/(?:\s+|#.*)+/,function(a){return o.test.call(t,
a.input.slice(a.index+a[0].length))?"":"(?:)"},XRegExp.OUTSIDE_CLASS,function(){return this.hasFlag("x")});XRegExp.addToken(/\./,function(){return"[\\s\\S]"},XRegExp.OUTSIDE_CLASS,function(){return this.hasFlag("s")})})();if(!XRegExp)throw ReferenceError("XRegExp must be loaded before the Unicode plugin");
(function(){var b={};XRegExp.addUnicodePackage=function(g){var i=/\w{4}/g,j=/[- _]+/g,r,q;for(q in g)if(g.hasOwnProperty(q)){r=q.replace(j,"").toLowerCase();b.hasOwnProperty(r)||(b[r]=g[q].replace(i,"\\u$&"))}};XRegExp.addToken(/\\([pP]){(\^?)([^}]*)}/,function(g,i){var j=g[1]==="P"||g[2],r=g[3].replace(/[- _]+/g,"").toLowerCase();if(g[1]==="P"&&g[2])throw SyntaxError("erroneous characters: "+g[0]);if(j&&i===XRegExp.INSIDE_CLASS)throw SyntaxError("not supported in character classes: \\"+g[1]+"{"+
g[2]+"...}");if(!b.hasOwnProperty(r))throw SyntaxError("invalid or unsupported Unicode item: "+g[0]);return i===XRegExp.OUTSIDE_CLASS?"["+(j?"^":"")+b[r]+"]":b[r]},XRegExp.INSIDE_CLASS|XRegExp.OUTSIDE_CLASS);XRegExp.addUnicodePackage({L:"0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC"})})();
