function onShowNotification(){console.log("notification is shown!")}function onCloseNotification(){console.log("notification is closed!")}function onClickNotification(ev){console.log("notification was clicked!"),console.log(ev),window.location.href="https://brewer-vacations-admin.appspot.com/"+ev.currentTarget.data.cta}function onErrorNotification(){console.error("Error showing notification. You may need to request permission.")}function onPermissionGranted(){console.log("Permission has been granted by the user"),window.DESKTOP_NOTIFICATIONS_ENABLED=!0}function onPermissionDenied(){console.warn("Permission has been denied by the user"),window.DESKTOP_NOTIFICATIONS_ENABLED=!1}function doNotification(notification){Sound.volume=1,Sound.play();var notificationConfig={title:notification.title,notification:{badge:1,body:notification.body,tag:"new message",icon:"",notifyShow:onShowNotification,notifyClose:onCloseNotification,notifyClick:onClickNotification,notifyError:onErrorNotification,timeout:5,data:{cta:"chat"}}};new Notify(notificationConfig.title,notificationConfig.notification).show()}!function(a,b){"use strict";function c(a){if(!("clientX"in a||"clientY"in a)){var b=a.touches||a.originalEvent.touches;b&&b.length&&(a.clientX=b[0].clientX,a.clientY=b[0].clientY),a.preventDefault()}}function d(a){if(a=a[0],a.previousElementSibling)return b.element(a.previousElementSibling);for(var c=a.previousSibling;null!=c&&1!=c.nodeType;)c=c.previousSibling;return b.element(c)}function e(a,b){var c=d(a);c.length>0?c.after(b):a.parent().prepend(b)}function f(a,c){if(a instanceof b.element&&(a=a[0]),null!==i)return a[i](c)}var g=b.module("angular-sortable-view",[]);g.directive("svRoot",[function(){function a(a,b,c){return c?a.x-b.x<0:a.y-b.y<0}function b(a){return i[a]}function c(a){delete i[a]}function d(a){return[{x:a.left,y:a.top},{x:a.left+a.width,y:a.top},{x:a.left,y:a.top+a.height},{x:a.left+a.width,y:a.top+a.height},{x:a.left+a.width/2,y:a.top+a.height/2}]}function g(a,b){return a.x>=b[0].x&&a.x<=b[1].x&&a.y>=b[0].y&&a.y<=b[2].y?0:Math.min.apply(Math,b.map(function(b){return(b.x-a.x)*(b.x-a.x)+(b.y-a.y)*(b.y-a.y)}))}var h,i=Object.create(null);return{restrict:"A",controller:["$scope","$attrs","$interpolate","$parse",function(j,k,l,m){var n=l(k.svRoot)(j)||j.$id;i[n]||(i[n]=[]);var o,p,q,r,s,t,u=!1,v=m(k.svOnSort);k.svOnStart=k.$$element[0].attributes["sv-on-start"],k.svOnStart=k.svOnStart&&k.svOnStart.value,k.svOnStop=k.$$element[0].attributes["sv-on-stop"],k.svOnStop=k.svOnStop&&k.svOnStop.value;var w=m(k.svOnStart),x=m(k.svOnStop);if(this.sortingInProgress=function(){return h},k.svGrid){if(null===(u="true"===k.svGrid||"false"!==k.svGrid&&null))throw"Invalid value of sv-grid attribute"}else j.$watchCollection(function(){return b(n)},function(a){u=!1;var b=a.filter(function(a){return!a.container}).map(function(a){return{part:a.getPart().id,y:a.element[0].getBoundingClientRect().top}}),c=Object.create(null);b.forEach(function(a){c[a.part]?c[a.part].push(a.y):c[a.part]=[a.y]}),Object.keys(c).forEach(function(a){c[a].sort(),c[a].forEach(function(b,d){d0&&b===c[a][d+1]&&(u=!0)})})});this.$moveUpdate=function(c,i,k,l,m,v,x){var y=k[0].getBoundingClientRect();"element"===c.tolerance&&(i={x:~~(y.left+y.width/2),y:~~(y.top+y.height/2)}),h=!0,o=[],p||(m?(p=m.clone(),p.removeClass("ng-hide")):(p=l.clone(),p.addClass("sv-visibility-hidden"),p.addClass("sv-placeholder"),p.css({height:y.height+"px",width:y.width+"px"})),l.after(p),v.copyMode||l.addClass("ng-hide"),s=l,q=c,r=k,w(j,{$helper:{element:r},$part:v.model(v.scope),$index:x,$item:v.model(v.scope)[x]}),j.$root&&j.$root.$$phase||j.$apply()),r[0].reposition({x:i.x+document.body.scrollLeft-i.offset.x*y.width,y:i.y+document.body.scrollTop-i.offset.y*y.height}),b(n).forEach(function(b,e){if(null==c.containment||f(b.element,c.containment)||f(b.element,c.containment+" *")){var h=b.element[0].getBoundingClientRect(),j=d(h),k={x:~~(h.left+h.width/2),y:~~(h.top+h.height/2)},l={x:~~(h.left+h.width/2),y:~~h.top},m={x:~~h.left,y:~~(h.top+h.height/2)};if(!b.container&&(b.element[0].scrollHeight||b.element[0].scrollWidth)){var n=b.getPart();o.push({element:b.element,q:g(i,j),view:n,targetIndex:b.getIndex(),after:a(k,i,"isGrid"in n?n.isGrid:u)})}if(b.container&&!b.element[0].querySelector("[sv-element]:not(.sv-placeholder):not(.sv-source)")){var p=k;"vertical"===b.centerVariant?p=m:"horizontal"===b.centerVariant&&(p=l),o.push({element:b.element,q:(p.x-i.x)*(p.x-i.x)+(p.y-i.y)*(p.y-i.y),view:b.getPart(),targetIndex:0,container:!0})}}});var z=p[0].getBoundingClientRect();o.push({q:g(i,d(z)),element:p,placeholder:!0}),o.sort(function(a,b){return a.q-b.q}),o.forEach(function(a,b){0!==b||a.placeholder||a.container?0===b&&a.container?(t=a,a.element.append(p)):a.element.removeClass("sv-candidate"):(t=a,a.element.addClass("sv-candidate"),a.after?a.element.after(p):e(a.element,p))})},this.$drop=function(a,b,c){function d(){if(h=!1,p.remove(),r.remove(),s.removeClass("ng-hide"),o=void 0,p=void 0,c=void 0,r=void 0,s=void 0,x(j,{$part:a.model(a.scope),$index:b,$item:a.model(a.scope)[b]}),t){t.element.removeClass("sv-candidate");var d=a.model(a.scope).splice(b,1),e=t.targetIndex;t.view===a&&t.targetIndex>b&&e--,t.after&&e++,t.view.model(t.view.scope).splice(e,0,d[0]),t.view===a&&b===e||v(j,{$partTo:t.view.model(t.view.scope),$partFrom:a.model(a.scope),$item:d[0],$indexTo:e,$indexFrom:b})}t=void 0,j.$root&&j.$root.$$phase||j.$apply()}if(p)if(!c.revert||t&&t.view&&t.view.noRevert)d();else{var e=p[0].getBoundingClientRect(),f=r[0].getBoundingClientRect(),g=Math.sqrt(Math.pow(f.top-e.top,2)+Math.pow(f.left-e.left,2)),i=+c.revert*g/200;i=Math.min(i,+c.revert),["-webkit-","-moz-","-ms-","-o-",""].forEach(function(a){void 0!==r[0].style[a+"transition"]&&(r[0].style[a+"transition"]="all "+i+"ms ease")}),setTimeout(d,i),r.css({top:e.top+document.body.scrollTop+"px",left:e.left+document.body.scrollLeft+"px"})}},this.addToSortableElements=function(a){b(n).push(a)},this.removeFromSortableElements=function(a){var d=b(n),e=d.indexOf(a);e>-1&&(d.splice(e,1),0===d.length&&c(n))}}]}}]),g.directive("svPart",["$parse",function(a){return{restrict:"A",require:"^svRoot",controller:["$scope",function(a){a.$ctrl=this,this.getPart=function(){return a.part},this.$drop=function(b,c){a.$sortableRoot.$drop(a.part,b,c)}}],scope:!0,link:function(b,c,d,e){if(!d.svPart)throw new Error("no model provided");var f=a(d.svPart);if(!f.assign)throw new Error("model not assignable");b.part={id:b.$id,element:c,model:f,copyMode:"true"===d.svCopy,noRevert:"true"===d.svNoRevert,scope:b},"isGrid"in d&&(b.part.isGrid="true"===d.isGrid),b.$sortableRoot=e;var g={element:c,getPart:b.$ctrl.getPart,container:!0,centerVariant:d.svCenter||"both"};e.addToSortableElements(g),b.$on("$destroy",function(){e.removeFromSortableElements(g)})}}}]),g.directive("svElement",["$parse",function(a){return{restrict:"A",require:["^svPart","^svRoot"],controller:["$scope",function(a){a.$ctrl=this}],link:function(d,e,f,g){function h(h){function i(a){c(a),n||(e.parent().prepend(r),n=!0),g[1].$moveUpdate(p,{x:a.clientX,y:a.clientY,offset:u},r,e,m,g[0].getPart(),d.$index)}if(c(h),!g[1].sortingInProgress()&&(0==h.button||"mousedown"!==h.type)){var k=h.target.attributes["sv-handle-disabled"];if(!k||"true"!==k.value){n=!1;var p=a(f.svElement)(d);if(p=b.extend({},{tolerance:"pointer",revert:200,containment:"html"},p),p.containment)var q=j.call(e,p.containment)[0].getBoundingClientRect();var r,s=e,t=e[0].getBoundingClientRect();l||(l=g[0].helper),m||(m=g[0].placeholder),l?(r=l.clone(),r.removeClass("ng-hide"),r.css({left:t.left+document.body.scrollLeft+"px",top:t.top+document.body.scrollTop+"px"}),s.addClass("sv-visibility-hidden")):(r=s.clone(),r.addClass("sv-helper").css({left:t.left+document.body.scrollLeft+"px",top:t.top+document.body.scrollTop+"px",width:t.width+"px"})),r[0].reposition=function(a){var b=a.x,c=a.y,d=r[0].getBoundingClientRect(),e=document.body;q&&(cq.top+e.scrollTop+q.height&&(c=q.top+e.scrollTop+q.height-d.height),bq.left+e.scrollLeft+q.width&&(b=q.left+e.scrollLeft+q.width-d.width)),this.style.left=b-e.scrollLeft+"px",this.style.top=c-e.scrollTop+"px"};var u={x:(h.clientX-t.left)/t.width,y:(h.clientY-t.top)/t.height};o.addClass("sv-sorting-in-progress"),o.on("mousemove touchmove",i).on("mouseup touchend touchcancel",function a(b){o.off("mousemove touchmove",i),o.off("mouseup touchend touchcancel",a),o.removeClass("sv-sorting-in-progress"),n&&g[0].$drop(d.$index,p),e.removeClass("sv-visibility-hidden")})}}}var i={element:e,getPart:g[0].getPart,getIndex:function(){return d.$index}};g[1].addToSortableElements(i),d.$on("$destroy",function(){g[1].removeFromSortableElements(i)});var k=e;k.on("mousedown touchstart",h),d.$watch("$ctrl.handle",function(a){a&&(k.off("mousedown touchstart",h),k=a,k.on("mousedown touchstart",h))});var l;d.$watch("$ctrl.helper",function(a){a&&(l=a)});var m;d.$watch("$ctrl.placeholder",function(a){a&&(m=a)});var n,o=(b.element(document.body),b.element(document.documentElement))}}}]),g.directive("svHandle",function(){return{require:"?^svElement",link:function(a,b,c,d){d&&(d.handle=b.add(d.handle))}}}),g.directive("svHelper",function(){return{require:["?^svPart","?^svElement"],link:function(a,b,c,d){b.addClass("sv-helper").addClass("ng-hide"),d[1]?d[1].helper=b:d[0]&&(d[0].helper=b)}}}),g.directive("svPlaceholder",function(){return{require:["?^svPart","?^svElement"],link:function(a,b,c,d){b.addClass("sv-placeholder").addClass("ng-hide"),d[1]?d[1].placeholder=b:d[0]&&(d[0].placeholder=b)}}}),b.element(document.head).append([""].join(""));var h=document.documentElement,i=h.matches?"matches":h.matchesSelector?"matchesSelector":h.webkitMatches?"webkitMatches":h.webkitMatchesSelector?"webkitMatchesSelector":h.msMatches?"msMatches":h.msMatchesSelector?"msMatchesSelector":h.mozMatches?"mozMatches":h.mozMatchesSelector?"mozMatchesSelector":null;if(null==i)throw"This browser doesn't support the HTMLElement.matches method";var j=b.element.prototype.closest||function(a){for(var c=this[0].parentNode;c!==document.documentElement&&!c[i](a);)c=c.parentNode;return c[i](a)?b.element(c):b.element()};"function"!=typeof b.element.prototype.add&&(b.element.prototype.add=function(a){var c,d=b.element();for(a=b.element(a),c=0;c',chooseFromList:'',multipleChoices:'',matrix:'',checkboxes:'',textarea:'',header:''}}e.$inject=["$compile"],i.$inject=["$attrs","Utils"],t.module("dashboard.angularMaterialFormBuilder").directive("formItem",e),i.prototype.init=function(){this.Utils.extend(this.item,{type:this.Attrs.type,props:{title:"",helpText:""},config:{required:!1}})},i.prototype.deleteClicked=function(){this.onDelete({item:this.item,index:this.index()})},i.prototype._getItemTemplate=function(t){console.log("get template",t);return'
delete arrow_drop_up arrow_drop_down
'+this.templates[t]+'Required field
'}}(angular),function(t){"use strict";function e(t){function e(e,i,o,n){t(function(){n.init()},50)}return{restrict:"E",templateUrl:"app/directives/checkboxes-item/checkboxes-view.html",scope:{formItem:"=",isPreview:"&",form:"="},controller:i,controllerAs:"CheckboxesView",bindToController:!0,link:e}}function i(t,e){this.Scope=t,this.Utils=e}e.$inject=["$timeout"],i.$inject=["$scope","Utils"],t.module("dashboard.angularMaterialFormBuilder").directive("checkboxesView",e),i.prototype.init=function(){this.Utils.extend(this.formItem,{config:{},options:[]}),this.selectedOptions=this._getSelectedOptions(),this.disableOptions=!1,this.isValid=!0,this._updateView(),this._updateValidity(),this.isPreview()&&this._enableWatchers()},i.prototype.toggleSelectedOption=function(){this.selectedOptions=this._getSelectedOptions(),this._updateView(),this._updateValidity()},i.prototype._getSelectedOptions=function(){return this.formItem.options.filter(function(t){return t.selected})},i.prototype._updateView=function(){this.disableOptions=!(!this.formItem.config.maxSelections||this.selectedOptions.length!==this.formItem.config.maxSelections)},i.prototype._updateValidity=function(){this.isValid=!this.formItem.config.required||this.selectedOptions.length>0,this.form.$setValidity("minSelections",this.isValid)},i.prototype._enableWatchers=function(){this.Scope.$watch("CheckboxesView.formItem.config.required",function(t){void 0!==t&&(this._updateView(),this._updateValidity())}.bind(this))}}(angular),function(t){"use strict";function e(){return{restrict:"E",templateUrl:"app/directives/checkboxes-item/checkboxes-item.html",scope:{item:"="},controller:i,controllerAs:"Checkboxes",bindToController:!0}}function i(t,e){this.item=this.item||{},this.Element=e,t.extend(this.item,{config:{maxSelections:null},options:[{value:"",selected:!1}]})}i.$inject=["Utils","$element"],t.module("dashboard.angularMaterialFormBuilder").directive("checkboxesItem",e),i.prototype.deleteOption=function(t){this.item.options.splice(t,1)},i.prototype.addOption=function(){this.item.options.push({value:"",selected:!1}),setTimeout(function(){var t=this.Element.find("input");t[t.length-1].focus()}.bind(this),0)}}(angular),function(t){"use strict";function e(){}t.module("dashboard.angularMaterialFormBuilder").service("Utils",e),e.prototype.extend=function(t,e){return void 0===t&&(t={}),Object.keys(e).forEach(function(i){t.hasOwnProperty(i)?"object"==typeof e[i]&&t[i]&&e[i]&&this.extend(t[i],e[i]):t[i]=e[i]}.bind(this)),t}}(angular),function(t){"use strict";function e(){i=this,i.form={items:[]}}t.module("dashboard.angularMaterialFormBuilder").controller("MainController",e);var i;e.prototype.addItem=function(t){this.form.items.push({type:t})},e.prototype.delete=function(t,e){i.form.items.splice(e,1)},e.prototype.up=function(t,e){if(0!==e){var o=i.form.items[e-1];i.form.items[e]=o,i.form.items[e-1]=t}},e.prototype.down=function(t,e){if(e!==i.form.items.length-1){var o=i.form.items[e+1];i.form.items[e]=o,i.form.items[e+1]=t}}}(angular),angular.module("dashboard.angularMaterialFormBuilder").run(["$templateCache",function(t){t.put("app/directives/checkboxes-item/checkboxes-item.html",'
Layout direction ({{Checkboxes.item.config.direction == \'horizontal\' ? \'Horizontal\' : \'Vertical\'}})
reorder delete
Add Option
'),t.put("app/directives/checkboxes-item/checkboxes-view.html",'
{{option.value}}
Must select {{CheckboxesView.formItem.maxSelections || 1}} items
'),t.put("app/directives/form-item/form-item.html",'
deletearrow_drop_uparrow_drop_down
Required field
'),t.put("app/directives/form-items-container/form-items-container.html",'
'),t.put("app/directives/form-view/form-view.html",'
{{formItem.props.title}}
{{formItem.props.helpText}}
'),t.put("app/directives/input-item/input-item.html",' TextNumber'),t.put("app/directives/input-item/input-view.html",'
This field is required
'), t.put("app/directives/matrix-item/matrix-item.html",'
reorder deleteDelete
Add Column
reorder deleteDelete
Add row
'),t.put("app/directives/matrix-item/matrix-view.html",'
{{column.value}}
{{row.value}}
This is required
'),t.put("app/directives/radio-button-item/radio-button-item.html",'
Layout direction ({{RadioButton.item.config.direction == \'horizontal\' ? \'Horizontal\' : \'Vertical\'}})
reorder delete
Add Option
'),t.put("app/directives/radio-button-item/radio-button-view.html",'{{option.value}}
This field is required
'),t.put("app/directives/select-item/select-item.html",'
reorder delete
Add Option
'),t.put("app/directives/select-item/select-view.html",'{{ option.value }}
This field is required
'),t.put("app/directives/textarea-item/textarea-item.html",' '),t.put("app/directives/textarea-item/textarea-view.html",'
This field is required
'),t.put("app/directives/header-item/header-item.html",''),t.put("app/directives/header-item/header-view.html","
")}]),function(){var a;a=angular.module("ngAnalytics",[]),a.service("ngAnalyticsService",["$timeout",function(a){var b;this.ga=null,this.setClientId=function(a){return b=a,a},this.getClientId=function(){return b},this.authorize=function(c){var d=this;a(function(){d.ga.auth.authorize({container:c,clientid:b,userInfoLabel:d.authLabel})},0)},this.viewSelectors={},this.isReady=!1,this.authLabel=void 0,this.authorized=!1}]),a.directive("ngAnalyticsAuth",["ngAnalyticsService",function(a){return{scope:{label:"@",authContainer:"@",hideOnAuth:"@"},restrict:"E",templateUrl:"ngAnalytics-auth/template.html",link:function(b){a.authLabel=b.label,b.authContainer=b.authContainer||"embed-api-auth-container";var c=b.$watch(function(){return a.isReady},function(d){d&&(b.hideOnAuth&&"true"===b.hideOnAuth&&(a.ga.auth.on("success",function(){b.hide=!0}),b.$watch(function(){return a.ga.auth.isAuthorized()},function(a,c){a&&c!==a?b.hide=!0:a||c===a||(b.hide=!1)})),c())})}}}]),a.directive("ngAnalyticsChart",["ngAnalyticsService",function(a){return{scope:{viewSelectorContainer:"@",authContainer:"@",chart:"="},restrict:"E",templateUrl:"ngAnalytics-chart/template.html",link:function(b){var c,d=!a.authorized;a.authorized=!0;var e=b.$watch(function(){return a.isReady},function(f){if(f){var g;if(!a.ga.auth.isAuthorized()&&d&&a.authorize(b.authContainer||"embed-api-auth-container"),g=new a.ga.googleCharts.DataChart(b.chart),b.viewSelectorContainer)c=b.$watch(function(){return a.viewSelectors[b.viewSelectorContainer]},function(d){d&&(a.viewSelectors[b.viewSelectorContainer].on("change",function(a){var b={query:{ids:a}};g.set(b).execute()}),c())});else{var h=function(){g.execute()};a.ga.auth.once("success",h),a.ga.auth.isAuthorized()&&h()}e()}})}}}]),a.directive("ngAnalyticsReport",["$rootScope","$q","ngAnalyticsService",function(a,b,c){return{scope:{queries:"=",authContainer:"@",viewSelectorContainer:"@"},restrict:"E",link:function(d,e){function f(a){var d=b.defer(),e=new c.ga.report.Data(a);return e.once("success",function(a){d.resolve(a)}),e.once("error",function(a){d.reject(a)}),e.execute(),d.promise}var g=!c.authorized;c.authorized=!0;var h=d.$watch(function(){return c.isReady},function(i){if(i){if(!c.ga.auth.isAuthorized()&&g&&c.authorize(d.authContainer||"embed-api-auth-container"),d.viewSelectorContainer)var j=d.$watch(function(){return c.viewSelectors[d.viewSelectorContainer]},function(g){g&&(c.viewSelectors[d.viewSelectorContainer].on("change",function(c){var g=[];angular.forEach(d.queries,function(a){a.query.ids=c,g.push(f(a))}),b.all(g).then(function(b){d.report=b,a.$broadcast("$gaReportSuccess",b,e)},function(b){d.error=b,a.$broadcast("$gaReportError",b,e)})}),j())});else{var k=function(){var c=[];angular.forEach(d.queries,function(a){c.push(f(a))}),b.all(c).then(function(b){d.report=b,a.$broadcast("$gaReportSuccess",b,e)},function(b){d.error=b,a.$broadcast("$gaReportError",b,e)})};c.ga.auth.once("success",k),c.ga.auth.isAuthorized()&&k()}h()}})}}}]),a.directive("ngAnalyticsView",["ngAnalyticsService",function(a){return{scope:{viewSelectorContainer:"@",authContainer:"@",charts:"="},restrict:"E",templateUrl:"ngAnalytics-view/template.html",link:function(b){var c=!a.authorized;a.authorized=!0,b.$watch(function(){return a.isReady},function(d){if(d){!a.ga.auth.isAuthorized()&&c&&a.authorize(b.authContainer||"embed-api-auth-container"),b.viewSelectorContainer=b.viewSelectorContainer||"view-selector-container";var e=new a.ga.ViewSelector({container:b.viewSelectorContainer});a.viewSelectors[b.viewSelectorContainer]=e;var f=function(){e.execute()};a.ga.auth.once("success",f),a.ga.auth.isAuthorized()&&f()}})}}}]),a.run(["$templateCache","$timeout","ngAnalyticsService",function(a,b,c){var d=document.createTextNode("(function(w,d,s,g,js,fjs){g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(cb){this.q.push(cb)}};js=d.createElement(s);fjs=d.getElementsByTagName(s)[0];js.src='https://apis.google.com/js/platform.js';fjs.parentNode.insertBefore(js,fjs);js.onload=function(){g.load('analytics')};}(window,document,'script'));"),e=document.createElement("script");e.type="text/javascript",e.appendChild(d),document.body.appendChild(e),gapi.analytics.ready(function(){b(function(){c.ga=gapi.analytics,c.isReady=!0},0)}),a.put("ngAnalytics-auth/template.html",'
'),a.put("ngAnalytics-chart/template.html",'
'),a.put("ngAnalytics-view/template.html",'
')}])}.call(this),function(a){angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(a){angular.isDefined(a.urlSanitizationWhitelist)?a.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):a.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),angular.module("ngCsv.services").service("CSV",["$q",function(a){var b="\r\n";this.stringifyField=function(a,b){return"locale"===b.decimalSep&&this.isFloat(a)?a.toLocaleString():"."!==b.decimalSep&&this.isFloat(a)?a.toString().replace(".",b.decimalSep):"string"==typeof a?(a=a.replace(/"/g,'""'),(b.quoteStrings||a.indexOf(",")>-1||a.indexOf("\n")>-1||a.indexOf("\r")>-1)&&(a=b.txtDelim+a+b.txtDelim),a):"boolean"==typeof a?a?"TRUE":"FALSE":a},this.isFloat=function(a){return+a===a&&(!isFinite(a)||Boolean(a%1))},this.stringify=function(d,e){var f=a.defer(),g=this,h="",i="",j=a.when(d).then(function(a){if(a=angular.copy(a),angular.isDefined(e.header)&&e.header){var d,j;d=[],angular.forEach(e.header,function(a){this.push(g.stringifyField(a,e))},d),j=d.join(e.fieldSep?e.fieldSep:","),i+=j+b}var k=[];angular.isArray(a)?k=a:angular.isFunction(a)&&(k=a()),angular.forEach(k,function(a,c){var d,f;f=[],angular.forEach(a,function(a){this.push(g.stringifyField(a,e))},f),d=f.join(e.fieldSep?e.fieldSep:","),i+=c");g.attr("href",a.URL.createObjectURL(d)),g.attr("download",b.getFilename()),g.attr("target","_blank"),e.find("body").append(g),f(function(){g[0].click(),g.remove()},null)}}c.bind("click",function(){b.buildCSV().then(function(){d()}),b.$apply()})}}}])}(window,document),angular.module("templates-dist",["templates/emoji-button-bootstrap.html","templates/emoji-button-strap.html","templates/emoji-button.html","templates/emoji-popover-bootstrap.html","templates/emoji-popover-strap.html","templates/emoji-popover.html"]),angular.module("templates/emoji-button-bootstrap.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("templates/emoji-button-bootstrap.html",'\n')}]),angular.module("templates/emoji-button-strap.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("templates/emoji-button-strap.html",'\n')}]),angular.module("templates/emoji-button.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("templates/emoji-button.html",'\n')}]),angular.module("templates/emoji-popover-bootstrap.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("templates/emoji-popover-bootstrap.html",'
\n
\n \n \n \n
\n \n \n
\n')}]),angular.module("templates/emoji-popover-strap.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("templates/emoji-popover-strap.html",'
\n
\n
\n ×\n
\n

\n
\n
\n
\n \n \n \n
\n \n \n
\n
\n
\n')}]),angular.module("templates/emoji-popover.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("templates/emoji-popover.html",'
\n
\n ×\n
\n

\n
\n
\n
\n \n \n \n
\n \n \n
\n
\n
\n')}]),angular.module("vkEmojiPicker",["ngSanitize","templates-dist"]).config(function(){String.fromCodePoint||function(){var defineProperty=function(){try{var object={},$defineProperty=Object.defineProperty,result=$defineProperty(object,object,object)&&$defineProperty}catch(error){}return result}(),stringFromCharCode=String.fromCharCode,floor=Math.floor,fromCodePoint=function(){var highSurrogate,lowSurrogate,codeUnits=[],index=-1,length=arguments.length;if(!length)return"";for(var result="";++index1114111||floor(codePoint)!=codePoint)throw RangeError("Invalid code point: "+codePoint);codePoint<=65535?codeUnits.push(codePoint):(codePoint-=65536,highSurrogate=55296+(codePoint>>10),lowSurrogate=codePoint%1024+56320,codeUnits.push(highSurrogate,lowSurrogate)),(index+1==length||codeUnits.length>16384)&&(result+=stringFromCharCode.apply(null,codeUnits),codeUnits.length=0)}return result};defineProperty?defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:!0,writable:!0}):String.fromCodePoint=fromCodePoint}()}),angular.module("vkEmojiPicker").constant("EmojiGroups",function(){var faces=["smile","laughing","blush","smiley","relaxed","smirk","heart_eyes","kissing_heart","kissing_closed_eyes","flushed","relieved","satisfied","grin","wink","stuck_out_tongue_winking_eye","stuck_out_tongue_closed_eyes","grinning","kissing","winky_face","kissing_smiling_eyes","stuck_out_tongue","sleeping","worried","frowning","anguished","open_mouth","grimacing","confused","hushed","expressionless","unamused","sweat_smile","sweat","wow","disappointed_relieved","weary","pensive","disappointed","confounded","fearful","cold_sweat","persevere","cry","sob","joy","astonished","scream","neckbeard","tired_face","angry","rage","triumph","sleepy","yum","mask","sunglasses","dizzy_face","imp","smiling_imp","neutral_face","no_mouth","innocent","alien","yellow_heart","blue_heart","purple_heart","heart","green_heart","broken_heart","heartbeat","heartpulse","two_hearts","revolving_hearts","cupid","sparkling_heart","sparkles","star","star2","dizzy","boom","collision","anger","exclamation","question","grey_exclamation","grey_question","zzz","dash","sweat_drops","notes","musical_note","fire","hankey","thumbsup","thumbsdown","ok_hand","punch","fist","v","wave","hand","raised_hand","open_hands","point_up","point_down","point_left","point_right","raised_hands","pray","point_up_2","clap","muscle","metal","fu","walking","runner","couple","family","two_men_holding_hands","two_women_holding_hands","dancer","dancers","ok_woman","no_good","information_desk_person","raising_hand","bride_with_veil","person_with_pouting_face","person_frowning","bow","couplekiss","couple_with_heart","massage","haircut","nail_care","boy","girl","woman","man","baby","older_woman","older_man","person_with_blond_hair","man_with_gua_pi_mao","man_with_turban","construction_worker","cop","angel","princess","smiley_cat","smile_cat","heart_eyes_cat","kissing_cat","smirk_cat","scream_cat","crying_cat_face","joy_cat","pouting_cat","japanese_ogre","japanese_goblin","see_no_evil","hear_no_evil","speak_no_evil","guardsman","skull","feet","lips","kiss","droplet","ear","eyes","nose","tongue","love_letter","bust_in_silhouette","busts_in_silhouette","speech_balloon","thought_balloon"],nature=["sunny","umbrella","cloud","snowflake","snowman","zap","cyclone","foggy","ocean","cat","dog","mouse","hamster","rabbit","wolf","frog","tiger","koala","bear","pig","pig_nose","cow","boar","monkey_face","monkey","horse","racehorse","camel","sheep","elephant","panda_face","snake","bird","baby_chick","hatched_chick","hatching_chick","chicken","penguin","turtle","bug","honeybee","ant","beetle","snail","octopus","tropical_fish","fish","whale","whale2","dolphin","cow2","ram","rat","water_buffalo","tiger2","rabbit2","dragon","goat","rooster","dog2","pig2","mouse2","ox","dragon_face","blowfish","crocodile","dromedary_camel","leopard","cat2","poodle","paw_prints","bouquet","cherry_blossom","tulip","four_leaf_clover","rose","sunflower","hibiscus","maple_leaf","leaves","fallen_leaf","herb","mushroom","cactus","palm_tree","evergreen_tree","deciduous_tree","chestnut","seedling","blossom","ear_of_rice","shell","globe_with_meridians","sun_with_face","full_moon_with_face","new_moon_with_face","new_moon","waxing_crescent_moon","first_quarter_moon","waxing_gibbous_moon","full_moon","waning_gibbous_moon","last_quarter_moon","waning_crescent_moon","last_quarter_moon_with_face","first_quarter_moon_with_face","moon","earth_africa","earth_americas","earth_asia","volcano","milky_way","partly_sunny"],life=["bamboo","gift_heart","dolls","school_satchel","mortar_board","flags","fireworks","sparkler","wind_chime","rice_scene","jack_o_lantern","ghost","santa","christmas_tree","gift","bell","no_bell","tanabata_tree","tada","confetti_ball","balloon","crystal_ball","cd","dvd","floppy_disk","camera","video_camera","movie_camera","computer","tv","iphone","phone","telephone","telephone_receiver","pager","fax","minidisc","vhs","sound","speaker","mute","loudspeaker","mega","hourglass","hourglass_flowing_sand","alarm_clock","watch","radio","satellite","loop","mag","mag_right","unlock","lock","lock_with_ink_pen","closed_lock_with_key","key","bulb","flashlight","high_brightness","low_brightness","electric_plug","battery","calling","email","mailbox","postbox","bath","bathtub","shower","toilet","wrench","nut_and_bolt","hammer","seat","moneybag","yen","dollar","pound","euro","credit_card","money_with_wings","e-mail","inbox_tray","outbox_tray","envelope","incoming_envelope","postal_horn","mailbox_closed","mailbox_with_mail","mailbox_with_no_mail","door","smoking","bomb","gun","hocho","pill","syringe","page_facing_up","page_with_curl","bookmark_tabs","bar_chart","chart_with_upwards_trend","chart_with_downwards_trend","scroll","clipboard","calendar","date","card_index","file_folder","open_file_folder","scissors","pushpin","paperclip","black_nib","pencil2","straight_ruler","triangular_ruler","closed_book","green_book","blue_book","orange_book","notebook","notebook_with_decorative_cover","ledger","books","bookmark","name_badge","microscope","telescope","newspaper","football","basketball","soccer","baseball","tennis","8ball","rugby_football","bowling","golf","mountain_bicyclist","bicyclist","horse_racing","snowboarder","swimmer","surfer","ski","spades","hearts","clubs","diamonds","gem","ring","trophy","musical_score","musical_keyboard","violin","space_invader","video_game","black_joker","flower_playing_cards","game_die","dart","mahjong","clapper","memo","book","art","microphone","headphones","trumpet","saxophone","guitar","shoe","sandal","high_heel","lipstick","boot","shirt","necktie","womans_clothes","dress","running_shirt_with_sash","jeans","kimono","bikini","ribbon","tophat","crown","womans_hat","mans_shoe","closed_umbrella","briefcase","handbag","pouch","purse","eyeglasses","fishing_pole_and_fish","coffee","tea","sake","baby_bottle","beer","beers","cocktail","tropical_drink","wine_glass","fork_and_knife","pizza","hamburger","fries","poultry_leg","meat_on_bone","spaghetti","curry","fried_shrimp","bento","sushi","fish_cake","rice_ball","rice_cracker","rice","ramen","stew","oden","dango","egg","bread","doughnut","custard","icecream","ice_cream","shaved_ice","birthday","cake","cookie","chocolate_bar","candy","lollipop","honey_pot","apple","green_apple","tangerine","lemon","cherries","grapes","watermelon","strawberry","peach","melon","banana","pear","pineapple","sweet_potato","eggplant","tomato","corn"],travel=["house","house_with_garden","school","office","post_office","hospital","bank","convenience_store","love_hotel","hotel","wedding","church","department_store","european_post_office","city_sunrise","city_sunset","japanese_castle","european_castle","tent","factory","tokyo_tower","japan","mount_fuji","sunrise_over_mountains","sunrise","stars","statue_of_liberty","bridge_at_night","carousel_horse","rainbow","ferris_wheel","fountain","roller_coaster","ship","speedboat","boat","rowboat","anchor","rocket","airplane","helicopter","steam_locomotive","tram","mountain_railway","bike","aerial_tramway","suspension_railway","mountain_cableway","tractor","blue_car","oncoming_automobile","car","taxi","oncoming_taxi","articulated_lorry","bus","oncoming_bus","rotating_light","police_car","oncoming_police_car","fire_engine","ambulance","minibus","truck","train","station","bullettrain_front","bullettrain_side","light_rail","monorail","railway_car","trolleybus","ticket","fuelpump","vertical_traffic_light","traffic_light","warning","construction","beginner","atm","slot_machine","busstop","barber","hotsprings","checkered_flag","crossed_flags","izakaya_lantern","moyai","circus_tent","performing_arts","round_pushpin","triangular_flag_on_post","jp","kr","cn","us","fr","es","it","ru","uk","de"],signs=["one","two","three","four","five","six","seven","eight","nine","keycap_ten","1234","zero","hash","symbols","arrow_backward","arrow_down","arrow_forward","arrow_left","capital_abcd","abcd","abc","arrow_lower_left","arrow_lower_right","arrow_right","arrow_up","arrow_upper_left","arrow_upper_right","arrow_double_down","arrow_double_up","arrow_down_small","arrow_heading_down","arrow_heading_up","leftwards_arrow_with_hook","arrow_right_hook","left_right_arrow","arrow_up_down","arrow_up_small","arrows_clockwise","arrows_counterclockwise","rewind","fast_forward","information_source","ok","twisted_rightwards_arrows","repeat","repeat_one","new","top","up","cool","free","ng","cinema","koko","signal_strength","u5272","u5408","u55b6","u6307","u6708","u6709","u6e80","u7121","u7533","u7a7a","u7981","sa","restroom","mens","womens","baby_symbol","no_smoking","parking","wheelchair","metro","baggage_claim","accept","wc","potable_water","put_litter_in_its_place","secret","congratulations","m","passport_control","left_luggage","customs","ideograph_advantage","cl","sos","id","no_entry_sign","underage","no_mobile_phones","do_not_litter","non-potable_water","no_bicycles","no_pedestrians","children_crossing","no_entry","eight_spoked_asterisk","eight_pointed_black_star","heart_decoration","vs","vibration_mode","mobile_phone_off","chart","currency_exchange","aries","taurus","gemini","cancer","leo","virgo","libra","scorpius","sagittarius","capricorn","aquarius","pisces","ophiuchus","six_pointed_star","negative_squared_cross_mark","a","b","ab","o2","diamond_shape_with_a_dot_inside","recycle","end","on","soon","clock1","clock130","clock10","clock1030","clock11","clock1130","clock12","clock1230","clock2","clock230","clock3","clock330","clock4","clock430","clock5","clock530","clock6","clock630","clock7","clock730","clock8","clock830","clock9","clock930","heavy_dollar_sign","copyright","registered","tm","x","heavy_exclamation_mark","bangbang","interrobang","o","heavy_multiplication_x","heavy_plus_sign","heavy_minus_sign","heavy_division_sign","white_flower","100","heavy_check_mark","ballot_box_with_check","radio_button","link","curly_loop","wavy_dash","part_alternation_mark","trident","black_square","white_square","white_check_mark","black_square_button","white_square_button","black_circle","white_circle","red_circle","large_blue_circle","large_blue_diamond","large_orange_diamond","small_blue_diamond","small_orange_diamond","small_red_triangle","small_red_triangle_down"];return{groups:[{name:"recent",icon:{name:"icon-recent",selected:"icon-recent-selected"},emoji:[]},{name:"smile",icon:{name:"icon-smile",selected:"icon-smile-selected"},emoji:faces},{name:"flower",icon:{name:"icon-flower",selected:"icon-flower-selected"},emoji:nature},{name:"bell",icon:{name:"icon-bell",selected:"icon-bell-selected"},emoji:life},{name:"car",icon:{name:"icon-car",selected:"icon-car-selected"},emoji:travel},{name:"grid",icon:{name:"icon-grid",selected:"icon-grid-selected"},emoji:signs}],all:faces.concat(nature,life,travel,signs)}}()),angular.module("vkEmojiPicker").constant("EmojiHex",function(){return{emoji:{copyright:"00a9",registered:"00ae",bangbang:"203c",interrobang:"2049",tm:"2122",information_source:"2139",left_right_arrow:"2194",arrow_up_down:"2195",arrow_upper_left:"2196",arrow_upper_right:"2197",arrow_lower_right:"2198",arrow_lower_left:"2199",leftwards_arrow_with_hook:"21a9",arrow_right_hook:"21aa",watch:"231a",hourglass:"231b",fast_forward:"23e9",rewind:"23ea",arrow_double_up:"23eb",arrow_double_down:"23ec",alarm_clock:"23f0",hourglass_flowing_sand:"23f3",m:"24c2",black_small_square:"25aa",white_small_square:"25ab",arrow_forward:"25b6",arrow_backward:"25c0",white_medium_square:"25fb",black_medium_square:"25fc",white_medium_small_square:"25fd",black_medium_small_square:"25fe",sunny:"2600",cloud:"2601",phone:"260e",telephone:"260e",ballot_box_with_check:"2611",umbrella:"2614",coffee:"2615",point_up:"261d",relaxed:"263a",aries:"2648",taurus:"2649",gemini:"264a",cancer:"264b",leo:"264c",virgo:"264d",libra:"264e",scorpius:"264f",sagittarius:"2650",capricorn:"2651",aquarius:"2652",pisces:"2653",spades:"2660",clubs:"2663",hearts:"2665",diamonds:"2666",hotsprings:"2668",recycle:"267b",wheelchair:"267f",anchor:"2693",warning:"26a0",zap:"26a1",white_circle:"26aa",black_circle:"26ab",soccer:"26bd",baseball:"26be",snowman:"26c4",partly_sunny:"26c5",ophiuchus:"26ce",no_entry:"26d4",church:"26ea",fountain:"26f2",golf:"26f3",boat:"26f5",sailboat:"26f5",tent:"26fa",fuelpump:"26fd", scissors:"2702",white_check_mark:"2705",airplane:"2708",email:"2709",envelope:"2709",fist:"270a",hand:"270b",raised_hand:"270b",v:"270c",pencil2:"270f",black_nib:"2712",heavy_check_mark:"2714",heavy_multiplication_x:"2716",sparkles:"2728",eight_spoked_asterisk:"2733",eight_pointed_black_star:"2734",snowflake:"2744",sparkle:"2747",x:"274c",negative_squared_cross_mark:"274e",question:"2753",grey_question:"2754",grey_exclamation:"2755",exclamation:"2757",heavy_exclamation_mark:"2757",heart:"2764",heavy_plus_sign:"2795",heavy_minus_sign:"2796",heavy_division_sign:"2797",arrow_right:"27a1",curly_loop:"27b0",loop:"27bf",arrow_heading_up:"2934",arrow_heading_down:"2935",arrow_left:"2b05",arrow_up:"2b06",arrow_down:"2b07",black_large_square:"2b1b",white_large_square:"2b1c",star:"2b50",o:"2b55",wavy_dash:"3030",part_alternation_mark:"303d",congratulations:"3297",secret:"3299",mahjong:"1f004",black_joker:"1f0cf",a:"1f170",b:"1f171",o2:"1f17e",parking:"1f17f",ab:"1f18e",cl:"1f191",cool:"1f192",free:"1f193",id:"1f194",new:"1f195",ng:"1f196",ok:"1f197",sos:"1f198",up:"1f199",vs:"1f19a",koko:"1f201",sa:"1f202",u7121:"1f21a",u6307:"1f22f",u7981:"1f232",u7a7a:"1f233",u5408:"1f234",u6e80:"1f235",u6709:"1f236",u6708:"1f237",u7533:"1f238",u5272:"1f239",u55b6:"1f23a",ideograph_advantage:"1f250",accept:"1f251",cyclone:"1f300",foggy:"1f301",closed_umbrella:"1f302",night_with_stars:"1f303",sunrise_over_mountains:"1f304",sunrise:"1f305",city_sunset:"1f306",city_sunrise:"1f307",rainbow:"1f308",bridge_at_night:"1f309",ocean:"1f30a",volcano:"1f30b",milky_way:"1f30c",earth_africa:"1f30d",earth_americas:"1f30e",earth_asia:"1f30f",globe_with_meridians:"1f310",new_moon:"1f311",waxing_crescent_moon:"1f312",first_quarter_moon:"1f313",moon:"1f314",waxing_gibbous_moon:"1f314",full_moon:"1f315",waning_gibbous_moon:"1f316",last_quarter_moon:"1f317",waning_crescent_moon:"1f318",crescent_moon:"1f319",new_moon_with_face:"1f31a",first_quarter_moon_with_face:"1f31b",last_quarter_moon_with_face:"1f31c",full_moon_with_face:"1f31d",sun_with_face:"1f31e",star2:"1f31f",stars:"1f320",chestnut:"1f330",seedling:"1f331",evergreen_tree:"1f332",deciduous_tree:"1f333",palm_tree:"1f334",cactus:"1f335",tulip:"1f337",cherry_blossom:"1f338",rose:"1f339",hibiscus:"1f33a",sunflower:"1f33b",blossom:"1f33c",corn:"1f33d",ear_of_rice:"1f33e",herb:"1f33f",four_leaf_clover:"1f340",maple_leaf:"1f341",fallen_leaf:"1f342",leaves:"1f343",mushroom:"1f344",tomato:"1f345",eggplant:"1f346",grapes:"1f347",melon:"1f348",watermelon:"1f349",tangerine:"1f34a",lemon:"1f34b",banana:"1f34c",pineapple:"1f34d",apple:"1f34e",green_apple:"1f34f",pear:"1f350",peach:"1f351",cherries:"1f352",strawberry:"1f353",hamburger:"1f354",pizza:"1f355",meat_on_bone:"1f356",poultry_leg:"1f357",rice_cracker:"1f358",rice_ball:"1f359",rice:"1f35a",curry:"1f35b",ramen:"1f35c",spaghetti:"1f35d",bread:"1f35e",fries:"1f35f",sweet_potato:"1f360",dango:"1f361",oden:"1f362",sushi:"1f363",fried_shrimp:"1f364",fish_cake:"1f365",icecream:"1f366",shaved_ice:"1f367",ice_cream:"1f368",doughnut:"1f369",cookie:"1f36a",chocolate_bar:"1f36b",candy:"1f36c",lollipop:"1f36d",custard:"1f36e",honey_pot:"1f36f",cake:"1f370",bento:"1f371",stew:"1f372",egg:"1f373",fork_and_knife:"1f374",tea:"1f375",sake:"1f376",wine_glass:"1f377",cocktail:"1f378",tropical_drink:"1f379",beer:"1f37a",beers:"1f37b",baby_bottle:"1f37c",ribbon:"1f380",gift:"1f381",birthday:"1f382",jack_o_lantern:"1f383",christmas_tree:"1f384",santa:"1f385",fireworks:"1f386",sparkler:"1f387",balloon:"1f388",tada:"1f389",confetti_ball:"1f38a",tanabata_tree:"1f38b",crossed_flags:"1f38c",bamboo:"1f38d",dolls:"1f38e",flags:"1f38f",wind_chime:"1f390",rice_scene:"1f391",school_satchel:"1f392",mortar_board:"1f393",carousel_horse:"1f3a0",ferris_wheel:"1f3a1",roller_coaster:"1f3a2",fishing_pole_and_fish:"1f3a3",microphone:"1f3a4",movie_camera:"1f3a5",cinema:"1f3a6",headphones:"1f3a7",art:"1f3a8",tophat:"1f3a9",circus_tent:"1f3aa",ticket:"1f3ab",clapper:"1f3ac",performing_arts:"1f3ad",video_game:"1f3ae",dart:"1f3af",slot_machine:"1f3b0","8ball":"1f3b1",game_die:"1f3b2",bowling:"1f3b3",flower_playing_cards:"1f3b4",musical_note:"1f3b5",notes:"1f3b6",saxophone:"1f3b7",guitar:"1f3b8",musical_keyboard:"1f3b9",trumpet:"1f3ba",violin:"1f3bb",musical_score:"1f3bc",running_shirt_with_sash:"1f3bd",tennis:"1f3be",ski:"1f3bf",basketball:"1f3c0",checkered_flag:"1f3c1",snowboarder:"1f3c2",runner:"1f3c3",running:"1f3c3",surfer:"1f3c4",trophy:"1f3c6",horse_racing:"1f3c7",football:"1f3c8",rugby_football:"1f3c9",swimmer:"1f3ca",house:"1f3e0",house_with_garden:"1f3e1",office:"1f3e2",post_office:"1f3e3",european_post_office:"1f3e4",hospital:"1f3e5",bank:"1f3e6",atm:"1f3e7",hotel:"1f3e8",love_hotel:"1f3e9",convenience_store:"1f3ea",school:"1f3eb",department_store:"1f3ec",factory:"1f3ed",izakaya_lantern:"1f3ee",lantern:"1f3ee",japanese_castle:"1f3ef",european_castle:"1f3f0","skin-tone-2":"1f3fb","skin-tone-3":"1f3fc","skin-tone-4":"1f3fd","skin-tone-5":"1f3fe","skin-tone-6":"1f3ff",rat:"1f400",mouse2:"1f401",ox:"1f402",water_buffalo:"1f403",cow2:"1f404",tiger2:"1f405",leopard:"1f406",rabbit2:"1f407",cat2:"1f408",dragon:"1f409",crocodile:"1f40a",whale2:"1f40b",snail:"1f40c",snake:"1f40d",racehorse:"1f40e",ram:"1f40f",goat:"1f410",sheep:"1f411",monkey:"1f412",rooster:"1f413",chicken:"1f414",dog2:"1f415",pig2:"1f416",boar:"1f417",elephant:"1f418",octopus:"1f419",shell:"1f41a",bug:"1f41b",ant:"1f41c",bee:"1f41d",honeybee:"1f41d",beetle:"1f41e",fish:"1f41f",tropical_fish:"1f420",blowfish:"1f421",turtle:"1f422",hatching_chick:"1f423",baby_chick:"1f424",hatched_chick:"1f425",bird:"1f426",penguin:"1f427",koala:"1f428",poodle:"1f429",dromedary_camel:"1f42a",camel:"1f42b",dolphin:"1f42c",flipper:"1f42c",mouse:"1f42d",cow:"1f42e",tiger:"1f42f",rabbit:"1f430",cat:"1f431",dragon_face:"1f432",whale:"1f433",horse:"1f434",monkey_face:"1f435",dog:"1f436",pig:"1f437",frog:"1f438",hamster:"1f439",wolf:"1f43a",bear:"1f43b",panda_face:"1f43c",pig_nose:"1f43d",feet:"1f43e",paw_prints:"1f43e",eyes:"1f440",ear:"1f442",nose:"1f443",lips:"1f444",tongue:"1f445",point_up_2:"1f446",point_down:"1f447",point_left:"1f448",point_right:"1f449",facepunch:"1f44a",punch:"1f44a",wave:"1f44b",ok_hand:"1f44c","+1":"1f44d",thumbsup:"1f44d","-1":"1f44e",thumbsdown:"1f44e",clap:"1f44f",open_hands:"1f450",crown:"1f451",womans_hat:"1f452",eyeglasses:"1f453",necktie:"1f454",shirt:"1f455",tshirt:"1f455",jeans:"1f456",dress:"1f457",kimono:"1f458",bikini:"1f459",womans_clothes:"1f45a",purse:"1f45b",handbag:"1f45c",pouch:"1f45d",mans_shoe:"1f45e",shoe:"1f45e",athletic_shoe:"1f45f",high_heel:"1f460",sandal:"1f461",boot:"1f462",footprints:"1f463",bust_in_silhouette:"1f464",busts_in_silhouette:"1f465",boy:"1f466",girl:"1f467",man:"1f468",woman:"1f469",family:"1f46a",couple:"1f46b",two_men_holding_hands:"1f46c",two_women_holding_hands:"1f46d",cop:"1f46e",dancers:"1f46f",bride_with_veil:"1f470",person_with_blond_hair:"1f471",man_with_gua_pi_mao:"1f472",man_with_turban:"1f473",older_man:"1f474",older_woman:"1f475",baby:"1f476",construction_worker:"1f477",princess:"1f478",japanese_ogre:"1f479",japanese_goblin:"1f47a",ghost:"1f47b",angel:"1f47c",alien:"1f47d",space_invader:"1f47e",imp:"1f47f",skull:"1f480",information_desk_person:"1f481",guardsman:"1f482",dancer:"1f483",lipstick:"1f484",nail_care:"1f485",massage:"1f486",haircut:"1f487",barber:"1f488",syringe:"1f489",pill:"1f48a",kiss:"1f48b",love_letter:"1f48c",ring:"1f48d",gem:"1f48e",couplekiss:"1f48f",bouquet:"1f490",couple_with_heart:"1f491",wedding:"1f492",heartbeat:"1f493",broken_heart:"1f494",two_hearts:"1f495",sparkling_heart:"1f496",heartpulse:"1f497",cupid:"1f498",blue_heart:"1f499",green_heart:"1f49a",yellow_heart:"1f49b",purple_heart:"1f49c",gift_heart:"1f49d",revolving_hearts:"1f49e",heart_decoration:"1f49f",diamond_shape_with_a_dot_inside:"1f4a0",bulb:"1f4a1",anger:"1f4a2",bomb:"1f4a3",zzz:"1f4a4",boom:"1f4a5",collision:"1f4a5",sweat_drops:"1f4a6",droplet:"1f4a7",dash:"1f4a8",hankey:"1f4a9",poop:"1f4a9",shit:"1f4a9",muscle:"1f4aa",dizzy:"1f4ab",speech_balloon:"1f4ac",thought_balloon:"1f4ad",white_flower:"1f4ae",100:"1f4af",moneybag:"1f4b0",currency_exchange:"1f4b1",heavy_dollar_sign:"1f4b2",credit_card:"1f4b3",yen:"1f4b4",dollar:"1f4b5",euro:"1f4b6",pound:"1f4b7",money_with_wings:"1f4b8",chart:"1f4b9",seat:"1f4ba",computer:"1f4bb",briefcase:"1f4bc",minidisc:"1f4bd",floppy_disk:"1f4be",cd:"1f4bf",dvd:"1f4c0",file_folder:"1f4c1",open_file_folder:"1f4c2",page_with_curl:"1f4c3",page_facing_up:"1f4c4",date:"1f4c5",calendar:"1f4c6",card_index:"1f4c7",chart_with_upwards_trend:"1f4c8",chart_with_downwards_trend:"1f4c9",bar_chart:"1f4ca",clipboard:"1f4cb",pushpin:"1f4cc",round_pushpin:"1f4cd",paperclip:"1f4ce",straight_ruler:"1f4cf",triangular_ruler:"1f4d0",bookmark_tabs:"1f4d1",ledger:"1f4d2",notebook:"1f4d3",notebook_with_decorative_cover:"1f4d4",closed_book:"1f4d5",book:"1f4d6",open_book:"1f4d6",green_book:"1f4d7",blue_book:"1f4d8",orange_book:"1f4d9",books:"1f4da",name_badge:"1f4db",scroll:"1f4dc",memo:"1f4dd",pencil:"1f4dd",telephone_receiver:"1f4de",pager:"1f4df",fax:"1f4e0",satellite:"1f4e1",loudspeaker:"1f4e2",mega:"1f4e3",outbox_tray:"1f4e4",inbox_tray:"1f4e5",package:"1f4e6","e-mail":"1f4e7",incoming_envelope:"1f4e8",envelope_with_arrow:"1f4e9",mailbox_closed:"1f4ea",mailbox:"1f4eb",mailbox_with_mail:"1f4ec",mailbox_with_no_mail:"1f4ed",postbox:"1f4ee",postal_horn:"1f4ef",newspaper:"1f4f0",iphone:"1f4f1",calling:"1f4f2",vibration_mode:"1f4f3",mobile_phone_off:"1f4f4",no_mobile_phones:"1f4f5",signal_strength:"1f4f6",camera:"1f4f7",video_camera:"1f4f9",tv:"1f4fa",radio:"1f4fb",vhs:"1f4fc",twisted_rightwards_arrows:"1f500",repeat:"1f501",repeat_one:"1f502",arrows_clockwise:"1f503",arrows_counterclockwise:"1f504",low_brightness:"1f505",high_brightness:"1f506",mute:"1f507",speaker:"1f508",sound:"1f509",loud_sound:"1f50a",battery:"1f50b",electric_plug:"1f50c",mag:"1f50d",mag_right:"1f50e",lock_with_ink_pen:"1f50f",closed_lock_with_key:"1f510",key:"1f511",lock:"1f512",unlock:"1f513",bell:"1f514",no_bell:"1f515",bookmark:"1f516",link:"1f517",radio_button:"1f518",back:"1f519",end:"1f51a",on:"1f51b",soon:"1f51c",top:"1f51d",underage:"1f51e",keycap_ten:"1f51f",capital_abcd:"1f520",abcd:"1f521",1234:"1f522",symbols:"1f523",abc:"1f524",fire:"1f525",flashlight:"1f526",wrench:"1f527",hammer:"1f528",nut_and_bolt:"1f529",hocho:"1f52a",knife:"1f52a",gun:"1f52b",microscope:"1f52c",telescope:"1f52d",crystal_ball:"1f52e",six_pointed_star:"1f52f",beginner:"1f530",trident:"1f531",black_square_button:"1f532",white_square_button:"1f533",red_circle:"1f534",large_blue_circle:"1f535",large_orange_diamond:"1f536",large_blue_diamond:"1f537",small_orange_diamond:"1f538",small_blue_diamond:"1f539",small_red_triangle:"1f53a",small_red_triangle_down:"1f53b",arrow_up_small:"1f53c",arrow_down_small:"1f53d",clock1:"1f550",clock2:"1f551",clock3:"1f552",clock4:"1f553",clock5:"1f554",clock6:"1f555",clock7:"1f556",clock8:"1f557",clock9:"1f558",clock10:"1f559",clock11:"1f55a",clock12:"1f55b",clock130:"1f55c",clock230:"1f55d",clock330:"1f55e",clock430:"1f55f",clock530:"1f560",clock630:"1f561",clock730:"1f562",clock830:"1f563",clock930:"1f564",clock1030:"1f565",clock1130:"1f566",clock1230:"1f567",mount_fuji:"1f5fb",tokyo_tower:"1f5fc",statue_of_liberty:"1f5fd",japan:"1f5fe",moyai:"1f5ff",grinning:"1f600",grin:"1f601",joy:"1f602",smiley:"1f603",smile:"1f604",sweat_smile:"1f605",laughing:"1f606",satisfied:"1f606",innocent:"1f607",smiling_imp:"1f608",wink:"1f609",blush:"1f60a",yum:"1f60b",relieved:"1f60c",heart_eyes:"1f60d",sunglasses:"1f60e",smirk:"1f60f",neutral_face:"1f610",expressionless:"1f611",unamused:"1f612",sweat:"1f613",pensive:"1f614",confused:"1f615",confounded:"1f616",kissing:"1f617",kissing_heart:"1f618",kissing_smiling_eyes:"1f619",kissing_closed_eyes:"1f61a",stuck_out_tongue:"1f61b",stuck_out_tongue_winking_eye:"1f61c",stuck_out_tongue_closed_eyes:"1f61d",disappointed:"1f61e",worried:"1f61f",angry:"1f620",rage:"1f621",cry:"1f622",persevere:"1f623",triumph:"1f624",disappointed_relieved:"1f625",frowning:"1f626",anguished:"1f627",fearful:"1f628",weary:"1f629",sleepy:"1f62a",tired_face:"1f62b",grimacing:"1f62c",sob:"1f62d",open_mouth:"1f62e",hushed:"1f62f",cold_sweat:"1f630",scream:"1f631",astonished:"1f632",flushed:"1f633",sleeping:"1f634",dizzy_face:"1f635",no_mouth:"1f636",mask:"1f637",smile_cat:"1f638",joy_cat:"1f639",smiley_cat:"1f63a",heart_eyes_cat:"1f63b",smirk_cat:"1f63c",kissing_cat:"1f63d",pouting_cat:"1f63e",crying_cat_face:"1f63f",scream_cat:"1f640",no_good:"1f645",ok_woman:"1f646",bow:"1f647",see_no_evil:"1f648",hear_no_evil:"1f649",speak_no_evil:"1f64a",raising_hand:"1f64b",raised_hands:"1f64c",person_frowning:"1f64d",person_with_pouting_face:"1f64e",pray:"1f64f",rocket:"1f680",helicopter:"1f681",steam_locomotive:"1f682",railway_car:"1f683",bullettrain_side:"1f684",bullettrain_front:"1f685",train2:"1f686",metro:"1f687",light_rail:"1f688",station:"1f689",tram:"1f68a",train:"1f68b",bus:"1f68c",oncoming_bus:"1f68d",trolleybus:"1f68e",busstop:"1f68f",minibus:"1f690",ambulance:"1f691",fire_engine:"1f692",police_car:"1f693",oncoming_police_car:"1f694",taxi:"1f695",oncoming_taxi:"1f696",car:"1f697",red_car:"1f697",oncoming_automobile:"1f698",blue_car:"1f699",truck:"1f69a",articulated_lorry:"1f69b",tractor:"1f69c",monorail:"1f69d",mountain_railway:"1f69e",suspension_railway:"1f69f",mountain_cableway:"1f6a0",aerial_tramway:"1f6a1",ship:"1f6a2",rowboat:"1f6a3",speedboat:"1f6a4",traffic_light:"1f6a5",vertical_traffic_light:"1f6a6",construction:"1f6a7",rotating_light:"1f6a8",triangular_flag_on_post:"1f6a9",door:"1f6aa",no_entry_sign:"1f6ab",smoking:"1f6ac",no_smoking:"1f6ad",put_litter_in_its_place:"1f6ae",do_not_litter:"1f6af",potable_water:"1f6b0","non-potable_water":"1f6b1",bike:"1f6b2",no_bicycles:"1f6b3",bicyclist:"1f6b4",mountain_bicyclist:"1f6b5",walking:"1f6b6",no_pedestrians:"1f6b7",children_crossing:"1f6b8",mens:"1f6b9",womens:"1f6ba",restroom:"1f6bb",baby_symbol:"1f6bc",toilet:"1f6bd",wc:"1f6be",shower:"1f6bf",bath:"1f6c0",bathtub:"1f6c1",passport_control:"1f6c2",customs:"1f6c3",baggage_claim:"1f6c4",left_luggage:"1f6c5",hash:"0023-20e3",zero:"0030-20e3",one:"0031-20e3",two:"0032-20e3",three:"0033-20e3",four:"0034-20e3",five:"0035-20e3",six:"0036-20e3",seven:"0037-20e3",eight:"0038-20e3",nine:"0039-20e3",ae:"1f1e6-1f1ea",at:"1f1e6-1f1f9",au:"1f1e6-1f1fa",be:"1f1e7-1f1ea",br:"1f1e7-1f1f7",ca:"1f1e8-1f1e6",ch:"1f1e8-1f1ed",cn:"1f1e8-1f1f3",co:"1f1e8-1f1f4",de:"1f1e9-1f1ea",dk:"1f1e9-1f1f0",es:"1f1ea-1f1f8",fi:"1f1eb-1f1ee",fr:"1f1eb-1f1f7",gb:"1f1ec-1f1e7",uk:"1f1ec-1f1e7",hk:"1f1ed-1f1f0",ie:"1f1ee-1f1ea",il:"1f1ee-1f1f1",in:"1f1ee-1f1f3",it:"1f1ee-1f1f9",jp:"1f1ef-1f1f5",kr:"1f1f0-1f1f7",mo:"1f1f2-1f1f4",mx:"1f1f2-1f1fd",my:"1f1f2-1f1fe",nl:"1f1f3-1f1f1",no:"1f1f3-1f1f4",nz:"1f1f3-1f1ff",ph:"1f1f5-1f1ed",pl:"1f1f5-1f1f1",pr:"1f1f5-1f1f7",pt:"1f1f5-1f1f9",ru:"1f1f7-1f1fa",se:"1f1f8-1f1ea",sg:"1f1f8-1f1ec",tr:"1f1f9-1f1f7",us:"1f1fa-1f1f8",vn:"1f1fb-1f1f3",za:"1f1ff-1f1e6","man-man-boy":"1f468-1f468-1f466","man-man-boy-boy":"1f468-1f468-1f466-1f466","man-man-girl":"1f468-1f468-1f467","man-man-girl-boy":"1f468-1f468-1f467-1f466","man-man-girl-girl":"1f468-1f468-1f467-1f467","man-woman-boy":"1f468-1f469-1f466","man-woman-boy-boy":"1f468-1f469-1f466-1f466","man-woman-girl":"1f468-1f469-1f467","man-woman-girl-girl":"1f468-1f469-1f467-1f467","man-heart-man":"1f468-2764-fe0f-1f468","man-kiss-man":"1f468-2764-fe0f-1f48b-1f468","woman-woman-boy":"1f469-1f469-1f466","woman-woman-boy-boy":"1f469-1f469-1f466-1f466","woman-woman-girl":"1f469-1f469-1f467","woman-woman-girl-boy":"1f469-1f469-1f467-1f466","woman-woman-girl-girl":"1f469-1f469-1f467-1f467","woman-heart-woman":"1f469-2764-fe0f-1f469","woman-kiss-woman":"1f469-2764-fe0f-1f48b-1f469"}}}()),angular.module("vkEmojiPicker").directive("emojiPicker",["EmojiGroups","vkEmojiStorage","vkEmojiTransforms",function(emojiGroups,storage,vkEmojiTransforms){var templateUrl="templates/emoji-button-bootstrap.html";try{angular.module("ui.bootstrap.popover")}catch(e){try{angular.module("mgcrea.ngStrap.popover"),templateUrl="templates/emoji-button-strap.html"}catch(e){templateUrl="templates/emoji-button.html"}}return{restrict:"A",templateUrl:templateUrl,scope:{model:"=emojiPicker",placement:"@",title:"@",onChangeFunc:"="},link:function($scope,element,attrs){function formatSelectedEmoji(emoji,type){return emoji=[" :",emoji,":"].join(""),"unicode"==type?vkEmojiTransforms.emojify(emoji):emoji}function fireOnChangeFunc(){$scope.onChangeFunc&&"function"==typeof $scope.onChangeFunc&&setTimeout($scope.onChangeFunc)}var recentLimit=parseInt(attrs.recentLimit,10)||54,outputFormat=attrs.outputFormat||"";$scope.groups=emojiGroups.groups,$scope.selectedGroup=emojiGroups.groups[0],$scope.selectedGroup.emoji=storage.getFirst(recentLimit),$scope.append=function(emoji){null==$scope.model&&($scope.model=""),$scope.model+=formatSelectedEmoji(emoji,outputFormat),$scope.model=$scope.model.trim(),storage.store(emoji),fireOnChangeFunc()},$scope.remove=function(){if(angular.isDefined($scope.model)){var words=$scope.model.split(" ");words.pop(),$scope.model=words.join(" ").trim(),fireOnChangeFunc()}},$scope.toClassName=function(emoji){return emoji.replace(/_/g,"-")},$scope.changeGroup=function(group){$scope.selectedGroup=group,"recent"===$scope.selectedGroup.name&&($scope.selectedGroup.emoji=storage.getFirst(recentLimit))},$scope.$on("$destroy",function(){element.remove()})}}}]),angular.module("vkEmojiPicker").directive("emojiPopover",["$emojiPopover",function($emojiPopover){return{restrict:"A",link:function($scope,element,attrs){var config={scope:$scope};config.title=attrs.title||"",config.placement=attrs.placement||"top",config.template=attrs.template||"templates/emoji-popover.html";var popover=$emojiPopover(element,config);$scope.$on("$destroy",function(){popover&&popover.destroy(),config=null,popover=null})}}}]),angular.module("vkEmojiPicker").directive("emojiRemovable",function(){return{restrict:"A",scope:{model:"=emojiRemovable"},link:function($scope,element){var createMapping=function(words,emojis){var map=[],offset=0;return angular.forEach(emojis,function(emoji){for(var emojiElement=angular.element(emoji),regexp=new RegExp("^:?"+emojiElement.attr("alt")+":?$"),i=offset;i=0&&emojiArray.splice(emojiIndex,1)}emojiArray.unshift(value),storage.setItem("emojiPicker",JSON.stringify(emojiArray))},factory.getFirst=function(count){var count=count||1,emojiString=storage.getItem("emojiPicker");return null==emojiString?[]:JSON.parse(emojiString).slice(0,count)},factory.clear=function(){storage.clear()},factory}]),angular.module("vkEmojiPicker").factory("vkEmojiTransforms",["EmojiHex","EmojiGroups",function(EmojiHex,EmojiGroups){function getUnicodes(){var swappedHex={},unicodes=[];return angular.forEach(EmojiHex.emoji,function(value,key){swappedHex[value]=key,unicodes.push(value)}),unicodes.reverse()}function hexify(text){if(null==text)return"";var matches=text.match(/\:([a-z0-9_+-]+)(?:\[((?:[^\]]|\][^:])*\]?)\])?\:/g);if(null===matches)return text;for(var i=0;i'].join("")})}function unicodify(text){if(null==text)return"";var matches=text.match(regexHex);if(null===matches)return text;for(var i=0,len=matches.length;i-1)var codePoints=hexString.split("-"),unicode=eval("String.fromCodePoint(0x"+codePoints.join(", 0x")+")");else var codePoint=["0x",hexString].join(""),unicode=String.fromCodePoint(codePoint);text=text.replace(hexString,unicode)}return text}function emojify(input){return unicodify(hexify(input))}var transforms={hexify:hexify,imagify:imagify,unicodify:unicodify,emojify:emojify},regex=new RegExp(":("+EmojiGroups.all.join("|")+"):","g"),regexHex=new RegExp("("+getUnicodes().join("|")+")","g");return transforms}]),function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports):"function"==typeof define&&define.amd?define(["exports"],b):b(a.Notify=a.Notify||{})}(this,function(a){"use strict";function d(a){return"function"==typeof a}function e(a){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if("string"!=typeof a)throw new Error("Notify(): first arg (title) must be a string.");if("object"!=typeof c)throw new Error("Notify(): second arg (options) must be an object.");var e=c.notifyShow,f=void 0===e?null:e,g=c.notifyClose,h=void 0===g?null:g,i=c.notifyClick,j=void 0===i?null:i,k=c.notifyError,l=void 0===k?null:k,m=c.closeOnClick,n=void 0!==m&&m,o=c.timeout,p=void 0===o?null:o,q=b(c,["notifyShow","notifyClose","notifyClick","notifyError","closeOnClick","timeout"]);this.title=a,this.options=q,this.permission=null,this.closeOnClick=n,this.timeout=p,d(f)&&(this.onShowCallback=f),d(h)&&(this.onCloseCallback=h),d(j)&&(this.onClickCallback=j),d(l)&&(this.onErrorCallback=l)}var b=function(a,b){var c={};for(var d in a)b.indexOf(d)>=0||Object.prototype.hasOwnProperty.call(a,d)&&(c[d]=a[d]);return c},c=window.Notification;e.isSupported=function(a){if(!c||!c.requestPermission)return!1;if("granted"===a||"granted"===c.permission)throw new Error("You must only call this before calling Notification.requestPermission(), otherwise this feature detect would trigger an actual notification!");try{new c("")}catch(a){if("TypeError"===a.name)return!1}return!0},e.needsPermission=!c||!c.permission||"granted"!==c.permission,e.requestPermission=function(a,b){c.requestPermission(function(c){switch(c){case"granted":e.needsPermission=!1,d(a)&&a();break;case"denied":e.needsPermission=!0,d(b)&&b()}})},e.prototype.show=function(){this.myNotify=new c(this.title,this.options),this.options.requireInteraction||!this.timeout||isNaN(this.timeout)||setTimeout(this.close.bind(this),1e3*this.timeout),this.myNotify.addEventListener("show",this,!1),this.myNotify.addEventListener("error",this,!1),this.myNotify.addEventListener("close",this,!1),this.myNotify.addEventListener("click",this,!1)},e.prototype.onShowNotification=function(a){this.onShowCallback&&this.onShowCallback(a)},e.prototype.onCloseNotification=function(a){this.onCloseCallback&&this.onCloseCallback(a),this.destroy()},e.prototype.onClickNotification=function(a){this.onClickCallback&&this.onClickCallback(a),this.closeOnClick&&this.close()},e.prototype.onErrorNotification=function(a){this.onErrorCallback&&this.onErrorCallback(a),this.destroy()},e.prototype.destroy=function(){this.myNotify.removeEventListener("show",this,!1),this.myNotify.removeEventListener("error",this,!1),this.myNotify.removeEventListener("close",this,!1),this.myNotify.removeEventListener("click",this,!1)},e.prototype.close=function(){this.myNotify.close()},e.prototype.handleEvent=function(a){switch(a.type){case"show":this.onShowNotification(a);break;case"close":this.onCloseNotification(a);break;case"click":this.onClickNotification(a);break;case"error":this.onErrorNotification(a)}},a.default=e}),window.DESKTOP_NOTIFICATIONS_ENABLED=!1;var Notify=window.Notify.default,Sound=new Audio("./assets/notification.mp3");Notify.needsPermission?Notify.isSupported()&&Notify.requestPermission(onPermissionGranted,onPermissionDenied):window.DESKTOP_NOTIFICATIONS_ENABLED=!0,function(window,document){angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function($compileProvider){angular.isDefined($compileProvider.urlSanitizationWhitelist)?$compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function($q){var specialChars={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(data,options){return"locale"===options.decimalSep&&this.isFloat(data)?data.toLocaleString():"."!==options.decimalSep&&this.isFloat(data)?data.toString().replace(".",options.decimalSep):"string"==typeof data?(data=data.replace(/"/g,'""'),(options.quoteStrings||data.indexOf(",")>-1||data.indexOf("\n")>-1||data.indexOf("\r")>-1)&&(data=options.txtDelim+data+options.txtDelim),data):"boolean"==typeof data?data?"TRUE":"FALSE":data},this.isFloat=function(input){return+input===input&&(!isFinite(input)||Boolean(input%1))},this.stringify=function(data,options){var def=$q.defer(),that=this,csv="",csvContent="",dataPromise=$q.when(data).then(function(responseData){if(angular.isDefined(options.header)&&options.header){var encodingArray,headerString;encodingArray=[],angular.forEach(options.header,function(title,key){this.push(that.stringifyField(title,options))},encodingArray),headerString=encodingArray.join(options.fieldSep?options.fieldSep:","),csvContent+=headerString+"\r\n"}var arrData=[];if(angular.isArray(responseData)?arrData=responseData:angular.isFunction(responseData)&&(arrData=responseData()),angular.isDefined(options.label)&&options.label&&"boolean"==typeof options.label){var labelArray,labelString;labelArray=[],angular.forEach(arrData[0],function(value,label){this.push(that.stringifyField(label,options))},labelArray),labelString=labelArray.join(options.fieldSep?options.fieldSep:","),csvContent+=labelString+"\r\n"}angular.forEach(arrData,function(oldRow,index){var dataString,infoArray,row=angular.copy(arrData[index]);infoArray=[];var iterator=options.columnOrder?options.columnOrder:row;angular.forEach(iterator,function(field,key){var val=options.columnOrder?row[field]:field;this.push(that.stringifyField(val,options))},infoArray),dataString=infoArray.join(options.fieldSep?options.fieldSep:","),csvContent+=index'),downloadLink=angular.element(downloadContainer.children()[0]);downloadLink.attr("href",window.URL.createObjectURL(blob)),downloadLink.attr("download",scope.getFilename()),downloadLink.attr("target","_blank"),$document.find("body").append(downloadContainer),$timeout(function(){downloadLink[0].click(),downloadLink.remove()},null)}}element.bind("click",function(e){scope.buildCSV().then(function(csv){doClick()}),scope.$apply()})}}}])}(window,document),function(exports,undefined){"use strict";function require(ids,callback){for(var module,defs=[],i=0;i=constrainRect.x&&pos.x+pos.w<=constrainRect.w+constrainRect.x&&pos.y>=constrainRect.y&&pos.y+pos.h<=constrainRect.h+constrainRect.y)return rels[i];return null}function inflate(rect,w,h){return create(rect.x-w,rect.y-h,rect.w+2*w,rect.h+2*h)}function intersect(rect,cropRect){var x1,y1,x2,y2;return x1=max(rect.x,cropRect.x),y1=max(rect.y,cropRect.y),x2=min(rect.x+rect.w,cropRect.x+cropRect.w),y2=min(rect.y+rect.h,cropRect.y+cropRect.h),x2-x1<0||y2-y1<0?null:create(x1,y1,x2-x1,y2-y1)}function clamp(rect,clampRect,fixedSize){var underflowX1,underflowY1,overflowX2,overflowY2,x1,y1,x2,y2,cx2,cy2;return x1=rect.x,y1=rect.y,x2=rect.x+rect.w,y2=rect.y+rect.h,cx2=clampRect.x+clampRect.w,cy2=clampRect.y+clampRect.h,underflowX1=max(0,clampRect.x-x1),underflowY1=max(0,clampRect.y-y1),overflowX2=max(0,x2-cx2),overflowY2=max(0,y2-cy2),x1+=underflowX1,y1+=underflowY1,fixedSize&&(x2+=underflowX1,y2+=underflowY1,x1-=overflowX2,y1-=overflowY2),x2-=overflowX2,y2-=overflowY2,create(x1,y1,x2-x1,y2-y1)}function create(x,y,w,h){return{x:x,y:y,w:w,h:h}}function fromClientRect(clientRect){return create(clientRect.left,clientRect.top,clientRect.width,clientRect.height)}var min=Math.min,max=Math.max,round=Math.round;return{inflate:inflate,relativePosition:relativePosition,findBestRelativePosition:findBestRelativePosition,intersect:intersect,clamp:clamp,create:create,fromClientRect:fromClientRect}}),define("tinymce/util/Promise",[],function(){function bind(fn,thisArg){return function(){fn.apply(thisArg,arguments)}}function Promise(fn){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof fn)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],doResolve(fn,bind(resolve,this),bind(reject,this))}function handle(deferred){var me=this;if(null===this._state)return void this._deferreds.push(deferred);asap(function(){var cb=me._state?deferred.onFulfilled:deferred.onRejected;if(null===cb)return void(me._state?deferred.resolve:deferred.reject)(me._value);var ret;try{ret=cb(me._value)}catch(e){return void deferred.reject(e)}deferred.resolve(ret)})}function resolve(newValue){try{if(newValue===this)throw new TypeError("A promise cannot be resolved with itself.");if(newValue&&("object"==typeof newValue||"function"==typeof newValue)){var then=newValue.then;if("function"==typeof then)return void doResolve(bind(then,newValue),bind(resolve,this),bind(reject,this))}this._state=!0,this._value=newValue,finale.call(this)}catch(e){reject.call(this,e)}}function reject(newValue){this._state=!1,this._value=newValue,finale.call(this)}function finale(){for(var i=0,len=this._deferreds.length;i=534,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=ie,range:window.getSelection&&"Range"in window,documentMode:ie&&!ie12?document.documentMode||7:10,fileApi:fileApi,ceFalse:ie===!1||ie>8,canHaveCSP:ie===!1||ie>11,desktop:!phone&&!tablet,windowsPhone:windowsPhone}}),define("tinymce/dom/EventUtils",["tinymce/util/Delay","tinymce/Env"],function(Delay,Env){function addEvent(target,name,callback,capture){target.addEventListener?target.addEventListener(name,callback,capture||!1):target.attachEvent&&target.attachEvent("on"+name,callback)}function removeEvent(target,name,callback,capture){target.removeEventListener?target.removeEventListener(name,callback,capture||!1):target.detachEvent&&target.detachEvent("on"+name,callback)}function getTargetFromShadowDom(event,defaultTarget){var path,target=defaultTarget;return path=event.path,path&&path.length>0&&(target=path[0]),event.deepPath&&(path=event.deepPath())&&path.length>0&&(target=path[0]),target}function fix(originalEvent,data){function returnFalse(){return!1}function returnTrue(){return!0}var name,event=data||{};for(name in originalEvent)deprecated[name]||(event[name]=originalEvent[name]);if(event.target||(event.target=event.srcElement||document),Env.experimentalShadowDom&&(event.target=getTargetFromShadowDom(originalEvent,event.target)),originalEvent&&mouseEventRe.test(originalEvent.type)&&void 0===originalEvent.pageX&&void 0!==originalEvent.clientX){var eventDoc=event.target.ownerDocument||document,doc=eventDoc.documentElement,body=eventDoc.body;event.pageX=originalEvent.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0),event.pageY=originalEvent.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}return event.preventDefault=function(){event.isDefaultPrevented=returnTrue,originalEvent&&(originalEvent.preventDefault?originalEvent.preventDefault():originalEvent.returnValue=!1)},event.stopPropagation=function(){event.isPropagationStopped=returnTrue,originalEvent&&(originalEvent.stopPropagation?originalEvent.stopPropagation():originalEvent.cancelBubble=!0)},event.stopImmediatePropagation=function(){event.isImmediatePropagationStopped=returnTrue,event.stopPropagation()},event.isDefaultPrevented||(event.isDefaultPrevented=returnFalse,event.isPropagationStopped=returnFalse,event.isImmediatePropagationStopped=returnFalse),void 0===event.metaKey&&(event.metaKey=!1),event}function bindOnReady(win,callback,eventUtils){function readyHandler(){eventUtils.domLoaded||(eventUtils.domLoaded=!0,callback(event))}function waitForDomLoaded(){("complete"===doc.readyState||"interactive"===doc.readyState&&doc.body)&&(removeEvent(doc,"readystatechange",waitForDomLoaded),readyHandler())}function tryScroll(){try{doc.documentElement.doScroll("left")}catch(ex){return void Delay.setTimeout(tryScroll)}readyHandler()}var doc=win.document,event={type:"ready"};if(eventUtils.domLoaded)return void callback(event);doc.addEventListener?"complete"===doc.readyState?readyHandler():addEvent(win,"DOMContentLoaded",readyHandler):(addEvent(doc,"readystatechange",waitForDomLoaded),doc.documentElement.doScroll&&win.self===win.top&&tryScroll()),addEvent(win,"load",readyHandler)}function EventUtils(){function executeHandlers(evt,id){var callbackList,i,l,callback,container=events[id];if(callbackList=container&&container[evt.type])for(i=0,l=callbackList.length;iExpr.cacheLength&&delete cache[keys.shift()],cache[key+" "]=value}var keys=[];return cache}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var div=document.createElement("div");try{return!!fn(div)}catch(e){return!1}finally{div.parentNode&&div.parentNode.removeChild(div),div=null}}function addHandle(attrs,handler){for(var arr=attrs.split("|"),i=attrs.length;i--;)Expr.attrHandle[arr[i]]=handler}function siblingCheck(a,b){var cur=b&&a,diff=cur&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||MAX_NEGATIVE)-(~a.sourceIndex||MAX_NEGATIVE);if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createPositionalPseudo(fn){return markFunction(function(argument){return argument=+argument,markFunction(function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))})})}function testContext(context){return context&&typeof context.getElementsByTagName!==strundefined&&context}function setFilters(){}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i-1&&(seed[temp]=!(results[temp]=elem))}}else matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)})}function matcherFromTokens(tokens){for(var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,!0),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1},implicitRelative,!0),matchers=[function(elem,context,xml){return!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml))}];i1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:" "===tokens[i-2].type?"*":""})).replace(rtrim,"$1"),matcher,i0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",outermost),dirrunsUnique=dirruns+=null==contextBackup?1:Math.random()||.1,len=elems.length;for(outermost&&(outermostContext=context!==document&&context);i!==len&&null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0;matcher=elementMatchers[j++];)if(matcher(elem,context,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+-new Date,preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),sortOrder=function(a,b){return a===b&&(hasDuplicate=!0),0},strundefined=typeof undefined,MAX_NEGATIVE=1<<31,hasOwn={}.hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=arr.indexOf||function(elem){for(var i=0,len=this.length;i+~]|"+whitespace+")"+whitespace+"*"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*?)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+identifier+")"),CLASS:new RegExp("^\\.("+identifier+")"),TAG:new RegExp("^("+identifier+"|[*])"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,rescape=/'|\\/g,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-65536;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)};try{push.apply(arr=slice.call(preferredDoc.childNodes),preferredDoc.childNodes),arr[preferredDoc.childNodes.length].nodeType}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els))}:function(target,els){for(var j=target.length,i=0;target[j++]=els[i++];);target.length=j-1}}}support=Sizzle.support={},isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return!!documentElement&&"HTML"!==documentElement.nodeName},setDocument=Sizzle.setDocument=function(node){var hasCompare,doc=node?node.ownerDocument||node:preferredDoc,parent=doc.defaultView;return doc!==document&&9===doc.nodeType&&doc.documentElement?(document=doc,docElem=doc.documentElement,documentIsHTML=!isXML(doc),parent&&parent!==function(win){try{return win.top}catch(ex){}return null}(parent)&&(parent.addEventListener?parent.addEventListener("unload",function(){setDocument()},!1):parent.attachEvent&&parent.attachEvent("onunload",function(){setDocument()})),support.attributes=assert(function(div){return div.className="i",!div.getAttribute("className")}),support.getElementsByTagName=assert(function(div){return div.appendChild(doc.createComment("")),!div.getElementsByTagName("*").length}),support.getElementsByClassName=rnative.test(doc.getElementsByClassName),support.getById=assert(function(div){return docElem.appendChild(div).id=expando,!doc.getElementsByName||!doc.getElementsByName(expando).length}),support.getById?(Expr.find.ID=function(id,context){if(typeof context.getElementById!==strundefined&&documentIsHTML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape) ;return function(elem){return elem.getAttribute("id")===attrId}}):(delete Expr.find.ID,Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!==strundefined&&elem.getAttributeNode("id");return node&&node.value===attrId}}),Expr.find.TAG=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!==strundefined)return context.getElementsByTagName(tag)}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.CLASS=support.getElementsByClassName&&function(className,context){if(documentIsHTML)return context.getElementsByClassName(className)},rbuggyMatches=[],rbuggyQSA=[],(support.qsa=rnative.test(doc.querySelectorAll))&&(assert(function(div){div.innerHTML="",div.querySelectorAll("[msallowcapture^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")"),div.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")"),div.querySelectorAll(":checked").length||rbuggyQSA.push(":checked")}),assert(function(div){var input=doc.createElement("input");input.setAttribute("type","hidden"),div.appendChild(input).setAttribute("name","D"),div.querySelectorAll("[name=d]").length&&rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?="),div.querySelectorAll(":enabled").length||rbuggyQSA.push(":enabled",":disabled"),div.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")})),(support.matchesSelector=rnative.test(matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert(function(div){support.disconnectedMatch=matches.call(div,"div"),matches.call(div,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)}),rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|")),rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|")),hasCompare=rnative.test(docElem.compareDocumentPosition),contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=hasCompare?function(a,b){if(a===b)return hasDuplicate=!0,0;var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;return compare||(compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&compare||!support.sortDetached&&b.compareDocumentPosition(a)===compare?a===doc||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)?-1:b===doc||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)?1:sortInput?indexOf.call(sortInput,a)-indexOf.call(sortInput,b):0:4&compare?-1:1)}:function(a,b){if(a===b)return hasDuplicate=!0,0;var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup)return a===doc?-1:b===doc?1:aup?-1:bup?1:sortInput?indexOf.call(sortInput,a)-indexOf.call(sortInput,b):0;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0},doc):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document&&setDocument(elem),expr=expr.replace(rattributeQuotes,"='$1']"),support.matchesSelector&&documentIsHTML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr)))try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&11!==elem.document.nodeType)return ret}catch(e){}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!==document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){(elem.ownerDocument||elem)!==document&&setDocument(elem);var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val!==undefined?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;if(hasDuplicate=!support.detectDuplicates,sortInput=!support.sortStable&&results.slice(0),results.sort(sortOrder),hasDuplicate){for(;elem=results[i++];)elem===results[i]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return sortInput=null,results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i++];)ret+=getText(node);return ret},Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[6]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[3]?match[2]=match[4]||match[5]||"":unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return"*"===nodeNameSelector?function(){return!0}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName}},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test("string"==typeof elem.className&&elem.className||typeof elem.getAttribute!==strundefined&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:!operator||(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===operator?check&&result.indexOf(check)>-1:"$="===operator?check&&result.slice(-check.length)===check:"~="===operator?(" "+result+" ").indexOf(check)>-1:"|="===operator&&(result===check||result.slice(0,check.length+1)===check+"-"))}},CHILD:function(type,what,argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(outerCache=parent[expando]||(parent[expando]={}),cache=outerCache[type]||[],nodeIndex=cache[0]===dirruns&&cache[1],diff=cache[0]===dirruns&&cache[2],node=nodeIndex&&parent.childNodes[nodeIndex];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns)diff=cache[1];else for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&((node[expando]||(node[expando]={}))[type]=[dirruns,diff]),node!==elem)););return(diff-=last)===first||diff%first==0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)idx=indexOf.call(seed,matched[i]),seed[idx]=!(matches[idx]=matched[i])}):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))}):function(elem,context,xml){return input[0]=elem,matcher(input,null,xml,results),!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){return text=text.replace(runescape,funescape),function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do{if(elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))return(elemLang=elemLang.toLowerCase())===lang||0===elemLang.indexOf(lang+"-")}while((elem=elem.parentNode)&&1===elem.nodeType);return!1}}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:function(elem){return elem.disabled===!1},disabled:function(elem){return elem.disabled===!0},checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,elem.selected===!0},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeType<6)return!1;return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||"text"===attr.toLowerCase())},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){for(var i=0;i=0;)matchIndexes.push(i);return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;++i2&&"ID"===(token=tokens[0]).type&&support.getById&&9===context.nodeType&&documentIsHTML&&Expr.relative[tokens[1].type]){if(!(context=(Expr.find.ID(token.matches[0].replace(runescape,funescape),context)||[])[0]))return results;compiled&&(context=context.parentNode),selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){if(tokens.splice(i,1),!(selector=seed.length&&toSelector(tokens)))return push.apply(results,seed),results;break}}return(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,rsibling.test(selector)&&testContext(context.parentNode)||context),results},support.sortStable=expando.split("").sort(sortOrder).join("")===expando,support.detectDuplicates=!!hasDuplicate,setDocument(),support.sortDetached=assert(function(div1){return 1&div1.compareDocumentPosition(document.createElement("div"))}),assert(function(div){return div.innerHTML="","#"===div.firstChild.getAttribute("href")})||addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML)return elem.getAttribute(name,"type"===name.toLowerCase()?1:2)}),support.attributes&&assert(function(div){return div.innerHTML="",div.firstChild.setAttribute("value",""),""===div.firstChild.getAttribute("value")})||addHandle("value",function(elem,name,isXML){if(!isXML&&"input"===elem.nodeName.toLowerCase())return elem.defaultValue}),assert(function(div){return null==div.getAttribute("disabled")})||addHandle(booleans,function(elem,name,isXML){var val;if(!isXML)return elem[name]===!0?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null}),Sizzle}),define("tinymce/util/Arr",[],function(){function toArray(obj){var i,l,array=obj;if(!isArray(obj))for(array=[],i=0,l=obj.length;i=0;i--)domManipulate(targetNodes,sourceItem[i],callback,reverse);else for(i=0;i)[^>]*$|#([\w\-]*)$)/,Event=EventUtils.Event,skipUniques=Tools.makeMap("children,contents,next,prev"),numericCssMap=Tools.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),booleanMap=Tools.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),propFix={for:"htmlFor",class:"className",readonly:"readOnly"},cssFix={float:"cssFloat"},attrHooks={},cssHooks={},whiteSpaceRegExp=/^\s*|\s*$/g;return DomQuery.fn=DomQuery.prototype={constructor:DomQuery,selector:"",context:null,length:0,init:function(selector,context){var match,node,self=this;if(!selector)return self;if(selector.nodeType)return self.context=self[0]=selector,self.length=1,self;if(context&&context.nodeType)self.context=context;else{if(context)return DomQuery(selector).attr(context);self.context=context=document}if(isString(selector)){if(self.selector=selector,!(match="<"===selector.charAt(0)&&">"===selector.charAt(selector.length-1)&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector)))return DomQuery(context).find(selector);if(match[1])for(node=createFragment(selector,getElementDocument(context)).firstChild;node;)push.call(self,node),node=node.nextSibling;else{if(!(node=getElementDocument(context).getElementById(match[2])))return self;if(node.id!==match[2])return self.find(selector);self.length=1,self[0]=node}}else this.add(selector,!1);return self},toArray:function(){return Tools.toArray(this)},add:function(items,sort){var nodes,i,self=this;if(isString(items))return self.add(DomQuery(items));if(sort!==!1)for(nodes=DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items))),self.length=nodes.length,i=0;i1&&(skipUniques[name]||(result=DomQuery.unique(result)),0===name.indexOf("parents")&&(result=result.reverse())),result=DomQuery(result),selector?result.filter(selector):result}}),each({parentsUntil:function(node,until){return dir(node,"parentNode",until)},nextUntil:function(node,until){return sibling(node,"nextSibling",1,until).slice(1)},prevUntil:function(node,until){return sibling(node,"previousSibling",1,until).slice(1)}},function(name,fn){DomQuery.fn[name]=function(selector,filter){var self=this,result=[];return self.each(function(){var nodes=fn.call(result,this,selector,result);nodes&&(DomQuery.isArray(nodes)?result.push.apply(result,nodes):result.push(nodes))}),this.length>1&&(result=DomQuery.unique(result),0!==name.indexOf("parents")&&"prevUntil"!==name||(result=result.reverse())),result=DomQuery(result),filter?result.filter(filter):result}}),DomQuery.fn.is=function(selector){return!!selector&&this.filter(selector).length>0},DomQuery.fn.init.prototype=DomQuery.fn,DomQuery.overrideDefaults=function(callback){function sub(selector,context){return defaults=defaults||callback(),0===arguments.length&&(selector=defaults.element),context||(context=defaults.context),new sub.fn.init(selector,context)}var defaults;return DomQuery.extend(sub,this),sub},Env.ie&&Env.ie<8&&(appendHooks(attrHooks,"get",{maxlength:function(elm){var value=elm.maxLength;return 2147483647===value?undef:value},size:function(elm){var value=elm.size;return 20===value?undef:value},class:function(elm){return elm.className},style:function(elm){var value=elm.style.cssText;return 0===value.length?undef:value}}),appendHooks(attrHooks,"set",{class:function(elm,value){elm.className=value},style:function(elm,value){elm.style.cssText=value}})),Env.ie&&Env.ie<9&&(cssFix.float="styleFloat",appendHooks(cssHooks,"set",{opacity:function(elm,value){var style=elm.style;null===value||""===value?style.removeAttribute("filter"):(style.zoom=1,style.filter="alpha(opacity="+100*value+")")}})),DomQuery.attrHooks=attrHooks,DomQuery.cssHooks=cssHooks,DomQuery}),define("tinymce/html/Styles",[],function(){return function(settings,schema){function toHex(match,r,g,b){function hex(val){return val=parseInt(val,10).toString(16),val.length>1?val:"0"+val}return"#"+hex(r)+hex(g)+hex(b)}var i,encodingItems,validStyles,invalidStyles,rgbRegExp=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,styleRegExp=/\s*([^:]+):\s*([^;]+);?/g,encodingLookup={};for(settings=settings||{},schema&&(validStyles=schema.getValidStyles(),invalidStyles=schema.getInvalidStyles()),encodingItems="\\\" \\' \\; \\: ; : \ufeff".split(" "),i=0;i-1&&noJoin||(styles[prefix+suffix]=i==-1?box[0]:box.join(" "),delete styles[prefix+"-top"+suffix],delete styles[prefix+"-right"+suffix],delete styles[prefix+"-bottom"+suffix],delete styles[prefix+"-left"+suffix])}}function canCompress(key){var i,value=styles[key];if(value){for(value=value.split(" "),i=value.length;i--;)if(value[i]!==value[0])return!1;return styles[key]=value[0],!0}}function encode(str){return isEncoded=!0,encodingLookup[str]}function decode(str,keep_slashes){return isEncoded&&(str=str.replace(/\uFEFF[0-9]/g,function(str){return encodingLookup[str]})),keep_slashes||(str=str.replace(/\\([\'\";:])/g,"$1")),str}function decodeSingleHexSequence(escSeq){return String.fromCharCode(parseInt(escSeq.slice(1),16))}function decodeHexSequences(value){return value.replace(/\\[0-9a-f]+/gi,decodeSingleHexSequence)}function processUrl(match,url,url2,url3,str,str2){if(str=str||str2)return str=decode(str),"'"+str.replace(/\'/g,"\\'")+"'";if(url=decode(url||url2||url3),!settings.allow_script_urls){var scriptUrl=url.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(scriptUrl))return"";if(!settings.allow_svg_data_urls&&/^data:image\/svg/i.test(scriptUrl))return""}return urlConverter&&(url=urlConverter.call(urlConverterScope,url,"style")),"url('"+url.replace(/\'/g,"\\'")+"')"}var matches,name,value,isEncoded,styles={},urlConverter=settings.url_converter,urlConverterScope=settings.url_converter_scope||this;if(css){for(css=css.replace(/[\u0000-\u001F]/g,""),css=css.replace(/\\[\"\';:\uFEFF]/g,encode).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(str){return str.replace(/[;:]/g,encode)});matches=styleRegExp.exec(css);)if(styleRegExp.lastIndex=matches.index+matches[0].length,name=matches[1].replace(/\s+$/,"").toLowerCase(),value=matches[2].replace(/\s+$/,""),name&&value){if(name=decodeHexSequences(name),value=decodeHexSequences(value),name.indexOf("\ufeff")!==-1||name.indexOf('"')!==-1)continue;if(!settings.allow_script_urls&&("behavior"==name||/expression\s*\(|\/\*|\*\//.test(value)))continue;"font-weight"===name&&"700"===value?value="bold":"color"!==name&&"background-color"!==name||(value=value.toLowerCase()),value=value.replace(rgbRegExp,toHex),value=value.replace(/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,processUrl),styles[name]=isEncoded?decode(value,!0):value}compress("border","",!0),compress("border","-width"),compress("border","-color"),compress("border","-style"),compress("padding",""),compress("margin",""),function(target,a,b,c){canCompress(a)&&canCompress(b)&&canCompress(c)&&(styles[target]=styles[a]+" "+styles[b]+" "+styles[c],delete styles[a],delete styles[b],delete styles[c])}("border","border-width","border-style","border-color"),"medium none"===styles.border&&delete styles.border,"none"===styles["border-image"]&&delete styles["border-image"]}return styles},serialize:function(styles,elementName){function serializeStyles(name){var styleList,i,l,value;if(styleList=validStyles[name])for(i=0,l=styleList.length;i0?" ":"")+name+": "+value+";")}var name,value,css="";if(elementName&&validStyles)serializeStyles("*"),serializeStyles(elementName);else for(name in styles)!(value=styles[name])||invalidStyles&&!function(name,elementName){var styleMap;return(!(styleMap=invalidStyles["*"])||!styleMap[name])&&(!(styleMap=invalidStyles[elementName])||!styleMap[name])}(name,elementName)||(css+=(css.length>0?" ":"")+name+": "+value+";");return css}}}}),define("tinymce/dom/TreeWalker",[],function(){return function(startNode,rootNode){function findSibling(node,startName,siblingName,shallow){var sibling,parent;if(node){if(!shallow&&node[startName])return node[startName];if(node!=rootNode){if(sibling=node[siblingName])return sibling;for(parent=node.parentNode;parent&&parent!=rootNode;parent=parent.parentNode)if(sibling=parent[siblingName])return sibling}}}function findPreviousNode(node,startName,siblingName,shallow){var sibling,parent,child;if(node){if(sibling=node[siblingName],rootNode&&sibling===rootNode)return;if(sibling){if(!shallow)for(child=sibling[startName];child;child=child[startName])if(!child[startName])return child;return sibling}if((parent=node.parentNode)&&parent!==rootNode)return parent}}var node=startNode;this.current=function(){return node},this.next=function(shallow){return node=findSibling(node,"firstChild","nextSibling",shallow)},this.prev=function(shallow){return node=findSibling(node,"lastChild","previousSibling",shallow)},this.prev2=function(shallow){return node=findPreviousNode(node,"lastChild","previousSibling",shallow)}}}),define("tinymce/dom/Range",["tinymce/util/Tools"],function(Tools){function Range(dom){function createDocumentFragment(){return doc.createDocumentFragment()}function setStart(n,o){_setEndPoint(TRUE,n,o)}function setEnd(n,o){_setEndPoint(FALSE,n,o)}function setStartBefore(n){setStart(n.parentNode,nodeIndex(n))}function setStartAfter(n){setStart(n.parentNode,nodeIndex(n)+1)}function setEndBefore(n){setEnd(n.parentNode,nodeIndex(n))}function setEndAfter(n){setEnd(n.parentNode,nodeIndex(n)+1)}function collapse(ts){ts?(self[END_CONTAINER]=self[START_CONTAINER],self[END_OFFSET]=self[START_OFFSET]):(self[START_CONTAINER]=self[END_CONTAINER],self[START_OFFSET]=self[END_OFFSET]),self.collapsed=TRUE}function selectNode(n){setStartBefore(n),setEndAfter(n)}function selectNodeContents(n){setStart(n,0),setEnd(n,1===n.nodeType?n.childNodes.length:n.nodeValue.length)}function compareBoundaryPoints(h,r){var sc=self[START_CONTAINER],so=self[START_OFFSET],ec=self[END_CONTAINER],eo=self[END_OFFSET],rsc=r.startContainer,rso=r.startOffset,rec=r.endContainer,reo=r.endOffset;return 0===h?_compareBoundaryPoints(sc,so,rsc,rso):1===h?_compareBoundaryPoints(ec,eo,rsc,rso):2===h?_compareBoundaryPoints(ec,eo,rec,reo):3===h?_compareBoundaryPoints(sc,so,rec,reo):void 0}function deleteContents(){_traverse(DELETE)}function extractContents(){return _traverse(EXTRACT)}function cloneContents(){return _traverse(CLONE)}function insertNode(n){var nn,o,startContainer=this[START_CONTAINER],startOffset=this[START_OFFSET];3!==startContainer.nodeType&&4!==startContainer.nodeType||!startContainer.nodeValue?(startContainer.childNodes.length>0&&(o=startContainer.childNodes[startOffset]),o?startContainer.insertBefore(n,o):3==startContainer.nodeType?dom.insertAfter(n,startContainer):startContainer.appendChild(n)):startOffset?startOffset>=startContainer.nodeValue.length?dom.insertAfter(n,startContainer):(nn=startContainer.splitText(startOffset),startContainer.parentNode.insertBefore(n,nn)):startContainer.parentNode.insertBefore(n,startContainer)}function surroundContents(n){var f=self.extractContents();self.insertNode(n),n.appendChild(f),self.selectNode(n)}function cloneRange(){return extend(new Range(dom),{startContainer:self[START_CONTAINER],startOffset:self[START_OFFSET],endContainer:self[END_CONTAINER],endOffset:self[END_OFFSET],collapsed:self.collapsed,commonAncestorContainer:self.commonAncestorContainer})}function _getSelectedNode(container,offset){var child;if(3==container.nodeType)return container;if(offset<0)return container;for(child=container.firstChild;child&&offset>0;)--offset,child=child.nextSibling;return child||container}function _isCollapsed(){return self[START_CONTAINER]==self[END_CONTAINER]&&self[START_OFFSET]==self[END_OFFSET]}function _compareBoundaryPoints(containerA,offsetA,containerB,offsetB){var c,offsetC,n,cmnRoot,childA,childB;if(containerA==containerB)return offsetA==offsetB?0:offsetA0&&self.collapse(st):self.collapse(st),self.collapsed=_isCollapsed(),self.commonAncestorContainer=dom.findCommonAncestor(self[START_CONTAINER],self[END_CONTAINER])}function _traverse(how){var c,p,depthDiff,startNode,endNode,sp,ep,endContainerDepth=0,startContainerDepth=0;if(self[START_CONTAINER]==self[END_CONTAINER])return _traverseSameContainer(how);for(c=self[END_CONTAINER],p=c.parentNode;p;c=p,p=p.parentNode){if(p==self[START_CONTAINER])return _traverseCommonStartContainer(c,how);++endContainerDepth}for(c=self[START_CONTAINER],p=c.parentNode;p;c=p,p=p.parentNode){if(p==self[END_CONTAINER])return _traverseCommonEndContainer(c,how);++startContainerDepth}for(depthDiff=startContainerDepth-endContainerDepth,startNode=self[START_CONTAINER];depthDiff>0;)startNode=startNode.parentNode,depthDiff--;for(endNode=self[END_CONTAINER];depthDiff<0;)endNode=endNode.parentNode,depthDiff++;for(sp=startNode.parentNode,ep=endNode.parentNode;sp!=ep;sp=sp.parentNode,ep=ep.parentNode)startNode=sp,endNode=ep;return _traverseCommonAncestors(startNode,endNode,how)}function _traverseSameContainer(how){var frag,s,sub,n,cnt,sibling,xferNode,start,len;if(how!=DELETE&&(frag=createDocumentFragment()),self[START_OFFSET]==self[END_OFFSET])return frag;if(3==self[START_CONTAINER].nodeType){if(s=self[START_CONTAINER].nodeValue,sub=s.substring(self[START_OFFSET],self[END_OFFSET]),how!=CLONE&&(n=self[START_CONTAINER],start=self[START_OFFSET],len=self[END_OFFSET]-self[START_OFFSET],0===start&&len>=n.nodeValue.length-1?n.parentNode.removeChild(n):n.deleteData(start,len),self.collapse(TRUE)),how==DELETE)return;return sub.length>0&&frag.appendChild(doc.createTextNode(sub)),frag}for(n=_getSelectedNode(self[START_CONTAINER],self[START_OFFSET]),cnt=self[END_OFFSET]-self[START_OFFSET];n&&cnt>0;)sibling=n.nextSibling,xferNode=_traverseFullySelected(n,how),frag&&frag.appendChild(xferNode),--cnt,n=sibling;return how!=CLONE&&self.collapse(TRUE),frag}function _traverseCommonStartContainer(endAncestor,how){var frag,n,endIdx,cnt,sibling,xferNode;if(how!=DELETE&&(frag=createDocumentFragment()),n=_traverseRightBoundary(endAncestor,how),frag&&frag.appendChild(n),endIdx=nodeIndex(endAncestor),(cnt=endIdx-self[START_OFFSET])<=0)return how!=CLONE&&(self.setEndBefore(endAncestor),self.collapse(FALSE)),frag;for(n=endAncestor.previousSibling;cnt>0;)sibling=n.previousSibling,xferNode=_traverseFullySelected(n,how),frag&&frag.insertBefore(xferNode,frag.firstChild),--cnt,n=sibling;return how!=CLONE&&(self.setEndBefore(endAncestor),self.collapse(FALSE)),frag}function _traverseCommonEndContainer(startAncestor,how){var frag,startIdx,n,cnt,sibling,xferNode;for(how!=DELETE&&(frag=createDocumentFragment()),n=_traverseLeftBoundary(startAncestor,how),frag&&frag.appendChild(n),startIdx=nodeIndex(startAncestor),++startIdx,cnt=self[END_OFFSET]-startIdx,n=startAncestor.nextSibling;n&&cnt>0;)sibling=n.nextSibling,xferNode=_traverseFullySelected(n,how),frag&&frag.appendChild(xferNode),--cnt,n=sibling;return how!=CLONE&&(self.setStartAfter(startAncestor),self.collapse(TRUE)),frag}function _traverseCommonAncestors(startAncestor,endAncestor,how){var n,frag,startOffset,endOffset,cnt,sibling,nextSibling;for(how!=DELETE&&(frag=createDocumentFragment()),n=_traverseLeftBoundary(startAncestor,how),frag&&frag.appendChild(n),startOffset=nodeIndex(startAncestor),endOffset=nodeIndex(endAncestor),++startOffset,cnt=endOffset-startOffset,sibling=startAncestor.nextSibling;cnt>0;)nextSibling=sibling.nextSibling,n=_traverseFullySelected(sibling,how),frag&&frag.appendChild(n),sibling=nextSibling,--cnt;return n=_traverseRightBoundary(endAncestor,how),frag&&frag.appendChild(n),how!=CLONE&&(self.setStartAfter(startAncestor),self.collapse(TRUE)),frag}function _traverseRightBoundary(root,how){var parent,clonedParent,prevSibling,clonedChild,clonedGrandParent,next=_getSelectedNode(self[END_CONTAINER],self[END_OFFSET]-1),isFullySelected=next!=self[END_CONTAINER];if(next==root)return _traverseNode(next,isFullySelected,FALSE,how);for(parent=next.parentNode,clonedParent=_traverseNode(parent,FALSE,FALSE,how);parent;){for(;next;)prevSibling=next.previousSibling,clonedChild=_traverseNode(next,isFullySelected,FALSE,how),how!=DELETE&&clonedParent.insertBefore(clonedChild,clonedParent.firstChild),isFullySelected=TRUE,next=prevSibling;if(parent==root)return clonedParent;next=parent.previousSibling,parent=parent.parentNode,clonedGrandParent=_traverseNode(parent,FALSE,FALSE,how),how!=DELETE&&clonedGrandParent.appendChild(clonedParent),clonedParent=clonedGrandParent}}function _traverseLeftBoundary(root,how){var parent,clonedParent,nextSibling,clonedChild,clonedGrandParent,next=_getSelectedNode(self[START_CONTAINER],self[START_OFFSET]),isFullySelected=next!=self[START_CONTAINER];if(next==root)return _traverseNode(next,isFullySelected,TRUE,how);for(parent=next.parentNode,clonedParent=_traverseNode(parent,FALSE,TRUE,how);parent;){for(;next;)nextSibling=next.nextSibling,clonedChild=_traverseNode(next,isFullySelected,TRUE,how),how!=DELETE&&clonedParent.appendChild(clonedChild),isFullySelected=TRUE,next=nextSibling;if(parent==root)return clonedParent;next=parent.nextSibling,parent=parent.parentNode,clonedGrandParent=_traverseNode(parent,FALSE,TRUE,how),how!=DELETE&&clonedGrandParent.appendChild(clonedParent),clonedParent=clonedGrandParent}}function _traverseNode(n,isFullySelected,isLeft,how){var txtValue,newNodeValue,oldNodeValue,offset,newNode;if(isFullySelected)return _traverseFullySelected(n,how);if(3==n.nodeType){if(txtValue=n.nodeValue,isLeft?(offset=self[START_OFFSET],newNodeValue=txtValue.substring(offset),oldNodeValue=txtValue.substring(0,offset)):(offset=self[END_OFFSET],newNodeValue=txtValue.substring(0,offset),oldNodeValue=txtValue.substring(offset)),how!=CLONE&&(n.nodeValue=oldNodeValue),how==DELETE)return;return newNode=dom.clone(n,FALSE),newNode.nodeValue=newNodeValue,newNode}if(how!=DELETE)return dom.clone(n,FALSE)}function _traverseFullySelected(n,how){if(how!=DELETE)return how==CLONE?dom.clone(n,TRUE):n;n.parentNode.removeChild(n)}function toStringIE(){return dom.create("body",null,cloneContents()).outerText}var self=this,doc=dom.doc,EXTRACT=0,CLONE=1,DELETE=2,TRUE=!0,FALSE=!1,START_OFFSET="startOffset",START_CONTAINER="startContainer",END_CONTAINER="endContainer",END_OFFSET="endOffset",extend=Tools.extend,nodeIndex=dom.nodeIndex;return extend(self,{startContainer:doc,startOffset:0,endContainer:doc,endOffset:0,collapsed:TRUE,commonAncestorContainer:doc,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:setStart,setEnd:setEnd,setStartBefore:setStartBefore,setStartAfter:setStartAfter,setEndBefore:setEndBefore,setEndAfter:setEndAfter,collapse:collapse,selectNode:selectNode,selectNodeContents:selectNodeContents,compareBoundaryPoints:compareBoundaryPoints,deleteContents:deleteContents,extractContents:extractContents,cloneContents:cloneContents,insertNode:insertNode,surroundContents:surroundContents,cloneRange:cloneRange,toStringIE:toStringIE}),self}return Range.prototype.toString=function(){return this.toStringIE()},Range}),define("tinymce/html/Entities",["tinymce/util/Tools"],function(Tools){function nativeDecode(text){var elm;return elm=document.createElement("div"),elm.innerHTML=text,elm.textContent||elm.innerText||text}function buildEntitiesLookup(items,radix){var i,chr,entity,lookup={};if(items){for(items=items.split(","),radix=radix||10,i=0;i\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,textCharsRegExp=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,asciiMap={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};baseEntities={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},reverseEntities={"<":"<",">":">","&":"&",""":'"',"'":"'"},namedEntities=buildEntitiesLookup("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var Entities={encodeRaw:function(text,attr){return text.replace(attr?attrsCharsRegExp:textCharsRegExp,function(chr){return baseEntities[chr]||chr})},encodeAllRaw:function(text){return(""+text).replace(/[<>&\"\']/g,function(chr){return baseEntities[chr]||chr})},encodeNumeric:function(text,attr){return text.replace(attr?attrsCharsRegExp:textCharsRegExp,function(chr){return chr.length>1?"&#"+(1024*(chr.charCodeAt(0)-55296)+(chr.charCodeAt(1)-56320)+65536)+";":baseEntities[chr]||"&#"+chr.charCodeAt(0)+";"})},encodeNamed:function(text,attr,entities){return entities=entities||namedEntities,text.replace(attr?attrsCharsRegExp:textCharsRegExp,function(chr){return baseEntities[chr]||entities[chr]||chr})},getEncodeFunc:function(name,entities){function encodeNamedAndNumeric(text,attr){return text.replace(attr?attrsCharsRegExp:textCharsRegExp,function(chr){return baseEntities[chr]||entities[chr]||"&#"+chr.charCodeAt(0)+";"||chr})}function encodeCustomNamed(text,attr){return Entities.encodeNamed(text,attr,entities)}return entities=buildEntitiesLookup(entities)||namedEntities,name=makeMap(name.replace(/\+/g,",")),name.named&&name.numeric?encodeNamedAndNumeric:name.named?entities?encodeCustomNamed:Entities.encodeNamed:name.numeric?Entities.encodeNumeric:Entities.encodeRaw},decode:function(text){return text.replace(/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,function(all,numeric){return numeric?(numeric="x"===numeric.charAt(0).toLowerCase()?parseInt(numeric.substr(1),16):parseInt(numeric,10),numeric>65535?(numeric-=65536,String.fromCharCode(55296+(numeric>>10),56320+(1023&numeric))):asciiMap[numeric]||String.fromCharCode(numeric)):reverseEntities[all]||namedEntities[all]||nativeDecode(all)})}};return Entities}),define("tinymce/dom/StyleSheetLoader",["tinymce/util/Tools","tinymce/util/Delay"],function(Tools,Delay){return function(document,settings){function appendToHead(node){document.getElementsByTagName("head")[0].appendChild(node)}function load(url,loadedCallback,errorCallback){function passed(){for(var callbacks=state.passed,i=callbacks.length;i--;)callbacks[i]();state.status=2,state.passed=[],state.failed=[]}function failed(){for(var callbacks=state.failed,i=callbacks.length;i--;)callbacks[i]();state.status=3,state.passed=[],state.failed=[]}function wait(testCallback,waitCallback){testCallback()||((new Date).getTime()-startTime0)return style=document.createElement("style"),style.textContent='@import "'+url+'"',waitForGeckoLinkLoaded(),void appendToHead(style);waitForWebKitLinkLoaded()}appendToHead(link),link.href=url}}var maxLoadTime,idCount=0,loadedStates={};settings=settings||{},maxLoadTime=settings.maxLoadTime||5e3,this.load=load}}),define("tinymce/dom/DOMUtils",["tinymce/dom/Sizzle","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/EventUtils","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/util/Tools","tinymce/dom/StyleSheetLoader"],function(Sizzle,$,Styles,EventUtils,TreeWalker,Range,Entities,Env,Tools,StyleSheetLoader){function setupAttrHooks(domUtils,settings){var keepUrlHook,attrHooks={},keepValues=settings.keep_values;return keepUrlHook={set:function($elm,value,name){settings.url_converter&&(value=settings.url_converter.call(settings.url_converter_scope||domUtils,value,name,$elm[0])),$elm.attr("data-mce-"+name,value).attr(name,value)},get:function($elm,name){return $elm.attr("data-mce-"+name)||$elm.attr(name)}},attrHooks={style:{set:function($elm,value){if(null!==value&&"object"==typeof value)return void $elm.css(value);keepValues&&$elm.attr("data-mce-style",value),$elm.attr("style",value)},get:function($elm){var value=$elm.attr("data-mce-style")||$elm.attr("style");return value=domUtils.serializeStyle(domUtils.parseStyle(value),$elm[0].nodeName)}}},keepValues&&(attrHooks.href=attrHooks.src=keepUrlHook),attrHooks}function updateInternalStyleAttr(domUtils,$elm){var value=$elm.attr("style");value=domUtils.serializeStyle(domUtils.parseStyle(value),$elm[0].nodeName),value||(value=null),$elm.attr("data-mce-style",value)}function nodeIndex(node,normalized){var lastNodeType,nodeType,idx=0;if(node)for(lastNodeType=node.nodeType,node=node.previousSibling;node;node=node.previousSibling)nodeType=node.nodeType,(!normalized||3!=nodeType||nodeType!=lastNodeType&&node.nodeValue.length)&&(idx++,lastNodeType=nodeType);return idx}function DOMUtils(doc,settings){var blockElementsMap,self=this;self.doc=doc,self.win=window,self.files={},self.counter=0,self.stdMode=!isIE||doc.documentMode>=8,self.boxModel=!isIE||"CSS1Compat"==doc.compatMode||self.stdMode,self.styleSheetLoader=new StyleSheetLoader(doc),self.boundEvents=[],self.settings=settings=settings||{},self.schema=settings.schema,self.styles=new Styles({url_converter:settings.url_converter,url_converter_scope:settings.url_converter_scope},settings.schema),self.fixDoc(doc),self.events=settings.ownEvents?new EventUtils(settings.proxy):EventUtils.Event,self.attrHooks=setupAttrHooks(self,settings),blockElementsMap=settings.schema?settings.schema.getBlockElements():{},self.$=$.overrideDefaults(function(){return{context:doc,element:self.getRoot()}}),self.isBlock=function(node){if(!node)return!1;var type=node.nodeType;return type?!(1!==type||!blockElementsMap[node.nodeName]):!!blockElementsMap[node]}}var each=Tools.each,is=Tools.is,grep=Tools.grep,trim=Tools.trim,isIE=Env.ie,simpleSelectorRe=/^([a-z0-9],?)+$/i,whiteSpaceRegExp=/^[ \t\r\n]*$/;return DOMUtils.prototype={$$:function(elm){return"string"==typeof elm&&(elm=this.get(elm)),this.$(elm)},root:null,fixDoc:function(doc){var name,settings=this.settings;if(isIE&&settings.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(name){doc.createElement(name)});for(name in settings.schema.getCustomElements())doc.createElement(name)}},clone:function(node,deep){var clone,doc,self=this;return!isIE||1!==node.nodeType||deep?node.cloneNode(deep):(doc=self.doc,deep?clone.firstChild:(clone=doc.createElement(node.nodeName),each(self.getAttribs(node),function(attr){self.setAttrib(clone,attr.nodeName,self.getAttrib(node,attr.nodeName))}),clone))},getRoot:function(){var self=this;return self.settings.root_element||self.doc.body},getViewPort:function(win){var doc,rootElm;return win=win||this.win,doc=win.document,rootElm=this.boxModel?doc.documentElement:doc.body,{x:win.pageXOffset||rootElm.scrollLeft,y:win.pageYOffset||rootElm.scrollTop,w:win.innerWidth||rootElm.clientWidth,h:win.innerHeight||rootElm.clientHeight}},getRect:function(elm){var pos,size,self=this;return elm=self.get(elm),pos=self.getPos(elm),size=self.getSize(elm),{x:pos.x,y:pos.y,w:size.w,h:size.h}},getSize:function(elm){var w,h,self=this;return elm=self.get(elm),w=self.getStyle(elm,"width"),h=self.getStyle(elm,"height"),w.indexOf("px")===-1&&(w=0),h.indexOf("px")===-1&&(h=0),{w:parseInt(w,10)||elm.offsetWidth||elm.clientWidth, h:parseInt(h,10)||elm.offsetHeight||elm.clientHeight}},getParent:function(node,selector,root){return this.getParents(node,selector,root,!1)},getParents:function(node,selector,root,collect){var selectorVal,self=this,result=[];for(node=self.get(node),collect=collect===undefined,root=root||("BODY"!=self.getRoot().nodeName?self.getRoot().parentNode:null),is(selector,"string")&&(selectorVal=selector,selector="*"===selector?function(node){return 1==node.nodeType}:function(node){return self.is(node,selectorVal)});node&&node!=root&&node.nodeType&&9!==node.nodeType;){if(!selector||selector(node)){if(!collect)return node;result.push(node)}node=node.parentNode}return collect?result:null},get:function(elm){var name;return elm&&this.doc&&"string"==typeof elm&&(name=elm,(elm=this.doc.getElementById(elm))&&elm.id!==name)?this.doc.getElementsByName(name)[1]:elm},getNext:function(node,selector){return this._findSib(node,selector,"nextSibling")},getPrev:function(node,selector){return this._findSib(node,selector,"previousSibling")},select:function(selector,scope){var self=this;return Sizzle(selector,self.get(scope)||self.settings.root_element||self.doc,[])},is:function(elm,selector){var i;if(elm.length===undefined){if("*"===selector)return 1==elm.nodeType;if(simpleSelectorRe.test(selector)){for(selector=selector.toLowerCase().split(/,/),elm=elm.nodeName.toLowerCase(),i=selector.length-1;i>=0;i--)if(selector[i]==elm)return!0;return!1}}if(elm.nodeType&&1!=elm.nodeType)return!1;var elms=elm.nodeType?[elm]:elm;return Sizzle(selector,elms[0].ownerDocument||elms[0],null,elms).length>0},add:function(parentElm,name,attrs,html,create){var self=this;return this.run(parentElm,function(parentElm){var newElm;return newElm=is(name,"string")?self.doc.createElement(name):name,self.setAttribs(newElm,attrs),html&&(html.nodeType?newElm.appendChild(html):self.setHTML(newElm,html)),create?newElm:parentElm.appendChild(newElm)})},create:function(name,attrs,html){return this.add(this.doc.createElement(name),name,attrs,html,1)},createHTML:function(name,attrs,html){var key,outHtml="";outHtml+="<"+name;for(key in attrs)attrs.hasOwnProperty(key)&&null!==attrs[key]&&void 0!==attrs[key]&&(outHtml+=" "+key+'="'+this.encode(attrs[key])+'"');return void 0!==html?outHtml+">"+html+"":outHtml+" />"},createFragment:function(html){var frag,node,container,doc=this.doc;for(container=doc.createElement("div"),frag=doc.createDocumentFragment(),html&&(container.innerHTML=html);node=container.firstChild;)frag.appendChild(node);return frag},remove:function(node,keepChildren){return node=this.$$(node),keepChildren?node.each(function(){for(var child;child=this.firstChild;)3==child.nodeType&&0===child.data.length?this.removeChild(child):this.parentNode.insertBefore(child,this)}).remove():node.remove(),node.length>1?node.toArray():node[0]},setStyle:function(elm,name,value){elm=this.$$(elm).css(name,value),this.settings.update_styles&&updateInternalStyleAttr(this,elm)},getStyle:function(elm,name,computed){return elm=this.$$(elm),computed?elm.css(name):(name=name.replace(/-(\D)/g,function(a,b){return b.toUpperCase()}),"float"==name&&(name=Env.ie&&Env.ie<12?"styleFloat":"cssFloat"),elm[0]&&elm[0].style?elm[0].style[name]:undefined)},setStyles:function(elm,styles){elm=this.$$(elm).css(styles),this.settings.update_styles&&updateInternalStyleAttr(this,elm)},removeAllAttribs:function(e){return this.run(e,function(e){var i,attrs=e.attributes;for(i=attrs.length-1;i>=0;i--)e.removeAttributeNode(attrs.item(i))})},setAttrib:function(elm,name,value){var originalValue,hook,self=this,settings=self.settings;""===value&&(value=null),elm=self.$$(elm),originalValue=elm.attr(name),elm.length&&(hook=self.attrHooks[name],hook&&hook.set?hook.set(elm,value,name):elm.attr(name,value),originalValue!=value&&settings.onSetAttrib&&settings.onSetAttrib({attrElm:elm,attrName:name,attrValue:value}))},setAttribs:function(elm,attrs){var self=this;self.$$(elm).each(function(i,node){each(attrs,function(value,name){self.setAttrib(node,name,value)})})},getAttrib:function(elm,name,defaultVal){var hook,value,self=this;return elm=self.$$(elm),elm.length&&(hook=self.attrHooks[name],value=hook&&hook.get?hook.get(elm,name):elm.attr(name)),void 0===value&&(value=defaultVal||""),value},getPos:function(elm,rootElm){var offsetParent,pos,self=this,x=0,y=0,doc=self.doc,body=doc.body;if(elm=self.get(elm),rootElm=rootElm||body,elm){if(rootElm===body&&elm.getBoundingClientRect&&"static"===$(body).css("position"))return pos=elm.getBoundingClientRect(),rootElm=self.boxModel?doc.documentElement:body,x=pos.left+(doc.documentElement.scrollLeft||body.scrollLeft)-rootElm.clientLeft,y=pos.top+(doc.documentElement.scrollTop||body.scrollTop)-rootElm.clientTop,{x:x,y:y};for(offsetParent=elm;offsetParent&&offsetParent!=rootElm&&offsetParent.nodeType;)x+=offsetParent.offsetLeft||0,y+=offsetParent.offsetTop||0,offsetParent=offsetParent.offsetParent;for(offsetParent=elm.parentNode;offsetParent&&offsetParent!=rootElm&&offsetParent.nodeType;)x-=offsetParent.scrollLeft||0,y-=offsetParent.scrollTop||0,offsetParent=offsetParent.parentNode}return{x:x,y:y}},parseStyle:function(cssText){return this.styles.parse(cssText)},serializeStyle:function(styles,name){return this.styles.serialize(styles,name)},addStyle:function(cssText){var head,styleElm,self=this,doc=self.doc;if(self!==DOMUtils.DOM&&doc===document){var addedStyles=DOMUtils.DOM.addedStyles;if(addedStyles=addedStyles||[],addedStyles[cssText])return;addedStyles[cssText]=!0,DOMUtils.DOM.addedStyles=addedStyles}styleElm=doc.getElementById("mceDefaultStyles"),styleElm||(styleElm=doc.createElement("style"),styleElm.id="mceDefaultStyles",styleElm.type="text/css",head=doc.getElementsByTagName("head")[0],head.firstChild?head.insertBefore(styleElm,head.firstChild):head.appendChild(styleElm)),styleElm.styleSheet?styleElm.styleSheet.cssText+=cssText:styleElm.appendChild(doc.createTextNode(cssText))},loadCSS:function(url){var head,self=this,doc=self.doc;if(self!==DOMUtils.DOM&&doc===document)return void DOMUtils.DOM.loadCSS(url);url||(url=""),head=doc.getElementsByTagName("head")[0],each(url.split(","),function(url){var link;url=Tools._addCacheSuffix(url),self.files[url]||(self.files[url]=!0,link=self.create("link",{rel:"stylesheet",href:url}),isIE&&doc.documentMode&&doc.recalc&&(link.onload=function(){doc.recalc&&doc.recalc(),link.onload=null}),head.appendChild(link))})},addClass:function(elm,cls){this.$$(elm).addClass(cls)},removeClass:function(elm,cls){this.toggleClass(elm,cls,!1)},hasClass:function(elm,cls){return this.$$(elm).hasClass(cls)},toggleClass:function(elm,cls,state){this.$$(elm).toggleClass(cls,state).each(function(){""===this.className&&$(this).attr("class",null)})},show:function(elm){this.$$(elm).show()},hide:function(elm){this.$$(elm).hide()},isHidden:function(elm){return"none"==this.$$(elm).css("display")},uniqueId:function(prefix){return(prefix||"mce_")+this.counter++},setHTML:function(elm,html){elm=this.$$(elm),isIE?elm.each(function(i,target){if(target.canHaveHTML!==!1){for(;target.firstChild;)target.removeChild(target.firstChild);try{target.innerHTML="
"+html,target.removeChild(target.firstChild)}catch(ex){$("
").html("
"+html).contents().slice(1).appendTo(target)}return html}}):elm.html(html)},getOuterHTML:function(elm){return elm=this.get(elm),1==elm.nodeType&&"outerHTML"in elm?elm.outerHTML:$("
").append($(elm).clone()).html()},setOuterHTML:function(elm,html){var self=this;self.$$(elm).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=html)}catch(ex){}self.remove($(this).html(html),!0)})},decode:Entities.decode,encode:Entities.encodeAllRaw,insertAfter:function(node,referenceNode){return referenceNode=this.get(referenceNode),this.run(node,function(node){var parent,nextSibling;return parent=referenceNode.parentNode,nextSibling=referenceNode.nextSibling,nextSibling?parent.insertBefore(node,nextSibling):parent.appendChild(node),node})},replace:function(newElm,oldElm,keepChildren){return this.run(oldElm,function(oldElm){return is(oldElm,"array")&&(newElm=newElm.cloneNode(!0)),keepChildren&&each(grep(oldElm.childNodes),function(node){newElm.appendChild(node)}),oldElm.parentNode.replaceChild(newElm,oldElm)})},rename:function(elm,name){var newElm,self=this;return elm.nodeName!=name.toUpperCase()&&(newElm=self.create(name),each(self.getAttribs(elm),function(attrNode){self.setAttrib(newElm,attrNode.nodeName,self.getAttrib(elm,attrNode.nodeName))}),self.replace(newElm,elm,1)),newElm||elm},findCommonAncestor:function(a,b){for(var pe,ps=a;ps;){for(pe=b;pe&&ps!=pe;)pe=pe.parentNode;if(ps==pe)break;ps=ps.parentNode}return!ps&&a.ownerDocument?a.ownerDocument.documentElement:ps},toHex:function(rgbVal){return this.styles.toHex(Tools.trim(rgbVal))},run:function(elm,func,scope){var result,self=this;return"string"==typeof elm&&(elm=self.get(elm)),!!elm&&(scope=scope||this,elm.nodeType||!elm.length&&0!==elm.length?func.call(scope,elm):(result=[],each(elm,function(elm,i){elm&&("string"==typeof elm&&(elm=self.get(elm)),result.push(func.call(scope,elm,i)))}),result))},getAttribs:function(elm){var attrs;if(!(elm=this.get(elm)))return[];if(isIE){if(attrs=[],"OBJECT"==elm.nodeName)return elm.attributes;"OPTION"===elm.nodeName&&this.getAttrib(elm,"selected")&&attrs.push({specified:1,nodeName:"selected"});return elm.cloneNode(!1).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(a){attrs.push({specified:1,nodeName:a})}),attrs}return elm.attributes},isEmpty:function(node,elements){var i,attributes,type,whitespace,walker,name,self=this,brCount=0;if(node=node.firstChild){walker=new TreeWalker(node,node.parentNode),elements=elements||(self.schema?self.schema.getNonEmptyElements():null),whitespace=self.schema?self.schema.getWhiteSpaceElements():{};do{if(1===(type=node.nodeType)){var bogusVal=node.getAttribute("data-mce-bogus");if(bogusVal){node=walker.next("all"===bogusVal);continue}if(name=node.nodeName.toLowerCase(),elements&&elements[name]){if("br"===name){brCount++,node=walker.next();continue}return!1}for(attributes=self.getAttribs(node),i=attributes.length;i--;)if("name"===(name=attributes[i].nodeName)||"data-mce-bookmark"===name)return!1}if(8==type)return!1;if(3===type&&!whiteSpaceRegExp.test(node.nodeValue))return!1;if(3===type&&node.parentNode&&whitespace[node.parentNode.nodeName]&&whiteSpaceRegExp.test(node.nodeValue))return!1;node=walker.next()}while(node)}return brCount<=1},createRng:function(){var doc=this.doc;return doc.createRange?doc.createRange():new Range(this)},nodeIndex:nodeIndex,split:function(parentElm,splitElm,replacementElm){function trimNode(node){var i,children=node.childNodes,type=node.nodeType;if(1!=type||"bookmark"!=node.getAttribute("data-mce-type")){for(i=children.length-1;i>=0;i--)trimNode(children[i]);if(9!=type){if(3==type&&node.nodeValue.length>0){var trimmedLength=trim(node.nodeValue).length;if(!self.isBlock(node.parentNode)||trimmedLength>0||0===trimmedLength&&function(node){var previousIsSpan=node.previousSibling&&"SPAN"==node.previousSibling.nodeName,nextIsSpan=node.nextSibling&&"SPAN"==node.nextSibling.nodeName;return previousIsSpan&&nextIsSpan}(node))return}else if(1==type&&(children=node.childNodes,1==children.length&&children[0]&&1==children[0].nodeType&&"bookmark"==children[0].getAttribute("data-mce-type")&&node.parentNode.insertBefore(children[0],node),children.length||/^(br|hr|input|img)$/i.test(node.nodeName)))return;self.remove(node)}return node}}var bef,aft,pa,self=this,r=self.createRng();if(parentElm&&splitElm)return r.setStart(parentElm.parentNode,self.nodeIndex(parentElm)),r.setEnd(splitElm.parentNode,self.nodeIndex(splitElm)),bef=r.extractContents(),r=self.createRng(),r.setStart(splitElm.parentNode,self.nodeIndex(splitElm)+1),r.setEnd(parentElm.parentNode,self.nodeIndex(parentElm)+1),aft=r.extractContents(),pa=parentElm.parentNode,pa.insertBefore(trimNode(bef),parentElm),replacementElm?pa.insertBefore(replacementElm,parentElm):pa.insertBefore(splitElm,parentElm),pa.insertBefore(trimNode(aft),parentElm),self.remove(parentElm),replacementElm||splitElm},bind:function(target,name,func,scope){var self=this;if(Tools.isArray(target)){for(var i=target.length;i--;)target[i]=self.bind(target[i],name,func,scope);return target}return!self.settings.collect||target!==self.doc&&target!==self.win||self.boundEvents.push([target,name,func,scope]),self.events.bind(target,name,func,scope||self)},unbind:function(target,name,func){var i,self=this;if(Tools.isArray(target)){for(i=target.length;i--;)target[i]=self.unbind(target[i],name,func);return target}if(self.boundEvents&&(target===self.doc||target===self.win))for(i=self.boundEvents.length;i--;){var item=self.boundEvents[i];target!=item[0]||name&&name!=item[1]||func&&func!=item[2]||this.events.unbind(item[0],item[1],item[2])}return this.events.unbind(target,name,func)},fire:function(target,name,evt){return this.events.fire(target,name,evt)},getContentEditable:function(node){var contentEditable;return node&&1==node.nodeType?(contentEditable=node.getAttribute("data-mce-contenteditable"),contentEditable&&"inherit"!==contentEditable?contentEditable:"inherit"!==node.contentEditable?node.contentEditable:null):null},getContentEditableParent:function(node){for(var root=this.getRoot(),state=null;node&&node!==root&&null===(state=this.getContentEditable(node));node=node.parentNode);return state},destroy:function(){var self=this;if(self.boundEvents){for(var i=self.boundEvents.length;i--;){var item=self.boundEvents[i];this.events.unbind(item[0],item[1],item[2])}self.boundEvents=null}Sizzle.setDocument&&Sizzle.setDocument(),self.win=self.doc=self.root=self.events=self.frag=null},isChildOf:function(node,parent){for(;node;){if(parent===node)return!0;node=node.parentNode}return!1},dumpRng:function(r){return"startContainer: "+r.startContainer.nodeName+", startOffset: "+r.startOffset+", endContainer: "+r.endContainer.nodeName+", endOffset: "+r.endOffset},_findSib:function(node,selector,name){var self=this,func=selector;if(node)for("string"==typeof func&&(func=function(node){return self.is(node,selector)}),node=node[name];node;node=node[name])if(func(node))return node;return null}},DOMUtils.DOM=new DOMUtils(document),DOMUtils.nodeIndex=nodeIndex,DOMUtils}),define("tinymce/dom/ScriptLoader",["tinymce/dom/DOMUtils","tinymce/util/Tools"],function(DOMUtils,Tools){function ScriptLoader(){function loadScript(url,success,failure){function done(){dom.remove(id),elm&&(elm.onreadystatechange=elm.onload=elm=null),success()}function error(){isFunction(failure)?failure():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+url)}var elm,id,dom=DOM;id=dom.uniqueId(),elm=document.createElement("script"),elm.id=id,elm.type="text/javascript",elm.src=Tools._addCacheSuffix(url),"onreadystatechange"in elm?elm.onreadystatechange=function(){/loaded|complete/.test(elm.readyState)&&done()}:elm.onload=done,elm.onerror=error,(document.getElementsByTagName("head")[0]||document.body).appendChild(elm)}var undef,states={},queue=[],scriptLoadedCallbacks={},queueLoadedCallbacks=[],loading=0;this.isDone=function(url){return 2==states[url]},this.markDone=function(url){states[url]=2},this.add=this.load=function(url,success,scope,failure){states[url]==undef&&(queue.push(url),states[url]=0),success&&(scriptLoadedCallbacks[url]||(scriptLoadedCallbacks[url]=[]),scriptLoadedCallbacks[url].push({success:success,failure:failure,scope:scope||this}))},this.remove=function(url){delete states[url],delete scriptLoadedCallbacks[url]},this.loadQueue=function(success,scope,failure){this.loadScripts(queue,success,scope,failure)},this.loadScripts=function(scripts,success,scope,failure){function execCallbacks(name,url){each(scriptLoadedCallbacks[url],function(callback){isFunction(callback[name])&&callback[name].call(callback.scope)}),scriptLoadedCallbacks[url]=undef}var loadScripts,failures=[];queueLoadedCallbacks.push({success:success,failure:failure,scope:scope||this}),(loadScripts=function(){var loadingScripts=grep(scripts);scripts.length=0,each(loadingScripts,function(url){return 2===states[url]?void execCallbacks("success",url):3===states[url]?void execCallbacks("failure",url):void(1!==states[url]&&(states[url]=1,loading++,loadScript(url,function(){states[url]=2,loading--,execCallbacks("success",url),loadScripts()},function(){states[url]=3,loading--,failures.push(url),execCallbacks("failure",url),loadScripts()})))}),loading||(each(queueLoadedCallbacks,function(callback){0===failures.length?isFunction(callback.success)&&callback.success.call(callback.scope):isFunction(callback.failure)&&callback.failure.call(callback.scope,failures)}),queueLoadedCallbacks.length=0)})()}}var DOM=DOMUtils.DOM,each=Tools.each,grep=Tools.grep,isFunction=function(f){return"function"==typeof f};return ScriptLoader.ScriptLoader=new ScriptLoader,ScriptLoader}),define("tinymce/AddOnManager",["tinymce/dom/ScriptLoader","tinymce/util/Tools"],function(ScriptLoader,Tools){function AddOnManager(){var self=this;self.items=[],self.urls={},self.lookup={}}var each=Tools.each;return AddOnManager.prototype={get:function(name){return this.lookup[name]?this.lookup[name].instance:undefined},dependencies:function(name){var result;return this.lookup[name]&&(result=this.lookup[name].dependencies),result||[]},requireLangPack:function(name,languages){var language=AddOnManager.language;if(language&&AddOnManager.languageLoad!==!1){if(languages)if(languages=","+languages+",",languages.indexOf(","+language.substr(0,2)+",")!=-1)language=language.substr(0,2);else if(languages.indexOf(","+language+",")==-1)return;ScriptLoader.ScriptLoader.add(this.urls[name]+"/langs/"+language+".js")}},add:function(id,addOn,dependencies){return this.items.push(addOn),this.lookup[id]={instance:addOn,dependencies:dependencies},addOn},remove:function(name){delete this.urls[name],delete this.lookup[name]},createUrl:function(baseUrl,dep){return"object"==typeof dep?dep:{prefix:baseUrl.prefix,resource:dep,suffix:baseUrl.suffix}},addComponents:function(pluginName,scripts){var pluginUrl=this.urls[pluginName];each(scripts,function(script){ScriptLoader.ScriptLoader.add(pluginUrl+"/"+script)})},load:function(name,addOnUrl,success,scope,failure){function loadDependencies(){var dependencies=self.dependencies(name);each(dependencies,function(dep){var newUrl=self.createUrl(addOnUrl,dep);self.load(newUrl.resource,newUrl,undefined,undefined)}),success&&(scope?success.call(scope):success.call(ScriptLoader))}var self=this,url=addOnUrl;self.urls[name]||("object"==typeof addOnUrl&&(url=addOnUrl.prefix+addOnUrl.resource+addOnUrl.suffix),0!==url.indexOf("/")&&url.indexOf("://")==-1&&(url=AddOnManager.baseURL+"/"+url),self.urls[name]=url.substring(0,url.lastIndexOf("/")),self.lookup[name]?loadDependencies():ScriptLoader.ScriptLoader.add(url,loadDependencies,scope,failure))}},AddOnManager.PluginManager=new AddOnManager,AddOnManager.ThemeManager=new AddOnManager,AddOnManager}),define("tinymce/dom/NodeType",[],function(){function isNodeType(type){return function(node){return!!node&&node.nodeType==type}}function matchNodeNames(names){return names=names.toLowerCase().split(" "),function(node){var i,name;if(node&&node.nodeType)for(name=node.nodeName.toLowerCase(),i=0;ichildNodes.length-1?index=childNodes.length-1:index<0&&(index=0),childNodes[index]||container}function findParent(node,rootNode,predicate){for(;node&&node!==rootNode;){if(predicate(node))return node;node=node.parentNode}return null}function hasParent(node,rootNode,predicate){return null!==findParent(node,rootNode,predicate)}function isFormatterCaret(node){return"_mce_caret"===node.id}function isCeFalseCaretContainer(node,rootNode){return isCaretContainer(node)&&hasParent(node,rootNode,isFormatterCaret)===!1}function RangeUtils(dom){this.walk=function(rng,callback){function exclude(nodes){var node;return node=nodes[0],3===node.nodeType&&node===startContainer&&startOffset>=node.nodeValue.length&&nodes.splice(0,1),node=nodes[nodes.length-1],0===endOffset&&nodes.length>0&&node===endContainer&&3===node.nodeType&&nodes.splice(nodes.length-1,1),nodes}function collectSiblings(node,name,end_node){for(var siblings=[];node&&node!=end_node;node=node[name])siblings.push(node);return siblings}function findEndPoint(node,root){do{if(node.parentNode==root)return node;node=node.parentNode}while(node)}function walkBoundary(start_node,end_node,next){var siblingName=next?"nextSibling":"previousSibling";for(node=start_node,parent=node.parentNode;node&&node!=end_node;node=parent)parent=node.parentNode,siblings=collectSiblings(node==start_node?node:node[siblingName],siblingName),siblings.length&&(next||siblings.reverse(),callback(exclude(siblings)))}var ancestor,startPoint,endPoint,node,parent,siblings,nodes,startContainer=rng.startContainer,startOffset=rng.startOffset,endContainer=rng.endContainer,endOffset=rng.endOffset;if(nodes=dom.select("td[data-mce-selected],th[data-mce-selected]"),nodes.length>0)return void each(nodes,function(node){callback([node])});if(1==startContainer.nodeType&&startContainer.hasChildNodes()&&(startContainer=startContainer.childNodes[startOffset]),1==endContainer.nodeType&&endContainer.hasChildNodes()&&(endContainer=getEndChild(endContainer,endOffset)),startContainer==endContainer)return callback(exclude([startContainer]));for(ancestor=dom.findCommonAncestor(startContainer,endContainer),node=startContainer;node;node=node.parentNode){if(node===endContainer)return walkBoundary(startContainer,ancestor,!0);if(node===ancestor)break}for(node=endContainer;node;node=node.parentNode){if(node===startContainer)return walkBoundary(endContainer,ancestor);if(node===ancestor)break}startPoint=findEndPoint(startContainer,ancestor)||startContainer,endPoint=findEndPoint(endContainer,ancestor)||endContainer,walkBoundary(startContainer,startPoint,!0),siblings=collectSiblings(startPoint==startContainer?startPoint:startPoint.nextSibling,"nextSibling",endPoint==endContainer?endPoint.nextSibling:endPoint),siblings.length&&callback(exclude(siblings)),walkBoundary(endContainer,endPoint)},this.split=function(rng){function splitText(node,offset){return node.splitText(offset)}var startContainer=rng.startContainer,startOffset=rng.startOffset,endContainer=rng.endContainer,endOffset=rng.endOffset;return startContainer==endContainer&&3==startContainer.nodeType?startOffset>0&&startOffsetstartOffset?(endOffset-=startOffset,startContainer=endContainer=splitText(endContainer,endOffset).previousSibling,endOffset=endContainer.nodeValue.length,startOffset=0):endOffset=0):(3==startContainer.nodeType&&startOffset>0&&startOffset0&&endOffset0)return container=node,offset=left?node.nodeValue.length:0,void(normalized=!0);if(dom.isBlock(node)||nonEmptyElementsMap[node.nodeName.toLowerCase()])return;lastInlineElement=node}collapsed&&lastInlineElement&&(container=lastInlineElement,normalized=!0,offset=0)}var container,offset,walker,node,nonEmptyElementsMap,directionLeft,isAfterNode,body=dom.getRoot();if(container=rng[(start?"start":"end")+"Container"],offset=rng[(start?"start":"end")+"Offset"],isAfterNode=1==container.nodeType&&offset===container.childNodes.length,nonEmptyElementsMap=dom.schema.getNonEmptyElements(),directionLeft=start,!isCaretContainer(container)){if(1==container.nodeType&&offset>container.childNodes.length-1&&(directionLeft=!1),9===container.nodeType&&(container=dom.getRoot(),offset=0),container===body){if(directionLeft&&(node=container.childNodes[offset>0?offset-1:0])){if(isCaretContainer(node))return;if(nonEmptyElementsMap[node.nodeName]||"TABLE"==node.nodeName)return}if(container.hasChildNodes()){if(offset=Math.min(!directionLeft&&offset>0?offset-1:offset,container.childNodes.length-1),container=container.childNodes[offset],offset=0,!collapsed&&container===body.lastChild&&"TABLE"===container.nodeName)return;if(function(node){for(;node&&node!=body;){if(isContentEditableFalse(node))return!0;node=node.parentNode}return!1}(container)||isCaretContainer(container))return;if(container.hasChildNodes()&&!/TABLE/.test(container.nodeName)){node=container,walker=new TreeWalker(container,body);do{if(isContentEditableFalse(node)||isCaretContainer(node)){normalized=!1;break}if(3===node.nodeType&&node.nodeValue.length>0){offset=directionLeft?0:node.nodeValue.length,container=node,normalized=!0;break}if(nonEmptyElementsMap[node.nodeName.toLowerCase()]&&!function(node){return node&&/^(TD|TH|CAPTION)$/.test(node.nodeName)}(node)){offset=dom.nodeIndex(node),container=node.parentNode,"IMG"!=node.nodeName||directionLeft||offset++,normalized=!0;break}}while(node=directionLeft?walker.next():walker.prev())}}}collapsed&&(3===container.nodeType&&0===offset&&findTextNodeRelative(!0),1===container.nodeType&&(node=container.childNodes[offset],node||(node=container.childNodes[offset-1]),!node||"BR"!==node.nodeName||function(node,name){return node.previousSibling&&node.previousSibling.nodeName==name}(node,"A")||hasBrBeforeAfter(node)||hasBrBeforeAfter(node,!0)||findTextNodeRelative(!0,node))),directionLeft&&!collapsed&&3===container.nodeType&&offset===container.nodeValue.length&&findTextNodeRelative(!1),normalized&&rng["set"+(start?"Start":"End")](container,offset)}}var normalized,collapsed;return collapsed=rng.collapsed,normalizeEndPoint(!0),collapsed||normalizeEndPoint(), normalized&&collapsed&&rng.collapse(!0),normalized}}function findClosestIeRange(clientX,clientY,doc){var element,rng,rects;if(element=doc.elementFromPoint(clientX,clientY),rng=doc.body.createTextRange(),element&&"HTML"!=element.tagName||(element=doc.body),rng.moveToElementText(element),rects=Tools.toArray(rng.getClientRects()),rects=rects.sort(function(a,b){return a=Math.abs(Math.max(a.top-clientY,a.bottom-clientY)),b=Math.abs(Math.max(b.top-clientY,b.bottom-clientY)),a-b}),rects.length>0){clientY=(rects[0].bottom+rects[0].top)/2;try{return rng.moveToPoint(clientX,clientY),rng.collapse(!0),rng}catch(ex){}}return null}function moveOutOfContentEditableFalse(rng,rootNode){var parentElement=rng&&rng.parentElement?rng.parentElement():null;return isContentEditableFalse(findParent(parentElement,rootNode,hasCeProperty))?null:rng}var each=Tools.each,isContentEditableTrue=NodeType.isContentEditableTrue,isContentEditableFalse=NodeType.isContentEditableFalse,isCaretContainer=CaretContainer.isCaretContainer;return RangeUtils.compareRanges=function(rng1,rng2){if(rng1&&rng2){if(!rng1.item&&!rng1.duplicate)return rng1.startContainer==rng2.startContainer&&rng1.startOffset==rng2.startOffset;if(rng1.item&&rng2.item&&rng1.item(0)===rng2.item(0))return!0;if(rng1.isEqual&&rng2.isEqual&&rng2.isEqual(rng1))return!0}return!1},RangeUtils.getCaretRangeFromPoint=function(clientX,clientY,doc){var rng,point;if(doc.caretPositionFromPoint)point=doc.caretPositionFromPoint(clientX,clientY),rng=doc.createRange(),rng.setStart(point.offsetNode,point.offset),rng.collapse(!0);else if(doc.caretRangeFromPoint)rng=doc.caretRangeFromPoint(clientX,clientY);else if(doc.body.createTextRange){rng=doc.body.createTextRange();try{rng.moveToPoint(clientX,clientY),rng.collapse(!0)}catch(ex){rng=findClosestIeRange(clientX,clientY,doc)}return moveOutOfContentEditableFalse(rng,doc.body)}return rng},RangeUtils.getSelectedNode=function(range){var startContainer=range.startContainer,startOffset=range.startOffset;return startContainer.hasChildNodes()&&range.endOffset==startOffset+1?startContainer.childNodes[startOffset]:null},RangeUtils.getNode=function(container,offset){return 1==container.nodeType&&container.hasChildNodes()&&(offset>=container.childNodes.length&&(offset=container.childNodes.length-1),container=container.childNodes[offset]),container},RangeUtils}),define("tinymce/NodeChange",["tinymce/dom/RangeUtils","tinymce/Env","tinymce/util/Delay"],function(RangeUtils,Env,Delay){return function(editor){function isSameElementPath(startElm){var i,currentPath;if(currentPath=editor.$(startElm).parentsUntil(editor.getBody()).add(startElm),currentPath.length===lastPath.length){for(i=currentPath.length;i>=0&¤tPath[i]===lastPath[i];i--);if(i===-1)return lastPath=currentPath,!0}return lastPath=currentPath,!1}var lastRng,lastPath=[];"onselectionchange"in editor.getDoc()||editor.on("NodeChange Click MouseUp KeyUp Focus",function(e){var nativeRng,fakeRng;nativeRng=editor.selection.getRng(),fakeRng={startContainer:nativeRng.startContainer,startOffset:nativeRng.startOffset,endContainer:nativeRng.endContainer,endOffset:nativeRng.endOffset},"nodechange"!=e.type&&RangeUtils.compareRanges(fakeRng,lastRng)||editor.fire("SelectionChange"),lastRng=fakeRng}),editor.on("contextmenu",function(){editor.fire("SelectionChange")}),editor.on("SelectionChange",function(){var startElm=editor.selection.getStart(!0);!Env.range&&editor.selection.isCollapsed()||!isSameElementPath(startElm)&&editor.dom.isChildOf(startElm,editor.getBody())&&editor.nodeChanged({selectionChange:!0})}),editor.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==editor.selection.getNode().nodeName?Delay.setEditorTimeout(editor,function(){editor.nodeChanged()}):editor.nodeChanged())}),this.nodeChanged=function(args){var node,parents,root,selection=editor.selection;editor.initialized&&selection&&!editor.settings.disable_nodechange&&!editor.readonly&&(root=editor.getBody(),node=selection.getStart()||root,node.ownerDocument==editor.getDoc()&&editor.dom.isChildOf(node,root)||(node=root),"IMG"==node.nodeName&&selection.isCollapsed()&&(node=node.parentNode),parents=[],editor.dom.getParent(node,function(node){if(node===root)return!0;parents.push(node)}),args=args||{},args.element=node,args.parents=parents,editor.fire("NodeChange",args))}}}),define("tinymce/html/Node",[],function(){function walk(node,root_node,prev){var sibling,parent,startName=prev?"lastChild":"firstChild",siblingName=prev?"prev":"next";if(node[startName])return node[startName];if(node!==root_node){if(sibling=node[siblingName])return sibling;for(parent=node.parent;parent&&parent!==root_node;parent=parent.parent)if(sibling=parent[siblingName])return sibling}}function Node(name,type){this.name=name,this.type=type,1===type&&(this.attributes=[],this.attributes.map={})}var whiteSpaceRegExp=/^[ \t\r\n]*$/,typeLookup={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return Node.prototype={replace:function(node){var self=this;return node.parent&&node.remove(),self.insert(node,self),self.remove(),self},attr:function(name,value){var attrs,i,self=this;if("string"!=typeof name){for(i in name)self.attr(i,name[i]);return self}if(attrs=self.attributes){if(void 0!==value){if(null===value){if(name in attrs.map)for(delete attrs.map[name],i=attrs.length;i--;)if(attrs[i].name===name)return attrs=attrs.splice(i,1),self;return self}if(name in attrs.map){for(i=attrs.length;i--;)if(attrs[i].name===name){attrs[i].value=value;break}}else attrs.push({name:name,value:value});return attrs.map[name]=value,self}return attrs.map[name]}},clone:function(){var i,l,selfAttrs,selfAttr,cloneAttrs,self=this,clone=new Node(self.name,self.type);if(selfAttrs=self.attributes){for(cloneAttrs=[],cloneAttrs.map={},i=0,l=selfAttrs.length;i