1&&"string"==typeof d&&!g.checkClone&&De.test(d))return e.each((function(i){var o=e.eq(i);v&&(t[0]=d.call(this,i,o.html())),Ie(o,t,n,r)}));if(p&&(o=(i=Ee(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=(u=T.map(xe(i,"script"),Re)).length;f0&&_e(u,!s&&xe(e,"script")),a},cleanData:function(e){for(var t,n,r,i=T.event.special,o=0;void 0!==(n=e[o]);o++)if(J(n)){if(t=n[Z.expando]){if(t.events)for(r in t.events)i[r]?T.event.remove(n,r):T.removeEvent(n,r,t.handle);n[Z.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),T.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return U(this,(function(e){return void 0===e?T.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Ie(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)}))},prepend:function(){return Ie(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Ie(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Ie(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(T.cleanData(xe(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return T.clone(this,e,t)}))},html:function(e){return U(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Oe.test(e)&&!be[(ye.exec(e)||["",""])[1].toLowerCase()]){e=T.htmlPrefilter(e);try{for(;n=0&&(s+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-s-a-.5))||0),s}function nt(e,t,n){var r=Me(e),i=(!g.boxSizingReliable()||n)&&"border-box"===T.css(e,"boxSizing",!1,r),o=i,u=We(e,t,r),a="offset"+t[0].toUpperCase()+t.slice(1);if(ze.test(u)){if(!n)return u;u="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&O(e,"tr")||"auto"===u||!parseFloat(u)&&"inline"===T.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===T.css(e,"boxSizing",!1,r),(o=a in e)&&(u=e[a])),(u=parseFloat(u)||0)+tt(e,t,n||(i?"border":"content"),o,r,u)+"px"}function rt(e,t,n,r,i){return new rt.prototype.init(e,t,n,r,i)}T.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,u,a=K(t),s=Ye.test(t),c=e.style;if(s||(t=Ke(a)),u=T.cssHooks[t]||T.cssHooks[a],void 0===n)return u&&"get"in u&&void 0!==(i=u.get(e,!1,r))?i:c[t];"string"===(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=le(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||s||(n+=i&&i[3]||(T.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),u&&"set"in u&&void 0===(n=u.set(e,n,r))||(s?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,u,a=K(t);return Ye.test(t)||(t=Ke(a)),(u=T.cssHooks[t]||T.cssHooks[a])&&"get"in u&&(i=u.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),T.each(["height","width"],(function(e,t){T.cssHooks[t]={get:function(e,n,r){if(n)return!Je.test(T.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?nt(e,t,r):He(e,Ze,(function(){return nt(e,t,r)}))},set:function(e,n,r){var i,o=Me(e),u=!g.scrollboxSize()&&"absolute"===o.position,a=(u||r)&&"border-box"===T.css(e,"boxSizing",!1,o),s=r?tt(e,t,r,a,o):0;return a&&u&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-tt(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=T.css(e,t)),et(0,n,s)}}})),T.cssHooks.marginLeft=Ue(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-He(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),T.each({margin:"",padding:"",border:"Width"},(function(e,t){T.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(T.cssHooks[e+t].set=et)})),T.fn.extend({css:function(e,t){return U(this,(function(e,t,n){var r,i,o={},u=0;if(Array.isArray(t)){for(r=Me(e),i=t.length;u1)}}),T.Tween=rt,rt.prototype={constructor:rt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||T.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(T.cssNumber[n]?"":"px")},cur:function(){var e=rt.propHooks[this.prop];return e&&e.get?e.get(this):rt.propHooks._default.get(this)},run:function(e){var t,n=rt.propHooks[this.prop];return this.options.duration?this.pos=t=T.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rt.propHooks._default.set(this),this}},rt.prototype.init.prototype=rt.prototype,rt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=T.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){T.fx.step[e.prop]?T.fx.step[e.prop](e):1!==e.elem.nodeType||!T.cssHooks[e.prop]&&null==e.elem.style[Ke(e.prop)]?e.elem[e.prop]=e.now:T.style(e.elem,e.prop,e.now+e.unit)}}},rt.propHooks.scrollTop=rt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},T.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},T.fx=rt.prototype.init,T.fx.step={};var it,ot,ut=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){ot&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(st):r.setTimeout(st,T.fx.interval),T.fx.tick())}function ct(){return r.setTimeout((function(){it=void 0})),it=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ft(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,u=i.length;o1)},removeAttr:function(e){return this.each((function(){T.removeAttr(this,e)}))}}),T.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?T.prop(e,t,n):(1===o&&T.isXMLDoc(e)||(i=T.attrHooks[t.toLowerCase()]||(T.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void T.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=T.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&O(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(I);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?T.removeAttr(e,n):e.setAttribute(n,n),n}},T.each(T.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=dt[t]||T.find.attr;dt[t]=function(e,t,r){var i,o,u=t.toLowerCase();return r||(o=dt[u],dt[u]=i,i=null!=n(e,t,r)?u:null,dt[u]=o),i}}));var vt=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function yt(e){return(e.match(I)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(I)||[]}T.fn.extend({prop:function(e,t){return U(this,T.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[T.propFix[e]||e]}))}}),T.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&T.isXMLDoc(e)||(t=T.propFix[t]||t,i=T.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=T.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(T.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){T.propFix[this.toLowerCase()]=this})),T.fn.extend({addClass:function(e){var t,n,r,i,o,u,a,s=0;if(y(e))return this.each((function(t){T(this).addClass(e.call(this,t,mt(this)))}));if((t=bt(e)).length)for(;n=this[s++];)if(i=mt(n),r=1===n.nodeType&&" "+yt(i)+" "){for(u=0;o=t[u++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(a=yt(r))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,r,i,o,u,a,s=0;if(y(e))return this.each((function(t){T(this).removeClass(e.call(this,t,mt(this)))}));if(!arguments.length)return this.attr("class","");if((t=bt(e)).length)for(;n=this[s++];)if(i=mt(n),r=1===n.nodeType&&" "+yt(i)+" "){for(u=0;o=t[u++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(a=yt(r))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):y(e)?this.each((function(n){T(this).toggleClass(e.call(this,n,mt(this),t),t)})):this.each((function(){var t,i,o,u;if(r)for(i=0,o=T(this),u=bt(e);t=u[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=mt(this))&&Z.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Z.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+yt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var xt=/\r/g;T.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=y(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,T(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=T.map(i,(function(e){return null==e?"":e+""}))),(t=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=T.valHooks[i.type]||T.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(xt,""):null==n?"":n:void 0}}),T.extend({valHooks:{option:{get:function(e){var t=T.find.attr(e,"value");return null!=t?t:yt(T.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,u="select-one"===e.type,a=u?null:[],s=u?o+1:i.length;for(r=o<0?s:u?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),T.each(["radio","checkbox"],(function(){T.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=T.inArray(T(e).val(),t)>-1}},g.checkOn||(T.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),g.focusin="onfocusin"in r;var _t=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};T.extend(T.event,{trigger:function(e,t,n,i){var o,u,a,s,c,l,f,p,d=[n||b],v=h.call(e,"type")?e.type:e,g=h.call(e,"namespace")?e.namespace.split("."):[];if(u=p=a=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!_t.test(v+T.event.triggered)&&(v.indexOf(".")>-1&&(g=v.split("."),v=g.shift(),g.sort()),c=v.indexOf(":")<0&&"on"+v,(e=e[T.expando]?e:new T.Event(v,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:T.makeArray(t,[e]),f=T.event.special[v]||{},i||!f.trigger||!1!==f.trigger.apply(n,t))){if(!i&&!f.noBubble&&!m(n)){for(s=f.delegateType||v,_t.test(s+v)||(u=u.parentNode);u;u=u.parentNode)d.push(u),a=u;a===(n.ownerDocument||b)&&d.push(a.defaultView||a.parentWindow||r)}for(o=0;(u=d[o++])&&!e.isPropagationStopped();)p=u,e.type=o>1?s:f.bindType||v,(l=(Z.get(u,"events")||Object.create(null))[e.type]&&Z.get(u,"handle"))&&l.apply(u,t),(l=c&&u[c])&&l.apply&&J(u)&&(e.result=l.apply(u,t),!1===e.result&&e.preventDefault());return e.type=v,i||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(d.pop(),t)||!J(n)||c&&y(n[v])&&!m(n)&&((a=n[c])&&(n[c]=null),T.event.triggered=v,e.isPropagationStopped()&&p.addEventListener(v,wt),n[v](),e.isPropagationStopped()&&p.removeEventListener(v,wt),T.event.triggered=void 0,a&&(n[c]=a)),e.result}},simulate:function(e,t,n){var r=T.extend(new T.Event,n,{type:e,isSimulated:!0});T.event.trigger(r,null,t)}}),T.fn.extend({trigger:function(e,t){return this.each((function(){T.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return T.event.trigger(e,t,n,!0)}}),g.focusin||T.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){T.event.simulate(t,e.target,T.event.fix(e))};T.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=Z.access(r,t);i||r.addEventListener(e,n,!0),Z.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Z.access(r,t)-1;i?Z.access(r,t,i):(r.removeEventListener(e,n,!0),Z.remove(r,t))}}}));var Et=r.location,Tt={guid:Date.now()},Ct=/\?/;T.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||T.error("Invalid XML: "+(n?T.map(n.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var At=/\[\]$/,kt=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,jt=/^(?:input|select|textarea|keygen)/i;function Ot(e,t,n,r){var i;if(Array.isArray(t))T.each(t,(function(t,i){n||At.test(e)?r(e,i):Ot(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==w(t))r(e,t);else for(i in t)Ot(e+"["+i+"]",t[i],n,r)}T.param=function(e,t){var n,r=[],i=function(e,t){var n=y(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!T.isPlainObject(e))T.each(e,(function(){i(this.name,this.value)}));else for(n in e)Ot(n,e[n],t,i);return r.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=T.prop(this,"elements");return e?T.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!T(this).is(":disabled")&&jt.test(this.nodeName)&&!St.test(e)&&(this.checked||!ge.test(e))})).map((function(e,t){var n=T(this).val();return null==n?null:Array.isArray(n)?T.map(n,(function(e){return{name:t.name,value:e.replace(kt,"\r\n")}})):{name:t.name,value:n.replace(kt,"\r\n")}})).get()}});var Dt=/%20/g,Nt=/#.*$/,Lt=/([?&])_=[^&]*/,Rt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:GET|HEAD)$/,qt=/^\/\//,$t={},It={},Bt="*/".concat("*"),zt=b.createElement("a");function Mt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(I)||[];if(y(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ht(e,t,n,r){var i={},o=e===It;function u(a){var s;return i[a]=!0,T.each(e[a]||[],(function(e,a){var c=a(t,n,r);return"string"!=typeof c||o||i[c]?o?!(s=c):void 0:(t.dataTypes.unshift(c),u(c),!1)})),s}return u(t.dataTypes[0])||!i["*"]&&u("*")}function Ft(e,t){var n,r,i=T.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&T.extend(!0,e,r),e}zt.href=Et.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Bt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,T.ajaxSettings),t):Ft(T.ajaxSettings,e)},ajaxPrefilter:Mt($t),ajaxTransport:Mt(It),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,o,u,a,s,c,l,f,p,h=T.ajaxSetup({},t),d=h.context||h,v=h.context&&(d.nodeType||d.jquery)?T(d):T.event,g=T.Deferred(),y=T.Callbacks("once memory"),m=h.statusCode||{},x={},_={},w="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!u)for(u={};t=Rt.exec(o);)u[t[1].toLowerCase()+" "]=(u[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=u[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=_[e.toLowerCase()]=_[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)m[t]=[m[t],e[t]];return this},abort:function(e){var t=e||w;return n&&n.abort(t),C(0,t),this}};if(g.promise(E),h.url=((e||h.url||Et.href)+"").replace(qt,Et.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(I)||[""],null==h.crossDomain){s=b.createElement("a");try{s.href=h.url,s.href=s.href,h.crossDomain=zt.protocol+"//"+zt.host!=s.protocol+"//"+s.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=T.param(h.data,h.traditional)),Ht($t,h,t,E),c)return E;for(f in(l=T.event&&h.global)&&0==T.active++&&T.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Pt.test(h.type),i=h.url.replace(Nt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Dt,"+")):(p=h.url.slice(i.length),h.data&&(h.processData||"string"==typeof h.data)&&(i+=(Ct.test(i)?"&":"?")+h.data,delete h.data),!1===h.cache&&(i=i.replace(Lt,"$1"),p=(Ct.test(i)?"&":"?")+"_="+Tt.guid+++p),h.url=i+p),h.ifModified&&(T.lastModified[i]&&E.setRequestHeader("If-Modified-Since",T.lastModified[i]),T.etag[i]&&E.setRequestHeader("If-None-Match",T.etag[i])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Bt+"; q=0.01":""):h.accepts["*"]),h.headers)E.setRequestHeader(f,h.headers[f]);if(h.beforeSend&&(!1===h.beforeSend.call(d,E,h)||c))return E.abort();if(w="abort",y.add(h.complete),E.done(h.success),E.fail(h.error),n=Ht(It,h,t,E)){if(E.readyState=1,l&&v.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(a=r.setTimeout((function(){E.abort("timeout")}),h.timeout));try{c=!1,n.send(x,C)}catch(e){if(c)throw e;C(-1,e)}}else C(-1,"No Transport");function C(e,t,u,s){var f,p,b,x,_,w=t;c||(c=!0,a&&r.clearTimeout(a),n=void 0,o=s||"",E.readyState=e>0?4:0,f=e>=200&&e<300||304===e,u&&(x=function(e,t,n){for(var r,i,o,u,a=e.contents,s=e.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){s.unshift(i);break}if(s[0]in n)o=s[0];else{for(i in n){if(!s[0]||e.converters[i+" "+s[0]]){o=i;break}u||(u=i)}o=o||u}if(o)return o!==s[0]&&s.unshift(o),n[o]}(h,E,u)),!f&&T.inArray("script",h.dataTypes)>-1&&T.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,u,a,s,c={},l=e.dataTypes.slice();if(l[1])for(u in e.converters)c[u.toLowerCase()]=e.converters[u];for(o=l.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!s&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s=o,o=l.shift())if("*"===o)o=s;else if("*"!==s&&s!==o){if(!(u=c[s+" "+o]||c["* "+o]))for(i in c)if((a=i.split(" "))[1]===o&&(u=c[s+" "+a[0]]||c["* "+a[0]])){!0===u?u=c[i]:!0!==c[i]&&(o=a[0],l.unshift(a[1]));break}if(!0!==u)if(u&&e.throws)t=u(t);else try{t=u(t)}catch(e){return{state:"parsererror",error:u?e:"No conversion from "+s+" to "+o}}}return{state:"success",data:t}}(h,x,E,f),f?(h.ifModified&&((_=E.getResponseHeader("Last-Modified"))&&(T.lastModified[i]=_),(_=E.getResponseHeader("etag"))&&(T.etag[i]=_)),204===e||"HEAD"===h.type?w="nocontent":304===e?w="notmodified":(w=x.state,p=x.data,f=!(b=x.error))):(b=w,!e&&w||(w="error",e<0&&(e=0))),E.status=e,E.statusText=(t||w)+"",f?g.resolveWith(d,[p,w,E]):g.rejectWith(d,[E,w,b]),E.statusCode(m),m=void 0,l&&v.trigger(f?"ajaxSuccess":"ajaxError",[E,h,f?p:b]),y.fireWith(d,[E,w]),l&&(v.trigger("ajaxComplete",[E,h]),--T.active||T.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return T.get(e,t,n,"json")},getScript:function(e,t){return T.get(e,void 0,t,"script")}}),T.each(["get","post"],(function(e,t){T[t]=function(e,n,r,i){return y(n)&&(i=i||r,r=n,n=void 0),T.ajax(T.extend({url:e,type:t,dataType:i,data:n,success:r},T.isPlainObject(e)&&e))}})),T.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),T._evalUrl=function(e,t,n){return T.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){T.globalEval(e,t,n)}})},T.fn.extend({wrapAll:function(e){var t;return this[0]&&(y(e)&&(e=e.call(this[0])),t=T(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return y(e)?this.each((function(t){T(this).wrapInner(e.call(this,t))})):this.each((function(){var t=T(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=y(e);return this.each((function(n){T(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){T(this).replaceWith(this.childNodes)})),this}}),T.expr.pseudos.hidden=function(e){return!T.expr.pseudos.visible(e)},T.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},Ut=T.ajaxSettings.xhr();g.cors=!!Ut&&"withCredentials"in Ut,g.ajax=Ut=!!Ut,T.ajaxTransport((function(e){var t,n;if(g.cors||Ut&&!e.crossDomain)return{send:function(i,o){var u,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(u in e.xhrFields)a[u]=e.xhrFields[u];for(u in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(u,i[u]);t=function(e){return function(){t&&(t=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Wt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=t(),n=a.onerror=a.ontimeout=t("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),T.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return T.globalEval(e),e}}}),T.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),T.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=T("
+
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
new file mode 100644
index 0000000..5f590a9
--- /dev/null
+++ b/resources/views/layouts/app.blade.php
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+ {{ config('app.name', 'Laravel') }}
+
+
+
+
+
+
+
+
+
+ @livewireStyles
+
+
+
+ @include('layouts.navigation')
+
+
+
+
+
+
+ {{ $slot }}
+
+ @livewireScripts
+
diff --git a/resources/views/layouts/guest.blade.php b/resources/views/layouts/guest.blade.php
new file mode 100644
index 0000000..b94f3af
--- /dev/null
+++ b/resources/views/layouts/guest.blade.php
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+ {{ config('app.name', 'Laravel') }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $slot }}
+
+
+
diff --git a/resources/views/layouts/navigation.blade.php b/resources/views/layouts/navigation.blade.php
new file mode 100644
index 0000000..3684e45
--- /dev/null
+++ b/resources/views/layouts/navigation.blade.php
@@ -0,0 +1,95 @@
+
diff --git a/resources/views/livewire/actual.blade.php b/resources/views/livewire/actual.blade.php
new file mode 100644
index 0000000..cf57c20
--- /dev/null
+++ b/resources/views/livewire/actual.blade.php
@@ -0,0 +1,316 @@
+
+ @if(\Auth::user()->hasPosts($year))
+
+
+
+
+
+
+
+
+
+
+
+ ValuesDifference
+
+
+
+
+
+ | |
+ Jan |
+ Feb |
+ Mar |
+ Apr |
+ May |
+ Jun |
+ Jul |
+ Aug |
+ Sep |
+ Okt |
+ Nov |
+ Dec |
+ Avg |
+ Total |
+
+ @foreach($categories as $category)
+
+ | {{$category->name}} |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+ @foreach($category->posts->where("year", $year) as $post)
+
+ | {{$post->name}} |
+
+
+ {!! $hf->number($post->monthActualValue(1, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(2, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(3, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(4, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(5, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(6, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(7, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(8, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(9, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(10, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(11, ($switchMode == "difference"))) !!}
+
+ |
+
+
+ {!! $hf->number($post->monthActualValue(12, ($switchMode == "difference"))) !!}
+
+ |
+ {!! $hf->number($post->avgActualValue($activeMonthCount, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($post->totalActualValue(($switchMode == "difference"))) !!} |
+
+ @endforeach
+
+
+ | |
+ {!! $hf->number($category->monthActualValue($year, 1, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 2, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 3, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 4, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 5, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 6, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 7, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 8, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 9, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 10, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 11, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->monthActualValue($year, 12, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->avgActualValue($year, $activeMonthCount, ($switchMode == "difference"))) !!} |
+ {!! $hf->number($category->totalActualValue($year, ($switchMode == "difference"))) !!} |
+
+ @endforeach
+
+
+ | |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+ | Total |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 1, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 2, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 3, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 4, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 5, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 6, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 7, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 8, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 9, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 10, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 11, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 12, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->avgActualValue($categories, $year, $activeMonthCount, ($switchMode == "difference"))) !!} |
+ {!! $hf->number(\Auth::user()->totalActualValue($categories, $year, ($switchMode == "difference"))) !!} |
+
+
+
+
+
+ @else
+
+
+ No posts created ...
+
+
+ @endif
+
+
+
+
+
+
+
+
+
+
+
+ {{$columnName}}
+
+
+
+ Clear all values for month?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{$fieldName}} for ({{$fieldMonthName}})
+
+
+
+ Added values ({!!$fieldTypeHTML!!})
+
+
+ {!! $fieldHistoryHTML !!}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{$fieldName}} for ({{$fieldMonthName}})
+
+
+
+ Delete value {!!$deleteValueHTML!!}?
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/livewire/categories.blade.php b/resources/views/livewire/categories.blade.php
new file mode 100644
index 0000000..3eea959
--- /dev/null
+++ b/resources/views/livewire/categories.blade.php
@@ -0,0 +1,51 @@
+
+
+
+
+
+ @foreach($categories as $category)
+ -
+
+ [
+ ↑
+ ↓
+ X
+ ]
+
+ {{$category->name}}
+
+
+ @endforeach
+
+
+
+
+
+
+
+
+
+
+
+
+ Delete category?
+
+
+
+ All posts and data related will also be removed.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/livewire/projected.blade.php b/resources/views/livewire/projected.blade.php
new file mode 100644
index 0000000..49c412b
--- /dev/null
+++ b/resources/views/livewire/projected.blade.php
@@ -0,0 +1,326 @@
+
+
+
+
+
+
+
+
+
+
+
+ @if(\Auth::user()->hasPosts($year))
+
+
+
+ | |
+ Jan |
+ Feb |
+ Mar |
+ Apr |
+ May |
+ Jun |
+ Jul |
+ Aug |
+ Sep |
+ Okt |
+ Nov |
+ Dec |
+ Avg |
+ Total |
+
+ @foreach($categories as $category)
+
+ | {{$category->name}} |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+ @foreach($category->posts as $post)
+
+ |
+ {{$post->name}}
+ |
+
+ {!! $hf->number($post->monthValue(1)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(2)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(3)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(4)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(5)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(6)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(7)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(8)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(9)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(10)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(11)) !!}
+ |
+
+ {!! $hf->number($post->monthValue(12)) !!}
+ |
+
+ {!! $hf->number($post->avgValue($activeMonthCount)) !!}
+ |
+
+ {!! $hf->number($post->totalValue()) !!} |
+
+
+ @endforeach
+
+
+ | |
+ {!! $hf->number($category->monthValue($year, 1)) !!} |
+ {!! $hf->number($category->monthValue($year, 2)) !!} |
+ {!! $hf->number($category->monthValue($year, 3)) !!} |
+ {!! $hf->number($category->monthValue($year, 4)) !!} |
+ {!! $hf->number($category->monthValue($year, 5)) !!} |
+ {!! $hf->number($category->monthValue($year, 6)) !!} |
+ {!! $hf->number($category->monthValue($year, 7)) !!} |
+ {!! $hf->number($category->monthValue($year, 8)) !!} |
+ {!! $hf->number($category->monthValue($year, 9)) !!} |
+ {!! $hf->number($category->monthValue($year, 10)) !!} |
+ {!! $hf->number($category->monthValue($year, 11)) !!} |
+ {!! $hf->number($category->monthValue($year, 12)) !!} |
+ {!! $hf->number($category->avgValue($year, $activeMonthCount)) !!} |
+ {!! $hf->number($category->totalValue($year)) !!} |
+
+ @endforeach
+
+
+ | |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+ | Total |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 1)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 2)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 3)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 4)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 5)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 6)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 7)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 8)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 9)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 10)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 11)) !!} |
+ {!! $hf->number(\Auth::user()->monthValue($categories, $year, 12)) !!} |
+ {!! $hf->number(\Auth::user()->avgValue($categories, $year, $activeMonthCount)) !!} |
+ {!! $hf->number(\Auth::user()->totalValue($categories, $year)) !!} |
+
+
+
+ @elseif(count($yearList) > 0)
+
+
+ or copy from:
+
+
+
+
+
+
+
+
+
+ @endif
+
+
+
+
+
+
+
+
+
+
+
+ {{$fieldName}} for ({{$fieldMonthName}})
+
+
+
+ Set value ({!!$fieldTypeHTML!!})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{$rowName}}
+
+
+
+ Set value for all months ({!!$rowTypeHTML!!})
+
+
+
+
+
+
+
+
+
+ or delete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{$columnName}}
+
+
+
+ Clear all values for month?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Delete {{$deleteName}}?
+
+
+
+ All data related will also be removed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php
new file mode 100644
index 0000000..5a6b15b
--- /dev/null
+++ b/resources/views/welcome.blade.php
@@ -0,0 +1,32 @@
+
+
+
+ Budget
+
+
+
+
+
+
+
+
+
+
Budget App
+
+ A budget app. For budgets. And budgeting.
+ - Lasse Hassing <hello@hassing.org>
+
+
+
+
+
+
+
+
+
diff --git a/routes/api.php b/routes/api.php
new file mode 100644
index 0000000..bcb8b18
--- /dev/null
+++ b/routes/api.php
@@ -0,0 +1,19 @@
+get('/user', function (Request $request) {
+ return $request->user();
+});
diff --git a/routes/auth.php b/routes/auth.php
new file mode 100644
index 0000000..bb7357e
--- /dev/null
+++ b/routes/auth.php
@@ -0,0 +1,64 @@
+middleware('guest')
+ ->name('register');
+
+Route::post('/register', [RegisteredUserController::class, 'store'])
+ ->middleware('guest');
+
+Route::get('/login', [AuthenticatedSessionController::class, 'create'])
+ ->middleware('guest')
+ ->name('login');
+
+Route::post('/login', [AuthenticatedSessionController::class, 'store'])
+ ->middleware('guest');
+
+/*Route::get('/forgot-password', [PasswordResetLinkController::class, 'create'])
+ ->middleware('guest')
+ ->name('password.request');
+
+Route::post('/forgot-password', [PasswordResetLinkController::class, 'store'])
+ ->middleware('guest')
+ ->name('password.email');
+
+Route::get('/reset-password/{token}', [NewPasswordController::class, 'create'])
+ ->middleware('guest')
+ ->name('password.reset');
+
+Route::post('/reset-password', [NewPasswordController::class, 'store'])
+ ->middleware('guest')
+ ->name('password.update');*/
+
+Route::get('/verify-email', [EmailVerificationPromptController::class, '__invoke'])
+ ->middleware('auth')
+ ->name('verification.notice');
+
+Route::get('/verify-email/{id}/{hash}', [VerifyEmailController::class, '__invoke'])
+ ->middleware(['auth', 'signed', 'throttle:6,1'])
+ ->name('verification.verify');
+
+Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store'])
+ ->middleware(['auth', 'throttle:6,1'])
+ ->name('verification.send');
+
+Route::get('/confirm-password', [ConfirmablePasswordController::class, 'show'])
+ ->middleware('auth')
+ ->name('password.confirm');
+
+Route::post('/confirm-password', [ConfirmablePasswordController::class, 'store'])
+ ->middleware('auth');
+
+Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])
+ ->middleware('auth')
+ ->name('logout');
diff --git a/routes/channels.php b/routes/channels.php
new file mode 100644
index 0000000..5d451e1
--- /dev/null
+++ b/routes/channels.php
@@ -0,0 +1,18 @@
+id === (int) $id;
+});
diff --git a/routes/console.php b/routes/console.php
new file mode 100644
index 0000000..e05f4c9
--- /dev/null
+++ b/routes/console.php
@@ -0,0 +1,19 @@
+comment(Inspiring::quote());
+})->purpose('Display an inspiring quote');
diff --git a/routes/web.php b/routes/web.php
new file mode 100644
index 0000000..ef673a8
--- /dev/null
+++ b/routes/web.php
@@ -0,0 +1,52 @@
+id)->orderBy("priority")->get();
+
+ return view('dashboard', ["year" => $year, "categories" => $categories]);
+}
+
+
+Route::get('/', function () {
+ if(\Auth::user() != null) {
+ return redirect("/dashboard");
+ }
+
+ return view('welcome');
+});
+
+Route::get('/dashboard', function () {
+ $year = intval((new \Datetime())->format("Y"));
+ return dashboard($year);
+})->middleware(['auth'])->name('dashboard');
+
+Route::get('/year/{year}', function ($year) {
+ $year = intval($year);
+ if($year < 2000 || $year > 2200) {
+ $year = intval((new \Datetime())->format("Y"));
+ }
+ if($year == intval((new \Datetime())->format("Y"))) {
+ return redirect("/dashboard");
+ }
+
+ return dashboard($year);
+})->middleware(['auth'])->name('year');
+
+Route::get('/categories', function () {
+ return view('categories');
+})->middleware(['auth'])->name('categories');
+
+require __DIR__.'/auth.php';
diff --git a/server.php b/server.php
new file mode 100644
index 0000000..5fb6379
--- /dev/null
+++ b/server.php
@@ -0,0 +1,21 @@
+
+ */
+
+$uri = urldecode(
+ parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
+);
+
+// This file allows us to emulate Apache's "mod_rewrite" functionality from the
+// built-in PHP web server. This provides a convenient way to test a Laravel
+// application without having installed a "real" web server software here.
+if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
+ return false;
+}
+
+require_once __DIR__.'/public/index.php';
diff --git a/storage/app/.gitignore b/storage/app/.gitignore
new file mode 100644
index 0000000..8f4803c
--- /dev/null
+++ b/storage/app/.gitignore
@@ -0,0 +1,3 @@
+*
+!public/
+!.gitignore
diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/storage/app/public/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore
new file mode 100644
index 0000000..05c4471
--- /dev/null
+++ b/storage/framework/.gitignore
@@ -0,0 +1,9 @@
+compiled.php
+config.php
+down
+events.scanned.php
+maintenance.php
+routes.php
+routes.scanned.php
+schedule-*
+services.json
diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore
new file mode 100644
index 0000000..01e4a6c
--- /dev/null
+++ b/storage/framework/cache/.gitignore
@@ -0,0 +1,3 @@
+*
+!data/
+!.gitignore
diff --git a/storage/framework/cache/data/.gitignore b/storage/framework/cache/data/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/storage/framework/cache/data/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/storage/framework/sessions/.gitignore b/storage/framework/sessions/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/storage/framework/sessions/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/storage/framework/testing/.gitignore b/storage/framework/testing/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/storage/framework/testing/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/storage/framework/views/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/storage/logs/.gitignore b/storage/logs/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/storage/logs/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/tailwind.config.js b/tailwind.config.js
new file mode 100644
index 0000000..f1ed564
--- /dev/null
+++ b/tailwind.config.js
@@ -0,0 +1,29 @@
+const { repeat } = require('lodash');
+const defaultTheme = require('tailwindcss/defaultTheme');
+
+module.exports = {
+ purge: [
+ './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
+ './storage/framework/views/*.php',
+ './resources/views/**/*.blade.php',
+ ],
+
+ theme: {
+ extend: {
+ fontFamily: {
+ sans: ['Nunito', ...defaultTheme.fontFamily.sans],
+ },
+ gridTemplateColumns: {
+ '15': 'repeat(15, minmax(0, 1fr))'
+ }
+ },
+ },
+
+ variants: {
+ extend: {
+ opacity: ['disabled']
+ },
+ },
+
+ plugins: [require('@tailwindcss/forms')],
+};
diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php
new file mode 100644
index 0000000..547152f
--- /dev/null
+++ b/tests/CreatesApplication.php
@@ -0,0 +1,22 @@
+make(Kernel::class)->bootstrap();
+
+ return $app;
+ }
+}
diff --git a/tests/Feature/AuthenticationTest.php b/tests/Feature/AuthenticationTest.php
new file mode 100644
index 0000000..2dbceac
--- /dev/null
+++ b/tests/Feature/AuthenticationTest.php
@@ -0,0 +1,45 @@
+get('/login');
+
+ $response->assertStatus(200);
+ }
+
+ public function test_users_can_authenticate_using_the_login_screen()
+ {
+ $user = User::factory()->create();
+
+ $response = $this->post('/login', [
+ 'email' => $user->email,
+ 'password' => 'password',
+ ]);
+
+ $this->assertAuthenticated();
+ $response->assertRedirect(RouteServiceProvider::HOME);
+ }
+
+ public function test_users_can_not_authenticate_with_invalid_password()
+ {
+ $user = User::factory()->create();
+
+ $this->post('/login', [
+ 'email' => $user->email,
+ 'password' => 'wrong-password',
+ ]);
+
+ $this->assertGuest();
+ }
+}
diff --git a/tests/Feature/EmailVerificationTest.php b/tests/Feature/EmailVerificationTest.php
new file mode 100644
index 0000000..61b5775
--- /dev/null
+++ b/tests/Feature/EmailVerificationTest.php
@@ -0,0 +1,65 @@
+create([
+ 'email_verified_at' => null,
+ ]);
+
+ $response = $this->actingAs($user)->get('/verify-email');
+
+ $response->assertStatus(200);
+ }
+
+ public function test_email_can_be_verified()
+ {
+ Event::fake();
+
+ $user = User::factory()->create([
+ 'email_verified_at' => null,
+ ]);
+
+ $verificationUrl = URL::temporarySignedRoute(
+ 'verification.verify',
+ now()->addMinutes(60),
+ ['id' => $user->id, 'hash' => sha1($user->email)]
+ );
+
+ $response = $this->actingAs($user)->get($verificationUrl);
+
+ Event::assertDispatched(Verified::class);
+ $this->assertTrue($user->fresh()->hasVerifiedEmail());
+ $response->assertRedirect(RouteServiceProvider::HOME.'?verified=1');
+ }
+
+ public function test_email_is_not_verified_with_invalid_hash()
+ {
+ $user = User::factory()->create([
+ 'email_verified_at' => null,
+ ]);
+
+ $verificationUrl = URL::temporarySignedRoute(
+ 'verification.verify',
+ now()->addMinutes(60),
+ ['id' => $user->id, 'hash' => sha1('wrong-email')]
+ );
+
+ $this->actingAs($user)->get($verificationUrl);
+
+ $this->assertFalse($user->fresh()->hasVerifiedEmail());
+ }
+}
diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php
new file mode 100644
index 0000000..4ae02bc
--- /dev/null
+++ b/tests/Feature/ExampleTest.php
@@ -0,0 +1,21 @@
+get('/');
+
+ $response->assertStatus(200);
+ }
+}
diff --git a/tests/Feature/PasswordConfirmationTest.php b/tests/Feature/PasswordConfirmationTest.php
new file mode 100644
index 0000000..fdfe630
--- /dev/null
+++ b/tests/Feature/PasswordConfirmationTest.php
@@ -0,0 +1,44 @@
+create();
+
+ $response = $this->actingAs($user)->get('/confirm-password');
+
+ $response->assertStatus(200);
+ }
+
+ public function test_password_can_be_confirmed()
+ {
+ $user = User::factory()->create();
+
+ $response = $this->actingAs($user)->post('/confirm-password', [
+ 'password' => 'password',
+ ]);
+
+ $response->assertRedirect();
+ $response->assertSessionHasNoErrors();
+ }
+
+ public function test_password_is_not_confirmed_with_invalid_password()
+ {
+ $user = User::factory()->create();
+
+ $response = $this->actingAs($user)->post('/confirm-password', [
+ 'password' => 'wrong-password',
+ ]);
+
+ $response->assertSessionHasErrors();
+ }
+}
diff --git a/tests/Feature/PasswordResetTest.php b/tests/Feature/PasswordResetTest.php
new file mode 100644
index 0000000..8d98149
--- /dev/null
+++ b/tests/Feature/PasswordResetTest.php
@@ -0,0 +1,71 @@
+get('/forgot-password');
+
+ $response->assertStatus(200);
+ }
+
+ public function test_reset_password_link_can_be_requested()
+ {
+ Notification::fake();
+
+ $user = User::factory()->create();
+
+ $this->post('/forgot-password', ['email' => $user->email]);
+
+ Notification::assertSentTo($user, ResetPassword::class);
+ }
+
+ public function test_reset_password_screen_can_be_rendered()
+ {
+ Notification::fake();
+
+ $user = User::factory()->create();
+
+ $this->post('/forgot-password', ['email' => $user->email]);
+
+ Notification::assertSentTo($user, ResetPassword::class, function ($notification) {
+ $response = $this->get('/reset-password/'.$notification->token);
+
+ $response->assertStatus(200);
+
+ return true;
+ });
+ }
+
+ public function test_password_can_be_reset_with_valid_token()
+ {
+ Notification::fake();
+
+ $user = User::factory()->create();
+
+ $this->post('/forgot-password', ['email' => $user->email]);
+
+ Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user) {
+ $response = $this->post('/reset-password', [
+ 'token' => $notification->token,
+ 'email' => $user->email,
+ 'password' => 'password',
+ 'password_confirmation' => 'password',
+ ]);
+
+ $response->assertSessionHasNoErrors();
+
+ return true;
+ });
+ }
+}
diff --git a/tests/Feature/RegistrationTest.php b/tests/Feature/RegistrationTest.php
new file mode 100644
index 0000000..6dd5ff8
--- /dev/null
+++ b/tests/Feature/RegistrationTest.php
@@ -0,0 +1,32 @@
+get('/register');
+
+ $response->assertStatus(200);
+ }
+
+ public function test_new_users_can_register()
+ {
+ $response = $this->post('/register', [
+ 'name' => 'Test User',
+ 'email' => 'test@example.com',
+ 'password' => 'password',
+ 'password_confirmation' => 'password',
+ ]);
+
+ $this->assertAuthenticated();
+ $response->assertRedirect(RouteServiceProvider::HOME);
+ }
+}
diff --git a/tests/TestCase.php b/tests/TestCase.php
new file mode 100644
index 0000000..2932d4a
--- /dev/null
+++ b/tests/TestCase.php
@@ -0,0 +1,10 @@
+assertTrue(true);
+ }
+}
diff --git a/webpack.mix.js b/webpack.mix.js
new file mode 100644
index 0000000..c0e99dd
--- /dev/null
+++ b/webpack.mix.js
@@ -0,0 +1,18 @@
+const mix = require('laravel-mix');
+
+/*
+ |--------------------------------------------------------------------------
+ | Mix Asset Management
+ |--------------------------------------------------------------------------
+ |
+ | Mix provides a clean, fluent API for defining some Webpack build steps
+ | for your Laravel applications. By default, we are compiling the CSS
+ | file for the application as well as bundling up all the JS files.
+ |
+ */
+
+mix.js('resources/js/app.js', 'public/js').postCss('resources/css/app.css', 'public/css', [
+ require('postcss-import'),
+ require('tailwindcss'),
+ require('autoprefixer'),
+]);