/* >>> file start: js/jquery/jquery.lj.repostbutton.js */
LJ.UI.registerTemplate('templates-CleanHtml-PaidRepost', "{{if !$data.owner}}+{{html $data.cost}}{{else $data.budget}}{{html $data.budget}}{{/if}}{{html $data.count}} ", 'JQuery.stat');
LJ.UI.registerTemplate('templates-CleanHtml-Repost', "{{if !$data.owner}}+{{html $data.cost}}{{else $data.budget}}{{html $data.budget}}{{/if}}{{html $data.count}} ", 'JQuery.stat');
LJ.UI.registerTemplate('templates-CleanHtml-reposted', "{{if $data.content}} {{each ($value.users || $data.users)}}{{if !((!$index) && !($value.dropComma || $data.dropComma))}}, {{/if}}{{html ($value.user || $data.user)}}{{/each}} {{else}}
{{/if}} ", 'JQuery.stat');
!function(t){return t}(),function(t){"use strict";t.widget("lj.repostbutton",t.lj.basicWidget,{options:{classNames:{active:"repost-button-active",inactive:"repost-button-inactive",popupLoad:"b-reposted-popup-load",popupNomore:"b-reposted-popup-footer-hide",repostError:"repost-error"},selectors:{counterParent:".lj-button-c",button:".lj-button-b",counter:".lj-like-item-count",buttonLink:".lj-button-link",popupContent:".b-reposted-popup-content",popupFooter:".b-reposted-popup-footer",popupMore:".b-reposted-popup-footer > a"},templates:{popup:"templates-CleanHtml-reposted"},url:"",reposted:!1,cost:0,budget:0,paid:!1},_create:function(){this.options.classNames={active:"b-flatrepost-reposted",inactive:"b-flatrepost-disabled",popupLoad:"b-reposted-popup-load",popupNomore:"b-reposted-popup-footer-hide",repostError:"repost-error"},this.options.selectors={counterParent:".b-flatrepost-counter",button:".b-flatrepost-name",counter:".b-flatrepost-counter",buttonLink:".b-flatrepost-name",popupContent:".b-reposted-popup-content",popupFooter:".b-reposted-popup-footer",popupMore:".b-reposted-popup-footer > a"},t.lj.basicWidget.prototype._create.apply(this),this.options.url||console.warn(this.widgetName,": no url in options, initialization won't continue"),this._journal=LJ.get("currentJournal"),this._count=null,this._remote=LJ.get("remoteUser"),this._reposted=this.options.reposted,this._el("buttonLink"),this._href=this.element.find(this._s("button")).data("href"),this._href=LJ.Util.Journal.parseLink(this._href)||{},this._canRepost()||(this.element.addClass(this._cl("inactive")),this._buttonLink.removeAttr("title"),this._lock()),this._popup=null,this._popupContent=null,this._popupLocked=!1,this._lastUser=null,this._el("counterParent"),this._el("counter"),Number(this._counter.html())||this._hideCounter(),this._bindControls()},_hideCounter:function(){this._counterParent.addClass("empty")},_showCounter:function(){this._counterParent.removeClass("empty")},_bindControls:function(){var e=this;this.element.on("click",this._s("button"),this._onUpdateButton.bind(this)),this._counterParent.one("click",function(){Number(e._counter.html())&&(e._popup=e._tmpl("popup"),e._el("popupFooter",e._popup),e._popupContent=e._popup.find(e._s("popupContent")),e._popup.bubble({showOn:"click",align:"side",alwaysShowUnderTarget:!0,target:e._counterParent}).on("bubblehide",function(){e._lastUser=null,e._popupContent.empty(),e._popupFooter.removeClass(e._cl("popupNomore"))}).on("bubbleshow",function(){e._loadRepostedList()}).on("click",e._s("popupMore"),e._loadRepostedList.bind(e)),Function.defer(function(){e._popup.bubble("show")}))}),t.lj.basicWidget.prototype._bindControls.apply(e)},_loadRepostedList:function(t){var e=this;t&&t.preventDefault(),this._popupLocked||(this._popupLocked=!0,this._popupContent.addClass(this._cl("popupLoad")),LJ.Api.call("repost.get_list",{url:this.options.url,last:this._lastUser},function(t){e._popupContent.removeClass(e._cl("popupLoad")),e._popupLocked=!1,t.error?e._handleAnswer(t):(e._render(t.users,t.nomore,t.count),e._lastUser=t.last)}))},_render:function(t,e,o){var s=this;t.length>0&&s._tmpl("popup",{content:!0,dropComma:!!s._lastUser,users:t}).appendTo(s._popupContent),this._updateCounter(o),e&&s._popupFooter.addClass(s._cl("popupNomore"))},_onUpdateButton:function(t){this.locked()||this.toggleRepost(),t.preventDefault()},_handleAnswer:function(t){if(t.hasOwnProperty("delete")&&(t.message&&this._showMessage(t.message),this.paid!==Boolean(t.paid)||this.paid&&this.cost!==t.cost))return void this.element.replaceWith(LJ.Social.renderRepostButton(this.options.url,t));if(t.error){if(t.error.message&&this._showMessage(t.error.message),t.error.data)return void this.element.replaceWith(LJ.Social.renderRepostButton(this.options.url,t.error.data))}else this._updateButton(!this._reposted);!t.hasOwnProperty("count")&&t.hasOwnProperty("delete")&&(t.count=this._count-1),this._updateCounter(t.count),this._unlock()},_showMessage:function(e){var o=t("",{"class":this._cl("repostError"),text:e}).bubble({target:this.element,align:"center",hide:function(){o.remove()}}).bubble("show")},_updateButton:function(t){this._reposted=t,this.element.toggleClass(this._cl("active"),this._reposted)},_updateCounter:function(t){"undefined"!=typeof t&&(this._count=Number(t),this._counter.html(this._count)),Number(this._counter.html())?this._showCounter():this._hideCounter()},_canRepost:function(){return LJ.get("preview")?!1:this._remote?LJ.get("remote_is_identity")?!1:this._remote===this._href.journal?!1:!0:!1},toggleRepost:function(){var t=this,e={url:this.options.url};this._canRepost()&&(null===this._count&&(this._count=parseInt(this._el("counter").html(),10)||0),this._lock(),this._reposted?LJ.Api.call("repost.delete",e,function(e){e.error||e.reposted||t._journal!==t._remote||location.href.match(/\/(friends|times|feed)\b/)?t._handleAnswer(e):location.reload()}):(e.timezone=LJ.Util.Date.timezone(),this.options.paid&&(e.cost=this.options.cost),LJ.Api.call("repost.create",e,this._handleAnswer.bind(this))))}})}(jQuery);
/* <<< file end: js/jquery/jquery.lj.repostbutton.js */
//# map link was there [jquery.lj.repostbutton.js.map]
/* >>> file start: js/threeposts.js */
!function(t){return t}(),function(t){"use strict";t(function(){function e(){var t=3,e={7:4,8:4,9:3};return t=e[v]>0?e[v]:v}function i(){var t=1;if(M>H)return t=1;if(v>=2){t=Math.floor(H/M),t>v&&(t=v);var e=v%t;if(e>0)if(v%(t-1)===0)t--;else if(v%(t+1)===0)t++;else if(1===e){var i=H/(t+1);i>=E&&t++}}return t}function n(){H=u.width(),b=O>H?i():e(),s(H/b)}function s(t){var e=[150,300,330,400,500,600,800],i=["xxs","xs","s","m","l","xl","xxl"];e.forEach(function(n){t>n&&(F=i[e.indexOf(n)])})}function r(){u.find("."+w).removeClass(w),"xs"===F&&z.each(function(){var e=t(this).find("."+_),i=e.get(0).getClientRects().length;2>i&&t(this).addClass(w)})}function o(t){return p.get(t).scrollHeight}function a(){if(0===C&&g.height()>0){p.height("auto");var t=p.map(o),e=Math.max.apply(Math,t);p.height(e)}}function h(){H=u.width();var t=[400,600,800,1e3,1200,1400],e=["xs","s","m","l","xl","xxl"];t.forEach(function(i){H>i&&(j=e[t.indexOf(i)])}),n(),f()}function f(){var t=c+"--size-"+j,e=c+"--items-in-row-"+b,i=c+"--item-size-"+F,n=l+"\n"+t+"\n"+e+"\n"+i;u.attr("class",n),u.attr("data-item-layout",F),x.hide(),d.show(),a(),r()}var c="threeposts",u=t("."+c),l=u.attr("class"),x=t(".placeholder-threeposts"),d=t(".threeposts__items"),m="threeposts__item",p=t("."+m),g=t(p.get(0)),v=p.length,_="threeposts__title-inner",w="threeposts__item--short-title",y="threeposts__item--pic",z=t("."+y),C=z.length,M=235,E=200,O=1200,b=3,j="xxs",F="xxs",H=u.width();h(),t(window).resize(LJ.Function.debounce(h,50))})}(jQuery);
/* <<< file end: js/threeposts.js */
//# map link was there [threeposts.js.map]
/* >>> file start: js/jquery/jquery.lj.ljcut.js */
!function(t){return t}(),function(t){"use strict";var e=[];t.widget("lj.ljcut",t.lj.basicWidget,{options:{journalid:null,ditemid:null,cutid:null,placeholders:0,sticky:!1,selectors:{expand:".ljcut-link-expand",collapse:".ljcut-link-collapse",collapseLink:".ljcut-pseudolink-collapse",stickyLink:".b-sticky-cut-link"},classNames:{preloader:"ljcut-link-expanding",expanded:"ljcut-expanded","sticky-cut-visible":"b-sticky-cut-visible",cut:".b-sticky-cut"}},_create:function(){t.lj.basicWidget.prototype._create.apply(this),this._window=t(window),this.cut=t(this._cl("cut")),this._stickyCollapseHandler=this._collapse.bind(this),this.content=null,this._isMac=/Mac/.test(navigator.userAgent),this._isOpera=/Opera/.test(navigator.userAgent),this._collapseNode=t('{close}'.supplant({close:this._ml("collapse")})),this._bindControls(),this._id=e.length,e[this._id]=!1},_bindControls:function(){var e=!1,i=[this._s("expand"),this._s("collapse")].join(", ");t.lj.basicWidget.prototype._bindControls.apply(this),this.element.on("click",this._s("expand"),this._expand.bind(this)),this.element.on("click",this._s("collapse"),this._collapse.bind(this)),this.element.on("touchstart",i,function(){e=!0}),this.element.on("touchmove",i,function(){e=!1}),this.element.on("touchend",i,function(i){e&&(t(i.target).trigger("click"),i.preventDefault())}),t(document).on("keydown",this._shortcuts.bind(this)),this._window.on("scroll",this._scrolling.bind(this))},_shortcuts:function(t){var e=this._isMac&&this._isOpera?t.metaKey:t.ctrlKey,i=t.altKey;if(e&&i){switch(t.which){case 61:case 187:this.expand();break;case 173:case 31:case 109:case 189:this.collapse()}t.preventDefault()}},_togglePreloader:function(t){this.element.toggleClass(this._cl("preloader"),t)},_toggleContent:function(e,i){var s,n=this;!this.locked()&&this.content&&(this._lock(),"function"!=typeof i&&(i=t.noop),this.element.toggleClass(n._cl("expanded"),e),e?this._showContent(i):(s=this.element.offset().top-30,this.element.is(":screenable")?this._hideContent(i):t("body,html").animate({scrollTop:s},300,function(){setTimeout(n._hideContent.bind(n,i),50)})))},_showContent:function(t){var e=this;this.content.show(50,function(){e._trigger("show",null,e),t(),e._unlock()})},_hideContent:function(t){var e=this;this.content.slideUp(50,function(){e._trigger("hide",null,e),t(),e._unlock()})},_requestContent:function(e){var i=this;this._lock(),this._togglePreloader(!0),LJ.Api.call("event.get_lj_cut",e,function(e){i.content=t("",{html:e.text}).hide(),i.content.find("a:not([target])").attr("target","_self"),i.element.after(i.content),i._unlock(),i._togglePreloader(!1),i._toggleContent(!0,i._addHandlers.bind(i)),e.counter_image_url&&LJ.Stat.addCounter(e.counter_image_url)})},_addHandlers:function(){this.content.ljLikes(),LJ.Event.trigger("social:widgets:parse")},expand:function(){this.locked()||(this.content?this._toggleContent(!0):this._requestContent({journalid:this.options.journalid,ditemid:this.options.ditemid,cutid:this.options.cutid,placeholders:this.options.placeholders}))},collapse:function(){this.locked()||(this._toggleContent(!1),this._toggleStickyClass(!1))},_expand:function(t){return t.metaKey||t.ctrlKey?!0:(t.preventDefault(),void this.expand())},_collapse:function(t){return t.metaKey||t.ctrlKey?!0:(t.preventDefault(),e[this._id]=!1,void this.collapse())},_scrolling:function(){this._updateStickyCutState()},_updateStickyCutState:function(){var i,s,n,o,l,c,a;this._isExpanded()&&this.options.sticky&&this.content&&(i=this._window.height(),s=t(document).scrollTop(),n=this.content.height(),o=this.content.offset().top,l=o+n,a=this.element.find(this._s("collapse")),c=s>o&&l-i>s,e[this._id]=c,this._toggleStickyClass(c))},_toggleStickyClass:function(i){this.cut.toggleClass(this._cl("sticky-cut-visible"),e.indexOf(!0)>-1),i?t(document).on("click",this._s("stickyLink"),this._stickyCollapseHandler):t(document).off("click",this._s("stickyLink"),this._stickyCollapseHandler)},_addBottomCollapser:function(){return!this._bottomCloser&&this.options.sticky&&(this._bottomCloser=this._collapseNode.appendTo(this.content),this._bottomCloser.find(this._s("collapseLink")).on("click",this._bottomCloserClickHandler.bind(this))),this._bottomCloser},_bottomCloserClickHandler:function(){event.preventDefault(),this.collapse()},_isExpanded:function(){return this.element.hasClass(this._cl("expanded"))},_isCollapsed:function(){return!this._isExpanded()}})}(jQuery);
/* <<< file end: js/jquery/jquery.lj.ljcut.js */
//# map link was there [jquery.lj.ljcut.js.map]
/* >>> file start: js/core/string.js */
!function(t){return t}(),function(){"use strict";LJ.define("LJ.String"),LJ.String.pad=function(t,n,r){if(t=t.toString(),"undefined"==typeof n)throw new Error("You should provide padding string length");if("undefined"==typeof r)throw new Error("You should provide padding symbol");if(t.length>=n)return t;for(;t.length":">",'"':""","'":"'"};return t.replace(/([<>&\"\'])/g,function(t,r){return n[r]?n[r]:r})}}();
/* <<< file end: js/core/string.js */
//# map link was there [string.js.map]
/* >>> file start: js/core/angular/activity.js */
!function(){"use strict";function t(t,n){function c(){return u}function e(t){u=t}function i(){n.cancel(o),e(!0),o=n(e.bind(this,!1),9e5)}var u,o;return i(),t.on("click touchstart touchend keydown mousemove mousewheel",LJ.Function.debounce(i,100,!0)),{isActive:c}}angular.module("LJ.Activity",[]),angular.module("LJ.Activity").factory("Activity",t),t.$inject=["$document","$timeout"]}();
/* <<< file end: js/core/angular/activity.js */
//# map link was there [activity.js.map]
/* >>> file start: js/core/angular/api.js */
//!= require js/core/angular/messages.js
//= require js/core/angular/activity.js
!function(){"use strict";function e(e,n,t,r,a,c){function i(e,n){return"undefined"==typeof n?e:e+angular.toJson(s(n))}function s(e){var n;return angular.isObject(e)?(n={},Object.keys(e).sort().forEach(function(t){n[t]=s(e[t])}),n):e}function o(e,n){f.remove(i(e,n))}function u(n,s,o,u){var g,l,p=r.defer(),d={cache:!1,silent:!1,meta:!1},m=!1;return c.isActive()?(angular.isObject(s)&&null!==s||(s={}),angular.isObject(o)&&(u=o,o=null),u=angular.extend(d,u||{}),l=i(n,s),u.cache&&(g=f.get(l),g&&(m=!0)),m||(g=p.promise,LJ.Api.call(n,s,function(n){e(function(){n.error?p.reject(n.error):p.resolve(n),t.$apply()},0)}),u.cache&&f.put(l,g)),LJ.Event.trigger("api:request:change",n,!0),g.then(function(){LJ.Event.trigger("api:request:change",n,!1)}),u.silent||g.then(function(e){var n={};"undefined"!=typeof e.message&&(angular.isString(e.message)?(n.body=e.message,n.type="success"):(n.body=e.message.content,n.type="success"),a.add(n))},function(e){"undefined"!=typeof e.message&&1!==e.code&&a.error({body:e.message})}),u.meta&&(g=g.then(function(e){return{response:e,fromCache:m}})),angular.isFunction(o)&&g.then(o),g):(p.reject(),p.promise)}var g={call:u,invalidate:o},f=n("LJApiPromises");return g}angular.module("LJ.Api",["LJ.Messages","LJ.Activity"]).factory("Api",e),e.$inject=["$timeout","$cacheFactory","$rootScope","$q","Messages","Activity"]}();
/* <<< file end: js/core/angular/api.js */
//# map link was there [api.js.map]
/* >>> file start: js/lib/jquery-ui/jquery.ui.position.min.js */
!function(t,e){t.ui=t.ui||{};var o=/left|center|right/,i=/top|center|bottom/,n="center",s={},f=t.fn.position,l=t.fn.offset;t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var l,r,a,h=t(e.of),c=h[0],p=(e.collision||"flip").split(" "),u=e.offset?e.offset.split(" "):[0,0];return 9===c.nodeType?(l=h.width(),r=h.height(),a={top:0,left:0}):c.setTimeout?(l=h.width(),r=h.height(),a={top:h.scrollTop(),left:h.scrollLeft()}):c.preventDefault?(e.at="left top",l=r=0,a={top:e.of.pageY,left:e.of.pageX}):(l=h.outerWidth(),r=h.outerHeight(),a=h.offset()),t.each(["my","at"],function(){var t=(e[this]||"").split(" ");1===t.length&&(t=o.test(t[0])?t.concat([n]):i.test(t[0])?[n].concat(t):[n,n]),t[0]=o.test(t[0])?t[0]:n,t[1]=i.test(t[1])?t[1]:n,e[this]=t}),1===p.length&&(p[1]=p[0]),u[0]=parseInt(u[0],10)||0,1===u.length&&(u[1]=u[0]),u[1]=parseInt(u[1],10)||0,"right"===e.at[0]?a.left+=l:e.at[0]===n&&(a.left+=l/2),"bottom"===e.at[1]?a.top+=r:e.at[1]===n&&(a.top+=r/2),a.left+=u[0],a.top+=u[1],this.each(function(){var o,i=t(this),f=i.outerWidth(),h=i.outerHeight(),c=parseInt(t.curCSS(this,"marginLeft",!0))||0,g=parseInt(t.curCSS(this,"marginTop",!0))||0,d=f+c+(parseInt(t.curCSS(this,"marginRight",!0))||0),m=h+g+(parseInt(t.curCSS(this,"marginBottom",!0))||0),y=t.extend({},a);"right"===e.my[0]?y.left-=f:e.my[0]===n&&(y.left-=f/2),"bottom"===e.my[1]?y.top-=h:e.my[1]===n&&(y.top-=h/2),s.fractions||(y.left=Math.round(y.left),y.top=Math.round(y.top)),o={left:y.left-c,top:y.top-g},t.each(["left","top"],function(i,n){t.ui.position[p[i]]&&t.ui.position[p[i]][n](y,{targetWidth:l,targetHeight:r,elemWidth:f,elemHeight:h,collisionPosition:o,collisionWidth:d,collisionHeight:m,offset:u,my:e.my,at:e.at})}),t.fn.bgiframe&&i.bgiframe(),i.offset(t.extend(y,{using:e.using}))})},t.ui.position={fit:{left:function(e,o){var i=t(window),n=o.collisionPosition.left+o.collisionWidth-i.width()-i.scrollLeft();e.left=n>0?e.left-n:Math.max(e.left-o.collisionPosition.left,e.left)},top:function(e,o){var i=t(window),n=o.collisionPosition.top+o.collisionHeight-i.height()-i.scrollTop();e.top=n>0?e.top-n:Math.max(e.top-o.collisionPosition.top,e.top)}},flip:{left:function(e,o){if(o.at[0]!==n){var i=t(window),s=o.collisionPosition.left+o.collisionWidth-i.width()-i.scrollLeft(),f="left"===o.my[0]?-o.elemWidth:"right"===o.my[0]?o.elemWidth:0,l="left"===o.at[0]?o.targetWidth:-o.targetWidth,r=-2*o.offset[0];e.left+=o.collisionPosition.left<0?f+l+r:s>0?f+l+r:0}},top:function(e,o){if(o.at[1]!==n){var i=t(window),s=o.collisionPosition.top+o.collisionHeight-i.height()-i.scrollTop(),f="top"===o.my[1]?-o.elemHeight:"bottom"===o.my[1]?o.elemHeight:0,l="top"===o.at[1]?o.targetHeight:-o.targetHeight,r=-2*o.offset[1];e.top+=o.collisionPosition.top<0?f+l+r:s>0?f+l+r:0}}}},t.offset.setOffset||(t.offset.setOffset=function(e,o){/static/.test(t.curCSS(e,"position"))&&(e.style.position="relative");var i=t(e),n=i.offset(),s=parseInt(t.curCSS(e,"top",!0),10)||0,f=parseInt(t.curCSS(e,"left",!0),10)||0,l={top:o.top-n.top+s,left:o.left-n.left+f};"using"in o?o.using.call(e,l):i.css(l)},t.fn.offset=function(e){var o=this[0];return o&&o.ownerDocument?e?t.isFunction(e)?this.each(function(o){t(this).offset(e.call(this,o,t(this).offset()))}):this.each(function(){t.offset.setOffset(this,e)}):l.call(this):null}),t.curCSS||(t.curCSS=t.css),function(){var e,o,i,n,f,l=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(l?"div":"body"),i={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},l&&t.extend(i,{position:"absolute",left:"-1000px",top:"-1000px"});for(var a in i)e.style[a]=i[a];e.appendChild(r),o=l||document.documentElement,o.insertBefore(e,o.firstChild),r.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",n=t(r).offset(function(t,e){return e}).offset(),e.innerHTML="",o.removeChild(e),f=n.top+n.left+(l?2e3:0),s.fractions=f>21&&22>f}()}(jQuery);
/* <<< file end: js/lib/jquery-ui/jquery.ui.position.min.js */
//# map link was there [jquery.ui.position.min.js.map]
/* >>> file start: js/lib/jquery-ui/jquery.ui.autocomplete.min.js */
!function(e,t){var i=0;e.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var t,i=this,n=this.element[0].ownerDocument;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(n){if(!i.options.disabled&&!i.element.propAttr("readOnly")){t=!1;var s=e.ui.keyCode;switch(n.keyCode){case s.PAGE_UP:i._move("previousPage",n);break;case s.PAGE_DOWN:i._move("nextPage",n);break;case s.UP:i._keyEvent("previous",n);break;case s.DOWN:i._keyEvent("next",n);break;case s.ENTER:case s.NUMPAD_ENTER:i.menu.active&&(t=!0,n.preventDefault());case s.TAB:if(!i.menu.active)return;i.menu.select(n);break;case s.ESCAPE:i.element.val(i.term),i.close(n);break;default:clearTimeout(i.searching),i.searching=setTimeout(function(){i.term!=i.element.val()&&(i.selectedItem=null,i.search(null,n))},i.options.delay)}}}).bind("keypress.autocomplete",function(e){t&&(t=!1,e.preventDefault())}).bind("focus.autocomplete",function(){i.options.disabled||(i.selectedItem=null,i.previous=i.element.val())}).bind("blur.autocomplete",function(e){i.options.disabled||(clearTimeout(i.searching),i.closing=setTimeout(function(){i.close(e),i._change(e)},150))}),this._initSource(),this.menu=e("").addClass("ui-autocomplete").appendTo(e(this.options.appendTo||"body",n)[0]).mousedown(function(t){var n=i.menu.element[0];e(t.target).closest(".ui-menu-item").length||setTimeout(function(){e(document).one("mousedown",function(t){t.target!==i.element[0]&&t.target!==n&&!e.ui.contains(n,t.target)&&i.close()})},1),setTimeout(function(){clearTimeout(i.closing)},13)}).menu({focus:function(e,t){var n=t.item.data("item.autocomplete");!1!==i._trigger("focus",e,{item:n})&&/^key/.test(e.originalEvent.type)&&i.element.val(n.value)},selected:function(e,t){var s=t.item.data("item.autocomplete"),o=i.previous;i.element[0]!==n.activeElement&&(i.element.focus(),i.previous=o,setTimeout(function(){i.previous=o,i.selectedItem=s},1)),!1!==i._trigger("select",e,{item:s})&&i.element.val(s.value),i.term=i.element.val(),i.close(e),i.selectedItem=s},blur:function(e,t){i.menu.element.is(":visible")&&i.element.val()!==i.term&&i.element.val(i.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),e.fn.bgiframe&&this.menu.element.bgiframe(),i.beforeunloadHandler=function(){i.element.removeAttr("autocomplete")},e(window).bind("beforeunload",i.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),e(window).unbind("beforeunload",this.beforeunloadHandler),e.Widget.prototype.destroy.call(this)},_setOption:function(t,i){e.Widget.prototype._setOption.apply(this,arguments),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(e(i||"body",this.element[0].ownerDocument)[0]),"disabled"===t&&i&&this.xhr&&this.xhr.abort()},_initSource:function(){var t,i,n=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,n){n(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,s){n.xhr&&n.xhr.abort(),n.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e,t){s(e)},error:function(){s([])}})}):this.source=this.options.source},search:function(e,t){return e=null!=e?e:this.element.val(),this.term=this.element.val(),e.length").data("item.autocomplete",i).append(e("").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.first()&&/^previous/.test(e)||this.menu.last()&&/^next/.test(e)?(this.element.val(this.term),void this.menu.deactivate()):void this.menu[e](t):void this.search(null,t)},widget:function(){return this.menu.element},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(t,i){var n=new RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return n.test(e.label||e.value||e)})}})}(jQuery),function(e){e.widget("ui.menu",{_create:function(){var t=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(i){e(i.target).closest(".ui-menu-item a").length&&(i.preventDefault(),t.select(i))}),this.refresh()},refresh:function(){var t=this,i=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");i.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(i){t.activate(i,e(this).parent())}).mouseleave(function(){t.deactivate()})},activate:function(e,t){if(this.deactivate(),this.hasScroll()){var i=t.offset().top-this.element.offset().top,n=this.element.scrollTop(),s=this.element.height();0>i?this.element.scrollTop(n+i):i>=s&&this.element.scrollTop(n+i-s+t.height())}this.active=t.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",e,{item:t})},deactivate:function(){this.active&&(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,t,i){if(!this.active)return void this.activate(i,this.element.children(t));var n=this.active[e+"All"](".ui-menu-item").eq(0);n.length?this.activate(i,n):this.activate(i,this.element.children(t))},nextPage:function(t){if(this.hasScroll()){if(!this.active||this.last())return void this.activate(t,this.element.children(".ui-menu-item:first"));var i=this.active.offset().top,n=this.element.height(),s=this.element.children(".ui-menu-item").filter(function(){var t=e(this).offset().top-i-n+e(this).height();return 10>t&&t>-10});s.length||(s=this.element.children(".ui-menu-item:last")),this.activate(t,s)}else this.activate(t,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(t){if(this.hasScroll()){if(!this.active||this.first())return void this.activate(t,this.element.children(".ui-menu-item:last"));var i=this.active.offset().top,n=this.element.height(),s=this.element.children(".ui-menu-item").filter(function(){var t=e(this).offset().top-i+n-e(this).height();return 10>t&&t>-10});s.length||(s=this.element.children(".ui-menu-item:first")),this.activate(t,s)}else this.activate(t,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()>> file start: js/core/angular/autocomplete.js */
//= require js/lib/jquery-ui/jquery.ui.position.min.js
//= require js/lib/jquery-ui/jquery.ui.autocomplete.min.js
angular.module("LJ.Autocomplete",[]).directive("ljAutocomplete",["$parse",function(e){return{restrict:"A",link:function(t,o,l){function n(e,t){var n,c,i,r,f,d=e.term,v=LJ.DOM.getSelection(o).start,A=d.slice(0,v),j=d.slice(v);return j.length&&","!==j.charAt(0)?void t():(A=A.trim(),c=A.lastIndexOf(","),-1===c?(r=A,p=[]):(r=A.slice(c+1).trim(),p=A.slice(0,c).split(/\,\s*/)),j.length?(j=j.slice(1).trim(),s=j.split(/\,\s*/),""===s[s.length-1]&&s.pop()):s=[],n=p.concat(s),r.length>> file start: js/core/angular/ref.js */
!function(e){return e}(),function(){"use strict";angular.module("LJ.Ref",[]).factory("Ref",function(){function e(e,n){return f[e]?void console.error("Ref element with id `%s` has been registered before.",e):void(f[e]=n)}function n(e){f[e]&&delete f[e]}function o(e){var n=f[e];return n||console.error("Ref `%s` not found.",e),n}function r(e,n){"undefined"==typeof n&&(n={});var r=o(e),f=angular.element("html, body");if(!r)return void console.error("Could not scroll to the ref `%s` that has not been already defined.",e);var l=r.offset().top;n.onlyUp&&angular.element(window).scrollTop()<=l||(!n.onlyOutOfScreen||t(r))&&(n.toParent&&(f=r.parent(),l=0),f.animate({scrollTop:l}))}function t(e){var n=angular.element(window),o=n.scrollTop(),r=o+n.height(),t=e.offset().top;return t>r-100||o>t}var f={};return{add:e,remove:n,get:o,scrollTo:r}}).directive("ljRef",["Ref",function(e){return{restrict:"A",scope:!0,link:function(n,o,r){var t=r.ljRef;e.add(t,o),n.$on("$destroy",function(){e.remove(t)})}}}])}();
/* <<< file end: js/core/angular/ref.js */
//# map link was there [ref.js.map]
/* >>> file start: js/core/angular/bubble.js */
//= require js/core/angular/ref.js
Site.page.template['Widgets/ljBubble.tmpl'] = '\n \n
\n';
Site.page.template['angular/confirm.bubble.ng.tmpl'] = '\n';
//= require_ml confirm.bubble.yes
//= require_ml confirm.bubble.no
!function(){"use strict";function e(e,o,t,n,r){return{scope:!0,link:function(i,l,a){function u(){var e=i.arrow.vertical,o=i.arrow.horizontal;i.visibility="hidden",$.keepInitialWidth&&!$.widthSaved&&($.widthSaved=!0,C.width(C.width())),f(),d()&&(i.arrow.vertical="b"===e?c("alwaysTop")?"b":"t":c("alwaysBottom")?"t":"b"),p()&&(i.arrow.horizontal="l"===o?c("alwaysRight")?"l":"r":c("alwaysLeft")?"r":"l"),i.arrow.horizontal!==o||i.arrow.vertical!==e?n(s):i.visibility="visible"}function s(){return f(),p()&&!c("aside")&&i.arrow.horizontal?(i.arrow.horizontal="",void s()):void(i.visibility="visible")}function c(e){return i.bubble.options[e]||$[e]}function f(){var o=e.node||l,t=o.offset().left+Math.floor(o.outerWidth()/2),n=i.bubble.options.forceX||0,r=i.bubble.options.forceY||0;c("aside")?(i.position.x="r"===i.arrow.horizontal?o.offset().left-C.outerWidth()-B.outerWidth()+n:o.offset().left+o.outerWidth()+B.outerWidth()+n,i.position.y=o.offset().top-B.position().top+(o.outerHeight()-B.outerHeight())/2+r):(i.position.x=i.arrow.horizontal?t-B.position().left-Math.floor(B.outerWidth()/2)-2+n:t-C.outerWidth()/2-Math.floor(B.outerWidth()/4)-2+n,i.position.y="t"===i.arrow.vertical?o.offset().top+o.outerHeight()+B.outerHeight()+r:o.offset().top-B.outerHeight()-C.outerHeight()+r)}function b(){i.position.x=-9999}function d(){var e=L.scrollTop();return i.position.ye+L.outerHeight()}function p(){var e=L.scrollLeft();return i.position.xe+L.outerWidth()}function h(o){o.preventDefault(),e.current!==$.name&&n(function(){e.open($.name)})}function v(){m(),x&&(y=n(e.close,x))}function m(){n.cancel(y)}function w(){m(),e.close()}function g(){i.show&&n(W)}var y,$=o(a.ljBubble)(i),z=$.name,C=t(r.get("ljBubble.tmpl"))(i),W=LJ.Function.throttle(u,50),B=C.find(".i-popup-arr"),L=angular.element(window),j=$.eventType||"click",x=Number($.autoClose||0);i.show=!1,e._register(z,$),i.template=$.template||z+".html",i.bubble={name:z,close:e.close,options:e.options(z)},i.clear=function(){i.arrow={vertical:$.arrowInitialVertical||"t",horizontal:$.arrowInitialHorizontal||"l"}},i.position={x:-9999,y:-9999},i.visibility="hidden",i.arrowClass=function(){var e=i.bubble.options,o=i.arrow.vertical,t=i.arrow.horizontal;return e.aside||$.aside?"i-popup-arr"+t+o:"i-popup-arr"+o+t},i.$watch(function(){return e.current},function(e){b(),n(function(){i.show=e===z,e&&i.show&&(i.clear(),n(W))})},!0),$.disableClick||l.on(j,h),$.disableResizeListener||L.on("resize",g),$.recalculateOnOrientationChange&&L.on("orientationchange",function(){g(),L.on("resize",g),n(function(){L.off("resize",g)},1e3)}),$.recalculateOnScroll&&L.on("scroll",g),$.closeOnScroll&&L.on("scroll",w),angular.element("body").append(C),l.on("mouseleave",v),C.on("mouseenter",m),C.on("mouseleave",v),i.clear(),i.$on("$destroy",function(){l.off(j,h),L.off("resize",g),L.off("scroll",g),L.off("scroll",e.close),l.off("mouseleave",v),C.off("mouseenter",m),C.off("mouseleave",v),e._unregister(z),C.remove()})}}}function o(e,o,t,n,r,i){var l={},a={},u="p-openpopup";return l.current=null,l.node=null,l.register=function(){function t(t,l){var a,u,s;return t&&t.name&&t.template?(a=t.name,t.disableClick=!0,r[a]?(r[a].count+=1,n.bind(null,a)):(u=angular.element("").attr("lj-bubble",angular.toJson(t)),s="undefined"==typeof l,s&&(l=e.$new(!0)),u.appendTo("body"),o(u)(l),r[a]={count:1,node:u,scope:l,isScopeCreated:s},n.bind(null,a))):void i.error("Incorrect bubble options. You should provide name and template.",t)}function n(e){var o=r[e];o&&(o.count-=1,0===o.count&&(o.isScopeCreated||o.scope.$destroy(),o.node.remove(),delete r[e]))}var r={};return t}(),l.exists=function(e){return a.hasOwnProperty(e)},l._register=function(e,o){var t;if(a.hasOwnProperty(e))throw"Warning: bubble with name "+e+" has been registered before!";t=angular.isDefined(o)?angular.copy(o):{},t=angular.extend({closeControl:!0},t),a[e]=Object.create(t)},l._unregister=function(e){delete a[e],l.current===e&&(l.current=null)},l.confirm=function(e){function o(){r.scrollBy(0,1),r.scrollBy(0,-1)}var t=LJ.ml("confirm.bubble.yes"),i=LJ.ml("confirm.bubble.no"),a={closeControl:!1,confirm:e.confirm,header:e.header,text:e.text,yes:e.yes||t,no:e.no||i};l.open(e.id,a),n(o),n(o,100),n(o,200),n(o,300)},l.open=function(o,n,r){return a.hasOwnProperty(o)?(n instanceof jQuery&&(r=n,n={}),angular.isString(n)&&(r=t.get(n),n={}),angular.isObject(n)&&l.options(o,n),r instanceof jQuery&&(l.node=r),angular.isString(r)&&(l.node=t.get(r)),l.current=o,e.$broadcast("bubble:open",o,n,r),e.$broadcast("bubble:open:"+o,o,n,r),void angular.element("body").addClass(u)):void i.error("Bubble `"+o+"` can't be opened, it has not been registered yet.")},l.close=function(){var o,t=l.current,n=a[t];e.$broadcast("bubble:close",t,n,l.node),e.$broadcast("bubble:close:"+t,t,n,l.node);for(o in n)n.hasOwnProperty(o)&&delete n[o];l.current=null,l.node=null,angular.element("body").removeClass(u)},l.options=function(e,o){return"undefined"==typeof o||o===a[e]?a[e]:void angular.copy(o,a[e])},l}angular.module("LJ.Bubble",["LJ.Templates","LJ.Directives","LJ.Ref"]),angular.module("LJ.Bubble").factory("Bubble",o).directive("ljBubble",e),e.$inject=["Bubble","$parse","$compile","$timeout","$templateCache"],o.$inject=["$rootScope","$compile","Ref","$timeout","$window","$log"]}();
/* <<< file end: js/core/angular/bubble.js */
//# map link was there [bubble.js.map]
/* >>> file start: js/core/angular/options.js */
function _typeof(n){return n&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n}angular.module("LJ.Options",[]).factory("Options",[function(){return{create:function(n){function e(e,t){"undefined"==typeof t?angular.extend(n,e):n[e]=t}function t(e){return n[e]}function o(){return n}if("undefined"==typeof n&&(n={}),"object"!==("undefined"==typeof n?"undefined":_typeof(n)))throw new TypeError("Options should be an object.");return{set:e,get:t,raw:o}}}}]);
/* <<< file end: js/core/angular/options.js */
//# map link was there [options.js.map]
/* >>> file start: js/core/angular/users.js */
//= require js/core/angular/api.js
//= require js/core/angular/options.js
!function(e){return e}(),function(){"use strict";angular.module("Users",["LJ.Api","LJ.Options"]).factory("Relations",["$q","$timeout","UsersCache",function(e,n,r){function t(t,i,u){var a=e.defer(),s={addFriend:{is_invite_sent:!0},removeFriend:{is_friend:!1},subscribe:{is_subscribedon:!0},unsubscribe:{is_subscribedon:!1},join:{is_invite_sent:!0},leave:{is_member:!1},setBan:{is_banned:!0},setUnban:{is_banned:!1}},o={addFriend:{is_invite_sent:!1},removeFriend:{is_friend:!0},subscribe:{is_subscribedon:!1},unsubscribe:{is_subscribedon:!0},join:{is_invite_sent:!1},leave:{is_member:!0},setBan:{is_banned:!1},setUnban:{is_banned:!0}},c=angular.copy(r.get(t)||{});return angular.isUndefined(u)&&(u={}),u.wait||r.update(t,s[i]||{}),LJ.Event.trigger("relations.change",{username:t,action:i,callback:function(e){n(function(){if(e.error)return u.wait||r.update(t,angular.extend(o[i],c)),void a.reject(e.error.message);var n=LJ.Object.pick(e,"is_banned","is_friend","is_member","is_subscriber","is_subscribedon","is_friend_of","is_invite_sent");r.update(t,n),a.resolve(e)})}}),a.promise}function i(e,n,i){var u=t(e,n?"subscribe":"unsubscribe",i);return n||u.then(function(){r.update(e,{filtermask:0})}),u}function u(e,n,r){return t(e,n?"addFriend":"removeFriend",r)}function a(e,n,r){return t(e,n?"join":"leave",r)}function s(e,n,r){return t(e,n?"setBan":"setUnban",r)}function o(e,n,r){return t(e,n?"banEverywhere":"unbanEverywhere",r)}return{toggleFriend:u,toggleSubscription:i,toggleMember:a,toggleBan:s,toggleBanEverywhere:o}}]).factory("Mask",function(){function e(e){return e>>>0}var n={};return n.change=function(n,r){var t=r.add,i=r.remove;return angular.isDefined(t)&&(angular.isArray(t)||(t=[t]),n=t.reduce(function(n,r){return e(n|Math.pow(2,r))},n)),angular.isDefined(i)&&(angular.isArray(i)||(i=[i]),n=i.reduce(function(n,r){var t=Math.pow(2,32)-1-Math.pow(2,r);return e(n&t)},n)),n},n.check=function(e,n){var r=Math.pow(2,n);return Boolean(e&r)},n}).factory("UsersCache",["$q","$cacheFactory","Options",function(e,n,r){function t(e){if(!angular.isUndefined(e)){var n=l.get(f.get("journal"))||{},r=e;return angular.isArray(e)||(e=[e]),e.forEach(function(e){if(e&&angular.isObject(e)&&!angular.isUndefined(e.username)){var r=n[e.username];n[e.username]=r?angular.extend(r,e):e}}),l.put(f.get("journal"),n),r}}function i(e){var n=l.get(f.get("journal"));return Boolean(n[e])}function u(e){var n;if(angular.isString(e))return n=l.get(f.get("journal")),n&&n[e]?n[e]:null;if(angular.isFunction(e))return s(e);if(angular.isUndefined(e))return s();throw new TypeError("Incorrect argument passed.")}function a(e){var n=l.get(f.get("journal"));return n||angular.isObject(n)?Object.keys(n).reduce(function(r,t){return String(n[t].id)===String(e)?n[t]:r},null):null}function s(e){var n,r=l.get(f.get("journal")),t=[];for(n in r)if(r.hasOwnProperty(n)){if(e&&!e(r[n]))continue;t.push(r[n])}return t}function o(e,n){var r=u(e)||{username:e};return angular.extend(r,n),t(r),r}var c,l=n("users"),f=r.create({journal:LJ.get("remoteUser")});return c={add:t,update:o,set:f.set,get:u,getById:a,exists:i}}]).factory("Users",["$q","$timeout","Api","Mask","UsersCache","Options",function(e,n,r,t,i,u){function a(e){return k[C.get("type")][e]}function s(e){return"subscriptions"===C.get("type")?Boolean(e.is_subscribedon):!0}function o(e,n){return angular.isUndefined(n)?e[c()]||1:void(e[c()]=n)}function c(){return"subscriptions"===C.get("type")?"filtermask":"groupmask"}function l(e,n,t){return r.call("user.get",{target:e,fields:n},t).then(function(e){var n=e.user;return i.add(n),n})}function f(e,n,t){return r.call("user.get",{targetid:e,fields:n},t).then(function(e){var n=e.user;return i.add(n),n})}function d(e,n){return r.call("relations.list_friends",{journal:C.get("journal"),fields:e},n).then(_("is_friend"))}function g(e){return r.call("groups.list_users",{journal:C.get("journal"),fields:e}).then(function(e){return i.add(e.users),e})}function p(e){return r.call("relations.list_subscriptions",{journal:C.get("journal"),fields:e}).then(_("is_subscribedon"))}function b(e){return r.call("relations.list_banned",{journal:C.get("journal"),fields:e}).then(_("is_banned"))}function _(e){return function(n){var r=n.users;return r.forEach(LJ.Function.set(e,!0)),i.add(r),r}}function v(e){return r.call("relations."+e+"_count").then(function(e){return e.count})}function h(n){return angular.isArray(n)||(n=[n]),0===n.length?e.reject("You should provide users to sync."):r.call(a("update"),{users:n,journal:C.get("journal")}).then(function(e){return i.add(e.users),e})}function m(e,n){var r=i.get(e);return r?t.check(o(r),n):!1}function j(e){return e.filter(i.exists).map(i.get).filter(s)}function y(e){var n=(e.filter||"").toLowerCase(),r=i.get(function(r){return s(r)&&t.check(o(r),e.id)?n&&-1===r.display_username.toLowerCase().indexOf(n)?!1:!0:!1});return e.limit&&(r=r.slice(0,e.limit)),r}function U(e){var n=(e.filter||"").toLowerCase(),r=i.get(function(r){return s(r)?t.check(o(r),e.id)?!1:n&&-1===r.display_username.toLowerCase().indexOf(n)?!1:!0:!1});return e.limit&&(r=r.slice(0,e.limit)),r}function w(e,n){angular.isArray(n)||(n=[n]);var r;return r="subscriptions"===C.get("type")?j(n):n.map(function(e){return i.get(e)||{username:e}}),r.forEach(function(n){o(n,t.change(o(n),{add:e}))}),h(r)}function L(e,n,r){angular.isArray(n)||(n=[n]);var i=j(n);return i.forEach(function(n){o(n,t.change(o(n),{remove:e}))}),r&&r.silent?void 0:h(i)}function E(e,n){return i.update(e,{alias:n}),r.call("user.alias_set",{target:e,alias:n})}function F(e){return function(n,r){return n[e].toLowerCase().localeCompare(r[e].toLowerCase())}}function O(){var e,n=C.get("journal");C.set.apply(null,arguments),e=C.get("journal"),e!==n&&i.set("journal",e)}var k={friends:{read:"relations.list_friends",readOne:"relations.get_friend",update:"groups.update_users"},subscriptions:{read:"relations.list_subscriptions",readOne:"relations.get_subscription",update:"filters.update_users"}},C=u.create({type:"friends",journal:LJ.get("remoteUser")});return{USERHEAD_FIELDS:{alias:1,journal_url:1,profile_url:1,userhead_url:1,is_invisible:1,journaltype:1},set:O,get:C.get,Cache:i,fetchUser:l,fetchUserById:f,fetchBanned:b,fetchFriends:d,fetchGroupUsers:g,fetchSubscriptions:p,fetchCount:v,sync:h,alias:E,isUserInGroup:m,getExisting:j,fromGroup:y,outOfGroup:U,addToGroup:w,removeFromGroup:L,comparator:F}}])}();
/* <<< file end: js/core/angular/users.js */
//# map link was there [users.js.map]
/* >>> file start: js/lib/textinputs_jquery.js */
function _typeof(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}!function(e){function t(e,t){var n=_typeof(e[t]);return"function"===n||!("object"!=n||!e[t])||"unknown"==n}function n(e,t){return _typeof(e[t])!=g}function o(e,t){return!("object"!=_typeof(e[t])||!e[t])}function r(e){window.console&&window.console.log&&window.console.log("RangyInputs not supported in your browser. Reason: "+e)}function a(e,t,n){return 0>t&&(t+=e.value.length),("undefined"==typeof n?"undefined":_typeof(n))==g&&(n=t),0>n&&(n+=e.value.length),{start:t,end:n}}function c(e,t,n){return{start:t,end:n,length:n-t,text:e.value.slice(t,n)}}function l(){return o(document,"body")?document.body:document.getElementsByTagName("body")[0]}var i,s,u,d,f,v,p,m,y,g="undefined";e(document).ready(function(){function h(e,t){return function(){var n=this.jquery?this[0]:this,o=n.nodeName.toLowerCase();if(1==n.nodeType&&("textarea"==o||"input"==o&&"text"==n.type)){var r=[n].concat(Array.prototype.slice.call(arguments)),a=e.apply(this,r);if(!t)return a}return t?this:void 0}}var x=document.createElement("textarea");if(l().appendChild(x),n(x,"selectionStart")&&n(x,"selectionEnd"))i=function(e){var t=e.selectionStart,n=e.selectionEnd;return c(e,t,n)},s=function(e,t,n){var o=a(e,t,n);e.selectionStart=o.start,e.selectionEnd=o.end},y=function(e,t){t?e.selectionEnd=e.selectionStart:e.selectionStart=e.selectionEnd};else{if(!(t(x,"createTextRange")&&o(document,"selection")&&t(document.selection,"createRange")))return l().removeChild(x),void r("No means of finding text input caret position");i=function(e){var t,n,o,r,a=0,l=0,i=document.selection.createRange();return i&&i.parentElement()==e&&(o=e.value.length,t=e.value.replace(/\r\n/g,"\n"),n=e.createTextRange(),n.moveToBookmark(i.getBookmark()),r=e.createTextRange(),r.collapse(!1),n.compareEndPoints("StartToEnd",r)>-1?a=l=o:(a=-n.moveStart("character",-o),a+=t.slice(0,a).split("\n").length-1,n.compareEndPoints("EndToEnd",r)>-1?l=o:(l=-n.moveEnd("character",-o),l+=t.slice(0,l).split("\n").length-1))),c(e,a,l)};var E=function(e,t){return t-(e.value.slice(0,t).split("\r\n").length-1)};s=function(e,t,n){var o=a(e,t,n),r=e.createTextRange(),c=E(e,o.start);r.collapse(!0),o.start==o.end?r.move("character",c):(r.moveEnd("character",E(e,o.end)),r.moveStart("character",c)),r.select()},y=function(e,t){var n=document.selection.createRange();n.collapse(t),n.select()}}l().removeChild(x),d=function(e,t,n,o){var r;t!=n&&(r=e.value,e.value=r.slice(0,t)+r.slice(n)),o&&s(e,t,t)},u=function(e){var t=i(e);d(e,t.start,t.end,!0)},m=function(e){var t,n=i(e);return n.start!=n.end&&(t=e.value,e.value=t.slice(0,n.start)+t.slice(n.end)),s(e,n.start,n.start),n.text};var S=function(e,t,n,o){var r=t+n.length;switch(o="string"==typeof o?o.toLowerCase():""){case"collapsetostart":s(e,t,t);break;case"collapsetoend":s(e,r,r);break;case"select":s(e,t,r)}};f=function(e,t,n,o){var r=e.value;e.value=r.slice(0,n)+t+r.slice(n),"boolean"==typeof o&&(o=o?"collapseToEnd":""),S(e,n,t,o)},v=function(e,t,n){var o=i(e),r=e.value;e.value=r.slice(0,o.start)+t+r.slice(o.end),S(e,o.start,t,n||"collapseToEnd")},p=function(e,t,n,o){("undefined"==typeof n?"undefined":_typeof(n))==g&&(n=t);var r=i(e),a=e.value;e.value=a.slice(0,r.start)+t+r.text+n+a.slice(r.end);var c=r.start+t.length;S(e,c,r.text,o||"select")},e.fn.extend({getSelection:h(i,!1),setSelection:h(s,!0),collapseSelection:h(y,!0),deleteSelectedText:h(u,!0),deleteText:h(d,!0),extractSelectedText:h(m,!1),insertText:h(f,!0),replaceSelectedText:h(v,!0),surroundSelectedText:h(p,!0)})})}(jQuery);
/* <<< file end: js/lib/textinputs_jquery.js */
//# map link was there [textinputs_jquery.js.map]
/* >>> file start: js/core/angular/ljTour.js */
//= require js/core/angular/bubble.js
//= require js/core/angular/api.js
//= require js/core/angular/ref.js
Site.page.template['angular/bubbletour.ng.tmpl'] = '\n';
LJ.injectStyle('/* >>> file start: stc/tour/ljtour.css */\n.b-bubble-tour{z-index:5001}.b-bubble-tour .b-popup-inner{padding:0}.b-helptour{width:350px}.b-helptour-header{margin:0 0 .3em;padding:10px 16px 0}.b-helptour-footer:after,.b-helptour-header:after{display:table;width:100%;clear:both;content:\"\"}.b-helptour-stage-title{margin-right:10px}.b-helptour P:first-child{margin:0 0 .3em}.b-helptour-content{margin:10px 0 .6em;padding:0 16px}.b-helptour-content P{margin:.3em 0}.b-helptour-content LI,.b-helptour-content UL{margin:0;padding:0;list-style:none}.b-helptour-footer{padding:6px 15px;border-radius:0 0 5px 5px;background-color:#DAE3E6}.b-helptour-controls{margin:0;padding:0}.b-helptour-state{float:left}.b-helptour-step{float:right}.b-helptour-control{display:inline;margin-right:4px;cursor:pointer}.b-helptour-control-done:after{display:inline-block;content:\"\";width:14px;height:12px;background-image:url(/img/icons/unit_v3.png?v=42878);background-repeat:no-repeat;background-position:0 -223px}.b-helptour-control-done A{padding-left:8px}.b-helptour-control-done A:link,.b-helptour-control-done A:visited,.b-helptour-control-next A:link,.b-helptour-control-prev A:link{color:#00A3D9}.b-helptour-control-skip A:link,.b-helptour-control-skip A:visited{color:#7A9199}.b-helptour-control A{font-size:13px}.b-helptour-control A:active,.b-helptour-control A:focus,.b-helptour-control A:hover{color:#0086b3}.p-ljtour .b-lenta .l-flatslide-container{position:static}.p-ljtour .l-flatslide-menu-controls{position:absolute;top:auto!important}.p-ljtour.p-openpopup .w-cs{overflow:visible}@media all and (max-width:650px){.p-ljtour.p-openpopup .b-fader{display:none!important}.b-bubble-tour{display:none}}\n/* <<< file end: stc/tour/ljtour.css */\n\n/*# sourceMappingURL=ljtour.css.map */\n');
//= require_ml tour.steps.prev
//= require_ml tour.steps.next
//= require_ml tour.steps.skip
//= require_ml tour.steps.done
!function(e){return e}(),function(e){"use strict";angular.module("LJ.Tour",["LJ.Bubble","LJ.Templates","LJ.Directives","LJ.Api"]).factory("Tour",["Api",function(e){var t={};return t.queue={},t.checkAvailable=function(){var n=Object.keys(t.queue);return e.call("tour.is_available",{tours:n}).then(function(e){n.forEach(function(n){0===e.states[n]&&delete t.queue[n]})})},t.setDone=function(t){return e.call("tour.set_done",{tour:t})},t}]).directive("ljTour",["$timeout","$document","Bubble","Ref","Tour",function(t,n,r,u,o){return{scope:!0,link:function(i){function c(){e("body").find("[data-tour]").each(function(){var t=e(this),n=angular.extend({element:t},t.data());Array.isArray(O[n.tour])||(O[n.tour]=[]),O[n.tour].push(n)})}function a(){var e=Object.keys(O)[0],t=O[e];i.current=t.filter(function(e){return b(e)&&v(e)}).sort(function(e,t){return(e.tourStep||1)>t.tourStep}),i.current.forEach(function(e){u.add(e.tour+e.tourStep,e.element)}),delete O[e],m(i.current[0])?f():l()}function l(){Object.keys(O).length&&a()}function s(){r.close(),S.fadeOut(),angular.element("body").removeClass("p-ljtour").off("ljsale-load",y),o.setDone(i.step.tour),S.off("click",s),i.current=null,i.step=null,l()}function f(){return angular.element("body").addClass("p-ljtour").on("ljsale-load",function(e){e.originalEvent.data.slot&&y()}),S.is(":visible")?void t(f,300):(d(),S.on("click",s).fadeIn(),void(i.current=i.current.filter(function(e){return g(e.element)})))}function d(){var e=i.current.indexOf(i.step);e0&&(i.step=i.current[--e],i.index=++e,h())}function b(e){return e.hasOwnProperty("tourOwner")?LJ.get("remote.username")===LJ.get("journal.username"):!0}function v(e){return e.hasOwnProperty("tourSkipIf")?e.tourSkipIf.split(",").every(function(e){return e=e.trim(),"!"===e.charAt(0)?LJ.get(e.slice(1)):!LJ.get(e)}):!0}function g(e){return e.is(":visible")&&0!==e.css("opacity")&&"hidden"!==e.css("visibility")}function m(e){return e?e.hasOwnProperty("tourStartPage")?new RegExp(e.tourStartPage,"i").test(location.pathname):1===e.tourStep:!1}function y(){angular.element(window).trigger("resize"),k()}function h(){if(i.step){if(!i.step.element.is(":visible"))return d();r.current&&r.close(),t(function(){var e=r.options("tour")||{};r.open("tour",angular.extend(e,i.step.tourBubble),i.step.element),k()}),LJ.Event.once("visual_editor_ready",function(){t(y)})}}function k(){u.scrollTo(i.step.tour+i.step.tourStep,{onlyOutOfScreen:!0})}function J(e){if(i.current&&i.current.length){switch(e.which){case 27:s();break;case 37:p();break;case 39:d()}i.$apply()}}var L,O=o.queue,S=angular.element(document.querySelector(".b-fader")),w=!1;L=r.register({name:"tour",template:"bubbletour.ng.tmpl",closeControl:!1},i),!LJ.Flags.isEnabled("friendsfeed_tour")||LJ.Support.isMobile()||w||(w=!0,t(function(){c(),o.checkAvailable().then(l)})),i.next=d,i.prev=p,i.end=s,n.on("keydown",J),i.$on("$destroy",function(){n.off("keydown",J),L()})}}}])}(jQuery);
/* <<< file end: js/core/angular/ljTour.js */
//# map link was there [ljTour.js.map]
/* >>> file start: js/editor/editor.js */
//= require js/lib/textinputs_jquery.js
//= require js/core/angular/ljTour.js
!function(e){"use strict";angular.module("Editor",["LJ.Tour"]).factory("Editor",function(){var t={};return t.getSelectedText=function(){var t=e("#body");return t.getSelection().text},t.htmlMode=function(){return e("#body").is(":visible")},t.insertContent=function(n,r,o,i){var l,c=e("#body");if(LJ.Event.trigger("contentInsert"),t.htmlMode()){var u=r.split("{caret}");c.surroundSelectedText(u[0],u.length>1?u[u.length-1]||"":"").trigger("input"),l=c.getSelection(),3===u.length&&0===l.length&&c.replaceSelectedText(u[1],"collapseToEnd").setSelection(l.start+u[1].length+u[u.length-1].length)}else{if("color"===n)return LJ.Event.trigger("selectedColor",o);LJ.Event.trigger(n+"_response",o||r,i)}},t}).controller("EditorCtrl",["$scope","Editor","Bubble","$timeout",function(e,t,n,r){var o={bold:"{caret}",italic:"{caret}",underline:"{caret}",strikethrough:"{caret}"};e.formattingAction=function(e,n){e.preventDefault(),o[n]&&t.insertContent(n,o[n])},e.userClick=function(e,o){var i=t.getSelectedText(),l=/^[A-Za-z0-9_\-]+$/;e.preventDefault(),l.test(i)?t.insertContent(o,''):r(function(){n.open("user")})}}])}(jQuery);
/* <<< file end: js/editor/editor.js */
//# map link was there [editor.js.map]
/* >>> file start: js/editor/media.js */
//= require_ml media.ramblerkassa.title
LJ.define("LJ.Media"),LJ.Media.parse=function(e){"use strict";function t(t,i){this.provider=t,e.extend(this,i),this._cache={}}function i(e,t){var i,r;for(i in a)if(a.hasOwnProperty(i)&&(r=a[i].parse(e,t)))return r;return null}function r(t,r){r=e.extend({thumbnail:!0},r||{});try{var a,n=e(t).first();if(n&&"iframe"===n.prop("tagName").toLowerCase()&&(a=n&&n.attr("src")))return i(a,r)}catch(o){return i(t,r)}}t.prototype.parse=function(t,i){var r,a=this,n=this.params(t,i);if(n)return r=[],r.push("string"==typeof this.embed?this.toPromise(this.embed.supplant(n)):this.embed(n)),i.thumbnail&&this.thumbnail&&r.push("string"==typeof this.thumbnail?this.toPromise(this.thumbnail.supplant(n)):this.thumbnail(n)),e.when.apply(e,r).then(function(e,t){return{link:a.link.supplant(n),embed:e,thumb:t,site:a.provider}})},t.prototype.cache=function(e,t){return"undefined"==typeof t?this._cache[e]:void(this._cache[e]=t)},t.prototype.toPromise=function(t){var i=e.Deferred();return i.resolve(t),i.promise()};var a={ljVideo:new t("ljVideo",{link:"http://vc.videos.livejournal.com/index/player?player=new&record_id={storageid}",embed:function(e){return''.supplant(e)},thumbnail:function(e){return e.screenshot||this.cache(e.storageid)},params:function(t,i){var r=/.*livejournal\.com\/.*\?[\w=&]*record_id=(\d+).*$/,a=("string"==typeof t?t:i.url).match(r);return i.screenshot&&this.cache(i.storageid,i.screenshot),a&&e.extend(i,{storageid:a[1]})}}),coub:new t("coub",{link:"//coub.com/embed/{id}?muted=false&autostart=false&originalSize=false",embed:' ',thumbnail:function(e){var t=this.cache(e.id);return t?this.toPromise(t):this.toPromise(null)},params:function(e){var t=/\/\/[w\.]*coub\.com\/embed\/(\w+)/,i=e.match(t);return i&&{id:i[1]}}}),youtube:new t("youtube",{link:"http://youtube.com/watch?v={id}",thumbnail:"http://img.youtube.com/vi/{id}/0.jpg",embed:'',params:function(e){var t=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\??v?=?))([^#\&\?]*).*/,i=e.match(t);return i&&-1===i[0].indexOf("youtu")?null:i&&{id:i[7]}}}),vimeo:new t("vimeo",{link:"http://vimeo.com/{id}",embed:'',params:function(e){var t=/^(https?:\/\/)?(www\.)?(player\.)?vimeo.com\/(video\/|channels\/\w+\/)?(\d+)*/,i=e.match(t);return i&&{id:i[5]}},thumbnail:function(t){var i=this,r=this.cache(t.id);return r?this.toPromise(r):e.ajax({url:"http://vimeo.com/api/v2/video/"+t.id+".json",dataType:"jsonp"}).then(function(e){if(e&&e[0]){var r=e[0].thumbnail_large;if(r)return i.cache(t.id,r),r}else console.error("Data error",e)})}}),vine:new t("vine",{link:"http://vine.co/v/{id}",embed:'',params:function(e){var t=/vine.co\/v\/([^\/]*)/,i=e.match(t);return i&&{id:i[1]}}}),instagram:new t("instagram",{link:"http://instagram.com/p/{id}/",embed:'',params:function(e){var t=/.*(?:instagram\.\w*|instagr\.am)\/p\/([^\/]+).*/,i=e.match(t);return i&&{id:i[1]}}}),gist:new t("gist",{link:"https://gist.github.com/{id}",embed:'',params:function(e){var t=/.*(?:gist\.github\.com\/)([^\/]+\/{1}[^\/]+)\/{0,1}$/,i=e.match(t);return i&&{id:i[1]}}}),rutube:new t("rutube",{link:"http://rutube.ru/video/{id}/",embed:'',params:function(e){var t=/^.*rutube.ru\/video(\/embed\/|\/private\/|\/)(\w{32}).*/,i=e.match(t);return i&&{id:i[2]}},thumbnail:function(t){var i=this,r=this.cache(t.id);return r?this.toPromise(r):e.ajax({url:"http://rutube.ru/api/video/"+t.id+"/?format=jsonp",dataType:"jsonp"}).done(function(e){if(e&&e.thumbnail_url){var r=e.thumbnail_url;if(r)return i.cache(t.id,r),r}else console.error("Data error",e)})}}),twitter:new t("twitter",{link:"https://twitter.com/{username}/status/{id}",params:function(e){var t=/^.*twitter.com\/(\w*)\/status\/(\w*).*/,i=e.match(t);return i&&{id:i[2],username:i[1]}},embed:function(t){var i=this,r=this.cache(t.id);return r?this.toPromise(r):e.ajax({url:"https://api.twitter.com/1/statuses/oembed.json?id={id}".supplant({id:t.id}),dataType:"jsonp"}).then(function(e){var r=e.html.replace(/