bookstack/public/js/common.js

12 lines
354 KiB
JavaScript
Raw Normal View History

2016-08-14 19:40:55 +08:00
!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===j)return e;break;default:return ne(u(e))}if(e.nodeType===j)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==j)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+L]),a&&(s[r].length&&(s[r]+=" "),s[r]+=n)}),s}function $(e){return e instanceof ne?e[0]:e}function y(e,t,n){var r="";t&&(r=o(t,U,!0)),n.addClass&&(r=C(r,o(n.addClass,L))),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 A(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 M(){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!==$);)o=i.nextSibling,1==i.nodeType&&n.end(i.nodeName.toLowerCase());i=o}for(;i=$.firstChild;)$.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(y,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||A[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||A[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(A,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"),A=o({},w,S,_,C),T=n("background,cite,href,longdesc,src,xlink:href"),M=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,M);!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(
}),E=_;x["$injector"+g]={$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"===j(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||qe(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===Li)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 y(e)?e:{}}function lt(e,t,n,i){function o(e){try{e.apply(null,z(arguments,1))}finally{if($--,0===$)for(;y.length;)try{y.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 $=0,y=[];c.$$completeOutstandingRequest=o,c.$$incOutstandingRequestCount=function(){$++},c.notifyWhenNoOutstandingRequests=function(e){0===$?e():y.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&&Lr(e).on("popstate",s),Lr(e).on("hashchange",s),E=!0),_.push(t),t},c.$$applicationDestroyed=function(){Lr(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 $++,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
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(y,f);else O(f)&&f.then(y)}}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=Y(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&&!$(e)?e:s(e)}catch(t){r(oo.interr(o,t))}}if(!o.length||o.indexOf(e)===-1){var y;if(!c){var b=a(o);y=m(b),y.exp=o,y.expressions=[],y.$$watchDelegate=u}return y}p=!!p;for(var w,x,k,S=0,_=[],E=[],D=o.length,A=[],T=[];S<D;){if((w=o.indexOf(e,S))==-1||(x=o.indexOf(t,w+f))==-1){S!==D&&A.push(a(o.substring(S)));break}S!==w&&A.push(a(o.substring(S,w))),k=o.substring(w+f,x),_.push(k),E.push(n(k,g)),S=x+d,T.push(A.length),A.push("")}if(h&&A.length>1&&oo.throwNoconcat(o),!c||_.length){var M=function(e){for(var t=0,n=_.length;t<n;t++){if(p&&v(e[t]))return;A[T[t]]=e[t]}return A.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 M(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=M(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 jt(){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=$(l)&&!l,v=(g?r:n).defer(),y=v.promise;return u=$(u)?u:0,y.$$intervalId=h(function(){g?i.defer(c):e.$evalAsync(c),v.notify(m++),u>0&&m>=u&&(v.resolve(m),p(y.$$intervalId),delete a[y.$$intervalId]),g||e.$apply()},s),a[y.$$intervalId]=v,y}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 Lt(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 qt(e){return e.replace(/(#.+)|#$/,"$1")}function Yt(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=Lt(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 $(o=zt(e,r))?(a=o,s=$(o=zt(n,o))?t+(zt("/",o)||o):e+a):$(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",Yn),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=y(e)&&n in e;return t===!0?t=U:C(t)||(t=function(e,t){return!v(e)&&(null===e||null===t?e===t:!(y(t)||y(e)&&!g(e))&&(e=Fr(""+e),t=Fr(""+t),e.indexOf(t)!==-1))}),i=function(i){return o&&!y(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 qn(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 Yn(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)==Ao;r++);if(r==(o=e.length))t=[0],n=1;else{for(o--;e.charAt(o)==Ao;)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=Ao+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=$(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 yo=function(e,t){this.lexer=e,this.options=t};yo.Program="Program",yo.ExpressionStatement="ExpressionStatement",yo.AssignmentExpression="AssignmentExpression",yo.ConditionalExpression="ConditionalExpression",yo.LogicalExpression="LogicalExpression",yo.BinaryExpression="BinaryExpression",yo.UnaryExpression="UnaryExpression",yo.CallExpression="CallExpression",yo.MemberExpression="MemberExpression",yo.Identifier="Identifier",yo.Literal="Literal",yo.ArrayExpression="ArrayExpression",yo.Property="Property",yo.ObjectExpression="ObjectExpression",yo.ThisExpression="ThisExpression",yo.LocalsExpression="LocalsExpression",yo.NGValueParameter="NGValueParameter",yo.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:yo.Program,body:e}},expressionStatement:function(){return{type:yo.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:yo.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:yo.ConditionalExpression,test:n,alternate:e,consequent:t}):n},logicalOR:function(){for(var e=this.logicalAND();this.expect("||");)e={type:yo.LogicalExpression,operator:"||",left:e,right:this.logicalAND()};return e},logicalAND:function(){for(var e=this.equality();this.expect("&&");)e={type:yo.LogicalExpression,operator:"&&",left:e,right:this.equality()};return e},equality:function(){for(var e,t=this.relational();e=this.expect("==","!=","===","!==");)t={type:yo.BinaryExpression,operator:e.text,left:t,right:this.relational()};return t},relational:function(){for(var e,t=this.additive();e=this.expect("<",">","<=",">=");)t={type:yo.BinaryExpression,operator:e.text,left:t,right:this.additive()};return t},additive:function(){for(var e,t=this.multiplicative();e=this.expect("+","-");)t={type:yo.BinaryExpression,operator:e.text,left:t,right:this.multiplicative()};return t},multiplicative:function(){for(var e,t=this.unary();e=this.expect("*","/","%");)t={type:yo.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(y),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(y),(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&&$(i.debounce)&&(n=i.debounce,x(n)?r=n:x(n[t])?r=n[t]:x(n["default"])&&(r=n["default"])),s.cancel(y),r?y=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:Aa,priority:1,compile:function(t){return t.addClass(wa).addClass(ka).addClass(ya),{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))})}}}}}],Ma=/(\s+|^)default(\s+|$)/,Oa=function(){return{restrict:"A",controller:["$scope","$attrs",function(e,t){var n=this;this.$options=R(e.$eval(t.ngModelOptions)),$(this.$options.updateOn)?(this.$options.updateO
return i},t.prototype.getRejectedFiles=function(){var e,t,n,r,i;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.instan
return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},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.
}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=Et(e,this),r.isValid()?(i=6e4*(r.utcOffset()-this.utcOffset()),t=j(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()&&(y(e)&&e.isValid()||yt(e).isValid())?Ut({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ln(e){return this.from(yt(),e)}function cn(e,t){return this.isValid()&&(y(e)&&e.isValid()||yt(e).isValid())?Ut({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function fn(e){return this.to(yt(),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=j(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=j(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 $n(){return new Date(this.valueOf())}function yn(){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)}function kn(){return c({},h(this))}function Cn(){return h(this).overflow}function Sn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function _n(e,t){B(0,[e,e.length],0,t)}function En(e){return Mn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Dn(e){return Mn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function An(){return Ce(this.year(),1,4)}function Tn(){var e=this.localeData()._week;return Ce(this.year(),e.dow,e.doy)}function Mn(e,t,n,r,i){var o;return null==e?ke(this,r,i).year:(o=Ce(e,r,i),t>o&&(t=o),On.call(this,e,t,n,r,i))}function On(e,t,n,r,i){var o=xe(e,t,n,r,i),a=be(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Fn(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function In(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function Nn(e,t){t[oi]=w(1e3*("0."+e))}function Pn(){return this._isUTC?"UTC":""}function jn(){return this._isUTC?"Coordinated Universal Time":""}function Ln(e){return yt(1e3*e)}function Rn(){return yt.apply(null,arguments).parseZone()}function Un(e){return e}function Vn(e,t,n,r){var i=nt(),o=f().set(r,t);return i[n](o,e)}function zn(e,t,n){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return Vn(e,t,n,
u=u.handleEvent),"function"==typeof u&&(c=E({},e),ye(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":je(t,X.activeClass),X.bubbleEvents===!0&&n&&Ce(E({},e,{type:e.type.slice(1)}));break;case"_mouseup":Le(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"==typeof e.type&&e){var t,n=e.target||null,r=n&&n.ownerDocument||s,i={view:r.defaultView||a,canBubble:!0,cancelable:!0,detail:"click"===e.type?1:0,button:"number"==typeof e.which?e.which-1:"number"==typeof e.button?e.button:r.createEvent?0:1},o=E(i,e);n&&r.createEvent&&n.dispatchEvent&&(o=[o.type,o.canBubble,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget],t=r.createEvent("MouseEvents"),t.initMouseEvent&&(t.initMouseEvent.apply(t,o),t._source="js",n.dispatchEvent(t)))}},Se=function(){var e=X.flashLoadTimeout;if("number"==typeof e&&e>=0){var t=Math.min(1e3,e/10),n=X.swfObjectId+"_fallbackContent";W=f(function(){var e=s.getElementById(n);Ve(e)&&(ze(),U.deactivated=null,Ge.emit({type:"error",name:"swf-not-found"}))},t)}},_e=function(){var e=s.createElement("div");return e.id=X.containerId,e.className=X.containerClass,e.style.position="absolute",e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px",e.style.zIndex=""+Ye(X.zIndex),e},Ee=function(e){for(var t=e&&e.parentNode;t&&"OBJECT"===t.nodeName&&t.parentNode;)t=t.parentNode;return t||null},De=function(){var e,t=U.bridge,n=Ee(t);if(!t){var r=Ne(a.location.host,X),i="never"===r?"none":"all",o=Fe(E({jsVersion:Ge.version},X)),u=X.swfPath+Oe(X.swfPath,X);n=_e();var l=s.createElement("div");n.appendChild(l),s.body.appendChild(n);var c=s.createElement("div"),f="activex"===U.pluginType;c.innerHTML='<object id="'+X.swfObjectId+'" name="'+X.swfObjectId+'" width="100%" height="100%" '+(f?'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"':'type="app
n.on("input focus","[autosuggest]",function(e){var t=$(this),n=t.val(),r=t.attr("autosuggest"),i=t.attr("autosuggest-type");if("value"===i.toLowerCase()){var a=t.closest("tr").find('[autosuggest-type="name"]').first(),u=a.val();""!==u&&(r+="?name="+encodeURIComponent(u))}var l=s(n.slice(0,3),r);l.then(function(e){0===n.length?o(t,e.slice(0,6)):(e=e.filter(function(e){return e.toLowerCase().indexOf(n.toLowerCase())!==-1}).slice(0,4),o(t,e))})});var p=0;n.on("blur","[autosuggest]",function(e){var t=Date.now();setTimeout(function(){p<t&&(c.hide(),f=!1)},200)}),n.on("focus","[autosuggest]",function(e){p=Date.now()}),n.on("keydown","[autosuggest]",function(e){if(f){var t=l.childNodes,n=t.length;if(40===e.keyCode){var r=h===n-1?0:h+1;i(r,t)}else if(38===e.keyCode){var o=0===h?n-1:h-1;i(o,t)}else if((13===e.keyCode||9===e.keyCode)&&!e.shiftKey){var a=t[h].textContent;if(d[0].value=a,d.focus(),c.hide(),f=!1,13===e.keyCode)return e.preventDefault(),!1}}});var m=[]}}}]),e.directive("entitySelector",["$http","$sce",function(e,t){return{restrict:"A",scope:!0,link:function(n,r,i){function o(e){var t=e.attr("data-entity-type"),n=e.attr("data-entity-id"),i=!e.hasClass("selected");r.find(".selected").removeClass("selected").removeClass("primary-background"),i&&e.addClass("selected").addClass("primary-background");var o=i?t+":"+n:"";s.val(o)}function a(){var e=i.entityTypes?encodeURIComponent(i.entityTypes):encodeURIComponent("page,book,chapter");return window.baseUrl("/ajax/search/entities?types="+e)}n.loading=!0,n.entityResults=!1,n.search="";var s=r.find("[entity-selector-input]").first();r.on("click",".entity-list a",function(e){e.preventDefault(),e.stopPropagation();var t=$(this).closest("[data-entity-type]");o(t)}),r.on("click","[data-entity-type]",function(e){o($(this))}),e.get(a()).then(function(e){n.entityResults=t.trustAsHtml(e.data),n.loading=!1}),n.searchEntities=function(){n.loading=!0,s.val("");var r=a()+"&term="+encodeURIComponent(n.search);e.get(r).then(function(e){n.entityResults=t.trustAsHtml(e.data),n.loading=!1})}}}}])}},{"./components/drop-zone.html":14,"./components/image-picker.html":15,"./components/toggle-switch.html":16,dropzone:10,marked:11}],19:[function(e,t,n){"use strict";var r=e("angular");e("angular-resource"),e("angular-animate"),e("angular-sanitize");e("angular-ui-sortable"),window.baseUrl=function(e){var t=document.querySelector('meta[name="base-url"]').getAttribute("content");return"/"===t[t.length-1]&&(t=t.slice(0,t.length-1)),"/"===e[0]&&(e=e.slice(1)),t+"/"+e};var i=r.module("bookStack",["ngResource","ngAnimate","ngSanitize","ui.sortable"]),o={listeners:{},emit:function(e,t){if("undefined"==typeof this.listeners[e])return this;for(var n=this.listeners[e],r=0;r<n.length;r++){var i=n[r];i(t)}return this},listen:function(e,t){return"undefined"==typeof this.listeners[e]&&(this.listeners[e]=[]),this.listeners[e].push(t),this}};window.Events=o;e("./services")(i,o),e("./directives")(i,o),e("./controllers")(i,o);jQuery.fn.smoothScrollTo=function(){if(0!==this.length)return $("body").animate({scrollTop:this.offset().top-60},800),this},$.expr[":"].contains=$.expr.createPseudo(function(e){return function(t){return $(t).text().toUpperCase().indexOf(e.toUpperCase())>=0}}),$(function(){var e=$(".notification"),t=e.filter(".pos"),n=e.filter(".neg"),r=e.filter(".warning");window.Events.listen("success",function(e){t.hide(),t.find("span").text(e),setTimeout(function(){t.show()},1)}),window.Events.listen("warning",function(e){r.find("span").text(e),r.show()}),window.Events.listen("error",function(e){n.find("span").text(e),n.show()}),e.click(function(){$(this).fadeOut(100)}),$(".chapter-toggle").click(function(e){e.preventDefault(),$(this).toggleClass("open"),$(this).closest(".chapter").find(".inset-list").slideToggle(180)}),$("#back-to-top").click(function(){$("#header").smoothScrollTo()});var i=!1,o=document.getElementById("back-to-top"),a=1200;window.addEventListener("scroll",function(){!i&&document.body.scrollTop>a?(o.style.display="block",i=!0,setTimeout(function(){o.style.opacity=.4},1)):i&&document.body.scroll