bookstack/public/js/common.js

12 lines
364 KiB
JavaScript
Raw Normal View History

!function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){!function(e,t){"use strict";function n(e,t,n){if(!e)throw me("areq","Argument '{0}' is {1}",t||"?",n||"required");return e}function r(e,t){return e||t?e?t?(Z(e)&&(e=e.join(" ")),Z(t)&&(t=t.join(" ")),e+" "+t):e:t:""}function i(e){var t={};return e&&(e.to||e.from)&&(t.to=e.to,t.from=e.from),t}function o(e,t,n){var r="";return e=Z(e)?e:e&&ee(e)&&e.length?e.split(/\s+/):[],G(e,function(e,i){e&&e.length>0&&(r+=i>0?" ":"",r+=n?t+e:e+t)}),r}function a(e,t){var n=e.indexOf(t);t>=0&&e.splice(n,1)}function s(e){if(e instanceof ne)switch(e.length){case 0:return e;case 1:if(e[0].nodeType===L)return e;break;default:return ne(u(e))}if(e.nodeType===L)return ne(e)}function u(e){if(!e[0])return e;for(var t=0;t<e.length;t++){var n=e[t];if(n.nodeType==L)return n}}function l(e,t,n){G(t,function(t){e.addClass(t,n)})}function c(e,t,n){G(t,function(t){e.removeClass(t,n)})}function f(e){return function(t,n){n.addClass&&(l(e,t,n.addClass),n.addClass=null),n.removeClass&&(c(e,t,n.removeClass),n.removeClass=null)}}function d(e){if(e=e||{},!e.$$prepared){var t=e.domOperation||re;e.domOperation=function(){e.$$domOperationFired=!0,t(),t=re},e.$$prepared=!0}return e}function h(e,t){p(e,t),m(e,t)}function p(e,t){t.from&&(e.css(t.from),t.from=null)}function m(e,t){t.to&&(e.css(t.to),t.to=null)}function g(e,t,n){var r=t.options||{},i=n.options||{},o=(r.addClass||"")+" "+(i.addClass||""),a=(r.removeClass||"")+" "+(i.removeClass||""),s=v(e.attr("class"),o,a);i.preparationClasses&&(r.preparationClasses=C(i.preparationClasses,r.preparationClasses),delete i.preparationClasses);var u=r.domOperation!==re?r.domOperation:null;return B(r,i),u&&(r.domOperation=u),s.addClass?r.addClass=s.addClass:r.addClass=null,s.removeClass?r.removeClass=s.removeClass:r.removeClass=null,t.addClass=r.addClass,t.removeClass=r.removeClass,r}function v(e,t,n){function r(e){ee(e)&&(e=e.split(" "));var t={};return G(e,function(e){e.length&&(t[e]=!0)}),t}var i=1,o=-1,a={};e=r(e),t=r(t),G(t,function(e,t){a[t]=i}),n=r(n),G(n,function(e,t){a[t]=a[t]===i?null:o});var s={addClass:"",removeClass:""};return G(a,function(t,n){var r,a;t===i?(r="addClass",a=!e[n]||e[n+R]):t===o&&(r="removeClass",a=e[n]||e[n+j]),a&&(s[r].length&&(s[r]+=" "),s[r]+=n)}),s}function y(e){return e instanceof ne?e[0]:e}function $(e,t,n){var r="";t&&(r=o(t,U,!0)),n.addClass&&(r=C(r,o(n.addClass,j))),n.removeClass&&(r=C(r,o(n.removeClass,R))),r.length&&(n.preparationClasses=r,e.addClass(r))}function b(e,t){t.preparationClasses&&(e.removeClass(t.preparationClasses),t.preparationClasses=null),t.activeClasses&&(e.removeClass(t.activeClasses),t.activeClasses=null)}function w(e,t){var n=t?"-"+t+"s":"";return k(e,[he,n]),[he,n]}function x(e,t){var n=t?"paused":"",r=N+le;return k(e,[r,n]),[r,n]}function k(e,t){var n=t[0],r=t[1];e.style[n]=r}function C(e,t){return e?t?e+" "+t:e:t}function S(e){return[de,e+"s"]}function _(e,t){var n=t?fe:he;return[n,e+"s"]}function E(e,t,n){var r=Object.create(null),i=e.getComputedStyle(t)||{};return G(n,function(e,t){var n=i[e];if(n){var o=n.charAt(0);("-"===o||"+"===o||o>=0)&&(n=D(n)),0===n&&(n=null),r[t]=n}}),r}function D(e){var t=0,n=e.split(/\s*,\s*/);return G(n,function(e){"s"==e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),e=parseFloat(e)||0,t=t?Math.max(e,t):e}),t}function M(e){return 0===e||null!=e}function T(e,t){var n=F,r=e+"s";return t?n+=ie:r+=" linear all",[n,r]}function A(){var e=Object.create(null);return{flush:function(){e=Object.create(null)},count:function(t){var n=e[t];return n?n.total:0},get:function(t){var n=e[t];return n&&n.value},put:function(t,n){e[t]?e[t].total++:e[t]={total:1,value:n}}}}function O(e,t,n){G(n,functio
!o))for(;null==o&&(i=i.parentNode,i!==y);)o=i.nextSibling,1==i.nodeType&&n.end(i.nodeName.toLowerCase());i=o}for(;i=y.firstChild;)y.removeChild(i)}function h(e){for(var t={},n=0,r=e.length;n<r;n++){var i=e[n];t[i.name]=i.value}return t}function p(e){return e.replace(/&/g,"&amp;").replace($,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(b,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function m(e,t){var n=!1,r=i(e,e.push);return{start:function(e,i){e=u(e),!n&&D[e]&&(n=e),n||M[e]!==!0||(r("<"),r(e),a(i,function(n,i){var o=u(i),a="img"===e&&"src"===o||"background"===o;F[o]!==!0||T[o]===!0&&!t(n,a)||(r(" "),r(i),r('="'),r(p(n)),r('"'))}),r(">"))},end:function(e){e=u(e),n||M[e]!==!0||w[e]===!0||(r("</"),r(e),r(">")),e==n&&(n=!1)},chars:function(e){n||r(p(e))}}}function g(t){if(t.nodeType===e.Node.ELEMENT_NODE)for(var n=t.attributes,r=0,i=n.length;r<i;r++){var o=n[r],a=o.name.toLowerCase();"xmlns:ns1"!==a&&0!==a.lastIndexOf("ns1:",0)||(t.removeAttributeNode(o),r--,i--)}var s=t.firstChild;s&&g(s),s=t.nextSibling,s&&g(s)}var v=!1;this.$get=["$$sanitizeUri",function(e){return v&&o(M,E),function(t){var n=[];return c(t,f(n,function(t,n){return!/^unsafe:/.test(e(t,n))})),n.join("")}}],this.enableSvg=function(e){return s(e)?(v=e,this):v},i=t.bind,o=t.extend,a=t.forEach,s=t.isDefined,u=t.lowercase,l=t.noop,c=r,f=m;var y,$=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/([^\#-~ |!])/g,w=n("area,br,col,hr,img,wbr"),x=n("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),k=n("rp,rt"),C=o({},k,x),S=o({},x,n("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),_=o({},k,n("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),E=n("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),D=n("script,style"),M=o({},w,S,_,C),T=n("background,cite,href,longdesc,src,xlink:href"),A=n("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),O=n("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),F=o({},T,O,A);!function(e){var t;if(!e.document||!e.document.implementation)throw d("noinert","Can't create an inert html document");t=e.document.implementation.createHTMLDocument("inert");var n=t.documentElement||t.getDocumentElement(),r=n.getElementsByTagName("body");if(
$get:m(_)};var D=d(e);return E=_.get("$injector"),E.strictDi=t,r(D,function(e){e&&E.invoke(e)}),E}function it(){var e=!0;this.disableAutoScrolling=function(){e=!1},this.$get=["$window","$location","$rootScope",function(t,n,r){function i(e){var t=null;return Array.prototype.some.call(e,function(e){if("a"===L(e))return t=e,!0}),t}function o(){var e=s.yOffset;if(C(e))e=e();else if(N(e)){var n=e[0],r=t.getComputedStyle(n);e="fixed"!==r.position?0:n.getBoundingClientRect().bottom}else x(e)||(e=0);return e}function a(e){if(e){e.scrollIntoView();var n=o();if(n){var r=e.getBoundingClientRect().top;t.scrollBy(0,r-n)}}else t.scrollTo(0,0)}function s(e){e=w(e)?e:n.hash();var t;e?(t=u.getElementById(e))?a(t):(t=i(u.getElementsByName(e)))?a(t):"top"===e&&a(null):a(null)}var u=t.document;return e&&r.$watch(function(){return n.hash()},function(e,t){e===t&&""===e||Ye(function(){r.$evalAsync(s)})}),s}]}function ot(e,t){return e||t?e?t?(Zr(e)&&(e=e.join(" ")),Zr(t)&&(t=t.join(" ")),e+" "+t):e:t:""}function at(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.nodeType===ji)return n}}function st(e){w(e)&&(e=e.split(" "));var t=pe();return r(e,function(e){e.length&&(t[e]=!0)}),t}function ut(e){return $(e)?e:{}}function lt(e,t,n,i){function o(e){try{e.apply(null,z(arguments,1))}finally{if(y--,0===y)for(;$.length;)try{$.pop()()}catch(t){n.error(t)}}}function a(e){var t=e.indexOf("#");return t===-1?"":e.substr(t)}function s(){C=null,u(),l()}function u(){b=S(),b=v(b)?null:b,U(b,D)&&(b=D),D=b}function l(){x===c.url()&&w===b||(x=c.url(),w=b,r(_,function(e){e(c.url(),b)}))}var c=this,f=e.location,d=e.history,p=e.setTimeout,m=e.clearTimeout,g={};c.isMock=!1;var y=0,$=[];c.$$completeOutstandingRequest=o,c.$$incOutstandingRequestCount=function(){y++},c.notifyWhenNoOutstandingRequests=function(e){0===y?e():$.push(e)};var b,w,x=f.href,k=t.find("base"),C=null,S=i.history?function(){try{return d.state}catch(e){}}:h;u(),w=b,c.url=function(t,n,r){if(v(r)&&(r=null),f!==e.location&&(f=e.location),d!==e.history&&(d=e.history),t){var o=w===r;if(x===t&&(!i.history||o))return c;var s=x&&Ht(x)===Ht(t);return x=t,w=r,!i.history||s&&o?(s||(C=t),n?f.replace(t):s?f.hash=a(t):f.href=t,f.href!==t&&(C=t)):(d[n?"replaceState":"pushState"](r,"",t),u(),w=b),C&&(C=t),c}return C||f.href.replace(/%27/g,"'")},c.state=function(){return b};var _=[],E=!1,D=null;c.onUrlChange=function(t){return E||(i.history&&jr(e).on("popstate",s),jr(e).on("hashchange",s),E=!0),_.push(t),t},c.$$applicationDestroyed=function(){jr(e).off("hashchange popstate",s)},c.$$checkUrlChange=l,c.baseHref=function(){var e=k.attr("href");return e?e.replace(/^(https?\:)?\/\/[^\/]*/,""):""},c.defer=function(e,t){var n;return y++,n=p(function(){delete g[n],o(e)},t||0),g[n]=!0,n},c.defer.cancel=function(e){return!!g[e]&&(delete g[e],m(e),o(h),!0)}}function ct(){this.$get=["$window","$log","$sniffer","$document",function(e,t,n,r){return new lt(e,r,t,n)}]}function ft(){this.$get=function(){function e(e,r){function i(e){e!=d&&(h?h==e&&(h=e.n):h=e,o(e.n,e.p),o(e,d),d=e,d.n=null)}function o(e,t){e!=t&&(e&&(e.p=t),t&&(t.n=e))}if(e in n)throw t("$cacheFactory")("iid","CacheId '{0}' is already taken!",e);var a=0,s=l({},r,{id:e}),u=pe(),c=r&&r.capacity||Number.MAX_VALUE,f=pe(),d=null,h=null;return n[e]={put:function(e,t){if(!v(t)){if(c<Number.MAX_VALUE){var n=f[e]||(f[e]={key:e});i(n)}return e in u||a++,u[e]=t,a>c&&this.remove(h.key),t}},get:function(e){if(c<Number.MAX_VALUE){var t=f[e];if(!t)return;i(t)}return u[e]},remove:function(e){if(c<Number.MAX_VALUE){var t=f[e];if(!t)return;t==d&&(d=t.p),t==h&&(h=t.n),o(t.n,t.p),delete f[e]}e in u&&(delete u[e],a--)},removeAll:function(){u=pe(),a=0,f=pe(),d=h=null},destroy:function(){u=null,s=null,f=null,delete n[e]},info:function(){return l({},s,{size:a})}}}var n={};return e.info=function(){var e={};return r(n,function(t,n){e[n]=t.info()}),e},e.get=function(e){return n[e]},e}}function dt(){this.$get=["$cacheFactory",function(e){return e("templates")}]}function ht(){}function pt(t,n){function i(e,t,n){var i=/^\s*([@&<]|=(\*?))(\??)\s*(\w*)\s*$/,o=pe();return r(e,function(e,r){if(e in
0===n&&(n=t?200:"file"==In(s).protocol?404:0),b(l,n,t,k.getAllResponseHeaders(),e)};var C=function(){b(l,-1,null,null,"")};if(k.onerror=C,k.onabort=C,r(m,function(e,t){k.addEventListener(t,e)}),r(g,function(e,t){k.upload.addEventListener(t,e)}),d&&(k.withCredentials=!0),p)try{k.responseType=p}catch(S){if("json"!==p)throw S}k.send(v(u)?null:u)}if(f>0)var _=n($,f);else O(f)&&f.then($)}}function Pt(){var e="{{",t="}}";this.startSymbol=function(t){return t?(e=t,this):e},this.endSymbol=function(e){return e?(t=e,this):t},this.$get=["$parse","$exceptionHandler","$sce",function(n,r,i){function o(e){return"\\\\\\"+e}function a(n){return n.replace(h,e).replace(p,t)}function s(e){if(null==e)return"";switch(typeof e){case"string":break;case"number":e=""+e;break;default:e=q(e)}return e}function u(e,t,n,r){var i;return i=e.$watch(function(e){return i(),r(e)},t,n)}function c(o,c,h,p){function g(e){try{return e=O(e),p&&!y(e)?e:s(e)}catch(t){r(oo.interr(o,t))}}if(!o.length||o.indexOf(e)===-1){var $;if(!c){var b=a(o);$=m(b),$.exp=o,$.expressions=[],$.$$watchDelegate=u}return $}p=!!p;for(var w,x,k,S=0,_=[],E=[],D=o.length,M=[],T=[];S<D;){if((w=o.indexOf(e,S))==-1||(x=o.indexOf(t,w+f))==-1){S!==D&&M.push(a(o.substring(S)));break}S!==w&&M.push(a(o.substring(S,w))),k=o.substring(w+f,x),_.push(k),E.push(n(k,g)),S=x+d,T.push(M.length),M.push("")}if(h&&M.length>1&&oo.throwNoconcat(o),!c||_.length){var A=function(e){for(var t=0,n=_.length;t<n;t++){if(p&&v(e[t]))return;M[T[t]]=e[t]}return M.join("")},O=function(e){return h?i.getTrusted(h,e):i.valueOf(e)};return l(function(e){var t=0,n=_.length,i=new Array(n);try{for(;t<n;t++)i[t]=E[t](e);return A(i)}catch(a){r(oo.interr(o,a))}},{exp:o,expressions:_,$$watchDelegate:function(e,t){var n;return e.$watchGroup(E,function(r,i){var o=A(r);C(t)&&t.call(this,o,r!==i?n:o,e),n=o})}})}}var f=e.length,d=t.length,h=new RegExp(e.replace(/./g,o),"g"),p=new RegExp(t.replace(/./g,o),"g");return c.startSymbol=function(){return e},c.endSymbol=function(){return t},c}]}function Lt(){this.$get=["$rootScope","$window","$q","$$q","$browser",function(e,t,n,r,i){function o(o,s,u,l){function c(){f?o.apply(null,d):o(m)}var f=arguments.length>4,d=f?z(arguments,4):[],h=t.setInterval,p=t.clearInterval,m=0,g=y(l)&&!l,v=(g?r:n).defer(),$=v.promise;return u=y(u)?u:0,$.$$intervalId=h(function(){g?i.defer(c):e.$evalAsync(c),v.notify(m++),u>0&&m>=u&&(v.resolve(m),p($.$$intervalId),delete a[$.$$intervalId]),g||e.$apply()},s),a[$.$$intervalId]=v,$}var a={};return o.cancel=function(e){return!!(e&&e.$$intervalId in a)&&(a[e.$$intervalId].reject("canceled"),t.clearInterval(e.$$intervalId),delete a[e.$$intervalId],!0)},o}]}function jt(e){for(var t=e.split("/"),n=t.length;n--;)t[n]=ee(t[n]);return t.join("/")}function Rt(e,t){var n=In(e);t.$$protocol=n.protocol,t.$$host=n.hostname,t.$$port=f(n.port)||uo[n.protocol]||null}function Ut(e,t){var n="/"!==e.charAt(0);n&&(e="/"+e);var r=In(e);t.$$path=decodeURIComponent(n&&"/"===r.pathname.charAt(0)?r.pathname.substring(1):r.pathname),t.$$search=X(r.search),t.$$hash=decodeURIComponent(r.hash),t.$$path&&"/"!=t.$$path.charAt(0)&&(t.$$path="/"+t.$$path)}function Vt(e,t){return 0===e.lastIndexOf(t,0)}function zt(e,t){if(Vt(t,e))return t.substr(e.length)}function Ht(e){var t=e.indexOf("#");return t==-1?e:e.substr(0,t)}function Yt(e){return e.replace(/(#.+)|#$/,"$1")}function qt(e){return e.substr(0,Ht(e).lastIndexOf("/")+1)}function Wt(e){return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function Bt(e,t,n){this.$$html5=!0,n=n||"",Rt(e,this),this.$$parse=function(e){var n=zt(t,e);if(!w(n))throw lo("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',e,t);Ut(n,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var e=K(this.$$search),n=this.$$hash?"#"+ee(this.$$hash):"";this.$$url=jt(this.$$path)+(e?"?"+e:"")+n,this.$$absUrl=t+this.$$url.substr(1)},this.$$parseLinkUrl=function(r,i){if(i&&"#"===i[0])return this.hash(i.slice(1)),!0;var o,a,s;return y(o=zt(e,r))?(a=o,s=y(o=zt(n,o))?t+(zt("/",o)||o):e+a):y(o=zt(t,r))?s=t+o:t==r+"/"&&(s=t),s&&this.$$parse(s),!!s}}functio
t("json",ar),t("limitTo",sr),t("lowercase",Fo),t("number",qn),t("orderBy",lr),t("uppercase",Io)}function Un(){return function(e,r,i,o){if(!n(e)){if(null==e)return e;throw t("filter")("notarray","Expected array but received: {0}",e)}o=o||"$";var a,s,u=Hn(r);switch(u){case"function":a=r;break;case"boolean":case"null":case"number":case"string":s=!0;case"object":a=Vn(r,i,o,s);break;default:return e}return Array.prototype.filter.call(e,a)}}function Vn(e,t,n,r){var i,o=$(e)&&n in e;return t===!0?t=U:C(t)||(t=function(e,t){return!v(e)&&(null===e||null===t?e===t:!($(t)||$(e)&&!g(e))&&(e=Fr(""+e),t=Fr(""+t),e.indexOf(t)!==-1))}),i=function(i){return o&&!$(i)?zn(i,e[n],t,n,!1):zn(i,e,t,n,r)}}function zn(e,t,n,r,i,o){var a=Hn(e),s=Hn(t);if("string"===s&&"!"===t.charAt(0))return!zn(e,t.substring(1),n,r,i);if(Zr(e))return e.some(function(e){return zn(e,t,n,r,i)});switch(a){case"object":var u;if(i){for(u in e)if("$"!==u.charAt(0)&&zn(e[u],t,n,r,!0))return!0;return!o&&zn(e,t,n,r,!1)}if("object"===s){for(u in t){var l=t[u];if(!C(l)&&!v(l)){var c=u===r,f=c?e:e[u];if(!zn(f,l,n,r,c,c))return!1}}return!0}return n(e,t);case"function":return!1;default:return n(e,t)}}function Hn(e){return null===e?"null":typeof e}function Yn(e){var t=e.NUMBER_FORMATS;return function(e,n,r){return v(n)&&(n=t.CURRENCY_SYM),v(r)&&(r=t.PATTERNS[1].maxFrac),null==e?e:Gn(e,t.PATTERNS[1],t.GROUP_SEP,t.DECIMAL_SEP,r).replace(/\u00A4/g,n)}}function qn(e){var t=e.NUMBER_FORMATS;return function(e,n){return null==e?e:Gn(e,t.PATTERNS[0],t.GROUP_SEP,t.DECIMAL_SEP,n)}}function Wn(e){var t,n,r,i,o,a=0;for((n=e.indexOf(Do))>-1&&(e=e.replace(Do,"")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charAt(r)==Mo;r++);if(r==(o=e.length))t=[0],n=1;else{for(o--;e.charAt(o)==Mo;)o--;for(n-=r,t=[],i=0;r<=o;r++,i++)t[i]=+e.charAt(r)}return n>Eo&&(t=t.splice(0,Eo-1),a=n-1,n=1),{d:t,e:a,i:n}}function Bn(e,t,n,r){var i=e.d,o=i.length-e.i;t=v(t)?Math.min(Math.max(n,o),r):+t;var a=t+e.i,s=i[a];if(a>0){i.splice(Math.max(e.i,a));for(var u=a;u<i.length;u++)i[u]=0}else{o=Math.max(0,o),e.i=1,i.length=Math.max(1,a=t+1),i[0]=0;for(var l=1;l<a;l++)i[l]=0}if(s>=5)if(a-1<0){for(var c=0;c>a;c--)i.unshift(0),e.i++;i.unshift(1),e.i++}else i[a-1]++;for(;o<Math.max(0,t);o++)i.push(0);var f=i.reduceRight(function(e,t,n,r){return t+=e,r[n]=t%10,Math.floor(t/10)},0);f&&(i.unshift(f),e.i++)}function Gn(e,t,n,r,i){if(!w(e)&&!x(e)||isNaN(e))return"";var o,a=!isFinite(e),s=!1,u=Math.abs(e)+"",l="";if(a)l="∞";else{o=Wn(u),Bn(o,i,t.minFrac,t.maxFrac);var c=o.d,f=o.i,d=o.e,h=[];for(s=c.reduce(function(e,t){return e&&!t},!0);f<0;)c.unshift(0),f++;f>0?h=c.splice(f,c.length):(h=c,c=[0]);var p=[];for(c.length>=t.lgSize&&p.unshift(c.splice(-t.lgSize,c.length).join(""));c.length>t.gSize;)p.unshift(c.splice(-t.gSize,c.length).join(""));c.length&&p.unshift(c.join("")),l=p.join(n),h.length&&(l+=r+h.join("")),d&&(l+="e+"+d)}return e<0&&!s?t.negPre+l+t.negSuf:t.posPre+l+t.posSuf}function Zn(e,t,n,r){var i="";for((e<0||r&&e<=0)&&(r?e=-e+1:(e=-e,i="-")),e=""+e;e.length<t;)e=Mo+e;return n&&(e=e.substr(e.length-t)),i+e}function Qn(e,t,n,r,i){return n=n||0,function(o){var a=o["get"+e]();return(n>0||a>-n)&&(a+=n),0===a&&n==-12&&(a=12),Zn(a,t,r,i)}}function Jn(e,t,n){return function(r,i){var o=r["get"+e](),a=(n?"STANDALONE":"")+(t?"SHORT":""),s=Ir(a+e);return i[s][o]}}function Xn(e,t,n){var r=-1*n,i=r>=0?"+":"";return i+=Zn(Math[r>0?"floor":"ceil"](r/60),2)+Zn(Math.abs(r%60),2)}function Kn(e){var t=new Date(e,0,1).getDay();return new Date(e,0,(t<=4?5:12)-t)}function er(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function tr(e){return function(t){var n=Kn(t.getFullYear()),r=er(t),i=+r-+n,o=1+Math.round(i/6048e5);return Zn(o,e)}}function nr(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}function rr(e,t){return e.getFullYear()<=0?t.ERAS[0]:t.ERAS[1]}function ir(e,t){return e.getFullYear()<=0?t.ERANAMES[0]:t.ERANAMES[1]}function or(e){function t(e){var t;if(t=e.match(n)){var r=new Date(0),i=0,o=0,a=t[8]?r.setUTCFullYear:r.setFullYear,s=t[8]?r.setUTCHours
return"-"===e||"+"===e||this.isNumber(e)},throwError:function(e,t,n){n=n||this.index;var r=y(t)?"s "+t+"-"+this.index+" ["+this.text.substring(t,n)+"]":" "+n;throw fo("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",e,r,this.text)},readNumber:function(){for(var e="",t=this.index;this.index<this.text.length;){var n=Fr(this.text.charAt(this.index));if("."==n||this.isNumber(n))e+=n;else{var r=this.peek();if("e"==n&&this.isExpOperator(r))e+=n;else if(this.isExpOperator(n)&&r&&this.isNumber(r)&&"e"==e.charAt(e.length-1))e+=n;else{if(!this.isExpOperator(n)||r&&this.isNumber(r)||"e"!=e.charAt(e.length-1))break;this.throwError("Invalid exponent")}}this.index++}this.tokens.push({index:t,text:e,constant:!0,value:Number(e)})},readIdent:function(){var e=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var t=this.peekMultichar();if(!this.isIdentifierContinue(t))break;this.index+=t.length}this.tokens.push({index:e,text:this.text.slice(e,this.index),identifier:!0})},readString:function(e){var t=this.index;this.index++;for(var n="",r=e,i=!1;this.index<this.text.length;){var o=this.text.charAt(this.index);if(r+=o,i){if("u"===o){var a=this.text.substring(this.index+1,this.index+5);a.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+a+"]"),this.index+=4,n+=String.fromCharCode(parseInt(a,16))}else{var s=vo[o];n+=s||o}i=!1}else if("\\"===o)i=!0;else{if(o===e)return this.index++,void this.tokens.push({index:t,text:r,constant:!0,value:n});n+=o}this.index++}this.throwError("Unterminated quote",t)}};var $o=function(e,t){this.lexer=e,this.options=t};$o.Program="Program",$o.ExpressionStatement="ExpressionStatement",$o.AssignmentExpression="AssignmentExpression",$o.ConditionalExpression="ConditionalExpression",$o.LogicalExpression="LogicalExpression",$o.BinaryExpression="BinaryExpression",$o.UnaryExpression="UnaryExpression",$o.CallExpression="CallExpression",$o.MemberExpression="MemberExpression",$o.Identifier="Identifier",$o.Literal="Literal",$o.ArrayExpression="ArrayExpression",$o.Property="Property",$o.ObjectExpression="ObjectExpression",$o.ThisExpression="ThisExpression",$o.LocalsExpression="LocalsExpression",$o.NGValueParameter="NGValueParameter",$o.prototype={ast:function(e){this.text=e,this.tokens=this.lexer.lex(e);var t=this.program();return 0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),t},program:function(){for(var e=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&e.push(this.expressionStatement()),!this.expect(";"))return{type:$o.Program,body:e}},expressionStatement:function(){return{type:$o.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var e,t=this.expression();e=this.expect("|");)t=this.filter(t);return t},expression:function(){return this.assignment()},assignment:function(){var e=this.ternary();return this.expect("=")&&(e={type:$o.AssignmentExpression,left:e,right:this.assignment(),operator:"="}),e},ternary:function(){var e,t,n=this.logicalOR();return this.expect("?")&&(e=this.expression(),this.consume(":"))?(t=this.expression(),{type:$o.ConditionalExpression,test:n,alternate:e,consequent:t}):n},logicalOR:function(){for(var e=this.logicalAND();this.expect("||");)e={type:$o.LogicalExpression,operator:"||",left:e,right:this.logicalAND()};return e},logicalAND:function(){for(var e=this.equality();this.expect("&&");)e={type:$o.LogicalExpression,operator:"&&",left:e,right:this.equality()};return e},equality:function(){for(var e,t=this.relational();e=this.expect("==","!=","===","!==");)t={type:$o.BinaryExpression,operator:e.text,left:t,right:this.relational()};return t},relational:function(){for(var e,t=this.additive();e=this.expect("<",">","<=",">=");)t={type:$o.BinaryExpression,operator:e.text,left:t,right:this.additive()};return t},additive:function(){for(var e,t=this.multiplicative();e=this.expect("+","-");)t={type:$o.BinaryExpression,operator:e.text,left:t,right:this.multiplicative()};return t},multiplicative:function(){for(var e,t=this.unary();e=this.expect("*","/","%");)t={type:$o.BinaryExp
},unset:function(e,t){delete e[t]},$animate:a}),this.$setPristine=function(){b.$dirty=!1,b.$pristine=!0,a.removeClass(i,xa),a.addClass(i,wa)},this.$setDirty=function(){b.$dirty=!0,b.$pristine=!1,a.removeClass(i,wa),a.addClass(i,xa),b.$$parentForm.$setDirty()},this.$setUntouched=function(){b.$touched=!1,b.$untouched=!0,a.setClass(i,ka,Ca)},this.$setTouched=function(){b.$touched=!0,b.$untouched=!1,a.setClass(i,Ca,ka)},this.$rollbackViewValue=function(){s.cancel($),b.$viewValue=b.$$lastCommittedViewValue,b.$render()},this.$validate=function(){if(!x(b.$modelValue)||!isNaN(b.$modelValue)){var e=b.$$lastCommittedViewValue,t=b.$$rawModelValue,n=b.$valid,r=b.$modelValue,i=b.$options&&b.$options.allowInvalid;b.$$runValidators(t,e,function(e){i||n===e||(b.$modelValue=e?t:void 0,b.$modelValue!==r&&b.$$writeModelToScope())})}},this.$$runValidators=function(e,t,n){function i(){var e=b.$$parserName||"parse";return v(f)?(s(e,null),!0):(f||(r(b.$validators,function(e,t){s(t,null)}),r(b.$asyncValidators,function(e,t){s(t,null)})),s(e,f),f)}function o(){var n=!0;return r(b.$validators,function(r,i){var o=r(e,t);n=n&&o,s(i,o)}),!!n||(r(b.$asyncValidators,function(e,t){s(t,null)}),!1)}function a(){var n=[],i=!0;r(b.$asyncValidators,function(r,o){var a=r(e,t);if(!O(a))throw Da("nopromise","Expected asynchronous validator to return a promise but got '{0}' instead.",a);s(o,void 0),n.push(a.then(function(){s(o,!0)},function(){i=!1,s(o,!1)}))}),n.length?l.all(n).then(function(){u(i)},h):u(!0)}function s(e,t){c===w&&b.$setValidity(e,t)}function u(e){c===w&&n(e)}w++;var c=w;return i()&&o()?void a():void u(!1)},this.$commitViewValue=function(){var e=b.$viewValue;s.cancel($),(b.$$lastCommittedViewValue!==e||""===e&&b.$$hasNativeValidators)&&(b.$$updateEmptyClasses(e),b.$$lastCommittedViewValue=e,b.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){function t(){b.$modelValue!==o&&b.$$writeModelToScope()}var n=b.$$lastCommittedViewValue,r=n;if(f=!v(r)||void 0)for(var i=0;i<b.$parsers.length;i++)if(r=b.$parsers[i](r),v(r)){f=!1;break}x(b.$modelValue)&&isNaN(b.$modelValue)&&(b.$modelValue=m(e));var o=b.$modelValue,a=b.$options&&b.$options.allowInvalid;b.$$rawModelValue=r,a&&(b.$modelValue=r,t()),b.$$runValidators(r,b.$$lastCommittedViewValue,function(e){a||(b.$modelValue=e?r:void 0,t())})},this.$$writeModelToScope=function(){g(e,b.$modelValue),r(b.$viewChangeListeners,function(e){try{e()}catch(n){t(n)}})},this.$setViewValue=function(e,t){b.$viewValue=e,b.$options&&!b.$options.updateOnDefault||b.$$debounceViewValueCommit(t)},this.$$debounceViewValueCommit=function(t){var n,r=0,i=b.$options;i&&y(i.debounce)&&(n=i.debounce,x(n)?r=n:x(n[t])?r=n[t]:x(n["default"])&&(r=n["default"])),s.cancel($),r?$=s(function(){b.$commitViewValue()},r):u.$$phase?b.$commitViewValue():e.$apply(function(){b.$commitViewValue()})},e.$watch(function(){var t=m(e);if(t!==b.$modelValue&&(b.$modelValue===b.$modelValue||t===t)){b.$modelValue=b.$$rawModelValue=t,f=void 0;for(var n=b.$formatters,r=n.length,i=t;r--;)i=n[r](i);b.$viewValue!==i&&(b.$$updateEmptyClasses(i),b.$viewValue=b.$$lastCommittedViewValue=i,b.$render(),b.$$runValidators(t,i,h))}return t})}],Ta=["$rootScope",function(e){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Ma,priority:1,compile:function(t){return t.addClass(wa).addClass(ka).addClass($a),{pre:function(e,t,n,r){var i=r[0],o=r[1]||i.$$parentForm;i.$$setOptions(r[2]&&r[2].$options),o.$addControl(i),n.$observe("name",function(e){i.$name!==e&&i.$$parentForm.$$renameControl(i,e)}),e.$on("$destroy",function(){i.$$parentForm.$removeControl(i)})},post:function(t,n,r,i){var o=i[0];o.$options&&o.$options.updateOn&&n.on(o.$options.updateOn,function(e){o.$$debounceViewValueCommit(e&&e.type)}),n.on("blur",function(){o.$touched||(e.$$phase?t.$evalAsync(o.$setTouched):t.$apply(o.$setTouched))})}}}}}],Aa=/(\s+|^)default(\s+|$)/,Oa=function(){return{restrict:"A",controller:["$scope","$attrs",function(e,t){var n=this;this.$options=R(e.$eval(t.ngModelOptions)),y(this.$options.updateOn)?(this.$options.updateO
for(r=this.files,i=[],t=0,n=r.length;t<n;t++)e=r[t],e.accepted||i.push(e);return i},t.prototype.getFilesWithStatus=function(e){var t,n,r,i,o;for(i=this.files,o=[],n=0,r=i.length;n<r;n++)t=i[n],t.status===e&&o.push(t);return o},t.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(t.QUEUED)},t.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(t.UPLOADING)},t.prototype.getAddedFiles=function(){return this.getFilesWithStatus(t.ADDED)},t.prototype.getActiveFiles=function(){var e,n,r,i,o;for(i=this.files,o=[],n=0,r=i.length;n<r;n++)e=i[n],e.status!==t.UPLOADING&&e.status!==t.QUEUED||o.push(e);return o},t.prototype.init=function(){var e,n,r,i,o,a,s;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(t.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(r=function(e){return function(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null==e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!=e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!=e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var t,n,i,o;if(n=e.hiddenFileInput.files,n.length)for(i=0,o=n.length;i<o;i++)t=n[i],e.addFile(t);return e.emit("addedfiles",n),r()})}}(this))(),this.URL=null!=(a=window.URL)?a:window.webkitURL,s=this.events,i=0,o=s.length;i<o;i++)e=s[i],this.on(e,this.options[e]);return this.on("uploadprogress",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("canceled",function(e){return function(t){return e.emit("complete",t)}}(this)),this.on("complete",function(e){return function(t){if(0===e.getAddedFiles().length&&0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length)return setTimeout(function(){return e.emit("queuecomplete")},0)}}(this)),n=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(e){return function(t){return e.emit("dragstart",t)}}(this),dragenter:function(e){return function(t){return n(t),e.emit("dragenter",t)}}(this),dragover:function(e){return function(t){var r;try{r=t.dataTransfer.effectAllowed}catch(i){}return t.dataTransfer.dropEffect="move"===r||"linkMove"===r?"move":"copy",n(t),e.emit("dragover",t)}}(this),dragleave:function(e){return function(t){return e.emit("dragleave",t)}}(this),drop:function(e){return function(t){return n(t),e.drop(t)}}(this),dragend:function(e){return function(t){return e.emit("dragend",t)}}(this)}}],this.clickableElements.forEach(function(e){return function(n){return e.listeners.push({element:n,events:{click:function(r){return(n!==e.element||r.target===e.element||t.elementInside(r.target,e.element.querySelector(".dz-message")))&&e.hiddenFileInput.click(),!0}}})}}(this)),this.enable(),this.options.init.call(this)},t.prototype.destroy=function(){var e;return this.disable(),this.removeAllFiles(!0),(null!=(e=this.hiddenFileInput)?e.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,t.instances.splice(t.instances.indexOf(this),1)},t.prototype.updateTotal
},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i<r;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(s(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(i){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>"},i.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},o.parse=function(e,t,n){var r=new o(t,n);return r.parse(e)},o.prototype.parse=function(e){this.inline=new r(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i,o="",a="";for(n="",e=0;e<this.token.header.length;e++)r={header:!0,align:this.token.align[e]},n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(o+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",i=0;i<t.length;i++)n+=this.renderer.tablecell(this.inline.output(t[i]),{header:!1,align:this.token.align[i]});a+=this.renderer.tablerow(n)}return this.renderer.table(o,a);case"blockquote_start":for(var a="";"blockquote_end"!==this.next().type;)a+=this.tok();return this.renderer.blockquote(a);case"list_start":for(var a="",s=this.token.ordered;"list_end"!==this.next().type;)a+=this.tok();return this.renderer.list(a,s);case"list_item_start":for(var a="";"list_item_end"!==this.next().type;)a+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(a);case"loose_item_start":for(var a="";"list_item_end"!==this.next().type;)a+=this.tok();return this.renderer.listitem(a);case"html":var u=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(u);case"paragraph":return this.renderer.paragraph(this.inline.o
i=Vt(n,r),Wt(this,i,e),this}}function Wt(e,t,r,i){var o=t._milliseconds,a=St(t._days),s=St(t._months);e.isValid()&&(i=null==i||i,o&&e._d.setTime(e._d.valueOf()+o*r),a&&H(e,"Date",z(e,"Date")+a*r),s&&ce(e,z(e,"Month")+s*r),i&&n.updateOffset(e,a||s))}function Bt(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function Gt(e,t){var r=e||$t(),i=Dt(r,this).startOf("day"),o=n.calendarFormat(this,i)||"sameElse",a=t&&(_(t[o])?t[o].call(this,r):t[o]);return this.format(a||this.localeData().calendar(o,this,$t(r)))}function Zt(){return new y(this)}function Qt(e,t){var n=$(e)?e:$t(e);return!(!this.isValid()||!n.isValid())&&(t=L(g(t)?"millisecond":t),"millisecond"===t?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function Jt(e,t){var n=$(e)?e:$t(e);return!(!this.isValid()||!n.isValid())&&(t=L(g(t)?"millisecond":t),"millisecond"===t?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function Xt(e,t,n,r){return r=r||"()",("("===r[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===r[1]?this.isBefore(t,n):!this.isAfter(t,n))}function Kt(e,t){var n,r=$(e)?e:$t(e);return!(!this.isValid()||!r.isValid())&&(t=L(t||"millisecond"),"millisecond"===t?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function en(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function tn(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function nn(e,t,n){var r,i,o,a;return this.isValid()?(r=Dt(e,this),r.isValid()?(i=6e4*(r.utcOffset()-this.utcOffset()),t=L(t),"year"===t||"month"===t||"quarter"===t?(a=rn(this,r),"quarter"===t?a/=3:"year"===t&&(a/=12)):(o=this-r,a="second"===t?o/1e3:"minute"===t?o/6e4:"hour"===t?o/36e5:"day"===t?(o-i)/864e5:"week"===t?(o-i)/6048e5:o),n?a:b(a)):NaN):NaN}function rn(e,t){var n,r,i=12*(t.year()-e.year())+(t.month()-e.month()),o=e.clone().add(i,"months");return t-o<0?(n=e.clone().add(i-1,"months"),r=(t-o)/(o-n)):(n=e.clone().add(i+1,"months"),r=(t-o)/(n-o)),-(i+r)||0}function on(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function an(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?_(Date.prototype.toISOString)?this.toDate().toISOString():Q(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):Q(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function sn(e){e||(e=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var t=Q(this,e);return this.localeData().postformat(t)}function un(e,t){return this.isValid()&&($(e)&&e.isValid()||$t(e).isValid())?Vt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ln(e){return this.from($t(),e)}function cn(e,t){return this.isValid()&&($(e)&&e.isValid()||$t(e).isValid())?Vt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function fn(e){return this.to($t(),e)}function dn(e){var t;return void 0===e?this._locale._abbr:(t=nt(e),null!=t&&(this._locale=t),this)}function hn(){return this._locale}function pn(e){switch(e=L(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function mn(e){return e=L(e),void 0===e||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function gn(){return this._d.valueOf()-6e4*(this._offset||0)}function vn(){return Math.floor(this.valueOf()/1e3)}function yn(){return new Date(this.valueOf())}function $n(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function bn(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function wn(){return this.isValid()?this.toISOString():null}function xn(){return p(this)
minimumVersion:V}),J.test(e.name)&&E(e,{version:U.version})),"copy"===e.type&&(e.clipboardData={setData:Ge.setData,clearData:Ge.clearData}),"aftercopy"===e.type&&(e=Ae(e,Y)),e.target&&!e.relatedTarget&&(e.relatedTarget=ge(e.target)),ve(e)}},ge=function(e){var t=e&&e.getAttribute&&e.getAttribute("data-clipboard-target");return t?s.getElementById(t):null},ve=function(e){if(e&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)){var t=e.target,r="_mouseover"===e.type&&e.relatedTarget?e.relatedTarget:n,i="_mouseout"===e.type&&e.relatedTarget?e.relatedTarget:n,o=Ue(t),u=a.screenLeft||a.screenX||0,l=a.screenTop||a.screenY||0,c=s.body.scrollLeft+s.documentElement.scrollLeft,f=s.body.scrollTop+s.documentElement.scrollTop,d=o.left+("number"==typeof e._stageX?e._stageX:0),h=o.top+("number"==typeof e._stageY?e._stageY:0),p=d-c,m=h-f,g=u+p,v=l+m,y="number"==typeof e.movementX?e.movementX:0,$="number"==typeof e.movementY?e.movementY:0;delete e._stageX,delete e._stageY,E(e,{srcElement:t,fromElement:r,toElement:i,screenX:g,screenY:v,pageX:d,pageY:h,clientX:p,clientY:m,x:p,y:m,movementX:y,movementY:$,offsetX:0,offsetY:0,layerX:0,layerY:0})}return e},ye=function(e){var t=e&&"string"==typeof e.type&&e.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(t)},$e=function(e,t,n,r){r?l(function(){e.apply(t,n)},0):e.apply(t,n)},be=function(e){if("object"==typeof e&&e&&e.type){var t=ye(e),n=z["*"]||[],r=z[e.type]||[],i=n.concat(r);if(i&&i.length){var o,s,u,l,c,f=this;for(o=0,s=i.length;o<s;o++)u=i[o],l=f,"string"==typeof u&&"function"==typeof a[u]&&(u=a[u]),"object"==typeof u&&u&&"function"==typeof u.handleEvent&&(l=u,u=u.handleEvent),"function"==typeof u&&(c=E({},e),$e(u,l,[c],t))}return this}},we=function(e){var t=null;return(R===!1||e&&"error"===e.type&&e.name&&G.indexOf(e.name)!==-1)&&(t=!1),t},xe=function(e){var t=e.target||i||null,n="swf"===e._source;switch(delete e._source,e.type){case"error":var a="flash-sandboxed"===e.name||we(e);"boolean"==typeof a&&(U.sandboxed=a),Z.indexOf(e.name)!==-1?E(U,{disabled:"flash-disabled"===e.name,outdated:"flash-outdated"===e.name,unavailable:"flash-unavailable"===e.name,degraded:"flash-degraded"===e.name,deactivated:"flash-deactivated"===e.name,overdue:"flash-overdue"===e.name,ready:!1}):"version-mismatch"===e.name&&(r=e.swfVersion,E(U,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),ze();break;case"ready":r=e.swfVersion;var s=U.deactivated===!0;E(U,{disabled:!1,outdated:!1,sandboxed:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:s,ready:!s}),ze();break;case"beforecopy":o=t;break;case"copy":var u,l,c=e.relatedTarget;!H["text/html"]&&!H["text/plain"]&&c&&(l=c.value||c.outerHTML||c.innerHTML)&&(u=c.value||c.textContent||c.innerText)?(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",u),l!==u&&e.clipboardData.setData("text/html",l)):!H["text/plain"]&&e.target&&(u=e.target.getAttribute("data-clipboard-text"))&&(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",u));break;case"aftercopy":ke(e),Ge.clearData(),t&&t!==Pe()&&t.focus&&t.focus();break;case"_mouseover":Ge.focus(t),X.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!O(e.relatedTarget,t)&&Ce(E({},e,{type:"mouseenter",bubbles:!1,cancelable:!1})),Ce(E({},e,{type:"mouseover"})));break;case"_mouseout":Ge.blur(),X.bubbleEvents===!0&&n&&(t&&t!==e.relatedTarget&&!O(e.relatedTarget,t)&&Ce(E({},e,{type:"mouseleave",bubbles:!1,cancelable:!1})),Ce(E({},e,{type:"mouseout"})));break;case"_mousedown":Le(t,X.activeClass),X.bubbleEvents===!0&&n&&Ce(E({},e,{type:e.type.slice(1)}));break;case"_mouseup":je(t,X.activeClass),X.bubbleEvents===!0&&n&&Ce(E({},e,{type:e.type.slice(1)}));break;case"_click":o=null,X.bubbleEvents===!0&&n&&Ce(E({},e,{type:e.type.slice(1)}));break;case"_mousemove":X.bubbleEvents===!0&&n&&Ce(E({},e,{type:e.type.slice(1)}))}if(/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type))return!0},ke=function(e){if(e.errors&&e.errors.length>0){var t=D(e);E(t,{type:"error",name:"clipboard-error"}),delete t.success,l(function(){Ge.emit(t)},0)}},Ce=function(e){if(e&&"string
o(t,t.url)});var i=n.resizeCrop?"true":"false",a="/images/thumb/"+t.id+"/"+n.resizeWidth+"/"+n.resizeHeight+"/"+i;a=window.baseUrl(a),e.get(a).then(function(e){o(t,e.data.url)})}}}}]),e.directive("dropZone",[function(){return{restrict:"E",template:'\n <div class="dropzone-container">\n <div class="dz-message">Drop files or click here to upload</div>\n </div>\n ',scope:{uploadUrl:"@",eventSuccess:"=",eventError:"=",uploadedTo:"@"},link:function(e,t,n){n.placeholder&&(t[0].querySelector(".dz-message").textContent=n.placeholder);new r(t[0].querySelector(".dropzone-container"),{url:e.uploadUrl,init:function(){var t=this;t.on("sending",function(t,n,r){var i=window.document.querySelector("meta[name=token]").getAttribute("content");r.append("_token",i);var o="undefined"==typeof e.uploadedTo?0:e.uploadedTo;r.append("uploaded_to",o)}),"undefined"!=typeof e.eventSuccess&&t.on("success",e.eventSuccess),t.on("success",function(e,n){$(e.previewElement).fadeOut(400,function(){t.removeFile(e)})}),"undefined"!=typeof e.eventError&&t.on("error",e.eventError),t.on("error",function(e,t,n){function r(t){$(e.previewElement).find("[data-dz-errormessage]").text(t)}413===n.status&&r("The server does not allow uploads of this size. Please try a smaller file."),t.file&&r(t.file[0])})}})}}}]),e.directive("dropdown",[function(){return{restrict:"A",link:function(e,t,n){var r=t.find("ul");t.find("[dropdown-toggle]").on("click",function(){r.show().addClass("anim menuIn");var e=r.find("input"),n=e.length>0;n&&(e.first().focus(),t.on("keypress","input",function(e){if(13===e.keyCode)return e.preventDefault(),r.hide(),r.removeClass("anim menuIn"),!1})),t.mouseleave(function(){r.hide(),r.removeClass("anim menuIn")})})}}}]),e.directive("tinymce",["$timeout",function(e){return{restrict:"A",scope:{tinymce:"=",mceModel:"=",mceChange:"="},link:function(t,n,r){function i(n){n.on("ExecCommand change NodeChange ObjectResized",function(r){var i=n.getContent();e(function(){t.mceModel=i}),t.mceChange(i)}),n.on("keydown",function(e){t.$emit("editor-keydown",e)}),n.on("init",function(e){t.mceModel=n.getContent()}),t.$on("html-update",function(e,r){n.setContent(r),n.selection.select(n.getBody(),!0),n.selection.collapse(!1),t.mceModel=n.getContent()})}t.tinymce.extraSetups.push(i),tinymce.PluginManager.add("customhr",function(e){e.addCommand("InsertHorizontalRule",function(){var t=document.createElement("hr"),n=e.selection.getNode(),r=n.parentNode;r.insertBefore(t,n)}),e.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}),tinymce.init(t.tinymce)}}}]),e.directive("markdownInput",["$timeout",function(e){return{restrict:"A",scope:{mdModel:"=",mdChange:"="},link:function(t,n,r){n=n.find("textarea").first();var o=n.val();t.mdModel=o,t.mdChange(i(o)),n.on("change input",function(r){o=n.val(),e(function(){t.mdModel=o,t.mdChange(i(o))})}),t.$on("markdown-update",function(e,r){n.val(r),t.mdModel=r,t.mdChange(i(r))})}}}]),e.directive("markdownEditor",["$timeout",function(e){return{restrict:"A",link:function(e,t,n){function r(){h=u[0].scrollHeight,p=u.height(),m=l[0].scrollHeight,g=l.height()}function i(){window.showEntityLinkSelector(function(e){var t=d,n=u[0].selectionEnd,r=n!==t,i=u.val();if(r){var o=i.substring(t,n),a="["+o+"]("+e.link+")";u.val(i.substring(0,t)+a+i.substring(n))}else{var s=" ["+e.name+"]("+e.link+") ";u.val(i.substring(0,t)+s+i.substring(t))}u.change()})}function o(e){if(e=e.originalEvent,e.clipboardData){var t=e.clipboardData.items;if(t)for(var n=0;n<t.length;n++)s(t[n].getAsFile())}}function a(e){e.stopPropagation(),e.preventDefault();for(var t=e.originalEvent.dataTransfer.files,n=0;n<t.length;n++)s(t[n])}function s(e){if(0===e.type.indexOf("image")){var t=new FormData,n="png",r=new XMLHttpRequest;if(e.name){var i=e.name.match(/\.(.+)$/);i&&(n=i[1])}var o="image-"+Math.random().toString(16).slice(2),a=u[0].selectionStart,s=u[0].selectionEnd,l=u[0].value,c=l.substring(a,s),f=window.b