@cling-se/widget 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DocFormSend.c32e7fd2.js → DocFormSend.b2ed0cb5.js} +10 -10
- package/dist/{index.8113135f.js → index.026afc88.js} +2 -2
- package/dist/{index.ff279dff.js → index.03c509b3.js} +2 -2
- package/dist/{index.cf6e7984.js → index.03ed1967.js} +2 -2
- package/dist/{index.37c9dfd5.js → index.0788e939.js} +2 -2
- package/dist/{index.cccc5e82.js → index.0a0ceded.js} +3 -3
- package/dist/{index.87a5d9bb.js → index.0cb02e1b.js} +2 -2
- package/dist/{index.8f68268e.js → index.176c66b8.js} +2 -2
- package/dist/{index.356d0dad.js → index.1af8248a.js} +2 -2
- package/dist/{index.6f3cfc5e.js → index.1bb2028f.js} +3 -3
- package/dist/{index.30532b11.js → index.1bdfd224.js} +2 -2
- package/dist/{index.34287c95.js → index.1bfb5ab3.js} +2 -2
- package/dist/{index.53deca9d.js → index.1da2952e.js} +2 -2
- package/dist/{index.1736aa11.js → index.2231f8d4.js} +4 -4
- package/dist/{index.8db58cb2.js → index.25329e89.js} +2 -2
- package/dist/{index.58d6de5a.js → index.2ace86f5.js} +1 -1
- package/dist/{index.1bba1ac5.js → index.2d332d52.js} +2 -2
- package/dist/{index.77c8358e.js → index.2d567c37.js} +2 -2
- package/dist/{index.9b23131c.js → index.2e507988.js} +4 -4
- package/dist/{index.ac2dab55.js → index.2f4aeb17.js} +0 -0
- package/dist/{index.38174225.js → index.3436a1ad.js} +3 -3
- package/dist/{index.79737094.js → index.360baed7.js} +2 -2
- package/dist/{index.0d5dbd39.js → index.39ec9686.js} +2 -2
- package/dist/{index.89e557b4.js → index.3e7b32c1.js} +2 -2
- package/dist/{index.3ccefbc0.js → index.3f51320b.js} +2 -2
- package/dist/{index.53ddbffd.js → index.425053e9.js} +2 -2
- package/dist/{index.0e12e2f7.js → index.47d61b17.js} +4 -4
- package/dist/{index.a7c9dcfd.js → index.49006d75.js} +2 -2
- package/dist/{index.90e84cad.js → index.4c96b296.js} +2 -2
- package/dist/{index.15029b8a.js → index.4fad26a8.js} +3 -3
- package/dist/{index.5a863edf.js → index.531b80fc.js} +3 -3
- package/dist/{index.8cf84426.js → index.54b843e0.js} +4 -4
- package/dist/{index.a8eb9363.js → index.5aad9bdd.js} +2 -2
- package/dist/{index.c75f5a35.js → index.5c2c7bf4.js} +4 -4
- package/dist/{index.44bd47a4.js → index.5e73a467.js} +2 -2
- package/dist/{index.770a550f.js → index.5e7e41a3.js} +2 -2
- package/dist/{index.e0824d4a.js → index.5f0949fb.js} +2 -2
- package/dist/{index.d067e17d.js → index.5f81f3ef.js} +2 -2
- package/dist/{index.9d2a0f13.js → index.60f874cf.js} +3 -3
- package/dist/{index.973eb9b7.js → index.63502376.js} +4 -4
- package/dist/{index.7c44c5a9.js → index.63bee262.js} +2 -2
- package/dist/{index.5287a6dc.js → index.67a69f25.js} +2 -2
- package/dist/{index.f194f870.js → index.6ccd74d7.js} +2 -2
- package/dist/{index.f25b51c8.js → index.6cdde2ce.js} +2 -2
- package/dist/{index.f4f3d78a.js → index.7172581d.js} +2 -2
- package/dist/{index.d4200cd8.js → index.739aa819.js} +4 -4
- package/dist/{index.d6e1426c.js → index.7bcfe125.js} +2 -2
- package/dist/{index.c2d5dc09.js → index.7d2da2f8.js} +2 -2
- package/dist/{index.9fb4e7b8.js → index.7f35d59a.js} +4 -4
- package/dist/{index.0c0c759c.js → index.8323f5f4.js} +2 -2
- package/dist/{index.9bcc7d00.js → index.83fc0678.js} +2 -2
- package/dist/{index.5b074710.js → index.8581d497.js} +2 -2
- package/dist/{index.5a96ad13.js → index.86737b3b.js} +2 -2
- package/dist/{index.3804f45d.js → index.8842072e.js} +2 -2
- package/dist/{index.92967823.js → index.8a5acaff.js} +3 -3
- package/dist/{index.50b8d0df.js → index.8c3cf3da.js} +2 -2
- package/dist/{index.85f29241.js → index.90453e0d.js} +3 -3
- package/dist/{index.b21ce0af.js → index.95bef893.js} +4 -4
- package/dist/{index.28456a86.js → index.9a1c119f.js} +0 -0
- package/dist/{index.124577b8.js → index.a7c90db2.js} +4 -4
- package/dist/{index.7e57386e.js → index.a8353252.js} +3 -3
- package/dist/{index.96b2e7ff.js → index.a9460cf4.js} +3 -3
- package/dist/{index.86cb53e5.js → index.ae8047b4.js} +2 -2
- package/dist/{index.f2c9152e.js → index.aed027b0.js} +2 -2
- package/dist/{index.9e942df8.js → index.afc068d7.js} +3 -3
- package/dist/{index.9f370e79.js → index.b17c8f65.js} +3 -3
- package/dist/{index.5466d6f8.js → index.b2ecd745.js} +2 -2
- package/dist/{index.30751ecd.js → index.b7151f05.js} +4 -4
- package/dist/{index.afdccee8.js → index.b9a4646b.js} +2 -2
- package/dist/{index.fb800be0.js → index.b9cc44a8.js} +2 -2
- package/dist/{index.e1c5cd10.js → index.bb375784.js} +4 -4
- package/dist/{index.97679a67.js → index.be2945a2.js} +2 -2
- package/dist/{index.515d6b85.js → index.c02dd0fa.js} +2 -2
- package/dist/{index.73367bac.js → index.c2c5188d.js} +2 -2
- package/dist/{index.a98d72a6.js → index.c4295946.js} +2 -2
- package/dist/{index.a839642f.js → index.c72142c5.js} +2 -2
- package/dist/{index.afd9278e.js → index.c84e7cc7.js} +1 -1
- package/dist/{index.79eb023e.js → index.c87205cf.js} +2 -2
- package/dist/{index.f99a635e.js → index.c8cb705e.js} +2 -2
- package/dist/{index.b3f8c11f.js → index.c93cf602.js} +2 -2
- package/dist/{index.b88bf86b.js → index.cb1f6110.js} +2 -2
- package/dist/{index.8aec2b12.js → index.cca825fd.js} +2 -2
- package/dist/{index.313766cd.js → index.cd8e3187.js} +1 -1
- package/dist/{index.74f8dd09.js → index.d103fed6.js} +2 -2
- package/dist/{index.f6858fbb.js → index.d104916c.js} +0 -0
- package/dist/{index.a87aa509.js → index.d2c7c173.js} +2 -2
- package/dist/{index.8ea3b1fa.js → index.d7aba76d.js} +2 -2
- package/dist/{index.ba7ae770.js → index.d85731cd.js} +2 -2
- package/dist/{index.202d840c.js → index.d90c6cc4.js} +3 -3
- package/dist/{index.9b365e5e.js → index.dc39d415.js} +1 -1
- package/dist/{index.de49dce6.js → index.de496f72.js} +2 -2
- package/dist/{index.5e2d9f69.js → index.df1b9a99.js} +2 -2
- package/dist/{index.66467c62.js → index.e5265c4b.js} +2 -2
- package/dist/{index.aff311c8.js → index.e5ee35ee.js} +2 -2
- package/dist/{index.b4174965.js → index.e8469a79.js} +2 -2
- package/dist/{index.9d2a2ff6.js → index.e8d572a1.js} +2 -2
- package/dist/{index.32ebc2bc.js → index.eaf0a7c6.js} +0 -0
- package/dist/{index.e90ba55c.js → index.eb12eff9.js} +2 -2
- package/dist/{index.1047676e.js → index.ee5f65a2.js} +2 -2
- package/dist/{index.501083b4.js → index.f0425720.js} +2 -2
- package/dist/{index.2930ae11.js → index.f6d2f338.js} +2 -2
- package/dist/{index.fec6a3b8.js → index.f6f8b067.js} +3 -3
- package/dist/{index.d9384142.js → index.f965c5a1.js} +2 -2
- package/dist/{index.0b13cb94.js → index.fa21acdb.js} +2 -2
- package/dist/{main.fd6a7aca.js → main.0842d793.js} +3 -3
- package/dist/main.es.js +1 -1
- package/dist/main.umd.js +2 -2
- package/dist/style.css +2 -2
- package/package.json +1 -1
package/dist/main.umd.js
CHANGED
|
@@ -345,7 +345,7 @@ In order to facilitate your application for deduction, {{company.name}} needs yo
|
|
|
345
345
|
`+o+O.join(`,
|
|
346
346
|
`+o)+`
|
|
347
347
|
`+P+"}":"{"+O.join(",")+"}",o=P,x}}("",{"":M})}),typeof a.parse!="function"&&(a.parse=(p={"\\":"\\",'"':'"',"/":"/",t:" ",n:`
|
|
348
|
-
`,r:"\r",f:"\f",b:"\b"},h={go:function(){l="ok"},firstokey:function(){m=c,l="colon"},okey:function(){m=c,l="colon"},ovalue:function(){l="ocomma"},firstavalue:function(){l="acomma"},avalue:function(){l="acomma"}},v={go:function(){l="ok"},ovalue:function(){l="ocomma"},firstavalue:function(){l="acomma"},avalue:function(){l="acomma"}},g={"{":{go:function(){d.push({state:"ok"}),f={},l="firstokey"},ovalue:function(){d.push({container:f,state:"ocomma",key:m}),f={},l="firstokey"},firstavalue:function(){d.push({container:f,state:"acomma"}),f={},l="firstokey"},avalue:function(){d.push({container:f,state:"acomma"}),f={},l="firstokey"}},"}":{firstokey:function(){var M=d.pop();c=f,f=M.container,m=M.key,l=M.state},ocomma:function(){var M=d.pop();f[m]=c,c=f,f=M.container,m=M.key,l=M.state}},"[":{go:function(){d.push({state:"ok"}),f=[],l="firstavalue"},ovalue:function(){d.push({container:f,state:"ocomma",key:m}),f=[],l="firstavalue"},firstavalue:function(){d.push({container:f,state:"acomma"}),f=[],l="firstavalue"},avalue:function(){d.push({container:f,state:"acomma"}),f=[],l="firstavalue"}},"]":{firstavalue:function(){var M=d.pop();c=f,f=M.container,m=M.key,l=M.state},acomma:function(){var M=d.pop();f.push(c),c=f,f=M.container,m=M.key,l=M.state}},":":{colon:function(){if(Object.hasOwnProperty.call(f,m))throw new SyntaxError("Duplicate key '"+m+'"');l="ovalue"}},",":{ocomma:function(){f[m]=c,l="okey"},acomma:function(){f.push(c),l="avalue"}},true:{go:function(){c=!0,l="ok"},ovalue:function(){c=!0,l="ocomma"},firstavalue:function(){c=!0,l="acomma"},avalue:function(){c=!0,l="acomma"}},false:{go:function(){c=!1,l="ok"},ovalue:function(){c=!1,l="ocomma"},firstavalue:function(){c=!1,l="acomma"},avalue:function(){c=!1,l="acomma"}},null:{go:function(){c=null,l="ok"},ovalue:function(){c=null,l="ocomma"},firstavalue:function(){c=null,l="acomma"},avalue:function(){c=null,l="acomma"}}},function(M,C){var F,T,N=/^[\u0020\t\n\r]*(?:([,:\[\]{}]|true|false|null)|(-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)|"((?:[^\r\n\t\\\"]|\\(?:["\\\/trnfb]|u[0-9a-fA-F]{4}))*)")/;l="go",d=[];try{for(;F=N.exec(M);)F[1]?g[F[1]][l]():F[2]?(c=+F[2],v[l]()):(T=F[3],c=T.replace(/\\(?:u(.{4})|([^u]))/g,function(W,$,E){return $?String.fromCharCode(parseInt($,16)):p[E]}),h[l]()),M=M.slice(F[0].length)}catch(W){l=W}if(l!=="ok"||/[^\u0020\t\n\r]/.test(M))throw l instanceof SyntaxError?l:new SyntaxError("JSON");return typeof C=="function"?function W($,E){var L,x,S=$[E];if(S&&typeof S=="object")for(L in c)Object.prototype.hasOwnProperty.call(S,L)&&((x=W(S,L))!==void 0?S[L]=x:delete S[L]);return C.call($,E,S)}({"":c},""):c}))}},function(r,n,a){function o(i,s,u){if(s.hasOwnProperty&&s.hasOwnProperty("addEventListener")){for(var l=s.addEventListener;l._rollbarOldAdd&&l.belongsToShim;)l=l._rollbarOldAdd;var d=function(c,p,h){l.call(this,c,i.wrap(p),h)};d._rollbarOldAdd=l,d.belongsToShim=u,s.addEventListener=d;for(var f=s.removeEventListener;f._rollbarOldRemove&&f.belongsToShim;)f=f._rollbarOldRemove;var m=function(c,p,h){f.call(this,c,p&&p._rollbar_wrapped||p,h)};m._rollbarOldRemove=f,m.belongsToShim=u,s.removeEventListener=m}}r.exports=function(i,s,u){if(i){var l,d,f="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(l=0;l<f.length;++l)i[d=f[l]]&&i[d].prototype&&o(s,i[d].prototype,u)}}},function(r,n,a){var o=a(0),i=a(5);function s(h,v){return[h,o.stringify(h,v)]}function u(h,v){var g=h.length;return g>2*v?h.slice(0,v).concat(h.slice(g-v)):h}function l(h,v,g){g=g===void 0?30:g;var _,y=h.data.body;if(y.trace_chain)for(var b=y.trace_chain,k=0;k<b.length;k++)_=u(_=b[k].frames,g),b[k].frames=_;else y.trace&&(_=u(_=y.trace.frames,g),y.trace.frames=_);return[h,o.stringify(h,v)]}function d(h,v){return v&&v.length>h?v.slice(0,h-3).concat("..."):v}function f(h,v,g){return[v=i(v,function _(y,b,k){switch(o.typeName(b)){case"string":return d(h,b);case"object":case"array":return i(b,_,k);default:return b}}),o.stringify(v,g)]}function m(h){return h.exception&&(delete h.exception.description,h.exception.message=d(255,h.exception.message)),h.frames=u(h.frames,1),h}function c(h,v){var g=h.data.body;if(g.trace_chain)for(var _=g.trace_chain,y=0;y<_.length;y++)_[y]=m(_[y]);else g.trace&&(g.trace=m(g.trace));return[h,o.stringify(h,v)]}function p(h,v){return o.maxByteSize(h)>v}r.exports={truncate:function(h,v,g){g=g===void 0?524288:g;for(var _,y,b,k=[s,l,f.bind(null,1024),f.bind(null,512),f.bind(null,256),c];_=k.shift();)if(h=(y=_(h,v))[0],(b=y[1]).error||!p(b.value,g))return b;return b},raw:s,truncateFrames:l,truncateStrings:f,maybeTruncateValue:d}}])})})(fV);const Lwe=ae(fV.exports),Wwe=Me.rollbar.clientToken,Fwe=new Lwe({accessToken:Wwe,captureUncaught:!0,captureUnhandledRejections:!0,source_map_enabled:!0,environment:Me.rollbar.environment||Me.environment,enabled:!1,ignoredMessages:["The operation is insecure","Script error.","null is not an object (evaluating 'localStorage.getItem')","Unexpected token '<'","expected expression, got '<'","ChunkLoadError","Loading chunk","ResizeObserver loop limit exceeded","Failed to update a ServiceWorker for scope","Object Not Found Matching Id","newestWorker is null"],payload:{client:{javascript:{code_version:"0.0.10",source_map_enabled:!0,guess_uncaught_frames:!0}}},transform:t=>{const{trace:e}=t.body;if(e&&e.frames)for(let r=0;r<e.frames.length;r++){const{filename:n}=e.frames[r];n&&(e.frames[r].filename=e.frames[r].filename.replace(Me.baseUrl,"https://dynamichost"))}}}),{UPDATE_VIEW_SETTINGS:Fs,LOAD_USER_POSITION:jwe,LOAD_USER:js,LOGIN_USER:im,LOGIN_AUTH_TOKEN:mV,AUTH_3RD_PARTY_USER:pV,SWITCH_CONNECTED_USER:hV,LOGOUT_USER:om,REGISTER_USER:vV,RESET_USER_PASSWORD:gV}=jl,{DO_LOAD_CURRENT_COMPANY:Vwe,DO_LOAD_ALL_SETTINGS:zwe,DO_NORMALIZE_COMPANY_USERS:Uwe,LOAD_UNREAD_NOTIFICATIONS:Hwe}=Oe,{SET_USER_LOCATION:qwe,SET_USER:Kt}=It,yV=t=>be.te(`errors:${t}`)&&be.t(`errors:${t}`),Bwe={async[js]({commit:t,getters:e,dispatch:r}){var n,a,o;try{if(!Ze.getItem("token")){Ze.removeItem("tokenExpire"),Ze.removeItem("refreshToken"),t(Kt,{userId:null,companyId:null,crispUserHash:null}),this.$router.push({name:"Login"});return}const[{data:i},{data:s=[]}]=await Promise.all([cr.get("/companyUser/self"),r3.getConnectedUsers()]),{id:u,CompanyId:l,crispUserHash:d,language:f,locale:m}=i;f&&be.i18next.changeLanguage(f),m&&be.l10n.changeLocale(m),await this.dispatch(Uwe,{companyUsers:[{...i,connectedUsers:s}]}),t(Kt,{userId:u,companyId:l,crispUserHash:d}),await this.dispatch(Vwe),await this.dispatch(zwe),this._vm.$cookiePreference!=="all"&&(this._vm.$cookiePreference="all"),this.hasModule("notifications")&&!this.getters["notifications/isFetching"]&&this.dispatch(Hwe,{throttleTime:5});const{user:c,company:p,isQualified:h}=e;if(c){let v="";(c.firstname||c.lastname)&&(v=c.fullName),Fwe.configure({payload:{person:{id:c.id,username:v||null,email:c.email||null}}}),(n=this.$supportChat)==null||n.syncData(),(a=this.$trackevent)==null||a.call(this,"loadUser",{companyUserId:c.id}),(o=this.$segment)==null||o.identifyCompanyUser()}}catch(i){this.handleError(i,{action:js,actionPayload:null}),r(om)}},async[im]({commit:t,dispatch:e},{email:r,password:n,doRedirect:a=!0,doLoadUser:o=!0,superUserId:i=null,responseType:s=null,code:u=null}){try{t(Kt,{isLoggingIn:!0}),e(Fs,{view:"login",settings:{error:null}});let l;if(i?({data:l}=await cr.post("/auth/employee",{email:r,password:n,CompanyUserId:i}),Ze.setItem("isClingEmployee",!0)):u?({data:l}=await cr.post("/oauth2/token",{code:u,client_id:Me.clientId,grant_type:"authorization_code",brand:this._vm.$brand,...Cf(this._vm.$view)}),l={token:l.access_token,tokenExpires:l.expires_in,refreshToken:l.refresh_token}):{data:l}=await cr.post("/auth/companyUser",{email:r,password:n,response_type:s,...Cf(this._vm.$view)}),s==="code"&&l.code)return t(Kt,{isLoggingIn:!1}),l;const{token:d,tokenExpires:f,refreshToken:m}=l;if(Ze.setItem("token",d),Ze.setItem("tokenExpires",f),Ze.setItem("refreshToken",m),t(Kt,{isLoggingIn:!1}),o&&await e(js),!a)return!0;const{redirect:c}=this.state.route.query||{};return c?(this.$router.push(c),!0):(this.$router.push({name:"account"}),!0)}catch(l){let d=be.t("errors:fallback"),f=!1;if(l&&typeof l.getPayload=="function"){const m=l.getPayload();m&&m.axios&&m.axios.status===401&&(f=!0)}return f&&(d=be.t("actions:loginUser.wrongCredentials")),e(Fs,{view:"login",settings:{error:d}}),t(Kt,{isLoggingIn:!1}),f||this.handleError(l,{action:im,actionPayload:null}),!1}},async[mV]({commit:t,dispatch:e},{authToken:r,to:n}){let a={};try{if(!r)throw new Error("Missing param authToken");if(!n)throw new Error("Missing param to");t(Kt,{isLoggingIn:!0}),a=Object.assign({},n.query),delete a.authtoken;const{data:o}=await Cme(r,{...Cf(this._vm.$view)}),{token:i,tokenExpires:s,refreshToken:u}=o;Ze.setItem("token",i),Ze.setItem("tokenExpires",s),Ze.setItem("refreshToken",u),await e(js),this.$router.push({path:n.path,query:a})}catch(o){const i=n.path;await e(om,{next:{name:"Login",query:{redirect:i}}}),this.handleError(o,{action:mV,actionPayload:null})}finally{t(Kt,{isLoggingIn:!1})}},async[pV]({commit:t,dispatch:e},{service:r,code:n}){t(Kt,{isLoggingIn:!0});const a={isAuth:!1,isVerify:!1,company:null,companyUser:null,addedToExistingCompanyId:null,error:null};try{const{data:o}=await t1.signupWithCrm(r,{code:n,doLogin:!0,...Cf(this._vm.$view),brand:this._vm.$brand}),{addedToExistingCompanyId:i,authenticate:s}=o,{token:u,tokenExpires:l,refreshToken:d,company:f,companyUser:m}=s;return Ze.setItem("token",u),Ze.setItem("tokenExpires",l),Ze.setItem("refreshToken",d),m&&m.isSlave&&!m.verifiedEmailAt?(a.companyUser=m,a.isVerify=!0,a):(await e(js),i&&(a.addedToExistingCompanyId=i),a.company=f,a.isAuth=!0,a)}catch(o){return this.handleError(o,{action:pV,actionPayload:null}),{isAuth:!1,isVerify:!1,company:null,companyUser:null,addedToExistingCompanyId:null,error:o.message}}finally{t(Kt,{isLoggingIn:!1})}},async[hV]({commit:t,dispatch:e},{companyUserId:r,doRedirect:n=!0}){try{if(typeof r>"u")throw new Error("Missing param companyUserId");t(Kt,{isLoggingIn:!0});const{data:a}=await r3.getConnectedUserAuth(r),{token:o,tokenExpires:i,refreshToken:s}=a;Ze.setItem("token",o),Ze.setItem("tokenExpires",i),Ze.setItem("refreshToken",s),this.commit("reset"),await e(js),n?this.$router.push({name:"account"}):window.reloadApp(!0)}catch(a){this.handleError(a,{action:hV,actionPayload:null})}finally{t(Kt,{isLoggingIn:!1})}},async[vV]({commit:t,dispatch:e},{company:r,companyUser:n,termsVersion:a,voucherCode:o=null,source:i=null,region:s,language:u,currency:l,throwIfSlaveUser:d}){var f,m;try{const c={isAuth:!1,isVerify:!1,didNavigate:!1};if(e(Fs,{view:"register",settings:{error:null}}),t(Kt,{isRegistering:!0}),!r)throw new Error("Missing param company");if(!n)throw new Error("Missing param companyUser");if(!a)throw new Error("Missing param termsVersion");const{data:p}=await $me({Company:r,CompanyUser:n,voucherCode:o,source:i,region:s,language:u,currency:l,throwIfSlaveUser:d}),{CompanyUser:h}=p,v={type:"terms",version:a,identifier:h.email,object:"CompanyUser",objectId:h.id};if(await Rme(v),h.isSlave)return c.isVerify=!0,c;const g=await e(im,{email:n.email,password:n.password,doRedirect:!1});return c.isAuth=g,g&&((f=this.$trackevent)==null||f.call(this,"register")),(m=this.$segment)==null||m.track("Register Documents Viewed",JSON.parse(Ze.getItem("documentsViewed"))||[]),c}catch(c){if(te(c,"payload.code")===4008&&d)throw c;if(c&&c.code){const p=yV(c.code);p&&e(Fs,{view:"register",settings:{error:p}})}return this.handleError(c,{action:vV,actionPayload:null}),{isAuth:!1,isVerify:!1,didNavigate:!1}}finally{t(Kt,{isRegistering:!1})}},async[gV]({commit:t,dispatch:e},{password:r,token:n,doRedirect:a=!0}){try{if(e(Fs,{view:"register",settings:{error:null}}),t(Kt,{isResettingPassword:!0}),!r)throw new Error("Missing param password");if(!n)throw new Error("Missing param token");const{data:o}=await Ame(r,n),{email:i}=o;return await e(im,{email:i,password:r,doRedirect:a}),!0}catch(o){if(o&&o.code){const i=yV(o.code);i&&e(Fs,{view:"register",settings:{error:i}})}return this.handleError(o,{action:gV,actionPayload:null}),!1}finally{t(Kt,{isResettingPassword:!1})}},[om]({commit:t},{next:e}={}){try{Ze.removeItem("token"),Ze.removeItem("tokenExpires"),Ze.removeItem("refreshToken"),this.commit("reset")}finally{t(Kt,{isLoggingIn:!1,userId:null,companyId:null,crispUserHash:null})}if(e)try{return this.$router.replace(e)}catch(r){this.handleError(r,{action:om,actionPayload:null})}return this.$router.replace({name:"Login"})},[jwe]({commit:t}){navigator.geolocation.getCurrentPosition(({coords:e})=>{t(qwe,[e.longitude,e.latitude])})}},X1=new Map,{PUSH_MODAL:Ywe,POP_MODAL:Gwe,SET_CAN_CLOSE_MODAL:Kwe,SHOW_MESSAGE:Xwe,CLEAR_MESSAGE:Jwe,CLEAR_MESSAGE_BY_ID:Qwe,MESSAGE_ACTION:_V,UPDATE_VIEW_SETTINGS:Zwe,RESET_VIEW_SETTINGS:e1e,SHOW_ERROR:t1e,RESET_ERROR:r1e}=jl,n1e={...Bwe,[Ywe]({commit:t,state:e},r){const n={...r,_uniqueId:Sn.exports()};t(It.SET_MODALS,[...e.modals,n])},[Gwe]({commit:t,state:e}){t(It.SET_MODALS,e.modals.slice(0,-1))},[Kwe]({commit:t},e){t(It.SET_CAN_CLOSE_MODAL,e)},[Xwe]({commit:t,state:e},r){const{type:n,displayType:a="notification",time:o=5e3,title:i,message:s,closeButton:u,omit:l=""}=r,d={},f={};if((p=>{const[h="foo",v="bar"]=p.split(":");return this._vm[h]===v})(l))return;r.actions&&Object.keys(r.actions).forEach(p=>{const h=r.actions[p];if(typeof h=="object"&&!Array.isArray(h)){if(!h.fn&&!h.callback)throw Error(`No callback function provided for action ${p}`);d[p]=h.fn||h.callback,delete h.fn,delete h.callback,f[p]=h}else if(typeof h=="string")d[p]=h,f[p]={};else if(typeof h=="function")d[p]=h,f[p]={};else throw Error(`Action, ${p} , must be one of: object|string|function`)}),t(It.ADD_MESSAGE,{actions:f,title:i,message:s,type:n,displayType:a,time:o,closeButton:u});const c=e.messages.slice(-1)[0];return X1.set(c._uniqueId,d),c._uniqueId},[Jwe]({commit:t,state:e},r){const n=e.messages[r]||{};t(It.REMOVE_MESSAGE,r),X1.delete(n._uniqueId)},[Qwe]({dispatch:t,state:e},r){const n=e.messages.findIndex(a=>a._uniqueId===r);t(jl.CLEAR_MESSAGE,n)},[_V]({state:t,dispatch:e},{index:r,type:n}){try{const a={cancel:()=>e(jl.CLEAR_MESSAGE,r)},o=t.messages[r]||{};if(!o||!o._uniqueId)throw Error("message not found, failed to trigger action");const i=X1.get(o._uniqueId);if(!i)throw Error("message has no actions, failed to trigger action");const s=i[n];if(!s)throw Error(`message has no action of type ${n}`);let u=s;if(typeof s=="string"&&(u=a[s],!u))throw Error(`No predefined action of type ${s}`);if(typeof u!="function")throw Error("Unable to extract function from message action");return u(o)}catch(a){return this.handleError(a,{action:_V,actionPayload:arguments[1],retries:0})}},[Zwe]({commit:t},{view:e,settings:r}){t(It.SET_VIEW_SETTINGS,{view:e,settings:r})},[e1e]({commit:t}){t(It.RESET_VIEW_SETTINGS)},[t1e]({commit:t},e){t(It.SET_ERROR,e)},[r1e]({commit:t}){t(It.RESET_ERROR)}};function sm(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a1e(t,e){return i1e(t)||o1e(t,e)||s1e(t,e)||u1e()}function i1e(t){if(Array.isArray(t))return t}function o1e(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,a=!1,o=void 0;try{for(var i=t[Symbol.iterator](),s;!(n=(s=i.next()).done)&&(r.push(s.value),!(e&&r.length===e));n=!0);}catch(u){a=!0,o=u}finally{try{!n&&i.return!=null&&i.return()}finally{if(a)throw o}}return r}}function s1e(t,e){if(!!t){if(typeof t=="string")return bV(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bV(t,e)}}function bV(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
348
|
+
`,r:"\r",f:"\f",b:"\b"},h={go:function(){l="ok"},firstokey:function(){m=c,l="colon"},okey:function(){m=c,l="colon"},ovalue:function(){l="ocomma"},firstavalue:function(){l="acomma"},avalue:function(){l="acomma"}},v={go:function(){l="ok"},ovalue:function(){l="ocomma"},firstavalue:function(){l="acomma"},avalue:function(){l="acomma"}},g={"{":{go:function(){d.push({state:"ok"}),f={},l="firstokey"},ovalue:function(){d.push({container:f,state:"ocomma",key:m}),f={},l="firstokey"},firstavalue:function(){d.push({container:f,state:"acomma"}),f={},l="firstokey"},avalue:function(){d.push({container:f,state:"acomma"}),f={},l="firstokey"}},"}":{firstokey:function(){var M=d.pop();c=f,f=M.container,m=M.key,l=M.state},ocomma:function(){var M=d.pop();f[m]=c,c=f,f=M.container,m=M.key,l=M.state}},"[":{go:function(){d.push({state:"ok"}),f=[],l="firstavalue"},ovalue:function(){d.push({container:f,state:"ocomma",key:m}),f=[],l="firstavalue"},firstavalue:function(){d.push({container:f,state:"acomma"}),f=[],l="firstavalue"},avalue:function(){d.push({container:f,state:"acomma"}),f=[],l="firstavalue"}},"]":{firstavalue:function(){var M=d.pop();c=f,f=M.container,m=M.key,l=M.state},acomma:function(){var M=d.pop();f.push(c),c=f,f=M.container,m=M.key,l=M.state}},":":{colon:function(){if(Object.hasOwnProperty.call(f,m))throw new SyntaxError("Duplicate key '"+m+'"');l="ovalue"}},",":{ocomma:function(){f[m]=c,l="okey"},acomma:function(){f.push(c),l="avalue"}},true:{go:function(){c=!0,l="ok"},ovalue:function(){c=!0,l="ocomma"},firstavalue:function(){c=!0,l="acomma"},avalue:function(){c=!0,l="acomma"}},false:{go:function(){c=!1,l="ok"},ovalue:function(){c=!1,l="ocomma"},firstavalue:function(){c=!1,l="acomma"},avalue:function(){c=!1,l="acomma"}},null:{go:function(){c=null,l="ok"},ovalue:function(){c=null,l="ocomma"},firstavalue:function(){c=null,l="acomma"},avalue:function(){c=null,l="acomma"}}},function(M,C){var F,T,N=/^[\u0020\t\n\r]*(?:([,:\[\]{}]|true|false|null)|(-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)|"((?:[^\r\n\t\\\"]|\\(?:["\\\/trnfb]|u[0-9a-fA-F]{4}))*)")/;l="go",d=[];try{for(;F=N.exec(M);)F[1]?g[F[1]][l]():F[2]?(c=+F[2],v[l]()):(T=F[3],c=T.replace(/\\(?:u(.{4})|([^u]))/g,function(W,$,E){return $?String.fromCharCode(parseInt($,16)):p[E]}),h[l]()),M=M.slice(F[0].length)}catch(W){l=W}if(l!=="ok"||/[^\u0020\t\n\r]/.test(M))throw l instanceof SyntaxError?l:new SyntaxError("JSON");return typeof C=="function"?function W($,E){var L,x,S=$[E];if(S&&typeof S=="object")for(L in c)Object.prototype.hasOwnProperty.call(S,L)&&((x=W(S,L))!==void 0?S[L]=x:delete S[L]);return C.call($,E,S)}({"":c},""):c}))}},function(r,n,a){function o(i,s,u){if(s.hasOwnProperty&&s.hasOwnProperty("addEventListener")){for(var l=s.addEventListener;l._rollbarOldAdd&&l.belongsToShim;)l=l._rollbarOldAdd;var d=function(c,p,h){l.call(this,c,i.wrap(p),h)};d._rollbarOldAdd=l,d.belongsToShim=u,s.addEventListener=d;for(var f=s.removeEventListener;f._rollbarOldRemove&&f.belongsToShim;)f=f._rollbarOldRemove;var m=function(c,p,h){f.call(this,c,p&&p._rollbar_wrapped||p,h)};m._rollbarOldRemove=f,m.belongsToShim=u,s.removeEventListener=m}}r.exports=function(i,s,u){if(i){var l,d,f="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(l=0;l<f.length;++l)i[d=f[l]]&&i[d].prototype&&o(s,i[d].prototype,u)}}},function(r,n,a){var o=a(0),i=a(5);function s(h,v){return[h,o.stringify(h,v)]}function u(h,v){var g=h.length;return g>2*v?h.slice(0,v).concat(h.slice(g-v)):h}function l(h,v,g){g=g===void 0?30:g;var _,y=h.data.body;if(y.trace_chain)for(var b=y.trace_chain,k=0;k<b.length;k++)_=u(_=b[k].frames,g),b[k].frames=_;else y.trace&&(_=u(_=y.trace.frames,g),y.trace.frames=_);return[h,o.stringify(h,v)]}function d(h,v){return v&&v.length>h?v.slice(0,h-3).concat("..."):v}function f(h,v,g){return[v=i(v,function _(y,b,k){switch(o.typeName(b)){case"string":return d(h,b);case"object":case"array":return i(b,_,k);default:return b}}),o.stringify(v,g)]}function m(h){return h.exception&&(delete h.exception.description,h.exception.message=d(255,h.exception.message)),h.frames=u(h.frames,1),h}function c(h,v){var g=h.data.body;if(g.trace_chain)for(var _=g.trace_chain,y=0;y<_.length;y++)_[y]=m(_[y]);else g.trace&&(g.trace=m(g.trace));return[h,o.stringify(h,v)]}function p(h,v){return o.maxByteSize(h)>v}r.exports={truncate:function(h,v,g){g=g===void 0?524288:g;for(var _,y,b,k=[s,l,f.bind(null,1024),f.bind(null,512),f.bind(null,256),c];_=k.shift();)if(h=(y=_(h,v))[0],(b=y[1]).error||!p(b.value,g))return b;return b},raw:s,truncateFrames:l,truncateStrings:f,maybeTruncateValue:d}}])})})(fV);const Lwe=ae(fV.exports),Wwe=Me.rollbar.clientToken,Fwe=new Lwe({accessToken:Wwe,captureUncaught:!0,captureUnhandledRejections:!0,source_map_enabled:!0,environment:Me.rollbar.environment||Me.environment,enabled:!1,ignoredMessages:["The operation is insecure","Script error.","null is not an object (evaluating 'localStorage.getItem')","Unexpected token '<'","expected expression, got '<'","ChunkLoadError","Loading chunk","ResizeObserver loop limit exceeded","Failed to update a ServiceWorker for scope","Object Not Found Matching Id","newestWorker is null"],payload:{client:{javascript:{code_version:"0.0.11",source_map_enabled:!0,guess_uncaught_frames:!0}}},transform:t=>{const{trace:e}=t.body;if(e&&e.frames)for(let r=0;r<e.frames.length;r++){const{filename:n}=e.frames[r];n&&(e.frames[r].filename=e.frames[r].filename.replace(Me.baseUrl,"https://dynamichost"))}}}),{UPDATE_VIEW_SETTINGS:Fs,LOAD_USER_POSITION:jwe,LOAD_USER:js,LOGIN_USER:im,LOGIN_AUTH_TOKEN:mV,AUTH_3RD_PARTY_USER:pV,SWITCH_CONNECTED_USER:hV,LOGOUT_USER:om,REGISTER_USER:vV,RESET_USER_PASSWORD:gV}=jl,{DO_LOAD_CURRENT_COMPANY:Vwe,DO_LOAD_ALL_SETTINGS:zwe,DO_NORMALIZE_COMPANY_USERS:Uwe,LOAD_UNREAD_NOTIFICATIONS:Hwe}=Oe,{SET_USER_LOCATION:qwe,SET_USER:Kt}=It,yV=t=>be.te(`errors:${t}`)&&be.t(`errors:${t}`),Bwe={async[js]({commit:t,getters:e,dispatch:r}){var n,a,o;try{if(!Ze.getItem("token")){Ze.removeItem("tokenExpire"),Ze.removeItem("refreshToken"),t(Kt,{userId:null,companyId:null,crispUserHash:null}),this.$router.push({name:"Login"});return}const[{data:i},{data:s=[]}]=await Promise.all([cr.get("/companyUser/self"),r3.getConnectedUsers()]),{id:u,CompanyId:l,crispUserHash:d,language:f,locale:m}=i;f&&be.i18next.changeLanguage(f),m&&be.l10n.changeLocale(m),await this.dispatch(Uwe,{companyUsers:[{...i,connectedUsers:s}]}),t(Kt,{userId:u,companyId:l,crispUserHash:d}),await this.dispatch(Vwe),await this.dispatch(zwe),this._vm.$cookiePreference!=="all"&&(this._vm.$cookiePreference="all"),this.hasModule("notifications")&&!this.getters["notifications/isFetching"]&&this.dispatch(Hwe,{throttleTime:5});const{user:c,company:p,isQualified:h}=e;if(c){let v="";(c.firstname||c.lastname)&&(v=c.fullName),Fwe.configure({payload:{person:{id:c.id,username:v||null,email:c.email||null}}}),(n=this.$supportChat)==null||n.syncData(),(a=this.$trackevent)==null||a.call(this,"loadUser",{companyUserId:c.id}),(o=this.$segment)==null||o.identifyCompanyUser()}}catch(i){this.handleError(i,{action:js,actionPayload:null}),r(om)}},async[im]({commit:t,dispatch:e},{email:r,password:n,doRedirect:a=!0,doLoadUser:o=!0,superUserId:i=null,responseType:s=null,code:u=null}){try{t(Kt,{isLoggingIn:!0}),e(Fs,{view:"login",settings:{error:null}});let l;if(i?({data:l}=await cr.post("/auth/employee",{email:r,password:n,CompanyUserId:i}),Ze.setItem("isClingEmployee",!0)):u?({data:l}=await cr.post("/oauth2/token",{code:u,client_id:Me.clientId,grant_type:"authorization_code",brand:this._vm.$brand,...Cf(this._vm.$view)}),l={token:l.access_token,tokenExpires:l.expires_in,refreshToken:l.refresh_token}):{data:l}=await cr.post("/auth/companyUser",{email:r,password:n,response_type:s,...Cf(this._vm.$view)}),s==="code"&&l.code)return t(Kt,{isLoggingIn:!1}),l;const{token:d,tokenExpires:f,refreshToken:m}=l;if(Ze.setItem("token",d),Ze.setItem("tokenExpires",f),Ze.setItem("refreshToken",m),t(Kt,{isLoggingIn:!1}),o&&await e(js),!a)return!0;const{redirect:c}=this.state.route.query||{};return c?(this.$router.push(c),!0):(this.$router.push({name:"account"}),!0)}catch(l){let d=be.t("errors:fallback"),f=!1;if(l&&typeof l.getPayload=="function"){const m=l.getPayload();m&&m.axios&&m.axios.status===401&&(f=!0)}return f&&(d=be.t("actions:loginUser.wrongCredentials")),e(Fs,{view:"login",settings:{error:d}}),t(Kt,{isLoggingIn:!1}),f||this.handleError(l,{action:im,actionPayload:null}),!1}},async[mV]({commit:t,dispatch:e},{authToken:r,to:n}){let a={};try{if(!r)throw new Error("Missing param authToken");if(!n)throw new Error("Missing param to");t(Kt,{isLoggingIn:!0}),a=Object.assign({},n.query),delete a.authtoken;const{data:o}=await Cme(r,{...Cf(this._vm.$view)}),{token:i,tokenExpires:s,refreshToken:u}=o;Ze.setItem("token",i),Ze.setItem("tokenExpires",s),Ze.setItem("refreshToken",u),await e(js),this.$router.push({path:n.path,query:a})}catch(o){const i=n.path;await e(om,{next:{name:"Login",query:{redirect:i}}}),this.handleError(o,{action:mV,actionPayload:null})}finally{t(Kt,{isLoggingIn:!1})}},async[pV]({commit:t,dispatch:e},{service:r,code:n}){t(Kt,{isLoggingIn:!0});const a={isAuth:!1,isVerify:!1,company:null,companyUser:null,addedToExistingCompanyId:null,error:null};try{const{data:o}=await t1.signupWithCrm(r,{code:n,doLogin:!0,...Cf(this._vm.$view),brand:this._vm.$brand}),{addedToExistingCompanyId:i,authenticate:s}=o,{token:u,tokenExpires:l,refreshToken:d,company:f,companyUser:m}=s;return Ze.setItem("token",u),Ze.setItem("tokenExpires",l),Ze.setItem("refreshToken",d),m&&m.isSlave&&!m.verifiedEmailAt?(a.companyUser=m,a.isVerify=!0,a):(await e(js),i&&(a.addedToExistingCompanyId=i),a.company=f,a.isAuth=!0,a)}catch(o){return this.handleError(o,{action:pV,actionPayload:null}),{isAuth:!1,isVerify:!1,company:null,companyUser:null,addedToExistingCompanyId:null,error:o.message}}finally{t(Kt,{isLoggingIn:!1})}},async[hV]({commit:t,dispatch:e},{companyUserId:r,doRedirect:n=!0}){try{if(typeof r>"u")throw new Error("Missing param companyUserId");t(Kt,{isLoggingIn:!0});const{data:a}=await r3.getConnectedUserAuth(r),{token:o,tokenExpires:i,refreshToken:s}=a;Ze.setItem("token",o),Ze.setItem("tokenExpires",i),Ze.setItem("refreshToken",s),this.commit("reset"),await e(js),n?this.$router.push({name:"account"}):window.reloadApp(!0)}catch(a){this.handleError(a,{action:hV,actionPayload:null})}finally{t(Kt,{isLoggingIn:!1})}},async[vV]({commit:t,dispatch:e},{company:r,companyUser:n,termsVersion:a,voucherCode:o=null,source:i=null,region:s,language:u,currency:l,throwIfSlaveUser:d}){var f,m;try{const c={isAuth:!1,isVerify:!1,didNavigate:!1};if(e(Fs,{view:"register",settings:{error:null}}),t(Kt,{isRegistering:!0}),!r)throw new Error("Missing param company");if(!n)throw new Error("Missing param companyUser");if(!a)throw new Error("Missing param termsVersion");const{data:p}=await $me({Company:r,CompanyUser:n,voucherCode:o,source:i,region:s,language:u,currency:l,throwIfSlaveUser:d}),{CompanyUser:h}=p,v={type:"terms",version:a,identifier:h.email,object:"CompanyUser",objectId:h.id};if(await Rme(v),h.isSlave)return c.isVerify=!0,c;const g=await e(im,{email:n.email,password:n.password,doRedirect:!1});return c.isAuth=g,g&&((f=this.$trackevent)==null||f.call(this,"register")),(m=this.$segment)==null||m.track("Register Documents Viewed",JSON.parse(Ze.getItem("documentsViewed"))||[]),c}catch(c){if(te(c,"payload.code")===4008&&d)throw c;if(c&&c.code){const p=yV(c.code);p&&e(Fs,{view:"register",settings:{error:p}})}return this.handleError(c,{action:vV,actionPayload:null}),{isAuth:!1,isVerify:!1,didNavigate:!1}}finally{t(Kt,{isRegistering:!1})}},async[gV]({commit:t,dispatch:e},{password:r,token:n,doRedirect:a=!0}){try{if(e(Fs,{view:"register",settings:{error:null}}),t(Kt,{isResettingPassword:!0}),!r)throw new Error("Missing param password");if(!n)throw new Error("Missing param token");const{data:o}=await Ame(r,n),{email:i}=o;return await e(im,{email:i,password:r,doRedirect:a}),!0}catch(o){if(o&&o.code){const i=yV(o.code);i&&e(Fs,{view:"register",settings:{error:i}})}return this.handleError(o,{action:gV,actionPayload:null}),!1}finally{t(Kt,{isResettingPassword:!1})}},[om]({commit:t},{next:e}={}){try{Ze.removeItem("token"),Ze.removeItem("tokenExpires"),Ze.removeItem("refreshToken"),this.commit("reset")}finally{t(Kt,{isLoggingIn:!1,userId:null,companyId:null,crispUserHash:null})}if(e)try{return this.$router.replace(e)}catch(r){this.handleError(r,{action:om,actionPayload:null})}return this.$router.replace({name:"Login"})},[jwe]({commit:t}){navigator.geolocation.getCurrentPosition(({coords:e})=>{t(qwe,[e.longitude,e.latitude])})}},X1=new Map,{PUSH_MODAL:Ywe,POP_MODAL:Gwe,SET_CAN_CLOSE_MODAL:Kwe,SHOW_MESSAGE:Xwe,CLEAR_MESSAGE:Jwe,CLEAR_MESSAGE_BY_ID:Qwe,MESSAGE_ACTION:_V,UPDATE_VIEW_SETTINGS:Zwe,RESET_VIEW_SETTINGS:e1e,SHOW_ERROR:t1e,RESET_ERROR:r1e}=jl,n1e={...Bwe,[Ywe]({commit:t,state:e},r){const n={...r,_uniqueId:Sn.exports()};t(It.SET_MODALS,[...e.modals,n])},[Gwe]({commit:t,state:e}){t(It.SET_MODALS,e.modals.slice(0,-1))},[Kwe]({commit:t},e){t(It.SET_CAN_CLOSE_MODAL,e)},[Xwe]({commit:t,state:e},r){const{type:n,displayType:a="notification",time:o=5e3,title:i,message:s,closeButton:u,omit:l=""}=r,d={},f={};if((p=>{const[h="foo",v="bar"]=p.split(":");return this._vm[h]===v})(l))return;r.actions&&Object.keys(r.actions).forEach(p=>{const h=r.actions[p];if(typeof h=="object"&&!Array.isArray(h)){if(!h.fn&&!h.callback)throw Error(`No callback function provided for action ${p}`);d[p]=h.fn||h.callback,delete h.fn,delete h.callback,f[p]=h}else if(typeof h=="string")d[p]=h,f[p]={};else if(typeof h=="function")d[p]=h,f[p]={};else throw Error(`Action, ${p} , must be one of: object|string|function`)}),t(It.ADD_MESSAGE,{actions:f,title:i,message:s,type:n,displayType:a,time:o,closeButton:u});const c=e.messages.slice(-1)[0];return X1.set(c._uniqueId,d),c._uniqueId},[Jwe]({commit:t,state:e},r){const n=e.messages[r]||{};t(It.REMOVE_MESSAGE,r),X1.delete(n._uniqueId)},[Qwe]({dispatch:t,state:e},r){const n=e.messages.findIndex(a=>a._uniqueId===r);t(jl.CLEAR_MESSAGE,n)},[_V]({state:t,dispatch:e},{index:r,type:n}){try{const a={cancel:()=>e(jl.CLEAR_MESSAGE,r)},o=t.messages[r]||{};if(!o||!o._uniqueId)throw Error("message not found, failed to trigger action");const i=X1.get(o._uniqueId);if(!i)throw Error("message has no actions, failed to trigger action");const s=i[n];if(!s)throw Error(`message has no action of type ${n}`);let u=s;if(typeof s=="string"&&(u=a[s],!u))throw Error(`No predefined action of type ${s}`);if(typeof u!="function")throw Error("Unable to extract function from message action");return u(o)}catch(a){return this.handleError(a,{action:_V,actionPayload:arguments[1],retries:0})}},[Zwe]({commit:t},{view:e,settings:r}){t(It.SET_VIEW_SETTINGS,{view:e,settings:r})},[e1e]({commit:t}){t(It.RESET_VIEW_SETTINGS)},[t1e]({commit:t},e){t(It.SET_ERROR,e)},[r1e]({commit:t}){t(It.RESET_ERROR)}};function sm(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a1e(t,e){return i1e(t)||o1e(t,e)||s1e(t,e)||u1e()}function i1e(t){if(Array.isArray(t))return t}function o1e(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,a=!1,o=void 0;try{for(var i=t[Symbol.iterator](),s;!(n=(s=i.next()).done)&&(r.push(s.value),!(e&&r.length===e));n=!0);}catch(u){a=!0,o=u}finally{try{!n&&i.return!=null&&i.return()}finally{if(a)throw o}}return r}}function s1e(t,e){if(!!t){if(typeof t=="string")return bV(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bV(t,e)}}function bV(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
349
349
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wV(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return t.reduce(function(e,r){var n=r.split(".").slice(-1)[0];if(e[n])throw new Error("The key `".concat(n,"` is already in use."));return e[n]=r,e},{})}function l1e(t){return Object.keys(t).map(function(e){return[e,t[e]]})}function um(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var a=typeof r[0]=="string"?[].concat(r):[""].concat(r),o=a1e(a,4),i=o[0],s=o[1],u=o[2],l=o[3];return i.length&&i.charAt(i.length-1)!=="/"&&(i+="/"),u="".concat(i).concat(u||"getField"),l="".concat(i).concat(l||"updateField"),t(i,s,u,l)}}function lm(t){return function(e){return e.split(/[.[\]]+/).reduce(function(r,n){return r[n]},t)}}function Vl(t,e){var r=e.path,n=e.value;r.split(/[.[\]]+/).reduce(function(a,o,i,s){return s.length===i+1&&(a[o]=n),a[o]},t)}var d1e=um(function(t,e,r,n){var a=Array.isArray(e)?wV(e):e;return Object.keys(a).reduce(function(o,i){var s=a[i],u={get:function(){return this.$store.getters[r](s)},set:function(d){this.$store.commit(n,{path:s,value:d})}};return o[i]=u,o},{})}),c1e=um(function(t,e,r,n){var a=Array.isArray(e)?wV(e):e;return Object.keys(a).reduce(function(o,i){var s=a[i];return o[i]={get:function(){var l=this.$store,d=l1e(l.getters[r](s));return d.map(function(f){return Object.keys(f[1]).reduce(function(m,c){var p="".concat(s,"[").concat(f[0],"].").concat(c);return Object.defineProperty(m,c,{get:function(){return l.getters[r](p)},set:function(v){l.commit(n,{path:p,value:v})}})},{})})}},o},{})}),xV=function(e){var r,n=e.getterType,a=e.mutationType;return r={},sm(r,n,lm),sm(r,a,Vl),sm(r,"mapFields",um(function(o,i){return d1e(o,i,n,a)})),sm(r,"mapMultiRowFields",um(function(o,i){return c1e(o,i,n,a)})),r};const{SET_USER_LOCATION:f1e,SET_USER:m1e}=It,p1e={...{[f1e](t,e){t.user.position=e},[m1e](t,e){Object.keys(e).forEach(r=>{t.user[r]=e[r]})}},updateField:Vl,[It.SET_MODALS](t,e){ce.set(t,"modals",e)},[It.SET_CAN_CLOSE_MODAL](t,e){ce.set(t,"canCloseModal",e)},[It.ADD_MESSAGE](t,e){t.messages.push(bs(e))},[It.REMOVE_MESSAGE](t,e){ce.delete(t.messages,e)},[It.SET_VIEW_SETTINGS](t,{view:e,settings:r}){Object.keys(r).forEach(n=>{ce.set(t.viewSettings[e],n,r[n])})},[It.RESET_VIEW_SETTINGS](t,e){ce.set(t.viewSettings,e,JSON.parse(Y4.viewSettings[e]))},[It.SET_ERROR](t,e){t.error=e},[It.RESET_ERROR](t){t.error=null},[It.SET_SOCKET_CONNECTED](t,e){t.isSocketConnected=e}};var J1={exports:{}},h1e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Q1(t){this.message=t}Q1.prototype=new Error,Q1.prototype.name="InvalidCharacterError";function v1e(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new Q1("'atob' failed: The string to be decoded is not correctly encoded.");for(var r=0,n,a,o=0,i="";a=e.charAt(o++);~a&&(n=r%4?n*64+a:a,r++%4)?i+=String.fromCharCode(255&n>>(-2*r&6)):0)a=h1e.indexOf(a);return i}var g1e=typeof window<"u"&&window.atob&&window.atob.bind(window)||v1e,kV=g1e;function y1e(t){return decodeURIComponent(kV(t).replace(/(.)/g,function(e,r){var n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}var _1e=function(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return y1e(e)}catch{return kV(e)}},b1e=_1e;function zl(t){this.message=t}zl.prototype=new Error,zl.prototype.name="InvalidTokenError",J1.exports=function(t,e){if(typeof t!="string")throw new zl("Invalid token specified");e=e||{};var r=e.header===!0?0:1;try{return JSON.parse(b1e(t.split(".")[r]))}catch(n){throw new zl("Invalid token specified: "+n.message)}},J1.exports.InvalidTokenError=zl;const Fb=class{init({store:e}){this.store=e}getValidFeatures(){return Object.keys(Fb.schema)}_isValidAccountType(e){if(!e||ot(e)!=="array")throw new Error("Invalid param accountTypes");const{accountType:r}=this.store.getters["application/companyAccount"]||{};return e.includes(r)}_isValidFeatureKey(e){if(!e||ot(e)!=="string")throw new Error("Invalid param featureKey");const{CompanyFeatures:r}=this.store.getters["application/company"]||{};return r?r[e]:!1}_isValidCompanySetting(e){if(!e||ot(e)!=="string")throw new Error("Invalid param settingKey");return e.split("||").some(n=>{const a=this.store.getters["settings/getCompanySetting"](n);return typeof a=="boolean"&&a})}_isValidCompanyUserSettingFn({name:e,fn:r}){if(!e||ot(e)!=="string")throw new Error("Invalid param name");if(!r||ot(r)!=="function")throw new Error("Invalid param fn");const n=this.store.getters["settings/getCompanyUserSetting"](e);return!!r(n)}_isValidRegion(e){if(!e||ot(e)!=="string")throw new Error("Invalid param requiredRegion");const{region:r}=this.store.getters["application/company"]||{};return r?e===r:!1}_isValidBrand(e){if(!e||ot(e)!=="string")throw new Error("Invalid param requiredBrand");const r=this.store.$brand;return r?e===r:!1}_isCreatedBefore(e){if(!e||ot(e)!=="string")throw new Error("Invalid param feature dateString");const{createdAt:r}=this.store.getters["application/company"]||{};return r?Wse(r,e):!1}_evaluateFeature(e,{returnType:r="boolean"}={}){const n=Fb.schema[e];if(!n||ot(n)!=="object")throw Error(`No rules for feature '${e}' has been defined!`);if(!["boolean","array"].includes(r))throw Error("Invalid param returnType");const a=[];return n.accountTypes&&!this._isValidAccountType(n.accountTypes)&&(a.push("accountTypes"),r==="boolean")||n.featureKey&&!this._isValidFeatureKey(n.featureKey)&&(a.push("featureKey"),r==="boolean")||n.companySetting&&!this._isValidCompanySetting(n.companySetting)&&(a.push("companySetting"),r==="boolean")||n.companyUserSettingFn&&!this._isValidCompanyUserSettingFn(n.companyUserSettingFn)&&(a.push("companyUserSettingFn"),r==="boolean")||n.region&&!this._isValidRegion(n.region)&&(a.push("region"),r==="boolean")||n.brand&&!this._isValidBrand(n.brand)&&(a.push("brand"),r==="boolean")||n.createdBefore&&!this._isCreatedBefore(n.createdBefore)&&(a.push("preDynDoc2"),r==="boolean")?!1:r==="array"?a:!0}checkFeature(e){return this._evaluateFeature(e)}checkFeatureUpgrade(e){const r=this._evaluateFeature(e,{returnType:"array"});return r.length===1&&r.includes("accountTypes")}};let dm=Fb;Ut(dm,"schema",{personalMessage:{},unlimitedCertificates:{},companyAboutUs:{},winProfile:{},templates:{},invoice:{featureKey:"invoice"},sellInvoice:{featureKey:"sellInvoice"},timeTrack:{featureKey:"timeTrack"},task:{featureKey:"task"},reverseVat:{featureKey:"reverseVat"},ataSetting:{featureKey:"ataSetting"},propertyDesignation:{companySetting:"showRot||showGreenRot"},openAccConstruction:{featureKey:"openAccConstruction"},docChapterIsBinding:{companySetting:"showIsBinding"},projectSettingHideAllArticles:{companySetting:"allowHideAllArticles"},docAtaDateDelay:{companySetting:"docAtaShowDateDelay"},docAtaNotIncluded:{companySetting:"docAtaShowNotIncluded"},docAtaPayment:{companySetting:"docAtaShowPayment"},sms:{featureKey:"sms"},smsSenderName:{featureKey:"smsSenderName"},regionSE:{region:"SE"},bankId:{region:"SE",companySetting:"enableBankId"},templateGallery:{companyUserSettingFn:{name:"defaultLanguage",fn:e=>e==="sv"}},clientReview:{brand:"cling"},upgradeSignatureBankId:{companySetting:"upgradeSignatureBankId"},preDynDoc2:{createdBefore:"2020-11-05T00:00:00.000Z"},emailDomain:{featureKey:"emailDomain"},subdomain:{featureKey:"subdomain"},stats:{featureKey:"stats"},api:{featureKey:"api"},fortnox:{featureKey:"fortnox"},inviteCreators:{accountTypes:["base","pro"]}});const Fn=new dm,La=class{init({store:e}){this.store=e}_getObjectById(e,r){const n=(La.schema[r]||{}).$module,{data:a}=this.store.state[n]||{};if(!a)throw Error(`No module for ${r} has been defined!`);return a[e]}_getIdPath(e){return(La.schema[e]||{}).$id}_getAllowNullOwner(e){return!!(La.schema[e]||{}).$allowNullOwner}_getScopeKey(e){return(La.schema[e]||{}).$scopeKey}_getUserId(){const{user:e={}}=this.store.state.application;return e.userId}getValidScopes(){return Object.keys(La.schema)}getRequiredCompanyUserPermission(e,r){const n=La.schema[e];return!n||!n[r]?[]:Array.isArray(n[r])?n[r]:[n[r]]}hasFeature(e){const r=La.featureSchema[e];return r?Fn.checkFeature(r):!0}checkPermission(e,r,n=void 0){const{getters:a}=this.store,{CompanyUserPermission:o}=a["application/user"]||{};if(!o||!this.hasFeature(e))return!1;let s=this.getRequiredCompanyUserPermission(e,r);if(!s||s.length===0)return console.warn(`Permission ${r} in scope ${e} has not been implemented`),!1;let u=s.some(d=>o[d]===!0);if(u)return!0;if(!n)return!1;const l=this._getScopeKey(e);if(s=s.map(d=>d.includes("Own")?d:d.replace(`${l[0].toUpperCase()}${l.slice(1)}`,`Own${l[0].toUpperCase()}${l.slice(1)}`)),u=s.some(d=>o[d]===!0),u){const d=this._getObjectById(n,e);if(!d)return!1;if(e==="documents")return this.checkPermission("projects",r,d.projectId);const f=Jfe(d,this._getIdPath(e)),m=this._getAllowNullOwner(e);return f===this._getUserId()||m&&f===null}return!1}getScope(e={}){return this.getValidScopes().find(a=>e[a])}};let Ul=La;Ut(Ul,"schema",{projects:{read:"manageProjects",modify:"manageProjects",create:["manageProjects","manageOwnProjects"],delete:"manageProjects",readPrice:["manageProjects","showPrices"],$scopeKey:"projects",$module:"projects",$id:"CompanyUserId"},users:{modify:"manageUsers",create:"manageUsers",$scopeKey:"users",$module:"companyUsers",$id:"id"},documents:{create:["manageProjects","manageOwnProjects"],read:"manageProjects",modify:"manageProjects",delete:"manageProjects",readPrice:["manageProjects","showPrices"],$scopeKey:"projects",$module:"documents2",$id:"companyUserId"},atas:{create:["manageAtas","manageOwnAtas"],read:"manageAtas",modify:"manageAtas",delete:"manageAtas",readPrice:["manageAtas","showPrices"],$scopeKey:"atas",$module:"documents",$id:"data.CompanyUserId"},company:{create:"manageCompany",read:"manageCompany",modify:"manageCompany",$scopeKey:"company",$module:"companies",$id:"id"},articles:{create:["manageProjects","manageOwnProjects"],modify:["manageProjects","manageOwnProjects"],delete:["manageProjects","manageOwnProjects"],readPrice:["manageOwnAtas","manageAtas","manageProjects","manageOwnProjects","showPrices"],$scopeKey:"projects",$module:"articles",$id:"id"},invoices:{read:["readInvoices","readOwnInvoices"],modify:"modifyInvoices",create:"createInvoices",delete:"deleteInvoices",attest:"attestInvoices",$scopeKey:"invoices",$module:"invoices",$id:"CompanyUserId"},bookkeeping:{modify:"modifyBookkeepingSettings",export:"exportInvoices"},prices:{read:"showPrices"},timeTracks:{read:["readTimeTracks","readOwnTimeTracks"],modify:"modifyTimeTracks",create:"createTimeTracks",delete:["deleteTimeTracks","deleteOwnTimeTracks"],attest:"attestTimeTracks",$scopeKey:"timeTracks",$module:"timeTracks",$id:"CompanyUserId"},templates:{create:"createTemplates",read:"readTemplates",modify:"modifyTemplates",delete:"deleteTemplates"},endCustomers:{read:["readEndCustomers","readOwnEndCustomers"],modify:"modifyEndCustomers",create:"createEndCustomers",delete:"deleteEndCustomers",$scopeKey:"endCustomers",$module:"endCustomers",$id:"CompanyUserId",$allowNullOwner:!0},fortnox:{export:"modifyBookkeepingSettings"}}),Ut(Ul,"featureSchema",{invoices:"invoice",bookkeeping:"invoice",timeTracks:"timeTrack"});const io=new Ul,w1e={...{userPosition:t=>t.user.position,isLoggingIn:t=>t.user.isLoggingIn,isSuperUser:()=>()=>{const t=Ze.getItem("token");if(!t)return!1;const{employee:e}=J1.exports(t);return!!e},isRegistering:t=>t.user.isRegistering,isResettingPassword:t=>t.user.isResettingPassword,crispUserHash:t=>t.user.crispUserHash,isUserLoaded:({user:t})=>t.userId&&t.companyId&&!0||!1,company:({user:t},e,r,n)=>n["companies/companyById"](t.companyId),companyAccount:({user:t},e,r,n)=>(n["companies/companyById"](t.companyId)||{}).CompanyAccount||null,companyAccountType:(t,e)=>(e.companyAccount||{}).accountType||null,companyRegion:(t,e)=>(e.company||{}).region||(Me.brand==="docspo"?"US":"SE"),subscription:(t,e)=>{const{companyAccount:r={}}=e;if(!r)return{};const{freePremiumDays:n=null,accountType:a=null,maxProjectManagers:o=null,freeDocumentsLeft:i=null,paymentMethod:s,billingCycleInterval:u,billingCycleCount:l,showCalloutConvertStripe:d,hasExceededQuota:f,StripeSubscriptions:m,mrr:c,hasFailedPayments:p,allowFailedPaymentToConvertStripe:h}=r,v=[...new Set([...m.map(b=>b.status)])],g=m.some(b=>(b.stripeItems||[]).some(k=>k.stripePriceStripeId.startsWith("plan_"))),_=W0.includes(a)&&d&&s==="invoice"&&te(r,"documentQuota.newCount")===1e3&&!te(r,"premiumEndAt");return{type:a,trialDaysLeft:n,maxProjectManagers:o,freeDocumentsLeft:i,paymentMethod:s,billingCycleInterval:u,billingCycleCount:l,showCalloutConvertStripe:W0.includes(a)&&d&&s==="invoice",stripeStatuses:v,isPaying:W0.includes(a),hasExceededQuota:f,isStripeLegacy:g,isInvoiceLegacy:_,mrr:c,hasFailedPayments:p,allowFailedPaymentToConvertStripe:h}},user:({user:t},e,r,n)=>n["companyUsers/referenceById"](t.userId),isQualified:(t,{user:e,companyAccount:r})=>!r||!e||typeof e.isQualified!="boolean"?!0:e.isQualified||!["free","trial","premiumTrial"].includes(r.accountType),feature:()=>Fn.checkFeature.bind(Fn),can:()=>io.checkPermission.bind(io)},getField:lm,modals:t=>t.modals,messages:t=>t.messages,isIncVat:t=>t.priceInputVat==="incVat",viewSettings:t=>e=>t.viewSettings[e],showSearch:t=>t.viewSettings.search.show,error:t=>t.error,isSocketConnected:t=>t.isSocketConnected},x1e={namespaced:!0,state:Y4,getters:w1e,actions:n1e,mutations:p1e},k1e={data:{},ids:[],isFetching:!1,isPosting:!1},De={application:It,projects:Lr,forms:Wn,files:Y1,settings:lV,certificates:hwe,companies:H1,companyReferences:gwe,companyReferenceItems:_we,documents2:B1,invoices:Owe,timeTracks:Dwe,templates:K1,publicDocuments:$we,documentTerms:Rwe,notifications:xwe,unitTypes:Nwe,CLEAR_FORM:"CLEAR_FORM",DELETE_ARTICLE:"DELETE_ARTICLE",DELETE_COMPANY_USER:"DELETE_COMPANY_USER",DELETE_CONTRACT:"DELETE_CONTRACT",DELETE_ENDCUSTOMER:"DELETE_ENDCUSTOMER",DELETE_PROJECT:"DELETE_PROJECT",DELETE_PROJECT_FILE:"DELETE_PROJECT_FILE",DELETE_TEMPLATE_MESSAGE:"DELETE_TEMPLATE_MESSAGE",SET_ARTICLES:"SET_ARTICLES",SET_ATAS:"SET_ATAS",SET_COMPANY_USERS:"SET_COMPANY_USERS",SET_CONTRACTS:"SET_CONTRACTS",SET_ENDCUSTOMERS:"SET_ENDCUSTOMERS",SET_FORM:"SET_FORM",SET_NOTIFICATIONS:"SET_NOTIFICATIONS",SET_OFFERS:"SET_OFFERS",SET_PROJECTS:"SET_PROJECTS",SET_PROJECT_FILES:"SET_PROJECT_FILES",UPDATE_COMPANY:"UPDATE_COMPANY"};function PV(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function TV(t,e,r){return e&&PV(t.prototype,e),r&&PV(t,r),t}function jn(){return jn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},jn.apply(this,arguments)}function Z1(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function Hl(t){return!!(t&&typeof t.hasOwnProperty=="function"&&(t.hasOwnProperty("__ownerID")||t._map&&t._map.hasOwnProperty("__ownerID")))}function MV(t,e,r){return Object.keys(t).reduce(function(n,a){var o=""+a;return n.has(o)?n.set(o,r(n.get(o),t[o])):n},e)}var P1e=function(e){return function(r){return Hl(r)?r.get(e):r[e]}},T1e=function(){function t(r,n,a){if(n===void 0&&(n={}),a===void 0&&(a={}),!r||typeof r!="string")throw new Error("Expected a string key for Entity, but found "+r+".");var o=a,i=o.idAttribute,s=i===void 0?"id":i,u=o.mergeStrategy,l=u===void 0?function(p,h){return jn({},p,h)}:u,d=o.processStrategy,f=d===void 0?function(p){return jn({},p)}:d,m=o.fallbackStrategy,c=m===void 0?function(p,h){}:m;this._key=r,this._getId=typeof s=="function"?s:P1e(s),this._idAttribute=s,this._mergeStrategy=l,this._processStrategy=f,this._fallbackStrategy=c,this.define(n)}var e=t.prototype;return e.define=function(n){this.schema=Object.keys(n).reduce(function(a,o){var i,s=n[o];return jn({},a,(i={},i[o]=s,i))},this.schema||{})},e.getId=function(n,a,o){return this._getId(n,a,o)},e.merge=function(n,a){return this._mergeStrategy(n,a)},e.fallback=function(n,a){return this._fallbackStrategy(n,a)},e.normalize=function(n,a,o,i,s,u){var l=this,d=this.getId(n,a,o),f=this.key;if(f in u||(u[f]={}),d in u[f]||(u[f][d]=[]),u[f][d].some(function(c){return c===n}))return d;u[f][d].push(n);var m=this._processStrategy(n,a,o);return Object.keys(this.schema).forEach(function(c){if(m.hasOwnProperty(c)&&typeof m[c]=="object"){var p=l.schema[c],h=typeof p=="function"?p(n):p;m[c]=i(m[c],m,c,h,s,u)}}),s(this,m,n,a,o),d},e.denormalize=function(n,a){var o=this;return Hl(n)?MV(this.schema,n,a):(Object.keys(this.schema).forEach(function(i){if(n.hasOwnProperty(i)){var s=o.schema[i];n[i]=a(n[i],s)}}),n)},TV(t,[{key:"key",get:function(){return this._key}},{key:"idAttribute",get:function(){return this._idAttribute}}]),t}(),ex=function(){function t(r,n){n&&(this._schemaAttribute=typeof n=="string"?function(a){return a[n]}:n),this.define(r)}var e=t.prototype;return e.define=function(n){this.schema=n},e.getSchemaAttribute=function(n,a,o){return!this.isSingleSchema&&this._schemaAttribute(n,a,o)},e.inferSchema=function(n,a,o){if(this.isSingleSchema)return this.schema;var i=this.getSchemaAttribute(n,a,o);return this.schema[i]},e.normalizeValue=function(n,a,o,i,s,u){var l=this.inferSchema(n,a,o);if(!l)return n;var d=i(n,a,o,l,s,u);return this.isSingleSchema||d===void 0||d===null?d:{id:d,schema:this.getSchemaAttribute(n,a,o)}},e.denormalizeValue=function(n,a){var o=Hl(n)?n.get("schema"):n.schema;if(!this.isSingleSchema&&!o)return n;var i=this.isSingleSchema?void 0:Hl(n)?n.get("id"):n.id,s=this.isSingleSchema?this.schema:this.schema[o];return a(i||n,s)},TV(t,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),t}(),M1e=function(t){Z1(e,t);function e(n,a){if(!a)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return t.call(this,n,a)||this}var r=e.prototype;return r.normalize=function(a,o,i,s,u,l){return this.normalizeValue(a,o,i,s,u,l)},r.denormalize=function(a,o){return this.denormalizeValue(a,o)},e}(ex),S1e=function(t){Z1(e,t);function e(){return t.apply(this,arguments)||this}var r=e.prototype;return r.normalize=function(a,o,i,s,u,l){var d=this;return Object.keys(a).reduce(function(f,m,c){var p,h=a[m];return h!=null?jn({},f,(p={},p[m]=d.normalizeValue(h,a,m,s,u,l),p)):f},{})},r.denormalize=function(a,o){var i=this;return Object.keys(a).reduce(function(s,u){var l,d=a[u];return jn({},s,(l={},l[u]=i.denormalizeValue(d,o),l))},{})},e}(ex),O1e=function(e){var r=Array.isArray(e);if(r&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},SV=function(e){return Array.isArray(e)?e:Object.keys(e).map(function(r){return e[r]})},E1e=function(e,r,n,a,o,i,s){e=O1e(e);var u=SV(r);return u.map(function(l,d){return o(l,n,a,e,i,s)})},D1e=function(t){Z1(e,t);function e(){return t.apply(this,arguments)||this}var r=e.prototype;return r.normalize=function(a,o,i,s,u,l){var d=this,f=SV(a);return f.map(function(m,c){return d.normalizeValue(m,o,i,s,u,l)}).filter(function(m){return m!=null})},r.denormalize=function(a,o){var i=this;return a&&a.map?a.map(function(s){return i.denormalizeValue(s,o)}):a},e}(ex),OV=function(e,r,n,a,o,i,s){var u=jn({},r);return Object.keys(e).forEach(function(l){var d=e[l],f=typeof d=="function"?d(r):d,m=o(r[l],r,l,f,i,s);m==null?delete u[l]:u[l]=m}),u},C1e=function(e,r,n){if(Hl(r))return MV(e,r,n);var a=jn({},r);return Object.keys(e).forEach(function(o){a[o]!=null&&(a[o]=n(a[o],e[o]))}),a},$1e=function(){function t(r){this.define(r)}var e=t.prototype;return e.define=function(n){this.schema=Object.keys(n).reduce(function(a,o){var i,s=n[o];return jn({},a,(i={},i[o]=s,i))},this.schema||{})},e.normalize=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return OV.apply(void 0,[this.schema].concat(a))},e.denormalize=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return C1e.apply(void 0,[this.schema].concat(a))},t}(),A1e=function t(e,r,n,a,o,i){if(typeof e!="object"||!e)return e;if(typeof a=="object"&&(!a.normalize||typeof a.normalize!="function")){var s=Array.isArray(a)?E1e:OV;return s(a,e,r,n,t,o,i)}return a.normalize(e,r,n,t,o,i)},R1e=function(e){return function(r,n,a,o,i){var s=r.key,u=r.getId(a,o,i);s in e||(e[s]={});var l=e[s][u];l?e[s][u]=r.merge(l,n):e[s][u]=n}},Se={Array:D1e,Entity:T1e,Object:$1e,Union:M1e,Values:S1e},EV=function(e,r){if(!e||typeof e!="object")throw new Error('Unexpected input given to normalize. Expected type to be "object", found "'+(e===null?"null":typeof e)+'".');var n={},a=R1e(n),o={},i=A1e(e,e,null,r,a,o);return{entities:n,result:i}};const Vs=new Se.Entity("files");new Se.Array(Vs);const DV=new Se.Entity("projectFiles",{File:Vs});new Se.Array(DV);const tx=new Se.Entity("companyUsers");new Se.Array(tx);const rx=new Se.Entity("offers",{Files:[Vs]});new Se.Array(rx);const CV=new Se.Entity("atas",{Files:[Vs]});new Se.Array(CV);const nx=new Se.Entity("projects",{CompanyUser:tx,ProjectMembers:[tx],ProjectFiles:[DV]});CV.define({Project:nx});const I1e=new Se.Array(nx),N1e=new Se.Entity("articles");new Se.Array(N1e);const $V=new Se.Entity("certificates");new Se.Array($V);const L1e=new Se.Entity("companies",{CompanyCertificates:[$V]}),W1e=new Se.Array(L1e),AV=new Se.Entity("companyReferenceItems",{Image:Vs,Thumbnail:Vs});new Se.Array(AV);const F1e=new Se.Entity("companyReferences",{CompanyReferenceItems:[AV]});new Se.Array(F1e);const RV=new Se.Entity("contracts",{Offer:rx});new Se.Array(RV),rx.define({Contract:RV}),new Se.Entity("endCustomers");const j1e=new Se.Entity("notifications",{Project:nx});new Se.Array(j1e);const V1e=new Se.Entity("propertyDesignations");new Se.Array(V1e);const z1e=new Se.Entity("templateMessages");new Se.Array(z1e);const ql="companies",{LOAD_FILE:Sft,FORM_RESET_OLD:IV}=Oe,{SET_FORM:ax}=De.forms,{DO_LOAD_CURRENT_COMPANY:cm,DO_NORMALIZE_COMPANIES:NV,DO_UPDATE_CURRENT_COMPANY:LV,FORM_EDIT_COMPANY:U1e,FORM_SUBMIT_COMPANY:WV,FORM_NEW_COMPANY_BRANDING:FV,FORM_EDIT_COMPANY_BRANDING:ix,FORM_SUBMIT_COMPANY_BRANDING:jV,UPDATE_COMPANY_ACCOUNT_TYPE:VV}=tV,{SET_COMPANIES_FETCHING:ox,SET_COMPANIES_POSTING:ga}=H1,H1e={async[NV](t,{companies:e=[]}){if(!e||!Array.isArray(e)||!e.length)throw new Error("Missing param companies");await this.dispatch(ao,{data:e,schema:W1e})},async[cm]({commit:t,dispatch:e}){var r;try{t(ox,!0);const{data:n}=await cr.get("/company");return await e(NV,{companies:[n]}),await((r=this.$supportChat)==null?void 0:r.syncData()),t(ox,!1),n}catch(n){throw t(ox,!1),n}},async[LV]({dispatch:t,commit:e},{body:r}){try{e(ga,!0),await cr.put("/company",r);const n=await t(cm);return e(ga,!1),n}catch(n){throw e(ga,!1),n}},async[VV]({dispatch:t,commit:e},{accountType:r,billingCycleCost:n,billingCycleInterval:a,billingCycleCount:o,premiumSource:i=null,quantity:s}){try{if(e(ga,!0),!r)throw new Error("Missing parameter accountType");if(a&&!o)throw new Error("Param billingCycleCount is required if billingCycleInterval is used");if(!a&&o)throw new Error("Param billingCycleInterval is required if billingCycleCount is used");if((a||o)&&typeof n>"u")throw new Error("Param billingCycleCost is missing");const u={premiumSource:i};return a&&o&&n&&(u.billingCycleInterval=a,u.billingCycleCount=o,u.billingCycleCost=n),typeof s<"u"&&(u.quantity=s),await ope(r,u),await t(cm),e(ga,!1),!0}catch(u){return this.handleError(u,{object:"companyAccount",action:`${ql}/${VV}`}),!1}finally{e(ga,!1)}},async[U1e]({rootGetters:t},{props:e=[]}={}){try{const r=pa(t["application/company"],e);return this.commit(`forms/${ax}`,{key:"company",formData:r}),!0}catch(r){return this.handleError(r),!1}},async[WV]({rootGetters:t,dispatch:e}){try{const r=t["forms/getFormByKey"]("company");return await e(LV,{body:r}),await this.dispatch(IV,"company"),!0}catch(r){return this.handleError(r,{object:"companies",fallbackCode:"companies.submit",action:`${ql}/${WV}`}),!1}},async[FV]({rootGetters:t,dispatch:e}){try{const{CompanyBranding:r}=t["application/company"];if(r&&r.id)return e(ix);const n={about:""};return this.commit(`forms/${ax}`,{key:"companyBranding",formData:n}),!0}catch(r){return this.handleError(r,{object:"companies",action:`${ql}/${FV}`}),!1}},async[ix]({rootGetters:t}){try{const{CompanyBranding:e}=t["application/company"],r=e;return this.commit(`forms/${ax}`,{key:"companyBranding",formData:r}),!0}catch(e){return this.handleError(e,{object:"companies",action:`${ql}/${ix}`}),!1}},async[jV]({rootGetters:t,dispatch:e,commit:r}){try{r(ga,!0);const n=t["forms/getFormByKey"]("companyBranding");let{id:a}=n;return a?await cr.put("/companyBranding",n):{id:a}=await cr.post("/companyBranding",n),e(cm),r(ga,!1),await this.dispatch(IV,"companyBranding"),a}catch(n){return r(ga,!1),this.handleError(n,{object:"companies",fallbackCode:"companies.submit",action:`${ql}/${jV}`}),!1}}},ni=new Se.Entity("files"),q1e=new Se.Array(ni),fm=new Se.Entity("companyUsers"),zV=new Se.Array(fm),UV=new Se.Entity("companies"),B1e=new Se.Array(UV),oo=new Se.Entity("invoices");oo.define({InvoiceFiles:[{File:ni,Thumbnail:ni}],creditInvoices:[oo],creditsInvoice:oo,interestInvoices:[oo],interestForInvoice:oo});const sx=new Se.Array(oo),Y1e=new Se.Entity("documents",{data:{Files:q1e,Invoices:sx}}),G1e=new Se.Array(Y1e),HV=new Se.Entity("projectFiles",{File:ni}),K1e=new Se.Array(HV),ux=new Se.Entity("projects",{ProjectMembers:zV,ProjectFiles:[{File:ni}],Invoices:sx,CompanyUser:fm}),X1e=new Se.Array(ux),J1e=new Se.Entity("timeTracks",{CompanyUser:fm,Project:ux}),Q1e=new Se.Array(J1e),qV=new Se.Entity("companyReference",{CompanyReferenceItem:{Image:ni,Thumbnail:ni}}),Z1e=new Se.Array(qV),BV=new Se.Entity("documentTerms",{File:ni}),exe=new Se.Array(BV),txe={project:ux,projects:X1e,invoice:oo,invoices:sx,companyReference:qV,companyReferences:Z1e,projectFile:HV,projectFiles:K1e,documents:G1e,companyUser:fm,companyUsers:zV,company:UV,companies:B1e,timeTracks:Q1e,documentTerm:BV,documentTerms:exe},rxe=(t,e)=>{const r=txe[e];return r||console.warn(`No schema found for type: '${e}'`),EV(t,r)};function so(t,e,r=!1){let n=e.replace(/\[(\d*)\]/ig,(i,s)=>`.${s}`);n=n.split(".");let a=t;const o=n.pop();return n.length>0&&(a=n.reduce((i,s)=>{let u=i[s];return r&&(ot(u)==="undefined"||ot(u)==="null")&&(ce.set(i,s,{}),u=i[s]),u},t)),{root:a,prop:o}}function zs(t,e){function r(n,a){Object.keys(a).forEach(o=>{const i=n[o]instanceof Object&&!Array.isArray(n[o]),s=a[o]instanceof Object&&!Array.isArray(a[o]);if(i&&s){zs(n[o],a[o]);return}ce.set(n,o,a[o])})}r(t,e)}function Bl(t,{keyId:e="id"}={}){const r=[],n={};return t.forEach(a=>{n[a[e]]=a,r.push(a[e])}),{ids:r,values:n}}function YV({schema:t,getters:e,data:r,scope:n=null,instance:a=null}){let o=n;typeof o=="string"&&(o=[o]);const i={};return t&&Object.keys(t).map(s=>(t[s].$virtual&&t[s].$virtual.map(u=>{const{name:l,set:d}=u;let f={};if(r&&typeof r[s]<"u"?f=r[s]:typeof t[s].$default<"u"&&(f=t[s].$default),typeof f>"u")return!1;const m=a||this;return i[l]=d.call(m,f,{getters:e}),!0}),!0)),t&&o&&Array.isArray(o)&&Object.keys(t).map(s=>t[s].$scope?(o.some(l=>t[s].$scope.indexOf(l)>=0)||delete i[s],!0):(delete i[s],!0)),JSON.parse(JSON.stringify(i))}function nxe({schema:t,data:e,getters:r,scope:n=null,includeVirtual:a=!1,instance:o=null}){let i=n;if(typeof i=="string"&&(i=[i]),!t)throw new Error("Missing parameter schema");const s={};Object.keys(t).map(l=>(t[l].$default!=="undefined"&&(s[l]=t[l].$default),!0));let u=Object.assign({},s,e);return a&&(u={...u,...YV({schema:t,getters:r,data:e,scope:n,instance:o})}),t&&i&&Array.isArray(i)&&Object.keys(t).map(l=>t[l].$scope?(i.some(f=>t[l].$scope.indexOf(f)>=0)||delete u[l],!0):(delete u[l],!0)),JSON.parse(JSON.stringify(u))}function GV({next:t=null,projectId:e,docType:r,docId:n,invoiceId:a}={},o,i=void 0){if(!t||!o)return!1;switch(t){case"project":{if(!e)throw new Ni(`Cannot redirect user on next: '${t}' as no projectId is defined`);o.push({name:"project",params:{id:e,modal:!1}},i);break}case"invoice":{if(!a)throw new Ni(`Cannot redirect user on next: '${t}' as no invoiceId is defined`);o.push({name:"invoice",params:{id:a,modal:!1}},i);break}case"preview":{if(a){o.push({name:"previewInvoice",params:{id:a}},i);break}if(!e)throw new Ni(`Cannot redirect user on next: '${t}' as no projectId is defined`);if(!r)throw new Ni(`Cannot redirect user on next: '${t}' as no docType is defined`);if(!n)throw new Ni(`Cannot redirect user on next: '${t}' as no docId is defined`);o.push({name:"Preview",params:{projectId:e,docType:r,docId:n}},i);break}default:throw new Ni(`Cannot redirect user on next: '${t}' as it is not implemented`)}return!0}const{SET_COMPANIES:axe,CLEAR_COMPANIES:ixe,SET_COMPANIES_FETCHING:oxe,SET_COMPANIES_POSTING:sxe}=H1,uxe={[axe](t,{data:e}){if(typeof e!="object")throw Error("Data must be a company or an array of companies!");const r=Array.isArray(e)?e:[e],{ids:n,values:a}=Bl(r);zs(t.data,a),t.ids=Xi([...n,...t.ids])},[ixe](t){ce.set(t,"data",{}),ce.set(t,"ids",[])},[oxe](t,e){t.isFetching=e},[sxe](t,e){t.isPosting=e}},lxe={namespaced:!0,state:k1e,getters:{companyById:t=>e=>t.data[e],certificateIdListForCurrentCompany:(t,e,r)=>()=>e.certificateIdListForCompany(r.application.user.companyId),certificateIdListForCompany:t=>e=>{const r=t.data[e].CompanyCertificates;return r||[]},isFetching:t=>t.isFetching,isPosting:t=>t.isPosting},actions:H1e,mutations:uxe},dxe={data:{},ids:[],isFetching:!1,isPosting:!1},ai="companyUsers",{LOAD_COMPANY_USERS:KV,LOAD_COMPANY_USER:mm,DO_NORMALIZE_COMPANY_USERS:pm,UPDATE_COMPANY_USER:lx,CREATE_COMPANY_USER:dx,DELETE_COMPANY_USER:XV,PATCH_COMPANY_USER:cx,FORM_NEW_COMPANY_USER:cxe,FORM_EDIT_COMPANY_USER:fxe,FORM_SUBMIT_COMPANY_USER:JV}=rV,{SET_AS_NORMALIZED_DATA:mxe,FORM_RESET_OLD:pxe,DELETE_FILE:hxe}=Oe,{SET_COMPANY_USERS_FETCHING:hm,SET_COMPANY_USERS_POSTING:ii}=q1,vxe={async[pm](t,{companyUsers:e=[]}){if(!e||!Array.isArray(e)||!e.length)throw new Error("Missing param companyUsers");await this.dispatch(mxe,{data:e,schema:"companyUsers"})},async[KV]({dispatch:t,commit:e}){try{e(hm,!0);const{data:r}=await epe();await t(pm,{companyUsers:r})}catch(r){this.handleError(r,{object:"companyUser",fallbackCode:"companyUser.getAll",action:`${ai}/${KV}`})}finally{e(hm,!1)}},async[mm]({commit:t,dispatch:e,rootGetters:r},{id:n}){try{t(hm,!0);const{data:a}=await tpe(n);await e(pm,{companyUsers:[a]});const{id:o}=r["application/user"]||{};return n===o&&(be.locale!==a.locale&&be.l10n.changeLocale(a.locale),be.lang!==a.language&&(be.i18next.changeLanguage(a.language),location&&location.reload())),n}catch(a){return this.handleError(a,{object:"companyUser",objectId:n,fallbackCode:"companyUser.get",action:`${ai}/${mm}`,actionPayload:arguments[1]}),null}finally{t(hm,!1)}},async[dx]({commit:t,dispatch:e,rootGetters:r},{body:n}){try{const{language:a,locale:o}=r["application/user"]||{},i={language:a||"en",locale:o||"en-US",...n};t(ii,!0);const{data:s}=await rpe(i);return await e(pm,{companyUsers:[s]}),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:be.t("sentThingTo",{thing:be.t("invitation"),recipient:s.email})}),s.id}catch(a){return this.handleError(a,{object:"companyUser",fallbackCode:"companyUser.post",action:`${ai}/${dx}`,actionPayload:arguments[1]}),null}finally{t(ii,!1)}},async[lx]({dispatch:t,commit:e,getters:r},{id:n,body:a}){var o;try{e(ii,!0);const{AvatarPublicId:i}=a,{AvatarPublicId:s}=r.byId(n);return i&&i!==s&&this.dispatch(hxe,{id:s}),await npe(n,a),await t(mm,{id:n}),(o=this.$supportChat)==null||o.syncData(),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:be.t("updatedThing",{thing:be.t("user")})}),n}catch(i){return this.handleError(i,{object:"companyUser",objectId:n,fallbackCode:"companyUser.put",action:`${ai}/${lx}`,actionPayload:arguments[1]}),null}finally{e(ii,!1)}},async[XV]({commit:t},{id:e}){try{return t(ii,!0),await ape(e),t(q1.DELETE_COMPANY_USER,e),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:be.t("removedThing",{thing:be.t("user")}),actions:{undo:()=>{this.dispatch(`${ai}/${cx}`,{id:e})}}}),e}catch(r){return this.handleError(r,{object:"companyUser",objectId:e,fallbackCode:"companyUser.delete",action:`${ai}/${XV}`,actionPayload:arguments[1]}),null}finally{t(ii,!1)}},async[cx]({dispatch:t,commit:e},{id:r}){try{return e(ii,!0),await ipe(r),await t(mm,{id:r}),r}catch(n){return this.handleError(n,{object:"companyUser",objectId:r,fallbackCode:"companyUser.patch",action:`${ai}/${cx}`,actionPayload:arguments[1]}),null}finally{e(ii,!1)}},[cxe]({commit:t,rootGetters:e}){let r="en";const n=e["application/user"];n.language&&({language:r}=n);const a={AvatarPublicId:null,CompanyId:null,CompanyUserPermission:{manageCompany:!1,manageUsers:!1,manageProjects:!1,manageOwnProjects:!1,showPrices:!1,manageAtas:!1,manageOwnAtas:!1,createTimeTracks:!0,readTimeTracks:!1,readOwnTimeTracks:!0,modifyTimeTracks:!1,modifyOwnTimeTracks:!0,deleteTimeTracks:!1,deleteOwnTimeTracks:!0,attestTimeTracks:!1,createInvoices:!1,readInvoices:!1,readOwnInvoices:!1,modifyInvoices:!1,modifyOwnInvoices:!1,deleteInvoices:!1,deleteOwnInvoices:!1,attestInvoices:!1,attestOwnInvoices:!1,exportInvoices:!1,modifyBookkeepingSettings:!1},cellphone:null,email:null,finishedGuide:!1,firstname:null,id:null,language:r,lastActive:null,lastname:null,resetPasswordExpires:null,resetPasswordToken:null};return t(`forms/${De.SET_FORM}`,{key:"companyUser",formData:a},{root:!0})},[fxe]({commit:t,getters:e},{id:r,props:n=[]}){const a=pa(e.byId(r),n);return t(`forms/${De.SET_FORM}`,{key:"companyUser",formData:a},{root:!0})},async[JV]({rootGetters:t,dispatch:e}){try{const r=t["forms/getFormByKey"]("companyUser");let{id:n}=r;return n?await e(lx,{id:r.id,body:r}):n=await e(dx,{body:r}),await this.dispatch(pxe,"companyUser"),!0}catch(r){return this.handleError(r,{object:"companyUser",action:`${ai}/${JV}`,actionPayload:arguments[1]}),!1}}},{SET_COMPANY_USERS:gxe,DELETE_COMPANY_USER:yxe,CLEAR_COMPANY_USERS:_xe,SET_COMPANY_USERS_FETCHING:bxe,SET_COMPANY_USERS_POSTING:wxe}=q1,xxe={[gxe](t,{data:e=[]}){if(typeof e!="object")throw Error("Data must be a company user or an array of company users!");const r=Array.isArray(e)?e:[e],{ids:n,values:a}=Bl(r);zs(t.data,a),t.ids=Xi([...n,...t.ids])},[yxe](t,e){ce.delete(t.data,e);const r=t.ids.indexOf(e);r!==-1&&t.ids.splice(r,1)},[_xe](t){ce.set(t,"data",{}),ce.set(t,"ids",[])},[bxe](t,e){t.isFetching=e},[wxe](t,e){t.isPosting=e}},kxe={namespaced:!0,state:dxe,getters:{referenceById:t=>e=>t.data[e],byId:t=>e=>{const r=t.data[e];if(!r)return null;const{firstname:n,lastname:a}=r;return{...r,fullName:`${n||""} ${a||""}`.trim(),role:ome(r.CompanyUserPermission),avatarUrl:`${Me.api.baseUrl}/file/${r.AvatarPublicId}/download`}},all:(t,e)=>{const r={};return t.ids.forEach(n=>{r[n]=e.byId(n)}),r},isPosting:t=>t.isPosting,isFetching:t=>t.isFetching},actions:vxe,mutations:xxe},Pxe={...{invoice:{},isFetchingInvoice:!1,isPostingInvoice:!1},companyUser:{},company:{},isFetching:!1,isPosting:!1},vm="settings",{FORM_RESET_OLD:Txe}=Oe,{DO_LOAD_INVOICE_SETTINGS:fx,LOAD_INVOICE_SETTINGS:QV,DO_UPDATE_INVOICE_SETTINGS:mx,UPDATE_INVOICE_SETTINGS:ZV,FORM_EDIT_INVOICE_SETTINGS:ez,FORM_SUBMIT_INVOICE_SETTINGS:tz}=sV,{SET_INVOICE_SETTINGS_FETCHING:rz,SET_INVOICE_SETTINGS_POSTING:nz}=G1,{SET_SETTINGS:Mxe}=De.settings,{SET_FORM:Sxe}=De.forms,Oxe={async[fx]({commit:t}){try{t(rz,!0);const{data:e}=await lpe();t(Mxe,{key:"invoice",settings:e})}catch(e){throw e}finally{t(rz,!1)}},async[QV]({dispatch:t}){try{await t(fx)}catch(e){this.handleError(e,{object:"companySettings",fallbackCode:"settings.get",action:`${vm}/${QV}`})}},async[mx]({dispatch:t,commit:e},{data:r}){try{e(nz,!0),await dpe(r),t(fx)}catch(n){throw n}finally{e(nz,!1)}},async[ZV]({dispatch:t},{data:e}){try{return await t(mx,{data:e}),!0}catch(r){return this.handleError(r,{object:"setting",fallbackCode:"settings.put",action:`${vm}/${ZV}`,actionPayload:arguments[1]}),!1}},async[ez]({commit:t,state:e},{props:r=[]}={}){try{const n=pa(e.invoice,r);return t(`forms/${Sxe}`,{key:"companyInvoiceSettings",formData:n},{root:!0}),!0}catch(n){return this.handleError(n,{object:"setting",fallbackCode:"setting.editInvoice",action:`${vm}/${ez}`,actionPayload:arguments[1]}),!1}},async[tz]({rootGetters:t,dispatch:e}){try{const r=t["forms/getFormByKey"]("companyInvoiceSettings"),{invoicePaymentAccountType:n}=r;return n==="bankgiro"?(r.invoicePaymentDomesticClearingNo=null,r.invoicePaymentDomesticAccountNo=null):n==="domesticBankAcc"&&(r.invoicePaymentBankGiro=null),await e(mx,{data:r}),await this.dispatch(Txe,"companyInvoiceSettings"),!0}catch(r){return this.handleError(r,{object:"setting",fallbackCode:"setting.submitInvoice",action:`${vm}/${tz}`}),!1}}},oi="settings",{FORM_RESET_OLD:az,DO_LOAD_INVOICE_SETTINGS:Exe}=Oe,{DO_LOAD_ALL_SETTINGS:iz,LOAD_ALL_SETTINGS:oz,DO_LOAD_SETTINGS_COMPANY:gm,LOAD_SETTINGS_COMPANY:sz,LOAD_SETTINGS_COMPANYUSER:uz,UPDATE_SETTINGS:lz,DO_UPDATE_SETTINGS:Yl,FORM_EDIT_COMPANY_SETTINGS:dz,DO_LOAD_SETTINGS_COMPANYUSER:ym,FORM_SUBMIT_COMPANY_SETTINGS:cz,FORM_EDIT_COMPANY_USER_SETTINGS:fz,FORM_SUBMIT_COMPANY_USER_SETTINGS:mz}=uV,{SET_SETTINGS:px,SET_SETTINGS_FETCHING:_m,SET_SETTINGS_POSTING:pz}=De.settings,{SET_FORM:hz}=De.forms,vz=["ataTravel"],Dxe=["extraWorkPrice","extraWorkManagementPrice","extraEntrepreneurPercentage","extraOtherPercentage"],gz=t=>{const e=t;return Object.keys(e).forEach(r=>{vz.includes(r)&&e[r]==="0"?e[r]="":e[r]==="true"?e[r]=!0:e[r]==="false"?e[r]=!1:e[r]==="null"?e[r]=null:typeof e[r]!="boolean"&&!Number.isNaN(Number(e[r]))&&e[r]!==""&&(e[r]=Number(e[r]))}),e},bm=t=>{const e=[];return Object.keys(t).forEach(r=>{let n=t[r];t[r]===!0?n="true":t[r]===!1&&(n="false"),Dxe.includes(r)&&(n=Number(n)),vz.includes(r)&&(t[r]===!1||t[r]==="")?e.push({name:r,value:!1,type:"string"}):e.push({name:r,value:n})}),e},Cxe={...Oxe,async[iz]({dispatch:t}){await t(gm),await t(ym),await this.dispatch(Exe)},async[oz]({dispatch:t}){try{await t(iz)}catch(e){this.handleError(e,{object:"settings",fallbackCode:"settings.get",action:`${oi}/${oz}`})}},async[gm]({commit:t}){try{t(_m,!0);const{data:e}=await cr.get("/companySetting"),r=gz(e);t(px,{key:"company",settings:r});const{ataTitleKey:n}=e;n&&n!=="ata"&&be.i18next.addResources(be.i18next.language,"_common",{ata:`$t(${n})`,ataThe:`$t(${n}The)`})}catch(e){throw e}finally{t(_m,!1)}},async[sz]({dispatch:t}){try{await t(gm)}catch(e){this.handleError(e,{object:"companySettings",fallbackCode:"settings.get",action:`${oi}/${sz}`})}},async[ym]({dispatch:t,commit:e}){var r;try{e(_m,!0);const{data:n}=await cr.get("/companyUserSetting"),a=gz(n);e(px,{key:"companyUser",settings:a});const{autoTriggerPurchaseEvent:o}=a;if(o){const{currency:i,amount:s,accountType:u}=o||{};(r=this.$trackevent)==null||r.call(this,"purchase",{currency:i,amount:s,accountType:u}),await t(Yl,{key:"companyUser",settings:bm({autoTriggerPurchaseEvent:null})})}}catch(n){throw n}finally{e(_m,!1)}},async[uz]({dispatch:t}){try{await t(ym)}catch(e){this.handleError(e,{object:"companyUserSettings",fallbackCode:"settings.get",action:`${oi}/${uz}`})}},async[lz]({dispatch:t,commit:e},{key:r,settings:n}){try{if(!r)throw new Error("Missing valid parameter key");const a=bm(n);return e(px,{key:r,settings:n}),await t(Yl,{key:r,settings:a}),!0}catch(a){return this.handleError(a,{object:"setting",fallbackCode:"settings.put",action:`${oi}/${lz}`,actionPayload:arguments[1]}),!1}},async[Yl]({dispatch:t,commit:e},{key:r,settings:n}){try{if(e(pz,!0),r==="company")await cr.post("/companySetting",n),t(gm);else if(r==="companyUser")await cr.post("/companyUserSetting",n),t(ym);else throw new Error(`Setting key: '${r}' is not valid, cannot update settings.`)}catch(a){throw a}finally{e(pz,!1)}},async[dz]({commit:t,state:e},{props:r=[]}={}){try{const n=pa(e.company,r);return t(`forms/${hz}`,{key:"companySettings",formData:n},{root:!0}),!0}catch(n){return this.handleError(n,{object:"setting",fallbackCode:"setting.editCompany",action:`${oi}/${dz}`,actionPayload:arguments[1]}),!1}},async[cz]({rootGetters:t,dispatch:e}){try{const r=t["forms/getFormByKey"]("companySettings"),n=bm(r);return await e(Yl,{key:"company",settings:n}),await this.dispatch(az,"companySettings"),!0}catch(r){return this.handleError(r,{object:"setting",fallbackCode:"setting.submitCompany",action:`${oi}/${cz}`}),!1}},async[fz]({commit:t,state:e},{props:r=[]}={}){try{const n=pa(e.companyUser,r);return t(`forms/${hz}`,{key:"companyUserSettings",formData:n},{root:!0}),!0}catch(n){return this.handleError(n,{object:"setting",fallbackCode:"setting.editCompanyUser",action:`${oi}/${fz}`,actionPayload:arguments[1]}),!1}},async[mz]({rootGetters:t,dispatch:e}){try{const r=t["forms/getFormByKey"]("companyUserSettings"),n=bm(r);return await e(Yl,{key:"companyUser",settings:n}),await this.dispatch(az,"companyUserSettings"),!0}catch(r){return this.handleError(r,{object:"setting",fallbackCode:"setting.submitCompanyUser",action:`${oi}/${mz}`}),!1}}},{SET_INVOICE_SETTINGS_FETCHING:$xe,SET_INVOICE_SETTINGS_POSTING:Axe}=G1,Rxe={[$xe](t,e){t.isFetchingInvoice=e},[Axe](t,e){t.isPostingInvoice=e}},{SET_SETTINGS:Ixe,CLEAR_SETTINGS:Nxe,SET_SETTINGS_FETCHING:Lxe,SET_SETTINGS_POSTING:Wxe}=lV,Fxe={...Rxe,[Ixe](t,{key:e,settings:r={}}){if(!t[e])throw Error(`${e} is not a valid key/type`);Object.keys(r).forEach(n=>{const a=r[n];ce.set(t[e],n,a)})},[Nxe](t,{key:e,name:r=null}){r?ce.delete(t[e],r):ce.set(t,e,{})},[Lxe](t,e){t.isFetching=e},[Wxe](t,e){t.isPosting=e}},jxe={...{allInvoiceSettings:t=>t.invoice,getInvoiceSetting:t=>e=>{const r=t.invoice[e];return typeof r<"u"?r:null},isFetchingInvoice:t=>t.isFetchingInvoice,isPostingInvoice:t=>t.isPostingInvoice,isRegisteredForInvoicing:(t,e)=>e.getInvoiceSetting("isRegisteredForInvoicing")},allCompanySettings:t=>t.company,getCompanySetting:t=>e=>{const r=t.company[e];return typeof r<"u"?r:null},getCompanyUserSetting:t=>e=>{const r=t.companyUser[e];return typeof r<"u"?r:null},isPosting:t=>t.isPosting,isFetching:t=>t.isFetching,allowHidePrice:(t,e)=>e.getCompanySetting("work_allowHidePrice"),hidePriceOnNewlyAddedArticles:(t,e)=>e.allowHidePrice&&e.getCompanySetting("work_default_hidePrice"),allowDocumentCustomSender:(t,e)=>e.getCompanySetting("allowProjectCustomSender"),allowHideDocArticlePriceInput:(t,e)=>e.getCompanySetting("allowHideDocArticlePriceInput"),defaultHideDocArticlePriceInput:(t,e)=>e.getCompanySetting("hideDocArticlePriceInput"),defaultVatRate:(t,e)=>e.getCompanySetting("defaultVatRate"),defaultCurrency:(t,e)=>e.getCompanyUserSetting("defaultCurrency"),documentSenderSign:(t,e)=>e.getCompanyUserSetting("documentSenderSign"),showOverviewOnboardingOverlay:(t,e)=>e.getCompanyUserSetting("showOverviewOnboardingOverlay"),reminderSettings:t=>{const e=t.company||{};return{notAnswered:e.defaultReminderRemindDays,notViewed:e.defaultReminderViewedDays,expires:e.defaultReminderExpireDays}},defaultDocumentTheme:t=>{const{documentThemeBackgroundFilter:e,documentThemePriceBackground:r,documentThemePrimaryColor:n,offerBrandingBackgroundUrl:a}=t.company||{};return{...e&&e!=="hsla(239,71%,89%,0)"&&{backgroundFilter:e},...r&&r!=="hsla(249,60%,34%,1)"&&{priceSummaryBackground:r},...n&&n!=="hsla(271,100%,38%,1)"&&{headingColor:n},...n&&n!=="hsla(271,100%,38%,1)"&&{headingColor:n},...a&&{background:a}}},isAuthenticatedCRM:(t,e)=>(r,n=null)=>({hubspot:[{key:"hubspotNativeTokens",type:"getCompanyUserSetting",appType:"native"},{key:"hubspotTokens",type:"getCompanyUserSetting",appType:"extension"}],upsales:[{key:"upsalesApiKey",type:"getCompanySetting"}],salesforce:[{key:"salesforceTokens",type:"getCompanyUserSetting"}],pipedrive:[{key:"pipedriveTokens",type:"getCompanyUserSetting"}]}[r]||[]).filter(o=>!n||o.appType===n).some(({key:o,type:i})=>{var s;return!!((s=e[i])!=null&&s.call(e,o))}),allAuthenticatedCRMs:(t,e)=>["hubspot","salesforce","pipedrive"].filter(r=>!!e.isAuthenticatedCRM(r)),isFortnoxInstalled:(t,e)=>!!e.getCompanySetting("fortnoxTokens")&&Fn.checkFeature("fortnox")},Vxe={namespaced:!0,state:Pxe,getters:jxe,actions:Cxe,mutations:Fxe},zxe={...(()=>({isUploading:!1,article:{},document:{},document2:{},projectNote:{},company:{},companyBranding:{},companyUser:{},companyInvoiceSettings:{},companySettings:{},companyUserSettings:{},moduleArticles:[],modulePrices:{},file:{},invoice:{},invoiceNote:{},companyReference:{},companyReferenceItems:[],endCustomer:{},timeline:{},timeTrack:{TimeTrackSlots:[]},documentTerm:{},kycForm:{}}))()},{FORM_DOCUMENT_SET_CLIENT:yz,FORM_DOCUMENT_SUBMIT_CLIENT:Uxe}=Ln,{SET_FORM_VALUE:uo,REMOVE_FORM_VALUE:_z}=Wn,Hxe={async[yz]({commit:t,getters:e,rootGetters:r},{formData:n}){if(!n)return t(uo,{key:"document.ModuleEndCustomer",value:null}),t(_z,"document.ModuleExtraCustomers"),!0;const a=Object.assign({},n);a.id=null,a.EndCustomerId=n.id,t(uo,{key:"document.ModuleEndCustomer",value:a});const o=e.documentField("ModuleExtraCustomers");a.customerType==="company"&&a.reference&&o&&o.length===0&&t(uo,{key:"document.ModuleExtraCustomers",value:{name:a.reference}});const i=r["settings/getCompanySetting"]("priceInputCompany"),s=r["settings/getCompanySetting"]("priceInputDefault");return a.customerType==="company"&&i?t("application/updateField",{path:"priceInputVat",value:i},{root:!0}):a.customerType==="individual"&&s&&t("application/updateField",{path:"priceInputVat",value:s},{root:!0}),!0},async[Uxe]({commit:t,dispatch:e,rootGetters:r},{mode:n="create"}={}){let a=null;if(n==="edit"){const o=r["forms/documentField"]("ModuleEndCustomer"),i=r["forms/getFormByKey"]("endCustomer");if(!o)throw new Error("Could not find the old client");if(!i)throw new Error("Could not find the new client");if(o.customerType==="individual"&&i.customerType==="company")t(_z,"document.ModuleExtraCustomers"),t(uo,{key:"document.ModuleExtraCustomers",value:{name:i.reference}});else if(i.customerType==="company"){const s=r["forms/documentField"]("ModuleExtraCustomers");s&&s[0]?t(uo,{key:"document.ModuleExtraCustomers[0]",value:{name:i.reference}}):t(uo,{key:"document.ModuleExtraCustomers",value:{name:i.reference}})}a=Object.assign({},i,{id:i.EndCustomerId}),i.doUpdateEndCustomer&&(t(uo,{key:"endCustomer",value:a}),await e(`endCustomers/${va.FORM_SUBMIT_ENDCUSTOMER}`,{},{root:!0}))}else{const o=await e(`endCustomers/${va.FORM_SUBMIT_ENDCUSTOMER}`,{},{root:!0}),i=r["endCustomers/endCustomerById"](o);if(!i)throw new Error("Could not find the endCustomer");a=Object.assign({},i)}return await e(yz,{formData:a}),!0}};var bz={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(ct,function(){Array.isArray||(Array.isArray=function(o){return Object.prototype.toString.call(o)==="[object Array]"});function r(o){for(var i=[],s=0,u=o.length;s<u;s++)i.indexOf(o[s])===-1&&i.push(o[s]);return i}var n={},a={"==":function(o,i){return o==i},"===":function(o,i){return o===i},"!=":function(o,i){return o!=i},"!==":function(o,i){return o!==i},">":function(o,i){return o>i},">=":function(o,i){return o>=i},"<":function(o,i,s){return s===void 0?o<i:o<i&&i<s},"<=":function(o,i,s){return s===void 0?o<=i:o<=i&&i<=s},"!!":function(o){return n.truthy(o)},"!":function(o){return!n.truthy(o)},"%":function(o,i){return o%i},log:function(o){return console.log(o),o},in:function(o,i){return!i||typeof i.indexOf>"u"?!1:i.indexOf(o)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(o,i,s){if(s<0){var u=String(o).substr(i);return u.substr(0,u.length+s)}return String(o).substr(i,s)},"+":function(){return Array.prototype.reduce.call(arguments,function(o,i){return parseFloat(o,10)+parseFloat(i,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(o,i){return parseFloat(o,10)*parseFloat(i,10)})},"-":function(o,i){return i===void 0?-o:o-i},"/":function(o,i){return o/i},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(o,i){return o.concat(i)},[])},var:function(o,i){var s=i===void 0?null:i,u=this;if(typeof o>"u"||o===""||o===null)return u;for(var l=String(o).split("."),d=0;d<l.length;d++)if(u==null||(u=u[l[d]],u===void 0))return s;return u},missing:function(){for(var o=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,s=0;s<i.length;s++){var u=i[s],l=n.apply({var:u},this);(l===null||l==="")&&o.push(u)}return o},missing_some:function(o,i){var s=n.apply({missing:i},this);return i.length-s.length>=o?[]:s}};return n.is_logic=function(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.keys(o).length===1},n.truthy=function(o){return Array.isArray(o)&&o.length===0?!1:!!o},n.get_operator=function(o){return Object.keys(o)[0]},n.get_values=function(o){return o[n.get_operator(o)]},n.apply=function(o,i){if(Array.isArray(o))return o.map(function(v){return n.apply(v,i)});if(!n.is_logic(o))return o;var s=n.get_operator(o),u=o[s],l,d,f,m,c;if(Array.isArray(u)||(u=[u]),s==="if"||s=="?:"){for(l=0;l<u.length-1;l+=2)if(n.truthy(n.apply(u[l],i)))return n.apply(u[l+1],i);return u.length===l+1?n.apply(u[l],i):null}else if(s==="and"){for(l=0;l<u.length;l+=1)if(d=n.apply(u[l],i),!n.truthy(d))return d;return d}else if(s==="or"){for(l=0;l<u.length;l+=1)if(d=n.apply(u[l],i),n.truthy(d))return d;return d}else{if(s==="filter")return m=n.apply(u[0],i),f=u[1],Array.isArray(m)?m.filter(function(v){return n.truthy(n.apply(f,v))}):[];if(s==="map")return m=n.apply(u[0],i),f=u[1],Array.isArray(m)?m.map(function(v){return n.apply(f,v)}):[];if(s==="reduce")return m=n.apply(u[0],i),f=u[1],c=typeof u[2]<"u"?u[2]:null,Array.isArray(m)?m.reduce(function(v,g){return n.apply(f,{current:g,accumulator:v})},c):c;if(s==="all"){if(m=n.apply(u[0],i),f=u[1],!Array.isArray(m)||!m.length)return!1;for(l=0;l<m.length;l+=1)if(!n.truthy(n.apply(f,m[l])))return!1;return!0}else if(s==="none"){if(m=n.apply(u[0],i),f=u[1],!Array.isArray(m)||!m.length)return!0;for(l=0;l<m.length;l+=1)if(n.truthy(n.apply(f,m[l])))return!1;return!0}else if(s==="some"){if(m=n.apply(u[0],i),f=u[1],!Array.isArray(m)||!m.length)return!1;for(l=0;l<m.length;l+=1)if(n.truthy(n.apply(f,m[l])))return!0;return!1}}if(u=u.map(function(v){return n.apply(v,i)}),a.hasOwnProperty(s)&&typeof a[s]=="function")return a[s].apply(i,u);if(s.indexOf(".")>0){var p=String(s).split("."),h=a;for(l=0;l<p.length;l++){if(!h.hasOwnProperty(p[l]))throw new Error("Unrecognized operation "+s+" (failed at "+p.slice(0,l+1).join(".")+")");h=h[p[l]]}return h.apply(i,u)}throw new Error("Unrecognized operation "+s)},n.uses_data=function(o){var i=[];if(n.is_logic(o)){var s=n.get_operator(o),u=o[s];Array.isArray(u)||(u=[u]),s==="var"?i.push(u[0]):u.forEach(function(l){i.push.apply(i,n.uses_data(l))})}return r(i)},n.add_operation=function(o,i){a[o]=i},n.rm_operation=function(o){delete a[o]},n.rule_like=function(o,i){if(i===o||i==="@")return!0;if(i==="number")return typeof o=="number";if(i==="string")return typeof o=="string";if(i==="array")return Array.isArray(o)&&!n.is_logic(o);if(n.is_logic(i)){if(n.is_logic(o)){var s=n.get_operator(i),u=n.get_operator(o);if(s==="@"||s===u)return n.rule_like(n.get_values(o,!1),n.get_values(i,!1))}return!1}if(Array.isArray(i))if(Array.isArray(o)){if(i.length!==o.length)return!1;for(var l=0;l<i.length;l+=1)if(!n.rule_like(o[l],i[l]))return!1;return!0}else return!1;return!1},n})})(bz);var qxe=y0,Bxe=rm,Yxe=b0,wz=ua,Gxe=Ls;function Kxe(t,e,r,n){if(!wz(t))return t;e=Bxe(e,t);for(var a=-1,o=e.length,i=o-1,s=t;s!=null&&++a<o;){var u=Gxe(e[a]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(a!=i){var d=s[u];l=n?n(d,u,s):void 0,l===void 0&&(l=wz(d)?d:Yxe(e[a+1])?[]:{})}qxe(s,u,l),s=s[u]}return t}var Xxe=Kxe,Jxe=Xxe;function Qxe(t,e,r){return t==null?t:Jxe(t,e,r)}var Xt=Qxe;function Zxe(t,e){let r=0;const n=[];for(const[a,o]of t.entries()){const{code:i,data:s}=o;if(i===e){const u=n.slice(r).find(({code:l,data:d})=>{if(l!==i)return!1;const f=te(d,"client.id"),m=te(s,"client.id"),c=te(d,"email"),p=te(s,"email");return f===m&&m!==void 0||c===p&&p!==void 0});u?(u.children=[...u.children,o],u.createdAt=o.createdAt):n.push({...o,children:[]})}else i==="sent"&&(r=a?a-1:0),n.push(o)}return n}const xz=({nodes:t,data:e})=>{const r=[];return t.forEach(n=>{const a=n.isVisible?Zfe(n.isVisible,["_uniqueId"]):!1;(!a||bz.exports.apply(a,e))&&r.push(n),n&&Array.isArray(n.children)&&n.children.length&&(n.children=xz({nodes:n.children,data:e}))}),r},kz={rot:{max:5e4*100,ratio:.3},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot50:{max:5e4*100,ratio:.5}},Pz=(t,e,r)=>{if(!kz[t])throw new Error("Missing param type");const{max:n,ratio:a}=kz[t];return Math.min(r*n,e*a)},wm=({type:t="fixed",currency:e,maxTotal:r=null,articles:n=[],clients:a=[],region:o={},useVat:i,rounding:s})=>{if(typeof i>"u")throw new Error("Missing param useVat");if(typeof i!="boolean")throw new Error("Param useVat must be a boolean");if(typeof s!="object"||s===null)throw new Error("Param rounding must be a object");if(typeof s.enabled>"u")throw new Error("Missing param rounding.enabled");if(typeof s.enabled!="boolean")throw new Error("Param rounding.enabled must be a boolean");if(typeof s.interval>"u")throw new Error("Missing param rounding.interval");if(typeof s.interval!="number")throw new Error("Param rounding.interval must be a number");if(typeof s.show>"u")throw new Error("Missing param rounding.show");if(typeof s.show!="boolean")throw new Error("Param rounding.show must be a boolean");const u={type:t,subTotal:0,taxAmount:0,roundingAmount:0,total:0,currency:e,maxTotal:t==="openAccMaxPrice"?r||0:null,region:{country:"sweden",houseWorkType:null,reverseVat:!!a.find(f=>te(f,"region.reverseVat")),houseWorkManualAmount:o.houseWorkManualAmount||null,houseWorkWork:0,houseWorkAmount:o.houseWorkManualAmount||o.houseWorkAmount||null},helpers:{discount:0,isIndivid:!a.find(f=>f.type==="company"),noOfClients:a.length||1},useVat:i,rounding:{enabled:s.enabled,interval:s.interval,show:s.show}},l=f=>f/100;if(u.helpers.isIndivid&&!u.region.reverseVat){const f=[...n].sort((m,c)=>new Date(c.updatedAt).getTime()-new Date(m.updatedAt).getTime()).find(Qw);f&&!u.region.houseWorkType&&(u.region.houseWorkType=Kj(f))}for(let f of n){f=Ki(f);const{totalAmount:m,currency:c,priceType:p,discount:h,discountType:v}=f;let{vat:g}=f;i||(g=0),["fixed","approx"].includes(p)&&(u.currency=c,u.subTotal+=m,u.taxAmount+=m*l(g),u.helpers.discount+=v==="percentage"?m/((100-h/100)/100)-m:h,u.region.houseWorkType&&Qw(f)&&(u.region.houseWorkWork+=m*((100+g)/100)))}!u.helpers.isIndivid&&u.region.reverseVat&&(u.taxAmount=0),u.region.houseWorkType&&u.region.houseWorkAmount===null&&(u.region.houseWorkAmount=Pz(u.region.houseWorkType,u.region.houseWorkWork,u.helpers.noOfClients));const d=u.subTotal+u.taxAmount-u.region.houseWorkAmount;return u.roundingAmount=s.enabled&&s.interval?Math.round(d/s.interval)*s.interval-d:0,u.total=d+u.roundingAmount,Jw(u),u},eke=t=>{if(!t)return null;const{currency:e,clients:r=[],articles:n=[]}=t,a=te(t,"data.packageGroups",{}),o=te(t,"data.formSettings.useVat",!0),i={enabled:te(t,"data.formSettings.rounding.enabled",!1),interval:te(t,"data.formSettings.rounding.interval",1),show:te(t,"data.formSettings.rounding.show",!0)},s=[],u=[];let l=null,d=null,f=null;if(Object.keys(a).forEach(h=>{const v=a[h].packages.filter(({isSelected:_})=>_);u.push(...v.map(({packageId:_})=>_));const g=te(v,"[0].data.prices.type","fixed");s.push(...Array.isArray(g)?g:[g]),v.forEach(_=>{const{maxTotal:y=null,region:b}=te(_,"data.prices")||{};g==="openAccMaxPrice"&&!Number.isNaN(Number.parseInt(y,10))&&(l+=y),b&&!Number.isNaN(Number.parseInt(b.houseWorkManualAmount,10))&&(d+=b.houseWorkManualAmount)})}),!s.length){const h=te(t,"data.prices.type","fixed");s.push(...Array.isArray(h)?h:[h])}const m=n.filter(({packageId:h})=>!h||u.includes(h)),c=m.filter(Qw),p={};for(let h of c){h=Ki(h);const v=Kj(h),g=o?h.vat:0;p[v]||(p[v]=null),p[v]+=h.totalAmount*((100+g)/100)}for(const[h,v]of Object.entries(p))v&&(f+=Pz(h,v,r.length||1));return{...wm({currency:e,articles:m,clients:r,region:{country:"sweden",houseWorkManualAmount:d,houseWorkAmount:f},useVat:o,rounding:i}),type:s,maxTotal:l}},tke=t=>{const e=a=>be.t(`_common:documentMentions.${a}`),r=!!te(t,"clients.0"),n={clientName:{key:"clients.0.name",meta:{inputDisabled:!r,virtual:!0}},clientEmail:{key:"clients.0.email",meta:{inputDisabled:!r,virtual:!0}},clientPhone:{key:"clients.0.cellphone",meta:{inputDisabled:!r,virtual:!0}},clientCompany:{key:"clients.0.companyName",meta:{inputDisabled:!r,virtual:!0}},clientAddress:{key:"clients.0.addresses.standard.street",meta:{inputDisabled:!r,virtual:!0}},clientZip:{key:"clients.0.addresses.standard.zip",meta:{inputDisabled:!r,virtual:!0}},clientCity:{key:"clients.0.addresses.standard.city",meta:{inputDisabled:!r,virtual:!0}},clientSocialNo:{key:"clients.0.socialNo",meta:{inputDisabled:!0,virtual:!0}},clientOrgNo:{key:"clients.0.orgNo",meta:{inputDisabled:!0,virtual:!0}},senderName:{key:"companyUser.fullName",meta:{inputDisabled:!0,virtual:!0}},senderEmail:{key:"companyUser.email",meta:{inputDisabled:!0,virtual:!0}},senderPhone:{key:"companyUser.cellphone",meta:{inputDisabled:!0,virtual:!0}},senderCompany:{key:"company.name",meta:{inputDisabled:!0,virtual:!0}},senderAddress:{key:"company.street",meta:{inputDisabled:!0,virtual:!0}},senderZip:{key:"company.zip",meta:{inputDisabled:!0,virtual:!0}},senderCity:{key:"company.city",meta:{inputDisabled:!0,virtual:!0}},documentName:{key:"data.name",meta:{inputDisabled:!1,virtual:!0}}};for(const a of Object.keys(n))n[a].label=e(a),n[a].value=te(t,n[a].key)||"";return n},Gl=t=>t?Object.keys(t).reduce((e,r)=>t[r]||t[r]===!1?{...e,[r]:t[r]}:e,{}):{};function rke(t,e){if(typeof e!="object"||e===null)throw Error("Param pdfFile must be an object");const{name:r,url:n,mime:a,fileId:o}=e;if(!r||!n||!a||!o)throw Error("Param pdfFile must include name, url, mime and fileId");if(!t)return null;const i=te(t,"template.views.read.nodes")||[],s=Sn.exports(),u=Array(2).fill().map(()=>Sn.exports());return i.push({itemId:"sectionPdf",itemType:"section",value:null,parentId:"0",nodeId:u[0]},{itemId:"pdf",itemType:"pdf",value:{file:`data.pdf-file-${s}`},parentId:u[0],nodeId:u[1]}),Xt(t,`data.pdf-file-${s}`,e),Xt(t,`template.validationSchema.properties.data.properties.pdf-file-${s}`,{anyOf:[{$ref:`${Me.api.baseUrl}/schemas/file/1.json`},{type:"null"}]}),t}function nke(t){if(!t)return null;const e=te(t,"template.views.read.nodes")||[];if(e.find(n=>n.itemType==="answer"))return t;e.push({itemId:"answer",itemType:"answer",value:{defaultAnswerMethod:"data.defaultAnswerMethod"},parentId:"0",nodeId:Sn.exports()}),Xt(t,"template.views.read.nodes",e);const r="template.validationSchema.properties.data.properties.defaultAnswerMethod";return te(t,r)||Xt(t,r,{default:{accept:"signature",deny:"button"},$ref:`${Me.api.baseUrl}/schemas/answer/1.json`}),t}const ake=t=>{if(!t)return null;let e=(t||"").replace(/^SE|[-]/g,"").trim();return e.length===12&&(e=e.substring(2)),`SE${e}01`},hx=()=>{const t=["email"];return Fn.checkFeature("sms")&&Fn._isValidCompanySetting("deliveryDefaultSms")&&t.push("sms"),{region:{country:"sweden"},permissions:{write:["clients[*].socialNo","clients[0].region.propertyDesignation","data.rejectReasons","data.packageGroups[*].packages[*].isSelected"]},answer:null,deliveryTypes:t,documentRole:"signee",answerMethod:{accept:"signature",deny:"button"},signOrder:0,_uniqueId:Sn.exports()}},vx=(t,e)=>{const r={endCustomerId:t.id,type:t.customerType,name:t.customerType==="individual"?t.name:t.reference,socialNo:t.customerType==="individual"?t.org_no:null,companyName:t.customerType==="company"?t.name:null,orgNo:t.customerType==="company"?t.org_no:null,email:t.email,cellphone:t.cellphone,cellphoneRegion:t.cellphoneRegion,addresses:{...t.street||t.zip||t.city?{standard:{street:t.street,zip:`${t.zip||""}`,city:t.city,country:t.country,latitude:t.latitude?`${t.latitude}`:null,longitude:t.longitude?`${t.longitude}`:null}}:{},...t.workStreet||t.workZip||t.workCity?{work:{street:t.workStreet,zip:`${t.workZip||""}`,city:t.workCity,country:t.country,latitude:t.latitude?`${t.latitude}`:null,longitude:t.longitude?`${t.longitude}`:null}}:{}},vatNumber:t.vatNumber,region:{...e&&e.region,reverseVat:t.reverseVat&&t.customerType==="company"},documentRole:te(e,"documentRole","signee"),signOrder:te(e,"signOrder",0)};return{...hx(),...e,...r}},gx=(t={})=>{const e=t,r=te(e,"addresses.standard",{}),n=te(e,"addresses.work",{});return{id:e.endCustomerId,EndCustomerId:e.endCustomerId,customerType:e.type||"individual",name:e.type==="individual"?e.name:e.companyName,email:e.email,cellphone:e.cellphone,cellphoneRegion:e.cellphoneRegion,org_no:e.type==="individual"?e.socialNo:e.orgNo,street:r.street,zip:r.zip,city:r.city,workStreet:n.street,workZip:n.zip,workCity:n.city,vatNumber:e.vatNumber||ake(e.orgNo)||"",separateWorkAddress:!!Object.keys(n).length,reverseVat:te(e,"region.reverseVat",!1),longitude:te(e,"addresses[0].longitude",null),latitude:te(e,"addresses[0].latitude",null),reference:e.type==="company"?e.name:null}},ike=({background:t,backgroundFilter:e,priceSummaryBackground:r,showPriceSummary:n})=>({resourceUrl:t,overlayColor:e,backgroundColor:r,showPriceSummary:n}),oke=({header:t={},theme:e={}})=>{const{resourceUrl:r="",title:n="",backgroundColor:a="",overlayColor:o="",showPriceSummary:i}={...ike(e),...t};return{layout:"price",baseStyle:{textColor:"",textAlign:"left"},items:[{type:"content",size:50,media:{type:"color",backgroundColor:a},value:{preText:"",documentName:n?`<h1>${n}</h1>`:"",postText:"",showLogo:!0,logotype:""}},{type:"media",size:50,media:{type:"image",resourceUrl:r,overlay:!0,overlayColor:o}}],...typeof i=="boolean"&&{showPriceSummary:i}}},ske=(t,e={})=>(!t||!t.data||te(t,"template.views.read.nodes",[]).filter(n=>n.itemType==="header"&&!!n.value.header).map(n=>n.value.header.substring(5)).forEach(n=>{if(t.data[n]&&t.data[n].layout==="legacy"){const a={...e,...Gl(t.data.theme)};t.data[n]=oke({header:{...t.data[n],title:te(t,"data.name","")},theme:a})}}),t),uke={isHouseWorkAuto:!0,rotAmount:null,rutAmount:null,persons:[],propertyType:null,realEstateId:null,condominiumId:null,condominiumOrgNo:null,isExported:!1,isProcessed:!1},Kl={id:{$default:null,$type:Number,$scope:["invoice"]},publicId:{$default:null,$type:String},status:{$default:"draft",$type:String,$scope:["invoice"]},subStatus:{$default:null,$type:String},type:{$default:"invoice",$type:String,$scope:["invoice"]},invoiceNumber:{$default:null,$type:String,$scope:["invoice"]},ocr:{$default:null,$type:Number},ourReference:{$default:null,$type:String,$scope:["invoice"]},yourReference:{$default:null,$type:String,$scope:["invoice"]},invoiceDate:{$default:D5(new Date).toISOString(),$type:Date,$scope:["invoice"]},dueDays:{$default:null,$type:Number,$scope:["invoice"],$virtual:[{name:"dueDays",set(t,{getters:e}){return t!==null?t:e["settings/getInvoiceSetting"]("invoiceDueDays")||null}}]},dueDate:{$default:null,$type:Date,$scope:["invoice"],$virtual:[{name:"dueDate",set(t,{getters:e}){if(t!==null)return t;const r=e["settings/getInvoiceSetting"]("invoiceDueDays")||1;return Kc(Fse(nl(Kl.invoiceDate.$default),r)).toISOString()}}]},deliveryDate:{$default:null,$type:Date,$scope:["invoice"]},sentAt:{$default:null,$type:Date},attestedAt:{$default:null,$type:Date},disputedAt:{$default:null,$type:Date},salesRequestedAt:{$default:null,$type:Date},pausedAt:{$default:null,$type:Date},interestType:{$default:"noInterest",$type:String,$scope:["invoice"],$virtual:[{name:"interestType",set(t,{getters:e}){return e["settings/getInvoiceSetting"]("invoiceInterestPercentage")?"fixed":"noInterest"}}]},interestPercentage:{$default:null,$type:Number,$scope:["invoice"],$virtual:[{name:"interestPercentage",set(t,{getters:e}){return t!==null?t:e["settings/getInvoiceSetting"]("invoiceInterestPercentage")||null}}]},interestStartInDaysAfterDueDate:{$default:0,$type:Number,$scope:["invoice"]},invoiceFee:{$default:null,$type:Number,$scope:["invoice"],$virtual:[{name:"invoiceFee",set(t,{getters:e}){return t!==null?t:e["settings/getInvoiceSetting"]("invoiceFee")||null}}]},reminderFee:{$default:null,$type:Number,$scope:["invoice"],$virtual:[{name:"reminderFee",set(t,{getters:e}){return t!==null?t:e["settings/getInvoiceSetting"]("invoiceReminderFee")||null}}]},deliveryTypes:{$default:["email"],$type:Array,$scope:["invoice"]},totalAmount:{$default:0,$type:Number},remainingAmount:{$default:0,$type:Number},paidAmount:{$default:0,$type:Number},creditedAmount:{$default:0,$type:Number},writeOffAmount:{$default:0,$type:Number},reminderAmount:{$default:0,$type:Number},totalVatAmount:{$default:0,$type:Number},centRoundingAmount:{$default:0,$type:Number},transferAmount:{$default:0,$type:Number},currency:{$default:"SEK",$type:String},partnerPdfId:{$default:null,$type:String},ModuleArticles:{$default:[],$type:Array,$scope:["invoice"]},ModuleEndCustomer:{$default:null,$type:Object,$scope:["invoice"]},ModuleBranding:{$scope:["invoice"],$type:Object,$default:{message:null,useMessageEmail:!0}},InvoiceFiles:{$scope:["invoice"],$type:Array,$default:[]},InvoiceRegionSweden:{$default:uke,$type:Object,$scope:["invoice"]},ModuleScheduledDeliveries:{$scope:["invoice"],$type:Array,$default:[{type:"viewed",sendDays:null,sendType:"email",sendAt:null,status:"new"}],$virtual:[{name:"ModuleScheduledDeliveries",set(t,{getters:e}){return this.type==="credit"?[]:e["settings/getCompanySetting"]("invoiceReminderActive")?t.map(a=>{const o=a;if(o.sendDays!==null)return o;let i=null;return o.type==="viewed"&&(i=e["settings/getCompanySetting"]("invoiceReminderDefaultViewedDays")),i!==null&&(o.sendDays=i),o}):[]}}]},CompanyId:{$default:null,$type:"ref",$ref:"companies",$scope:["invoice"]},CompanyUserId:{$default:null,$type:"ref",$ref:"companyUsers",$scope:["invoice"]},creditsInvoiceId:{$default:null,$type:"ref",$ref:"invoices",$scope:["invoice"]},object:{$default:null,$type:String,$scope:["invoice"]},objectId:{$default:null,$type:Number,$scope:["invoice"]},documentId:{$default:null,$type:String,$scope:["invoice"]},projectId:{$default:null,$type:Number,$scope:["invoice"]},createdAt:{$default:null,$type:Date},updatedAt:{$default:null,$type:Date},deletedAt:{$default:null,$type:Date}};class yx{constructor(e,r){if(!e)throw Error("Missing argument invoice");if(!r)throw Error("Missing argument getters");this._getters=r,this._invoice=e}get id(){return this.getProperty("id")||null}get publicId(){return this.getProperty("publicId")||null}get pdfPath(){if(this.status==="draft"||this.isSale)return null;const e=this.latestReminder;if(e){const{id:r}=e;return`${Me.api.baseUrl}/public/invoice/${this.publicId}/pdf/reminder/${r}`}return`${Me.api.baseUrl}/public/invoice/${this.publicId}/pdf`}getCompany(){const{_getters:e}=this,r=this.getProperty("CompanyId")||{};return e["companies/companyById"](r)}getCompanyUser(){const{_getters:e}=this,r=this.getProperty("CompanyUserId")||{};return e["companyUsers/byId"](r)}get status(){return this.getProperty("status")}get visualStatus(){return this.getProperty("transferAmount")?"paying":this.status}get subStatus(){return this.getProperty("subStatus")}get type(){return this.getProperty("type")}get projectId(){return this.getProperty("projectId")||null}get document(){return this.documentId?this._getters["documents2/byId"](this.documentId):null}get documentId(){return this.getProperty("documentId")}get client(){return this.getProperty("ModuleEndCustomer")||null}get files(){return this.getProperty("InvoiceFiles")}get totalAmount(){return this.getProperty("totalAmount")}get totalVatAmount(){return this.getProperty("totalVatAmount")}get totalExVat(){return this.totalAmount-this.totalVatAmount}get paidAmount(){return this.getProperty("paidAmount")}get sentAt(){return this.getProperty("sentAt")}get dueDate(){const e=this.latestReminder;return e?e.dueDate:this.getProperty("dueDate")}get invoiceDate(){const e=this.latestReminder;return e?e.invoiceDate:this.getProperty("invoiceDate")}get invoiceNumber(){return this.getProperty("invoiceNumber")}get reminders(){return this.getProperty("InvoiceReminders")||[]}get latestReminder(){const e=this.reminders;return e.length?e[e.length-1]:null}get canDispute(){return this.getProperty("id")&&!["draft","salesRequest","sold","completed"].includes(this.status)&&!this.isDisputed}get canRegisterPayment(){return this.getProperty("id")&&!["draft","salesRequest","sold","completed"].includes(this.status)}get canRegisterWriteOff(){return this.getProperty("id")&&!["draft","salesRequest","sold","completed"].includes(this.status)}get canSendReminder(){return this.getProperty("id")&&!["draft","salesRequest","sold","completed"].includes(this.status)}get canCredit(){const e=this.getProperty("id"),r=this.getProperty("type")==="credit";return e&&this.isAttested&&!r&&!["draft","salesRequest"].includes(this.status)}get canSell(){return this.id&&!this.isAttested&&!["salesRequest"].includes(this.status)}get canCancelSell(){return this.id&&this.isAttested&&["salesRequest"].includes(this.status)}get creditsInvoice(){const{_getters:e}=this,r=this.getProperty("creditsInvoice")||null;return e["invoices/byId"](r)}get creditInvoices(){const{_getters:e}=this;return(this.getProperty("creditInvoices")||[]).map(a=>e["invoices/byId"](a))}get interestInvoiceTo(){const{_getters:e}=this,r=this.getProperty("interestForInvoiceId")||null;return e["invoices/byId"](r)}get interestInvoices(){const{_getters:e}=this;return(this.getProperty("interestInvoices")||[]).map(a=>e["invoices/byId"](a))}get isDisputed(){return!!this.getProperty("disputedAt")}get isAttested(){return!!this.getProperty("attestedAt")}get isReverseVat(){const e=this.getProperty("ModuleEndCustomer")||null;return e?e.reverseVat:!1}get events(){const e=this.getProperty("Events")||[],r=[];return e.forEach(n=>{const a={type:n.type};n.EventData.forEach(o=>{a[o.name]=o.value}),r.push({name:n.code==="sentSms"?"sent":n.code,timestamp:n.createdAt,data:a,counter:n.counter})}),r}get articles(){return Ki(this.getProperty("ModuleArticles")||[])}get totalNetAmount(){const{articles:e}=this;return e.reduce((n,a)=>n+a.totalAmount,0)}get currency(){return"SEK"}get invoiceRegionSweden(){return this.getProperty("InvoiceRegionSweden")||{}}get rotAmount(){const e=this.getProperty("InvoiceRegionSweden")||{},{rotAmount:r}=e;return r||0}get rutAmount(){const e=this.getProperty("InvoiceRegionSweden")||{},{rutAmount:r}=e;return r||0}get invoiceFee(){return this.getProperty("invoiceFee")||0}get isSale(){return!!(["salesRequest","sold"].includes(this.status)||this.getProperty("salesRequestAcceptedAt"))}getScheduledDeliveries({type:e,status:r}={}){let n=this.getProperty("ModuleScheduledDeliveries")||null;return!n||!n.length?[]:(e&&(n=n.filter(a=>a.type===e)),r&&(n=n.filter(a=>a.status===r)),n)}getProperty(e=""){return e.replace(/\[(.*)\]/ig,(a,o)=>`.${o}`).split(".").reduce((a,o)=>a&&(typeof a[o]!="object",a[o]),this._invoice)}getProperties({scope:e=null,includeVirtual:r=!1}={}){const n=Kl,{_getters:a}=this;return nxe({schema:n,getters:a,data:this._invoice,scope:e,includeVirtual:r,instance:this})}getVirtualProperties({scope:e=null}={}){const r=Kl,{_getters:n}=this;return YV({schema:r,getters:n,data:this._invoice,scope:e,instance:this})}}Ut(yx,"schema",Kl);const{DO_LOAD_INVOICE:Tz,DO_UPDATE_INVOICE:lke,DO_CREATE_INVOICE:dke,DO_ATTEST_INVOICE:cke,DO_SELL_INVOICE:fke,LOAD_FILE:mke,FORM_CLEAR_FORM:pke,FORM_RESET_OLD:hke,DO_LOAD_DOCUMENT2:Mz,UPDATE_VIEW_SETTINGS:vke,LOAD_INVOICE_SETTINGS:gke}=Oe,{SET_FORM:Xl,SET_FORM_VALUE:yke}=De.forms,{DELETE_MANY_INVOICES:_ke}=De.invoices,{LOAD_INVOICE_FORM:bke,LOAD_CREDIT_INVOICE_FORM:wke,LOAD_DOCUMENT2_INVOICE_FORM:xke,LOAD_CAMPAIGN_INVOICE_FORM:kke,SUBMIT_INVOICE_FORM:Pke,SET_KYC_FORM:Tke,DO_SAVE_KYC_FORM:Mke}=aV,si=(t,e)=>{t(vke,{view:"newInvoice",settings:{isLoading:e}})};async function _x({id:t=null,rootState:e,state:r,rootGetters:n,dispatch:a,projectId:o=null,documentId:i=null}){if(!e)throw new Error("Missing parameter rootState");if(!r)throw new Error("Missing parameter state");if(!n)throw new Error("Missing parameter rootGetters");if(!a)throw new Error("Missing parameter dispatch");let s=!1;const u=r.document;if(Object.keys(u).length!==0){const{name:l,params:d}=e.route||{};let{id:f}=d||{};f=Number.parseInt(f,10);const m=n["forms/documentField"]("id"),c=n["forms/documentField"]("documentType"),p=n["forms/documentField"]("type"),h=n["forms/documentField"]("projectId"),v=n["forms/documentField"]("documentId");if(c||(l==="invoiceNew"?!m&&!t&&p!=="credit"&&o===h&&(Tt.debug("INVOICE_FORM: Using existing store data as no ids was found"),s=!0):l==="invoiceEdit"?m&&m===f&&m===t&&p!=="credit"&&(Tt.debug("INVOICE_FORM: Using existing store data existing id match route"),s=!0):l==="invoiceCredit"?p==="credit"&&!t&&!m&&(Tt.debug("INVOICE_FORM: Using existing store data existing id match route"),s=!0):l==="invoiceDocument"&&v&&v===i&&(Tt.debug("INVOICE_FORM: Using existing store data as existing documentId match"),s=!0)),s){Tt.debug("INVOICE_FORM: Dont reload as forms/document is already defined");const g=n["forms/documentField"]("InvoiceFiles");g&&ot(g)==="array"&&g.forEach(_=>a(mke,{id:_.FileId},{root:!0}))}}return s}function Jl({rootState:t,rootGetters:e},r={}){const n=new yx(r,e).getProperties({includeVirtual:!0}),a={ModuleArticles:[e["articles/getNewArticle"]({name:"",price:0})]};return{...n,...a,CompanyId:t.application.user.companyId,CompanyUserId:t.application.user.userId}}const Ske={async[wke]({state:t,rootGetters:e,rootState:r,dispatch:n},{creditsInvoiceId:a}){try{if(si(this.dispatch,!0),await _x({id:null,rootState:r,state:t,rootGetters:e,dispatch:n}))return;let i=Jl({rootState:this.state,rootGetters:e},{type:"credit"});if(!a)throw new Error("Missing parameter creditsInvoiceId");await this.dispatch(Tz,{id:a});const s=this.getters["invoices/byId"](a);if(!s)throw Tt.event({type:"invoiceCredit",status:"failed",data:{id:a},error:"Tried to load invoice to credit that does not exist!"}),new Error(`Could not find original invoice by id: '${a}'`);s.documentId&&!this.getters["documents2/byId"](s.documentId)&&await this.dispatch(Mz,{id:s.documentId});const u=pa(s.getProperties({scope:"invoice",includeVirtual:!0}),["ModuleArticles","ModuleBranding","ourReference","yourReference","invoiceFee","deliveryTypes","ModuleEndCustomer","InvoiceRegionSweden","object","objectId","documentId","projectId"]);i={...i,...u,type:"credit",creditsInvoiceId:a,invoiceDate:Kc(new Date).toISOString(),dueDate:Kc(new Date).toISOString()},i.invoiceFee&&(i.invoiceFee=-i.invoiceFee),i.ModuleArticles&&(i.ModuleArticles=i.ModuleArticles.map(l=>{const d=Za(l,["id","createdAt","updatedAt","deletedAt","object","ObjectId"]);return d.price=-d.price,d.houseWorkHoursToReport&&(d.houseWorkHoursToReport*=-1),d})),i.ModuleBranding&&(i.ModuleBranding=Za(i.ModuleBranding,["id","createdAt","updatedAt","deletedAt","object","ObjectId"])),i.ModuleEndCustomer&&(i.ModuleEndCustomer=Za(i.ModuleEndCustomer,["id","createdAt","updatedAt","deletedAt","object","ObjectId"])),i.InvoiceRegionSweden&&(i.InvoiceRegionSweden=pa(i.InvoiceRegionSweden,["condominiumId","condominiumOrgNo","isHouseWorkAuto","persons","propertyType","realEstateId"]),i.InvoiceRegionSweden&&!i.InvoiceRegionSweden.isHouseWorkAuto&&(i.InvoiceRegionSweden.persons=(i.InvoiceRegionSweden.persons||[]).map(l=>({...l,amount:-l.amount})))),this.commit(`forms/${Xl}`,{key:"document",formData:i}),Tt.event({type:"invoiceCredit",status:"success",data:{id:a}}),Tt.debug("Credit invoice form loaded")}catch(o){this.handleError(o)}finally{si(this.dispatch,!1)}},async[xke]({state:t,rootGetters:e,rootState:r,dispatch:n},{docId:a}){try{if(!a)throw new Error("Missing parameter docId");si(this.dispatch,!0);let o=Jl({rootState:this.state,rootGetters:e});await this.dispatch(Mz,{id:a});const i=this.getters["documents2/byId"](a);if(!i)throw new Error("Missing document");const{projectId:s}=i;if(await _x({id:null,rootState:r,state:t,rootGetters:e,dispatch:n,documentId:a,projectId:s}))return;o={...o,documentId:i.id,...s&&{projectId:s}},i.clients&&i.clients.length&&(o.ModuleEndCustomer=gx(Za(i.clients[0],["id","createdAt","updatedAt","deletedAt","object","ObjectId"]))),this.commit(`forms/${Xl}`,{key:"document",formData:o})}catch(o){this.handleError(o)}finally{si(this.dispatch,!1)}},async[bke]({state:t,rootState:e,dispatch:r,rootGetters:n},{id:a=null,projectId:o=null}={}){try{if(si(this.dispatch,!0),await _x({id:a,rootState:e,state:t,rootGetters:n,dispatch:r,projectId:o}))return;let s={},u;if(a){if(await this.dispatch(Tz,{id:a}),u=this.getters["invoices/byId"](a),!u)throw Tt.event({type:"editInvoice",status:"failed",data:{id:a},error:"Tried to edit invoice that does not exist!"}),new Error(`Could not find invoice by id: '${a}'`);s={...s,...u.getProperties({scope:"invoice"})}}else if(s={...Jl({rootState:this.state,rootGetters:n})},o){s.projectId=o;const f=n["projects/byId"](o);f&&f.clients[0]&&(s.ModuleEndCustomer=gx(Za(f.clients[0],["id","createdAt","updatedAt","deletedAt","object","ObjectId"])))}const{object:l,objectId:d}=s;this.commit(`forms/${Xl}`,{key:"document",formData:s}),Tt.event({type:a?"editInvoice":"newInvoice",status:"success",data:{id:a}}),Tt.debug("Invoice form loaded")}catch(i){Tt.event({type:a?"editInvoice":"newInvoice",status:"failed",data:{id:a},error:i})}finally{si(this.dispatch,!1)}},async[Pke]({getters:t,commit:e},{next:r=null,doAttest:n=!1,doSell:a=!1}={}){let o=!1;try{let i=!1,s;const{invoice:u,hasChanged:l}=t,d=t.getInvoicePrices;let{id:f}=u;r==="invoice"&&(s={...u.getProperties(),ModuleArticles:u.articles,...d,id:0},this.dispatch(ao,{data:[s],schema:"invoices"}),o=!0,this.$router.push({name:"invoice",params:{id:s.id,modal:!1}}));const m={...u.getProperties(),...d};return l("document")&&(f?await this.dispatch(lke,{id:f,body:m}):(i=!0,f=await this.dispatch(dke,{body:m}),e(yke,{key:"document.id",value:f}))),o&&this.$router.replace({name:"invoice",params:{id:f,modal:!1}}),a?await this.dispatch(fke,{id:f}):n&&await this.dispatch(cke,{id:f}),await this.dispatch(hke,"document"),o||GV({next:r,invoiceId:f},this.$router),await this.dispatch(pke,{key:"document"}),o&&this.commit(`invoices/${_ke}`,s.id),{id:f,isNew:i}}catch(i){return this.handleError(i),o&&this.$router.currentRoute.name!=="invoiceNew"&&this.$router.go(-1),null}},async[kke]({state:t,rootGetters:e},{name:r=null}){if(!["100kr"].includes(r))throw Error("Missing valid param name");try{si(this.dispatch,!0);let a={...Jl({rootState:this.state,rootGetters:e})};if(r==="100kr"){let o;const{data:i}=await Zme("info@cling.se");i[0]?([o]=i,o.EndCustomerId=o.id):(await this.dispatch(Oe.FORM_NEW_ENDCUSTOMER),o=Object.assign(t.endCustomer,{name:"Cling Group AB",org_no:"559070-0273",email:"info@cling.se",customerType:"company",cellphone:"0850119885",street:"Kund-id WIN3890, FE nr 160",zip:"10569",city:"Stockholm"}),this.commit(Oe.SET_FORM_VALUE,{key:"endCustomer",value:o}),o.EndCustomerId=await this.dispatch(Oe.FORM_SUBMIT_ENDCUSTOMER,{showNotification:!1})),o.id=null,a={...Jl({rootState:this.state,rootGetters:e}),ModuleEndCustomer:{...o},ModuleArticles:[ame({name:"\u{1F4B0} Ge mig 100kr! \u{1F4B0}",price:1e4})]}}this.commit(`forms/${Xl}`,{key:"document",formData:a}),Tt.event({type:"campaignInvoice",status:"success",data:{name:r}}),Tt.debug("Invoice form loaded")}catch(a){Tt.event({type:"campaignInvoice",status:"failed",data:{name:r},error:a})}finally{si(this.dispatch,!1)}},async[Tke]({rootGetters:t},{formData:e={}}={}){await this.dispatch(gke),t["application/company"],t["settings/allInvoiceSettings"];let r={};r={...r,...e,company:{...r.company,...e.company},contact:{...r.contact,...e.contact}},this.commit(`forms/${Xl}`,{key:"kycForm",formData:r})},async[Mke]({getters:t}){const{kycForm:e}=t||{};if(!e)throw Error("Kyc Form missing in store");return["ownersWithMoreThan25Percent","beneficialOwners"].forEach(n=>{e[n]=(e[n]||[]).map(a=>({...a,address:a.address||"Sverige",country:a.country||"Sverige"}))}),await cpe.post({form:e})}},{SET_FORM_VALUE:Oke,REMOVE_FORM_VALUE:Eke}=De.forms,Dke={async[Ln.SET_FORM_ARTICLE]({commit:t},{index:e=null,data:r}){let n="document.ModuleArticles";e!==null&&(n=`document.ModuleArticles[${e}]`);const a=Ki(r);return t(Oke,{key:n,value:a})},async[Ln.REMOVE_FORM_ARTICLE]({commit:t},e){return t(Eke,e)}},Ql=t=>typeof t=="object"&&t!==null&&t.toString()==={}.toString(),xm=t=>JSON.parse(JSON.stringify(t)),bx=(t,e)=>{t=xm(t);for(const r in e)e.hasOwnProperty(r)&&(Ql(t[r])&&Ql(e[r])?t[r]=bx(t[r],e[r]):t[r]=e[r]);return t},Sz=(t,e)=>{t=t.replace(/^#\/definitions\//,"").split("/");const r=(a,o)=>{const i=a.shift();if(o[i]){if(!a.length)return o[i]}else return{};return r(t,o[i])},n=r(t,e);return Ql(n)?xm(n):n},Cke=(t,e)=>{const{length:r}=t;let n=-1,a={};for(;++n<r;){let o=t[n];o=typeof o.$ref<"u"?Sz(o.$ref,e):o,a=bx(a,o)}return a},Us=(t,e)=>{if(typeof t.default<"u")return t.default;if(typeof t.allOf<"u"){const r=Cke(t.allOf,e);return Us(r,e)}else if(typeof t.$ref<"u"){const r=Sz(t.$ref,e);return Us(r,e)}else if(t.type==="object"){if(!t.properties)return{};for(const r in t.properties)t.properties.hasOwnProperty(r)&&(t.properties[r]=Us(t.properties[r],e),(typeof t.properties[r]>"u"||Ql(t.properties[r])&&!Array.isArray(t.properties[r])&&!Object.keys(t.properties[r]).length)&&delete t.properties[r]);return t.properties}else if(t.type==="array"){if(!t.items)return[];const r=t.minItems||0;if(t.items.constructor===Array){const o=t.items.map(i=>Us(i,e));for(let i=o.length-1;i>=0&&!(typeof o[i]<"u");i--)i+1>r&&o.pop();return o}const n=Us(t.items,e);if(typeof n>"u")return[];const a=[];for(let o=0;o<Math.max(1,r);o++)a.push(xm(n));return a}},$ke=(t,e)=>(typeof e>"u"?e=t.definitions||{}:Ql(t.definitions)&&(e=bx(e,t.definitions)),Us(xm(t),e));class ui{constructor(e){if(!e)throw new Error("Missing param data");const{validationSchema:r,views:n}=e;if(!r)throw new Error("Missing param validationSchema in template data");if(!n)throw new Error("Missing param views in template data");this._data=e}get data(){return this._data}get id(){return this.data.id||null}get companyId(){return this.data.companyId||null}get name(){return this.data.name||null}get isNew(){return!this.id}get validationSchema(){return this.data.validationSchema}get views(){return this.data.views||{}}get language(){return this.data.language}get theme(){return te(this,"_data.validationSchema.properties.data.properties.theme.default",{})||{}}get thumbnailUrl(){return this.data.thumbnailUrl}get defaultMedia(){if(this.thumbnailUrl)return{type:"image",resourceUrl:this.thumbnailUrl};const{defaultData:e}=this,r=(te(this,"_data.views.read.nodes")||[]).filter(a=>["header","coverBlock"].includes(a.itemType));let n=null;for(const a of r)if(a){if(n)break;let o=a.value[a.itemType];if(!o)continue;if(a.itemType==="header"){o+=".items";const i=(te(e,o)||[]).find(({type:s})=>s==="media");i&&i.media&&({media:n}=i)}else if(a.itemType==="coverBlock"){const{type:i,cover:s}=te(e,o)||{};s&&(n={...i&&{type:i},...s})}}if(!n){const a=te(this,"theme.background");a&&(n={type:"image",resourceUrl:a})}return n}get reminders(){const e=this.getDefaultData({path:"properties.data.properties.reminders"});return e&&Array.isArray(e)?e:[]}get defaultData(){return this.getDefaultData()}get categoryTags(){return te(this.defaultData,"tags",[]).reduce((e,r)=>[...e,r.name],[])}get type(){return this.categoryTags[0]}getDefaultData({path:e=""}={}){let r=this.validationSchema;return e&&(r=e.split(".").reduce((n,a)=>n[a],r)),$ke(r)||{}}}const Ake=Me.brand.charAt(0).toUpperCase()+Me.brand.slice(1),Rke={accept:"acceptera",address:"adress",and:"and",answerFeedback:{intermediate:{title:"Tack f\xF6r att du delar dina tankar."},no:{start:{action:"Skicka in",placeholder:"Vad b\xF6r vi f\xF6rb\xE4ttra?",text:"Finns det n\xE5got specifikt du \xF6nskar vi b\xF6r f\xF6rb\xE4ttra?",title:"Tack f\xF6r att du delar med dig av dina tankar."},success:{action:"L\xE4s mer om $t(appBrand)",secondary:"Tillbaka till dokumentet",text:"Din feedback togs emot helt perfekt. V\xE5rt team kommer att ta del av din feedback med stor lyh\xF6rdhet.",title:"Tack."}},start:{no:"Nej",title:"Tyckte du om att anv\xE4nda $t(appBrand) f\xF6r att visa det h\xE4r dokumentet?",yes:"Ja"},yes:{action:"S\xE4tt ig\xE5ng gratis",secondary:"L\xE4s mer om $t(appBrand)",text:"Skapa och skicka snygga dokument med $t(appBrand). Uppt\xE4ck alla f\xF6rdelar med att skicka webbaserade dokument med e-signering.",title:"B\xF6rja anv\xE4nda $t(appBrand) du med."}},answerModal:{answerSuccess:"Ditt svar togs emot helt perfekt.",bankId:{component:{defaultError:"N\xE5got gick fel. Se till att du har matat in r\xE4tt personnummer och f\xF6rs\xF6k igen.",signingInterrupted:"Signeringen avbr\xF6ts, f\xF6rs\xF6k igen...",validations:{socialNo:{personalNumber:"Personnumret \xE4r inte giltigt",required:"Skriv in ditt personnummer"}},viewText:{canceled:{text:"Signeringen avbr\xF6ts. Var god och f\xF6rs\xF6k igen.",title:"Signeringen avbr\xF6ts"},error:{text:"Ett fel intr\xE4ffa. Var god och f\xF6rs\xF6k igen.",title:"Ett fel intr\xE4ffa"},form:{text:"Skriv in ditt personnummer f\xF6r att p\xE5b\xF6rja signeringen.",title:"Signera dokumentet med BankID"},new:{spinnerText:"\xD6ppna BankID p\xE5 din enhet.",text:"\xD6ppna BankID p\xE5 din enhet f\xF6r att signera dokumentet.",title:"Signera dokument"},signing:{spinnerText:"Var god signera dokumentet.",text:"\xD6ppna BankID p\xE5 din enhet f\xF6r att signera dokumentet.",title:"Signering p\xE5g\xE5r"},waiting:{spinnerText:"V\xE4ntar p\xE5 att du ska \xF6ppna BankID.",text:"\xD6ppna BankID p\xE5 din enhet f\xF6r att signera dokumentet.",title:"Signera dokument"}}},start:{action:"Signera med BankID",text:"Acceptera och signera dokumentet med BankID.",title:"Signera med BankID"},success:{text:"$t(answerModal.successText)",textFallback:"$t(answerModal.successTextFallback)",title:"$t(answerModal.successTitle)"}},decline:{component:{inputPlaceholder:"Frivilligt. L\xE4mna en kommentar om varf\xF6r du v\xE4ljer att neka."},start:{action:"Neka",text:"F\xF6r att neka dokumentet var god och bekr\xE4fta genom att klicka p\xE5 knappen nedanf\xF6r.",title:"Neka dokumentet"},success:{text:"Tack f\xF6r att du l\xE4mna ett svar.",title:"Du har nekat dokumentet."}},signature:{component:{draw:{canvasLabel:"Rita signatur",tab:"Rita"},subTitle:"Hur vill du signera?",terms:"Genom att signera dokumentet godk\xE4nner jag att den elektroniska signaturen \xE4r en representation av min handskrivna signatur och att den \xE4r lika giltig.",text:{canvasLabel:"F\xF6rhandsgranskning",nameLabel:"Signerad av",namePlaceholder:"Skriv ditt namn",tab:"Skriv"}},start:{action:"Signera & acceptera",text:"",title:"Acceptera dokumentet"},success:{text:"$t(answerModal.successText)",textFallback:"$t(answerModal.successTextFallback)",title:"$t(answerModal.successTitle)"}},versionError:{accept:{title:"Gick inte att signera dokumentet"},decline:{title:"Gick inte att neka dokumentet"},text:"Dokumentet har modifierats medan du har l\xE4st den. V\xE4nligen ladda om och ta del av det nya dokumentet f\xF6r att l\xE4mna svar.",btn:"Ladda om"},successText:"N\xE4r dokumentet har blivit signerat av alla parter kommer du f\xE5 en kopia skickat till din e-post {{email}} med en l\xE5st version av dokumentet.",successTextFallback:"N\xE4r dokumentet har blivit signerat av alla parter kommer du p\xE5 den h\xE4r webbsidan kunna ladda ner en l\xE5st version av dokumentet.",successTextFallbackSingle:"Dokumentet \xE4r nu signerat och komplett.",successTextSingle:"En bekr\xE4ftelse har skickats till e-posten {{email}} med en l\xE5st version av dokumentet.",successTitle:"Du har signerat dokumentet."},appBrand:Ake,approved:"godk\xE4nt",approx:"ca",cancel:"Avbryt",chapters:{answerButtons:{approveDescription:"Vi har meddelat {{- sender}} att dokumentet \xE4r godk\xE4nt.",approveTitle:"Dokumentet \xE4r godk\xE4nt!",denyDescription:"Vi har meddelat {{- sender}} att du inte \xE4r intresserad.",denyTitle:"Dokumentet \xE4r nekat",editPropDes:"Redigera fastighetsbeteckning",enterPropDes:"Ange fastighetsbeteckning",inPersonSignatureHint:"Du har blivit markerad f\xF6r att skriva under en fysisk kopia av detta dokument. Om du ist\xE4llet vill skriva under digitalt, kontakta",waitingDescription:"V\xE4ntar p\xE5 {{remaining}} st fler ska l\xE4mna svar.",youHave:"Du har "},articleItem:{eligibleForDeduction:"Ber\xE4ttigad f\xF6r {{type,deepNested:deduction}}-avdrag"},articleList:{changeShowVatTooltip:"\xC4ndra till att visa {{type}}",title:"Arbetsmoment / varor"},packageGroup:{errorCallout:"V\xE4lj minst ett alternativ",selectableOptions:"Valbara alternativ"},packageItem:{add:"L\xE4gg till paket",select:"V\xE4lj paket",selected:"Valt paket"},parties:{allRiskAndLiability:"Har allrisk- och ansvarsf\xF6rs\xE4kring",fTax:"Har F-skatt"},pricingSummary:{blocks:{approx:"Ungef\xE4rligt pris",deductionSubValue:"Totalpris utan avdrag {{price}}",maxPrice:"Maxpris",maxPriceVat:"Maxpris {{vat}}",net:"Netto",price:"Pris",rounding:"\xD6resavrundning",subTitleArticles:"Varav varor / moment med fast pris",summary:"Sammanst\xE4llning",total:"Total",typeDeduction:"Efter {{type,deepNested:deduction}}-avdrag"},placeholder:{description:"V\xE4lj vilket paket som passar dig b\xE4st genom att klicka p\xE5 ",descriptionBold:"V\xE4lj-knappen",title:"V\xE4lj ett paket"},terms:{houseWork:"Totalpriset efter skattereduktion f\xF6r {{type,deepNested:deduction}}-arbete f\xF6ruts\xE4tter att arbetet kvalificerar f\xF6r skattereduktion, att best\xE4llaren har det angivna utrymmet f\xF6r skattereduktion samt att det inte redan har utnyttjats f\xF6r annat {{type,deepNested:deduction}}-arbete. Best\xE4llaren ansvarar sj\xE4lv f\xF6r att kontrollera dess uppgifter.",houseWorkApprox:"Priset f\xF6r arbetet \xE4r ungef\xE4rligt. T\xE4nk p\xE5 att priset kan skilja sig med 15%. Om det g\xE4ller markarbeten rivningsarbeten eller lik. kan priset skilja sig med 25%. L\xE4s mer om detta i de allm\xE4nna best\xE4mmelserna.",reverseVat:"Notera att omv\xE4nd skattskyldighet g\xE4ller."}},termsDisclaimer:{description:"Genom att godk\xE4nna dokumentet accepterar du de ",termsAndConditions:"allm\xE4nna villkoren",title:"Villkor"}},close:"St\xE4ng",company:"f\xF6retag",deduction:Tl.deduction,denied:"nekat",deny:"Neka",denyModal:{denyButton:"Neka dokument",helpfulInformation:"Vi meddelar {{- senderName}} p\xE5 {{- senderCompany}} att du har valt att neka dokumentet.",otherPlaceholder:"Frivilligt. L\xE4mna en kommentar om varf\xF6r du v\xE4ljer att neka dokumentet.",subTitle:"Bekr\xE4fta ditt svar genom att klicka p\xE5 Neka.",successTitle:"Du har nekat dokumentet",thanksAnswer:"Tack f\xF6r ditt svar!",title:"Neka dokument"},detail_plural:"detaljer",document:"Dokument",document_plural:"Dokument",documentDetails:{subTitle:"Information om dokumentet."},documentTemplateView:{emailTemplate:{expires:{content:"$t(documentTemplateView.reminder) $t(documentTemplateView.emailTemplate.first.content)",subject:"$t(documentTemplateView.reminder) $t(documentTemplateView.sharedSubject)",text:`$t(documentTemplateView.emailTemplate.expires.title) $t(documentTemplateView.emailTemplate.expires.subject). $t(documentTemplateView.readMoreAndReply)
|
|
350
350
|
|
|
351
351
|
{{docLink}}`,title:"$t(documentTemplateView.emailTemplate.first.title)"},first:{content:"Du har f\xE5tt ett dokument fr\xE5n {{company.name}}. Klicka p\xE5 knappen f\xF6r att l\xE4sa mer och l\xE4mna ett svar.",subject:"$t(documentTemplateView.sharedSubject)",text:`$t(documentTemplateView.emailTemplate.first.title) $t(documentTemplateView.emailTemplate.first.subject). $t(documentTemplateView.readMoreAndReply)
|
|
@@ -569,7 +569,7 @@ ve.version="2.29.4",cet(kt),ve.fn=oe,ve.min=Ztt,ve.max=ert,ve.now=trt,ve.utc=ta,
|
|
|
569
569
|
z-index:-1000 !important;
|
|
570
570
|
top:0 !important;
|
|
571
571
|
right:0 !important
|
|
572
|
-
`,vat=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function gat(t){const e=window.getComputedStyle(t),r=e.getPropertyValue("box-sizing"),n=parseFloat(e.getPropertyValue("padding-bottom"))+parseFloat(e.getPropertyValue("padding-top")),a=parseFloat(e.getPropertyValue("border-bottom-width"))+parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:vat.map(i=>`${i}:${e.getPropertyValue(i)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:r}}function YG(t,e=1,r=null){rn||(rn=document.createElement("textarea"),document.body.appendChild(rn));const{paddingSize:n,borderSize:a,boxSizing:o,contextStyle:i}=gat(t);rn.setAttribute("style",`${i};${hat}`),rn.value=t.value||t.placeholder||"";let s=rn.scrollHeight;const u={};o==="border-box"?s+=a:o==="content-box"&&(s-=n),rn.value="";const l=rn.scrollHeight-n;if(e!==null){let d=l*e;o==="border-box"&&(d=d+n+a),s=Math.max(d,s),u.minHeight=`${d}px`}if(r!==null){let d=l*r;o==="border-box"&&(d=d+n+a),s=Math.min(d,s)}return u.height=`${s}px`,rn.parentNode&&rn.parentNode.removeChild(rn),rn=null,u}const rmt="",yat={name:"BaseInput",componentName:"BaseInput",mixins:[pat],inheritAttrs:!1,inject:{elForm:{default:""},elFormItem:{default:""}},props:{value:[String,Number],size:String,resize:String,form:String,disabled:Boolean,isPrice:{type:Boolean,default:!1},isIncVat:{type:Boolean,default:!1},vat:{type:Number,default:null},showZero:{type:Boolean,default:!1},type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:null},autoComplete:{type:String,default:"off"},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},tabindex:String,styleClass:{type:String,default:""}},data(){return{currentValue:this.value===void 0||this.value===null?"":this.value,prefixOffset:null,inputPrefixOffset:null,inputSuffixOffset:null,suffixOffset:null,hovering:!1,focused:!1,isOnComposition:!1,valueBeforeComposition:null,textareaCalcStyle:{}}},computed:{internalValue:{get(){if(this.isPrice&&!Number.isNaN(parseFloat(this.value))&&Number.isFinite(this.value)){if(!this.value&&!this.showZero)return"";let t=this.value;return this.isIncVat&&(t*=(100+this.vat)/100),t=Math.round(t)/100,t}return this.value},set(t){let e=t;this.isPrice&&(e=t*100,this.isIncVat&&(e/=(100+this.vat)/100),e=Math.round(e)),this.$emit("input",e)}},internalType(){return this.isPrice?"number":this.type},_elFormItemSize(){return(this.elFormItem||{}).elFormItemSize},validateState(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon(){return this.elForm?this.elForm.statusIcon:!1},validateIcon(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},inputSize(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},textareaStyle(){return{...this.textareaCalcStyle,resize:this.resize}},inputDisabled(){return this.disabled||(this.elForm||{}).disabled},isGroup(){return this.$slots.prepend||this.$slots.append},showClear(){return this.clearable&&!this.disabled&&!this.readonly&&this.currentValue!==""&&(this.focused||this.hovering)}},watch:{value(t,e){this.$nextTick(this.resizeTextarea),this.setCurrentValue(t)}},created(){this.$on("inputSelect",this.select)},mounted(){this.isGroup&&(this.prefixOffset=this.calcIconOffset("pre"),this.suffixOffset=this.calcIconOffset("suf")),this.$slots.prefix&&(this.inputPrefixOffset=this.calcInputPrefixOffset()),this.$slots.suffix&&(this.inputSuffixOffset=this.calcInputSuffixOffset()),this.resizeTextarea()},methods:{preventScroll(t){this.focused&&this.internalType==="number"&&t.preventDefault()},focus(){const t=this.$refs.input||this.$refs.textarea;t&&eme(t)},blur(){(this.$refs.input||this.$refs.textarea).blur()},handleBlur(t){this.focused=!1,this.$emit("blur",t),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.currentValue])},select(){(this.$refs.input||this.$refs.textarea).select()},handleFocus(t){this.focused=!0,this.$emit("focus",t)},handleChange(t){this.$emit("change",t.target.value)},setCurrentValue(t){this.isOnComposition&&t===this.valueBeforeComposition||(this.currentValue=t,!this.isOnComposition&&this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[t]))},calcInputPrefixOffset(){return this.$slots.prefix?{paddingLeft:`${this.$el.querySelector(".el-input__prefix").offsetWidth+14*1.8}px`}:null},calcInputSuffixOffset(){return this.$slots.suffix?{paddingRight:`${this.$el.querySelector(".el-input__suffix").offsetWidth+14*1.8}px`}:null},calcIconOffset(t){const r={suf:"append",pre:"prepend"}[t];return this.$slots[r]?{transform:`translateX(${t==="suf"?"-":""}${this.$el.querySelector(`.el-input-group__${r}`).offsetWidth}px)`}:null},clear(){this.$emit("input",""),this.$emit("change",""),this.$emit("clear"),this.setCurrentValue(""),this.focus()},allowKeyCode(t){if(!this.isPrice)return!0;const e=t.which?t.which:t.keyCode;return[69,187].includes(e)?(t.preventDefault(),!1):!0},resizeTextarea(){const{autosize:t,type:e}=this;if(e!=="textarea")return;if(!t){this.textareaCalcStyle={minHeight:YG(this.$refs.textarea).minHeight};return}const{minRows:r,maxRows:n}=t;this.textareaCalcStyle=YG(this.$refs.textarea,r,n)}}};var _at=function(){var e=this,r=e._self._c;return r("div",{staticClass:"input-container",class:[e.internalType==="textarea"?"el-textarea":"el-input",e.inputSize?"el-input--"+e.inputSize:"",e.styleClass?e.styleClass:"",e.focused?"is-focus":"",e.currentValue?"is-value":"",{"is-disabled":e.inputDisabled,"el-input-group":e.$slots.prepend||e.$slots.append,"el-input-group--append":e.$slots.append,"el-input-group--prepend":e.$slots.prepend,"el-input--prefix":e.$slots.prefix||e.prefixIcon,"el-input--suffix":e.$slots.suffix||e.suffixIcon||e.clearable,"el-input-error":e.validateState==="error"}],on:{mousewheel:e.preventScroll,mouseenter:function(n){e.hovering=!0},mouseleave:function(n){e.hovering=!1}}},[e.type!=="textarea"?[e.$slots.prepend?r("div",{staticClass:"el-input-group__prepend"},[e._t("prepend")],2):e._e(),e.internalType==="checkbox"?r("input",e._b({directives:[{name:"model",rawName:"v-model",value:e.internalValue,expression:"internalValue"}],ref:"input",staticClass:"el-input__inner",style:[e.inputPrefixOffset,e.inputSuffixOffset],attrs:{step:e.internalType==="number"?.01:!1,tabindex:e.tabindex,disabled:e.inputDisabled,autocomplete:e.autoComplete,"aria-label":e.label,type:"checkbox"},domProps:{checked:Array.isArray(e.internalValue)?e._i(e.internalValue,null)>-1:e.internalValue},on:{focus:e.handleFocus,blur:e.handleBlur,change:[function(n){var a=e.internalValue,o=n.target,i=!!o.checked;if(Array.isArray(a)){var s=null,u=e._i(a,s);o.checked?u<0&&(e.internalValue=a.concat([s])):u>-1&&(e.internalValue=a.slice(0,u).concat(a.slice(u+1)))}else e.internalValue=i},e.handleChange],keydown:e.allowKeyCode}},"input",e.$attrs,!1)):e.internalType==="radio"?r("input",e._b({directives:[{name:"model",rawName:"v-model",value:e.internalValue,expression:"internalValue"}],ref:"input",staticClass:"el-input__inner",style:[e.inputPrefixOffset,e.inputSuffixOffset],attrs:{step:e.internalType==="number"?.01:!1,tabindex:e.tabindex,disabled:e.inputDisabled,autocomplete:e.autoComplete,"aria-label":e.label,type:"radio"},domProps:{checked:e._q(e.internalValue,null)},on:{focus:e.handleFocus,blur:e.handleBlur,change:[function(n){e.internalValue=null},e.handleChange],keydown:e.allowKeyCode}},"input",e.$attrs,!1)):r("input",e._b({directives:[{name:"model",rawName:"v-model",value:e.internalValue,expression:"internalValue"}],ref:"input",staticClass:"el-input__inner",style:[e.inputPrefixOffset,e.inputSuffixOffset],attrs:{step:e.internalType==="number"?.01:!1,tabindex:e.tabindex,disabled:e.inputDisabled,autocomplete:e.autoComplete,"aria-label":e.label,type:e.internalType},domProps:{value:e.internalValue},on:{focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange,keydown:e.allowKeyCode,input:function(n){n.target.composing||(e.internalValue=n.target.value)}}},"input",e.$attrs,!1)),e.$slots.prefix||e.prefixIcon?r("span",{staticClass:"el-input__prefix",style:e.prefixOffset},[e._t("prefix"),e.prefixIcon?r("i",{staticClass:"el-input__icon",class:e.prefixIcon}):e._e()],2):e._e(),e.$slots.suffix||e.suffixIcon||e.showClear||e.validateState&&e.needStatusIcon?r("span",{staticClass:"el-input__suffix",style:e.suffixOffset},[r("span",{staticClass:"el-input__suffix-inner"},[e.showClear?r("div",{staticClass:"el-input__icon el-input__clear",on:{click:e.clear}},[r("svg",{attrs:{width:"20",height:"20",viewBox:"0 0 151 151",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M75.5 151c41.697499 0 75.5-33.8025 75.5-75.5S117.197499 0 75.5 0 0 33.8025 0 75.5 33.802501 151 75.5 151zm9.606602-75.5l19.441267-19.44127c2.932807-2.9328 2.933101-7.68184.004169-10.61077-2.922972-2.92297-7.679536-2.92706-10.610771.00417L74.5 64.8934 55.058733 45.45213c-2.932807-2.93281-7.681839-2.9331-10.610771-.00417-2.922973 2.92297-2.927066 7.67954.004169 10.61077L63.893398 75.5 44.452131 94.94127c-2.932807 2.9328-2.933101 7.68184-.004169 10.61077 2.922972 2.92297 7.679536 2.92706 10.610771-.00417L74.5 86.1066l19.441267 19.44127c2.932807 2.93281 7.681839 2.9331 10.610771.00417 2.922973-2.92297 2.927066-7.67954-.004169-10.61077L85.106602 75.5z",fill:"#738DA5","fill-rule":"evenodd"}})])]):[e._t("suffix"),e.suffixIcon?r("i",{staticClass:"el-input__icon",class:e.suffixIcon}):e._e()]],2),e.validateState?r("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",e.validateIcon]}):e._e()]):e._e(),e.$slots.append?r("div",{staticClass:"el-input-group__append"},[e._t("append")],2):e._e()]:r("textarea",e._b({directives:[{name:"model",rawName:"v-model",value:e.internalValue,expression:"internalValue"}],ref:"textarea",staticClass:"c-textarea el-input__inner",style:e.textareaStyle,attrs:{tabindex:e.tabindex,disabled:e.inputDisabled,"min-rows":"1"},domProps:{value:e.internalValue},on:{focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange,input:function(n){n.target.composing||(e.internalValue=n.target.value)}}},"textarea",e.$attrs,!1))],2)},bat=[],wat=$e(yat,_at,bat,!1,null,null,null,null);const GG=wat.exports,nmt="",amt="",xat={components:{BaseInput:GG},props:{value:{type:[Number,String,Date],default:null},format:{type:String,default:"P"},options:{type:Object,default(){return{}}},placeholder:{type:String,default:""},classList:{type:String,default:""},disabled:{type:Boolean,default:!1},customEl:{type:Boolean,default:!1},direction:{type:String,validator:t=>["start","end"].includes(t),default:null},range:{type:Boolean,default:!1},coRangePicker:{type:Object,default:null},clear:{type:Boolean,default:!1}},data(){return{visible:!1,defaultOptions:{firstDay:1,format:"P",showWeekNumber:!0,minDate:new Date}}},computed:{mergedOptions(){const t=this.$t("_common:pikaday");return Object.assign({i18n:t},this.defaultOptions,this.options)},internalValue(){return this.value?this.$formatDate(this.value,this.calcFormat):null},calcFormat(){return this.format||"P"}},watch:{options:{deep:!0,handler(){this.destroy(),this.create()}},clear(t){t&&this.resetRange()}},mounted(){this.create(),window.addEventListener("resize",this.rePosition)},beforeDestroy(){this.destroy(),window.removeEventListener("resize",this.rePosition)},methods:{create(){const t=this.customEl?this.$refs.input:this.$refs.input.$el;this.mergedOptions.field=t,this.bindListener("onSelect",()=>this.onSelect()),this.bindListener("onOpen",()=>this.onOpen()),this.bindListener("onClose",()=>this.onClose()),this.pikaday=new mat(this.mergedOptions);const e=this.value;!this.value&&this.autoDefault&&this.change(e),this.pikaday.setDate(e),this.range&&this.pikaday.setMinDate(null),this.mergedOptions.bound===!1?this.hide():this.visible?this.show():this.hide()},destroy(){!this.pikaday||this.pikaday.destroy()},change(t){if(t){let e=new Date(t);this.direction==="start"&&(e=D5(e)),this.direction==="end"&&(e=Kc(e)),e=e.toISOString(),this.$emit("input",e)}},onSelect(){const t=this.pikaday.getDate();this.change(t),this.range&&this.direction==="start"&&this.coRangePicker&&(this.pikaday.setStartRange(t),this.coRangePicker.setStartRange(t),this.coRangePicker.setMinDate(t)),this.range&&this.direction==="end"&&this.coRangePicker&&(this.pikaday.setEndRange(t),this.coRangePicker.setEndRange(t),this.coRangePicker.setMaxDate(t))},onOpen(){this.visible=!0,this.overflowCheck()},onClose(){rl(new Date(this.value))||(this.pikaday.setDate(null,!0),this.change(null)),this.visible=!1},show(){this.pikaday.show(),this.$emit("focus")},hide(){this.pikaday.hide(),this.$emit("blur")},bindListener(t,e){if(this.mergedOptions[t]){const r=this.mergedOptions[t];this.mergedOptions[t]=(...n)=>{r(n),e.apply(this)}}else this.mergedOptions[t]=e},overflowCheck(){!this.pikaday||parseInt(this.pikaday.el.style.left,10)<5&&(this.pikaday.el.style.left="5px")},rePosition(){!this.pikaday||(this.pikaday.adjustPosition(),this.overflowCheck())},resetRange(){this.pikaday.setDate(null,!0),this.pikaday.setStartRange(null),this.pikaday.setEndRange(null),this.direction==="start"&&this.pikaday.setMaxDate(null),this.direction==="end"&&this.pikaday.setMinDate(null)}}};var kat=function(){var e=this,r=e._self._c;return e.customEl?r("div",{ref:"input",class:[e.classList,{active:e.visible}],attrs:{readonly:"readonly",tabindex:"0"},on:{focus:e.show,input:e.onSelect,blur:e.hide}},[e._t("default")],2):r("div",[r("BaseInput",{ref:"input",staticClass:"base-date-picker",class:[e.classList,{active:e.visible}],attrs:{value:e.internalValue,placeholder:e.placeholder||e.$t("select",{thing:e.$t("date")}),disabled:e.disabled,readonly:"readonly"},on:{focus:e.show,blur:e.hide,input:e.onSelect}},[e.$slots.prefix?e._t("prefix",null,{slot:"prefix"}):e._e(),e.$slots.suffix?e._t("suffix",null,{slot:"suffix"}):e._e()],2)],1)},Pat=[],Tat=$e(xat,kat,Pat,!1,null,null,null,null);const KG=Tat.exports,imt="",Mat={name:"ErrorCallout",props:{message:{type:String,required:!0},size:{type:String,default:"normal"}}};var Sat=function(e,r){return e("div",{staticClass:"c-flex-row c-align-center font-inter",class:[r.data.staticClass],staticStyle:{"margin-top":"1rem"},style:[r.data.staticStyle]},[e("div",{staticClass:"error-wrapper has-text-danger",class:[`is-${r.props.size}`],staticStyle:{margin:"1rem 0"}},[e("BaseIcon",{staticStyle:{"margin-right":"0.5em",flex:"0 0 18px"},attrs:{type:"alert",size:"18"}}),e("div",[r._v(" "+r._s(r.props.message)+" ")])],1)])},Oat=[],Eat=$e(Mat,Sat,Oat,!0,null,"8d1ee7d0",null,null);const Dat=Eat.exports,omt="",Cat={name:"DocumentSendReminderItem",props:{label:{type:String,required:!0},value:{type:[Number,String],default:0},done:{type:Boolean,default:!1}}};var $at=function(){var e=this,r=e._self._c;return r("div",{staticClass:"reminder-row c-flex-row c-align-middle has-background-grey-lightest"},[r("div",{staticClass:"has-text-grey-dark",staticStyle:{flex:"1","margin-right":"1.5rem","user-select":"none"}},[e._v(" "+e._s(e.label)+" ")]),r("div",{staticClass:"number-wrapper"},[e.done?r("span",{staticClass:"has-text-success"},[r("BaseIcon",{attrs:{type:"check",size:"18"}}),e._v(" "+e._s(e.$t("sent"))+" ")],1):[r("CButton",{staticClass:"number-button",staticStyle:{width:"24px",height:"24px"},attrs:{icon:"minus",size:"small",circle:""},on:{click:function(n){e.$emit("input",Math.max(e.value-1,0))}}}),r("div",{staticClass:"number-value"},[e.value?[e._v(" "+e._s(e.$tc("day",{count:Number(e.value)}))+" ")]:r("span",{staticClass:"has-text-grey",staticStyle:{"font-size":"calc(1em - 2px)"}},[e._v(" "+e._s(e.$t("disabled").capitalize())+" ")])],2),r("CButton",{staticClass:"number-button",staticStyle:{width:"24px",height:"24px"},attrs:{icon:"plus",size:"small",circle:""},on:{click:function(n){return e.$emit("input",e.value+1)}}})]],2)])},Aat=[],Rat=$e(Cat,$at,Aat,!1,null,"54a51bdc",null,null);const Iat=Rat.exports,smt="",Nat={i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.send.reminders"},name:"DocumentSendReminders",components:{DocumentSendReminderItem:Iat},mixins:[dc()],props:{setFormValue:{type:Function,required:!0},removeFormValue:{type:Function,required:!0}},computed:{reminders(){const t={first:null,notViewed:null,notAnswered:null,expires:null};return this._document.reminders.forEach((e,r)=>{e.type==="first"?t.first={...e,index:r}:e.type==="viewed"?t.notViewed={...e,index:r}:e.type==="expires"?t.expires={...e,index:r}:t.notAnswered={...e,index:r}}),t}},methods:{getDefaultReminders(){if(!this._document.template)return[];const t=this._document.template.getDefaultData({path:"properties.data.properties.reminders"});return t&&Array.isArray(t)?t:[]},setReminder(t,e){let r="sendDays";if(typeof e=="string"&&(r="sendAt"),!e){this.removeFormValue(`data.reminders[${t.index}]`);return}if(typeof t=="string"){let n=this.getDefaultReminders().find(a=>a.type===t);if(n||(n=rd.default.find(a=>a.type===t)),!n)throw new Error("Could not find default reminder");n[r]=e,this.setFormValue({key:"data.reminders",value:n});return}this.setFormValue({key:`data.reminders[${t.index}].${r}`,value:e})}}};var Lat=function(){var e=this,r=e._self._c;return r("div",{staticClass:"font-inter",staticStyle:{"background-color":"white","border-radius":"0.5rem",padding:"2rem","font-size":"16px"}},[r("div",{staticStyle:{"font-size":"1.25em","font-weight":"700","margin-bottom":"0.25em","text-align":"center"}},[e._v(" "+e._s(e.$t("_common:reminder_plural").capitalize())+" ")]),r("div",{staticClass:"text-center has-text-grey-dark",staticStyle:{"max-width":"20rem",margin:"0 auto 2rem auto"}},[e._v(" "+e._s(e.$t("description"))+" ")]),e._l([{type:"notViewed",fallbackKey:"viewed"},{type:"notAnswered",fallbackKey:"reminder"},{type:"expires",fallbackKey:"expires"}],function(n,a){return r("DocumentSendReminderItem",{key:a,attrs:{label:e.$t(n.type),value:e.reminders[n.type]?e.reminders[n.type].sendDays:0,done:e.reminders[n.type]&&e.reminders[n.type].status==="successful"},on:{input:function(o){return e.setReminder(e.reminders[n.type]||n.fallbackKey,o)}}})}),r("div",{staticClass:"c-flex-row c-align-middle c-align-center",staticStyle:{"margin-top":"2.5rem"}},[r("CButton",{attrs:{type:"secondary",expanded:""},on:{click:function(n){return e.$emit("close")}}},[e._v(" "+e._s(e.$t("_common:save"))+" ")])],1)],2)},Wat=[],Fat=$e(Nat,Lat,Wat,!1,null,"ee5e99c4",null,null);const jat=Fat.exports,umt="";function XG(t,e){const r=new Date(t.getTime());return r.setDate(t.getDate()+(7+e-t.getDay()-1)%7+1),r.setHours(8,0,0,0),r}function JG(t){const e=new Date(t.getTime());return e.setDate(e.getDate()+1),e.setHours(10,0,0,0),e}let QG=JG(new Date),ZG=XG(new Date,1);const Vat={i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.send.later"},name:"DocumentSendLater",components:{BaseInput:GG,BaseDatePicker:KG},props:{_document:{type:Object,default:()=>({})},setFormValue:{type:Function,required:!0},removeFormValue:{type:Function,required:!0}},data(){return{sendAt:E5(new Date,5),showCustom:!1,backupSentFlag:!1}},validations:{sendAt:{minValue:t=>t>E5(new Date,2).toISOString()}},computed:{...e6("forms",{formData:t=>t.document2.data}),...Gd({deliveryTypes:"forms/deliveryTypes",isPostingDocument:"documents2/isPosting",isPostingProject:"projects/isPosting",feature:"application/feature"}),tomorrowMorning(){return QG.toISOString()},mondayMorning(){return ZG.toISOString()},reminderDeliveryTypes(){const t=["email"];return this.feature("sms")&&t.push("sms"),this.deliveryTypes?[...this.deliveryTypes.sms&&this.feature("sms")?["sms"]:[],...this.deliveryTypes.email?["email"]:[]]:t}},created(){QG=JG(new Date),ZG=XG(new Date,1)},methods:{...Ky({saveDocument:Oe.SAVE_DYNDOC_FORM}),setTime(t){const e=t.split(":"),r=new Date(this.sendAt).setHours(e[0],e[1]);r&&(this.sendAt=new Date(r).toISOString())},setDate(t){const e=new Date(this.sendAt),r=new Date(t).setHours(e.getHours(),e.getMinutes());this.sendAt=new Date(r).toISOString()},async onSendAt(t){try{if(this.$v.$invalid||this.isPostingDocument||this.isPostingProject||this.backupSentFlag)return;this.backupSentFlag=!0;const e={type:"first",status:"new",sendDays:0,sendAt:t,deliveryTypes:this.reminderDeliveryTypes,tries:0},r=this.formData.reminders.findIndex(a=>a.type==="first"),n=r>=0?`data.reminders[${r}]`:"data.reminders";this.setFormValue({key:n,value:e}),await this.saveDocument({doSend:!0}),this.backupSentFlag=!1}catch(e){this.$error(e)}finally{this.backupSentFlag=!1}}}};var zat=function(){var e=this,r=e._self._c;return r("div",{staticClass:"bg-white rounded-xl overflow-hidden font-inter"},[r("div",{staticClass:"px-6 pt-8 pb-3"},[r("div",{staticClass:"text-md font-semibold text-center"},[e._v(" "+e._s(e.$t("title"))+" ")]),r("div",{staticClass:"pt-8"},e._l([[e.tomorrowMorning,"tomorrowMorning"],[e.mondayMorning,"mondayMorning"]],function(n,a){return r("div",{key:a,staticClass:"bg-gray-50 border border-gray-200 p-4 rounded-md mb-4 cursor-pointer flex items-center justify-between text-sm hover:bg-gray-100 hover:border-gray-300 active:bg-gray-200 active:border-gray-400 select-none",on:{click:()=>e.onSendAt(n[0])}},[r("div",{staticClass:"font-medium"},[e._v(e._s(e.$t(n[1])))]),r("div",{staticClass:"text-gray-500"},[e._v(" "+e._s(e.$formatDate(n[0],"p, d MMM"))+" ")])])}),0)]),r("div",{staticClass:"px-8 py-6 bg-gray-100 border-t border-gray-200",class:e.showCustom?"":"cursor-pointer hover:bg-gray-200",on:{click:function(n){e.showCustom=!0}}},[r("div",{staticClass:"flex items-center text-sm"},[r("BaseIcon",{staticClass:"text-primary-500 mr-2",attrs:{type:"calendar",size:"18"}}),r("div",{staticClass:"font-medium",domProps:{textContent:e._s(e.$t("custom.title"))}})],1),r("Animation",[r("div",{directives:[{name:"show",rawName:"v-show",value:e.showCustom,expression:"showCustom"}],staticClass:"mt-4"},[r("div",{staticClass:"grid grid-cols-2 gap-4"},[r("BaseDatePicker",{attrs:{value:e.sendAt},on:{input:e.setDate}}),r("BaseInput",{attrs:{value:e.$formatDate(e.sendAt,"HH:mm"),clearable:!1,type:"time"},on:{input:e.setTime}})],1),e.$v.$invalid?r("div",{staticClass:"error-wrapper"},[r("BaseIcon",{staticClass:"mr-2 text-primary-500",attrs:{type:"calendar"}}),e._v(" "+e._s(e.$t("custom.invalid"))+" ")],1):e._e(),r("CButton",{staticStyle:{"margin-top":"1.5rem"},attrs:{loading:e.isPostingDocument||e.isPostingProject,type:"secondary",rounder:"",wide:""},on:{click:function(n){return e.onSendAt(e.sendAt)}}},[e._v(" "+e._s(e.$t("_common:send"))+" "+e._s(e.$formatDate(e.sendAt,"d MMM - p"))+" ")])],1)])],1)])},Uat=[],Hat=$e(Vat,zat,Uat,!1,null,"25247814",null,null);const qat=Hat.exports;var Bat=on,Yat=function(){return Bat.Date.now()},Gat=Yat,Kat=/\s/;function Xat(t){for(var e=t.length;e--&&Kat.test(t.charAt(e)););return e}var Jat=Xat,Qat=Jat,Zat=/^\s+/;function eit(t){return t&&t.slice(0,Qat(t)+1).replace(Zat,"")}var tit=eit,rit=tit,eK=ua,nit=tm,tK=0/0,ait=/^[-+]0x[0-9a-f]+$/i,iit=/^0b[01]+$/i,oit=/^0o[0-7]+$/i,sit=parseInt;function uit(t){if(typeof t=="number")return t;if(nit(t))return tK;if(eK(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=eK(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=rit(t);var r=iit.test(t);return r||oit.test(t)?sit(t.slice(2),r?2:8):ait.test(t)?tK:+t}var lit=uit,dit=ua,hL=Gat,rK=lit,cit="Expected a function",fit=Math.max,mit=Math.min;function pit(t,e,r){var n,a,o,i,s,u,l=0,d=!1,f=!1,m=!0;if(typeof t!="function")throw new TypeError(cit);e=rK(e)||0,dit(r)&&(d=!!r.leading,f="maxWait"in r,o=f?fit(rK(r.maxWait)||0,e):o,m="trailing"in r?!!r.trailing:m);function c(M){var C=n,F=a;return n=a=void 0,l=M,i=t.apply(F,C),i}function p(M){return l=M,s=setTimeout(g,e),d?c(M):i}function h(M){var C=M-u,F=M-l,T=e-C;return f?mit(T,o-F):T}function v(M){var C=M-u,F=M-l;return u===void 0||C>=e||C<0||f&&F>=o}function g(){var M=hL();if(v(M))return _(M);s=setTimeout(g,h(M))}function _(M){return s=void 0,m&&n?c(M):(n=a=void 0,i)}function y(){s!==void 0&&clearTimeout(s),l=0,n=u=a=s=void 0}function b(){return s===void 0?i:_(hL())}function k(){var M=hL(),C=v(M);if(n=arguments,a=this,u=M,C){if(s===void 0)return p(u);if(f)return clearTimeout(s),s=setTimeout(g,e),c(u)}return s===void 0&&(s=setTimeout(g,e)),i}return k.cancel=y,k.flush=b,k}var hit=pit;const vit={name:"SearchApi",props:{customSearch:{type:Object,default:()=>({})}},data(){return{defaultSearch:{project:!0,user:!0,endCustomer:!1,article:!1,extensionArticle:!1,invoice:!1,document:!1},hasLoadedUsers:!1,isLoading:!1,emptyQuery:null,hasSearchedAll:!1}},computed:{...Gd({allUsers:"companyUsers/all",allAuthenticatedCRMs:"settings/allAuthenticatedCRMs",can:"application/can"}),typesToFetch(){return Object.keys(this.customSearch).length?Object.keys(this.customSearch).filter(t=>this.customSearch[t]):Object.keys(this.defaultSearch).filter(t=>this.defaultSearch[t])}},methods:{...Ky({loadUsers:Oe.LOAD_COMPANY_USERS}),canFetchType(t){return t==="invoice"?this.can("invoices","read"):t==="endCustomer"?this.can("endCustomers","read"):t==="user"?this.can("users","modify"):!0},async fetch({query:t,start:e=null,end:r=null}){const n=this.typesToFetch.reduce((i,s)=>({...i,[s]:[]}),{}),a=t.toLowerCase();if(this.emptyQuery&&a&&a.startsWith(this.emptyQuery)||(this.emptyQuery=null,this.hasSearchedAll=!0,!a))return n;try{const i=[],s=Object.keys(this.defaultSearch);(this.typesToFetch||[]).forEach(u=>{!s.includes(u)||i.push((async()=>{let l=[];u==="document"?l=await this.fetchDocuments(a,e,r):u==="user"?l=await this.fetchUsers(a,e,r):u==="extensionArticle"?l=await this.fetchExtensionArticles(a,e,r):l=await this.fetchType(u,a,e,r),n[u]=l})())}),await Promise.all(i)}catch(i){throw i}finally{this.isLoading=!1}return Object.keys(n).every(i=>n[i].length===0)&&this.hasSearchedAll&&(this.emptyQuery=a),n},async fetchType(t,e,r,n){if(!this.canFetchType(t))return[];const{data:a}=await mt("search",{type:t,query:e,...r!==null&&n!==null&&{start:r,end:n}});return a},async fetchUsers(t,e,r){if(!this.canFetchType("user"))return[];this.hasLoadedUsers||(await this.loadUsers(),this.hasLoadedUsers=!0);const a=Object.values(this.allUsers).filter(o=>!!(o.fullName&&o.fullName.toLowerCase().includes(t)||o.email&&o.email.toLowerCase().includes(t)));return e!==null&&r!==null?a.slice(e,r):a},async fetchDocuments(t,e,r){const n=t.replace(/[-[\]{}()*+?.,\\/^$|#]/g,"\\$&"),a={$or:[{"data.name":{$regex:n,$options:"i"}},{"docNumber.value":{$regex:n,$options:"i"}},{clients:{$elemMatch:{$or:["name","email","socialNo","orgNo"].map(s=>({[s]:{$regex:n,$options:"i"}}))}}}]},{data:o}=await lt("/document",{params:{lean:!0,filter:encodeURIComponent(JSON.stringify(a)),fields:"clients,data.name,projectId,docNumber,createdAt",...e!==null&&r!==null&&{skip:e,limit:r-e}}}),{items:i=[]}=o||{};return i},async fetchExtensionArticles(t,e,r){const n=[];return await Promise.all(this.allAuthenticatedCRMs.map(async a=>{try{if(a==="pipedrive"&&t.length<2){this.hasSearchedAll=!1;return}const{data:o}=await t1.search(a,{query:t,type:"article"});o&&Array.isArray(o)&&n.push(...o)}catch{}})),n},triggerSearch:hit(async function({q:e,cb:r,start:n,end:a}){this.isLoading=!0;const o=await this.fetch({query:e,start:n,end:a});return this.isLoading=!1,r(o)},500)},render(){return this.$scopedSlots.default({fetch:({q:t,cb:e,start:r=null,end:n=null})=>(this.isLoading=!0,this.triggerSearch({q:t,cb:e,start:r,end:n})),isLoading:this.isLoading})}};var git=$e(vit,null,null,!1,null,null,null,null);const yit=git.exports,cmt="",_it={i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.clients"},name:"ClientAutocomplete",components:{SearchApi:yit},props:{searchEnabled:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!1},showEmpty:{type:Boolean,default:!1},filled:{type:Boolean,default:!1}},data(){return{convertToNewClient:vx,results:[],searchQuery:""}},methods:{search(t,e){this.$emit("input",e),this.searchEnabled&&(this.searchQuery=e,t({q:e,cb:({endCustomer:r})=>{this.results=r}}))}}};var bit=function(){var e=this,r=e._self._c;return r("SearchApi",{attrs:{"custom-search":{endCustomer:!0}},scopedSlots:e._u([{key:"default",fn:function({fetch:n,isLoading:a}){return[r("CAutocomplete",e._b({attrs:{data:e.results,loading:e.showLoading&&a,filled:e.filled,expanded:"","keep-first":""},on:{typing:function(o){return e.search(n,o)},select:function(o){e.$emit("setClient",e.convertToNewClient(o))}},scopedSlots:e._u([{key:"default",fn:function({option:o}){return r("div",{staticStyle:{"line-height":"1.5"}},[r("div",{staticStyle:{"font-weight":"500"}},[e._v(e._s(o.name||o.email))]),r("div",{staticClass:"has-text-grey-dark",staticStyle:{"font-size":"14px"}},[e._v(" "+e._s(o.reference?`${o.reference} \xB7 `:"")+" "+e._s(o.workStreet||o.street||"\xA0")+" ")])])}}],null,!0)},"CAutocomplete",{placeholder:e.$t("search.placeholder"),...e.$attrs,...e.$props},!1),[e.searchEnabled&&e.showEmpty?[r("div",{attrs:{slot:"footer"},slot:"footer"},[e.searchQuery&&!e.results.length?r("CButton",{staticStyle:{"font-weight":"600"},attrs:{type:"secondary",pattern:"tertiary",size:"small"},on:{click:function(o){return e.$emit("add")}}},[e._v(" "+e._s(e.$t("_common:add"))+" ")]):e._e()],1),r("template",{slot:"empty"},[e._v(" "+e._s(e.$t("search.empty"))+" "+e._s(e.searchQuery)+" ")])]:e._e()],2)]}}])})},wit=[],xit=$e(_it,bit,wit,!1,null,"5d023500",null,null);const nK=xit.exports,kit={i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.clients"},name:"AddClientCallout",components:{ClientAutocomplete:nK},mixins:[dc([])],props:{compact:{type:Boolean,default:!1}}};var Pit=function(){var e=this,r=e._self._c;return r("CCallout",{style:e.compact&&{backgroundColor:"white",boxShadow:"rgba(0, 0, 0, 0.21) 0px 3px 8px"},attrs:{title:e.compact?"":e.$t("title"),padding:e.compact?"10px":""}},[e.compact?e._e():r("div",{staticClass:"text-gray-700",staticStyle:{"padding-bottom":"1.5rem"}},[e._v(" "+e._s(e.$t("subTitle"))+" ")]),r("CField",{attrs:{grouped:"","group-multiline":""}},[r("div",{staticClass:"control"},[r("CButton",{staticClass:"is-left",attrs:{type:"secondary","icon-left":"plus"},on:{click:function(n){return e.$emit("add")}}},[e._v(" "+e._s(e.viewSettings.isPublicForm?e.$t("_common:add",{thing:e.$t("_common:recipient")}):e.$t("add.new"))+" ")])],1),e.viewSettings.isPublicForm?e._e():[e.compact?r("div",{staticClass:"control flex items-center text-gray-500",staticStyle:{width:"initial","font-size":"13px"}},[e._v(" "+e._s(e.$t("_common:or"))+" ")]):e._e(),r("ClientAutocomplete",e._g({staticStyle:{flex:"1 1 0"},attrs:{"show-loading":!0,"show-empty":!0,filled:e.compact,icon:"search","clear-on-select":""}},e.$listeners))]],2)],1)},Tit=[],Mit=$e(kit,Pit,Tit,!1,null,null,null,null);const Sit=Mit.exports;var aK={exports:{}};/*! VelocityJS.org (1.5.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */(function(t){/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */(function(e){if(e.jQuery)return;var r=function(d,f){return new r.fn.init(d,f)};r.isWindow=function(d){return d&&d===d.window},r.type=function(d){return d?typeof d=="object"||typeof d=="function"?o[s.call(d)]||"object":typeof d:d+""},r.isArray=Array.isArray||function(d){return r.type(d)==="array"};function n(d){var f=d.length,m=r.type(d);return m==="function"||r.isWindow(d)?!1:d.nodeType===1&&f?!0:m==="array"||f===0||typeof f=="number"&&f>0&&f-1 in d}r.isPlainObject=function(d){var f;if(!d||r.type(d)!=="object"||d.nodeType||r.isWindow(d))return!1;try{if(d.constructor&&!i.call(d,"constructor")&&!i.call(d.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}for(f in d);return f===void 0||i.call(d,f)},r.each=function(d,f,m){var c,p=0,h=d.length,v=n(d);if(m){if(v)for(;p<h&&(c=f.apply(d[p],m),c!==!1);p++);else for(p in d)if(!!d.hasOwnProperty(p)&&(c=f.apply(d[p],m),c===!1))break}else if(v)for(;p<h&&(c=f.call(d[p],p,d[p]),c!==!1);p++);else for(p in d)if(!!d.hasOwnProperty(p)&&(c=f.call(d[p],p,d[p]),c===!1))break;return d},r.data=function(d,f,m){if(m===void 0){var c=d[r.expando],p=c&&a[c];if(f===void 0)return p;if(p&&f in p)return p[f]}else if(f!==void 0){var h=d[r.expando]||(d[r.expando]=++r.uuid);return a[h]=a[h]||{},a[h][f]=m,m}},r.removeData=function(d,f){var m=d[r.expando],c=m&&a[m];c&&(f?r.each(f,function(p,h){delete c[h]}):delete a[m])},r.extend=function(){var d,f,m,c,p,h,v=arguments[0]||{},g=1,_=arguments.length,y=!1;for(typeof v=="boolean"&&(y=v,v=arguments[g]||{},g++),typeof v!="object"&&r.type(v)!=="function"&&(v={}),g===_&&(v=this,g--);g<_;g++)if(p=arguments[g])for(c in p)!p.hasOwnProperty(c)||(d=v[c],m=p[c],v!==m&&(y&&m&&(r.isPlainObject(m)||(f=r.isArray(m)))?(f?(f=!1,h=d&&r.isArray(d)?d:[]):h=d&&r.isPlainObject(d)?d:{},v[c]=r.extend(y,h,m)):m!==void 0&&(v[c]=m)));return v},r.queue=function(d,f,m){function c(h,v){var g=v||[];return h&&(n(Object(h))?function(_,y){for(var b=+y.length,k=0,M=_.length;k<b;)_[M++]=y[k++];if(b!==b)for(;y[k]!==void 0;)_[M++]=y[k++];return _.length=M,_}(g,typeof h=="string"?[h]:h):[].push.call(g,h)),g}if(!!d){f=(f||"fx")+"queue";var p=r.data(d,f);return m?(!p||r.isArray(m)?p=r.data(d,f,c(m)):p.push(m),p):p||[]}},r.dequeue=function(d,f){r.each(d.nodeType?[d]:d,function(m,c){f=f||"fx";var p=r.queue(c,f),h=p.shift();h==="inprogress"&&(h=p.shift()),h&&(f==="fx"&&p.unshift("inprogress"),h.call(c,function(){r.dequeue(c,f)}))})},r.fn=r.prototype={init:function(d){if(d.nodeType)return this[0]=d,this;throw new Error("Not a DOM node.")},offset:function(){var d=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:d.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:d.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function d(h){for(var v=h.offsetParent;v&&v.nodeName.toLowerCase()!=="html"&&v.style&&v.style.position.toLowerCase()==="static";)v=v.offsetParent;return v||document}var f=this[0],m=d(f),c=this.offset(),p=/^(?:body|html)$/i.test(m.nodeName)?{top:0,left:0}:r(m).offset();return c.top-=parseFloat(f.style.marginTop)||0,c.left-=parseFloat(f.style.marginLeft)||0,m.style&&(p.top+=parseFloat(m.style.borderTopWidth)||0,p.left+=parseFloat(m.style.borderLeftWidth)||0),{top:c.top-p.top,left:c.left-p.left}}};var a={};r.expando="velocity"+new Date().getTime(),r.uuid=0;for(var o={},i=o.hasOwnProperty,s=o.toString,u="Boolean Number String Function Array Date RegExp Object Error".split(" "),l=0;l<u.length;l++)o["[object "+u[l]+"]"]=u[l].toLowerCase();r.fn.init.prototype=r.fn,e.Velocity={Utilities:r}})(window),function(e){t.exports=e()}(function(){return function(e,r,n,a){var o=function(){if(n.documentMode)return n.documentMode;for(var x=7;x>4;x--){var S=n.createElement("div");if(S.innerHTML="<!--[if IE "+x+"]><span></span><![endif]-->",S.getElementsByTagName("span").length)return S=null,x}return a}(),i=function(){var x=0;return r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||function(S){var O=new Date().getTime(),P;return P=Math.max(0,16-(O-x)),x=O+P,setTimeout(function(){S(O+P)},P)}}(),s=function(){var x=r.performance||{};if(typeof x.now!="function"){var S=x.timing&&x.timing.navigationStart?x.timing.navigationStart:new Date().getTime();x.now=function(){return new Date().getTime()-S}}return x}();function u(x){for(var S=-1,O=x?x.length:0,P=[];++S<O;){var w=x[S];w&&P.push(w)}return P}var l=function(){var x=Array.prototype.slice;try{return x.call(n.documentElement),x}catch{return function(O,P){var w=this.length;if(typeof O!="number"&&(O=0),typeof P!="number"&&(P=w),this.slice)return x.call(this,O,P);var D,R=[],j=O>=0?O:Math.max(0,w+O),H=P<0?w+P:Math.min(P,w),q=H-j;if(q>0)if(R=new Array(q),this.charAt)for(D=0;D<q;D++)R[D]=this.charAt(j+D);else for(D=0;D<q;D++)R[D]=this[j+D];return R}}}(),d=function(){return Array.prototype.includes?function(x,S){return x.includes(S)}:Array.prototype.indexOf?function(x,S){return x.indexOf(S)>=0}:function(x,S){for(var O=0;O<x.length;O++)if(x[O]===S)return!0;return!1}};function f(x){return m.isWrapped(x)?x=l.call(x):m.isNode(x)&&(x=[x]),x}var m={isNumber:function(x){return typeof x=="number"},isString:function(x){return typeof x=="string"},isArray:Array.isArray||function(x){return Object.prototype.toString.call(x)==="[object Array]"},isFunction:function(x){return Object.prototype.toString.call(x)==="[object Function]"},isNode:function(x){return x&&x.nodeType},isWrapped:function(x){return x&&x!==r&&m.isNumber(x.length)&&!m.isString(x)&&!m.isFunction(x)&&!m.isNode(x)&&(x.length===0||m.isNode(x[0]))},isSVG:function(x){return r.SVGElement&&x instanceof r.SVGElement},isEmptyObject:function(x){for(var S in x)if(x.hasOwnProperty(S))return!1;return!0}},c,p=!1;if(e.fn&&e.fn.jquery?(c=e,p=!0):c=r.Velocity.Utilities,o<=8&&!p)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(o<=7){jQuery.fn.velocity=jQuery.fn.animate;return}var h=400,v="swing",g={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(r.navigator.userAgent),isAndroid:/Android/i.test(r.navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(r.navigator.userAgent),isChrome:r.chrome,isFirefox:/Firefox/i.test(r.navigator.userAgent),prefixElement:n.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[],delayedElements:{count:0}},CSS:{},Utilities:c,Redirects:{},Easings:{},Promise:r.Promise,defaults:{queue:"",duration:h,easing:v,begin:a,complete:a,progress:a,display:a,visibility:a,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0,promiseRejectEmpty:!0},init:function(x){c.data(x,"velocity",{isSVG:m.isSVG(x),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:5,patch:2},debug:!1,timestamp:!0,pauseAll:function(x){var S=new Date().getTime();c.each(g.State.calls,function(O,P){if(P){if(x!==a&&(P[2].queue!==x||P[2].queue===!1))return!0;P[5]={resume:!1}}}),c.each(g.State.delayedElements,function(O,P){!P||y(P,S)})},resumeAll:function(x){new Date().getTime(),c.each(g.State.calls,function(S,O){if(O){if(x!==a&&(O[2].queue!==x||O[2].queue===!1))return!0;O[5]&&(O[5].resume=!0)}}),c.each(g.State.delayedElements,function(S,O){!O||b(O)})}};r.pageYOffset!==a?(g.State.scrollAnchor=r,g.State.scrollPropertyLeft="pageXOffset",g.State.scrollPropertyTop="pageYOffset"):(g.State.scrollAnchor=n.documentElement||n.body.parentNode||n.body,g.State.scrollPropertyLeft="scrollLeft",g.State.scrollPropertyTop="scrollTop");function _(x){var S=c.data(x,"velocity");return S===null?a:S}function y(x,S){var O=_(x);O&&O.delayTimer&&!O.delayPaused&&(O.delayRemaining=O.delay-S+O.delayBegin,O.delayPaused=!0,clearTimeout(O.delayTimer.setTimeout))}function b(x,S){var O=_(x);O&&O.delayTimer&&O.delayPaused&&(O.delayPaused=!1,O.delayTimer.setTimeout=setTimeout(O.delayTimer.next,O.delayRemaining))}function k(x){return function(S){return Math.round(S*x)*(1/x)}}function M(x,S,O,P){var w=4,D=.001,R=1e-7,j=10,H=11,q=1/(H-1),Y="Float32Array"in r;if(arguments.length!==4)return!1;for(var G=0;G<4;++G)if(typeof arguments[G]!="number"||isNaN(arguments[G])||!isFinite(arguments[G]))return!1;x=Math.min(x,1),O=Math.min(O,1),x=Math.max(x,0),O=Math.max(O,0);var X=Y?new Float32Array(H):new Array(H);function ne(ee,A){return 1-3*A+3*ee}function me(ee,A){return 3*A-6*ee}function fe(ee){return 3*ee}function we(ee,A,I){return((ne(A,I)*ee+me(A,I))*ee+fe(A))*ee}function je(ee,A,I){return 3*ne(A,I)*ee*ee+2*me(A,I)*ee+fe(A)}function Le(ee,A){for(var I=0;I<w;++I){var B=je(A,x,O);if(B===0)return A;var K=we(A,x,O)-ee;A-=K/B}return A}function Ve(){for(var ee=0;ee<H;++ee)X[ee]=we(ee*q,x,O)}function ye(ee,A,I){var B,K,Z=0;do K=A+(I-A)/2,B=we(K,x,O)-ee,B>0?I=K:A=K;while(Math.abs(B)>R&&++Z<j);return K}function Ae(ee){for(var A=0,I=1,B=H-1;I!==B&&X[I]<=ee;++I)A+=q;--I;var K=(ee-X[I])/(X[I+1]-X[I]),Z=A+K*q,pe=je(Z,x,O);return pe>=D?Le(ee,Z):pe===0?Z:ye(ee,A,A+q)}var ze=!1;function Pt(){ze=!0,(x!==S||O!==P)&&Ve()}var Ot=function(ee){return ze||Pt(),x===S&&O===P?ee:ee===0?0:ee===1?1:we(Ae(ee),S,P)};Ot.getControlPoints=function(){return[{x,y:S},{x:O,y:P}]};var et="generateBezier("+[x,S,O,P]+")";return Ot.toString=function(){return et},Ot}var C=function(){function x(P){return-P.tension*P.x-P.friction*P.v}function S(P,w,D){var R={x:P.x+D.dx*w,v:P.v+D.dv*w,tension:P.tension,friction:P.friction};return{dx:R.v,dv:x(R)}}function O(P,w){var D={dx:P.v,dv:x(P)},R=S(P,w*.5,D),j=S(P,w*.5,R),H=S(P,w,j),q=1/6*(D.dx+2*(R.dx+j.dx)+H.dx),Y=1/6*(D.dv+2*(R.dv+j.dv)+H.dv);return P.x=P.x+q*w,P.v=P.v+Y*w,P}return function P(w,D,R){var j={x:-1,v:0,tension:null,friction:null},H=[0],q=0,Y=1/1e4,G=16/1e3,X,ne,me;for(w=parseFloat(w)||500,D=parseFloat(D)||20,R=R||null,j.tension=w,j.friction=D,X=R!==null,X?(q=P(w,D),ne=q/R*G):ne=G;me=O(me||j,ne),H.push(1+me.x),q+=16,Math.abs(me.x)>Y&&Math.abs(me.v)>Y;);return X?function(fe){return H[fe*(H.length-1)|0]}:q}}();g.Easings={linear:function(x){return x},swing:function(x){return .5-Math.cos(x*Math.PI)/2},spring:function(x){return 1-Math.cos(x*4.5*Math.PI)*Math.exp(-x*6)}},c.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(x,S){g.Easings[S[0]]=M.apply(null,S[1])});function F(x,S){var O=x;return m.isString(x)?g.Easings[x]||(O=!1):m.isArray(x)&&x.length===1?O=k.apply(null,x):m.isArray(x)&&x.length===2?O=C.apply(null,x.concat([S])):m.isArray(x)&&x.length===4?O=M.apply(null,x):O=!1,O===!1&&(g.Easings[g.defaults.easing]?O=g.defaults.easing:O=v),O}var T=g.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/ig},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"],units:["%","em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","Q","in","pc","pt","px","deg","grad","rad","turn","s","ms"],colorNames:{aliceblue:"240,248,255",antiquewhite:"250,235,215",aquamarine:"127,255,212",aqua:"0,255,255",azure:"240,255,255",beige:"245,245,220",bisque:"255,228,196",black:"0,0,0",blanchedalmond:"255,235,205",blueviolet:"138,43,226",blue:"0,0,255",brown:"165,42,42",burlywood:"222,184,135",cadetblue:"95,158,160",chartreuse:"127,255,0",chocolate:"210,105,30",coral:"255,127,80",cornflowerblue:"100,149,237",cornsilk:"255,248,220",crimson:"220,20,60",cyan:"0,255,255",darkblue:"0,0,139",darkcyan:"0,139,139",darkgoldenrod:"184,134,11",darkgray:"169,169,169",darkgrey:"169,169,169",darkgreen:"0,100,0",darkkhaki:"189,183,107",darkmagenta:"139,0,139",darkolivegreen:"85,107,47",darkorange:"255,140,0",darkorchid:"153,50,204",darkred:"139,0,0",darksalmon:"233,150,122",darkseagreen:"143,188,143",darkslateblue:"72,61,139",darkslategray:"47,79,79",darkturquoise:"0,206,209",darkviolet:"148,0,211",deeppink:"255,20,147",deepskyblue:"0,191,255",dimgray:"105,105,105",dimgrey:"105,105,105",dodgerblue:"30,144,255",firebrick:"178,34,34",floralwhite:"255,250,240",forestgreen:"34,139,34",fuchsia:"255,0,255",gainsboro:"220,220,220",ghostwhite:"248,248,255",gold:"255,215,0",goldenrod:"218,165,32",gray:"128,128,128",grey:"128,128,128",greenyellow:"173,255,47",green:"0,128,0",honeydew:"240,255,240",hotpink:"255,105,180",indianred:"205,92,92",indigo:"75,0,130",ivory:"255,255,240",khaki:"240,230,140",lavenderblush:"255,240,245",lavender:"230,230,250",lawngreen:"124,252,0",lemonchiffon:"255,250,205",lightblue:"173,216,230",lightcoral:"240,128,128",lightcyan:"224,255,255",lightgoldenrodyellow:"250,250,210",lightgray:"211,211,211",lightgrey:"211,211,211",lightgreen:"144,238,144",lightpink:"255,182,193",lightsalmon:"255,160,122",lightseagreen:"32,178,170",lightskyblue:"135,206,250",lightslategray:"119,136,153",lightsteelblue:"176,196,222",lightyellow:"255,255,224",limegreen:"50,205,50",lime:"0,255,0",linen:"250,240,230",magenta:"255,0,255",maroon:"128,0,0",mediumaquamarine:"102,205,170",mediumblue:"0,0,205",mediumorchid:"186,85,211",mediumpurple:"147,112,219",mediumseagreen:"60,179,113",mediumslateblue:"123,104,238",mediumspringgreen:"0,250,154",mediumturquoise:"72,209,204",mediumvioletred:"199,21,133",midnightblue:"25,25,112",mintcream:"245,255,250",mistyrose:"255,228,225",moccasin:"255,228,181",navajowhite:"255,222,173",navy:"0,0,128",oldlace:"253,245,230",olivedrab:"107,142,35",olive:"128,128,0",orangered:"255,69,0",orange:"255,165,0",orchid:"218,112,214",palegoldenrod:"238,232,170",palegreen:"152,251,152",paleturquoise:"175,238,238",palevioletred:"219,112,147",papayawhip:"255,239,213",peachpuff:"255,218,185",peru:"205,133,63",pink:"255,192,203",plum:"221,160,221",powderblue:"176,224,230",purple:"128,0,128",red:"255,0,0",rosybrown:"188,143,143",royalblue:"65,105,225",saddlebrown:"139,69,19",salmon:"250,128,114",sandybrown:"244,164,96",seagreen:"46,139,87",seashell:"255,245,238",sienna:"160,82,45",silver:"192,192,192",skyblue:"135,206,235",slateblue:"106,90,205",slategray:"112,128,144",snow:"255,250,250",springgreen:"0,255,127",steelblue:"70,130,180",tan:"210,180,140",teal:"0,128,128",thistle:"216,191,216",tomato:"255,99,71",turquoise:"64,224,208",violet:"238,130,238",wheat:"245,222,179",whitesmoke:"245,245,245",white:"255,255,255",yellowgreen:"154,205,50",yellow:"255,255,0"}},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var x=0;x<T.Lists.colors.length;x++){var S=T.Lists.colors[x]==="color"?"0 0 0 1":"255 255 255 1";T.Hooks.templates[T.Lists.colors[x]]=["Red Green Blue Alpha",S]}var O,P,w;if(o){for(O in T.Hooks.templates)if(!!T.Hooks.templates.hasOwnProperty(O)){P=T.Hooks.templates[O],w=P[0].split(" ");var D=P[1].match(T.RegEx.valueSplit);w[0]==="Color"&&(w.push(w.shift()),D.push(D.shift()),T.Hooks.templates[O]=[w.join(" "),D.join(" ")])}}for(O in T.Hooks.templates)if(!!T.Hooks.templates.hasOwnProperty(O)){P=T.Hooks.templates[O],w=P[0].split(" ");for(var R in w)if(!!w.hasOwnProperty(R)){var j=O+w[R],H=R;T.Hooks.registered[j]=[O,H]}}},getRoot:function(x){var S=T.Hooks.registered[x];return S?S[0]:x},getUnit:function(x,S){var O=(x.substr(S||0,5).match(/^[a-z%]+/)||[])[0]||"";return O&&d(T.Lists.units)?O:""},fixColors:function(x){return x.replace(/(rgba?\(\s*)?(\b[a-z]+\b)/g,function(S,O,P){return T.Lists.colorNames.hasOwnProperty(P)?(O||"rgba(")+T.Lists.colorNames[P]+(O?"":",1)"):O+P})},cleanRootPropertyValue:function(x,S){return T.RegEx.valueUnwrap.test(S)&&(S=S.match(T.RegEx.valueUnwrap)[1]),T.Values.isCSSNullValue(S)&&(S=T.Hooks.templates[x][1]),S},extractValue:function(x,S){var O=T.Hooks.registered[x];if(O){var P=O[0],w=O[1];return S=T.Hooks.cleanRootPropertyValue(P,S),S.toString().match(T.RegEx.valueSplit)[w]}else return S},injectValue:function(x,S,O){var P=T.Hooks.registered[x];if(P){var w=P[0],D=P[1],R,j;return O=T.Hooks.cleanRootPropertyValue(w,O),R=O.toString().match(T.RegEx.valueSplit),R[D]=S,j=R.join(" "),j}else return O}},Normalizations:{registered:{clip:function(x,S,O){switch(x){case"name":return"clip";case"extract":var P;return T.RegEx.wrappedValueAlreadyExtracted.test(O)?P=O:(P=O.toString().match(T.RegEx.valueUnwrap),P=P?P[1].replace(/,(\s+)?/g," "):O),P;case"inject":return"rect("+O+")"}},blur:function(x,S,O){switch(x){case"name":return g.State.isFirefox?"filter":"-webkit-filter";case"extract":var P=parseFloat(O);if(!(P||P===0)){var w=O.toString().match(/blur\(([0-9]+[A-z]+)\)/i);w?P=w[1]:P=0}return P;case"inject":return parseFloat(O)?"blur("+O+")":"none"}},opacity:function(x,S,O){if(o<=8)switch(x){case"name":return"filter";case"extract":var P=O.toString().match(/alpha\(opacity=(.*)\)/i);return P?O=P[1]/100:O=1,O;case"inject":return S.style.zoom=1,parseFloat(O)>=1?"":"alpha(opacity="+parseInt(parseFloat(O)*100,10)+")"}else switch(x){case"name":return"opacity";case"extract":return O;case"inject":return O}}},register:function(){(!o||o>9)&&!g.State.isGingerbread&&(T.Lists.transformsBase=T.Lists.transformsBase.concat(T.Lists.transforms3D));for(var x=0;x<T.Lists.transformsBase.length;x++)(function(){var w=T.Lists.transformsBase[x];T.Normalizations.registered[w]=function(D,R,j){switch(D){case"name":return"transform";case"extract":return _(R)===a||_(R).transformCache[w]===a?/^scale/i.test(w)?1:0:_(R).transformCache[w].replace(/[()]/g,"");case"inject":var H=!1;switch(w.substr(0,w.length-1)){case"translate":H=!/(%|px|em|rem|vw|vh|\d)$/i.test(j);break;case"scal":case"scale":g.State.isAndroid&&_(R).transformCache[w]===a&&j<1&&(j=1),H=!/(\d)$/i.test(j);break;case"skew":H=!/(deg|\d)$/i.test(j);break;case"rotate":H=!/(deg|\d)$/i.test(j);break}return H||(_(R).transformCache[w]="("+j+")"),_(R).transformCache[w]}}})();for(var S=0;S<T.Lists.colors.length;S++)(function(){var w=T.Lists.colors[S];T.Normalizations.registered[w]=function(D,R,j){switch(D){case"name":return w;case"extract":var H;if(T.RegEx.wrappedValueAlreadyExtracted.test(j))H=j;else{var q,Y={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(j)?Y[j]!==a?q=Y[j]:q=Y.black:T.RegEx.isHex.test(j)?q="rgb("+T.Values.hexToRgb(j).join(" ")+")":/^rgba?\(/i.test(j)||(q=Y.black),H=(q||j).toString().match(T.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return(!o||o>8)&&H.split(" ").length===3&&(H+=" 1"),H;case"inject":return/^rgb/.test(j)?j:(o<=8?j.split(" ").length===4&&(j=j.split(/\s+/).slice(0,3).join(" ")):j.split(" ").length===3&&(j+=" 1"),(o<=8?"rgb":"rgba")+"("+j.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")")}}})();function O(w,D,R){var j=T.getPropertyValue(D,"boxSizing").toString().toLowerCase()==="border-box";if(j===(R||!1)){var H,q,Y=0,G=w==="width"?["Left","Right"]:["Top","Bottom"],X=["padding"+G[0],"padding"+G[1],"border"+G[0]+"Width","border"+G[1]+"Width"];for(H=0;H<X.length;H++)q=parseFloat(T.getPropertyValue(D,X[H])),isNaN(q)||(Y+=q);return R?-Y:Y}return 0}function P(w,D){return function(R,j,H){switch(R){case"name":return w;case"extract":return parseFloat(H)+O(w,j,D);case"inject":return parseFloat(H)-O(w,j,D)+"px"}}}T.Normalizations.registered.innerWidth=P("width",!0),T.Normalizations.registered.innerHeight=P("height",!0),T.Normalizations.registered.outerWidth=P("width"),T.Normalizations.registered.outerHeight=P("height")}},Names:{camelCase:function(x){return x.replace(/-(\w)/g,function(S,O){return O.toUpperCase()})},SVGAttribute:function(x){var S="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(o||g.State.isAndroid&&!g.State.isChrome)&&(S+="|transform"),new RegExp("^("+S+")$","i").test(x)},prefixCheck:function(x){if(g.State.prefixMatches[x])return[g.State.prefixMatches[x],!0];for(var S=["","Webkit","Moz","ms","O"],O=0,P=S.length;O<P;O++){var w;if(O===0?w=x:w=S[O]+x.replace(/^\w/,function(D){return D.toUpperCase()}),m.isString(g.State.prefixElement.style[w]))return g.State.prefixMatches[x]=w,[w,!0]}return[x,!1]}},Values:{hexToRgb:function(x){var S=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,O=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,P;return x=x.replace(S,function(w,D,R,j){return D+D+R+R+j+j}),P=O.exec(x),P?[parseInt(P[1],16),parseInt(P[2],16),parseInt(P[3],16)]:[0,0,0]},isCSSNullValue:function(x){return!x||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(x)},getUnitType:function(x){return/^(rotate|skew)/i.test(x)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(x)?"":"px"},getDisplayType:function(x){var S=x&&x.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(S)?"inline":/^(li)$/i.test(S)?"list-item":/^(tr)$/i.test(S)?"table-row":/^(table)$/i.test(S)?"table":/^(tbody)$/i.test(S)?"table-row-group":"block"},addClass:function(x,S){if(x)if(x.classList)x.classList.add(S);else if(m.isString(x.className))x.className+=(x.className.length?" ":"")+S;else{var O=x.getAttribute(o<=7?"className":"class")||"";x.setAttribute("class",O+(O?" ":"")+S)}},removeClass:function(x,S){if(x)if(x.classList)x.classList.remove(S);else if(m.isString(x.className))x.className=x.className.toString().replace(new RegExp("(^|\\s)"+S.split(" ").join("|")+"(\\s|$)","gi")," ");else{var O=x.getAttribute(o<=7?"className":"class")||"";x.setAttribute("class",O.replace(new RegExp("(^|s)"+S.split(" ").join("|")+"(s|$)","gi")," "))}}},getPropertyValue:function(x,S,O,P){function w(G,X){var ne=0;if(o<=8)ne=c.css(G,X);else{var me=!1;/^(width|height)$/.test(X)&&T.getPropertyValue(G,"display")===0&&(me=!0,T.setPropertyValue(G,"display",T.Values.getDisplayType(G)));var fe=function(){me&&T.setPropertyValue(G,"display","none")};if(!P){if(X==="height"&&T.getPropertyValue(G,"boxSizing").toString().toLowerCase()!=="border-box"){var we=G.offsetHeight-(parseFloat(T.getPropertyValue(G,"borderTopWidth"))||0)-(parseFloat(T.getPropertyValue(G,"borderBottomWidth"))||0)-(parseFloat(T.getPropertyValue(G,"paddingTop"))||0)-(parseFloat(T.getPropertyValue(G,"paddingBottom"))||0);return fe(),we}else if(X==="width"&&T.getPropertyValue(G,"boxSizing").toString().toLowerCase()!=="border-box"){var je=G.offsetWidth-(parseFloat(T.getPropertyValue(G,"borderLeftWidth"))||0)-(parseFloat(T.getPropertyValue(G,"borderRightWidth"))||0)-(parseFloat(T.getPropertyValue(G,"paddingLeft"))||0)-(parseFloat(T.getPropertyValue(G,"paddingRight"))||0);return fe(),je}}var Le;_(G)===a?Le=r.getComputedStyle(G,null):_(G).computedStyle?Le=_(G).computedStyle:Le=_(G).computedStyle=r.getComputedStyle(G,null),X==="borderColor"&&(X="borderTopColor"),o===9&&X==="filter"?ne=Le.getPropertyValue(X):ne=Le[X],(ne===""||ne===null)&&(ne=G.style[X]),fe()}if(ne==="auto"&&/^(top|right|bottom|left)$/i.test(X)){var Ve=w(G,"position");(Ve==="fixed"||Ve==="absolute"&&/top|left/i.test(X))&&(ne=c(G).position()[X]+"px")}return ne}var D;if(T.Hooks.registered[S]){var R=S,j=T.Hooks.getRoot(R);O===a&&(O=T.getPropertyValue(x,T.Names.prefixCheck(j)[0])),T.Normalizations.registered[j]&&(O=T.Normalizations.registered[j]("extract",x,O)),D=T.Hooks.extractValue(R,O)}else if(T.Normalizations.registered[S]){var H,q;H=T.Normalizations.registered[S]("name",x),H!=="transform"&&(q=w(x,T.Names.prefixCheck(H)[0]),T.Values.isCSSNullValue(q)&&T.Hooks.templates[S]&&(q=T.Hooks.templates[S][1])),D=T.Normalizations.registered[S]("extract",x,q)}if(!/^[\d-]/.test(D)){var Y=_(x);if(Y&&Y.isSVG&&T.Names.SVGAttribute(S))if(/^(height|width)$/i.test(S))try{D=x.getBBox()[S]}catch{D=0}else D=x.getAttribute(S);else D=w(x,T.Names.prefixCheck(S)[0])}return T.Values.isCSSNullValue(D)&&(D=0),g.debug>=2&&console.log("Get "+S+": "+D),D},setPropertyValue:function(x,S,O,P,w){var D=S;if(S==="scroll")w.container?w.container["scroll"+w.direction]=O:w.direction==="Left"?r.scrollTo(O,w.alternateValue):r.scrollTo(w.alternateValue,O);else if(T.Normalizations.registered[S]&&T.Normalizations.registered[S]("name",x)==="transform")T.Normalizations.registered[S]("inject",x,O),D="transform",O=_(x).transformCache[S];else{if(T.Hooks.registered[S]){var R=S,j=T.Hooks.getRoot(S);P=P||T.getPropertyValue(x,j),O=T.Hooks.injectValue(R,O,P),S=j}if(T.Normalizations.registered[S]&&(O=T.Normalizations.registered[S]("inject",x,O),S=T.Normalizations.registered[S]("name",x)),D=T.Names.prefixCheck(S)[0],o<=8)try{x.style[D]=O}catch{g.debug&&console.log("Browser does not support ["+O+"] for ["+D+"]")}else{var H=_(x);H&&H.isSVG&&T.Names.SVGAttribute(S)?x.setAttribute(S,O):x.style[D]=O}g.debug>=2&&console.log("Set "+S+" ("+D+"): "+O)}return[D,O]},flushTransformCache:function(x){var S="",O=_(x);if((o||g.State.isAndroid&&!g.State.isChrome)&&O&&O.isSVG){var P=function(j){return parseFloat(T.getPropertyValue(x,j))},w={translate:[P("translateX"),P("translateY")],skewX:[P("skewX")],skewY:[P("skewY")],scale:P("scale")!==1?[P("scale"),P("scale")]:[P("scaleX"),P("scaleY")],rotate:[P("rotateZ"),0,0]};c.each(_(x).transformCache,function(j){/^translate/i.test(j)?j="translate":/^scale/i.test(j)?j="scale":/^rotate/i.test(j)&&(j="rotate"),w[j]&&(S+=j+"("+w[j].join(" ")+") ",delete w[j])})}else{var D,R;c.each(_(x).transformCache,function(j){if(D=_(x).transformCache[j],j==="transformPerspective")return R=D,!0;o===9&&j==="rotateZ"&&(j="rotate"),S+=j+D+" "}),R&&(S="perspective"+R+" "+S)}T.setPropertyValue(x,"transform",S)}};T.Hooks.register(),T.Normalizations.register(),g.hook=function(x,S,O){var P;return x=f(x),c.each(x,function(w,D){if(_(D)===a&&g.init(D),O===a)P===a&&(P=T.getPropertyValue(D,S));else{var R=T.setPropertyValue(D,S,O);R[0]==="transform"&&g.CSS.flushTransformCache(D),P=R}}),P};var N=function(){var x;function S(){return P?q.promise||null:w}var O=arguments[0]&&(arguments[0].p||c.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||m.isString(arguments[0].properties)),P,w,D,R,j,H;m.isWrapped(this)?(P=!1,D=0,R=this,w=this):(P=!0,D=1,R=O?arguments[0].elements||arguments[0].e:arguments[0]);var q={promise:null,resolver:null,rejecter:null};if(P&&g.Promise&&(q.promise=new g.Promise(function(ee,A){q.resolver=ee,q.rejecter=A})),O?(j=arguments[0].properties||arguments[0].p,H=arguments[0].options||arguments[0].o):(j=arguments[D],H=arguments[D+1]),R=f(R),!R){q.promise&&(!j||!H||H.promiseRejectEmpty!==!1?q.rejecter():q.resolver());return}var Y=R.length,G=0;if(!/^(stop|finish|finishAll|pause|resume)$/i.test(j)&&!c.isPlainObject(H)){var X=D+1;H={};for(var ne=X;ne<arguments.length;ne++)!m.isArray(arguments[ne])&&(/^(fast|normal|slow)$/i.test(arguments[ne])||/^\d/.test(arguments[ne]))?H.duration=arguments[ne]:m.isString(arguments[ne])||m.isArray(arguments[ne])?H.easing=arguments[ne]:m.isFunction(arguments[ne])&&(H.complete=arguments[ne])}var me;switch(j){case"scroll":me="scroll";break;case"reverse":me="reverse";break;case"pause":var fe=new Date().getTime();return c.each(R,function(ee,A){y(A,fe)}),c.each(g.State.calls,function(ee,A){var I=!1;A&&c.each(A[1],function(B,K){var Z=H===a?"":H;if(Z!==!0&&A[2].queue!==Z&&!(H===a&&A[2].queue===!1))return!0;if(c.each(R,function(pe,ge){if(ge===K)return A[5]={resume:!1},I=!0,!1}),I)return!1})}),S();case"resume":return c.each(R,function(ee,A){b(A)}),c.each(g.State.calls,function(ee,A){var I=!1;A&&c.each(A[1],function(B,K){var Z=H===a?"":H;if(Z!==!0&&A[2].queue!==Z&&!(H===a&&A[2].queue===!1)||!A[5])return!0;if(c.each(R,function(pe,ge){if(ge===K)return A[5].resume=!0,I=!0,!1}),I)return!1})}),S();case"finish":case"finishAll":case"stop":c.each(R,function(ee,A){_(A)&&_(A).delayTimer&&(clearTimeout(_(A).delayTimer.setTimeout),_(A).delayTimer.next&&_(A).delayTimer.next(),delete _(A).delayTimer),j==="finishAll"&&(H===!0||m.isString(H))&&(c.each(c.queue(A,m.isString(H)?H:""),function(I,B){m.isFunction(B)&&B()}),c.queue(A,m.isString(H)?H:"",[]))});var we=[];return c.each(g.State.calls,function(ee,A){A&&c.each(A[1],function(I,B){var K=H===a?"":H;if(K!==!0&&A[2].queue!==K&&!(H===a&&A[2].queue===!1))return!0;c.each(R,function(Z,pe){if(pe===B)if((H===!0||m.isString(H))&&(c.each(c.queue(pe,m.isString(H)?H:""),function(Pe,de){m.isFunction(de)&&de(null,!0)}),c.queue(pe,m.isString(H)?H:"",[])),j==="stop"){var ge=_(pe);ge&&ge.tweensContainer&&(K===!0||K==="")&&c.each(ge.tweensContainer,function(Pe,de){de.endValue=de.currentValue}),we.push(ee)}else(j==="finish"||j==="finishAll")&&(A[2].duration=1)})})}),j==="stop"&&(c.each(we,function(ee,A){L(A,!0)}),q.promise&&q.resolver(R)),S();default:if(c.isPlainObject(j)&&!m.isEmptyObject(j))me="start";else if(m.isString(j)&&g.Redirects[j]){x=c.extend({},H);var je=x.duration,Le=x.delay||0;return x.backwards===!0&&(R=c.extend(!0,[],R).reverse()),c.each(R,function(ee,A){parseFloat(x.stagger)?x.delay=Le+parseFloat(x.stagger)*ee:m.isFunction(x.stagger)&&(x.delay=Le+x.stagger.call(A,ee,Y)),x.drag&&(x.duration=parseFloat(je)||(/^(callout|transition)/.test(j)?1e3:h),x.duration=Math.max(x.duration*(x.backwards?1-ee/Y:(ee+1)/Y),x.duration*.75,200)),g.Redirects[j].call(A,A,x||{},ee,Y,R,q.promise?q:a)}),S()}else{var Ve="Velocity: First argument ("+j+") was not a property map, a known action, or a registered redirect. Aborting.";return q.promise?q.rejecter(new Error(Ve)):r.console&&console.log(Ve),S()}}var ye={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},Ae=[];function ze(ee,A){var I=c.extend({},g.defaults,H),B={},K;switch(_(ee)===a&&g.init(ee),parseFloat(I.delay)&&I.queue!==!1&&c.queue(ee,I.queue,function(Pe,de){if(de===!0)return!0;g.velocityQueueEntryFlag=!0;var he=g.State.delayedElements.count++;g.State.delayedElements[he]=ee;var Be=function(st){return function(){g.State.delayedElements[st]=!1,Pe()}}(he);_(ee).delayBegin=new Date().getTime(),_(ee).delay=parseFloat(I.delay),_(ee).delayTimer={setTimeout:setTimeout(Pe,parseFloat(I.delay)),next:Be}}),I.duration.toString().toLowerCase()){case"fast":I.duration=200;break;case"normal":I.duration=h;break;case"slow":I.duration=600;break;default:I.duration=parseFloat(I.duration)||1}g.mock!==!1&&(g.mock===!0?I.duration=I.delay=1:(I.duration*=parseFloat(g.mock)||1,I.delay*=parseFloat(g.mock)||1)),I.easing=F(I.easing,I.duration),I.begin&&!m.isFunction(I.begin)&&(I.begin=null),I.progress&&!m.isFunction(I.progress)&&(I.progress=null),I.complete&&!m.isFunction(I.complete)&&(I.complete=null),I.display!==a&&I.display!==null&&(I.display=I.display.toString().toLowerCase(),I.display==="auto"&&(I.display=g.CSS.Values.getDisplayType(ee))),I.visibility!==a&&I.visibility!==null&&(I.visibility=I.visibility.toString().toLowerCase()),I.mobileHA=I.mobileHA&&g.State.isMobile&&!g.State.isGingerbread;function Z(Pe){var de,he;if(I.begin&&G===0)try{I.begin.call(R,R)}catch(Ce){setTimeout(function(){throw Ce},1)}if(me==="scroll"){var Be=/^x$/i.test(I.axis)?"Left":"Top",st=parseFloat(I.offset)||0,Ke,Ge,Re;I.container?m.isWrapped(I.container)||m.isNode(I.container)?(I.container=I.container[0]||I.container,Ke=I.container["scroll"+Be],Re=Ke+c(ee).position()[Be.toLowerCase()]+st):I.container=null:(Ke=g.State.scrollAnchor[g.State["scrollProperty"+Be]],Ge=g.State.scrollAnchor[g.State["scrollProperty"+(Be==="Left"?"Top":"Left")]],Re=c(ee).offset()[Be.toLowerCase()]+st),B={scroll:{rootPropertyValue:!1,startValue:Ke,currentValue:Ke,endValue:Re,unitType:"",easing:I.easing,scrollData:{container:I.container,direction:Be,alternateValue:Ge}},element:ee},g.debug&&console.log("tweensContainer (scroll): ",B.scroll,ee)}else if(me==="reverse"){if(de=_(ee),!de)return;if(de.tweensContainer){de.opts.display==="none"&&(de.opts.display="auto"),de.opts.visibility==="hidden"&&(de.opts.visibility="visible"),de.opts.loop=!1,de.opts.begin=null,de.opts.complete=null,H.easing||delete I.easing,H.duration||delete I.duration,I=c.extend({},de.opts,I),he=c.extend(!0,{},de?de.tweensContainer:null);for(var dt in he)if(he.hasOwnProperty(dt)&&dt!=="element"){var Hr=he[dt].startValue;he[dt].startValue=he[dt].currentValue=he[dt].endValue,he[dt].endValue=Hr,m.isEmptyObject(H)||(he[dt].easing=I.easing),g.debug&&console.log("reverse tweensContainer ("+dt+"): "+JSON.stringify(he[dt]),ee)}B=he}else{c.dequeue(ee,I.queue);return}}else if(me==="start"){de=_(ee),de&&de.tweensContainer&&de.isAnimating===!0&&(he=de.tweensContainer);var Vu=function(Ce,Oi){var lr,nn,Ie;return m.isFunction(Ce)&&(Ce=Ce.call(ee,A,Y)),m.isArray(Ce)?(lr=Ce[0],!m.isArray(Ce[1])&&/^[\d-]/.test(Ce[1])||m.isFunction(Ce[1])||T.RegEx.isHex.test(Ce[1])?Ie=Ce[1]:m.isString(Ce[1])&&!T.RegEx.isHex.test(Ce[1])&&g.Easings[Ce[1]]||m.isArray(Ce[1])?(nn=Oi?Ce[1]:F(Ce[1],I.duration),Ie=Ce[2]):Ie=Ce[1]||Ce[2]):lr=Ce,Oi||(nn=nn||I.easing),m.isFunction(lr)&&(lr=lr.call(ee,A,Y)),m.isFunction(Ie)&&(Ie=Ie.call(ee,A,Y)),[lr||0,nn,Ie]},Uo=function(Ce,Oi){var lr=T.Hooks.getRoot(Ce),nn=!1,Ie=Oi[0],DL=Oi[1],Ye=Oi[2],Pr;if((!de||!de.isSVG)&&lr!=="tween"&&T.Names.prefixCheck(lr)[1]===!1&&T.Normalizations.registered[lr]===a){g.debug&&console.log("Skipping ["+lr+"] due to a lack of browser support.");return}(I.display!==a&&I.display!==null&&I.display!=="none"||I.visibility!==a&&I.visibility!=="hidden")&&/opacity|filter/.test(Ce)&&!Ye&&Ie!==0&&(Ye=0),I._cacheValues&&he&&he[Ce]?(Ye===a&&(Ye=he[Ce].endValue+he[Ce].unitType),nn=de.rootPropertyValueCache[lr]):T.Hooks.registered[Ce]?Ye===a?(nn=T.getPropertyValue(ee,lr),Ye=T.getPropertyValue(ee,Ce,nn)):nn=T.Hooks.templates[lr][1]:Ye===a&&(Ye=T.getPropertyValue(ee,Ce));var Ei,Tr,Fa,kc=!1,qb=function(mr,Ko){var Di,sa;return sa=(Ko||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(pr){return Di=pr,""}),Di||(Di=T.Values.getUnitType(mr)),[sa,Di]};if(Ye!==Ie&&m.isString(Ye)&&m.isString(Ie)){Pr="";var ia=0,oa=0,Pn=[],Bo=[],fr=0,Qt=0,Tn=0;for(Ye=T.Hooks.fixColors(Ye),Ie=T.Hooks.fixColors(Ie);ia<Ye.length&&oa<Ie.length;){var Et=Ye[ia],ja=Ie[oa];if(/[\d\.-]/.test(Et)&&/[\d\.-]/.test(ja)){for(var Yo=Et,Uu=ja,Bb=".",Yb=".";++ia<Ye.length;){if(Et=Ye[ia],Et===Bb)Bb="..";else if(!/\d/.test(Et))break;Yo+=Et}for(;++oa<Ie.length;){if(ja=Ie[oa],ja===Yb)Yb="..";else if(!/\d/.test(ja))break;Uu+=ja}var Go=T.Hooks.getUnit(Ye,ia),Pc=T.Hooks.getUnit(Ie,oa);if(ia+=Go.length,oa+=Pc.length,Go===Pc)Yo===Uu?Pr+=Yo+Go:(Pr+="{"+Pn.length+(Qt?"!":"")+"}"+Go,Pn.push(parseFloat(Yo)),Bo.push(parseFloat(Uu)));else{var Hu=parseFloat(Yo),Tc=parseFloat(Uu);Pr+=(fr<5?"calc":"")+"("+(Hu?"{"+Pn.length+(Qt?"!":"")+"}":"0")+Go+" + "+(Tc?"{"+(Pn.length+(Hu?1:0))+(Qt?"!":"")+"}":"0")+Pc+")",Hu&&(Pn.push(Hu),Bo.push(0)),Tc&&(Pn.push(0),Bo.push(Tc))}}else if(Et===ja)Pr+=Et,ia++,oa++,fr===0&&Et==="c"||fr===1&&Et==="a"||fr===2&&Et==="l"||fr===3&&Et==="c"||fr>=4&&Et==="("?fr++:(fr&&fr<5||fr>=4&&Et===")"&&--fr<5)&&(fr=0),Qt===0&&Et==="r"||Qt===1&&Et==="g"||Qt===2&&Et==="b"||Qt===3&&Et==="a"||Qt>=3&&Et==="("?(Qt===3&&Et==="a"&&(Tn=1),Qt++):Tn&&Et===","?++Tn>3&&(Qt=Tn=0):(Tn&&Qt<(Tn?5:4)||Qt>=(Tn?4:3)&&Et===")"&&--Qt<(Tn?5:4))&&(Qt=Tn=0);else{fr=0;break}}(ia!==Ye.length||oa!==Ie.length)&&(g.debug&&console.error('Trying to pattern match mis-matched strings ["'+Ie+'", "'+Ye+'"]'),Pr=a),Pr&&(Pn.length?(g.debug&&console.log('Pattern found "'+Pr+'" -> ',Pn,Bo,"["+Ye+","+Ie+"]"),Ye=Pn,Ie=Bo,Tr=Fa=""):Pr=a)}Pr||(Ei=qb(Ce,Ye),Ye=Ei[0],Fa=Ei[1],Ei=qb(Ce,Ie),Ie=Ei[0].replace(/^([+-\/*])=/,function(mr,Ko){return kc=Ko,""}),Tr=Ei[1],Ye=parseFloat(Ye)||0,Ie=parseFloat(Ie)||0,Tr==="%"&&(/^(fontSize|lineHeight)$/.test(Ce)?(Ie=Ie/100,Tr="em"):/^scale/.test(Ce)?(Ie=Ie/100,Tr=""):/(Red|Green|Blue)$/i.test(Ce)&&(Ie=Ie/100*255,Tr="")));var CL=function(){var mr={myParent:ee.parentNode||n.body,position:T.getPropertyValue(ee,"position"),fontSize:T.getPropertyValue(ee,"fontSize")},Ko=mr.position===ye.lastPosition&&mr.myParent===ye.lastParent,Di=mr.fontSize===ye.lastFontSize;ye.lastParent=mr.myParent,ye.lastPosition=mr.position,ye.lastFontSize=mr.fontSize;var sa=100,pr={};if(!Di||!Ko){var Mr=de&&de.isSVG?n.createElementNS("http://www.w3.org/2000/svg","rect"):n.createElement("div");g.init(Mr),mr.myParent.appendChild(Mr),c.each(["overflow","overflowX","overflowY"],function($L,Mc){g.CSS.setPropertyValue(Mr,Mc,"hidden")}),g.CSS.setPropertyValue(Mr,"position",mr.position),g.CSS.setPropertyValue(Mr,"fontSize",mr.fontSize),g.CSS.setPropertyValue(Mr,"boxSizing","content-box"),c.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function($L,Mc){g.CSS.setPropertyValue(Mr,Mc,sa+"%")}),g.CSS.setPropertyValue(Mr,"paddingLeft",sa+"em"),pr.percentToPxWidth=ye.lastPercentToPxWidth=(parseFloat(T.getPropertyValue(Mr,"width",null,!0))||1)/sa,pr.percentToPxHeight=ye.lastPercentToPxHeight=(parseFloat(T.getPropertyValue(Mr,"height",null,!0))||1)/sa,pr.emToPx=ye.lastEmToPx=(parseFloat(T.getPropertyValue(Mr,"paddingLeft"))||1)/sa,mr.myParent.removeChild(Mr)}else pr.emToPx=ye.lastEmToPx,pr.percentToPxWidth=ye.lastPercentToPxWidth,pr.percentToPxHeight=ye.lastPercentToPxHeight;return ye.remToPx===null&&(ye.remToPx=parseFloat(T.getPropertyValue(n.body,"fontSize"))||16),ye.vwToPx===null&&(ye.vwToPx=parseFloat(r.innerWidth)/100,ye.vhToPx=parseFloat(r.innerHeight)/100),pr.remToPx=ye.remToPx,pr.vwToPx=ye.vwToPx,pr.vhToPx=ye.vhToPx,g.debug>=1&&console.log("Unit ratios: "+JSON.stringify(pr),ee),pr};if(/[\/*]/.test(kc))Tr=Fa;else if(Fa!==Tr&&Ye!==0)if(Ie===0)Tr=Fa;else{K=K||CL();var Gb=/margin|padding|left|right|width|text|word|letter/i.test(Ce)||/X$/.test(Ce)||Ce==="x"?"x":"y";switch(Fa){case"%":Ye*=Gb==="x"?K.percentToPxWidth:K.percentToPxHeight;break;case"px":break;default:Ye*=K[Fa+"ToPx"]}switch(Tr){case"%":Ye*=1/(Gb==="x"?K.percentToPxWidth:K.percentToPxHeight);break;case"px":break;default:Ye*=1/K[Tr+"ToPx"]}}switch(kc){case"+":Ie=Ye+Ie;break;case"-":Ie=Ye-Ie;break;case"*":Ie=Ye*Ie;break;case"/":Ie=Ye/Ie;break}B[Ce]={rootPropertyValue:nn,startValue:Ye,currentValue:Ye,endValue:Ie,unitType:Tr,easing:DL},Pr&&(B[Ce].pattern=Pr),g.debug&&console.log("tweensContainer ("+Ce+"): "+JSON.stringify(B[Ce]),ee)};for(var Wa in j)if(!!j.hasOwnProperty(Wa)){var Ho=T.Names.camelCase(Wa),zu=Vu(j[Wa]);if(d(T.Lists.colors)){var jb=zu[0],Vb=zu[1],zb=zu[2];if(T.RegEx.isHex.test(jb)){for(var Ub=["Red","Green","Blue"],EL=T.Values.hexToRgb(jb),Hb=zb?T.Values.hexToRgb(zb):a,qo=0;qo<Ub.length;qo++){var xc=[EL[qo]];Vb&&xc.push(Vb),Hb!==a&&xc.push(Hb[qo]),Uo(Ho+Ub[qo],xc)}continue}}Uo(Ho,zu)}B.element=ee}B.element&&(T.Values.addClass(ee,"velocity-animating"),Ae.push(B),de=_(ee),de&&(I.queue===""&&(de.tweensContainer=B,de.opts=I),de.isAnimating=!0),G===Y-1?(g.State.calls.push([Ae,R,I,null,q.resolver,null,0]),g.State.isTicking===!1&&(g.State.isTicking=!0,E())):G++)}if(I.queue===!1)if(I.delay){var pe=g.State.delayedElements.count++;g.State.delayedElements[pe]=ee;var ge=function(Pe){return function(){g.State.delayedElements[Pe]=!1,Z()}}(pe);_(ee).delayBegin=new Date().getTime(),_(ee).delay=parseFloat(I.delay),_(ee).delayTimer={setTimeout:setTimeout(Z,parseFloat(I.delay)),next:ge}}else Z();else c.queue(ee,I.queue,function(Pe,de){if(de===!0)return q.promise&&q.resolver(R),!0;g.velocityQueueEntryFlag=!0,Z()});(I.queue===""||I.queue==="fx")&&c.queue(ee)[0]!=="inprogress"&&c.dequeue(ee)}c.each(R,function(ee,A){m.isNode(A)&&ze(A,ee)}),x=c.extend({},g.defaults,H),x.loop=parseInt(x.loop,10);var Pt=x.loop*2-1;if(x.loop)for(var Ot=0;Ot<Pt;Ot++){var et={delay:x.delay,progress:x.progress};Ot===Pt-1&&(et.display=x.display,et.visibility=x.visibility,et.complete=x.complete),N(R,"reverse",et)}return S()};g=c.extend(N,g),g.animate=N;var W=r.requestAnimationFrame||i;if(!g.State.isMobile&&n.hidden!==a){var $=function(){n.hidden?(W=function(x){return setTimeout(function(){x(!0)},16)},E()):W=r.requestAnimationFrame||i};$(),n.addEventListener("visibilitychange",$)}function E(x){if(x){var S=g.timestamp&&x!==!0?x:s.now(),O=g.State.calls.length;O>1e4&&(g.State.calls=u(g.State.calls),O=g.State.calls.length);for(var P=0;P<O;P++)if(!!g.State.calls[P]){var w=g.State.calls[P],D=w[0],R=w[2],j=w[3],H=!j,q=null,Y=w[5],G=w[6];if(j||(j=g.State.calls[P][3]=S-16),Y)if(Y.resume===!0)j=w[3]=Math.round(S-G-16),w[5]=null;else continue;G=w[6]=S-j;for(var X=Math.min(G/R.duration,1),ne=0,me=D.length;ne<me;ne++){var fe=D[ne],we=fe.element;if(!!_(we)){var je=!1;if(R.display!==a&&R.display!==null&&R.display!=="none"){if(R.display==="flex"){var Le=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];c.each(Le,function(I,B){T.setPropertyValue(we,"display",B)})}T.setPropertyValue(we,"display",R.display)}R.visibility!==a&&R.visibility!=="hidden"&&T.setPropertyValue(we,"visibility",R.visibility);for(var Ve in fe)if(fe.hasOwnProperty(Ve)&&Ve!=="element"){var ye=fe[Ve],Ae,ze=m.isString(ye.easing)?g.Easings[ye.easing]:ye.easing;if(m.isString(ye.pattern)){var Pt=X===1?function(I,B,K){var Z=ye.endValue[B];return K?Math.round(Z):Z}:function(I,B,K){var Z=ye.startValue[B],pe=ye.endValue[B]-Z,ge=Z+pe*ze(X,R,pe);return K?Math.round(ge):ge};Ae=ye.pattern.replace(/{(\d+)(!)?}/g,Pt)}else if(X===1)Ae=ye.endValue;else{var Ot=ye.endValue-ye.startValue;Ae=ye.startValue+Ot*ze(X,R,Ot)}if(!H&&Ae===ye.currentValue)continue;if(ye.currentValue=Ae,Ve==="tween")q=Ae;else{var et;if(T.Hooks.registered[Ve]){et=T.Hooks.getRoot(Ve);var ee=_(we).rootPropertyValueCache[et];ee&&(ye.rootPropertyValue=ee)}var A=T.setPropertyValue(we,Ve,ye.currentValue+(o<9&&parseFloat(Ae)===0?"":ye.unitType),ye.rootPropertyValue,ye.scrollData);T.Hooks.registered[Ve]&&(T.Normalizations.registered[et]?_(we).rootPropertyValueCache[et]=T.Normalizations.registered[et]("extract",null,A[1]):_(we).rootPropertyValueCache[et]=A[1]),A[0]==="transform"&&(je=!0)}}R.mobileHA&&_(we).transformCache.translate3d===a&&(_(we).transformCache.translate3d="(0px, 0px, 0px)",je=!0),je&&T.flushTransformCache(we)}}R.display!==a&&R.display!=="none"&&(g.State.calls[P][2].display=!1),R.visibility!==a&&R.visibility!=="hidden"&&(g.State.calls[P][2].visibility=!1),R.progress&&R.progress.call(w[1],w[1],X,Math.max(0,j+R.duration-S),j,q),X===1&&L(P)}}g.State.isTicking&&W(E)}function L(x,S){if(!g.State.calls[x])return!1;for(var O=g.State.calls[x][0],P=g.State.calls[x][1],w=g.State.calls[x][2],D=g.State.calls[x][4],R=!1,j=0,H=O.length;j<H;j++){var q=O[j].element;!S&&!w.loop&&(w.display==="none"&&T.setPropertyValue(q,"display",w.display),w.visibility==="hidden"&&T.setPropertyValue(q,"visibility",w.visibility));var Y=_(q);if(w.loop!==!0&&(c.queue(q)[1]===a||!/\.velocityQueueEntryFlag/i.test(c.queue(q)[1]))&&Y){Y.isAnimating=!1,Y.rootPropertyValueCache={};var G=!1;c.each(T.Lists.transforms3D,function(me,fe){var we=/^scale/.test(fe)?1:0,je=Y.transformCache[fe];Y.transformCache[fe]!==a&&new RegExp("^\\("+we+"[^.]").test(je)&&(G=!0,delete Y.transformCache[fe])}),w.mobileHA&&(G=!0,delete Y.transformCache.translate3d),G&&T.flushTransformCache(q),T.Values.removeClass(q,"velocity-animating")}if(!S&&w.complete&&!w.loop&&j===H-1)try{w.complete.call(P,P)}catch(me){setTimeout(function(){throw me},1)}D&&w.loop!==!0&&D(P),Y&&w.loop===!0&&!S&&(c.each(Y.tweensContainer,function(me,fe){if(/^rotate/.test(me)&&(parseFloat(fe.startValue)-parseFloat(fe.endValue))%360===0){var we=fe.startValue;fe.startValue=fe.endValue,fe.endValue=we}/^backgroundPosition/.test(me)&&parseFloat(fe.endValue)===100&&fe.unitType==="%"&&(fe.endValue=0,fe.startValue=100)}),g(q,"reverse",{loop:!0,delay:w.delay})),w.queue!==!1&&c.dequeue(q,w.queue)}g.State.calls[x]=!1;for(var X=0,ne=g.State.calls.length;X<ne;X++)if(g.State.calls[X]!==!1){R=!0;break}R===!1&&(g.State.isTicking=!1,delete g.State.calls,g.State.calls=[])}return e.Velocity=g,e!==r&&(e.fn.velocity=N,e.fn.velocity.defaults=g.defaults),c.each(["Down","Up"],function(x,S){g.Redirects["slide"+S]=function(O,P,w,D,R,j){var H=c.extend({},P),q=H.begin,Y=H.complete,G={},X={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""};H.display===a&&(H.display=S==="Down"?g.CSS.Values.getDisplayType(O)==="inline"?"inline-block":"block":"none"),H.begin=function(){w===0&&q&&q.call(R,R);for(var ne in X)if(!!X.hasOwnProperty(ne)){G[ne]=O.style[ne];var me=T.getPropertyValue(O,ne);X[ne]=S==="Down"?[me,0]:[0,me]}G.overflow=O.style.overflow,O.style.overflow="hidden"},H.complete=function(){for(var ne in G)G.hasOwnProperty(ne)&&(O.style[ne]=G[ne]);w===D-1&&(Y&&Y.call(R,R),j&&j.resolver(R))},g(O,X,H)}}),c.each(["In","Out"],function(x,S){g.Redirects["fade"+S]=function(O,P,w,D,R,j){var H=c.extend({},P),q=H.complete,Y={opacity:S==="In"?1:0};w!==0&&(H.begin=null),w!==D-1?H.complete=null:H.complete=function(){q&&q.call(R,R),j&&j.resolver(R)},H.display===a&&(H.display=S==="In"?"auto":"none"),g(this,Y,H)}}),g}(window.jQuery||window.Zepto||window,window,window?window.document:void 0)})})(aK);const cb=aK.exports;var Oit={exports:{}};(function(t,e){/* VelocityJS.org UI Pack (5.2.0). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License. Portions copyright Daniel Eden, Christian Pucci. */(function(r){typeof t5=="function"?t.exports=r():r()})(function(){return function(r,n,a,o){var i=r.Velocity;if(!i||!i.Utilities){n.console&&console.log("Velocity UI Pack: Velocity must be loaded first. Aborting.");return}var s=i.Utilities,u=i.version,l={major:1,minor:1,patch:0};function d(c,p){var h=[];return!c||!p?!1:(s.each([c,p],function(v,g){var _=[];s.each(g,function(y,b){for(;b.toString().length<5;)b="0"+b;_.push(b)}),h.push(_.join(""))}),parseFloat(h[0])>parseFloat(h[1]))}if(d(l,u)){var f="Velocity UI Pack: You need to update Velocity (velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity.";throw alert(f),new Error(f)}i.RegisterEffect=i.RegisterUI=function(c,p){function h(v,g,_,y){var b=0,k;s.each(v.nodeType?[v]:v,function(M,C){y&&(_+=M*y),k=C.parentNode;var F=["height","paddingTop","paddingBottom","marginTop","marginBottom"];i.CSS.getPropertyValue(C,"boxSizing").toString().toLowerCase()==="border-box"&&(F=["height"]),s.each(F,function(T,N){b+=parseFloat(i.CSS.getPropertyValue(C,N))})}),i.animate(k,{height:(g==="In"?"+":"-")+"="+b},{queue:!1,easing:"ease-in-out",duration:_*(g==="In"?.6:1)})}return i.Redirects[c]=function(v,g,_,y,b,k,M){var C=_===y-1,F=0;M=M||p.loop,typeof p.defaultDuration=="function"?p.defaultDuration=p.defaultDuration.call(b,b):p.defaultDuration=parseFloat(p.defaultDuration);for(var T=0;T<p.calls.length;T++)L=p.calls[T][1],typeof L=="number"&&(F+=L);var N=F>=1?0:p.calls.length?(1-F)/p.calls.length:1;for(T=0;T<p.calls.length;T++){var W=p.calls[T],$=W[0],E=1e3,L=W[1],x=W[2]||{},S={};if(g.duration!==o?E=g.duration:p.defaultDuration!==o&&(E=p.defaultDuration),S.duration=E*(typeof L=="number"?L:N),S.queue=g.queue||"",S.easing=x.easing||"ease",S.delay=parseFloat(x.delay)||0,S.loop=!p.loop&&x.loop,S._cacheValues=x._cacheValues||!0,T===0){if(S.delay+=parseFloat(g.delay)||0,_===0&&(S.begin=function(){g.begin&&g.begin.call(b,b);var w=c.match(/(In|Out)$/);w&&w[0]==="In"&&$.opacity!==o&&s.each(b.nodeType?[b]:b,function(D,R){i.CSS.setPropertyValue(R,"opacity",0)}),g.animateParentHeight&&w&&h(b,w[0],E+S.delay,g.stagger)}),g.display!==null){if(g.display!==o&&g.display!=="none")S.display=g.display;else if(/In$/.test(c)){var O=i.CSS.Values.getDisplayType(v);S.display=O==="inline"?"inline-block":O}}g.visibility&&g.visibility!=="hidden"&&(S.visibility=g.visibility)}if(T===p.calls.length-1){var P=function(){(g.display===o||g.display==="none")&&/Out$/.test(c)&&s.each(b.nodeType?[b]:b,function(w,D){i.CSS.setPropertyValue(D,"display","none")}),g.complete&&g.complete.call(b,b),k&&k.resolver(b||v)};S.complete=function(){if(M&&i.Redirects[c](v,g,_,y,b,k,M===!0?!0:Math.max(0,M-1)),p.reset){for(var w in p.reset)if(!!p.reset.hasOwnProperty(w)){var D=p.reset[w];i.CSS.Hooks.registered[w]===o&&(typeof D=="string"||typeof D=="number")&&(p.reset[w]=[p.reset[w],p.reset[w]])}var R={duration:0,queue:!1};C&&(R.complete=P),i.animate(v,p.reset,R)}else C&&P()},g.visibility==="hidden"&&(S.visibility=g.visibility)}i.animate(v,$,S)}},i},i.RegisterEffect.packagedEffects={"callout.bounce":{defaultDuration:550,calls:[[{translateY:-30},.25],[{translateY:0},.125],[{translateY:-15},.125],[{translateY:0},.25]]},"callout.shake":{defaultDuration:800,calls:[[{translateX:-11}],[{translateX:11}],[{translateX:-11}],[{translateX:11}],[{translateX:-11}],[{translateX:11}],[{translateX:-11}],[{translateX:0}]]},"callout.flash":{defaultDuration:1100,calls:[[{opacity:[0,"easeInOutQuad",1]}],[{opacity:[1,"easeInOutQuad"]}],[{opacity:[0,"easeInOutQuad"]}],[{opacity:[1,"easeInOutQuad"]}]]},"callout.pulse":{defaultDuration:825,calls:[[{scaleX:1.1,scaleY:1.1},.5,{easing:"easeInExpo"}],[{scaleX:1,scaleY:1},.5]]},"callout.swing":{defaultDuration:950,calls:[[{rotateZ:15}],[{rotateZ:-10}],[{rotateZ:5}],[{rotateZ:-5}],[{rotateZ:0}]]},"callout.tada":{defaultDuration:1e3,calls:[[{scaleX:.9,scaleY:.9,rotateZ:-3},.1],[{scaleX:1.1,scaleY:1.1,rotateZ:3},.1],[{scaleX:1.1,scaleY:1.1,rotateZ:-3},.1],["reverse",.125],["reverse",.125],["reverse",.125],["reverse",.125],["reverse",.125],[{scaleX:1,scaleY:1,rotateZ:0},.2]]},"transition.fadeIn":{defaultDuration:500,calls:[[{opacity:[1,0]}]]},"transition.fadeOut":{defaultDuration:500,calls:[[{opacity:[0,1]}]]},"transition.flipXIn":{defaultDuration:700,calls:[[{opacity:[1,0],transformPerspective:[800,800],rotateY:[0,-55]}]],reset:{transformPerspective:0}},"transition.flipXOut":{defaultDuration:700,calls:[[{opacity:[0,1],transformPerspective:[800,800],rotateY:55}]],reset:{transformPerspective:0,rotateY:0}},"transition.flipYIn":{defaultDuration:800,calls:[[{opacity:[1,0],transformPerspective:[800,800],rotateX:[0,-45]}]],reset:{transformPerspective:0}},"transition.flipYOut":{defaultDuration:800,calls:[[{opacity:[0,1],transformPerspective:[800,800],rotateX:25}]],reset:{transformPerspective:0,rotateX:0}},"transition.flipBounceXIn":{defaultDuration:900,calls:[[{opacity:[.725,0],transformPerspective:[400,400],rotateY:[-10,90]},.5],[{opacity:.8,rotateY:10},.25],[{opacity:1,rotateY:0},.25]],reset:{transformPerspective:0}},"transition.flipBounceXOut":{defaultDuration:800,calls:[[{opacity:[.9,1],transformPerspective:[400,400],rotateY:-10}],[{opacity:0,rotateY:90}]],reset:{transformPerspective:0,rotateY:0}},"transition.flipBounceYIn":{defaultDuration:850,calls:[[{opacity:[.725,0],transformPerspective:[400,400],rotateX:[-10,90]},.5],[{opacity:.8,rotateX:10},.25],[{opacity:1,rotateX:0},.25]],reset:{transformPerspective:0}},"transition.flipBounceYOut":{defaultDuration:800,calls:[[{opacity:[.9,1],transformPerspective:[400,400],rotateX:-15}],[{opacity:0,rotateX:90}]],reset:{transformPerspective:0,rotateX:0}},"transition.swoopIn":{defaultDuration:850,calls:[[{opacity:[1,0],transformOriginX:["100%","50%"],transformOriginY:["100%","100%"],scaleX:[1,0],scaleY:[1,0],translateX:[0,-700],translateZ:0}]],reset:{transformOriginX:"50%",transformOriginY:"50%"}},"transition.swoopOut":{defaultDuration:850,calls:[[{opacity:[0,1],transformOriginX:["50%","100%"],transformOriginY:["100%","100%"],scaleX:0,scaleY:0,translateX:-700,translateZ:0}]],reset:{transformOriginX:"50%",transformOriginY:"50%",scaleX:1,scaleY:1,translateX:0}},"transition.whirlIn":{defaultDuration:850,calls:[[{opacity:[1,0],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:[1,0],scaleY:[1,0],rotateY:[0,160]},1,{easing:"easeInOutSine"}]]},"transition.whirlOut":{defaultDuration:750,calls:[[{opacity:[0,"easeInOutQuint",1],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:0,scaleY:0,rotateY:160},1,{easing:"swing"}]],reset:{scaleX:1,scaleY:1,rotateY:0}},"transition.shrinkIn":{defaultDuration:750,calls:[[{opacity:[1,0],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:[1,1.5],scaleY:[1,1.5],translateZ:0}]]},"transition.shrinkOut":{defaultDuration:600,calls:[[{opacity:[0,1],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:1.3,scaleY:1.3,translateZ:0}]],reset:{scaleX:1,scaleY:1}},"transition.expandIn":{defaultDuration:700,calls:[[{opacity:[1,0],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:[1,.625],scaleY:[1,.625],translateZ:0}]]},"transition.expandOut":{defaultDuration:700,calls:[[{opacity:[0,1],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:.5,scaleY:.5,translateZ:0}]],reset:{scaleX:1,scaleY:1}},"transition.bounceIn":{defaultDuration:800,calls:[[{opacity:[1,0],scaleX:[1.05,.3],scaleY:[1.05,.3]},.35],[{scaleX:.9,scaleY:.9,translateZ:0},.2],[{scaleX:1,scaleY:1},.45]]},"transition.bounceOut":{defaultDuration:800,calls:[[{scaleX:.95,scaleY:.95},.35],[{scaleX:1.1,scaleY:1.1,translateZ:0},.35],[{opacity:[0,1],scaleX:.3,scaleY:.3},.3]],reset:{scaleX:1,scaleY:1}},"transition.bounceUpIn":{defaultDuration:800,calls:[[{opacity:[1,0],translateY:[-30,1e3]},.6,{easing:"easeOutCirc"}],[{translateY:10},.2],[{translateY:0},.2]]},"transition.bounceUpOut":{defaultDuration:1e3,calls:[[{translateY:20},.2],[{opacity:[0,"easeInCirc",1],translateY:-1e3},.8]],reset:{translateY:0}},"transition.bounceDownIn":{defaultDuration:800,calls:[[{opacity:[1,0],translateY:[30,-1e3]},.6,{easing:"easeOutCirc"}],[{translateY:-10},.2],[{translateY:0},.2]]},"transition.bounceDownOut":{defaultDuration:1e3,calls:[[{translateY:-20},.2],[{opacity:[0,"easeInCirc",1],translateY:1e3},.8]],reset:{translateY:0}},"transition.bounceLeftIn":{defaultDuration:750,calls:[[{opacity:[1,0],translateX:[30,-1250]},.6,{easing:"easeOutCirc"}],[{translateX:-10},.2],[{translateX:0},.2]]},"transition.bounceLeftOut":{defaultDuration:750,calls:[[{translateX:30},.2],[{opacity:[0,"easeInCirc",1],translateX:-1250},.8]],reset:{translateX:0}},"transition.bounceRightIn":{defaultDuration:750,calls:[[{opacity:[1,0],translateX:[-30,1250]},.6,{easing:"easeOutCirc"}],[{translateX:10},.2],[{translateX:0},.2]]},"transition.bounceRightOut":{defaultDuration:750,calls:[[{translateX:-30},.2],[{opacity:[0,"easeInCirc",1],translateX:1250},.8]],reset:{translateX:0}},"transition.slideUpIn":{defaultDuration:900,calls:[[{opacity:[1,0],translateY:[0,20],translateZ:0}]]},"transition.slideUpOut":{defaultDuration:900,calls:[[{opacity:[0,1],translateY:-20,translateZ:0}]],reset:{translateY:0}},"transition.slideDownIn":{defaultDuration:900,calls:[[{opacity:[1,0],translateY:[0,-20],translateZ:0}]]},"transition.slideDownOut":{defaultDuration:900,calls:[[{opacity:[0,1],translateY:20,translateZ:0}]],reset:{translateY:0}},"transition.slideLeftIn":{defaultDuration:1e3,calls:[[{opacity:[1,0],translateX:[0,-20],translateZ:0}]]},"transition.slideLeftOut":{defaultDuration:1050,calls:[[{opacity:[0,1],translateX:-20,translateZ:0}]],reset:{translateX:0}},"transition.slideRightIn":{defaultDuration:1e3,calls:[[{opacity:[1,0],translateX:[0,20],translateZ:0}]]},"transition.slideRightOut":{defaultDuration:1050,calls:[[{opacity:[0,1],translateX:20,translateZ:0}]],reset:{translateX:0}},"transition.slideUpBigIn":{defaultDuration:850,calls:[[{opacity:[1,0],translateY:[0,75],translateZ:0}]]},"transition.slideUpBigOut":{defaultDuration:800,calls:[[{opacity:[0,1],translateY:-75,translateZ:0}]],reset:{translateY:0}},"transition.slideDownBigIn":{defaultDuration:850,calls:[[{opacity:[1,0],translateY:[0,-75],translateZ:0}]]},"transition.slideDownBigOut":{defaultDuration:800,calls:[[{opacity:[0,1],translateY:75,translateZ:0}]],reset:{translateY:0}},"transition.slideLeftBigIn":{defaultDuration:800,calls:[[{opacity:[1,0],translateX:[0,-75],translateZ:0}]]},"transition.slideLeftBigOut":{defaultDuration:750,calls:[[{opacity:[0,1],translateX:-75,translateZ:0}]],reset:{translateX:0}},"transition.slideRightBigIn":{defaultDuration:800,calls:[[{opacity:[1,0],translateX:[0,75],translateZ:0}]]},"transition.slideRightBigOut":{defaultDuration:750,calls:[[{opacity:[0,1],translateX:75,translateZ:0}]],reset:{translateX:0}},"transition.perspectiveUpIn":{defaultDuration:800,calls:[[{opacity:[1,0],transformPerspective:[800,800],transformOriginX:[0,0],transformOriginY:["100%","100%"],rotateX:[0,-180]}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%"}},"transition.perspectiveUpOut":{defaultDuration:850,calls:[[{opacity:[0,1],transformPerspective:[800,800],transformOriginX:[0,0],transformOriginY:["100%","100%"],rotateX:-180}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%",rotateX:0}},"transition.perspectiveDownIn":{defaultDuration:800,calls:[[{opacity:[1,0],transformPerspective:[800,800],transformOriginX:[0,0],transformOriginY:[0,0],rotateX:[0,180]}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%"}},"transition.perspectiveDownOut":{defaultDuration:850,calls:[[{opacity:[0,1],transformPerspective:[800,800],transformOriginX:[0,0],transformOriginY:[0,0],rotateX:180}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%",rotateX:0}},"transition.perspectiveLeftIn":{defaultDuration:950,calls:[[{opacity:[1,0],transformPerspective:[2e3,2e3],transformOriginX:[0,0],transformOriginY:[0,0],rotateY:[0,-180]}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%"}},"transition.perspectiveLeftOut":{defaultDuration:950,calls:[[{opacity:[0,1],transformPerspective:[2e3,2e3],transformOriginX:[0,0],transformOriginY:[0,0],rotateY:-180}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%",rotateY:0}},"transition.perspectiveRightIn":{defaultDuration:950,calls:[[{opacity:[1,0],transformPerspective:[2e3,2e3],transformOriginX:["100%","100%"],transformOriginY:[0,0],rotateY:[0,180]}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%"}},"transition.perspectiveRightOut":{defaultDuration:950,calls:[[{opacity:[0,1],transformPerspective:[2e3,2e3],transformOriginX:["100%","100%"],transformOriginY:[0,0],rotateY:180}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%",rotateY:0}}};for(var m in i.RegisterEffect.packagedEffects)i.RegisterEffect.packagedEffects.hasOwnProperty(m)&&i.RegisterEffect(m,i.RegisterEffect.packagedEffects[m]);i.RunSequence=function(c){var p=s.extend(!0,[],c);p.length>1&&(s.each(p.reverse(),function(h,v){var g=p[h+1];if(g){var _=v.o||v.options,y=g.o||g.options,b=_&&_.sequenceQueue===!1?"begin":"complete",k=y&&y[b],M={};M[b]=function(){var C=g.e||g.elements,F=C.nodeType?[C]:C;k&&k.call(F,F),i(v)},g.o?g.o=s.extend({},y,M):g.options=s.extend({},y,M)}}),p.reverse()),i(p[0])}}(window.jQuery||window.Zepto||window,window)})})(Oit);var vL={},fb={},$t={},mb={},pb={};Object.defineProperty(pb,"__esModule",{value:!0}),pb.withParams=void 0;function hb(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?hb=function(r){return typeof r}:hb=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},hb(t)}var iK=typeof window<"u"?window:typeof ct<"u"?ct:{},Eit=function(e,r){return hb(e)==="object"&&r!==void 0?r:e(function(){})},Dit=iK.vuelidate?iK.vuelidate.withParams:Eit;pb.withParams=Dit,Object.defineProperty(mb,"__esModule",{value:!0}),mb.default=void 0;var Cit=pb.withParams,$it=Cit;mb.default=$it,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.req=t.regex=t.ref=t.len=void 0,Object.defineProperty(t,"withParams",{enumerable:!0,get:function(){return e.default}});var e=r(mb);function r(u){return u&&u.__esModule?u:{default:u}}function n(u){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?n=function(d){return typeof d}:n=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},n(u)}var a=function(l){if(Array.isArray(l))return!!l.length;if(l==null)return!1;if(l===!1)return!0;if(l instanceof Date)return!isNaN(l.getTime());if(n(l)==="object"){for(var d in l)return!0;return!1}return!!String(l).length};t.req=a;var o=function(l){return Array.isArray(l)?l.length:n(l)==="object"?Object.keys(l).length:String(l).length};t.len=o;var i=function(l,d,f){return typeof l=="function"?l.call(d,f):f[l]};t.ref=i;var s=function(l,d){return(0,e.default)({type:l},function(f){return!a(f)||d.test(f)})};t.regex=s}($t),Object.defineProperty(fb,"__esModule",{value:!0}),fb.default=void 0;var Ait=$t,Rit=(0,Ait.regex)("alpha",/^[a-zA-Z]*$/);fb.default=Rit;var vb={};Object.defineProperty(vb,"__esModule",{value:!0}),vb.default=void 0;var Iit=$t,Nit=(0,Iit.regex)("alphaNum",/^[a-zA-Z0-9]*$/);vb.default=Nit;var gb={};Object.defineProperty(gb,"__esModule",{value:!0}),gb.default=void 0;var Lit=$t,Wit=(0,Lit.regex)("numeric",/^[0-9]*$/);gb.default=Wit;var yb={};Object.defineProperty(yb,"__esModule",{value:!0}),yb.default=void 0;var oK=$t,Fit=function(e,r){return(0,oK.withParams)({type:"between",min:e,max:r},function(n){return!(0,oK.req)(n)||(!/\s/.test(n)||n instanceof Date)&&+e<=+n&&+r>=+n})};yb.default=Fit;var _b={};Object.defineProperty(_b,"__esModule",{value:!0}),_b.default=void 0;var jit=$t,Vit=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i,zit=(0,jit.regex)("email",Vit);_b.default=zit;var bb={};Object.defineProperty(bb,"__esModule",{value:!0}),bb.default=void 0;var sK=$t,Uit=(0,sK.withParams)({type:"ipAddress"},function(t){if(!(0,sK.req)(t))return!0;if(typeof t!="string")return!1;var e=t.split(".");return e.length===4&&e.every(Hit)});bb.default=Uit;var Hit=function(e){if(e.length>3||e.length===0||e[0]==="0"&&e!=="0"||!e.match(/^\d+$/))return!1;var r=+e|0;return r>=0&&r<=255},wb={};Object.defineProperty(wb,"__esModule",{value:!0}),wb.default=void 0;var uK=$t,qit=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:":";return(0,uK.withParams)({type:"macAddress"},function(r){if(!(0,uK.req)(r))return!0;if(typeof r!="string")return!1;var n=typeof e=="string"&&e!==""?r.split(e):r.length===12||r.length===16?r.match(/.{2}/g):null;return n!==null&&(n.length===6||n.length===8)&&n.every(Bit)})};wb.default=qit;var Bit=function(e){return e.toLowerCase().match(/^[0-9a-f]{2}$/)},xb={};Object.defineProperty(xb,"__esModule",{value:!0}),xb.default=void 0;var gL=$t,Yit=function(e){return(0,gL.withParams)({type:"maxLength",max:e},function(r){return!(0,gL.req)(r)||(0,gL.len)(r)<=e})};xb.default=Yit;var kb={};Object.defineProperty(kb,"__esModule",{value:!0}),kb.default=void 0;var yL=$t,Git=function(e){return(0,yL.withParams)({type:"minLength",min:e},function(r){return!(0,yL.req)(r)||(0,yL.len)(r)>=e})};kb.default=Git;var Pb={};Object.defineProperty(Pb,"__esModule",{value:!0}),Pb.default=void 0;var _L=$t,Kit=(0,_L.withParams)({type:"required"},function(t){return typeof t=="string"?(0,_L.req)(t.trim()):(0,_L.req)(t)});Pb.default=Kit;var Tb={};Object.defineProperty(Tb,"__esModule",{value:!0}),Tb.default=void 0;var bL=$t,Xit=function(e){return(0,bL.withParams)({type:"requiredIf",prop:e},function(r,n){return(0,bL.ref)(e,this,n)?(0,bL.req)(r):!0})};Tb.default=Xit;var Mb={};Object.defineProperty(Mb,"__esModule",{value:!0}),Mb.default=void 0;var wL=$t,Jit=function(e){return(0,wL.withParams)({type:"requiredUnless",prop:e},function(r,n){return(0,wL.ref)(e,this,n)?!0:(0,wL.req)(r)})};Mb.default=Jit;var Sb={};Object.defineProperty(Sb,"__esModule",{value:!0}),Sb.default=void 0;var lK=$t,Qit=function(e){return(0,lK.withParams)({type:"sameAs",eq:e},function(r,n){return r===(0,lK.ref)(e,this,n)})};Sb.default=Qit;var Ob={};Object.defineProperty(Ob,"__esModule",{value:!0}),Ob.default=void 0;var Zit=$t,eot=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i,tot=(0,Zit.regex)("url",eot);Ob.default=tot;var Eb={};Object.defineProperty(Eb,"__esModule",{value:!0}),Eb.default=void 0;var rot=$t,not=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(0,rot.withParams)({type:"or"},function(){for(var a=this,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r.length>0&&r.reduce(function(u,l){return u||l.apply(a,i)},!1)})};Eb.default=not;var Db={};Object.defineProperty(Db,"__esModule",{value:!0}),Db.default=void 0;var aot=$t,iot=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(0,aot.withParams)({type:"and"},function(){for(var a=this,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r.length>0&&r.reduce(function(u,l){return u&&l.apply(a,i)},!0)})};Db.default=iot;var Cb={};Object.defineProperty(Cb,"__esModule",{value:!0}),Cb.default=void 0;var dK=$t,oot=function(e){return(0,dK.withParams)({type:"not"},function(r,n){return!(0,dK.req)(r)||!e.call(this,r,n)})};Cb.default=oot;var $b={};Object.defineProperty($b,"__esModule",{value:!0}),$b.default=void 0;var cK=$t,sot=function(e){return(0,cK.withParams)({type:"minValue",min:e},function(r){return!(0,cK.req)(r)||(!/\s/.test(r)||r instanceof Date)&&+r>=+e})};$b.default=sot;var Ab={};Object.defineProperty(Ab,"__esModule",{value:!0}),Ab.default=void 0;var fK=$t,uot=function(e){return(0,fK.withParams)({type:"maxValue",max:e},function(r){return!(0,fK.req)(r)||(!/\s/.test(r)||r instanceof Date)&&+r<=+e})};Ab.default=uot;var Rb={};Object.defineProperty(Rb,"__esModule",{value:!0}),Rb.default=void 0;var lot=$t,dot=(0,lot.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);Rb.default=dot;var Ib={};Object.defineProperty(Ib,"__esModule",{value:!0}),Ib.default=void 0;var cot=$t,fot=(0,cot.regex)("decimal",/^[-]?\d*(\.\d+)?$/);Ib.default=fot,function(t){function e(W){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(E){return typeof E}:e=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},e(W)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"alpha",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"alphaNum",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"and",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"between",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"decimal",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"email",{enumerable:!0,get:function(){return i.default}}),t.helpers=void 0,Object.defineProperty(t,"integer",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"ipAddress",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"macAddress",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"maxLength",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"maxValue",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"minLength",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"minValue",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"not",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"numeric",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"or",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"required",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"requiredIf",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"requiredUnless",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"sameAs",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"url",{enumerable:!0,get:function(){return h.default}});var r=N(fb),n=N(vb),a=N(gb),o=N(yb),i=N(_b),s=N(bb),u=N(wb),l=N(xb),d=N(kb),f=N(Pb),m=N(Tb),c=N(Mb),p=N(Sb),h=N(Ob),v=N(Eb),g=N(Db),_=N(Cb),y=N($b),b=N(Ab),k=N(Rb),M=N(Ib),C=T($t);t.helpers=C;function F(W){if(typeof WeakMap!="function")return null;var $=new WeakMap,E=new WeakMap;return(F=function(x){return x?E:$})(W)}function T(W,$){if(!$&&W&&W.__esModule)return W;if(W===null||e(W)!=="object"&&typeof W!="function")return{default:W};var E=F($);if(E&&E.has(W))return E.get(W);var L={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in W)if(S!=="default"&&Object.prototype.hasOwnProperty.call(W,S)){var O=x?Object.getOwnPropertyDescriptor(W,S):null;O&&(O.get||O.set)?Object.defineProperty(L,S,O):L[S]=W[S]}return L.default=W,E&&E.set(W,L),L}function N(W){return W&&W.__esModule?W:{default:W}}}(vL);function mK(t){if(typeof t>"u")throw Error("Missing param inputParam");let e=t;Number.isInteger(e)&&(e=e.toString());let r=0;const n=e.length,a=n%2;let o,i;for(o=0;o<n;o+=1)i=parseInt(e.charAt(o),10),o%2===a&&(i*=2),i>9&&(i-=9),r+=i;return r%10===0}function pK(t){let e=t.replace(/ /g,"");return e=e.replace(/-/g,""),!mK(e)||(e=[e.slice(0,6),"-",e.slice(6)].join(""),!e.match(/^(\d{6})-(\d{4})$/))?!1:e}function Nb(t){if(typeof t>"u"||t===null||t==="")return!1;let e=t.trim().replace(/[^0-9]+/g,"");if(e.length!==10&&e.length!==12)return!1;if(e.length===10){const a=e.substring(0,2),o=new Date().getFullYear(),i=parseInt(o.toString().substring(2,2),10);parseInt(a,10)===19||parseInt(a,10)===20||(parseInt(a,10)>=0&&parseInt(a,10)<=i?e=`20${e}`:e=`19${e}`)}return new Date().getFullYear()-parseInt(e.substring(0,4),10)<16?!1:mK(e.substring(2))?e:!1}class mot{constructor({defaults:e={width:800,height:600},delay:r=50}={}){this._width=e.width,this._height=e.height,this._delay=r,this._timer=null,this._initialized=!1,this._handler=this._handleResize.bind(this)}_handleResize(){clearTimeout(this._timer),this._timer=setTimeout(()=>{this.update()},this._delay)}get width(){return this._width}get height(){return this._height}get initialized(){return this._initialized}update(){this._width=window.innerWidth,this._height=window.innerHeight}setDelay(e){this._delay=e}init(){return typeof window>"u"?this:this.initialized?this:(this.update(),window.addEventListener("resize",this._handler,{passive:!0}),this._initialized=!0,this)}destroy(){return this.initialized?(window.removeEventListener("resize",this._handler,{passive:!0}),this._initialized=!1,this):this}}const pot=new mot().init(),hK=new ce({data:{windowSize:pot}}),hot={computed:{windowWidth(){return hK.windowSize.width},windowHeight(){return hK.windowSize.height}}},fmt="",{mapFields:vot}=xV({getterType:"forms/getField",mutationType:"forms/updateField"}),got={i18nOptions:{namespaces:"components"},name:"FormClient",components:{ClientAutocomplete:nK},mixins:[hot],props:{requireReference:{type:Boolean,default:!0},searchEnabled:{type:Boolean,default:!1},validateOrgNo:{type:Boolean,default:!1},simpleForm:{type:Boolean,default:!1},inputFocusOnMount:{type:String,default:""},documentRole:{type:String,default:""},answerMethod:{type:Object,default:null},isPublicForm:{type:Boolean,default:!1}},validations(){return{orgNo:{personalNumber(t){return!this.validateOrgNo||!t?!0:this.isIndivid?Nb(t):pK(t)||Nb(t)}},reference:{required:vL.requiredIf(t=>t.requireReference&&!t.isIndivid)},email:{email:vL.email}}},computed:{...vot({id:"endCustomer.id",type:"endCustomer.customerType",name:"endCustomer.name",realOrgNo:"endCustomer.org_no",reference:"endCustomer.reference",email:"endCustomer.email",street:"endCustomer.street",zip:"endCustomer.zip",city:"endCustomer.city",cellphone:"endCustomer.cellphone",cellphoneRegion:"endCustomer.cellphoneRegion",separateWorkAddress:"endCustomer.separateWorkAddress",workStreet:"endCustomer.workStreet",workZip:"endCustomer.workZip",workCity:"endCustomer.workCity",reverseVat:"endCustomer.reverseVat",doUpdateEndCustomer:"endCustomer.doUpdateEndCustomer"}),...Gd({isPosting:"endCustomers/isPosting",companyRegion:"application/companyRegion",feature:"application/feature"}),messages(){return{name:{required:this.$t("forms.client.validations.name.required")},orgNo:{personalNumber:this.$t("forms.client.validations.orgNo.personalNumber")},realOrgNo:{personalNumber:this.$t("forms.client.validations.realOrgNo.realOrgNo")},reference:{required:this.$t("forms.client.validations.reference.required")},email:{required:this.$t("forms.client.validations.email.required"),email:this.$t("forms.client.validations.email.email")}}},orgNo:{get(){return this.realOrgNo},set(t){const e=this.isIndivid?Nb(t):pK(t)||Nb(t);return this.validateOrgNo&&e?(this.realOrgNo=e,!0):(this.realOrgNo=t,!0)}},isIndivid(){return this.type==="individual"}},mounted(){this.$refs[this.inputFocusOnMount]?this.$refs[this.inputFocusOnMount].$el.querySelector("input").focus():this.$refs.name.$el.querySelector("input").focus()},methods:{validateForm(){return this.$v.$touch(),this.$v.$invalid?!1:(this.$emit("submit",!0),!0)},beforeEnter(t){const e=t;e.style.opacity=0},enter(t,e){cb(t,{opacity:1},{duration:70,delay:100,queue:!1}),cb(t,"slideDown",{duration:150,complete:e})},leave(t,e){cb(t,{opacity:0},{duration:50,queue:!1}),cb(t,"slideUp",{duration:150,easing:"easeOutQuart",complete:e})}}};var yot=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-client"},[e.simpleForm?r("form",{on:{submit:function(n){return n.preventDefault(),e.validateForm.apply(null,arguments)}}},[r("div",{staticClass:"flex items-center space-between pb-6 flex-wrap"},[r("div",{staticClass:"flex-grow",staticStyle:{"font-weight":"600","font-size":"20px"}},[e._v(" "+e._s(e.$t("_common:recipient").capitalize())+" ")]),r("CField",[r("CRadioButton",{attrs:{"native-value":"individual",type:"none",size:"small"},model:{value:e.type,callback:function(n){e.type=n},expression:"type"}},[e._v(" "+e._s(e.$t("forms.client.individual"))+" ")]),r("CRadioButton",{attrs:{"native-value":"company",type:"none",size:"small"},model:{value:e.type,callback:function(n){e.type=n},expression:"type"}},[e._v(" "+e._s(e.$t("_common:company").capitalize())+" ")])],1)],1),r("CField",{staticStyle:{"margin-bottom":"1.5rem"},attrs:{label:e.isIndivid?e.$t("name").capitalize():e.$t("company").capitalize(),validator:e.$v.name,messages:e.messages.name,"label-position":"inside"}},[r("ClientAutocomplete",{ref:"name",attrs:{placeholder:e.isIndivid?e.$t("forms.client.placeholders.name"):e.$t("forms.client.placeholders.companyName"),"search-enabled":e.searchEnabled,"show-loading":!0},on:{setClient:function(n){return e.$emit("setClient",n)}},model:{value:e.name,callback:function(n){e.name=n},expression:"name"}})],1),e.isIndivid?e._e():r("CField",{staticStyle:{"margin-bottom":"1.5rem"},attrs:{validator:e.$v.reference,messages:e.messages.reference,label:e.$t("forms.client.reference").capitalize(),"label-position":"inside"}},[r("CInput",{ref:"reference",attrs:{placeholder:e.$t("forms.client.placeholders.reference")},model:{value:e.reference,callback:function(n){e.reference=n},expression:"reference"}})],1),r("CField",{staticStyle:{"margin-bottom":"1.5rem"},attrs:{validator:e.$v.email,messages:e.messages.email,label:e.$t("email").capitalize(),"label-position":"inside"}},[r("CInput",{ref:"email",attrs:{placeholder:e.$t("email").capitalize()},model:{value:e.email,callback:function(n){e.email=typeof n=="string"?n.trim():n},expression:"email"}})],1),r("CPhoneInput",{ref:"cellphone",staticStyle:{"margin-bottom":"1.5rem"},attrs:{label:e.$t("cellphone").capitalize(),placeholder:e.$t("forms.client.placeholders.cellphone"),region:e.cellphoneRegion,"default-region":e.companyRegion,"label-position":"inside"},on:{"update:region":function(n){e.cellphoneRegion=n}},model:{value:e.cellphone,callback:function(n){e.cellphone=n},expression:"cellphone"}}),e.documentRole?r("CDropdown",{staticStyle:{"margin-bottom":"1rem"},attrs:{expanded:""}},[r("CButton",{staticClass:"is-left",staticStyle:{width:"100%"},attrs:{slot:"trigger","dropdown-icon":!0,"icon-props":{stroke:"hsl(0, 0%, 50%)"},"icon-left":e.documentRole==="signee"?"pen-tool":"eye",type:"none",pattern:"secondary"},slot:"trigger"},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`_common:documentRole.${e.documentRole}.label`))+" ")])])]),e._l(["signee","recipient","approver"],function(n){return r("CDropdownItem",{key:n,attrs:{"icon-left":n==="signee"?"pen-tool":"eye","icon-props":{stroke:"hsl(0, 0%, 50%)"}},on:{click:function(a){return e.$emit("update:document-role",n)}}},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`_common:documentRole.${n}.description`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`_common:documentRole.${n}.label`))+" ")])])])})],2):e._e(),r("CButton",{attrs:{type:"secondary",pattern:"tertiary",size:"small","icon-left":"arrow-right"},on:{click:function(n){return e.$emit("show-more")}}},[e._v(" "+e._s(e.$t("forms.client.showMore").capitalize())+" ")]),r("CButton",{staticStyle:{margin:"1em 0 0 0"},attrs:{loading:e.isPosting,"native-type":"submit",type:"secondary",wide:"",size:"medium"}},[e._v(" "+e._s(e.$t(`_common:${e.id?"save":"add"}`,{thing:e.$t("_common:recipient")}))+" ")])],1):r("div",{class:{"column-only":e.windowWidth<=450}},[r("div",{staticClass:"flex items-center justify-center",staticStyle:{"margin-bottom":"2.5rem"}},[r("CField",[r("CRadioButton",{attrs:{"native-value":"individual",type:"secondary",size:"normal"},model:{value:e.type,callback:function(n){e.type=n},expression:"type"}},[e._v(" "+e._s(e.$t("forms.client.individual"))+" ")]),r("CRadioButton",{attrs:{"native-value":"company",type:"secondary",size:"normal"},model:{value:e.type,callback:function(n){e.type=n},expression:"type"}},[e._v(" "+e._s(e.$t("_common:company").capitalize())+" ")])],1)],1),r("CField",{staticClass:"flex",attrs:{grouped:""}},[r("CField",{attrs:{label:e.isIndivid?e.$t("name").capitalize():e.$t("company").capitalize(),validator:e.$v.name,messages:e.messages.name,"label-position":"inside",expanded:""}},[r("ClientAutocomplete",{ref:"name",attrs:{placeholder:e.isIndivid?e.$t("forms.client.placeholders.name"):e.$t("forms.client.placeholders.companyName"),"show-loading":!0,"search-enabled":e.searchEnabled,size:"medium"},on:{setClient:function(n){return e.$emit("setClient",n)}},model:{value:e.name,callback:function(n){e.name=n},expression:"name"}})],1),r("CField",{attrs:{label:e.isIndivid?e.$t("socialNo").capitalize():e.$t("orgNoShort").capitalize(),validator:e.$v.orgNo,messages:e.isIndivid?e.messages.orgNo:e.messages.realOrgNo,"label-position":"inside",expanded:""}},[r("CInput",{ref:"orgNo",attrs:{placeholder:e.isIndivid?e.$t("forms.client.placeholders.socialNo"):e.$t("forms.client.placeholders.orgNo"),size:"medium"},model:{value:e.orgNo,callback:function(n){e.orgNo=n},expression:"orgNo"}})],1)],1),e.type?r("transition",{attrs:{css:!1},on:{"before-enter":e.beforeEnter,enter:e.enter,leave:e.leave}},[e.isIndivid?e._e():r("CField",{attrs:{validator:e.$v.reference,messages:e.messages.reference,label:e.$t("reference").capitalize(),"label-position":"inside"}},[r("CInput",{ref:"reference",attrs:{placeholder:e.$t("forms.client.placeholders.reference"),size:"medium"},model:{value:e.reference,callback:function(n){e.reference=n},expression:"reference"}})],1)],1):e._e(),e.type?r("transition",{attrs:{css:!1},on:{"before-enter":e.beforeEnter,enter:e.enter,leave:e.leave}},[!e.isIndivid&&e.feature("reverseVat")&&e.feature("regionSE")?r("CField",{staticStyle:{"padding-left":"1em","margin-bottom":"2rem"}},[r("CCheckbox",{attrs:{size:"normal"},model:{value:e.reverseVat,callback:function(n){e.reverseVat=n},expression:"reverseVat"}},[e._v(" "+e._s(e.$t("vat.reverseVat"))+" ")])],1):e._e()],1):e._e(),r("CField",{staticClass:"flex",attrs:{grouped:""}},[r("CField",{attrs:{validator:e.$v.email,messages:e.messages.email,label:e.$t("email").capitalize(),"label-position":"inside",expanded:""}},[r("CInput",{ref:"email",attrs:{placeholder:e.$t("email").capitalize(),size:"medium"},model:{value:e.email,callback:function(n){e.email=typeof n=="string"?n.trim():n},expression:"email"}})],1),r("CPhoneInput",{staticStyle:{"margin-bottom":"1.5rem"},attrs:{label:e.$t("cellphone").capitalize(),placeholder:e.$t("forms.client.placeholders.cellphone"),region:e.cellphoneRegion,"default-region":e.companyRegion,"label-position":"inside",size:"medium"},on:{"update:region":function(n){e.cellphoneRegion=n}},model:{value:e.cellphone,callback:function(n){e.cellphone=n},expression:"cellphone"}})],1),r("CField",{attrs:{label:e.$t("address").capitalize(),"label-position":"inside"}},[r("CInput",{ref:"street",attrs:{placeholder:e.$t("forms.client.placeholders.address")},model:{value:e.street,callback:function(n){e.street=n},expression:"street"}})],1),r("CField",{staticClass:"flex force-two",attrs:{grouped:""}},[r("CField",{attrs:{expanded:""}},[r("CInput",{ref:"zip",attrs:{placeholder:e.$t("zip").capitalize(),size:"medium"},model:{value:e.zip,callback:function(n){e.zip=n},expression:"zip"}})],1),r("CField",{attrs:{expanded:""}},[r("CInput",{ref:"city",attrs:{placeholder:e.$t("city").capitalize(),size:"medium"},model:{value:e.city,callback:function(n){e.city=n},expression:"city"}})],1)],1),r("CField",{staticClass:"flex"},[r("CRadio",{staticStyle:{"margin-bottom":"0.5em"},attrs:{"native-value":!1,type:"secondary",size:"normal"},model:{value:e.separateWorkAddress,callback:function(n){e.separateWorkAddress=n},expression:"separateWorkAddress"}},[e._v(" "+e._s(e.$t("forms.client.seperateWorkAddress.false"))+" ")]),r("CRadio",{staticStyle:{"margin-bottom":"0.5em"},attrs:{"native-value":!0,type:"secondary",size:"normal"},model:{value:e.separateWorkAddress,callback:function(n){e.separateWorkAddress=n},expression:"separateWorkAddress"}},[e._v(" "+e._s(e.$t("forms.client.seperateWorkAddress.true"))+" ")])],1),e.type?r("transition",{attrs:{css:!1},on:{"before-enter":e.beforeEnter,enter:e.enter,leave:e.leave}},[e.separateWorkAddress?r("div",{staticStyle:{"margin-top":"1rem"}},[r("CField",{attrs:{label:e.$t("addressWork").capitalize()+` ( ${e.$t("forms.client.workAddressSubLabel")} )`}},[r("CInput",{ref:"workStreet",attrs:{placeholder:e.$t("forms.client.placeholders.address"),size:"medium"},model:{value:e.workStreet,callback:function(n){e.workStreet=n},expression:"workStreet"}})],1),r("CField",{staticClass:"flex force-two",attrs:{grouped:""}},[r("CField",{attrs:{expanded:""}},[r("CInput",{ref:"workZip",attrs:{placeholder:e.$t("zip").capitalize(),size:"medium",expanded:""},model:{value:e.workZip,callback:function(n){e.workZip=n},expression:"workZip"}})],1),r("CField",{attrs:{expanded:""}},[r("CInput",{ref:"workCity",attrs:{placeholder:e.$t("city").capitalize(),size:"medium",expanded:""},model:{value:e.workCity,callback:function(n){e.workCity=n},expression:"workCity"}})],1)],1)],1):e._e()]):e._e(),e.documentRole||e.answerMethod?r("CField",{staticClass:"flex pt-4",attrs:{grouped:""}},[e.documentRole?r("div",{staticClass:"dropdown-field-wrapper"},[r("div",{staticClass:"text-sm text-gray-600 my-1"},[e._v(" "+e._s(e.$t("_common:documentRole.title"))+" ")]),r("CDropdown",{staticStyle:{"margin-bottom":"1rem"},attrs:{expanded:""}},[r("CButton",{staticClass:"is-left",staticStyle:{width:"100%"},attrs:{slot:"trigger","dropdown-icon":!0,"icon-props":{stroke:"hsl(0, 0%, 50%)"},"icon-left":e.documentRole==="signee"?"pen-tool":"eye",type:"none",pattern:"secondary"},slot:"trigger"},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`_common:documentRole.${e.documentRole}.label`))+" ")])])]),e._l(["signee","recipient","approver"],function(n){return r("CDropdownItem",{key:n,attrs:{"icon-left":n==="signee"?"pen-tool":"eye","icon-props":{stroke:"hsl(0, 0%, 50%)"}},on:{click:function(a){return e.$emit("update:document-role",n)}}},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`_common:documentRole.${n}.description`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`_common:documentRole.${n}.label`))+" ")])])])})],2)],1):e._e(),e.answerMethod?r("div",{staticClass:"dropdown-field-wrapper"},[r("div",{staticClass:"text-sm text-gray-600 my-1"},[e._v(" "+e._s(e.$t("_common:signMethod.title"))+" ")]),r("CDropdown",{staticStyle:{"margin-bottom":"1rem"},attrs:{expanded:""}},[r("CButton",{staticClass:"is-left",attrs:{slot:"trigger","dropdown-icon":!0,type:"none",pattern:"secondary",wide:""},slot:"trigger"},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`components:account.documentForm.send.signMethod.${e.answerMethod.accept}.title`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`components:account.documentForm.send.signMethod.${e.answerMethod.accept}.content`))+" ")])])]),e._l([...!e.isPublicForm&&e.feature("bankId")?["bankId"]:[],"signature","inPerson"],function(n){return r("CDropdownItem",{key:n,on:{click:function(a){return e.$emit("update:answer-method",{...e.answerMethod,accept:n})}}},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`components:account.documentForm.send.signMethod.${n}.title`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`components:account.documentForm.send.signMethod.${n}.content`))+" ")])])])})],2)],1):e._e()]):e._e(),r("div",{staticStyle:{"margin-top":"3rem"}},[r("CButton",{attrs:{loading:e.isPosting,type:"secondary",wide:"",size:"medium"},on:{click:e.validateForm}},[e._v(e._s(e.$t("_common:save",{thing:e.$t("_common:recipient")})))])],1)],1)])},_ot=[],bot=$e(got,yot,_ot,!1,null,"b069851b",null,null);const wot=bot.exports,mmt="",{mapFields:xot}=xV({getterType:"forms/getField",mutationType:"forms/updateField"}),kot={name:"ClientModal",i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.clients"},components:{FormClient:wot},props:{documentClientIndex:{type:Number,default:0},signOrder:{type:Number,default:0},inputFocusOnMount:{type:String,default:""},forceExpand:{type:Boolean,default:!1},isPublicForm:{type:Boolean,default:!1}},data(){return{storedNewClient:{documentRole:"signee",answerMethod:{accept:"signature",deny:"button"}},isLoading:!1,hasChanged:!1,showMore:!1}},computed:{...xot({endCustomer:"endCustomer"}),...e6("forms",{formData:t=>t.document2}),isFullScreen(){return this.$mq==="sm"||this.showMore}},created(){this.forceExpand&&(this.showMore=!0);const t=te(this.formData,`clients[${this.documentClientIndex}]`,{});this.loadForm(t),["endCustomer","storedNewClient"].forEach(e=>this.$watch(e,{deep:!0,handler(){this.hasChanged=!0}}))},methods:{...Ky({saveClient:Oe.FORM_SUBMIT_ENDCUSTOMER,setFormValue:Oe.SET_FORM_VALUE,showMessage:Oe.SHOW_MESSAGE}),loadForm(t={}){this.storedNewClient=Object.assign(this.storedNewClient,t),this.endCustomer=gx({type:this.$brand==="cling"?"individual":"company",...t})},async onSave(){this.isLoading=!0;let t=te(this.endCustomer,"id");if(!this.isPublicForm){let e=!1;this.endCustomer&&(this.endCustomer.id?this.can("endCustomers","modify",this.endCustomer.id)&&(e=!0):this.can("endCustomers","create")&&(e=!0)),e&&(t=await this.saveClient())}this.setFormValue({key:`document2.clients[${this.documentClientIndex}]`,value:vx({...this.endCustomer,...t&&{id:t}},{...this.storedNewClient,signOrder:this.signOrder})}),this.$emit("close"),this.isLoading=!1},close(){return!this.hasChanged||!this.showMore?this.$emit("close"):this.showMessage({displayType:"dialog",type:"danger",title:this.$t("unsavedDialog.title"),message:this.$t("unsavedDialog.message"),actions:{cancel:{text:this.$t("unsavedDialog.cancel"),callback:"cancel"},submit:{text:this.$t("unsavedDialog.submit"),callback:()=>this.$emit("close")}}})}}};var Pot=function(){var e=this,r=e._self._c;return r("div",{staticClass:"font-inter",class:{"full-screen":e.isFullScreen,"modal-overlay":!0},on:{"&click":function(n){return n.target!==n.currentTarget?null:e.close.apply(null,arguments)}}},[r("div",{staticClass:"modal-container",style:!e.isFullScreen&&{padding:"3rem"}},[e.isFullScreen?r("CButton",{staticClass:"modal-close",attrs:{pattern:"tertiary",type:"none",circle:"",icon:"x"},on:{click:e.close}}):e._e(),r("FormClient",{staticClass:"modal-main",attrs:{"search-enabled":!0,"require-reference":!1,"simple-form":!e.showMore,"input-focus-on-mount":e.inputFocusOnMount,"document-role":e.storedNewClient.documentRole,"answer-method":e.storedNewClient.answerMethod,"is-public-form":e.isPublicForm},on:{"update:documentRole":function(n){return e.$set(e.storedNewClient,"documentRole",n)},"update:document-role":function(n){return e.$set(e.storedNewClient,"documentRole",n)},"update:answerMethod":function(n){return e.$set(e.storedNewClient,"answerMethod",n)},"update:answer-method":function(n){return e.$set(e.storedNewClient,"answerMethod",n)},setClient:function(n){return e.loadForm(n)},submit:e.onSave,"show-more":function(n){e.showMore=!0}}})],1)])},Tot=[],Mot=$e(kot,Pot,Tot,!1,null,"5ca23472",null,null);const vK=Mot.exports,pmt="",Sot={name:"ClientSendListItem",props:{client:{type:Object,default:()=>({})},isOrder:{type:Boolean,default:!1},isSender:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},data(){return{isHover:!1,isDropdownOpen:!1}}};var Oot=function(){var n;var e=this,r=e._self._c;return r("div",{staticClass:"rc-card c-flex-row c-align-middle",class:{"is-hover":e.isHover,"has-controls":e.isOrder},staticStyle:{"padding-left":"8px"},on:{click:function(a){e.isSender?e.$refs.dropdown.toggle():e.$emit("open")},"&mouseover":function(a){e.isHover=!0},"&mouseleave":function(a){e.isHover=!1}}},[e.compact?r("div",{staticStyle:{"font-size":"14px"}},[r("div",[e._v(e._s(e.client.name||e.client.companyName))]),e.client.name&&e.client.companyName?r("div",{staticStyle:{"font-size":"12px","font-weight":"500"}},[e._v(" "+e._s(e.client.companyName)+" ")]):e._e(),e.client.documentRole?r("div",{staticClass:"has-text-grey-dark",staticStyle:{"font-size":"13px","margin-top":"4px"}},[e._v(" "+e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`))+" ")]):e._e(),e.isOrder?r("div",{staticClass:"compact-order"},[r("BaseIcon",{staticClass:"compact-order-button",attrs:{size:"16",type:"chevron-up"},on:{click:function(a){return a.preventDefault(),a.stopPropagation(),e.$emit("move",-1)}}}),r("div",{staticClass:"rc-order",staticStyle:{width:"20px",height:"20px"}},[e._v(" "+e._s(e.client.signOrder)+" ")]),r("BaseIcon",{staticClass:"compact-order-button",attrs:{size:"16",type:"chevron-down"},on:{click:function(a){return a.preventDefault(),a.stopPropagation(),e.$emit("move",1)}}})],1):e._e()]):[r("div",{staticStyle:{width:"34px",flex:"0 0 34px",display:"inline-flex","justify-content":"center"}},[e.isOrder?r("div",{staticStyle:{position:"relative",display:"inline-block"}},[r("CButton",{staticClass:"rc-order__button up",attrs:{type:"none",pattern:"primary",circle:"",raised:"",size:"small",icon:"minus"},on:{click:function(a){return a.preventDefault(),a.stopPropagation(),e.$emit("move",-1)}}}),r("CButton",{staticClass:"rc-order__button down",attrs:{type:"none",pattern:"primary",circle:"",raised:"",size:"small",icon:"plus"},on:{click:function(a){return a.preventDefault(),a.stopPropagation(),e.$emit("move",1)}}}),r("div",{staticClass:"rc-order"},[e._v(" "+e._s(e.client.signOrder)+" ")])],1):r("BaseIcon",{staticClass:"has-text-secondary",staticStyle:{"margin-right":"8px",flex:"0 0 18px"},attrs:{type:e.isSender?"send":["signee","approver"].includes(e.client.documentRole)?"pen-tool":"eye",size:"18"}})],1),r("div",{staticClass:"rc-data truncate-text"},[e.client.name||e.client.companyName?r("div",{staticStyle:{"font-weight":"500"}},[e._v(e._s(e.client.name||e.client.companyName))]):e.isSender?r("div",{staticClass:"has-text-grey"},[e._v(e._s(e.$t("_common:empty",{thing:e.$t("_common:reference")})))]):e._e(),r("div",{staticClass:"has-text-grey-dark",staticStyle:{"font-size":"12px"}},[e.isSender?[e.isSender?r("span",[e._v(" "+e._s(e.$t("_common:documentRole.sender.description"))+" ")]):e._e(),e.client.documentRole==="signee"?r("span",[e._v(" "+e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`))+" ")]):e._e()]:[((n=e.client.answerMethod)==null?void 0:n.accept)==="inPerson"?r("span",{staticStyle:{"font-size":"13px",color:"hsla(360, 100%, 60%, 0.7)"}},[e._v(" "+e._s(e.$t("_common:signMethod.title"))+": "),r("span",[e._v(" "+e._s(e.$t("_common:signMethod.inPerson"))+" ")])]):e._e(),e.client.documentRole?r("span",[e._v(" "+e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`))+" ")]):e._e(),e.client.email?r("span",[e._v(e._s(e.client.email))]):e._e(),e.client.cellphone?r("span",[e._v(e._s(e.client.cellphone))]):e._e()]],2)])],r("transition",{attrs:{name:"fade-100"}},[e.isHover||e.isDropdownOpen?[e.isSender?r("CDropdown",{ref:"dropdown",staticStyle:{position:"absolute",right:"0.5rem"},attrs:{position:"is-bottom-left","menu-styling":{width:"220px"}},on:{"active-change":function(a){e.isDropdownOpen=a}},nativeOn:{click:function(a){a.stopPropagation()}}},[r("CButton",{attrs:{slot:"trigger",circle:"",size:"small",type:"none",pattern:"secondary",raised:"",icon:"more-horizontal"},slot:"trigger"}),e._t("dropdownOptions")],2):r("CButton",{staticStyle:{position:"absolute",right:"0.5rem"},attrs:{circle:"",size:"small",icon:"x",type:"none",pattern:"secondary",raised:""},on:{click:function(a){return a.stopPropagation(),e.$emit("remove")}}})]:e._e()],2)],2)},Eot=[],Dot=$e(Sot,Oot,Eot,!1,null,"467b29bb",null,null);const gK=Dot.exports,hmt="",Cot={name:"SenderBlockItem",i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.send.senderItem"},components:{RecipientBlockItem:gK},mixins:[dc(["senderClient"],{useEmit:!1,setFnName:"setFormValue"})],props:{setFormValue:{type:Function,required:!0},defaultAddSenderClient:{type:Boolean,default:!1}},data(){return{senderClientData:null}},computed:{...Gd({feature:"application/feature"})},created(){this.generateSenderClient(),this._document.id||this._document.isDirty("senderClient")?this.toggleSenderSign(!!this.senderClient):this.defaultAddSenderClient&&this.toggleSenderSign(!0)},methods:{get:te,generateSenderClient(){const{company:t,user:e}=this._document.sender||{},r=te(this._document,"data.defaultAnswerMethod");this.senderClientData={...hx(),documentRole:"recipient",...r&&{answerMethod:r},...this.senderClient,type:"company",companyName:t.name,name:e.name,email:e.email,cellphone:e.cellphone}},toggleSenderSign(t){this.senderClientData.documentRole=t?"signee":"recipient",this.senderClient=t?this.senderClientData:null,this._document.setDirty("senderClient")},setSenderMethod(t){const e={...this.senderClient,answerMethod:{accept:t,deny:"button"}};this.senderClient=e,this.senderClientData={...e}}}};var $ot=function(){var e=this,r=e._self._c;return e.senderClientData?r("RecipientBlockItem",{staticClass:"first-of-group last-of-group",staticStyle:{display:"inline-flex",width:"auto","padding-right":"2em","min-width":"220px"},attrs:{client:e.senderClientData,"is-sender":!0}},[r("template",{slot:"dropdownOptions"},[r("CDropdownItem",{attrs:{value:!!e.senderClient,"close-on-click":!1,toggle:""},on:{input:e.toggleSenderSign}},[e._v(" "+e._s(e.$t("toggle.label"))+" ")]),e.senderClient?[r("CDropdownItem",{attrs:{separator:""}}),r("div",{staticClass:"has-text-grey",staticStyle:{"font-size":"13px",padding:"0.5rem 0 0.25rem 1rem","font-weight":"500"}},[e._v(" "+e._s(e.$t("_common:signMethod.title"))+" ")]),e._l(["login","signature",...e.feature("bankId")?["bankId"]:[]],function(n){return r("CDropdownItem",{key:n,attrs:{"icon-right":e.get(e.senderClient,"answerMethod.accept")===n?"check":""},on:{click:function(a){return e.setSenderMethod(n)}}},[e._v(" "+e._s(e.$t(`_common:signMethod.${n}`))+" ")])})]:r("div",{staticClass:"has-background-grey-lightest-2 has-text-grey-darker",staticStyle:{padding:"0.5rem",margin:"0.5rem","font-size":"13px","border-radius":"4px","line-height":"1.25","font-weight":"500"}},[e._v(" "+e._s(e.$t("toggle.description"))+" ")])],2)],2):e._e()},Aot=[],Rot=$e(Cot,$ot,Aot,!1,null,"503a2933",null,null);const Iot=Rot.exports,vmt="",Not={name:"RecipientBlock",i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.send"},components:{AddClientCallout:Sit,ClientModal:vK,RecipientBlockItem:gK,SenderBlockItem:Iot},mixins:[dc(["clients"],{useEmit:!1,setFnName:"setFormValue"})],props:{compact:{type:Boolean,default:!1},setFormValue:{type:Function,required:!0},removeFormValue:{type:Function,required:!0},defaultAddSenderClient:{type:Boolean,default:!1},isPublicForm:{type:Boolean,default:!1}},computed:{sortedClients(){return[...this.clients].map((t,e)=>({...t,index:e})).sort((t,e)=>t.signOrder-e.signOrder)},maxSignOrder(){if(!this.useSignOrder||this.sortedClients.length===0)return 0;const{signOrder:t}=this.sortedClients[this.sortedClients.length-1];return t},useSignOrder(){return te(this._document,"useSignOrder",!1)}},methods:{onMoveRecipient({index:t,direction:e}){this.clients=pme(this.clients).set({...this.clients[t],signOrder:Math.max(this.clients[t].signOrder+e,0)},t)},toggleSignOrder(t){let e=[];if(t){const r=!this.clients.every(({signOrder:n})=>!n);this.clients=this.clients.map((n,a)=>({...n,signOrder:r?n.signOrder:a+1}))}else e=te(this._document,"template.reminders",[]),e.length||(e=rd.default);this.setFormValue({key:"data.reminders",value:e}),this.setFormValue({key:"useSignOrder",value:t})},removeClient(t){this.removeFormValue(`clients[${t}]`)},openClientModal(t=0){const e=te(this,`clients[${t}].signOrder`);this.$modal.show(vK,{documentClientIndex:t,...this.useSignOrder&&{signOrder:ot(e)==="number"?e:this.maxSignOrder+1},isPublicForm:this.isPublicForm})},setClient(t){this.setFormValue({key:`clients[${this.clients.length}]`,value:t})}}};var Lot=function(){var e=this,r=e._self._c;return r("div",[e.compact?e._e():[r("div",{staticClass:"has-text-grey-dark",staticStyle:{"font-size":"13px","font-weight":"500","padding-bottom":"3px"}},[e._v(" "+e._s(e.$t("_common:from").capitalize())+": ")]),r("SenderBlockItem",{attrs:{_document:e._document,_value:{senderClient:"senderClient"},"set-form-value":e.setFormValue,"default-add-sender-client":e.defaultAddSenderClient}})],r("div",{staticClass:"block-title c-flex-row has-text-grey",class:{"block-title__line":!e.compact},staticStyle:{"padding-bottom":"3px"}},[e.compact?e._e():r("div",{staticClass:"has-text-grey-dark",staticStyle:{"font-size":"13px","font-weight":"500"}},[e._v(" "+e._s(e.$t("_common:to").capitalize())+": ")]),e.clients&&e.clients.length?r("div",{staticStyle:{display:"inline-flex","align-items":"center","justify-content":"flex-end","margin-left":"auto"}},[r("BaseIcon",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.$t("signOrder.tooltip"),expression:"$t('signOrder.tooltip')"}],staticStyle:{"margin-right":"0.3rem"},attrs:{type:"info",size:"16"}}),r("div",{staticStyle:{"margin-right":"0.3rem","font-size":"13px","font-weight":"500"}},[e._v(" "+e._s(e.$t("signOrder.label"))+" ")]),r("CSwitch",{staticStyle:{"margin-right":"0"},attrs:{value:e.useSignOrder,size:"tiny",type:"success"},on:{input:e.toggleSignOrder}})],1):e._e()]),e.clients&&e.clients.length?[e.useSignOrder?r("transition-group",{staticClass:"list-move",attrs:{name:"list-move"}},[e._l(e.sortedClients,function(n,a){return[a>0&&n.signOrder!==e.sortedClients[a-1].signOrder?r("div",{key:a,staticClass:"recipient-divider"},[r("div",{staticClass:"recipient-divider__line"})]):e._e(),r("div",{key:n._uniqueId,staticStyle:{padding:"1px 0"}},[r("RecipientBlockItem",{class:{"first-of-group":a===0||a>0&&n.signOrder!==e.sortedClients[a-1].signOrder,"last-of-group":a===e.sortedClients.length-1||e.sortedClients[a+1]&&n.signOrder!==e.sortedClients[a+1].signOrder},attrs:{client:n,"is-order":e.useSignOrder,compact:e.compact},on:{move:function(o){return e.onMoveRecipient({index:n.index,direction:o})},open:function(o){return e.openClientModal(n.index)},remove:function(o){return e.removeClient(n.index)}}})],1)]})],2):e._l(e.clients,function(n,a){return r("RecipientBlockItem",{key:n._uniqueId,class:{"first-of-group":a===0,"last-of-group":a===e.clients.length-1},staticStyle:{"margin-bottom":"3px"},attrs:{"is-order":e.useSignOrder,compact:e.compact,client:n},on:{open:function(o){return e.openClientModal(a)},remove:function(o){return e.removeClient(a)}}})}),e.compact?e._e():r("CButton",{staticClass:"is-thinner",staticStyle:{"font-size":"14px"},attrs:{type:"secondary",pattern:"tertiary","icon-left":"plus",size:"normal"},on:{click:function(n){return e.openClientModal(e.clients.length)}}},[e._v(" "+e._s(e.$t("_common:add",{thing:e.$t("_common:recipient")}))+" ")])]:e.compact?e._e():r("AddClientCallout",{attrs:{compact:!0},on:{add:function(n){return e.openClientModal(e.clients.length)},setClient:e.setClient}})],2)},Wot=[],Fot=$e(Not,Lot,Wot,!1,null,"8623941a",null,null);const jot=Fot.exports,gmt="",Vot={name:"SendForm",i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.send"},components:{Simplebar:det,BaseDatePicker:KG,RecipientBlock:jot,ErrorCallout:Dat},mixins:[dc(["expiresAt","clients","defaultAnswerMethod","reminders","name"],{useEmit:!1,setFnName:"setFormValue"})],props:{setFormValue:{type:Function,required:!0},removeFormValue:{type:Function,required:!0},useScroll:{type:Boolean,default:!1},addMissingAnswerMethod:{type:Boolean,default:!1},onSendDocument:{type:Function,default:null}},data(){return{localIsPosting:!1,clientHoverIndex:null}},computed:{...Gd({deliveryTypes:"forms/deliveryTypes",isPostingDocument:"documents2/isPosting",isPostingProject:"projects/isPosting",documentSenderSign:"settings/documentSenderSign",getCompanySetting:"settings/getCompanySetting",feature:"application/feature"}),isPosting(){return this.isPostingDocument||this.isPostingProject||this.localIsPosting},isPublicForm(){return!!(this.viewSettings&&this.viewSettings.isPublicForm)},useSignOrder(){var t;return((t=this._document)==null?void 0:t.useSignOrder)||!1},noOfReminders(){return Object.values(this.reminders||[]).reduce((t,e)=>e&&(e.sendDays||e.sendAt)&&e.type!=="first"?t+1:t,0)},smsActivated(){return this.deliveryTypes.sms},emailActivated(){return this.deliveryTypes.email},isManualDelivery(){return!this.smsActivated&&!this.emailActivated},sendTypesText(){return this.emailActivated||this.smsActivated?[...this.emailActivated?[this.$t("_common:email").capitalize()]:[],...this.smsActivated?[this.$t("_common:sms")]:[]].join(" & "):this.$t("manualDelivery")},clientsAreMissingContactInfo(){return this.clients.some(t=>!(t.email||t.cellphone))},signMethods(){return[...this.feature("bankId")?[{value:"bankId",title:this.$t("signMethod.bankId.title"),content:this.$t("signMethod.bankId.content")}]:[],{value:"signature",title:this.$t("signMethod.signature.title"),content:this.$t("signMethod.signature.content")}]}},created(){var t;if(!this.expiresAt&&!this._document.isDirty("expiresAt")){const e=this.getCompanySetting("defaultExpireDays");if(e&&Number.isInteger(e)&&e>0){const r=new Date;r.setDate(r.getDate()+e),this.setField({field:"expiresAt",value:r.toISOString(),options:{ignoreChanges:!0}})}}this.addMissingAnswerMethod&&!this.defaultAnswerMethod&&(this.defaultAnswerMethod={accept:"signature",deny:"button"}),((t=this.defaultAnswerMethod)==null?void 0:t.accept)==="button"&&this.setAnswerMethod("signature",{ignoreChanges:!0})},validations:{clients:{required:t=>t&&t.length}},methods:{...Ky({saveDocument:Oe.SAVE_DYNDOC_FORM}),async doSendDocument(){var t;try{if(this.localIsPosting=!0,this.$v.$touch(),this.$v.$invalid)return;typeof this.onSendDocument=="function"&&await this.onSendDocument(),((t=this._document)==null?void 0:t.status)==="denied"&&this.resetDeniedDocument(),await this.saveDocument({doSend:!0})}catch(e){throw e}finally{this.localIsPosting=!1}},setDeliveryMethod(t,e){const r=this.deliveryTypes;r[t]=e;const n=Object.keys(r).filter(a=>r[a]);(this.clients||[]).forEach((a,o)=>{this.setFormValue({key:`clients[${o}].deliveryTypes`,value:n})})},setAnswerMethod(t,e={}){this.setField({field:"defaultAnswerMethod",value:{...this.defaultAnswerMethod,accept:t},options:e}),(this.clients||[]).forEach((r,n)=>{var a;((a=r.answerMethod)==null?void 0:a.accept)!=="inPerson"&&this.setField({key:`clients[${n}].answerMethod.accept`,value:t,options:e})})},openReminders(){this.useSignOrder||this.$modal.show(jat,{_document:this._document,setFormValue:this.setFormValue,removeFormValue:this.removeFormValue},{adaptive:!0,height:"auto",width:"90%",maxWidth:360,scrollable:!0})},openSendLater(){this.$v.$touch(),!this.$v.$invalid&&this.$modal.show(qat,{_document:this._document,setFormValue:this.setFormValue,removeFormValue:this.removeFormValue},{adaptive:!0,height:"auto",width:"90%",maxWidth:360,scrollable:!0})},resetDeniedDocument(){(this.clients||[]).forEach((t,e)=>{this.setFormValue({key:`clients[${e}].answer`,value:null})}),this.setFormValue({key:"data.rejectReasons",value:[]}),this.setFormValue({key:"status",value:"sent"})}}};var zot=function(){var e=this,r=e._self._c;return r("div",{staticStyle:{display:"flex","flex-direction":"column",height:"100%"}},[r(e.useScroll?"Simplebar":"div",{tag:"component",staticClass:"main-container"},[r("div",{staticClass:"main-container__content"},[r("div",{staticStyle:{"font-size":"calc(1em + 4px)","font-weight":"700","padding-bottom":"1rem"}},[e._v(" "+e._s(e.$t("_common:send",{thing:e.$t("_common:document").toLowerCase()}))+" ")]),r("div",{staticClass:"block-spacing",staticStyle:{"margin-bottom":"2rem"}},[r("div",{staticClass:"has-text-grey-darker",staticStyle:{"font-size":"13px","font-weight":"500","padding-bottom":"4px"}},[e._v(" "+e._s(e.$t("_common:documentName"))+" ")]),r("CInput",{attrs:{placeholder:e.$t("_common:name").capitalize(),filled:""},model:{value:e.name,callback:function(n){e.name=n},expression:"name"}})],1),r("div",{staticStyle:{"margin-bottom":"2em"}},[r("RecipientBlock",{attrs:{_value:{clients:"clients"},_document:e._document,"set-form-value":e.setFormValue,"remove-form-value":e.removeFormValue,"default-add-sender-client":e.documentSenderSign,"is-public-form":e.isPublicForm}})],1),e._t("default"),e.defaultAnswerMethod&&e.signMethods.length>1?r("div",{staticClass:"block-spacing",staticStyle:{"margin-bottom":"2rem"}},[r("div",{staticClass:"block-title has-text-grey-dark",staticStyle:{"font-size":"13px","font-weight":"500","padding-bottom":"4px"}},[e._v(" "+e._s(e.$t("signMethod.title"))+" "),r("BaseIcon",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.$t("signMethod.tooltip"),expression:"$t('signMethod.tooltip')"}],staticStyle:{"margin-left":"3px"},attrs:{type:"info",size:"15"}})],1),r("div",{staticClass:"cb-card-group"},e._l(e.signMethods,function(n){return r("div",{key:n.value,staticClass:"cb-card flex",class:{checked:e.defaultAnswerMethod.accept===n.value},on:{click:function(a){e.defaultAnswerMethod.accept!==n.value&&e.setAnswerMethod(n.value)}}},[r("CRadio",{staticStyle:{"margin-right":"0.75em"},attrs:{value:e.defaultAnswerMethod.accept,"native-value":n.value,type:"secondary",size:"small"}}),r("div",{staticClass:"flex-grow"},[r("div",{staticClass:"cb-card-title"},[e._v(e._s(n.title))]),r("div",{directives:[{name:"show",rawName:"v-show",value:e.defaultAnswerMethod.accept===n.value,expression:"defaultAnswerMethod.accept === signMethod.value"}],staticClass:"cb-card-body"},[e._v(" "+e._s(n.content)+" ")])])],1)}),0)]):e._e(),r("div",{staticClass:"block-spacing",staticStyle:{display:"grid","align-items":"center","grid-template-columns":"repeat(auto-fit, minmax(200px, 1fr))","grid-gap":"1em"}},[r("div",[r("BaseDatePicker",{staticClass:"psuedo-input",staticStyle:{position:"relative"},attrs:{"custom-el":!0,direction:"end",tabindex:"0"},model:{value:e.expiresAt,callback:function(n){e.expiresAt=n},expression:"expiresAt"}},[r("div",{staticClass:"psuedo-input-label"},[e._v(e._s(e.$t("validityPeriod")))]),r("div",[e._v(e._s(e.expiresAt?e.$formatDate(e.expiresAt):e.$t("_common:disabled").capitalize()))]),e.expiresAt?r("CButton",{staticStyle:{position:"absolute",right:"1em",top:"1em"},attrs:{icon:"x",size:"small",type:"none",pattern:"secondary"},on:{click:function(n){n.preventDefault(),n.stopPropagation(),e.expiresAt=void 0,e._document.setDirty("expiresAt")}}}):e._e()],1)],1),r("CDropdown",{staticStyle:{flex:"1 0 200px"},attrs:{"mobile-label":e.$t("sendAs"),expanded:""}},[r("div",{staticClass:"psuedo-input",attrs:{slot:"trigger",tabindex:"0"},slot:"trigger"},[r("div",{staticClass:"psuedo-input-label"},[e._v(e._s(e.$t("sendAs")))]),r("div",[e._v(" "+e._s(e.sendTypesText)+" ")])]),r("CDropdownItem",{attrs:{value:e.emailActivated,"close-on-click":!1,toggle:""},on:{click:function(n){return e.setDeliveryMethod("email",!e.emailActivated)}}},[e._v(" "+e._s(e.$t("_common:email").capitalize())+" ")]),e.feature("sms")?r("CDropdownItem",{attrs:{value:e.smsActivated,"close-on-click":!1,toggle:""},on:{click:function(n){return e.setDeliveryMethod("sms",!e.smsActivated)}}},[e._v(" "+e._s(e.$t("_common:sms"))+" ")]):e._e(),r("CDropdownItem",{attrs:{value:"",tooltip:{content:e.$t("manualDeliveryTooltip")}},domProps:{textContent:e._s(e.$t("manualDelivery"))},on:{click:()=>{e.setDeliveryMethod("sms",!1),e.setDeliveryMethod("email",!1)}}})],1),!e.useSignOrder&&!e.isManualDelivery?r("div",{staticClass:"psuedo-input",staticStyle:{position:"relative"},attrs:{tabindex:"0"},on:{click:e.openReminders}},[r("div",{staticClass:"psuedo-input-label"},[e._v(e._s(e.$t("_common:reminder_plural").capitalize()))]),r("div",[e._v(" "+e._s(e.noOfReminders?`${e.noOfReminders} ${e.$i18n.lang==="sv"?e.$t("_common:unitType.unit"):""}`:e.$t("_common:disabled").capitalize())+" ")]),e.noOfReminders?r("CButton",{staticStyle:{position:"absolute",right:"1em",top:"1em"},attrs:{icon:"x",size:"small",type:"none",pattern:"secondary"},on:{click:function(n){n.preventDefault(),n.stopPropagation(),e.reminders=[]}}}):e._e()],1):e._e()],1),e.clientsAreMissingContactInfo&&!e.isManualDelivery?r("ErrorCallout",{staticStyle:{"margin-bottom":"-2rem"},attrs:{message:e.$t("clientsAreMissingContactInfo"),size:"small"}}):e._e()],2)]),r("div",{staticClass:"footer-container"},[e._t("send",function(){return[r("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.clients.length?null:e.$t("components:account.documentForm.clients.errorMessage"),expression:`!clients.length
|
|
572
|
+
`,vat=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function gat(t){const e=window.getComputedStyle(t),r=e.getPropertyValue("box-sizing"),n=parseFloat(e.getPropertyValue("padding-bottom"))+parseFloat(e.getPropertyValue("padding-top")),a=parseFloat(e.getPropertyValue("border-bottom-width"))+parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:vat.map(i=>`${i}:${e.getPropertyValue(i)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:r}}function YG(t,e=1,r=null){rn||(rn=document.createElement("textarea"),document.body.appendChild(rn));const{paddingSize:n,borderSize:a,boxSizing:o,contextStyle:i}=gat(t);rn.setAttribute("style",`${i};${hat}`),rn.value=t.value||t.placeholder||"";let s=rn.scrollHeight;const u={};o==="border-box"?s+=a:o==="content-box"&&(s-=n),rn.value="";const l=rn.scrollHeight-n;if(e!==null){let d=l*e;o==="border-box"&&(d=d+n+a),s=Math.max(d,s),u.minHeight=`${d}px`}if(r!==null){let d=l*r;o==="border-box"&&(d=d+n+a),s=Math.min(d,s)}return u.height=`${s}px`,rn.parentNode&&rn.parentNode.removeChild(rn),rn=null,u}const rmt="",yat={name:"BaseInput",componentName:"BaseInput",mixins:[pat],inheritAttrs:!1,inject:{elForm:{default:""},elFormItem:{default:""}},props:{value:[String,Number],size:String,resize:String,form:String,disabled:Boolean,isPrice:{type:Boolean,default:!1},isIncVat:{type:Boolean,default:!1},vat:{type:Number,default:null},showZero:{type:Boolean,default:!1},type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:null},autoComplete:{type:String,default:"off"},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},tabindex:String,styleClass:{type:String,default:""}},data(){return{currentValue:this.value===void 0||this.value===null?"":this.value,prefixOffset:null,inputPrefixOffset:null,inputSuffixOffset:null,suffixOffset:null,hovering:!1,focused:!1,isOnComposition:!1,valueBeforeComposition:null,textareaCalcStyle:{}}},computed:{internalValue:{get(){if(this.isPrice&&!Number.isNaN(parseFloat(this.value))&&Number.isFinite(this.value)){if(!this.value&&!this.showZero)return"";let t=this.value;return this.isIncVat&&(t*=(100+this.vat)/100),t=Math.round(t)/100,t}return this.value},set(t){let e=t;this.isPrice&&(e=t*100,this.isIncVat&&(e/=(100+this.vat)/100),e=Math.round(e)),this.$emit("input",e)}},internalType(){return this.isPrice?"number":this.type},_elFormItemSize(){return(this.elFormItem||{}).elFormItemSize},validateState(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon(){return this.elForm?this.elForm.statusIcon:!1},validateIcon(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},inputSize(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},textareaStyle(){return{...this.textareaCalcStyle,resize:this.resize}},inputDisabled(){return this.disabled||(this.elForm||{}).disabled},isGroup(){return this.$slots.prepend||this.$slots.append},showClear(){return this.clearable&&!this.disabled&&!this.readonly&&this.currentValue!==""&&(this.focused||this.hovering)}},watch:{value(t,e){this.$nextTick(this.resizeTextarea),this.setCurrentValue(t)}},created(){this.$on("inputSelect",this.select)},mounted(){this.isGroup&&(this.prefixOffset=this.calcIconOffset("pre"),this.suffixOffset=this.calcIconOffset("suf")),this.$slots.prefix&&(this.inputPrefixOffset=this.calcInputPrefixOffset()),this.$slots.suffix&&(this.inputSuffixOffset=this.calcInputSuffixOffset()),this.resizeTextarea()},methods:{preventScroll(t){this.focused&&this.internalType==="number"&&t.preventDefault()},focus(){const t=this.$refs.input||this.$refs.textarea;t&&eme(t)},blur(){(this.$refs.input||this.$refs.textarea).blur()},handleBlur(t){this.focused=!1,this.$emit("blur",t),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.currentValue])},select(){(this.$refs.input||this.$refs.textarea).select()},handleFocus(t){this.focused=!0,this.$emit("focus",t)},handleChange(t){this.$emit("change",t.target.value)},setCurrentValue(t){this.isOnComposition&&t===this.valueBeforeComposition||(this.currentValue=t,!this.isOnComposition&&this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[t]))},calcInputPrefixOffset(){return this.$slots.prefix?{paddingLeft:`${this.$el.querySelector(".el-input__prefix").offsetWidth+14*1.8}px`}:null},calcInputSuffixOffset(){return this.$slots.suffix?{paddingRight:`${this.$el.querySelector(".el-input__suffix").offsetWidth+14*1.8}px`}:null},calcIconOffset(t){const r={suf:"append",pre:"prepend"}[t];return this.$slots[r]?{transform:`translateX(${t==="suf"?"-":""}${this.$el.querySelector(`.el-input-group__${r}`).offsetWidth}px)`}:null},clear(){this.$emit("input",""),this.$emit("change",""),this.$emit("clear"),this.setCurrentValue(""),this.focus()},allowKeyCode(t){if(!this.isPrice)return!0;const e=t.which?t.which:t.keyCode;return[69,187].includes(e)?(t.preventDefault(),!1):!0},resizeTextarea(){const{autosize:t,type:e}=this;if(e!=="textarea")return;if(!t){this.textareaCalcStyle={minHeight:YG(this.$refs.textarea).minHeight};return}const{minRows:r,maxRows:n}=t;this.textareaCalcStyle=YG(this.$refs.textarea,r,n)}}};var _at=function(){var e=this,r=e._self._c;return r("div",{staticClass:"input-container",class:[e.internalType==="textarea"?"el-textarea":"el-input",e.inputSize?"el-input--"+e.inputSize:"",e.styleClass?e.styleClass:"",e.focused?"is-focus":"",e.currentValue?"is-value":"",{"is-disabled":e.inputDisabled,"el-input-group":e.$slots.prepend||e.$slots.append,"el-input-group--append":e.$slots.append,"el-input-group--prepend":e.$slots.prepend,"el-input--prefix":e.$slots.prefix||e.prefixIcon,"el-input--suffix":e.$slots.suffix||e.suffixIcon||e.clearable,"el-input-error":e.validateState==="error"}],on:{mousewheel:e.preventScroll,mouseenter:function(n){e.hovering=!0},mouseleave:function(n){e.hovering=!1}}},[e.type!=="textarea"?[e.$slots.prepend?r("div",{staticClass:"el-input-group__prepend"},[e._t("prepend")],2):e._e(),e.internalType==="checkbox"?r("input",e._b({directives:[{name:"model",rawName:"v-model",value:e.internalValue,expression:"internalValue"}],ref:"input",staticClass:"el-input__inner",style:[e.inputPrefixOffset,e.inputSuffixOffset],attrs:{step:e.internalType==="number"?.01:!1,tabindex:e.tabindex,disabled:e.inputDisabled,autocomplete:e.autoComplete,"aria-label":e.label,type:"checkbox"},domProps:{checked:Array.isArray(e.internalValue)?e._i(e.internalValue,null)>-1:e.internalValue},on:{focus:e.handleFocus,blur:e.handleBlur,change:[function(n){var a=e.internalValue,o=n.target,i=!!o.checked;if(Array.isArray(a)){var s=null,u=e._i(a,s);o.checked?u<0&&(e.internalValue=a.concat([s])):u>-1&&(e.internalValue=a.slice(0,u).concat(a.slice(u+1)))}else e.internalValue=i},e.handleChange],keydown:e.allowKeyCode}},"input",e.$attrs,!1)):e.internalType==="radio"?r("input",e._b({directives:[{name:"model",rawName:"v-model",value:e.internalValue,expression:"internalValue"}],ref:"input",staticClass:"el-input__inner",style:[e.inputPrefixOffset,e.inputSuffixOffset],attrs:{step:e.internalType==="number"?.01:!1,tabindex:e.tabindex,disabled:e.inputDisabled,autocomplete:e.autoComplete,"aria-label":e.label,type:"radio"},domProps:{checked:e._q(e.internalValue,null)},on:{focus:e.handleFocus,blur:e.handleBlur,change:[function(n){e.internalValue=null},e.handleChange],keydown:e.allowKeyCode}},"input",e.$attrs,!1)):r("input",e._b({directives:[{name:"model",rawName:"v-model",value:e.internalValue,expression:"internalValue"}],ref:"input",staticClass:"el-input__inner",style:[e.inputPrefixOffset,e.inputSuffixOffset],attrs:{step:e.internalType==="number"?.01:!1,tabindex:e.tabindex,disabled:e.inputDisabled,autocomplete:e.autoComplete,"aria-label":e.label,type:e.internalType},domProps:{value:e.internalValue},on:{focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange,keydown:e.allowKeyCode,input:function(n){n.target.composing||(e.internalValue=n.target.value)}}},"input",e.$attrs,!1)),e.$slots.prefix||e.prefixIcon?r("span",{staticClass:"el-input__prefix",style:e.prefixOffset},[e._t("prefix"),e.prefixIcon?r("i",{staticClass:"el-input__icon",class:e.prefixIcon}):e._e()],2):e._e(),e.$slots.suffix||e.suffixIcon||e.showClear||e.validateState&&e.needStatusIcon?r("span",{staticClass:"el-input__suffix",style:e.suffixOffset},[r("span",{staticClass:"el-input__suffix-inner"},[e.showClear?r("div",{staticClass:"el-input__icon el-input__clear",on:{click:e.clear}},[r("svg",{attrs:{width:"20",height:"20",viewBox:"0 0 151 151",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M75.5 151c41.697499 0 75.5-33.8025 75.5-75.5S117.197499 0 75.5 0 0 33.8025 0 75.5 33.802501 151 75.5 151zm9.606602-75.5l19.441267-19.44127c2.932807-2.9328 2.933101-7.68184.004169-10.61077-2.922972-2.92297-7.679536-2.92706-10.610771.00417L74.5 64.8934 55.058733 45.45213c-2.932807-2.93281-7.681839-2.9331-10.610771-.00417-2.922973 2.92297-2.927066 7.67954.004169 10.61077L63.893398 75.5 44.452131 94.94127c-2.932807 2.9328-2.933101 7.68184-.004169 10.61077 2.922972 2.92297 7.679536 2.92706 10.610771-.00417L74.5 86.1066l19.441267 19.44127c2.932807 2.93281 7.681839 2.9331 10.610771.00417 2.922973-2.92297 2.927066-7.67954-.004169-10.61077L85.106602 75.5z",fill:"#738DA5","fill-rule":"evenodd"}})])]):[e._t("suffix"),e.suffixIcon?r("i",{staticClass:"el-input__icon",class:e.suffixIcon}):e._e()]],2),e.validateState?r("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",e.validateIcon]}):e._e()]):e._e(),e.$slots.append?r("div",{staticClass:"el-input-group__append"},[e._t("append")],2):e._e()]:r("textarea",e._b({directives:[{name:"model",rawName:"v-model",value:e.internalValue,expression:"internalValue"}],ref:"textarea",staticClass:"c-textarea el-input__inner",style:e.textareaStyle,attrs:{tabindex:e.tabindex,disabled:e.inputDisabled,"min-rows":"1"},domProps:{value:e.internalValue},on:{focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange,input:function(n){n.target.composing||(e.internalValue=n.target.value)}}},"textarea",e.$attrs,!1))],2)},bat=[],wat=$e(yat,_at,bat,!1,null,null,null,null);const GG=wat.exports,nmt="",amt="",xat={components:{BaseInput:GG},props:{value:{type:[Number,String,Date],default:null},format:{type:String,default:"P"},options:{type:Object,default(){return{}}},placeholder:{type:String,default:""},classList:{type:String,default:""},disabled:{type:Boolean,default:!1},customEl:{type:Boolean,default:!1},direction:{type:String,validator:t=>["start","end"].includes(t),default:null},range:{type:Boolean,default:!1},coRangePicker:{type:Object,default:null},clear:{type:Boolean,default:!1}},data(){return{visible:!1,defaultOptions:{firstDay:1,format:"P",showWeekNumber:!0,minDate:new Date}}},computed:{mergedOptions(){const t=this.$t("_common:pikaday");return Object.assign({i18n:t},this.defaultOptions,this.options)},internalValue(){return this.value?this.$formatDate(this.value,this.calcFormat):null},calcFormat(){return this.format||"P"}},watch:{options:{deep:!0,handler(){this.destroy(),this.create()}},clear(t){t&&this.resetRange()}},mounted(){this.create(),window.addEventListener("resize",this.rePosition)},beforeDestroy(){this.destroy(),window.removeEventListener("resize",this.rePosition)},methods:{create(){const t=this.customEl?this.$refs.input:this.$refs.input.$el;this.mergedOptions.field=t,this.bindListener("onSelect",()=>this.onSelect()),this.bindListener("onOpen",()=>this.onOpen()),this.bindListener("onClose",()=>this.onClose()),this.pikaday=new mat(this.mergedOptions);const e=this.value;!this.value&&this.autoDefault&&this.change(e),this.pikaday.setDate(e),this.range&&this.pikaday.setMinDate(null),this.mergedOptions.bound===!1?this.hide():this.visible?this.show():this.hide()},destroy(){!this.pikaday||this.pikaday.destroy()},change(t){if(t){let e=new Date(t);this.direction==="start"&&(e=D5(e)),this.direction==="end"&&(e=Kc(e)),e=e.toISOString(),this.$emit("input",e)}},onSelect(){const t=this.pikaday.getDate();this.change(t),this.range&&this.direction==="start"&&this.coRangePicker&&(this.pikaday.setStartRange(t),this.coRangePicker.setStartRange(t),this.coRangePicker.setMinDate(t)),this.range&&this.direction==="end"&&this.coRangePicker&&(this.pikaday.setEndRange(t),this.coRangePicker.setEndRange(t),this.coRangePicker.setMaxDate(t))},onOpen(){this.visible=!0,this.overflowCheck()},onClose(){rl(new Date(this.value))||(this.pikaday.setDate(null,!0),this.change(null)),this.visible=!1},show(){this.pikaday.show(),this.$emit("focus")},hide(){this.pikaday.hide(),this.$emit("blur")},bindListener(t,e){if(this.mergedOptions[t]){const r=this.mergedOptions[t];this.mergedOptions[t]=(...n)=>{r(n),e.apply(this)}}else this.mergedOptions[t]=e},overflowCheck(){!this.pikaday||parseInt(this.pikaday.el.style.left,10)<5&&(this.pikaday.el.style.left="5px")},rePosition(){!this.pikaday||(this.pikaday.adjustPosition(),this.overflowCheck())},resetRange(){this.pikaday.setDate(null,!0),this.pikaday.setStartRange(null),this.pikaday.setEndRange(null),this.direction==="start"&&this.pikaday.setMaxDate(null),this.direction==="end"&&this.pikaday.setMinDate(null)}}};var kat=function(){var e=this,r=e._self._c;return e.customEl?r("div",{ref:"input",class:[e.classList,{active:e.visible}],attrs:{readonly:"readonly",tabindex:"0"},on:{focus:e.show,input:e.onSelect,blur:e.hide}},[e._t("default")],2):r("div",[r("BaseInput",{ref:"input",staticClass:"base-date-picker",class:[e.classList,{active:e.visible}],attrs:{value:e.internalValue,placeholder:e.placeholder||e.$t("select",{thing:e.$t("date")}),disabled:e.disabled,readonly:"readonly"},on:{focus:e.show,blur:e.hide,input:e.onSelect}},[e.$slots.prefix?e._t("prefix",null,{slot:"prefix"}):e._e(),e.$slots.suffix?e._t("suffix",null,{slot:"suffix"}):e._e()],2)],1)},Pat=[],Tat=$e(xat,kat,Pat,!1,null,null,null,null);const KG=Tat.exports,imt="",Mat={name:"ErrorCallout",props:{message:{type:String,required:!0},size:{type:String,default:"normal"}}};var Sat=function(e,r){return e("div",{staticClass:"c-flex-row c-align-center font-inter",class:[r.data.staticClass],staticStyle:{"margin-top":"1rem"},style:[r.data.staticStyle]},[e("div",{staticClass:"error-wrapper has-text-danger",class:[`is-${r.props.size}`],staticStyle:{margin:"1rem 0"}},[e("BaseIcon",{staticStyle:{"margin-right":"0.5em",flex:"0 0 18px"},attrs:{type:"alert",size:"18"}}),e("div",[r._v(" "+r._s(r.props.message)+" ")])],1)])},Oat=[],Eat=$e(Mat,Sat,Oat,!0,null,"8d1ee7d0",null,null);const Dat=Eat.exports,omt="",Cat={name:"DocumentSendReminderItem",props:{label:{type:String,required:!0},value:{type:[Number,String],default:0},done:{type:Boolean,default:!1}}};var $at=function(){var e=this,r=e._self._c;return r("div",{staticClass:"reminder-row flex items-center bg-gray-100"},[r("div",{staticClass:"text-gray-500 flex-auto mr-6 select-none"},[e._v(" "+e._s(e.label)+" ")]),r("div",{staticClass:"number-wrapper"},[e.done?r("span",{staticClass:"has-text-success"},[r("BaseIcon",{attrs:{type:"check",size:"18"}}),e._v(" "+e._s(e.$t("sent"))+" ")],1):[r("CButton",{staticClass:"bg-white",staticStyle:{width:"24px",height:"24px"},attrs:{icon:"minus",size:"small",circle:""},on:{click:function(n){e.$emit("input",Math.max(e.value-1,0))}}}),r("div",{staticClass:"py-4 text-gray-800 font-medium text-center min-w-[8ch] text-sm"},[e.value?[e._v(" "+e._s(e.$tc("day",{count:Number(e.value)}))+" ")]:r("span",{staticClass:"has-text-grey",staticStyle:{"font-size":"calc(1em - 2px)"}},[e._v(" "+e._s(e.$t("disabled").capitalize())+" ")])],2),r("CButton",{staticClass:"bg-white",staticStyle:{width:"24px",height:"24px"},attrs:{icon:"plus",size:"small",circle:""},on:{click:function(n){return e.$emit("input",e.value+1)}}})]],2)])},Aat=[],Rat=$e(Cat,$at,Aat,!1,null,"427c6846",null,null);const Iat=Rat.exports,smt="",Nat={i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.send.reminders"},name:"DocumentSendReminders",components:{DocumentSendReminderItem:Iat},mixins:[dc()],props:{setFormValue:{type:Function,required:!0},removeFormValue:{type:Function,required:!0}},computed:{reminders(){const t={first:null,notViewed:null,notAnswered:null,expires:null};return this._document.reminders.forEach((e,r)=>{e.type==="first"?t.first={...e,index:r}:e.type==="viewed"?t.notViewed={...e,index:r}:e.type==="expires"?t.expires={...e,index:r}:t.notAnswered={...e,index:r}}),t}},methods:{getDefaultReminders(){if(!this._document.template)return[];const t=this._document.template.getDefaultData({path:"properties.data.properties.reminders"});return t&&Array.isArray(t)?t:[]},setReminder(t,e){let r="sendDays";if(typeof e=="string"&&(r="sendAt"),!e){this.removeFormValue(`data.reminders[${t.index}]`);return}if(typeof t=="string"){let n=this.getDefaultReminders().find(a=>a.type===t);if(n||(n=rd.default.find(a=>a.type===t)),!n)throw new Error("Could not find default reminder");n[r]=e,this.setFormValue({key:"data.reminders",value:n});return}this.setFormValue({key:`data.reminders[${t.index}].${r}`,value:e})}}};var Lat=function(){var e=this,r=e._self._c;return r("div",{staticClass:"font-inter",staticStyle:{"background-color":"white","border-radius":"0.5rem",padding:"2rem","font-size":"16px"}},[r("div",{staticStyle:{"font-size":"1.25em","font-weight":"700","margin-bottom":"0.25em","text-align":"center"}},[e._v(" "+e._s(e.$t("_common:reminder_plural").capitalize())+" ")]),r("div",{staticClass:"text-center has-text-grey-dark",staticStyle:{"max-width":"20rem",margin:"0 auto 2rem auto"}},[e._v(" "+e._s(e.$t("description"))+" ")]),e._l([{type:"notViewed",fallbackKey:"viewed"},{type:"notAnswered",fallbackKey:"reminder"},{type:"expires",fallbackKey:"expires"}],function(n,a){return r("DocumentSendReminderItem",{key:a,attrs:{label:e.$t(n.type),value:e.reminders[n.type]?e.reminders[n.type].sendDays:0,done:e.reminders[n.type]&&e.reminders[n.type].status==="successful"},on:{input:function(o){return e.setReminder(e.reminders[n.type]||n.fallbackKey,o)}}})}),r("div",{staticClass:"c-flex-row c-align-middle c-align-center",staticStyle:{"margin-top":"2.5rem"}},[r("CButton",{attrs:{type:"secondary",expanded:""},on:{click:function(n){return e.$emit("close")}}},[e._v(" "+e._s(e.$t("_common:save"))+" ")])],1)],2)},Wat=[],Fat=$e(Nat,Lat,Wat,!1,null,"ee5e99c4",null,null);const jat=Fat.exports,umt="";function XG(t,e){const r=new Date(t.getTime());return r.setDate(t.getDate()+(7+e-t.getDay()-1)%7+1),r.setHours(8,0,0,0),r}function JG(t){const e=new Date(t.getTime());return e.setDate(e.getDate()+1),e.setHours(10,0,0,0),e}let QG=JG(new Date),ZG=XG(new Date,1);const Vat={i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.send.later"},name:"DocumentSendLater",components:{BaseInput:GG,BaseDatePicker:KG},props:{_document:{type:Object,default:()=>({})},setFormValue:{type:Function,required:!0},removeFormValue:{type:Function,required:!0}},data(){return{sendAt:E5(new Date,5),showCustom:!1,backupSentFlag:!1}},validations:{sendAt:{minValue:t=>t>E5(new Date,2).toISOString()}},computed:{...e6("forms",{formData:t=>t.document2.data}),...Gd({deliveryTypes:"forms/deliveryTypes",isPostingDocument:"documents2/isPosting",isPostingProject:"projects/isPosting",feature:"application/feature"}),tomorrowMorning(){return QG.toISOString()},mondayMorning(){return ZG.toISOString()},reminderDeliveryTypes(){const t=["email"];return this.feature("sms")&&t.push("sms"),this.deliveryTypes?[...this.deliveryTypes.sms&&this.feature("sms")?["sms"]:[],...this.deliveryTypes.email?["email"]:[]]:t}},created(){QG=JG(new Date),ZG=XG(new Date,1)},methods:{...Ky({saveDocument:Oe.SAVE_DYNDOC_FORM}),setTime(t){const e=t.split(":"),r=new Date(this.sendAt).setHours(e[0],e[1]);r&&(this.sendAt=new Date(r).toISOString())},setDate(t){const e=new Date(this.sendAt),r=new Date(t).setHours(e.getHours(),e.getMinutes());this.sendAt=new Date(r).toISOString()},async onSendAt(t){try{if(this.$v.$invalid||this.isPostingDocument||this.isPostingProject||this.backupSentFlag)return;this.backupSentFlag=!0;const e={type:"first",status:"new",sendDays:0,sendAt:t,deliveryTypes:this.reminderDeliveryTypes,tries:0},r=this.formData.reminders.findIndex(a=>a.type==="first"),n=r>=0?`data.reminders[${r}]`:"data.reminders";this.setFormValue({key:n,value:e}),await this.saveDocument({doSend:!0}),this.backupSentFlag=!1}catch(e){this.$error(e)}finally{this.backupSentFlag=!1}}}};var zat=function(){var e=this,r=e._self._c;return r("div",{staticClass:"bg-white rounded-xl overflow-hidden font-inter"},[r("div",{staticClass:"px-6 pt-8 pb-3"},[r("div",{staticClass:"text-md font-semibold text-center"},[e._v(" "+e._s(e.$t("title"))+" ")]),r("div",{staticClass:"pt-8"},e._l([[e.tomorrowMorning,"tomorrowMorning"],[e.mondayMorning,"mondayMorning"]],function(n,a){return r("div",{key:a,staticClass:"bg-gray-50 border border-gray-200 p-4 rounded-md mb-4 cursor-pointer flex items-center justify-between text-sm hover:bg-gray-100 hover:border-gray-300 active:bg-gray-200 active:border-gray-400 select-none",on:{click:()=>e.onSendAt(n[0])}},[r("div",{staticClass:"font-medium"},[e._v(e._s(e.$t(n[1])))]),r("div",{staticClass:"text-gray-500"},[e._v(" "+e._s(e.$formatDate(n[0],"p, d MMM"))+" ")])])}),0)]),r("div",{staticClass:"px-8 py-6 bg-gray-100 border-t border-gray-200",class:e.showCustom?"":"cursor-pointer hover:bg-gray-200",on:{click:function(n){e.showCustom=!0}}},[r("div",{staticClass:"flex items-center text-sm"},[r("BaseIcon",{staticClass:"text-primary-500 mr-2",attrs:{type:"calendar",size:"18"}}),r("div",{staticClass:"font-medium",domProps:{textContent:e._s(e.$t("custom.title"))}})],1),r("Animation",[r("div",{directives:[{name:"show",rawName:"v-show",value:e.showCustom,expression:"showCustom"}],staticClass:"mt-4"},[r("div",{staticClass:"grid grid-cols-2 gap-4"},[r("BaseDatePicker",{attrs:{value:e.sendAt},on:{input:e.setDate}}),r("BaseInput",{attrs:{value:e.$formatDate(e.sendAt,"HH:mm"),clearable:!1,type:"time"},on:{input:e.setTime}})],1),e.$v.$invalid?r("div",{staticClass:"error-wrapper"},[r("BaseIcon",{staticClass:"mr-2 text-primary-500",attrs:{type:"calendar"}}),e._v(" "+e._s(e.$t("custom.invalid"))+" ")],1):e._e(),r("CButton",{staticStyle:{"margin-top":"1.5rem"},attrs:{loading:e.isPostingDocument||e.isPostingProject,type:"secondary",rounder:"",wide:""},on:{click:function(n){return e.onSendAt(e.sendAt)}}},[e._v(" "+e._s(e.$t("_common:send"))+" "+e._s(e.$formatDate(e.sendAt,"d MMM - p"))+" ")])],1)])],1)])},Uat=[],Hat=$e(Vat,zat,Uat,!1,null,"25247814",null,null);const qat=Hat.exports;var Bat=on,Yat=function(){return Bat.Date.now()},Gat=Yat,Kat=/\s/;function Xat(t){for(var e=t.length;e--&&Kat.test(t.charAt(e)););return e}var Jat=Xat,Qat=Jat,Zat=/^\s+/;function eit(t){return t&&t.slice(0,Qat(t)+1).replace(Zat,"")}var tit=eit,rit=tit,eK=ua,nit=tm,tK=0/0,ait=/^[-+]0x[0-9a-f]+$/i,iit=/^0b[01]+$/i,oit=/^0o[0-7]+$/i,sit=parseInt;function uit(t){if(typeof t=="number")return t;if(nit(t))return tK;if(eK(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=eK(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=rit(t);var r=iit.test(t);return r||oit.test(t)?sit(t.slice(2),r?2:8):ait.test(t)?tK:+t}var lit=uit,dit=ua,hL=Gat,rK=lit,cit="Expected a function",fit=Math.max,mit=Math.min;function pit(t,e,r){var n,a,o,i,s,u,l=0,d=!1,f=!1,m=!0;if(typeof t!="function")throw new TypeError(cit);e=rK(e)||0,dit(r)&&(d=!!r.leading,f="maxWait"in r,o=f?fit(rK(r.maxWait)||0,e):o,m="trailing"in r?!!r.trailing:m);function c(M){var C=n,F=a;return n=a=void 0,l=M,i=t.apply(F,C),i}function p(M){return l=M,s=setTimeout(g,e),d?c(M):i}function h(M){var C=M-u,F=M-l,T=e-C;return f?mit(T,o-F):T}function v(M){var C=M-u,F=M-l;return u===void 0||C>=e||C<0||f&&F>=o}function g(){var M=hL();if(v(M))return _(M);s=setTimeout(g,h(M))}function _(M){return s=void 0,m&&n?c(M):(n=a=void 0,i)}function y(){s!==void 0&&clearTimeout(s),l=0,n=u=a=s=void 0}function b(){return s===void 0?i:_(hL())}function k(){var M=hL(),C=v(M);if(n=arguments,a=this,u=M,C){if(s===void 0)return p(u);if(f)return clearTimeout(s),s=setTimeout(g,e),c(u)}return s===void 0&&(s=setTimeout(g,e)),i}return k.cancel=y,k.flush=b,k}var hit=pit;const vit={name:"SearchApi",props:{customSearch:{type:Object,default:()=>({})}},data(){return{defaultSearch:{project:!0,user:!0,endCustomer:!1,article:!1,extensionArticle:!1,invoice:!1,document:!1},hasLoadedUsers:!1,isLoading:!1,emptyQuery:null,hasSearchedAll:!1}},computed:{...Gd({allUsers:"companyUsers/all",allAuthenticatedCRMs:"settings/allAuthenticatedCRMs",can:"application/can"}),typesToFetch(){return Object.keys(this.customSearch).length?Object.keys(this.customSearch).filter(t=>this.customSearch[t]):Object.keys(this.defaultSearch).filter(t=>this.defaultSearch[t])}},methods:{...Ky({loadUsers:Oe.LOAD_COMPANY_USERS}),canFetchType(t){return t==="invoice"?this.can("invoices","read"):t==="endCustomer"?this.can("endCustomers","read"):t==="user"?this.can("users","modify"):!0},async fetch({query:t,start:e=null,end:r=null}){const n=this.typesToFetch.reduce((i,s)=>({...i,[s]:[]}),{}),a=t.toLowerCase();if(this.emptyQuery&&a&&a.startsWith(this.emptyQuery)||(this.emptyQuery=null,this.hasSearchedAll=!0,!a))return n;try{const i=[],s=Object.keys(this.defaultSearch);(this.typesToFetch||[]).forEach(u=>{!s.includes(u)||i.push((async()=>{let l=[];u==="document"?l=await this.fetchDocuments(a,e,r):u==="user"?l=await this.fetchUsers(a,e,r):u==="extensionArticle"?l=await this.fetchExtensionArticles(a,e,r):l=await this.fetchType(u,a,e,r),n[u]=l})())}),await Promise.all(i)}catch(i){throw i}finally{this.isLoading=!1}return Object.keys(n).every(i=>n[i].length===0)&&this.hasSearchedAll&&(this.emptyQuery=a),n},async fetchType(t,e,r,n){if(!this.canFetchType(t))return[];const{data:a}=await mt("search",{type:t,query:e,...r!==null&&n!==null&&{start:r,end:n}});return a},async fetchUsers(t,e,r){if(!this.canFetchType("user"))return[];this.hasLoadedUsers||(await this.loadUsers(),this.hasLoadedUsers=!0);const a=Object.values(this.allUsers).filter(o=>!!(o.fullName&&o.fullName.toLowerCase().includes(t)||o.email&&o.email.toLowerCase().includes(t)));return e!==null&&r!==null?a.slice(e,r):a},async fetchDocuments(t,e,r){const n=t.replace(/[-[\]{}()*+?.,\\/^$|#]/g,"\\$&"),a={$or:[{"data.name":{$regex:n,$options:"i"}},{"docNumber.value":{$regex:n,$options:"i"}},{clients:{$elemMatch:{$or:["name","email","socialNo","orgNo"].map(s=>({[s]:{$regex:n,$options:"i"}}))}}}]},{data:o}=await lt("/document",{params:{lean:!0,filter:encodeURIComponent(JSON.stringify(a)),fields:"clients,data.name,projectId,docNumber,createdAt",...e!==null&&r!==null&&{skip:e,limit:r-e}}}),{items:i=[]}=o||{};return i},async fetchExtensionArticles(t,e,r){const n=[];return await Promise.all(this.allAuthenticatedCRMs.map(async a=>{try{if(a==="pipedrive"&&t.length<2){this.hasSearchedAll=!1;return}const{data:o}=await t1.search(a,{query:t,type:"article"});o&&Array.isArray(o)&&n.push(...o)}catch{}})),n},triggerSearch:hit(async function({q:e,cb:r,start:n,end:a}){this.isLoading=!0;const o=await this.fetch({query:e,start:n,end:a});return this.isLoading=!1,r(o)},500)},render(){return this.$scopedSlots.default({fetch:({q:t,cb:e,start:r=null,end:n=null})=>(this.isLoading=!0,this.triggerSearch({q:t,cb:e,start:r,end:n})),isLoading:this.isLoading})}};var git=$e(vit,null,null,!1,null,null,null,null);const yit=git.exports,cmt="",_it={i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.clients"},name:"ClientAutocomplete",components:{SearchApi:yit},props:{searchEnabled:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!1},showEmpty:{type:Boolean,default:!1},filled:{type:Boolean,default:!1}},data(){return{convertToNewClient:vx,results:[],searchQuery:""}},methods:{search(t,e){this.$emit("input",e),this.searchEnabled&&(this.searchQuery=e,t({q:e,cb:({endCustomer:r})=>{this.results=r}}))}}};var bit=function(){var e=this,r=e._self._c;return r("SearchApi",{attrs:{"custom-search":{endCustomer:!0}},scopedSlots:e._u([{key:"default",fn:function({fetch:n,isLoading:a}){return[r("CAutocomplete",e._b({attrs:{data:e.results,loading:e.showLoading&&a,filled:e.filled,expanded:"","keep-first":""},on:{typing:function(o){return e.search(n,o)},select:function(o){e.$emit("setClient",e.convertToNewClient(o))}},scopedSlots:e._u([{key:"default",fn:function({option:o}){return r("div",{staticStyle:{"line-height":"1.5"}},[r("div",{staticStyle:{"font-weight":"500"}},[e._v(e._s(o.name||o.email))]),r("div",{staticClass:"has-text-grey-dark",staticStyle:{"font-size":"14px"}},[e._v(" "+e._s(o.reference?`${o.reference} \xB7 `:"")+" "+e._s(o.workStreet||o.street||"\xA0")+" ")])])}}],null,!0)},"CAutocomplete",{placeholder:e.$t("search.placeholder"),...e.$attrs,...e.$props},!1),[e.searchEnabled&&e.showEmpty?[r("div",{attrs:{slot:"footer"},slot:"footer"},[e.searchQuery&&!e.results.length?r("CButton",{staticStyle:{"font-weight":"600"},attrs:{type:"secondary",pattern:"tertiary",size:"small"},on:{click:function(o){return e.$emit("add")}}},[e._v(" "+e._s(e.$t("_common:add"))+" ")]):e._e()],1),r("template",{slot:"empty"},[e._v(" "+e._s(e.$t("search.empty"))+" "+e._s(e.searchQuery)+" ")])]:e._e()],2)]}}])})},wit=[],xit=$e(_it,bit,wit,!1,null,"5d023500",null,null);const nK=xit.exports,kit={i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.clients"},name:"AddClientCallout",components:{ClientAutocomplete:nK},mixins:[dc([])],props:{compact:{type:Boolean,default:!1}}};var Pit=function(){var e=this,r=e._self._c;return r("CCallout",{style:e.compact&&{backgroundColor:"white",boxShadow:"rgba(0, 0, 0, 0.21) 0px 3px 8px"},attrs:{title:e.compact?"":e.$t("title"),padding:e.compact?"10px":""}},[e.compact?e._e():r("div",{staticClass:"text-gray-700",staticStyle:{"padding-bottom":"1.5rem"}},[e._v(" "+e._s(e.$t("subTitle"))+" ")]),r("CField",{attrs:{grouped:"","group-multiline":""}},[r("div",{staticClass:"control"},[r("CButton",{staticClass:"is-left",attrs:{type:"secondary","icon-left":"plus"},on:{click:function(n){return e.$emit("add")}}},[e._v(" "+e._s(e.viewSettings.isPublicForm?e.$t("_common:add",{thing:e.$t("_common:recipient")}):e.$t("add.new"))+" ")])],1),e.viewSettings.isPublicForm?e._e():[e.compact?r("div",{staticClass:"control flex items-center text-gray-500",staticStyle:{width:"initial","font-size":"13px"}},[e._v(" "+e._s(e.$t("_common:or"))+" ")]):e._e(),r("ClientAutocomplete",e._g({staticStyle:{flex:"1 1 0"},attrs:{"show-loading":!0,"show-empty":!0,filled:e.compact,icon:"search","clear-on-select":""}},e.$listeners))]],2)],1)},Tit=[],Mit=$e(kit,Pit,Tit,!1,null,null,null,null);const Sit=Mit.exports;var aK={exports:{}};/*! VelocityJS.org (1.5.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */(function(t){/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */(function(e){if(e.jQuery)return;var r=function(d,f){return new r.fn.init(d,f)};r.isWindow=function(d){return d&&d===d.window},r.type=function(d){return d?typeof d=="object"||typeof d=="function"?o[s.call(d)]||"object":typeof d:d+""},r.isArray=Array.isArray||function(d){return r.type(d)==="array"};function n(d){var f=d.length,m=r.type(d);return m==="function"||r.isWindow(d)?!1:d.nodeType===1&&f?!0:m==="array"||f===0||typeof f=="number"&&f>0&&f-1 in d}r.isPlainObject=function(d){var f;if(!d||r.type(d)!=="object"||d.nodeType||r.isWindow(d))return!1;try{if(d.constructor&&!i.call(d,"constructor")&&!i.call(d.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}for(f in d);return f===void 0||i.call(d,f)},r.each=function(d,f,m){var c,p=0,h=d.length,v=n(d);if(m){if(v)for(;p<h&&(c=f.apply(d[p],m),c!==!1);p++);else for(p in d)if(!!d.hasOwnProperty(p)&&(c=f.apply(d[p],m),c===!1))break}else if(v)for(;p<h&&(c=f.call(d[p],p,d[p]),c!==!1);p++);else for(p in d)if(!!d.hasOwnProperty(p)&&(c=f.call(d[p],p,d[p]),c===!1))break;return d},r.data=function(d,f,m){if(m===void 0){var c=d[r.expando],p=c&&a[c];if(f===void 0)return p;if(p&&f in p)return p[f]}else if(f!==void 0){var h=d[r.expando]||(d[r.expando]=++r.uuid);return a[h]=a[h]||{},a[h][f]=m,m}},r.removeData=function(d,f){var m=d[r.expando],c=m&&a[m];c&&(f?r.each(f,function(p,h){delete c[h]}):delete a[m])},r.extend=function(){var d,f,m,c,p,h,v=arguments[0]||{},g=1,_=arguments.length,y=!1;for(typeof v=="boolean"&&(y=v,v=arguments[g]||{},g++),typeof v!="object"&&r.type(v)!=="function"&&(v={}),g===_&&(v=this,g--);g<_;g++)if(p=arguments[g])for(c in p)!p.hasOwnProperty(c)||(d=v[c],m=p[c],v!==m&&(y&&m&&(r.isPlainObject(m)||(f=r.isArray(m)))?(f?(f=!1,h=d&&r.isArray(d)?d:[]):h=d&&r.isPlainObject(d)?d:{},v[c]=r.extend(y,h,m)):m!==void 0&&(v[c]=m)));return v},r.queue=function(d,f,m){function c(h,v){var g=v||[];return h&&(n(Object(h))?function(_,y){for(var b=+y.length,k=0,M=_.length;k<b;)_[M++]=y[k++];if(b!==b)for(;y[k]!==void 0;)_[M++]=y[k++];return _.length=M,_}(g,typeof h=="string"?[h]:h):[].push.call(g,h)),g}if(!!d){f=(f||"fx")+"queue";var p=r.data(d,f);return m?(!p||r.isArray(m)?p=r.data(d,f,c(m)):p.push(m),p):p||[]}},r.dequeue=function(d,f){r.each(d.nodeType?[d]:d,function(m,c){f=f||"fx";var p=r.queue(c,f),h=p.shift();h==="inprogress"&&(h=p.shift()),h&&(f==="fx"&&p.unshift("inprogress"),h.call(c,function(){r.dequeue(c,f)}))})},r.fn=r.prototype={init:function(d){if(d.nodeType)return this[0]=d,this;throw new Error("Not a DOM node.")},offset:function(){var d=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:d.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:d.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function d(h){for(var v=h.offsetParent;v&&v.nodeName.toLowerCase()!=="html"&&v.style&&v.style.position.toLowerCase()==="static";)v=v.offsetParent;return v||document}var f=this[0],m=d(f),c=this.offset(),p=/^(?:body|html)$/i.test(m.nodeName)?{top:0,left:0}:r(m).offset();return c.top-=parseFloat(f.style.marginTop)||0,c.left-=parseFloat(f.style.marginLeft)||0,m.style&&(p.top+=parseFloat(m.style.borderTopWidth)||0,p.left+=parseFloat(m.style.borderLeftWidth)||0),{top:c.top-p.top,left:c.left-p.left}}};var a={};r.expando="velocity"+new Date().getTime(),r.uuid=0;for(var o={},i=o.hasOwnProperty,s=o.toString,u="Boolean Number String Function Array Date RegExp Object Error".split(" "),l=0;l<u.length;l++)o["[object "+u[l]+"]"]=u[l].toLowerCase();r.fn.init.prototype=r.fn,e.Velocity={Utilities:r}})(window),function(e){t.exports=e()}(function(){return function(e,r,n,a){var o=function(){if(n.documentMode)return n.documentMode;for(var x=7;x>4;x--){var S=n.createElement("div");if(S.innerHTML="<!--[if IE "+x+"]><span></span><![endif]-->",S.getElementsByTagName("span").length)return S=null,x}return a}(),i=function(){var x=0;return r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||function(S){var O=new Date().getTime(),P;return P=Math.max(0,16-(O-x)),x=O+P,setTimeout(function(){S(O+P)},P)}}(),s=function(){var x=r.performance||{};if(typeof x.now!="function"){var S=x.timing&&x.timing.navigationStart?x.timing.navigationStart:new Date().getTime();x.now=function(){return new Date().getTime()-S}}return x}();function u(x){for(var S=-1,O=x?x.length:0,P=[];++S<O;){var w=x[S];w&&P.push(w)}return P}var l=function(){var x=Array.prototype.slice;try{return x.call(n.documentElement),x}catch{return function(O,P){var w=this.length;if(typeof O!="number"&&(O=0),typeof P!="number"&&(P=w),this.slice)return x.call(this,O,P);var D,R=[],j=O>=0?O:Math.max(0,w+O),H=P<0?w+P:Math.min(P,w),q=H-j;if(q>0)if(R=new Array(q),this.charAt)for(D=0;D<q;D++)R[D]=this.charAt(j+D);else for(D=0;D<q;D++)R[D]=this[j+D];return R}}}(),d=function(){return Array.prototype.includes?function(x,S){return x.includes(S)}:Array.prototype.indexOf?function(x,S){return x.indexOf(S)>=0}:function(x,S){for(var O=0;O<x.length;O++)if(x[O]===S)return!0;return!1}};function f(x){return m.isWrapped(x)?x=l.call(x):m.isNode(x)&&(x=[x]),x}var m={isNumber:function(x){return typeof x=="number"},isString:function(x){return typeof x=="string"},isArray:Array.isArray||function(x){return Object.prototype.toString.call(x)==="[object Array]"},isFunction:function(x){return Object.prototype.toString.call(x)==="[object Function]"},isNode:function(x){return x&&x.nodeType},isWrapped:function(x){return x&&x!==r&&m.isNumber(x.length)&&!m.isString(x)&&!m.isFunction(x)&&!m.isNode(x)&&(x.length===0||m.isNode(x[0]))},isSVG:function(x){return r.SVGElement&&x instanceof r.SVGElement},isEmptyObject:function(x){for(var S in x)if(x.hasOwnProperty(S))return!1;return!0}},c,p=!1;if(e.fn&&e.fn.jquery?(c=e,p=!0):c=r.Velocity.Utilities,o<=8&&!p)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(o<=7){jQuery.fn.velocity=jQuery.fn.animate;return}var h=400,v="swing",g={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(r.navigator.userAgent),isAndroid:/Android/i.test(r.navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(r.navigator.userAgent),isChrome:r.chrome,isFirefox:/Firefox/i.test(r.navigator.userAgent),prefixElement:n.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[],delayedElements:{count:0}},CSS:{},Utilities:c,Redirects:{},Easings:{},Promise:r.Promise,defaults:{queue:"",duration:h,easing:v,begin:a,complete:a,progress:a,display:a,visibility:a,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0,promiseRejectEmpty:!0},init:function(x){c.data(x,"velocity",{isSVG:m.isSVG(x),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:5,patch:2},debug:!1,timestamp:!0,pauseAll:function(x){var S=new Date().getTime();c.each(g.State.calls,function(O,P){if(P){if(x!==a&&(P[2].queue!==x||P[2].queue===!1))return!0;P[5]={resume:!1}}}),c.each(g.State.delayedElements,function(O,P){!P||y(P,S)})},resumeAll:function(x){new Date().getTime(),c.each(g.State.calls,function(S,O){if(O){if(x!==a&&(O[2].queue!==x||O[2].queue===!1))return!0;O[5]&&(O[5].resume=!0)}}),c.each(g.State.delayedElements,function(S,O){!O||b(O)})}};r.pageYOffset!==a?(g.State.scrollAnchor=r,g.State.scrollPropertyLeft="pageXOffset",g.State.scrollPropertyTop="pageYOffset"):(g.State.scrollAnchor=n.documentElement||n.body.parentNode||n.body,g.State.scrollPropertyLeft="scrollLeft",g.State.scrollPropertyTop="scrollTop");function _(x){var S=c.data(x,"velocity");return S===null?a:S}function y(x,S){var O=_(x);O&&O.delayTimer&&!O.delayPaused&&(O.delayRemaining=O.delay-S+O.delayBegin,O.delayPaused=!0,clearTimeout(O.delayTimer.setTimeout))}function b(x,S){var O=_(x);O&&O.delayTimer&&O.delayPaused&&(O.delayPaused=!1,O.delayTimer.setTimeout=setTimeout(O.delayTimer.next,O.delayRemaining))}function k(x){return function(S){return Math.round(S*x)*(1/x)}}function M(x,S,O,P){var w=4,D=.001,R=1e-7,j=10,H=11,q=1/(H-1),Y="Float32Array"in r;if(arguments.length!==4)return!1;for(var G=0;G<4;++G)if(typeof arguments[G]!="number"||isNaN(arguments[G])||!isFinite(arguments[G]))return!1;x=Math.min(x,1),O=Math.min(O,1),x=Math.max(x,0),O=Math.max(O,0);var X=Y?new Float32Array(H):new Array(H);function ne(ee,A){return 1-3*A+3*ee}function me(ee,A){return 3*A-6*ee}function fe(ee){return 3*ee}function we(ee,A,I){return((ne(A,I)*ee+me(A,I))*ee+fe(A))*ee}function je(ee,A,I){return 3*ne(A,I)*ee*ee+2*me(A,I)*ee+fe(A)}function Le(ee,A){for(var I=0;I<w;++I){var B=je(A,x,O);if(B===0)return A;var K=we(A,x,O)-ee;A-=K/B}return A}function Ve(){for(var ee=0;ee<H;++ee)X[ee]=we(ee*q,x,O)}function ye(ee,A,I){var B,K,Z=0;do K=A+(I-A)/2,B=we(K,x,O)-ee,B>0?I=K:A=K;while(Math.abs(B)>R&&++Z<j);return K}function Ae(ee){for(var A=0,I=1,B=H-1;I!==B&&X[I]<=ee;++I)A+=q;--I;var K=(ee-X[I])/(X[I+1]-X[I]),Z=A+K*q,pe=je(Z,x,O);return pe>=D?Le(ee,Z):pe===0?Z:ye(ee,A,A+q)}var ze=!1;function Pt(){ze=!0,(x!==S||O!==P)&&Ve()}var Ot=function(ee){return ze||Pt(),x===S&&O===P?ee:ee===0?0:ee===1?1:we(Ae(ee),S,P)};Ot.getControlPoints=function(){return[{x,y:S},{x:O,y:P}]};var et="generateBezier("+[x,S,O,P]+")";return Ot.toString=function(){return et},Ot}var C=function(){function x(P){return-P.tension*P.x-P.friction*P.v}function S(P,w,D){var R={x:P.x+D.dx*w,v:P.v+D.dv*w,tension:P.tension,friction:P.friction};return{dx:R.v,dv:x(R)}}function O(P,w){var D={dx:P.v,dv:x(P)},R=S(P,w*.5,D),j=S(P,w*.5,R),H=S(P,w,j),q=1/6*(D.dx+2*(R.dx+j.dx)+H.dx),Y=1/6*(D.dv+2*(R.dv+j.dv)+H.dv);return P.x=P.x+q*w,P.v=P.v+Y*w,P}return function P(w,D,R){var j={x:-1,v:0,tension:null,friction:null},H=[0],q=0,Y=1/1e4,G=16/1e3,X,ne,me;for(w=parseFloat(w)||500,D=parseFloat(D)||20,R=R||null,j.tension=w,j.friction=D,X=R!==null,X?(q=P(w,D),ne=q/R*G):ne=G;me=O(me||j,ne),H.push(1+me.x),q+=16,Math.abs(me.x)>Y&&Math.abs(me.v)>Y;);return X?function(fe){return H[fe*(H.length-1)|0]}:q}}();g.Easings={linear:function(x){return x},swing:function(x){return .5-Math.cos(x*Math.PI)/2},spring:function(x){return 1-Math.cos(x*4.5*Math.PI)*Math.exp(-x*6)}},c.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(x,S){g.Easings[S[0]]=M.apply(null,S[1])});function F(x,S){var O=x;return m.isString(x)?g.Easings[x]||(O=!1):m.isArray(x)&&x.length===1?O=k.apply(null,x):m.isArray(x)&&x.length===2?O=C.apply(null,x.concat([S])):m.isArray(x)&&x.length===4?O=M.apply(null,x):O=!1,O===!1&&(g.Easings[g.defaults.easing]?O=g.defaults.easing:O=v),O}var T=g.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/ig},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"],units:["%","em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","Q","in","pc","pt","px","deg","grad","rad","turn","s","ms"],colorNames:{aliceblue:"240,248,255",antiquewhite:"250,235,215",aquamarine:"127,255,212",aqua:"0,255,255",azure:"240,255,255",beige:"245,245,220",bisque:"255,228,196",black:"0,0,0",blanchedalmond:"255,235,205",blueviolet:"138,43,226",blue:"0,0,255",brown:"165,42,42",burlywood:"222,184,135",cadetblue:"95,158,160",chartreuse:"127,255,0",chocolate:"210,105,30",coral:"255,127,80",cornflowerblue:"100,149,237",cornsilk:"255,248,220",crimson:"220,20,60",cyan:"0,255,255",darkblue:"0,0,139",darkcyan:"0,139,139",darkgoldenrod:"184,134,11",darkgray:"169,169,169",darkgrey:"169,169,169",darkgreen:"0,100,0",darkkhaki:"189,183,107",darkmagenta:"139,0,139",darkolivegreen:"85,107,47",darkorange:"255,140,0",darkorchid:"153,50,204",darkred:"139,0,0",darksalmon:"233,150,122",darkseagreen:"143,188,143",darkslateblue:"72,61,139",darkslategray:"47,79,79",darkturquoise:"0,206,209",darkviolet:"148,0,211",deeppink:"255,20,147",deepskyblue:"0,191,255",dimgray:"105,105,105",dimgrey:"105,105,105",dodgerblue:"30,144,255",firebrick:"178,34,34",floralwhite:"255,250,240",forestgreen:"34,139,34",fuchsia:"255,0,255",gainsboro:"220,220,220",ghostwhite:"248,248,255",gold:"255,215,0",goldenrod:"218,165,32",gray:"128,128,128",grey:"128,128,128",greenyellow:"173,255,47",green:"0,128,0",honeydew:"240,255,240",hotpink:"255,105,180",indianred:"205,92,92",indigo:"75,0,130",ivory:"255,255,240",khaki:"240,230,140",lavenderblush:"255,240,245",lavender:"230,230,250",lawngreen:"124,252,0",lemonchiffon:"255,250,205",lightblue:"173,216,230",lightcoral:"240,128,128",lightcyan:"224,255,255",lightgoldenrodyellow:"250,250,210",lightgray:"211,211,211",lightgrey:"211,211,211",lightgreen:"144,238,144",lightpink:"255,182,193",lightsalmon:"255,160,122",lightseagreen:"32,178,170",lightskyblue:"135,206,250",lightslategray:"119,136,153",lightsteelblue:"176,196,222",lightyellow:"255,255,224",limegreen:"50,205,50",lime:"0,255,0",linen:"250,240,230",magenta:"255,0,255",maroon:"128,0,0",mediumaquamarine:"102,205,170",mediumblue:"0,0,205",mediumorchid:"186,85,211",mediumpurple:"147,112,219",mediumseagreen:"60,179,113",mediumslateblue:"123,104,238",mediumspringgreen:"0,250,154",mediumturquoise:"72,209,204",mediumvioletred:"199,21,133",midnightblue:"25,25,112",mintcream:"245,255,250",mistyrose:"255,228,225",moccasin:"255,228,181",navajowhite:"255,222,173",navy:"0,0,128",oldlace:"253,245,230",olivedrab:"107,142,35",olive:"128,128,0",orangered:"255,69,0",orange:"255,165,0",orchid:"218,112,214",palegoldenrod:"238,232,170",palegreen:"152,251,152",paleturquoise:"175,238,238",palevioletred:"219,112,147",papayawhip:"255,239,213",peachpuff:"255,218,185",peru:"205,133,63",pink:"255,192,203",plum:"221,160,221",powderblue:"176,224,230",purple:"128,0,128",red:"255,0,0",rosybrown:"188,143,143",royalblue:"65,105,225",saddlebrown:"139,69,19",salmon:"250,128,114",sandybrown:"244,164,96",seagreen:"46,139,87",seashell:"255,245,238",sienna:"160,82,45",silver:"192,192,192",skyblue:"135,206,235",slateblue:"106,90,205",slategray:"112,128,144",snow:"255,250,250",springgreen:"0,255,127",steelblue:"70,130,180",tan:"210,180,140",teal:"0,128,128",thistle:"216,191,216",tomato:"255,99,71",turquoise:"64,224,208",violet:"238,130,238",wheat:"245,222,179",whitesmoke:"245,245,245",white:"255,255,255",yellowgreen:"154,205,50",yellow:"255,255,0"}},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var x=0;x<T.Lists.colors.length;x++){var S=T.Lists.colors[x]==="color"?"0 0 0 1":"255 255 255 1";T.Hooks.templates[T.Lists.colors[x]]=["Red Green Blue Alpha",S]}var O,P,w;if(o){for(O in T.Hooks.templates)if(!!T.Hooks.templates.hasOwnProperty(O)){P=T.Hooks.templates[O],w=P[0].split(" ");var D=P[1].match(T.RegEx.valueSplit);w[0]==="Color"&&(w.push(w.shift()),D.push(D.shift()),T.Hooks.templates[O]=[w.join(" "),D.join(" ")])}}for(O in T.Hooks.templates)if(!!T.Hooks.templates.hasOwnProperty(O)){P=T.Hooks.templates[O],w=P[0].split(" ");for(var R in w)if(!!w.hasOwnProperty(R)){var j=O+w[R],H=R;T.Hooks.registered[j]=[O,H]}}},getRoot:function(x){var S=T.Hooks.registered[x];return S?S[0]:x},getUnit:function(x,S){var O=(x.substr(S||0,5).match(/^[a-z%]+/)||[])[0]||"";return O&&d(T.Lists.units)?O:""},fixColors:function(x){return x.replace(/(rgba?\(\s*)?(\b[a-z]+\b)/g,function(S,O,P){return T.Lists.colorNames.hasOwnProperty(P)?(O||"rgba(")+T.Lists.colorNames[P]+(O?"":",1)"):O+P})},cleanRootPropertyValue:function(x,S){return T.RegEx.valueUnwrap.test(S)&&(S=S.match(T.RegEx.valueUnwrap)[1]),T.Values.isCSSNullValue(S)&&(S=T.Hooks.templates[x][1]),S},extractValue:function(x,S){var O=T.Hooks.registered[x];if(O){var P=O[0],w=O[1];return S=T.Hooks.cleanRootPropertyValue(P,S),S.toString().match(T.RegEx.valueSplit)[w]}else return S},injectValue:function(x,S,O){var P=T.Hooks.registered[x];if(P){var w=P[0],D=P[1],R,j;return O=T.Hooks.cleanRootPropertyValue(w,O),R=O.toString().match(T.RegEx.valueSplit),R[D]=S,j=R.join(" "),j}else return O}},Normalizations:{registered:{clip:function(x,S,O){switch(x){case"name":return"clip";case"extract":var P;return T.RegEx.wrappedValueAlreadyExtracted.test(O)?P=O:(P=O.toString().match(T.RegEx.valueUnwrap),P=P?P[1].replace(/,(\s+)?/g," "):O),P;case"inject":return"rect("+O+")"}},blur:function(x,S,O){switch(x){case"name":return g.State.isFirefox?"filter":"-webkit-filter";case"extract":var P=parseFloat(O);if(!(P||P===0)){var w=O.toString().match(/blur\(([0-9]+[A-z]+)\)/i);w?P=w[1]:P=0}return P;case"inject":return parseFloat(O)?"blur("+O+")":"none"}},opacity:function(x,S,O){if(o<=8)switch(x){case"name":return"filter";case"extract":var P=O.toString().match(/alpha\(opacity=(.*)\)/i);return P?O=P[1]/100:O=1,O;case"inject":return S.style.zoom=1,parseFloat(O)>=1?"":"alpha(opacity="+parseInt(parseFloat(O)*100,10)+")"}else switch(x){case"name":return"opacity";case"extract":return O;case"inject":return O}}},register:function(){(!o||o>9)&&!g.State.isGingerbread&&(T.Lists.transformsBase=T.Lists.transformsBase.concat(T.Lists.transforms3D));for(var x=0;x<T.Lists.transformsBase.length;x++)(function(){var w=T.Lists.transformsBase[x];T.Normalizations.registered[w]=function(D,R,j){switch(D){case"name":return"transform";case"extract":return _(R)===a||_(R).transformCache[w]===a?/^scale/i.test(w)?1:0:_(R).transformCache[w].replace(/[()]/g,"");case"inject":var H=!1;switch(w.substr(0,w.length-1)){case"translate":H=!/(%|px|em|rem|vw|vh|\d)$/i.test(j);break;case"scal":case"scale":g.State.isAndroid&&_(R).transformCache[w]===a&&j<1&&(j=1),H=!/(\d)$/i.test(j);break;case"skew":H=!/(deg|\d)$/i.test(j);break;case"rotate":H=!/(deg|\d)$/i.test(j);break}return H||(_(R).transformCache[w]="("+j+")"),_(R).transformCache[w]}}})();for(var S=0;S<T.Lists.colors.length;S++)(function(){var w=T.Lists.colors[S];T.Normalizations.registered[w]=function(D,R,j){switch(D){case"name":return w;case"extract":var H;if(T.RegEx.wrappedValueAlreadyExtracted.test(j))H=j;else{var q,Y={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(j)?Y[j]!==a?q=Y[j]:q=Y.black:T.RegEx.isHex.test(j)?q="rgb("+T.Values.hexToRgb(j).join(" ")+")":/^rgba?\(/i.test(j)||(q=Y.black),H=(q||j).toString().match(T.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return(!o||o>8)&&H.split(" ").length===3&&(H+=" 1"),H;case"inject":return/^rgb/.test(j)?j:(o<=8?j.split(" ").length===4&&(j=j.split(/\s+/).slice(0,3).join(" ")):j.split(" ").length===3&&(j+=" 1"),(o<=8?"rgb":"rgba")+"("+j.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")")}}})();function O(w,D,R){var j=T.getPropertyValue(D,"boxSizing").toString().toLowerCase()==="border-box";if(j===(R||!1)){var H,q,Y=0,G=w==="width"?["Left","Right"]:["Top","Bottom"],X=["padding"+G[0],"padding"+G[1],"border"+G[0]+"Width","border"+G[1]+"Width"];for(H=0;H<X.length;H++)q=parseFloat(T.getPropertyValue(D,X[H])),isNaN(q)||(Y+=q);return R?-Y:Y}return 0}function P(w,D){return function(R,j,H){switch(R){case"name":return w;case"extract":return parseFloat(H)+O(w,j,D);case"inject":return parseFloat(H)-O(w,j,D)+"px"}}}T.Normalizations.registered.innerWidth=P("width",!0),T.Normalizations.registered.innerHeight=P("height",!0),T.Normalizations.registered.outerWidth=P("width"),T.Normalizations.registered.outerHeight=P("height")}},Names:{camelCase:function(x){return x.replace(/-(\w)/g,function(S,O){return O.toUpperCase()})},SVGAttribute:function(x){var S="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(o||g.State.isAndroid&&!g.State.isChrome)&&(S+="|transform"),new RegExp("^("+S+")$","i").test(x)},prefixCheck:function(x){if(g.State.prefixMatches[x])return[g.State.prefixMatches[x],!0];for(var S=["","Webkit","Moz","ms","O"],O=0,P=S.length;O<P;O++){var w;if(O===0?w=x:w=S[O]+x.replace(/^\w/,function(D){return D.toUpperCase()}),m.isString(g.State.prefixElement.style[w]))return g.State.prefixMatches[x]=w,[w,!0]}return[x,!1]}},Values:{hexToRgb:function(x){var S=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,O=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,P;return x=x.replace(S,function(w,D,R,j){return D+D+R+R+j+j}),P=O.exec(x),P?[parseInt(P[1],16),parseInt(P[2],16),parseInt(P[3],16)]:[0,0,0]},isCSSNullValue:function(x){return!x||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(x)},getUnitType:function(x){return/^(rotate|skew)/i.test(x)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(x)?"":"px"},getDisplayType:function(x){var S=x&&x.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(S)?"inline":/^(li)$/i.test(S)?"list-item":/^(tr)$/i.test(S)?"table-row":/^(table)$/i.test(S)?"table":/^(tbody)$/i.test(S)?"table-row-group":"block"},addClass:function(x,S){if(x)if(x.classList)x.classList.add(S);else if(m.isString(x.className))x.className+=(x.className.length?" ":"")+S;else{var O=x.getAttribute(o<=7?"className":"class")||"";x.setAttribute("class",O+(O?" ":"")+S)}},removeClass:function(x,S){if(x)if(x.classList)x.classList.remove(S);else if(m.isString(x.className))x.className=x.className.toString().replace(new RegExp("(^|\\s)"+S.split(" ").join("|")+"(\\s|$)","gi")," ");else{var O=x.getAttribute(o<=7?"className":"class")||"";x.setAttribute("class",O.replace(new RegExp("(^|s)"+S.split(" ").join("|")+"(s|$)","gi")," "))}}},getPropertyValue:function(x,S,O,P){function w(G,X){var ne=0;if(o<=8)ne=c.css(G,X);else{var me=!1;/^(width|height)$/.test(X)&&T.getPropertyValue(G,"display")===0&&(me=!0,T.setPropertyValue(G,"display",T.Values.getDisplayType(G)));var fe=function(){me&&T.setPropertyValue(G,"display","none")};if(!P){if(X==="height"&&T.getPropertyValue(G,"boxSizing").toString().toLowerCase()!=="border-box"){var we=G.offsetHeight-(parseFloat(T.getPropertyValue(G,"borderTopWidth"))||0)-(parseFloat(T.getPropertyValue(G,"borderBottomWidth"))||0)-(parseFloat(T.getPropertyValue(G,"paddingTop"))||0)-(parseFloat(T.getPropertyValue(G,"paddingBottom"))||0);return fe(),we}else if(X==="width"&&T.getPropertyValue(G,"boxSizing").toString().toLowerCase()!=="border-box"){var je=G.offsetWidth-(parseFloat(T.getPropertyValue(G,"borderLeftWidth"))||0)-(parseFloat(T.getPropertyValue(G,"borderRightWidth"))||0)-(parseFloat(T.getPropertyValue(G,"paddingLeft"))||0)-(parseFloat(T.getPropertyValue(G,"paddingRight"))||0);return fe(),je}}var Le;_(G)===a?Le=r.getComputedStyle(G,null):_(G).computedStyle?Le=_(G).computedStyle:Le=_(G).computedStyle=r.getComputedStyle(G,null),X==="borderColor"&&(X="borderTopColor"),o===9&&X==="filter"?ne=Le.getPropertyValue(X):ne=Le[X],(ne===""||ne===null)&&(ne=G.style[X]),fe()}if(ne==="auto"&&/^(top|right|bottom|left)$/i.test(X)){var Ve=w(G,"position");(Ve==="fixed"||Ve==="absolute"&&/top|left/i.test(X))&&(ne=c(G).position()[X]+"px")}return ne}var D;if(T.Hooks.registered[S]){var R=S,j=T.Hooks.getRoot(R);O===a&&(O=T.getPropertyValue(x,T.Names.prefixCheck(j)[0])),T.Normalizations.registered[j]&&(O=T.Normalizations.registered[j]("extract",x,O)),D=T.Hooks.extractValue(R,O)}else if(T.Normalizations.registered[S]){var H,q;H=T.Normalizations.registered[S]("name",x),H!=="transform"&&(q=w(x,T.Names.prefixCheck(H)[0]),T.Values.isCSSNullValue(q)&&T.Hooks.templates[S]&&(q=T.Hooks.templates[S][1])),D=T.Normalizations.registered[S]("extract",x,q)}if(!/^[\d-]/.test(D)){var Y=_(x);if(Y&&Y.isSVG&&T.Names.SVGAttribute(S))if(/^(height|width)$/i.test(S))try{D=x.getBBox()[S]}catch{D=0}else D=x.getAttribute(S);else D=w(x,T.Names.prefixCheck(S)[0])}return T.Values.isCSSNullValue(D)&&(D=0),g.debug>=2&&console.log("Get "+S+": "+D),D},setPropertyValue:function(x,S,O,P,w){var D=S;if(S==="scroll")w.container?w.container["scroll"+w.direction]=O:w.direction==="Left"?r.scrollTo(O,w.alternateValue):r.scrollTo(w.alternateValue,O);else if(T.Normalizations.registered[S]&&T.Normalizations.registered[S]("name",x)==="transform")T.Normalizations.registered[S]("inject",x,O),D="transform",O=_(x).transformCache[S];else{if(T.Hooks.registered[S]){var R=S,j=T.Hooks.getRoot(S);P=P||T.getPropertyValue(x,j),O=T.Hooks.injectValue(R,O,P),S=j}if(T.Normalizations.registered[S]&&(O=T.Normalizations.registered[S]("inject",x,O),S=T.Normalizations.registered[S]("name",x)),D=T.Names.prefixCheck(S)[0],o<=8)try{x.style[D]=O}catch{g.debug&&console.log("Browser does not support ["+O+"] for ["+D+"]")}else{var H=_(x);H&&H.isSVG&&T.Names.SVGAttribute(S)?x.setAttribute(S,O):x.style[D]=O}g.debug>=2&&console.log("Set "+S+" ("+D+"): "+O)}return[D,O]},flushTransformCache:function(x){var S="",O=_(x);if((o||g.State.isAndroid&&!g.State.isChrome)&&O&&O.isSVG){var P=function(j){return parseFloat(T.getPropertyValue(x,j))},w={translate:[P("translateX"),P("translateY")],skewX:[P("skewX")],skewY:[P("skewY")],scale:P("scale")!==1?[P("scale"),P("scale")]:[P("scaleX"),P("scaleY")],rotate:[P("rotateZ"),0,0]};c.each(_(x).transformCache,function(j){/^translate/i.test(j)?j="translate":/^scale/i.test(j)?j="scale":/^rotate/i.test(j)&&(j="rotate"),w[j]&&(S+=j+"("+w[j].join(" ")+") ",delete w[j])})}else{var D,R;c.each(_(x).transformCache,function(j){if(D=_(x).transformCache[j],j==="transformPerspective")return R=D,!0;o===9&&j==="rotateZ"&&(j="rotate"),S+=j+D+" "}),R&&(S="perspective"+R+" "+S)}T.setPropertyValue(x,"transform",S)}};T.Hooks.register(),T.Normalizations.register(),g.hook=function(x,S,O){var P;return x=f(x),c.each(x,function(w,D){if(_(D)===a&&g.init(D),O===a)P===a&&(P=T.getPropertyValue(D,S));else{var R=T.setPropertyValue(D,S,O);R[0]==="transform"&&g.CSS.flushTransformCache(D),P=R}}),P};var N=function(){var x;function S(){return P?q.promise||null:w}var O=arguments[0]&&(arguments[0].p||c.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||m.isString(arguments[0].properties)),P,w,D,R,j,H;m.isWrapped(this)?(P=!1,D=0,R=this,w=this):(P=!0,D=1,R=O?arguments[0].elements||arguments[0].e:arguments[0]);var q={promise:null,resolver:null,rejecter:null};if(P&&g.Promise&&(q.promise=new g.Promise(function(ee,A){q.resolver=ee,q.rejecter=A})),O?(j=arguments[0].properties||arguments[0].p,H=arguments[0].options||arguments[0].o):(j=arguments[D],H=arguments[D+1]),R=f(R),!R){q.promise&&(!j||!H||H.promiseRejectEmpty!==!1?q.rejecter():q.resolver());return}var Y=R.length,G=0;if(!/^(stop|finish|finishAll|pause|resume)$/i.test(j)&&!c.isPlainObject(H)){var X=D+1;H={};for(var ne=X;ne<arguments.length;ne++)!m.isArray(arguments[ne])&&(/^(fast|normal|slow)$/i.test(arguments[ne])||/^\d/.test(arguments[ne]))?H.duration=arguments[ne]:m.isString(arguments[ne])||m.isArray(arguments[ne])?H.easing=arguments[ne]:m.isFunction(arguments[ne])&&(H.complete=arguments[ne])}var me;switch(j){case"scroll":me="scroll";break;case"reverse":me="reverse";break;case"pause":var fe=new Date().getTime();return c.each(R,function(ee,A){y(A,fe)}),c.each(g.State.calls,function(ee,A){var I=!1;A&&c.each(A[1],function(B,K){var Z=H===a?"":H;if(Z!==!0&&A[2].queue!==Z&&!(H===a&&A[2].queue===!1))return!0;if(c.each(R,function(pe,ge){if(ge===K)return A[5]={resume:!1},I=!0,!1}),I)return!1})}),S();case"resume":return c.each(R,function(ee,A){b(A)}),c.each(g.State.calls,function(ee,A){var I=!1;A&&c.each(A[1],function(B,K){var Z=H===a?"":H;if(Z!==!0&&A[2].queue!==Z&&!(H===a&&A[2].queue===!1)||!A[5])return!0;if(c.each(R,function(pe,ge){if(ge===K)return A[5].resume=!0,I=!0,!1}),I)return!1})}),S();case"finish":case"finishAll":case"stop":c.each(R,function(ee,A){_(A)&&_(A).delayTimer&&(clearTimeout(_(A).delayTimer.setTimeout),_(A).delayTimer.next&&_(A).delayTimer.next(),delete _(A).delayTimer),j==="finishAll"&&(H===!0||m.isString(H))&&(c.each(c.queue(A,m.isString(H)?H:""),function(I,B){m.isFunction(B)&&B()}),c.queue(A,m.isString(H)?H:"",[]))});var we=[];return c.each(g.State.calls,function(ee,A){A&&c.each(A[1],function(I,B){var K=H===a?"":H;if(K!==!0&&A[2].queue!==K&&!(H===a&&A[2].queue===!1))return!0;c.each(R,function(Z,pe){if(pe===B)if((H===!0||m.isString(H))&&(c.each(c.queue(pe,m.isString(H)?H:""),function(Pe,de){m.isFunction(de)&&de(null,!0)}),c.queue(pe,m.isString(H)?H:"",[])),j==="stop"){var ge=_(pe);ge&&ge.tweensContainer&&(K===!0||K==="")&&c.each(ge.tweensContainer,function(Pe,de){de.endValue=de.currentValue}),we.push(ee)}else(j==="finish"||j==="finishAll")&&(A[2].duration=1)})})}),j==="stop"&&(c.each(we,function(ee,A){L(A,!0)}),q.promise&&q.resolver(R)),S();default:if(c.isPlainObject(j)&&!m.isEmptyObject(j))me="start";else if(m.isString(j)&&g.Redirects[j]){x=c.extend({},H);var je=x.duration,Le=x.delay||0;return x.backwards===!0&&(R=c.extend(!0,[],R).reverse()),c.each(R,function(ee,A){parseFloat(x.stagger)?x.delay=Le+parseFloat(x.stagger)*ee:m.isFunction(x.stagger)&&(x.delay=Le+x.stagger.call(A,ee,Y)),x.drag&&(x.duration=parseFloat(je)||(/^(callout|transition)/.test(j)?1e3:h),x.duration=Math.max(x.duration*(x.backwards?1-ee/Y:(ee+1)/Y),x.duration*.75,200)),g.Redirects[j].call(A,A,x||{},ee,Y,R,q.promise?q:a)}),S()}else{var Ve="Velocity: First argument ("+j+") was not a property map, a known action, or a registered redirect. Aborting.";return q.promise?q.rejecter(new Error(Ve)):r.console&&console.log(Ve),S()}}var ye={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},Ae=[];function ze(ee,A){var I=c.extend({},g.defaults,H),B={},K;switch(_(ee)===a&&g.init(ee),parseFloat(I.delay)&&I.queue!==!1&&c.queue(ee,I.queue,function(Pe,de){if(de===!0)return!0;g.velocityQueueEntryFlag=!0;var he=g.State.delayedElements.count++;g.State.delayedElements[he]=ee;var Be=function(st){return function(){g.State.delayedElements[st]=!1,Pe()}}(he);_(ee).delayBegin=new Date().getTime(),_(ee).delay=parseFloat(I.delay),_(ee).delayTimer={setTimeout:setTimeout(Pe,parseFloat(I.delay)),next:Be}}),I.duration.toString().toLowerCase()){case"fast":I.duration=200;break;case"normal":I.duration=h;break;case"slow":I.duration=600;break;default:I.duration=parseFloat(I.duration)||1}g.mock!==!1&&(g.mock===!0?I.duration=I.delay=1:(I.duration*=parseFloat(g.mock)||1,I.delay*=parseFloat(g.mock)||1)),I.easing=F(I.easing,I.duration),I.begin&&!m.isFunction(I.begin)&&(I.begin=null),I.progress&&!m.isFunction(I.progress)&&(I.progress=null),I.complete&&!m.isFunction(I.complete)&&(I.complete=null),I.display!==a&&I.display!==null&&(I.display=I.display.toString().toLowerCase(),I.display==="auto"&&(I.display=g.CSS.Values.getDisplayType(ee))),I.visibility!==a&&I.visibility!==null&&(I.visibility=I.visibility.toString().toLowerCase()),I.mobileHA=I.mobileHA&&g.State.isMobile&&!g.State.isGingerbread;function Z(Pe){var de,he;if(I.begin&&G===0)try{I.begin.call(R,R)}catch(Ce){setTimeout(function(){throw Ce},1)}if(me==="scroll"){var Be=/^x$/i.test(I.axis)?"Left":"Top",st=parseFloat(I.offset)||0,Ke,Ge,Re;I.container?m.isWrapped(I.container)||m.isNode(I.container)?(I.container=I.container[0]||I.container,Ke=I.container["scroll"+Be],Re=Ke+c(ee).position()[Be.toLowerCase()]+st):I.container=null:(Ke=g.State.scrollAnchor[g.State["scrollProperty"+Be]],Ge=g.State.scrollAnchor[g.State["scrollProperty"+(Be==="Left"?"Top":"Left")]],Re=c(ee).offset()[Be.toLowerCase()]+st),B={scroll:{rootPropertyValue:!1,startValue:Ke,currentValue:Ke,endValue:Re,unitType:"",easing:I.easing,scrollData:{container:I.container,direction:Be,alternateValue:Ge}},element:ee},g.debug&&console.log("tweensContainer (scroll): ",B.scroll,ee)}else if(me==="reverse"){if(de=_(ee),!de)return;if(de.tweensContainer){de.opts.display==="none"&&(de.opts.display="auto"),de.opts.visibility==="hidden"&&(de.opts.visibility="visible"),de.opts.loop=!1,de.opts.begin=null,de.opts.complete=null,H.easing||delete I.easing,H.duration||delete I.duration,I=c.extend({},de.opts,I),he=c.extend(!0,{},de?de.tweensContainer:null);for(var dt in he)if(he.hasOwnProperty(dt)&&dt!=="element"){var Hr=he[dt].startValue;he[dt].startValue=he[dt].currentValue=he[dt].endValue,he[dt].endValue=Hr,m.isEmptyObject(H)||(he[dt].easing=I.easing),g.debug&&console.log("reverse tweensContainer ("+dt+"): "+JSON.stringify(he[dt]),ee)}B=he}else{c.dequeue(ee,I.queue);return}}else if(me==="start"){de=_(ee),de&&de.tweensContainer&&de.isAnimating===!0&&(he=de.tweensContainer);var Vu=function(Ce,Oi){var lr,nn,Ie;return m.isFunction(Ce)&&(Ce=Ce.call(ee,A,Y)),m.isArray(Ce)?(lr=Ce[0],!m.isArray(Ce[1])&&/^[\d-]/.test(Ce[1])||m.isFunction(Ce[1])||T.RegEx.isHex.test(Ce[1])?Ie=Ce[1]:m.isString(Ce[1])&&!T.RegEx.isHex.test(Ce[1])&&g.Easings[Ce[1]]||m.isArray(Ce[1])?(nn=Oi?Ce[1]:F(Ce[1],I.duration),Ie=Ce[2]):Ie=Ce[1]||Ce[2]):lr=Ce,Oi||(nn=nn||I.easing),m.isFunction(lr)&&(lr=lr.call(ee,A,Y)),m.isFunction(Ie)&&(Ie=Ie.call(ee,A,Y)),[lr||0,nn,Ie]},Uo=function(Ce,Oi){var lr=T.Hooks.getRoot(Ce),nn=!1,Ie=Oi[0],DL=Oi[1],Ye=Oi[2],Pr;if((!de||!de.isSVG)&&lr!=="tween"&&T.Names.prefixCheck(lr)[1]===!1&&T.Normalizations.registered[lr]===a){g.debug&&console.log("Skipping ["+lr+"] due to a lack of browser support.");return}(I.display!==a&&I.display!==null&&I.display!=="none"||I.visibility!==a&&I.visibility!=="hidden")&&/opacity|filter/.test(Ce)&&!Ye&&Ie!==0&&(Ye=0),I._cacheValues&&he&&he[Ce]?(Ye===a&&(Ye=he[Ce].endValue+he[Ce].unitType),nn=de.rootPropertyValueCache[lr]):T.Hooks.registered[Ce]?Ye===a?(nn=T.getPropertyValue(ee,lr),Ye=T.getPropertyValue(ee,Ce,nn)):nn=T.Hooks.templates[lr][1]:Ye===a&&(Ye=T.getPropertyValue(ee,Ce));var Ei,Tr,Fa,kc=!1,qb=function(mr,Ko){var Di,sa;return sa=(Ko||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(pr){return Di=pr,""}),Di||(Di=T.Values.getUnitType(mr)),[sa,Di]};if(Ye!==Ie&&m.isString(Ye)&&m.isString(Ie)){Pr="";var ia=0,oa=0,Pn=[],Bo=[],fr=0,Qt=0,Tn=0;for(Ye=T.Hooks.fixColors(Ye),Ie=T.Hooks.fixColors(Ie);ia<Ye.length&&oa<Ie.length;){var Et=Ye[ia],ja=Ie[oa];if(/[\d\.-]/.test(Et)&&/[\d\.-]/.test(ja)){for(var Yo=Et,Uu=ja,Bb=".",Yb=".";++ia<Ye.length;){if(Et=Ye[ia],Et===Bb)Bb="..";else if(!/\d/.test(Et))break;Yo+=Et}for(;++oa<Ie.length;){if(ja=Ie[oa],ja===Yb)Yb="..";else if(!/\d/.test(ja))break;Uu+=ja}var Go=T.Hooks.getUnit(Ye,ia),Pc=T.Hooks.getUnit(Ie,oa);if(ia+=Go.length,oa+=Pc.length,Go===Pc)Yo===Uu?Pr+=Yo+Go:(Pr+="{"+Pn.length+(Qt?"!":"")+"}"+Go,Pn.push(parseFloat(Yo)),Bo.push(parseFloat(Uu)));else{var Hu=parseFloat(Yo),Tc=parseFloat(Uu);Pr+=(fr<5?"calc":"")+"("+(Hu?"{"+Pn.length+(Qt?"!":"")+"}":"0")+Go+" + "+(Tc?"{"+(Pn.length+(Hu?1:0))+(Qt?"!":"")+"}":"0")+Pc+")",Hu&&(Pn.push(Hu),Bo.push(0)),Tc&&(Pn.push(0),Bo.push(Tc))}}else if(Et===ja)Pr+=Et,ia++,oa++,fr===0&&Et==="c"||fr===1&&Et==="a"||fr===2&&Et==="l"||fr===3&&Et==="c"||fr>=4&&Et==="("?fr++:(fr&&fr<5||fr>=4&&Et===")"&&--fr<5)&&(fr=0),Qt===0&&Et==="r"||Qt===1&&Et==="g"||Qt===2&&Et==="b"||Qt===3&&Et==="a"||Qt>=3&&Et==="("?(Qt===3&&Et==="a"&&(Tn=1),Qt++):Tn&&Et===","?++Tn>3&&(Qt=Tn=0):(Tn&&Qt<(Tn?5:4)||Qt>=(Tn?4:3)&&Et===")"&&--Qt<(Tn?5:4))&&(Qt=Tn=0);else{fr=0;break}}(ia!==Ye.length||oa!==Ie.length)&&(g.debug&&console.error('Trying to pattern match mis-matched strings ["'+Ie+'", "'+Ye+'"]'),Pr=a),Pr&&(Pn.length?(g.debug&&console.log('Pattern found "'+Pr+'" -> ',Pn,Bo,"["+Ye+","+Ie+"]"),Ye=Pn,Ie=Bo,Tr=Fa=""):Pr=a)}Pr||(Ei=qb(Ce,Ye),Ye=Ei[0],Fa=Ei[1],Ei=qb(Ce,Ie),Ie=Ei[0].replace(/^([+-\/*])=/,function(mr,Ko){return kc=Ko,""}),Tr=Ei[1],Ye=parseFloat(Ye)||0,Ie=parseFloat(Ie)||0,Tr==="%"&&(/^(fontSize|lineHeight)$/.test(Ce)?(Ie=Ie/100,Tr="em"):/^scale/.test(Ce)?(Ie=Ie/100,Tr=""):/(Red|Green|Blue)$/i.test(Ce)&&(Ie=Ie/100*255,Tr="")));var CL=function(){var mr={myParent:ee.parentNode||n.body,position:T.getPropertyValue(ee,"position"),fontSize:T.getPropertyValue(ee,"fontSize")},Ko=mr.position===ye.lastPosition&&mr.myParent===ye.lastParent,Di=mr.fontSize===ye.lastFontSize;ye.lastParent=mr.myParent,ye.lastPosition=mr.position,ye.lastFontSize=mr.fontSize;var sa=100,pr={};if(!Di||!Ko){var Mr=de&&de.isSVG?n.createElementNS("http://www.w3.org/2000/svg","rect"):n.createElement("div");g.init(Mr),mr.myParent.appendChild(Mr),c.each(["overflow","overflowX","overflowY"],function($L,Mc){g.CSS.setPropertyValue(Mr,Mc,"hidden")}),g.CSS.setPropertyValue(Mr,"position",mr.position),g.CSS.setPropertyValue(Mr,"fontSize",mr.fontSize),g.CSS.setPropertyValue(Mr,"boxSizing","content-box"),c.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function($L,Mc){g.CSS.setPropertyValue(Mr,Mc,sa+"%")}),g.CSS.setPropertyValue(Mr,"paddingLeft",sa+"em"),pr.percentToPxWidth=ye.lastPercentToPxWidth=(parseFloat(T.getPropertyValue(Mr,"width",null,!0))||1)/sa,pr.percentToPxHeight=ye.lastPercentToPxHeight=(parseFloat(T.getPropertyValue(Mr,"height",null,!0))||1)/sa,pr.emToPx=ye.lastEmToPx=(parseFloat(T.getPropertyValue(Mr,"paddingLeft"))||1)/sa,mr.myParent.removeChild(Mr)}else pr.emToPx=ye.lastEmToPx,pr.percentToPxWidth=ye.lastPercentToPxWidth,pr.percentToPxHeight=ye.lastPercentToPxHeight;return ye.remToPx===null&&(ye.remToPx=parseFloat(T.getPropertyValue(n.body,"fontSize"))||16),ye.vwToPx===null&&(ye.vwToPx=parseFloat(r.innerWidth)/100,ye.vhToPx=parseFloat(r.innerHeight)/100),pr.remToPx=ye.remToPx,pr.vwToPx=ye.vwToPx,pr.vhToPx=ye.vhToPx,g.debug>=1&&console.log("Unit ratios: "+JSON.stringify(pr),ee),pr};if(/[\/*]/.test(kc))Tr=Fa;else if(Fa!==Tr&&Ye!==0)if(Ie===0)Tr=Fa;else{K=K||CL();var Gb=/margin|padding|left|right|width|text|word|letter/i.test(Ce)||/X$/.test(Ce)||Ce==="x"?"x":"y";switch(Fa){case"%":Ye*=Gb==="x"?K.percentToPxWidth:K.percentToPxHeight;break;case"px":break;default:Ye*=K[Fa+"ToPx"]}switch(Tr){case"%":Ye*=1/(Gb==="x"?K.percentToPxWidth:K.percentToPxHeight);break;case"px":break;default:Ye*=1/K[Tr+"ToPx"]}}switch(kc){case"+":Ie=Ye+Ie;break;case"-":Ie=Ye-Ie;break;case"*":Ie=Ye*Ie;break;case"/":Ie=Ye/Ie;break}B[Ce]={rootPropertyValue:nn,startValue:Ye,currentValue:Ye,endValue:Ie,unitType:Tr,easing:DL},Pr&&(B[Ce].pattern=Pr),g.debug&&console.log("tweensContainer ("+Ce+"): "+JSON.stringify(B[Ce]),ee)};for(var Wa in j)if(!!j.hasOwnProperty(Wa)){var Ho=T.Names.camelCase(Wa),zu=Vu(j[Wa]);if(d(T.Lists.colors)){var jb=zu[0],Vb=zu[1],zb=zu[2];if(T.RegEx.isHex.test(jb)){for(var Ub=["Red","Green","Blue"],EL=T.Values.hexToRgb(jb),Hb=zb?T.Values.hexToRgb(zb):a,qo=0;qo<Ub.length;qo++){var xc=[EL[qo]];Vb&&xc.push(Vb),Hb!==a&&xc.push(Hb[qo]),Uo(Ho+Ub[qo],xc)}continue}}Uo(Ho,zu)}B.element=ee}B.element&&(T.Values.addClass(ee,"velocity-animating"),Ae.push(B),de=_(ee),de&&(I.queue===""&&(de.tweensContainer=B,de.opts=I),de.isAnimating=!0),G===Y-1?(g.State.calls.push([Ae,R,I,null,q.resolver,null,0]),g.State.isTicking===!1&&(g.State.isTicking=!0,E())):G++)}if(I.queue===!1)if(I.delay){var pe=g.State.delayedElements.count++;g.State.delayedElements[pe]=ee;var ge=function(Pe){return function(){g.State.delayedElements[Pe]=!1,Z()}}(pe);_(ee).delayBegin=new Date().getTime(),_(ee).delay=parseFloat(I.delay),_(ee).delayTimer={setTimeout:setTimeout(Z,parseFloat(I.delay)),next:ge}}else Z();else c.queue(ee,I.queue,function(Pe,de){if(de===!0)return q.promise&&q.resolver(R),!0;g.velocityQueueEntryFlag=!0,Z()});(I.queue===""||I.queue==="fx")&&c.queue(ee)[0]!=="inprogress"&&c.dequeue(ee)}c.each(R,function(ee,A){m.isNode(A)&&ze(A,ee)}),x=c.extend({},g.defaults,H),x.loop=parseInt(x.loop,10);var Pt=x.loop*2-1;if(x.loop)for(var Ot=0;Ot<Pt;Ot++){var et={delay:x.delay,progress:x.progress};Ot===Pt-1&&(et.display=x.display,et.visibility=x.visibility,et.complete=x.complete),N(R,"reverse",et)}return S()};g=c.extend(N,g),g.animate=N;var W=r.requestAnimationFrame||i;if(!g.State.isMobile&&n.hidden!==a){var $=function(){n.hidden?(W=function(x){return setTimeout(function(){x(!0)},16)},E()):W=r.requestAnimationFrame||i};$(),n.addEventListener("visibilitychange",$)}function E(x){if(x){var S=g.timestamp&&x!==!0?x:s.now(),O=g.State.calls.length;O>1e4&&(g.State.calls=u(g.State.calls),O=g.State.calls.length);for(var P=0;P<O;P++)if(!!g.State.calls[P]){var w=g.State.calls[P],D=w[0],R=w[2],j=w[3],H=!j,q=null,Y=w[5],G=w[6];if(j||(j=g.State.calls[P][3]=S-16),Y)if(Y.resume===!0)j=w[3]=Math.round(S-G-16),w[5]=null;else continue;G=w[6]=S-j;for(var X=Math.min(G/R.duration,1),ne=0,me=D.length;ne<me;ne++){var fe=D[ne],we=fe.element;if(!!_(we)){var je=!1;if(R.display!==a&&R.display!==null&&R.display!=="none"){if(R.display==="flex"){var Le=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];c.each(Le,function(I,B){T.setPropertyValue(we,"display",B)})}T.setPropertyValue(we,"display",R.display)}R.visibility!==a&&R.visibility!=="hidden"&&T.setPropertyValue(we,"visibility",R.visibility);for(var Ve in fe)if(fe.hasOwnProperty(Ve)&&Ve!=="element"){var ye=fe[Ve],Ae,ze=m.isString(ye.easing)?g.Easings[ye.easing]:ye.easing;if(m.isString(ye.pattern)){var Pt=X===1?function(I,B,K){var Z=ye.endValue[B];return K?Math.round(Z):Z}:function(I,B,K){var Z=ye.startValue[B],pe=ye.endValue[B]-Z,ge=Z+pe*ze(X,R,pe);return K?Math.round(ge):ge};Ae=ye.pattern.replace(/{(\d+)(!)?}/g,Pt)}else if(X===1)Ae=ye.endValue;else{var Ot=ye.endValue-ye.startValue;Ae=ye.startValue+Ot*ze(X,R,Ot)}if(!H&&Ae===ye.currentValue)continue;if(ye.currentValue=Ae,Ve==="tween")q=Ae;else{var et;if(T.Hooks.registered[Ve]){et=T.Hooks.getRoot(Ve);var ee=_(we).rootPropertyValueCache[et];ee&&(ye.rootPropertyValue=ee)}var A=T.setPropertyValue(we,Ve,ye.currentValue+(o<9&&parseFloat(Ae)===0?"":ye.unitType),ye.rootPropertyValue,ye.scrollData);T.Hooks.registered[Ve]&&(T.Normalizations.registered[et]?_(we).rootPropertyValueCache[et]=T.Normalizations.registered[et]("extract",null,A[1]):_(we).rootPropertyValueCache[et]=A[1]),A[0]==="transform"&&(je=!0)}}R.mobileHA&&_(we).transformCache.translate3d===a&&(_(we).transformCache.translate3d="(0px, 0px, 0px)",je=!0),je&&T.flushTransformCache(we)}}R.display!==a&&R.display!=="none"&&(g.State.calls[P][2].display=!1),R.visibility!==a&&R.visibility!=="hidden"&&(g.State.calls[P][2].visibility=!1),R.progress&&R.progress.call(w[1],w[1],X,Math.max(0,j+R.duration-S),j,q),X===1&&L(P)}}g.State.isTicking&&W(E)}function L(x,S){if(!g.State.calls[x])return!1;for(var O=g.State.calls[x][0],P=g.State.calls[x][1],w=g.State.calls[x][2],D=g.State.calls[x][4],R=!1,j=0,H=O.length;j<H;j++){var q=O[j].element;!S&&!w.loop&&(w.display==="none"&&T.setPropertyValue(q,"display",w.display),w.visibility==="hidden"&&T.setPropertyValue(q,"visibility",w.visibility));var Y=_(q);if(w.loop!==!0&&(c.queue(q)[1]===a||!/\.velocityQueueEntryFlag/i.test(c.queue(q)[1]))&&Y){Y.isAnimating=!1,Y.rootPropertyValueCache={};var G=!1;c.each(T.Lists.transforms3D,function(me,fe){var we=/^scale/.test(fe)?1:0,je=Y.transformCache[fe];Y.transformCache[fe]!==a&&new RegExp("^\\("+we+"[^.]").test(je)&&(G=!0,delete Y.transformCache[fe])}),w.mobileHA&&(G=!0,delete Y.transformCache.translate3d),G&&T.flushTransformCache(q),T.Values.removeClass(q,"velocity-animating")}if(!S&&w.complete&&!w.loop&&j===H-1)try{w.complete.call(P,P)}catch(me){setTimeout(function(){throw me},1)}D&&w.loop!==!0&&D(P),Y&&w.loop===!0&&!S&&(c.each(Y.tweensContainer,function(me,fe){if(/^rotate/.test(me)&&(parseFloat(fe.startValue)-parseFloat(fe.endValue))%360===0){var we=fe.startValue;fe.startValue=fe.endValue,fe.endValue=we}/^backgroundPosition/.test(me)&&parseFloat(fe.endValue)===100&&fe.unitType==="%"&&(fe.endValue=0,fe.startValue=100)}),g(q,"reverse",{loop:!0,delay:w.delay})),w.queue!==!1&&c.dequeue(q,w.queue)}g.State.calls[x]=!1;for(var X=0,ne=g.State.calls.length;X<ne;X++)if(g.State.calls[X]!==!1){R=!0;break}R===!1&&(g.State.isTicking=!1,delete g.State.calls,g.State.calls=[])}return e.Velocity=g,e!==r&&(e.fn.velocity=N,e.fn.velocity.defaults=g.defaults),c.each(["Down","Up"],function(x,S){g.Redirects["slide"+S]=function(O,P,w,D,R,j){var H=c.extend({},P),q=H.begin,Y=H.complete,G={},X={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""};H.display===a&&(H.display=S==="Down"?g.CSS.Values.getDisplayType(O)==="inline"?"inline-block":"block":"none"),H.begin=function(){w===0&&q&&q.call(R,R);for(var ne in X)if(!!X.hasOwnProperty(ne)){G[ne]=O.style[ne];var me=T.getPropertyValue(O,ne);X[ne]=S==="Down"?[me,0]:[0,me]}G.overflow=O.style.overflow,O.style.overflow="hidden"},H.complete=function(){for(var ne in G)G.hasOwnProperty(ne)&&(O.style[ne]=G[ne]);w===D-1&&(Y&&Y.call(R,R),j&&j.resolver(R))},g(O,X,H)}}),c.each(["In","Out"],function(x,S){g.Redirects["fade"+S]=function(O,P,w,D,R,j){var H=c.extend({},P),q=H.complete,Y={opacity:S==="In"?1:0};w!==0&&(H.begin=null),w!==D-1?H.complete=null:H.complete=function(){q&&q.call(R,R),j&&j.resolver(R)},H.display===a&&(H.display=S==="In"?"auto":"none"),g(this,Y,H)}}),g}(window.jQuery||window.Zepto||window,window,window?window.document:void 0)})})(aK);const cb=aK.exports;var Oit={exports:{}};(function(t,e){/* VelocityJS.org UI Pack (5.2.0). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License. Portions copyright Daniel Eden, Christian Pucci. */(function(r){typeof t5=="function"?t.exports=r():r()})(function(){return function(r,n,a,o){var i=r.Velocity;if(!i||!i.Utilities){n.console&&console.log("Velocity UI Pack: Velocity must be loaded first. Aborting.");return}var s=i.Utilities,u=i.version,l={major:1,minor:1,patch:0};function d(c,p){var h=[];return!c||!p?!1:(s.each([c,p],function(v,g){var _=[];s.each(g,function(y,b){for(;b.toString().length<5;)b="0"+b;_.push(b)}),h.push(_.join(""))}),parseFloat(h[0])>parseFloat(h[1]))}if(d(l,u)){var f="Velocity UI Pack: You need to update Velocity (velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity.";throw alert(f),new Error(f)}i.RegisterEffect=i.RegisterUI=function(c,p){function h(v,g,_,y){var b=0,k;s.each(v.nodeType?[v]:v,function(M,C){y&&(_+=M*y),k=C.parentNode;var F=["height","paddingTop","paddingBottom","marginTop","marginBottom"];i.CSS.getPropertyValue(C,"boxSizing").toString().toLowerCase()==="border-box"&&(F=["height"]),s.each(F,function(T,N){b+=parseFloat(i.CSS.getPropertyValue(C,N))})}),i.animate(k,{height:(g==="In"?"+":"-")+"="+b},{queue:!1,easing:"ease-in-out",duration:_*(g==="In"?.6:1)})}return i.Redirects[c]=function(v,g,_,y,b,k,M){var C=_===y-1,F=0;M=M||p.loop,typeof p.defaultDuration=="function"?p.defaultDuration=p.defaultDuration.call(b,b):p.defaultDuration=parseFloat(p.defaultDuration);for(var T=0;T<p.calls.length;T++)L=p.calls[T][1],typeof L=="number"&&(F+=L);var N=F>=1?0:p.calls.length?(1-F)/p.calls.length:1;for(T=0;T<p.calls.length;T++){var W=p.calls[T],$=W[0],E=1e3,L=W[1],x=W[2]||{},S={};if(g.duration!==o?E=g.duration:p.defaultDuration!==o&&(E=p.defaultDuration),S.duration=E*(typeof L=="number"?L:N),S.queue=g.queue||"",S.easing=x.easing||"ease",S.delay=parseFloat(x.delay)||0,S.loop=!p.loop&&x.loop,S._cacheValues=x._cacheValues||!0,T===0){if(S.delay+=parseFloat(g.delay)||0,_===0&&(S.begin=function(){g.begin&&g.begin.call(b,b);var w=c.match(/(In|Out)$/);w&&w[0]==="In"&&$.opacity!==o&&s.each(b.nodeType?[b]:b,function(D,R){i.CSS.setPropertyValue(R,"opacity",0)}),g.animateParentHeight&&w&&h(b,w[0],E+S.delay,g.stagger)}),g.display!==null){if(g.display!==o&&g.display!=="none")S.display=g.display;else if(/In$/.test(c)){var O=i.CSS.Values.getDisplayType(v);S.display=O==="inline"?"inline-block":O}}g.visibility&&g.visibility!=="hidden"&&(S.visibility=g.visibility)}if(T===p.calls.length-1){var P=function(){(g.display===o||g.display==="none")&&/Out$/.test(c)&&s.each(b.nodeType?[b]:b,function(w,D){i.CSS.setPropertyValue(D,"display","none")}),g.complete&&g.complete.call(b,b),k&&k.resolver(b||v)};S.complete=function(){if(M&&i.Redirects[c](v,g,_,y,b,k,M===!0?!0:Math.max(0,M-1)),p.reset){for(var w in p.reset)if(!!p.reset.hasOwnProperty(w)){var D=p.reset[w];i.CSS.Hooks.registered[w]===o&&(typeof D=="string"||typeof D=="number")&&(p.reset[w]=[p.reset[w],p.reset[w]])}var R={duration:0,queue:!1};C&&(R.complete=P),i.animate(v,p.reset,R)}else C&&P()},g.visibility==="hidden"&&(S.visibility=g.visibility)}i.animate(v,$,S)}},i},i.RegisterEffect.packagedEffects={"callout.bounce":{defaultDuration:550,calls:[[{translateY:-30},.25],[{translateY:0},.125],[{translateY:-15},.125],[{translateY:0},.25]]},"callout.shake":{defaultDuration:800,calls:[[{translateX:-11}],[{translateX:11}],[{translateX:-11}],[{translateX:11}],[{translateX:-11}],[{translateX:11}],[{translateX:-11}],[{translateX:0}]]},"callout.flash":{defaultDuration:1100,calls:[[{opacity:[0,"easeInOutQuad",1]}],[{opacity:[1,"easeInOutQuad"]}],[{opacity:[0,"easeInOutQuad"]}],[{opacity:[1,"easeInOutQuad"]}]]},"callout.pulse":{defaultDuration:825,calls:[[{scaleX:1.1,scaleY:1.1},.5,{easing:"easeInExpo"}],[{scaleX:1,scaleY:1},.5]]},"callout.swing":{defaultDuration:950,calls:[[{rotateZ:15}],[{rotateZ:-10}],[{rotateZ:5}],[{rotateZ:-5}],[{rotateZ:0}]]},"callout.tada":{defaultDuration:1e3,calls:[[{scaleX:.9,scaleY:.9,rotateZ:-3},.1],[{scaleX:1.1,scaleY:1.1,rotateZ:3},.1],[{scaleX:1.1,scaleY:1.1,rotateZ:-3},.1],["reverse",.125],["reverse",.125],["reverse",.125],["reverse",.125],["reverse",.125],[{scaleX:1,scaleY:1,rotateZ:0},.2]]},"transition.fadeIn":{defaultDuration:500,calls:[[{opacity:[1,0]}]]},"transition.fadeOut":{defaultDuration:500,calls:[[{opacity:[0,1]}]]},"transition.flipXIn":{defaultDuration:700,calls:[[{opacity:[1,0],transformPerspective:[800,800],rotateY:[0,-55]}]],reset:{transformPerspective:0}},"transition.flipXOut":{defaultDuration:700,calls:[[{opacity:[0,1],transformPerspective:[800,800],rotateY:55}]],reset:{transformPerspective:0,rotateY:0}},"transition.flipYIn":{defaultDuration:800,calls:[[{opacity:[1,0],transformPerspective:[800,800],rotateX:[0,-45]}]],reset:{transformPerspective:0}},"transition.flipYOut":{defaultDuration:800,calls:[[{opacity:[0,1],transformPerspective:[800,800],rotateX:25}]],reset:{transformPerspective:0,rotateX:0}},"transition.flipBounceXIn":{defaultDuration:900,calls:[[{opacity:[.725,0],transformPerspective:[400,400],rotateY:[-10,90]},.5],[{opacity:.8,rotateY:10},.25],[{opacity:1,rotateY:0},.25]],reset:{transformPerspective:0}},"transition.flipBounceXOut":{defaultDuration:800,calls:[[{opacity:[.9,1],transformPerspective:[400,400],rotateY:-10}],[{opacity:0,rotateY:90}]],reset:{transformPerspective:0,rotateY:0}},"transition.flipBounceYIn":{defaultDuration:850,calls:[[{opacity:[.725,0],transformPerspective:[400,400],rotateX:[-10,90]},.5],[{opacity:.8,rotateX:10},.25],[{opacity:1,rotateX:0},.25]],reset:{transformPerspective:0}},"transition.flipBounceYOut":{defaultDuration:800,calls:[[{opacity:[.9,1],transformPerspective:[400,400],rotateX:-15}],[{opacity:0,rotateX:90}]],reset:{transformPerspective:0,rotateX:0}},"transition.swoopIn":{defaultDuration:850,calls:[[{opacity:[1,0],transformOriginX:["100%","50%"],transformOriginY:["100%","100%"],scaleX:[1,0],scaleY:[1,0],translateX:[0,-700],translateZ:0}]],reset:{transformOriginX:"50%",transformOriginY:"50%"}},"transition.swoopOut":{defaultDuration:850,calls:[[{opacity:[0,1],transformOriginX:["50%","100%"],transformOriginY:["100%","100%"],scaleX:0,scaleY:0,translateX:-700,translateZ:0}]],reset:{transformOriginX:"50%",transformOriginY:"50%",scaleX:1,scaleY:1,translateX:0}},"transition.whirlIn":{defaultDuration:850,calls:[[{opacity:[1,0],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:[1,0],scaleY:[1,0],rotateY:[0,160]},1,{easing:"easeInOutSine"}]]},"transition.whirlOut":{defaultDuration:750,calls:[[{opacity:[0,"easeInOutQuint",1],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:0,scaleY:0,rotateY:160},1,{easing:"swing"}]],reset:{scaleX:1,scaleY:1,rotateY:0}},"transition.shrinkIn":{defaultDuration:750,calls:[[{opacity:[1,0],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:[1,1.5],scaleY:[1,1.5],translateZ:0}]]},"transition.shrinkOut":{defaultDuration:600,calls:[[{opacity:[0,1],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:1.3,scaleY:1.3,translateZ:0}]],reset:{scaleX:1,scaleY:1}},"transition.expandIn":{defaultDuration:700,calls:[[{opacity:[1,0],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:[1,.625],scaleY:[1,.625],translateZ:0}]]},"transition.expandOut":{defaultDuration:700,calls:[[{opacity:[0,1],transformOriginX:["50%","50%"],transformOriginY:["50%","50%"],scaleX:.5,scaleY:.5,translateZ:0}]],reset:{scaleX:1,scaleY:1}},"transition.bounceIn":{defaultDuration:800,calls:[[{opacity:[1,0],scaleX:[1.05,.3],scaleY:[1.05,.3]},.35],[{scaleX:.9,scaleY:.9,translateZ:0},.2],[{scaleX:1,scaleY:1},.45]]},"transition.bounceOut":{defaultDuration:800,calls:[[{scaleX:.95,scaleY:.95},.35],[{scaleX:1.1,scaleY:1.1,translateZ:0},.35],[{opacity:[0,1],scaleX:.3,scaleY:.3},.3]],reset:{scaleX:1,scaleY:1}},"transition.bounceUpIn":{defaultDuration:800,calls:[[{opacity:[1,0],translateY:[-30,1e3]},.6,{easing:"easeOutCirc"}],[{translateY:10},.2],[{translateY:0},.2]]},"transition.bounceUpOut":{defaultDuration:1e3,calls:[[{translateY:20},.2],[{opacity:[0,"easeInCirc",1],translateY:-1e3},.8]],reset:{translateY:0}},"transition.bounceDownIn":{defaultDuration:800,calls:[[{opacity:[1,0],translateY:[30,-1e3]},.6,{easing:"easeOutCirc"}],[{translateY:-10},.2],[{translateY:0},.2]]},"transition.bounceDownOut":{defaultDuration:1e3,calls:[[{translateY:-20},.2],[{opacity:[0,"easeInCirc",1],translateY:1e3},.8]],reset:{translateY:0}},"transition.bounceLeftIn":{defaultDuration:750,calls:[[{opacity:[1,0],translateX:[30,-1250]},.6,{easing:"easeOutCirc"}],[{translateX:-10},.2],[{translateX:0},.2]]},"transition.bounceLeftOut":{defaultDuration:750,calls:[[{translateX:30},.2],[{opacity:[0,"easeInCirc",1],translateX:-1250},.8]],reset:{translateX:0}},"transition.bounceRightIn":{defaultDuration:750,calls:[[{opacity:[1,0],translateX:[-30,1250]},.6,{easing:"easeOutCirc"}],[{translateX:10},.2],[{translateX:0},.2]]},"transition.bounceRightOut":{defaultDuration:750,calls:[[{translateX:-30},.2],[{opacity:[0,"easeInCirc",1],translateX:1250},.8]],reset:{translateX:0}},"transition.slideUpIn":{defaultDuration:900,calls:[[{opacity:[1,0],translateY:[0,20],translateZ:0}]]},"transition.slideUpOut":{defaultDuration:900,calls:[[{opacity:[0,1],translateY:-20,translateZ:0}]],reset:{translateY:0}},"transition.slideDownIn":{defaultDuration:900,calls:[[{opacity:[1,0],translateY:[0,-20],translateZ:0}]]},"transition.slideDownOut":{defaultDuration:900,calls:[[{opacity:[0,1],translateY:20,translateZ:0}]],reset:{translateY:0}},"transition.slideLeftIn":{defaultDuration:1e3,calls:[[{opacity:[1,0],translateX:[0,-20],translateZ:0}]]},"transition.slideLeftOut":{defaultDuration:1050,calls:[[{opacity:[0,1],translateX:-20,translateZ:0}]],reset:{translateX:0}},"transition.slideRightIn":{defaultDuration:1e3,calls:[[{opacity:[1,0],translateX:[0,20],translateZ:0}]]},"transition.slideRightOut":{defaultDuration:1050,calls:[[{opacity:[0,1],translateX:20,translateZ:0}]],reset:{translateX:0}},"transition.slideUpBigIn":{defaultDuration:850,calls:[[{opacity:[1,0],translateY:[0,75],translateZ:0}]]},"transition.slideUpBigOut":{defaultDuration:800,calls:[[{opacity:[0,1],translateY:-75,translateZ:0}]],reset:{translateY:0}},"transition.slideDownBigIn":{defaultDuration:850,calls:[[{opacity:[1,0],translateY:[0,-75],translateZ:0}]]},"transition.slideDownBigOut":{defaultDuration:800,calls:[[{opacity:[0,1],translateY:75,translateZ:0}]],reset:{translateY:0}},"transition.slideLeftBigIn":{defaultDuration:800,calls:[[{opacity:[1,0],translateX:[0,-75],translateZ:0}]]},"transition.slideLeftBigOut":{defaultDuration:750,calls:[[{opacity:[0,1],translateX:-75,translateZ:0}]],reset:{translateX:0}},"transition.slideRightBigIn":{defaultDuration:800,calls:[[{opacity:[1,0],translateX:[0,75],translateZ:0}]]},"transition.slideRightBigOut":{defaultDuration:750,calls:[[{opacity:[0,1],translateX:75,translateZ:0}]],reset:{translateX:0}},"transition.perspectiveUpIn":{defaultDuration:800,calls:[[{opacity:[1,0],transformPerspective:[800,800],transformOriginX:[0,0],transformOriginY:["100%","100%"],rotateX:[0,-180]}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%"}},"transition.perspectiveUpOut":{defaultDuration:850,calls:[[{opacity:[0,1],transformPerspective:[800,800],transformOriginX:[0,0],transformOriginY:["100%","100%"],rotateX:-180}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%",rotateX:0}},"transition.perspectiveDownIn":{defaultDuration:800,calls:[[{opacity:[1,0],transformPerspective:[800,800],transformOriginX:[0,0],transformOriginY:[0,0],rotateX:[0,180]}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%"}},"transition.perspectiveDownOut":{defaultDuration:850,calls:[[{opacity:[0,1],transformPerspective:[800,800],transformOriginX:[0,0],transformOriginY:[0,0],rotateX:180}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%",rotateX:0}},"transition.perspectiveLeftIn":{defaultDuration:950,calls:[[{opacity:[1,0],transformPerspective:[2e3,2e3],transformOriginX:[0,0],transformOriginY:[0,0],rotateY:[0,-180]}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%"}},"transition.perspectiveLeftOut":{defaultDuration:950,calls:[[{opacity:[0,1],transformPerspective:[2e3,2e3],transformOriginX:[0,0],transformOriginY:[0,0],rotateY:-180}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%",rotateY:0}},"transition.perspectiveRightIn":{defaultDuration:950,calls:[[{opacity:[1,0],transformPerspective:[2e3,2e3],transformOriginX:["100%","100%"],transformOriginY:[0,0],rotateY:[0,180]}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%"}},"transition.perspectiveRightOut":{defaultDuration:950,calls:[[{opacity:[0,1],transformPerspective:[2e3,2e3],transformOriginX:["100%","100%"],transformOriginY:[0,0],rotateY:180}]],reset:{transformPerspective:0,transformOriginX:"50%",transformOriginY:"50%",rotateY:0}}};for(var m in i.RegisterEffect.packagedEffects)i.RegisterEffect.packagedEffects.hasOwnProperty(m)&&i.RegisterEffect(m,i.RegisterEffect.packagedEffects[m]);i.RunSequence=function(c){var p=s.extend(!0,[],c);p.length>1&&(s.each(p.reverse(),function(h,v){var g=p[h+1];if(g){var _=v.o||v.options,y=g.o||g.options,b=_&&_.sequenceQueue===!1?"begin":"complete",k=y&&y[b],M={};M[b]=function(){var C=g.e||g.elements,F=C.nodeType?[C]:C;k&&k.call(F,F),i(v)},g.o?g.o=s.extend({},y,M):g.options=s.extend({},y,M)}}),p.reverse()),i(p[0])}}(window.jQuery||window.Zepto||window,window)})})(Oit);var vL={},fb={},$t={},mb={},pb={};Object.defineProperty(pb,"__esModule",{value:!0}),pb.withParams=void 0;function hb(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?hb=function(r){return typeof r}:hb=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},hb(t)}var iK=typeof window<"u"?window:typeof ct<"u"?ct:{},Eit=function(e,r){return hb(e)==="object"&&r!==void 0?r:e(function(){})},Dit=iK.vuelidate?iK.vuelidate.withParams:Eit;pb.withParams=Dit,Object.defineProperty(mb,"__esModule",{value:!0}),mb.default=void 0;var Cit=pb.withParams,$it=Cit;mb.default=$it,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.req=t.regex=t.ref=t.len=void 0,Object.defineProperty(t,"withParams",{enumerable:!0,get:function(){return e.default}});var e=r(mb);function r(u){return u&&u.__esModule?u:{default:u}}function n(u){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?n=function(d){return typeof d}:n=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},n(u)}var a=function(l){if(Array.isArray(l))return!!l.length;if(l==null)return!1;if(l===!1)return!0;if(l instanceof Date)return!isNaN(l.getTime());if(n(l)==="object"){for(var d in l)return!0;return!1}return!!String(l).length};t.req=a;var o=function(l){return Array.isArray(l)?l.length:n(l)==="object"?Object.keys(l).length:String(l).length};t.len=o;var i=function(l,d,f){return typeof l=="function"?l.call(d,f):f[l]};t.ref=i;var s=function(l,d){return(0,e.default)({type:l},function(f){return!a(f)||d.test(f)})};t.regex=s}($t),Object.defineProperty(fb,"__esModule",{value:!0}),fb.default=void 0;var Ait=$t,Rit=(0,Ait.regex)("alpha",/^[a-zA-Z]*$/);fb.default=Rit;var vb={};Object.defineProperty(vb,"__esModule",{value:!0}),vb.default=void 0;var Iit=$t,Nit=(0,Iit.regex)("alphaNum",/^[a-zA-Z0-9]*$/);vb.default=Nit;var gb={};Object.defineProperty(gb,"__esModule",{value:!0}),gb.default=void 0;var Lit=$t,Wit=(0,Lit.regex)("numeric",/^[0-9]*$/);gb.default=Wit;var yb={};Object.defineProperty(yb,"__esModule",{value:!0}),yb.default=void 0;var oK=$t,Fit=function(e,r){return(0,oK.withParams)({type:"between",min:e,max:r},function(n){return!(0,oK.req)(n)||(!/\s/.test(n)||n instanceof Date)&&+e<=+n&&+r>=+n})};yb.default=Fit;var _b={};Object.defineProperty(_b,"__esModule",{value:!0}),_b.default=void 0;var jit=$t,Vit=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i,zit=(0,jit.regex)("email",Vit);_b.default=zit;var bb={};Object.defineProperty(bb,"__esModule",{value:!0}),bb.default=void 0;var sK=$t,Uit=(0,sK.withParams)({type:"ipAddress"},function(t){if(!(0,sK.req)(t))return!0;if(typeof t!="string")return!1;var e=t.split(".");return e.length===4&&e.every(Hit)});bb.default=Uit;var Hit=function(e){if(e.length>3||e.length===0||e[0]==="0"&&e!=="0"||!e.match(/^\d+$/))return!1;var r=+e|0;return r>=0&&r<=255},wb={};Object.defineProperty(wb,"__esModule",{value:!0}),wb.default=void 0;var uK=$t,qit=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:":";return(0,uK.withParams)({type:"macAddress"},function(r){if(!(0,uK.req)(r))return!0;if(typeof r!="string")return!1;var n=typeof e=="string"&&e!==""?r.split(e):r.length===12||r.length===16?r.match(/.{2}/g):null;return n!==null&&(n.length===6||n.length===8)&&n.every(Bit)})};wb.default=qit;var Bit=function(e){return e.toLowerCase().match(/^[0-9a-f]{2}$/)},xb={};Object.defineProperty(xb,"__esModule",{value:!0}),xb.default=void 0;var gL=$t,Yit=function(e){return(0,gL.withParams)({type:"maxLength",max:e},function(r){return!(0,gL.req)(r)||(0,gL.len)(r)<=e})};xb.default=Yit;var kb={};Object.defineProperty(kb,"__esModule",{value:!0}),kb.default=void 0;var yL=$t,Git=function(e){return(0,yL.withParams)({type:"minLength",min:e},function(r){return!(0,yL.req)(r)||(0,yL.len)(r)>=e})};kb.default=Git;var Pb={};Object.defineProperty(Pb,"__esModule",{value:!0}),Pb.default=void 0;var _L=$t,Kit=(0,_L.withParams)({type:"required"},function(t){return typeof t=="string"?(0,_L.req)(t.trim()):(0,_L.req)(t)});Pb.default=Kit;var Tb={};Object.defineProperty(Tb,"__esModule",{value:!0}),Tb.default=void 0;var bL=$t,Xit=function(e){return(0,bL.withParams)({type:"requiredIf",prop:e},function(r,n){return(0,bL.ref)(e,this,n)?(0,bL.req)(r):!0})};Tb.default=Xit;var Mb={};Object.defineProperty(Mb,"__esModule",{value:!0}),Mb.default=void 0;var wL=$t,Jit=function(e){return(0,wL.withParams)({type:"requiredUnless",prop:e},function(r,n){return(0,wL.ref)(e,this,n)?!0:(0,wL.req)(r)})};Mb.default=Jit;var Sb={};Object.defineProperty(Sb,"__esModule",{value:!0}),Sb.default=void 0;var lK=$t,Qit=function(e){return(0,lK.withParams)({type:"sameAs",eq:e},function(r,n){return r===(0,lK.ref)(e,this,n)})};Sb.default=Qit;var Ob={};Object.defineProperty(Ob,"__esModule",{value:!0}),Ob.default=void 0;var Zit=$t,eot=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i,tot=(0,Zit.regex)("url",eot);Ob.default=tot;var Eb={};Object.defineProperty(Eb,"__esModule",{value:!0}),Eb.default=void 0;var rot=$t,not=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(0,rot.withParams)({type:"or"},function(){for(var a=this,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r.length>0&&r.reduce(function(u,l){return u||l.apply(a,i)},!1)})};Eb.default=not;var Db={};Object.defineProperty(Db,"__esModule",{value:!0}),Db.default=void 0;var aot=$t,iot=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(0,aot.withParams)({type:"and"},function(){for(var a=this,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r.length>0&&r.reduce(function(u,l){return u&&l.apply(a,i)},!0)})};Db.default=iot;var Cb={};Object.defineProperty(Cb,"__esModule",{value:!0}),Cb.default=void 0;var dK=$t,oot=function(e){return(0,dK.withParams)({type:"not"},function(r,n){return!(0,dK.req)(r)||!e.call(this,r,n)})};Cb.default=oot;var $b={};Object.defineProperty($b,"__esModule",{value:!0}),$b.default=void 0;var cK=$t,sot=function(e){return(0,cK.withParams)({type:"minValue",min:e},function(r){return!(0,cK.req)(r)||(!/\s/.test(r)||r instanceof Date)&&+r>=+e})};$b.default=sot;var Ab={};Object.defineProperty(Ab,"__esModule",{value:!0}),Ab.default=void 0;var fK=$t,uot=function(e){return(0,fK.withParams)({type:"maxValue",max:e},function(r){return!(0,fK.req)(r)||(!/\s/.test(r)||r instanceof Date)&&+r<=+e})};Ab.default=uot;var Rb={};Object.defineProperty(Rb,"__esModule",{value:!0}),Rb.default=void 0;var lot=$t,dot=(0,lot.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);Rb.default=dot;var Ib={};Object.defineProperty(Ib,"__esModule",{value:!0}),Ib.default=void 0;var cot=$t,fot=(0,cot.regex)("decimal",/^[-]?\d*(\.\d+)?$/);Ib.default=fot,function(t){function e(W){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(E){return typeof E}:e=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},e(W)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"alpha",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"alphaNum",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"and",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"between",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"decimal",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"email",{enumerable:!0,get:function(){return i.default}}),t.helpers=void 0,Object.defineProperty(t,"integer",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"ipAddress",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"macAddress",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"maxLength",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"maxValue",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"minLength",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"minValue",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"not",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"numeric",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"or",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"required",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"requiredIf",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"requiredUnless",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"sameAs",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"url",{enumerable:!0,get:function(){return h.default}});var r=N(fb),n=N(vb),a=N(gb),o=N(yb),i=N(_b),s=N(bb),u=N(wb),l=N(xb),d=N(kb),f=N(Pb),m=N(Tb),c=N(Mb),p=N(Sb),h=N(Ob),v=N(Eb),g=N(Db),_=N(Cb),y=N($b),b=N(Ab),k=N(Rb),M=N(Ib),C=T($t);t.helpers=C;function F(W){if(typeof WeakMap!="function")return null;var $=new WeakMap,E=new WeakMap;return(F=function(x){return x?E:$})(W)}function T(W,$){if(!$&&W&&W.__esModule)return W;if(W===null||e(W)!=="object"&&typeof W!="function")return{default:W};var E=F($);if(E&&E.has(W))return E.get(W);var L={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in W)if(S!=="default"&&Object.prototype.hasOwnProperty.call(W,S)){var O=x?Object.getOwnPropertyDescriptor(W,S):null;O&&(O.get||O.set)?Object.defineProperty(L,S,O):L[S]=W[S]}return L.default=W,E&&E.set(W,L),L}function N(W){return W&&W.__esModule?W:{default:W}}}(vL);function mK(t){if(typeof t>"u")throw Error("Missing param inputParam");let e=t;Number.isInteger(e)&&(e=e.toString());let r=0;const n=e.length,a=n%2;let o,i;for(o=0;o<n;o+=1)i=parseInt(e.charAt(o),10),o%2===a&&(i*=2),i>9&&(i-=9),r+=i;return r%10===0}function pK(t){let e=t.replace(/ /g,"");return e=e.replace(/-/g,""),!mK(e)||(e=[e.slice(0,6),"-",e.slice(6)].join(""),!e.match(/^(\d{6})-(\d{4})$/))?!1:e}function Nb(t){if(typeof t>"u"||t===null||t==="")return!1;let e=t.trim().replace(/[^0-9]+/g,"");if(e.length!==10&&e.length!==12)return!1;if(e.length===10){const a=e.substring(0,2),o=new Date().getFullYear(),i=parseInt(o.toString().substring(2,2),10);parseInt(a,10)===19||parseInt(a,10)===20||(parseInt(a,10)>=0&&parseInt(a,10)<=i?e=`20${e}`:e=`19${e}`)}return new Date().getFullYear()-parseInt(e.substring(0,4),10)<16?!1:mK(e.substring(2))?e:!1}class mot{constructor({defaults:e={width:800,height:600},delay:r=50}={}){this._width=e.width,this._height=e.height,this._delay=r,this._timer=null,this._initialized=!1,this._handler=this._handleResize.bind(this)}_handleResize(){clearTimeout(this._timer),this._timer=setTimeout(()=>{this.update()},this._delay)}get width(){return this._width}get height(){return this._height}get initialized(){return this._initialized}update(){this._width=window.innerWidth,this._height=window.innerHeight}setDelay(e){this._delay=e}init(){return typeof window>"u"?this:this.initialized?this:(this.update(),window.addEventListener("resize",this._handler,{passive:!0}),this._initialized=!0,this)}destroy(){return this.initialized?(window.removeEventListener("resize",this._handler,{passive:!0}),this._initialized=!1,this):this}}const pot=new mot().init(),hK=new ce({data:{windowSize:pot}}),hot={computed:{windowWidth(){return hK.windowSize.width},windowHeight(){return hK.windowSize.height}}},fmt="",{mapFields:vot}=xV({getterType:"forms/getField",mutationType:"forms/updateField"}),got={i18nOptions:{namespaces:"components"},name:"FormClient",components:{ClientAutocomplete:nK},mixins:[hot],props:{requireReference:{type:Boolean,default:!0},searchEnabled:{type:Boolean,default:!1},validateOrgNo:{type:Boolean,default:!1},simpleForm:{type:Boolean,default:!1},inputFocusOnMount:{type:String,default:""},documentRole:{type:String,default:""},answerMethod:{type:Object,default:null},isPublicForm:{type:Boolean,default:!1}},validations(){return{orgNo:{personalNumber(t){return!this.validateOrgNo||!t?!0:this.isIndivid?Nb(t):pK(t)||Nb(t)}},reference:{required:vL.requiredIf(t=>t.requireReference&&!t.isIndivid)},email:{email:vL.email}}},computed:{...vot({id:"endCustomer.id",type:"endCustomer.customerType",name:"endCustomer.name",realOrgNo:"endCustomer.org_no",reference:"endCustomer.reference",email:"endCustomer.email",street:"endCustomer.street",zip:"endCustomer.zip",city:"endCustomer.city",cellphone:"endCustomer.cellphone",cellphoneRegion:"endCustomer.cellphoneRegion",separateWorkAddress:"endCustomer.separateWorkAddress",workStreet:"endCustomer.workStreet",workZip:"endCustomer.workZip",workCity:"endCustomer.workCity",reverseVat:"endCustomer.reverseVat",doUpdateEndCustomer:"endCustomer.doUpdateEndCustomer"}),...Gd({isPosting:"endCustomers/isPosting",companyRegion:"application/companyRegion",feature:"application/feature"}),messages(){return{name:{required:this.$t("forms.client.validations.name.required")},orgNo:{personalNumber:this.$t("forms.client.validations.orgNo.personalNumber")},realOrgNo:{personalNumber:this.$t("forms.client.validations.realOrgNo.realOrgNo")},reference:{required:this.$t("forms.client.validations.reference.required")},email:{required:this.$t("forms.client.validations.email.required"),email:this.$t("forms.client.validations.email.email")}}},orgNo:{get(){return this.realOrgNo},set(t){const e=this.isIndivid?Nb(t):pK(t)||Nb(t);return this.validateOrgNo&&e?(this.realOrgNo=e,!0):(this.realOrgNo=t,!0)}},isIndivid(){return this.type==="individual"}},mounted(){this.$refs[this.inputFocusOnMount]?this.$refs[this.inputFocusOnMount].$el.querySelector("input").focus():this.$refs.name.$el.querySelector("input").focus()},methods:{validateForm(){return this.$v.$touch(),this.$v.$invalid?!1:(this.$emit("submit",!0),!0)},beforeEnter(t){const e=t;e.style.opacity=0},enter(t,e){cb(t,{opacity:1},{duration:70,delay:100,queue:!1}),cb(t,"slideDown",{duration:150,complete:e})},leave(t,e){cb(t,{opacity:0},{duration:50,queue:!1}),cb(t,"slideUp",{duration:150,easing:"easeOutQuart",complete:e})}}};var yot=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-client"},[e.simpleForm?r("form",{on:{submit:function(n){return n.preventDefault(),e.validateForm.apply(null,arguments)}}},[r("div",{staticClass:"flex items-center space-between pb-6 flex-wrap"},[r("div",{staticClass:"flex-grow",staticStyle:{"font-weight":"600","font-size":"20px"}},[e._v(" "+e._s(e.$t("_common:recipient").capitalize())+" ")]),r("CField",[r("CRadioButton",{attrs:{"native-value":"individual",type:"none",size:"small"},model:{value:e.type,callback:function(n){e.type=n},expression:"type"}},[e._v(" "+e._s(e.$t("forms.client.individual"))+" ")]),r("CRadioButton",{attrs:{"native-value":"company",type:"none",size:"small"},model:{value:e.type,callback:function(n){e.type=n},expression:"type"}},[e._v(" "+e._s(e.$t("_common:company").capitalize())+" ")])],1)],1),r("CField",{staticStyle:{"margin-bottom":"1.5rem"},attrs:{label:e.isIndivid?e.$t("name").capitalize():e.$t("company").capitalize(),validator:e.$v.name,messages:e.messages.name,"label-position":"inside"}},[r("ClientAutocomplete",{ref:"name",attrs:{placeholder:e.isIndivid?e.$t("forms.client.placeholders.name"):e.$t("forms.client.placeholders.companyName"),"search-enabled":e.searchEnabled,"show-loading":!0},on:{setClient:function(n){return e.$emit("setClient",n)}},model:{value:e.name,callback:function(n){e.name=n},expression:"name"}})],1),e.isIndivid?e._e():r("CField",{staticStyle:{"margin-bottom":"1.5rem"},attrs:{validator:e.$v.reference,messages:e.messages.reference,label:e.$t("forms.client.reference").capitalize(),"label-position":"inside"}},[r("CInput",{ref:"reference",attrs:{placeholder:e.$t("forms.client.placeholders.reference")},model:{value:e.reference,callback:function(n){e.reference=n},expression:"reference"}})],1),r("CField",{staticStyle:{"margin-bottom":"1.5rem"},attrs:{validator:e.$v.email,messages:e.messages.email,label:e.$t("email").capitalize(),"label-position":"inside"}},[r("CInput",{ref:"email",attrs:{placeholder:e.$t("email").capitalize()},model:{value:e.email,callback:function(n){e.email=typeof n=="string"?n.trim():n},expression:"email"}})],1),r("CPhoneInput",{ref:"cellphone",staticStyle:{"margin-bottom":"1.5rem"},attrs:{label:e.$t("cellphone").capitalize(),placeholder:e.$t("forms.client.placeholders.cellphone"),region:e.cellphoneRegion,"default-region":e.companyRegion,"label-position":"inside"},on:{"update:region":function(n){e.cellphoneRegion=n}},model:{value:e.cellphone,callback:function(n){e.cellphone=n},expression:"cellphone"}}),e.documentRole?r("CDropdown",{staticStyle:{"margin-bottom":"1rem"},attrs:{expanded:""}},[r("CButton",{staticClass:"is-left",staticStyle:{width:"100%"},attrs:{slot:"trigger","dropdown-icon":!0,"icon-props":{stroke:"hsl(0, 0%, 50%)"},"icon-left":e.documentRole==="signee"?"pen-tool":"eye",type:"none",pattern:"secondary"},slot:"trigger"},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`_common:documentRole.${e.documentRole}.label`))+" ")])])]),e._l(["signee","recipient","approver"],function(n){return r("CDropdownItem",{key:n,attrs:{"icon-left":n==="signee"?"pen-tool":"eye","icon-props":{stroke:"hsl(0, 0%, 50%)"}},on:{click:function(a){return e.$emit("update:document-role",n)}}},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`_common:documentRole.${n}.description`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`_common:documentRole.${n}.label`))+" ")])])])})],2):e._e(),r("CButton",{attrs:{type:"secondary",pattern:"tertiary",size:"small","icon-left":"arrow-right"},on:{click:function(n){return e.$emit("show-more")}}},[e._v(" "+e._s(e.$t("forms.client.showMore").capitalize())+" ")]),r("CButton",{staticStyle:{margin:"1em 0 0 0"},attrs:{loading:e.isPosting,"native-type":"submit",type:"secondary",wide:"",size:"medium"}},[e._v(" "+e._s(e.$t(`_common:${e.id?"save":"add"}`,{thing:e.$t("_common:recipient")}))+" ")])],1):r("div",{class:{"column-only":e.windowWidth<=450}},[r("div",{staticClass:"flex items-center justify-center",staticStyle:{"margin-bottom":"2.5rem"}},[r("CField",[r("CRadioButton",{attrs:{"native-value":"individual",type:"secondary",size:"normal"},model:{value:e.type,callback:function(n){e.type=n},expression:"type"}},[e._v(" "+e._s(e.$t("forms.client.individual"))+" ")]),r("CRadioButton",{attrs:{"native-value":"company",type:"secondary",size:"normal"},model:{value:e.type,callback:function(n){e.type=n},expression:"type"}},[e._v(" "+e._s(e.$t("_common:company").capitalize())+" ")])],1)],1),r("CField",{staticClass:"flex",attrs:{grouped:""}},[r("CField",{attrs:{label:e.isIndivid?e.$t("name").capitalize():e.$t("company").capitalize(),validator:e.$v.name,messages:e.messages.name,"label-position":"inside",expanded:""}},[r("ClientAutocomplete",{ref:"name",attrs:{placeholder:e.isIndivid?e.$t("forms.client.placeholders.name"):e.$t("forms.client.placeholders.companyName"),"show-loading":!0,"search-enabled":e.searchEnabled,size:"medium"},on:{setClient:function(n){return e.$emit("setClient",n)}},model:{value:e.name,callback:function(n){e.name=n},expression:"name"}})],1),r("CField",{attrs:{label:e.isIndivid?e.$t("socialNo").capitalize():e.$t("orgNoShort").capitalize(),validator:e.$v.orgNo,messages:e.isIndivid?e.messages.orgNo:e.messages.realOrgNo,"label-position":"inside",expanded:""}},[r("CInput",{ref:"orgNo",attrs:{placeholder:e.isIndivid?e.$t("forms.client.placeholders.socialNo"):e.$t("forms.client.placeholders.orgNo"),size:"medium"},model:{value:e.orgNo,callback:function(n){e.orgNo=n},expression:"orgNo"}})],1)],1),e.type?r("transition",{attrs:{css:!1},on:{"before-enter":e.beforeEnter,enter:e.enter,leave:e.leave}},[e.isIndivid?e._e():r("CField",{attrs:{validator:e.$v.reference,messages:e.messages.reference,label:e.$t("reference").capitalize(),"label-position":"inside"}},[r("CInput",{ref:"reference",attrs:{placeholder:e.$t("forms.client.placeholders.reference"),size:"medium"},model:{value:e.reference,callback:function(n){e.reference=n},expression:"reference"}})],1)],1):e._e(),e.type?r("transition",{attrs:{css:!1},on:{"before-enter":e.beforeEnter,enter:e.enter,leave:e.leave}},[!e.isIndivid&&e.feature("reverseVat")&&e.feature("regionSE")?r("CField",{staticStyle:{"padding-left":"1em","margin-bottom":"2rem"}},[r("CCheckbox",{attrs:{size:"normal"},model:{value:e.reverseVat,callback:function(n){e.reverseVat=n},expression:"reverseVat"}},[e._v(" "+e._s(e.$t("vat.reverseVat"))+" ")])],1):e._e()],1):e._e(),r("CField",{staticClass:"flex",attrs:{grouped:""}},[r("CField",{attrs:{validator:e.$v.email,messages:e.messages.email,label:e.$t("email").capitalize(),"label-position":"inside",expanded:""}},[r("CInput",{ref:"email",attrs:{placeholder:e.$t("email").capitalize(),size:"medium"},model:{value:e.email,callback:function(n){e.email=typeof n=="string"?n.trim():n},expression:"email"}})],1),r("CPhoneInput",{staticStyle:{"margin-bottom":"1.5rem"},attrs:{label:e.$t("cellphone").capitalize(),placeholder:e.$t("forms.client.placeholders.cellphone"),region:e.cellphoneRegion,"default-region":e.companyRegion,"label-position":"inside",size:"medium"},on:{"update:region":function(n){e.cellphoneRegion=n}},model:{value:e.cellphone,callback:function(n){e.cellphone=n},expression:"cellphone"}})],1),r("CField",{attrs:{label:e.$t("address").capitalize(),"label-position":"inside"}},[r("CInput",{ref:"street",attrs:{placeholder:e.$t("forms.client.placeholders.address")},model:{value:e.street,callback:function(n){e.street=n},expression:"street"}})],1),r("CField",{staticClass:"flex force-two",attrs:{grouped:""}},[r("CField",{attrs:{expanded:""}},[r("CInput",{ref:"zip",attrs:{placeholder:e.$t("zip").capitalize(),size:"medium"},model:{value:e.zip,callback:function(n){e.zip=n},expression:"zip"}})],1),r("CField",{attrs:{expanded:""}},[r("CInput",{ref:"city",attrs:{placeholder:e.$t("city").capitalize(),size:"medium"},model:{value:e.city,callback:function(n){e.city=n},expression:"city"}})],1)],1),r("CField",{staticClass:"flex"},[r("CRadio",{staticStyle:{"margin-bottom":"0.5em"},attrs:{"native-value":!1,type:"secondary",size:"normal"},model:{value:e.separateWorkAddress,callback:function(n){e.separateWorkAddress=n},expression:"separateWorkAddress"}},[e._v(" "+e._s(e.$t("forms.client.seperateWorkAddress.false"))+" ")]),r("CRadio",{staticStyle:{"margin-bottom":"0.5em"},attrs:{"native-value":!0,type:"secondary",size:"normal"},model:{value:e.separateWorkAddress,callback:function(n){e.separateWorkAddress=n},expression:"separateWorkAddress"}},[e._v(" "+e._s(e.$t("forms.client.seperateWorkAddress.true"))+" ")])],1),e.type?r("transition",{attrs:{css:!1},on:{"before-enter":e.beforeEnter,enter:e.enter,leave:e.leave}},[e.separateWorkAddress?r("div",{staticStyle:{"margin-top":"1rem"}},[r("CField",{attrs:{label:e.$t("addressWork").capitalize()+` ( ${e.$t("forms.client.workAddressSubLabel")} )`}},[r("CInput",{ref:"workStreet",attrs:{placeholder:e.$t("forms.client.placeholders.address"),size:"medium"},model:{value:e.workStreet,callback:function(n){e.workStreet=n},expression:"workStreet"}})],1),r("CField",{staticClass:"flex force-two",attrs:{grouped:""}},[r("CField",{attrs:{expanded:""}},[r("CInput",{ref:"workZip",attrs:{placeholder:e.$t("zip").capitalize(),size:"medium",expanded:""},model:{value:e.workZip,callback:function(n){e.workZip=n},expression:"workZip"}})],1),r("CField",{attrs:{expanded:""}},[r("CInput",{ref:"workCity",attrs:{placeholder:e.$t("city").capitalize(),size:"medium",expanded:""},model:{value:e.workCity,callback:function(n){e.workCity=n},expression:"workCity"}})],1)],1)],1):e._e()]):e._e(),e.documentRole||e.answerMethod?r("CField",{staticClass:"flex pt-4",attrs:{grouped:""}},[e.documentRole?r("div",{staticClass:"dropdown-field-wrapper"},[r("div",{staticClass:"text-sm text-gray-600 my-1"},[e._v(" "+e._s(e.$t("_common:documentRole.title"))+" ")]),r("CDropdown",{staticStyle:{"margin-bottom":"1rem"},attrs:{expanded:""}},[r("CButton",{staticClass:"is-left",staticStyle:{width:"100%"},attrs:{slot:"trigger","dropdown-icon":!0,"icon-props":{stroke:"hsl(0, 0%, 50%)"},"icon-left":e.documentRole==="signee"?"pen-tool":"eye",type:"none",pattern:"secondary"},slot:"trigger"},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`_common:documentRole.${e.documentRole}.label`))+" ")])])]),e._l(["signee","recipient","approver"],function(n){return r("CDropdownItem",{key:n,attrs:{"icon-left":n==="signee"?"pen-tool":"eye","icon-props":{stroke:"hsl(0, 0%, 50%)"}},on:{click:function(a){return e.$emit("update:document-role",n)}}},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`_common:documentRole.${n}.description`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`_common:documentRole.${n}.label`))+" ")])])])})],2)],1):e._e(),e.answerMethod?r("div",{staticClass:"dropdown-field-wrapper"},[r("div",{staticClass:"text-sm text-gray-600 my-1"},[e._v(" "+e._s(e.$t("_common:signMethod.title"))+" ")]),r("CDropdown",{staticStyle:{"margin-bottom":"1rem"},attrs:{expanded:""}},[r("CButton",{staticClass:"is-left",attrs:{slot:"trigger","dropdown-icon":!0,type:"none",pattern:"secondary",wide:""},slot:"trigger"},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`components:account.documentForm.send.signMethod.${e.answerMethod.accept}.title`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`components:account.documentForm.send.signMethod.${e.answerMethod.accept}.content`))+" ")])])]),e._l([...!e.isPublicForm&&e.feature("bankId")?["bankId"]:[],"signature","inPerson"],function(n){return r("CDropdownItem",{key:n,on:{click:function(a){return e.$emit("update:answer-method",{...e.answerMethod,accept:n})}}},[r("div",{staticStyle:{"line-height":"1.25",padding:"4px 0"}},[r("div",[e._v(e._s(e.$t(`components:account.documentForm.send.signMethod.${n}.title`)))]),r("div",{staticStyle:{"font-size":"12px",opacity:"0.7"}},[e._v(" "+e._s(e.$t(`components:account.documentForm.send.signMethod.${n}.content`))+" ")])])])})],2)],1):e._e()]):e._e(),r("div",{staticStyle:{"margin-top":"3rem"}},[r("CButton",{attrs:{loading:e.isPosting,type:"secondary",wide:"",size:"medium"},on:{click:e.validateForm}},[e._v(e._s(e.$t("_common:save",{thing:e.$t("_common:recipient")})))])],1)],1)])},_ot=[],bot=$e(got,yot,_ot,!1,null,"b069851b",null,null);const wot=bot.exports,mmt="",{mapFields:xot}=xV({getterType:"forms/getField",mutationType:"forms/updateField"}),kot={name:"ClientModal",i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.clients"},components:{FormClient:wot},props:{documentClientIndex:{type:Number,default:0},signOrder:{type:Number,default:0},inputFocusOnMount:{type:String,default:""},forceExpand:{type:Boolean,default:!1},isPublicForm:{type:Boolean,default:!1}},data(){return{storedNewClient:{documentRole:"signee",answerMethod:{accept:"signature",deny:"button"}},isLoading:!1,hasChanged:!1,showMore:!1}},computed:{...xot({endCustomer:"endCustomer"}),...e6("forms",{formData:t=>t.document2}),isFullScreen(){return this.$mq==="sm"||this.showMore}},created(){this.forceExpand&&(this.showMore=!0);const t=te(this.formData,`clients[${this.documentClientIndex}]`,{});this.loadForm(t),["endCustomer","storedNewClient"].forEach(e=>this.$watch(e,{deep:!0,handler(){this.hasChanged=!0}}))},methods:{...Ky({saveClient:Oe.FORM_SUBMIT_ENDCUSTOMER,setFormValue:Oe.SET_FORM_VALUE,showMessage:Oe.SHOW_MESSAGE}),loadForm(t={}){this.storedNewClient=Object.assign(this.storedNewClient,t),this.endCustomer=gx({type:this.$brand==="cling"?"individual":"company",...t})},async onSave(){this.isLoading=!0;let t=te(this.endCustomer,"id");if(!this.isPublicForm){let e=!1;this.endCustomer&&(this.endCustomer.id?this.can("endCustomers","modify",this.endCustomer.id)&&(e=!0):this.can("endCustomers","create")&&(e=!0)),e&&(t=await this.saveClient())}this.setFormValue({key:`document2.clients[${this.documentClientIndex}]`,value:vx({...this.endCustomer,...t&&{id:t}},{...this.storedNewClient,signOrder:this.signOrder})}),this.$emit("close"),this.isLoading=!1},close(){return!this.hasChanged||!this.showMore?this.$emit("close"):this.showMessage({displayType:"dialog",type:"danger",title:this.$t("unsavedDialog.title"),message:this.$t("unsavedDialog.message"),actions:{cancel:{text:this.$t("unsavedDialog.cancel"),callback:"cancel"},submit:{text:this.$t("unsavedDialog.submit"),callback:()=>this.$emit("close")}}})}}};var Pot=function(){var e=this,r=e._self._c;return r("div",{staticClass:"font-inter",class:{"full-screen":e.isFullScreen,"modal-overlay":!0},on:{"&click":function(n){return n.target!==n.currentTarget?null:e.close.apply(null,arguments)}}},[r("div",{staticClass:"modal-container",style:!e.isFullScreen&&{padding:"3rem"}},[e.isFullScreen?r("CButton",{staticClass:"modal-close",attrs:{pattern:"tertiary",type:"none",circle:"",icon:"x"},on:{click:e.close}}):e._e(),r("FormClient",{staticClass:"modal-main",attrs:{"search-enabled":!0,"require-reference":!1,"simple-form":!e.showMore,"input-focus-on-mount":e.inputFocusOnMount,"document-role":e.storedNewClient.documentRole,"answer-method":e.storedNewClient.answerMethod,"is-public-form":e.isPublicForm},on:{"update:documentRole":function(n){return e.$set(e.storedNewClient,"documentRole",n)},"update:document-role":function(n){return e.$set(e.storedNewClient,"documentRole",n)},"update:answerMethod":function(n){return e.$set(e.storedNewClient,"answerMethod",n)},"update:answer-method":function(n){return e.$set(e.storedNewClient,"answerMethod",n)},setClient:function(n){return e.loadForm(n)},submit:e.onSave,"show-more":function(n){e.showMore=!0}}})],1)])},Tot=[],Mot=$e(kot,Pot,Tot,!1,null,"5ca23472",null,null);const vK=Mot.exports,pmt="",Sot={name:"ClientSendListItem",props:{client:{type:Object,default:()=>({})},isOrder:{type:Boolean,default:!1},isSender:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},data(){return{isHover:!1,isDropdownOpen:!1}}};var Oot=function(){var n;var e=this,r=e._self._c;return r("div",{staticClass:"rc-card flex items-center",class:{"is-hover":e.isHover,"has-controls":e.isOrder},staticStyle:{"padding-left":"8px"},on:{click:function(a){e.isSender?e.$refs.dropdown.toggle():e.$emit("open")},"&mouseover":function(a){e.isHover=!0},"&mouseleave":function(a){e.isHover=!1}}},[e.compact?r("div",{staticStyle:{"font-size":"14px"}},[r("div",[e._v(e._s(e.client.name||e.client.companyName))]),e.client.name&&e.client.companyName?r("div",{staticStyle:{"font-size":"12px","font-weight":"500"}},[e._v(" "+e._s(e.client.companyName)+" ")]):e._e(),e.client.documentRole?r("div",{staticClass:"text-gray-700",staticStyle:{"font-size":"13px","margin-top":"4px"}},[e._v(" "+e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`))+" ")]):e._e(),e.isOrder?r("div",{staticClass:"compact-order"},[r("BaseIcon",{staticClass:"compact-order-button",attrs:{size:"16",type:"chevron-up"},on:{click:function(a){return a.preventDefault(),a.stopPropagation(),e.$emit("move",-1)}}}),r("div",{staticClass:"rc-order",staticStyle:{width:"20px",height:"20px"}},[e._v(" "+e._s(e.client.signOrder)+" ")]),r("BaseIcon",{staticClass:"compact-order-button",attrs:{size:"16",type:"chevron-down"},on:{click:function(a){return a.preventDefault(),a.stopPropagation(),e.$emit("move",1)}}})],1):e._e()]):[r("div",{staticStyle:{width:"34px",flex:"0 0 34px",display:"inline-flex","justify-content":"center"}},[e.isOrder?r("div",{staticStyle:{position:"relative",display:"inline-block"}},[r("CButton",{staticClass:"rc-order__button up",attrs:{type:"none",pattern:"primary",circle:"",raised:"",size:"small",icon:"minus"},on:{click:function(a){return a.preventDefault(),a.stopPropagation(),e.$emit("move",-1)}}}),r("CButton",{staticClass:"rc-order__button down",attrs:{type:"none",pattern:"primary",circle:"",raised:"",size:"small",icon:"plus"},on:{click:function(a){return a.preventDefault(),a.stopPropagation(),e.$emit("move",1)}}}),r("div",{staticClass:"rc-order"},[e._v(" "+e._s(e.client.signOrder)+" ")])],1):r("BaseIcon",{staticClass:"text-primary-500",staticStyle:{"margin-right":"8px",flex:"0 0 18px"},attrs:{type:e.isSender?"send":["signee","approver"].includes(e.client.documentRole)?"pen-tool":"eye",size:"18"}})],1),r("div",{staticClass:"rc-data truncate-text"},[e.client.name||e.client.companyName?r("div",{staticStyle:{"font-weight":"500"}},[e._v(" "+e._s(e.client.name||e.client.companyName)+" ")]):e.isSender?r("div",{staticClass:"text-gray-500"},[e._v(" "+e._s(e.$t("_common:empty",{thing:e.$t("_common:reference")}))+" ")]):e._e(),r("div",{staticClass:"text-gray-700",staticStyle:{"font-size":"12px"}},[e.isSender?[e.isSender?r("span",[e._v(" "+e._s(e.$t("_common:documentRole.sender.description"))+" ")]):e._e(),e.client.documentRole==="signee"?r("span",[e._v(" "+e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`))+" ")]):e._e()]:[((n=e.client.answerMethod)==null?void 0:n.accept)==="inPerson"?r("span",{staticStyle:{"font-size":"13px",color:"hsla(360, 100%, 60%, 0.7)"}},[e._v(" "+e._s(e.$t("_common:signMethod.title"))+": "),r("span",[e._v(" "+e._s(e.$t("_common:signMethod.inPerson"))+" ")])]):e._e(),e.client.documentRole?r("span",[e._v(" "+e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`))+" ")]):e._e(),e.client.email?r("span",[e._v(e._s(e.client.email))]):e._e(),e.client.cellphone?r("span",[e._v(e._s(e.client.cellphone))]):e._e()]],2)])],r("transition",{attrs:{name:"fade-100"}},[e.isHover||e.isDropdownOpen?[e.isSender?r("CDropdown",{ref:"dropdown",staticStyle:{position:"absolute",right:"0.5rem"},attrs:{position:"is-bottom-left","menu-styling":{width:"220px"}},on:{"active-change":function(a){e.isDropdownOpen=a}},nativeOn:{click:function(a){a.stopPropagation()}}},[r("CButton",{attrs:{slot:"trigger",circle:"",size:"small",type:"none",pattern:"secondary",raised:"",icon:"more-horizontal"},slot:"trigger"}),e._t("dropdownOptions")],2):r("CButton",{staticStyle:{position:"absolute",right:"0.5rem"},attrs:{circle:"",size:"small",icon:"x",type:"none",pattern:"secondary",raised:""},on:{click:function(a){return a.stopPropagation(),e.$emit("remove")}}})]:e._e()],2)],2)},Eot=[],Dot=$e(Sot,Oot,Eot,!1,null,"8b323de6",null,null);const gK=Dot.exports,hmt="",Cot={name:"SenderBlockItem",i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.send.senderItem"},components:{RecipientBlockItem:gK},mixins:[dc(["senderClient"],{useEmit:!1,setFnName:"setFormValue"})],props:{setFormValue:{type:Function,required:!0},defaultAddSenderClient:{type:Boolean,default:!1}},data(){return{senderClientData:null}},computed:{...Gd({feature:"application/feature"})},created(){this.generateSenderClient(),this._document.id||this._document.isDirty("senderClient")?this.toggleSenderSign(!!this.senderClient):this.defaultAddSenderClient&&this.toggleSenderSign(!0)},methods:{get:te,generateSenderClient(){const{company:t,user:e}=this._document.sender||{},r=te(this._document,"data.defaultAnswerMethod");this.senderClientData={...hx(),documentRole:"recipient",...r&&{answerMethod:r},...this.senderClient,type:"company",companyName:t.name,name:e.name,email:e.email,cellphone:e.cellphone}},toggleSenderSign(t){this.senderClientData.documentRole=t?"signee":"recipient",this.senderClient=t?this.senderClientData:null,this._document.setDirty("senderClient")},setSenderMethod(t){const e={...this.senderClient,answerMethod:{accept:t,deny:"button"}};this.senderClient=e,this.senderClientData={...e}}}};var $ot=function(){var e=this,r=e._self._c;return e.senderClientData?r("RecipientBlockItem",{staticClass:"first-of-group last-of-group",staticStyle:{display:"inline-flex",width:"auto","padding-right":"2em","min-width":"220px"},attrs:{client:e.senderClientData,"is-sender":!0}},[r("template",{slot:"dropdownOptions"},[r("CDropdownItem",{attrs:{value:!!e.senderClient,"close-on-click":!1,toggle:""},on:{input:e.toggleSenderSign}},[e._v(" "+e._s(e.$t("toggle.label"))+" ")]),e.senderClient?[r("CDropdownItem",{attrs:{separator:""}}),r("div",{staticClass:"has-text-grey",staticStyle:{"font-size":"13px",padding:"0.5rem 0 0.25rem 1rem","font-weight":"500"}},[e._v(" "+e._s(e.$t("_common:signMethod.title"))+" ")]),e._l(["login","signature",...e.feature("bankId")?["bankId"]:[]],function(n){return r("CDropdownItem",{key:n,attrs:{"icon-right":e.get(e.senderClient,"answerMethod.accept")===n?"check":""},on:{click:function(a){return e.setSenderMethod(n)}}},[e._v(" "+e._s(e.$t(`_common:signMethod.${n}`))+" ")])})]:r("div",{staticClass:"has-background-grey-lightest-2 has-text-grey-darker",staticStyle:{padding:"0.5rem",margin:"0.5rem","font-size":"13px","border-radius":"4px","line-height":"1.25","font-weight":"500"}},[e._v(" "+e._s(e.$t("toggle.description"))+" ")])],2)],2):e._e()},Aot=[],Rot=$e(Cot,$ot,Aot,!1,null,"503a2933",null,null);const Iot=Rot.exports,vmt="",Not={name:"RecipientBlock",i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.send"},components:{AddClientCallout:Sit,ClientModal:vK,RecipientBlockItem:gK,SenderBlockItem:Iot},mixins:[dc(["clients"],{useEmit:!1,setFnName:"setFormValue"})],props:{compact:{type:Boolean,default:!1},setFormValue:{type:Function,required:!0},removeFormValue:{type:Function,required:!0},defaultAddSenderClient:{type:Boolean,default:!1},isPublicForm:{type:Boolean,default:!1}},computed:{sortedClients(){return[...this.clients].map((t,e)=>({...t,index:e})).sort((t,e)=>t.signOrder-e.signOrder)},maxSignOrder(){if(!this.useSignOrder||this.sortedClients.length===0)return 0;const{signOrder:t}=this.sortedClients[this.sortedClients.length-1];return t},useSignOrder(){return te(this._document,"useSignOrder",!1)}},methods:{onMoveRecipient({index:t,direction:e}){this.clients=pme(this.clients).set({...this.clients[t],signOrder:Math.max(this.clients[t].signOrder+e,0)},t)},toggleSignOrder(t){let e=[];if(t){const r=!this.clients.every(({signOrder:n})=>!n);this.clients=this.clients.map((n,a)=>({...n,signOrder:r?n.signOrder:a+1}))}else e=te(this._document,"template.reminders",[]),e.length||(e=rd.default);this.setFormValue({key:"data.reminders",value:e}),this.setFormValue({key:"useSignOrder",value:t})},removeClient(t){this.removeFormValue(`clients[${t}]`)},openClientModal(t=0){const e=te(this,`clients[${t}].signOrder`);this.$modal.show(vK,{documentClientIndex:t,...this.useSignOrder&&{signOrder:ot(e)==="number"?e:this.maxSignOrder+1},isPublicForm:this.isPublicForm})},setClient(t){this.setFormValue({key:`clients[${this.clients.length}]`,value:t})}}};var Lot=function(){var e=this,r=e._self._c;return r("div",[e.compact?e._e():[r("div",{staticClass:"text-gray-500",staticStyle:{"font-size":"13px","font-weight":"500","padding-bottom":"3px"}},[e._v(" "+e._s(e.$t("_common:from").capitalize())+": ")]),r("SenderBlockItem",{attrs:{_document:e._document,_value:{senderClient:"senderClient"},"set-form-value":e.setFormValue,"default-add-sender-client":e.defaultAddSenderClient}})],r("div",{staticClass:"block-title flex text-gray-500",class:{"block-title__line":!e.compact},staticStyle:{"padding-bottom":"3px"}},[e.compact?e._e():r("div",{staticClass:"text-gray-500",staticStyle:{"font-size":"13px","font-weight":"500"}},[e._v(" "+e._s(e.$t("_common:to").capitalize())+": ")]),e.clients&&e.clients.length?r("div",{staticStyle:{display:"inline-flex","align-items":"center","justify-content":"flex-end","margin-left":"auto"}},[r("BaseIcon",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.$t("signOrder.tooltip"),expression:"$t('signOrder.tooltip')"}],staticStyle:{"margin-right":"0.3rem"},attrs:{type:"info",size:"16"}}),r("div",{staticStyle:{"margin-right":"0.3rem","font-size":"13px","font-weight":"500"}},[e._v(" "+e._s(e.$t("signOrder.label"))+" ")]),r("CSwitch",{staticStyle:{"margin-right":"0"},attrs:{value:e.useSignOrder,size:"tiny",type:"success"},on:{input:e.toggleSignOrder}})],1):e._e()]),e.clients&&e.clients.length?[e.useSignOrder?r("transition-group",{staticClass:"list-move",attrs:{name:"list-move"}},[e._l(e.sortedClients,function(n,a){return[a>0&&n.signOrder!==e.sortedClients[a-1].signOrder?r("div",{key:a,staticClass:"recipient-divider"},[r("div",{staticClass:"recipient-divider__line"})]):e._e(),r("div",{key:n._uniqueId,staticStyle:{padding:"1px 0"}},[r("RecipientBlockItem",{class:{"first-of-group":a===0||a>0&&n.signOrder!==e.sortedClients[a-1].signOrder,"last-of-group":a===e.sortedClients.length-1||e.sortedClients[a+1]&&n.signOrder!==e.sortedClients[a+1].signOrder},attrs:{client:n,"is-order":e.useSignOrder,compact:e.compact},on:{move:function(o){return e.onMoveRecipient({index:n.index,direction:o})},open:function(o){return e.openClientModal(n.index)},remove:function(o){return e.removeClient(n.index)}}})],1)]})],2):e._l(e.clients,function(n,a){return r("RecipientBlockItem",{key:n._uniqueId,class:{"first-of-group":a===0,"last-of-group":a===e.clients.length-1},staticStyle:{"margin-bottom":"3px"},attrs:{"is-order":e.useSignOrder,compact:e.compact,client:n},on:{open:function(o){return e.openClientModal(a)},remove:function(o){return e.removeClient(a)}}})}),e.compact?e._e():r("CButton",{staticClass:"is-thinner",staticStyle:{"font-size":"14px"},attrs:{type:"secondary",pattern:"tertiary","icon-left":"plus",size:"normal"},on:{click:function(n){return e.openClientModal(e.clients.length)}}},[e._v(" "+e._s(e.$t("_common:add",{thing:e.$t("_common:recipient")}))+" ")])]:e.compact?e._e():r("AddClientCallout",{attrs:{compact:!0},on:{add:function(n){return e.openClientModal(e.clients.length)},setClient:e.setClient}})],2)},Wot=[],Fot=$e(Not,Lot,Wot,!1,null,"ba73323c",null,null);const jot=Fot.exports,gmt="",Vot={name:"SendForm",i18nOptions:{namespaces:"components",keyPrefix:"account.documentForm.send"},components:{Simplebar:det,BaseDatePicker:KG,RecipientBlock:jot,ErrorCallout:Dat},mixins:[dc(["expiresAt","clients","defaultAnswerMethod","reminders","name"],{useEmit:!1,setFnName:"setFormValue"})],props:{setFormValue:{type:Function,required:!0},removeFormValue:{type:Function,required:!0},useScroll:{type:Boolean,default:!1},addMissingAnswerMethod:{type:Boolean,default:!1},onSendDocument:{type:Function,default:null}},data(){return{localIsPosting:!1,clientHoverIndex:null}},computed:{...Gd({deliveryTypes:"forms/deliveryTypes",isPostingDocument:"documents2/isPosting",isPostingProject:"projects/isPosting",documentSenderSign:"settings/documentSenderSign",getCompanySetting:"settings/getCompanySetting",feature:"application/feature"}),isPosting(){return this.isPostingDocument||this.isPostingProject||this.localIsPosting},isPublicForm(){return!!(this.viewSettings&&this.viewSettings.isPublicForm)},useSignOrder(){var t;return((t=this._document)==null?void 0:t.useSignOrder)||!1},noOfReminders(){return Object.values(this.reminders||[]).reduce((t,e)=>e&&(e.sendDays||e.sendAt)&&e.type!=="first"?t+1:t,0)},smsActivated(){return this.deliveryTypes.sms},emailActivated(){return this.deliveryTypes.email},isManualDelivery(){return!this.smsActivated&&!this.emailActivated},sendTypesText(){return this.emailActivated||this.smsActivated?[...this.emailActivated?[this.$t("_common:email").capitalize()]:[],...this.smsActivated?[this.$t("_common:sms")]:[]].join(" & "):this.$t("manualDelivery")},clientsAreMissingContactInfo(){return this.clients.some(t=>!(t.email||t.cellphone))},signMethods(){return[...this.feature("bankId")?[{value:"bankId",title:this.$t("signMethod.bankId.title"),content:this.$t("signMethod.bankId.content")}]:[],{value:"signature",title:this.$t("signMethod.signature.title"),content:this.$t("signMethod.signature.content")}]}},created(){var t;if(!this.expiresAt&&!this._document.isDirty("expiresAt")){const e=this.getCompanySetting("defaultExpireDays");if(e&&Number.isInteger(e)&&e>0){const r=new Date;r.setDate(r.getDate()+e),this.setField({field:"expiresAt",value:r.toISOString(),options:{ignoreChanges:!0}})}}this.addMissingAnswerMethod&&!this.defaultAnswerMethod&&(this.defaultAnswerMethod={accept:"signature",deny:"button"}),((t=this.defaultAnswerMethod)==null?void 0:t.accept)==="button"&&this.setAnswerMethod("signature",{ignoreChanges:!0})},validations:{clients:{required:t=>t&&t.length}},methods:{...Ky({saveDocument:Oe.SAVE_DYNDOC_FORM}),async doSendDocument(){var t;try{if(this.localIsPosting=!0,this.$v.$touch(),this.$v.$invalid)return;typeof this.onSendDocument=="function"&&await this.onSendDocument(),((t=this._document)==null?void 0:t.status)==="denied"&&this.resetDeniedDocument(),await this.saveDocument({doSend:!0})}catch(e){throw e}finally{this.localIsPosting=!1}},setDeliveryMethod(t,e){const r=this.deliveryTypes;r[t]=e;const n=Object.keys(r).filter(a=>r[a]);(this.clients||[]).forEach((a,o)=>{this.setFormValue({key:`clients[${o}].deliveryTypes`,value:n})})},setAnswerMethod(t,e={}){this.setField({field:"defaultAnswerMethod",value:{...this.defaultAnswerMethod,accept:t},options:e}),(this.clients||[]).forEach((r,n)=>{var a;((a=r.answerMethod)==null?void 0:a.accept)!=="inPerson"&&this.setField({key:`clients[${n}].answerMethod.accept`,value:t,options:e})})},openReminders(){this.useSignOrder||this.$modal.show(jat,{_document:this._document,setFormValue:this.setFormValue,removeFormValue:this.removeFormValue},{adaptive:!0,height:"auto",width:"90%",maxWidth:360,scrollable:!0})},openSendLater(){this.$v.$touch(),!this.$v.$invalid&&this.$modal.show(qat,{_document:this._document,setFormValue:this.setFormValue,removeFormValue:this.removeFormValue},{adaptive:!0,height:"auto",width:"90%",maxWidth:360,scrollable:!0})},resetDeniedDocument(){(this.clients||[]).forEach((t,e)=>{this.setFormValue({key:`clients[${e}].answer`,value:null})}),this.setFormValue({key:"data.rejectReasons",value:[]}),this.setFormValue({key:"status",value:"sent"})}}};var zot=function(){var e=this,r=e._self._c;return r("div",{staticStyle:{display:"flex","flex-direction":"column",height:"100%"}},[r(e.useScroll?"Simplebar":"div",{tag:"component",staticClass:"main-container"},[r("div",{staticClass:"main-container__content"},[r("div",{staticStyle:{"font-size":"calc(1em + 4px)","font-weight":"700","padding-bottom":"1rem"}},[e._v(" "+e._s(e.$t("_common:send",{thing:e.$t("_common:document").toLowerCase()}))+" ")]),r("div",{staticClass:"block-spacing",staticStyle:{"margin-bottom":"2rem"}},[r("div",{staticClass:"has-text-grey-darker",staticStyle:{"font-size":"13px","font-weight":"500","padding-bottom":"4px"}},[e._v(" "+e._s(e.$t("_common:documentName"))+" ")]),r("CInput",{attrs:{placeholder:e.$t("_common:name").capitalize(),filled:""},model:{value:e.name,callback:function(n){e.name=n},expression:"name"}})],1),r("div",{staticStyle:{"margin-bottom":"2em"}},[r("RecipientBlock",{attrs:{_value:{clients:"clients"},_document:e._document,"set-form-value":e.setFormValue,"remove-form-value":e.removeFormValue,"default-add-sender-client":e.documentSenderSign,"is-public-form":e.isPublicForm}})],1),e._t("default"),e.defaultAnswerMethod&&e.signMethods.length>1?r("div",{staticClass:"block-spacing",staticStyle:{"margin-bottom":"2rem"}},[r("div",{staticClass:"block-title has-text-grey-dark",staticStyle:{"font-size":"13px","font-weight":"500","padding-bottom":"4px"}},[e._v(" "+e._s(e.$t("signMethod.title"))+" "),r("BaseIcon",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.$t("signMethod.tooltip"),expression:"$t('signMethod.tooltip')"}],staticStyle:{"margin-left":"3px"},attrs:{type:"info",size:"15"}})],1),r("div",{staticClass:"cb-card-group"},e._l(e.signMethods,function(n){return r("div",{key:n.value,staticClass:"cb-card flex",class:{checked:e.defaultAnswerMethod.accept===n.value},on:{click:function(a){e.defaultAnswerMethod.accept!==n.value&&e.setAnswerMethod(n.value)}}},[r("CRadio",{staticStyle:{"margin-right":"0.75em"},attrs:{value:e.defaultAnswerMethod.accept,"native-value":n.value,type:"secondary",size:"small"}}),r("div",{staticClass:"flex-grow"},[r("div",{staticClass:"cb-card-title"},[e._v(e._s(n.title))]),r("div",{directives:[{name:"show",rawName:"v-show",value:e.defaultAnswerMethod.accept===n.value,expression:"defaultAnswerMethod.accept === signMethod.value"}],staticClass:"cb-card-body"},[e._v(" "+e._s(n.content)+" ")])])],1)}),0)]):e._e(),r("div",{staticClass:"block-spacing",staticStyle:{display:"grid","align-items":"center","grid-template-columns":"repeat(auto-fit, minmax(200px, 1fr))","grid-gap":"1em"}},[r("div",[r("BaseDatePicker",{staticClass:"psuedo-input",staticStyle:{position:"relative"},attrs:{"custom-el":!0,direction:"end",tabindex:"0"},model:{value:e.expiresAt,callback:function(n){e.expiresAt=n},expression:"expiresAt"}},[r("div",{staticClass:"psuedo-input-label"},[e._v(e._s(e.$t("validityPeriod")))]),r("div",[e._v(e._s(e.expiresAt?e.$formatDate(e.expiresAt):e.$t("_common:disabled").capitalize()))]),e.expiresAt?r("CButton",{staticStyle:{position:"absolute",right:"1em",top:"1em"},attrs:{icon:"x",size:"small",type:"none",pattern:"secondary"},on:{click:function(n){n.preventDefault(),n.stopPropagation(),e.expiresAt=void 0,e._document.setDirty("expiresAt")}}}):e._e()],1)],1),r("CDropdown",{staticStyle:{flex:"1 0 200px"},attrs:{"mobile-label":e.$t("sendAs"),expanded:""}},[r("div",{staticClass:"psuedo-input",attrs:{slot:"trigger",tabindex:"0"},slot:"trigger"},[r("div",{staticClass:"psuedo-input-label"},[e._v(e._s(e.$t("sendAs")))]),r("div",[e._v(" "+e._s(e.sendTypesText)+" ")])]),r("CDropdownItem",{attrs:{value:e.emailActivated,"close-on-click":!1,toggle:""},on:{click:function(n){return e.setDeliveryMethod("email",!e.emailActivated)}}},[e._v(" "+e._s(e.$t("_common:email").capitalize())+" ")]),e.feature("sms")?r("CDropdownItem",{attrs:{value:e.smsActivated,"close-on-click":!1,toggle:""},on:{click:function(n){return e.setDeliveryMethod("sms",!e.smsActivated)}}},[e._v(" "+e._s(e.$t("_common:sms"))+" ")]):e._e(),r("CDropdownItem",{attrs:{value:"",tooltip:{content:e.$t("manualDeliveryTooltip")}},domProps:{textContent:e._s(e.$t("manualDelivery"))},on:{click:()=>{e.setDeliveryMethod("sms",!1),e.setDeliveryMethod("email",!1)}}})],1),!e.useSignOrder&&!e.isManualDelivery?r("div",{staticClass:"psuedo-input",staticStyle:{position:"relative"},attrs:{tabindex:"0"},on:{click:e.openReminders}},[r("div",{staticClass:"psuedo-input-label"},[e._v(e._s(e.$t("_common:reminder_plural").capitalize()))]),r("div",[e._v(" "+e._s(e.noOfReminders?`${e.noOfReminders} ${e.$i18n.lang==="sv"?e.$t("_common:unitType.unit"):""}`:e.$t("_common:disabled").capitalize())+" ")]),e.noOfReminders?r("CButton",{staticStyle:{position:"absolute",right:"1em",top:"1em"},attrs:{icon:"x",size:"small",type:"none",pattern:"secondary"},on:{click:function(n){n.preventDefault(),n.stopPropagation(),e.reminders=[]}}}):e._e()],1):e._e()],1),e.clientsAreMissingContactInfo&&!e.isManualDelivery?r("ErrorCallout",{staticStyle:{"margin-bottom":"-2rem"},attrs:{message:e.$t("clientsAreMissingContactInfo"),size:"small"}}):e._e()],2)]),r("div",{staticClass:"footer-container"},[e._t("send",function(){return[r("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.clients.length?null:e.$t("components:account.documentForm.clients.errorMessage"),expression:`!clients.length
|
|
573
573
|
? $t('components:account.documentForm.clients.errorMessage')
|
|
574
574
|
: null
|
|
575
575
|
`}],staticClass:"flex"},[r("CButton",{staticStyle:{padding:"14px 16px","border-radius":"8px",height:"initial","font-size":"14px","font-weight":"600","box-shadow":"0 2px 4px -1px rgba(0,0,0,0.1)"},attrs:{disabled:!e.clients.length,loading:e.isPosting,type:"secondary",wide:""},on:{click:function(n){return e.doSendDocument()}}},[e._v(" "+e._s(e.$t("_common:send",{thing:e.$t("_common:document").toLowerCase()}))+" ")]),!e.useSignOrder&&!e.isManualDelivery?r("CButton",{staticStyle:{padding:"14px 16px","border-radius":"8px",height:"initial","font-size":"14px","font-weight":"600","margin-left":"4px"},attrs:{disabled:e.isPosting||!e.clients.length,type:"none",pattern:"tertiary"},on:{click:e.openSendLater}},[e._v(" "+e._s(e.$t("scheduledTooltip"))+" ")]):e._e()],1)]}),e._t("footer")],2)],1)},Uot=[],Hot=$e(Vot,zot,Uot,!1,null,"c7904c68",null,null);const qot=Hot.exports;var Bot=$e({name:"CSkeleton",functional:!0,props:{active:{type:Boolean,default:!0},animated:{type:Boolean,default:!1},width:[Number,String],height:[Number,String],circle:Boolean,rounded:{type:Boolean,default:!0},count:{type:Number,default:1},hidden:{type:[Boolean,String],default:!1},color:{type:String,default:null}},render(t,e){if(!e.props.active)return;const r=[],n=e.props.width,a=e.props.height;for(let o=0;o<e.props.count;o++)r.push(t("div",{staticClass:"c-skeleton-item",class:{"is-rounded":e.props.rounded},key:o,style:{height:a===void 0?null:isNaN(a)?a:a+"px",width:n===void 0?null:isNaN(n)?n:n+"px",borderRadius:e.props.circle?"50%":null,background:e.props.color?e.props.color:null}}));return t("div",{staticStyle:e.data.staticStyle,staticClass:"c-skeleton",class:[e.data.staticClass,{"is-animated":e.props.animated,"is-invisible":e.props.hidden}]},r)}},null,null,!1,null,null,null,null);const yK=Bot.exports;function Yot(t,e){return e.split(".").reduce((n,a)=>n?n[a]:null,t)}function _K(t){typeof t.remove<"u"?t.remove():typeof t.parentNode<"u"&&t.parentNode!==null&&t.parentNode.removeChild(t)}function bK(t){const e=document.createElement("div");e.style.position="absolute",e.style.left="0px",e.style.top="0px";const r=document.createElement("div");return e.appendChild(r),r.appendChild(t),document.body.appendChild(e),e}function xL(t,e,r){return Math.max(e,Math.min(r,t))}const wmt="",Got={name:"CAutocomplete",components:{CInput:lp},mixins:[Yk],inheritAttrs:!1,props:{value:[Number,String],data:{type:Array,default:()=>[]},field:{type:String,default:"value"},keepFirst:Boolean,clearOnSelect:Boolean,openOnFocus:Boolean,customFormatter:Function,checkInfiniteScroll:Boolean,keepOpen:Boolean,clearable:Boolean,maxHeight:[String,Number],dropdownPosition:{type:String,default:"auto"},iconRight:String,iconRightClickable:Boolean,appendToBody:Boolean},data(){return{selected:null,hovered:null,isActive:!1,newValue:this.value,newAutocomplete:this.autocomplete||"off",isListInViewportVertically:!0,hasFocus:!1,style:{},_isAutocomplete:!0,_elementRef:"input",_bodyEl:void 0}},computed:{whiteList(){const t=[];if(t.push(this.$refs.input.$el.querySelector("input")),t.push(this.$refs.dropdown),this.$refs.dropdown!==void 0){const e=this.$refs.dropdown.querySelectorAll("*");for(const r of e)t.push(r)}if(this.$parent.$data._isTaginput){t.push(this.$parent.$el);const e=this.$parent.$el.querySelectorAll("*");for(const r of e)t.push(r)}return t},hasDefaultSlot(){return!!this.$scopedSlots.default},hasEmptySlot(){return!!this.$slots.empty},hasHeaderSlot(){return!!this.$slots.header},hasFooterSlot(){return!!this.$slots.footer},isOpenedTop(){return this.dropdownPosition==="top"||this.dropdownPosition==="auto"&&!this.isListInViewportVertically},newIconRight(){return this.clearable&&this.newValue?"close-circle":this.iconRight},newIconRightClickable(){return this.clearable?!0:this.iconRightClickable},contentStyle(){return{maxHeight:this.maxHeight===void 0?null:isNaN(this.maxHeight)?this.maxHeight:`${this.maxHeight}px`}},isDropdownOpen(){return this.isActive&&(this.data.length>0||this.hasEmptySlot||this.hasHeaderSlot)}},watch:{isActive(t){this.dropdownPosition==="auto"&&(t?this.calcDropdownInViewportVertical():setTimeout(()=>{this.calcDropdownInViewportVertical()},100)),t&&this.$nextTick(()=>this.setHovered(null))},newValue(t){this.$emit("input",t);const e=this.getValue(this.selected);e&&e!==t&&this.setSelected(null,!1),this.hasFocus&&(!this.openOnFocus||t)&&(this.isActive=!!t)},value(t){this.newValue=t},data(t){this.keepFirst&&this.selectFirstOption(t)}},created(){typeof window<"u"&&(document.addEventListener("click",this.clickedOutside),this.dropdownPosition==="auto"&&window.addEventListener("resize",this.calcDropdownInViewportVertical))},mounted(){if(this.checkInfiniteScroll&&this.$refs.dropdown&&this.$refs.dropdown.querySelector(".dropdown-content")){const t=this.$refs.dropdown.querySelector(".dropdown-content");t.addEventListener("scroll",()=>this.checkIfReachedTheEndOfScroll(t))}this.appendToBody&&(this.$data._bodyEl=bK(this.$refs.dropdown),this.updateAppendToBody())},beforeDestroy(){typeof window<"u"&&(document.removeEventListener("click",this.clickedOutside),this.dropdownPosition==="auto"&&window.removeEventListener("resize",this.calcDropdownInViewportVertical)),this.checkInfiniteScroll&&this.$refs.dropdown&&this.$refs.dropdown.querySelector(".dropdown-content")&&this.$refs.dropdown.querySelector(".dropdown-content").removeEventListener("scroll",this.checkIfReachedTheEndOfScroll),this.appendToBody&&_K(this.$data._bodyEl)},methods:{setHovered(t){t!==void 0&&(this.hovered=t)},setSelected(t,e=!0){t!==void 0&&(this.selected=t,this.$emit("select",this.selected),this.selected!==null&&(this.newValue=this.clearOnSelect?"":this.getValue(this.selected),this.setHovered(this.clearOnSelect?null:this.hovered)),e&&this.$nextTick(()=>{this.isActive=!1}),this.checkValidity())},selectFirstOption(t){this.$nextTick(()=>{t.length?(this.openOnFocus||this.newValue!==""&&this.hovered!==t[0])&&this.setHovered(t[0]):this.setHovered(null)})},enterPressed(t){!this.isDropdownOpen||(t.preventDefault(),this.hovered!==null&&this.setSelected(this.hovered,!this.keepOpen))},tabPressed(){if(this.hovered===null){this.isActive=!1;return}this.setSelected(this.hovered,!this.keepOpen)},clickedOutside(t){this.whiteList.indexOf(t.target)<0&&(this.isActive=!1)},getValue(t){if(t!==null)return typeof this.customFormatter<"u"?this.customFormatter(t):typeof t=="object"?Yot(t,this.field):t},checkIfReachedTheEndOfScroll(t){t.clientHeight!==t.scrollHeight&&t.scrollTop+t.clientHeight>=t.scrollHeight&&this.$emit("infinite-scroll")},calcDropdownInViewportVertical(){this.$nextTick(()=>{if(this.$refs.dropdown===void 0)return;const t=this.$refs.dropdown.getBoundingClientRect();this.isListInViewportVertically=t.top>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight),this.appendToBody&&this.updateAppendToBody()})},keyArrows(t){const e=t==="down"?1:-1;if(this.isActive){let r=this.data.indexOf(this.hovered)+e;r=r>this.data.length-1?this.data.length:r,r=r<0?0:r,this.setHovered(this.data[r]);const n=this.$refs.dropdown.querySelector(".dropdown-content"),a=n.querySelectorAll("a.dropdown-item:not(.is-disabled)")[r];if(!a)return;const o=n.scrollTop,i=n.scrollTop+n.clientHeight-a.clientHeight;a.offsetTop<o?n.scrollTop=a.offsetTop:a.offsetTop>=i&&(n.scrollTop=a.offsetTop-n.clientHeight+a.clientHeight)}else this.isActive=!0},focused(t){this.getValue(this.selected)===this.newValue&&this.$el.querySelector("input").select(),this.openOnFocus&&(this.isActive=!0,this.keepFirst&&this.selectFirstOption(this.data)),this.hasFocus=!0,this.$emit("focus",t)},onBlur(t){this.hasFocus=!1,this.$emit("blur",t)},onInput(t){const e=this.getValue(this.selected);e&&e===this.newValue||(this.$emit("typing",this.newValue),this.checkValidity())},rightIconClick(t){this.clearable?this.newValue="":this.$emit("icon-right-click",t)},checkValidity(){this.useHtml5Validation&&this.$nextTick(()=>{this.checkHtml5Validity()})},updateAppendToBody(){const t=this.$refs.dropdown,e=this.$refs.input.$el;if(t&&e){const r=this.$data._bodyEl;r.classList.forEach(i=>r.classList.remove(i)),r.classList.add("autocomplete"),r.classList.add("control"),this.expandend&&r.classList.add("is-expandend");const n=e.getBoundingClientRect();let a=n.top+window.scrollY;const o=n.left+window.scrollX;this.isOpenedTop?a-=t.clientHeight:a+=e.clientHeight,this.style={position:"absolute",top:`${a}px`,left:`${o}px`,width:`${e.clientWidth}px`,maxWidth:`${e.clientWidth}px`,zIndex:"99"}}}}};var Kot=function(){var e=this,r=e._self._c;return r("div",{staticClass:"autocomplete control",class:{"is-expanded":e.expanded}},[r("CInput",e._b({ref:"input",attrs:{size:e.size,loading:e.loading,rounded:e.rounded,icon:e.icon,"icon-right":e.newIconRight,"icon-right-clickable":e.newIconRightClickable,"icon-pack":e.iconPack,maxlength:e.maxlength,autocomplete:e.newAutocomplete,"use-html5-validation":!1,type:"text"},on:{input:e.onInput,focus:e.focused,blur:e.onBlur,"icon-right-click":e.rightIconClick,"icon-click":n=>e.$emit("icon-click",n)},nativeOn:{keyup:function(n){if(!n.type.indexOf("key")&&e._k(n.keyCode,"esc",27,n.key,["Esc","Escape"]))return null;n.preventDefault(),e.isActive=!1},keydown:[function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"tab",9,n.key,"Tab")?null:e.tabPressed.apply(null,arguments)},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.enterPressed.apply(null,arguments)},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"up",38,n.key,["Up","ArrowUp"])?null:(n.preventDefault(),e.keyArrows("up"))},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"down",40,n.key,["Down","ArrowDown"])?null:(n.preventDefault(),e.keyArrows("down"))}]},model:{value:e.newValue,callback:function(n){e.newValue=n},expression:"newValue"}},"CInput",e.$attrs,!1)),r("transition",{attrs:{name:"fade"}},[r("div",{directives:[{name:"show",rawName:"v-show",value:e.isDropdownOpen,expression:"isDropdownOpen"}],ref:"dropdown",staticClass:"dropdown-menu",class:{"is-opened-top":e.isOpenedTop&&!e.appendToBody},style:e.style},[r("div",{directives:[{name:"show",rawName:"v-show",value:e.isActive,expression:"isActive"}],staticClass:"dropdown-content",style:e.contentStyle},[e.hasHeaderSlot?r("div",{staticClass:"dropdown-item"},[e._t("header")],2):e._e(),e._l(e.data,function(n,a){return r("a",{key:a,staticClass:"dropdown-item",class:{"is-hovered":n===e.hovered},on:{click:function(o){return e.setSelected(n,void 0,o)}}},[e.hasDefaultSlot?e._t("default",null,{option:n,index:a}):r("span",[e._v(" "+e._s(e.getValue(n,!0))+" ")])],2)}),e.data.length===0&&e.hasEmptySlot?r("div",{staticClass:"dropdown-item is-disabled"},[e._t("empty")],2):e._e(),e.hasFooterSlot?r("div",{staticClass:"dropdown-item"},[e._t("footer")],2):e._e()],2)])])],1)},Xot=[],Jot=$e(Got,Kot,Xot,!1,null,null,null,null);const Qot=Jot.exports,kL={props:{value:[String,Number,Boolean,Function,Object,Array],nativeValue:[String,Number,Boolean,Function,Object,Array],type:String,disabled:Boolean,required:Boolean,name:String,size:{type:String,default:"default"}},data(){return{newValue:this.value}},computed:{computedValue:{get(){return this.newValue},set(t){this.newValue=t,this.$emit("input",t)}}},watch:{value(t){this.newValue=t}},methods:{focus(){this.$refs.input.focus()}}},xmt="",Zot={name:"CCheckbox",mixins:[kL],props:{indeterminate:Boolean,trueValue:{type:[String,Number,Boolean,Function,Object,Array],default:!0},falseValue:{type:[String,Number,Boolean,Function,Object,Array],default:!1},inverted:Boolean}};var est=function(){var e=this,r=e._self._c;return r("label",{ref:"label",staticClass:"c-checkbox checkbox",class:[`is-${e.size}`,{"is-disabled":e.disabled}],attrs:{disabled:e.disabled},on:{click:e.focus,keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:(n.preventDefault(),e.$refs.label.click())}}},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.computedValue,expression:"computedValue"}],ref:"input",attrs:{disabled:e.disabled,required:e.required,name:e.name,"true-value":e.trueValue,"false-value":e.falseValue,type:"checkbox"},domProps:{indeterminate:e.indeterminate,value:e.nativeValue,checked:Array.isArray(e.computedValue)?e._i(e.computedValue,e.nativeValue)>-1:e._q(e.computedValue,e.trueValue)},on:{click:function(n){n.stopPropagation()},change:function(n){var a=e.computedValue,o=n.target,i=o.checked?e.trueValue:e.falseValue;if(Array.isArray(a)){var s=e.nativeValue,u=e._i(a,s);o.checked?u<0&&(e.computedValue=a.concat([s])):u>-1&&(e.computedValue=a.slice(0,u).concat(a.slice(u+1)))}else e.computedValue=i}}}),r("span",{staticClass:"check",class:[`is-${e.type}`,{"is-inverted":e.inverted}]},[r("svg",{attrs:{viewBox:"0 0 30 30"}},[r("polyline",{attrs:{points:"21 8 12 20 7 15"}})])]),e.$slots.default?r("span",{staticClass:"control-label"},[e._t("default")],2):e._e()])},tst=[],rst=$e(Zot,est,tst,!1,null,"fe7d069f",null,null);const wK=rst.exports,kmt="",nst={name:"CRadio",mixins:[kL]};var ast=function(){var e=this,r=e._self._c;return r("label",{ref:"label",staticClass:"b-radio radio",class:[`is-${e.size}`,{"is-disabled":e.disabled}],attrs:{disabled:e.disabled},on:{click:e.focus,keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:(n.preventDefault(),e.$refs.label.click())}}},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.computedValue,expression:"computedValue"}],ref:"input",attrs:{disabled:e.disabled,required:e.required,name:e.name,type:"radio"},domProps:{value:e.nativeValue,checked:e._q(e.computedValue,e.nativeValue)},on:{click:function(n){n.stopPropagation()},change:function(n){e.computedValue=e.nativeValue}}}),r("span",{staticClass:"check",class:`is-${e.type}`}),r("span",{staticClass:"control-label"},[e._t("default")],2)])},ist=[],ost=$e(nst,ast,ist,!1,null,"18c984ce",null,null);const xK=ost.exports,Pmt="",sst={name:"CRadioButton",mixins:[kL],props:{type:{type:String,default:"primary"},expanded:Boolean},data(){return{isFocused:!1}}};var ust=function(){var e=this,r=e._self._c;return r("div",{staticClass:"control",class:{"is-expanded":e.expanded}},[r("label",{ref:"label",staticClass:"c-radio radio c-button button",class:[e.newValue===e.nativeValue?`is-${e.type}`:null,`is-${e.size}`,{"is-disabled":e.disabled,"is-focused":e.isFocused}],attrs:{disabled:e.disabled},on:{click:e.focus,keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:(n.preventDefault(),e.$refs.label.click())}}},[e._t("default"),r("input",{directives:[{name:"model",rawName:"v-model",value:e.computedValue,expression:"computedValue"}],ref:"input",attrs:{disabled:e.disabled,required:e.required,name:e.name,type:"radio"},domProps:{value:e.nativeValue,checked:e._q(e.computedValue,e.nativeValue)},on:{click:function(n){n.stopPropagation()},focus:function(n){e.isFocused=!0},blur:function(n){e.isFocused=!1},change:function(n){e.computedValue=e.nativeValue}}})],2)])},lst=[],dst=$e(sst,ust,lst,!1,null,"20d2ab8e",null,null);const kK=dst.exports,Lb=(t,e=!1)=>t?e?t.querySelectorAll('*[tabindex="-1"]'):t.querySelectorAll(`a[href]:not([tabindex="-1"]),
|