/*
 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
*/
var XRegExp;if(XRegExp)throw Error("can't load XRegExp twice in the same frame");
(function(){function d(a,b){if(!XRegExp.isRegExp(a))throw TypeError("type RegExp expected");var c=a._xregexp;a=XRegExp(a.source,i(a)+(b||""));if(c)a._xregexp={source:c.source,captureNames:c.captureNames?c.captureNames.slice(0):null};return a}function i(a){return(a.global?"g":"")+(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.extended?"x":"")+(a.sticky?"y":"")}function m(a,b,c,f){var e=l.length,g,j,h;u=true;try{for(;e--;){h=l[e];if(c&h.scope&&(!h.trigger||h.trigger.call(f))){h.pattern.lastIndex=b;if((j=
h.pattern.exec(a))&&j.index===b){g={output:h.handler.call(f,j,c),match:j};break}}}}catch(o){throw o;}finally{u=false}return g}function p(a,b,c){if(Array.prototype.indexOf)return a.indexOf(b,c);for(c=c||0;c<a.length;c++)if(a[c]===b)return c;return-1}XRegExp=function(a,b){var c=[],f=XRegExp.OUTSIDE_CLASS,e=0,g,j;if(XRegExp.isRegExp(a)){if(b!==undefined)throw TypeError("can't supply flags when constructing one RegExp from another");return d(a)}if(u)throw Error("can't call the XRegExp constructor within token definition functions");
b=b||"";for(g={hasNamedCapture:false,captureNames:[],hasFlag:function(h){return b.indexOf(h)>-1},setFlag:function(h){b+=h}};e<a.length;)if(j=m(a,e,f,g)){c.push(j.output);e+=j.match[0].length||1}else if(j=k.exec.call(v[f],a.slice(e))){c.push(j[0]);e+=j[0].length}else{j=a.charAt(e);if(j==="[")f=XRegExp.INSIDE_CLASS;else if(j==="]")f=XRegExp.OUTSIDE_CLASS;c.push(j);e++}c=RegExp(c.join(""),k.replace.call(b,r,""));c._xregexp={source:a,captureNames:g.hasNamedCapture?g.captureNames:null};return c};XRegExp.version=
"1.5.0";XRegExp.INSIDE_CLASS=1;XRegExp.OUTSIDE_CLASS=2;var n=/\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g,r=/[^gimy]+|([\s\S])(?=[\s\S]*\1)/g,w=/^(?:[?*+]|{\d+(?:,\d*)?})\??/,u=false,l=[],k={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},t=k.exec.call(/()??/,"")[1]===undefined,s=function(){var a=/^/g;k.test.call(a,"");return!a.lastIndex}(),x=function(){var a=/x/g;k.replace.call("x",a,"");return!a.lastIndex}(),
q=RegExp.prototype.sticky!==undefined,v={};v[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]))/;v[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,b,c,f){l.push({pattern:d(a,"g"+(q?"y":"")),handler:b,scope:c||XRegExp.OUTSIDE_CLASS,trigger:f||null})};XRegExp.cache=function(a,b){var c=a+"/"+(b||"");return XRegExp.cache[c]||
(XRegExp.cache[c]=XRegExp(a,b))};XRegExp.copyAsGlobal=function(a){return d(a,"g")};XRegExp.escape=function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};XRegExp.execAt=function(a,b,c,f){b=d(b,"g"+(f&&q?"y":""));b.lastIndex=c=c||0;a=b.exec(a);return f?a&&a.index===c?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,b,c,f){for(var e=d(b,"g"),g=-1,j;j=e.exec(a);){c.call(f,j,++g,a,e);e.lastIndex===j.index&&e.lastIndex++}if(b.global)b.lastIndex=0};XRegExp.matchChain=function(a,b){return function c(f,e){var g=b[e].regex?b[e]:{regex:b[e]},j=d(g.regex,"g"),h=[],o;for(o=0;o<f.length;o++)XRegExp.iterate(f[o],j,function(y){h.push(g.backref?y[g.backref]||"":y[0])});return e===b.length-1||!h.length?h:c(h,e+1)}([a],0)};RegExp.prototype.apply=function(a,b){return this.exec(b[0])};RegExp.prototype.call=function(a,
b){return this.exec(b)};RegExp.prototype.exec=function(a){var b=k.exec.apply(this,arguments),c;if(b){if(!t&&b.length>1&&p(b,"")>-1){c=RegExp(this.source,k.replace.call(i(this),"g",""));k.replace.call(a.slice(b.index),c,function(){for(var e=1;e<arguments.length-2;e++)if(arguments[e]===undefined)b[e]=undefined})}if(this._xregexp&&this._xregexp.captureNames)for(var f=1;f<b.length;f++)if(c=this._xregexp.captureNames[f-1])b[c]=b[f];!s&&this.global&&!b[0].length&&this.lastIndex>b.index&&this.lastIndex--}return b};
if(!s)RegExp.prototype.test=function(a){(a=k.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 b=k.match.apply(this,arguments);a.lastIndex=0;return b}return a.exec(this)};String.prototype.replace=function(a,b){var c=XRegExp.isRegExp(a),f,e;if(c&&typeof b.valueOf()==="string"&&b.indexOf("${")===-1&&x)return k.replace.apply(this,arguments);if(c){if(a._xregexp)f=a._xregexp.captureNames}else a+=
"";if(typeof b==="function")e=k.replace.call(this,a,function(){if(f){arguments[0]=new String(arguments[0]);for(var g=0;g<f.length;g++)if(f[g])arguments[0][f[g]]=arguments[g+1]}if(c&&a.global)a.lastIndex=arguments[arguments.length-2]+arguments[0].length;return b.apply(null,arguments)});else{e=this+"";e=k.replace.call(e,a,function(){var g=arguments;return k.replace.call(b,n,function(j,h,o){if(h)switch(h){case "$":return"$";case "&":return g[0];case "`":return g[g.length-1].slice(0,g[g.length-2]);case "'":return g[g.length-
1].slice(g[g.length-2]+g[0].length);default:o="";h=+h;if(!h)return j;for(;h>g.length-3;){o=String.prototype.slice.call(h,-1)+o;h=Math.floor(h/10)}return(h?g[h]||"":"$")+o}else{h=+o;if(h<=g.length-3)return g[h];h=f?p(f,o):-1;return h>-1?g[h+1]:j}})})}if(c&&a.global)a.lastIndex=0;return e};String.prototype.split=function(a,b){if(!XRegExp.isRegExp(a))return k.split.apply(this,arguments);var c=this+"",f=[],e=0,g,j;if(b===undefined||+b<0)b=Infinity;else{b=Math.floor(+b);if(!b)return[]}for(a=XRegExp.copyAsGlobal(a);g=
a.exec(c);){if(a.lastIndex>e){f.push(c.slice(e,g.index));g.length>1&&g.index<c.length&&Array.prototype.push.apply(f,g.slice(1));j=g[0].length;e=a.lastIndex;if(f.length>=b)break}a.lastIndex===g.index&&a.lastIndex++}if(e===c.length){if(!k.test.call(a,"")||j)f.push("")}else f.push(c.slice(e));return f.length>b?f.slice(0,b):f};XRegExp.addToken(/\(\?#[^)]*\)/,function(a){return k.test.call(w,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 b=p(this.captureNames,a[1]);return b>-1?"\\"+(b+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 k.test.call(w,
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("function"!==typeof RegExp.escape)RegExp.escape=function(d){if("string"!==typeof d)return d;return d.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 d=this.el.dom.value;this.el.dom.value="";this.el.dom.value=d}})},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(d){d.set(this.checkField,false)},this);if(this.hiddenField)this.hiddenField.value="";this.applyEmptyText()},getCheckedDisplay:function(){var d=RegExp(this.separator,
"g");return this.getCheckedValue(this.displayField).replace(d,this.separator+" ")},getCheckedValue:function(d){d=d||this.valueField;var i=[];(this.store.snapshot||this.store.data).each(function(m){m.get(this.checkField)&&i.push(m.get(d))},this);return i.join(this.separator)},onBeforeQuery:function(d){d.query=d.query.replace(RegExp(this.getCheckedDisplay()+"[ "+this.separator+"]*"),"")},onRealBlur:function(){this.list.hide();var d=this.getRawValue().split(RegExp(RegExp.escape(this.separator)+" *")),
i=[],m=this.store.snapshot||this.store.data;Ext.each(d,function(p){m.each(function(n){p===n.get(this.displayField)&&i.push(n.get(this.valueField))},this)},this);this.setValue(i.join(this.separator));this.store.clearFilter()},beforeBlur:Ext.emptyFn,onSelect:function(d,i){if(this.fireEvent("beforeselect",this,d,i)!==false){d.set(this.checkField,!d.get(this.checkField));this.store.isFiltered()&&this.doQuery(this.allQuery);this.setValue(this.getCheckedValue());this.fireEvent("select",this,d,i)}},setValue:function(d){if(d){d=
""+d;if(this.valueField){this.store.clearFilter();this.store.each(function(i){var m=!!d.match("(^|"+this.separator+")"+RegExp.escape(i.get(this.valueField))+"("+this.separator+"|$)");i.set(this.checkField,m)},this);this.value=this.getCheckedValue();this.setRawValue(this.getCheckedDisplay());if(this.hiddenField)this.hiddenField.value=this.value}else{this.value=d;this.setRawValue(d);if(this.hiddenField)this.hiddenField.value=d}this.el&&this.el.removeClass(this.emptyClass)}else this.clearValue()},selectAll:function(){this.store.each(function(d){d.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.IconDragSelector=function(d){function i(){s=[];l.all.each(function(a){s[s.length]=a.getRegion()});x=l.el.getRegion()}function m(){return false}function p(a){return!v||a.target==l.el.dom}function n(){l.on("containerclick",m,l,{single:true});if(k){k.dom.parentNode!==l.el.dom&&l.el.dom.appendChild(k.dom);k.setDisplayed("block")}else k=l.el.createChild({cls:"x-view-selector"});i();l.clearSelections()}function r(){var a=t.startXY,b=t.getXY(),c=Math.min(a[0],b[0]),f=Math.min(a[1],b[1]),e=Math.abs(a[0]-
b[0]);a=Math.abs(a[1]-b[1]);q.left=c;q.top=f;q.right=c+e;q.bottom=f+a;q.constrainTo(x);k.setRegion(q);c=0;for(f=s.length;c<f;c++){e=s[c];if((a=q.intersect(e))&&!e.selected){e.selected=true;l.select(c,true)}else if(!a&&e.selected){e.selected=false;l.deselect(c)}}}function w(){Ext.isIE||l.un("containerclick",m,l);k&&k.setDisplayed(false)}function u(a){t=new Ext.dd.DragTracker({onBeforeStart:p,onStart:n,onDrag:r,onEnd:w});t.initEl(a.el)}d=d||{};var l,k,t,s,x,q=new Ext.lib.Region(0,0,0,0),v=d.dragSafe===
true;this.init=function(a){l=a;l.on("render",u)}};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(d,i){Ext.ux.IconCombo.superclass.onRender.call(this,d,i);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 d=this.store.query(this.valueField,this.getValue()).itemAt(0);if(d&&this.icon)this.icon.className="ux-icon-combo-icon "+d.get(this.iconClsField)},setValue:function(d){Ext.ux.IconCombo.superclass.setValue.call(this,d);this.setIconCls()},clearValue:function(){Ext.ux.IconCombo.superclass.clearValue.call(this);if(this.icon)this.icon.className=
""}});Ext.reg("iconcombo",Ext.ux.IconCombo);if(!XRegExp)throw ReferenceError("XRegExp must be loaded before the Unicode plugin");
(function(){var d={};XRegExp.addUnicodePackage=function(i){var m=/\w{4}/g,p=/[- _]+/g,n,r;for(r in i)if(i.hasOwnProperty(r)){n=r.replace(p,"").toLowerCase();d.hasOwnProperty(n)||(d[n]=i[r].replace(m,"\\u$&"))}};XRegExp.addToken(/\\([pP]){(\^?)([^}]*)}/,function(i,m){var p=i[1]==="P"||i[2],n=i[3].replace(/[- _]+/g,"").toLowerCase();if(i[1]==="P"&&i[2])throw SyntaxError("erroneous characters: "+i[0]);if(p&&m===XRegExp.INSIDE_CLASS)throw SyntaxError("not supported in character classes: \\"+i[1]+"{"+
i[2]+"...}");if(!d.hasOwnProperty(n))throw SyntaxError("invalid or unsupported Unicode item: "+i[0]);return m===XRegExp.OUTSIDE_CLASS?"["+(p?"^":"")+d[n]+"]":d[n]},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"})})();
