@opengis/admin 0.2.80 → 0.2.82
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/{add-page-B--iNsnp.js → add-page-D-gdxNnz.js} +1 -1
- package/dist/{admin-interface-SLegMCCg.js → admin-interface-CwjwYrOe.js} +3 -3
- package/dist/{admin-view-ZWBCcfXl.js → admin-view-FtuvEpxh.js} +1 -1
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +4 -4
- package/dist/{card-view-BYs3p6pQ.js → card-view-C8pMNjQF.js} +1 -1
- package/dist/{edit-page-CJOg-fHq.js → edit-page-CIYRxSp9.js} +1 -1
- package/dist/{import-file-g9nXuHvS.js → import-file-Dcs_0g1C.js} +19 -24
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/server/helpers/list/tableList.js +1 -1
- package/server/routes/data/controllers/tableFilter.js +1 -1
- package/server/routes/menu/controllers/getMenu.js +1 -1
- package/server/templates/pt/card-print.pt.hbs +19 -1
package/dist/admin.umd.cjs
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[sw]=this[sw]={accessors:{}}).accessors,i=this.prototype;function s(a){const o=eh(a);r[o]||(ZR(i,a),r[o]=!0)}return Re.isArray(e)?e.forEach(s):s(e),this}}Ui.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Re.reduceDescriptors(Ui.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),Re.freezeMethods(Ui);function a0(t,e){const n=this||Qu,r=e||n,i=Ui.from(r.headers);let s=r.data;return Re.forEach(t,function(o){s=o.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function ow(t){return!!(t&&t.__CANCEL__)}function td(t,e,n){Jt.call(this,t??"canceled",Jt.ERR_CANCELED,e,n),this.name="CanceledError"}Re.inherits(td,Jt,{__CANCEL__:!0});function aw(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Jt("Request failed with status code "+n.status,[Jt.ERR_BAD_REQUEST,Jt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function XR(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function KR(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(p){const g=Date.now(),y=r[s];a||(a=g),n[i]=p,r[i]=g;let v=s,E=0;for(;v!==i;)E+=n[v++],v=v%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),g-a<e)return;const T=y&&g-y;return T?Math.round(E*1e3/T):void 0}}function JR(t,e){let n=0,r=1e3/e,i,s;const a=(g,y=Date.now())=>{n=y,i=null,s&&(clearTimeout(s),s=null),t.apply(null,g)};return[(...g)=>{const y=Date.now(),v=y-n;v>=r?a(g,y):(i=g,s||(s=setTimeout(()=>{s=null,a(i)},r-v)))},()=>i&&a(i)]}const Dp=(t,e,n=3)=>{let r=0;const i=KR(50,250);return JR(s=>{const a=s.loaded,o=s.lengthComputable?s.total:void 0,p=a-r,g=i(p),y=a<=o;r=a;const v={loaded:a,total:o,progress:o?a/o:void 0,bytes:p,rate:g||void 0,estimated:g&&o&&y?(o-a)/g:void 0,event:s,lengthComputable:o!=null,[e?"download":"upload"]:!0};t(v)},n)},lw=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},cw=t=>(...e)=>Re.asap(()=>t(...e)),QR=Hi.hasStandardBrowserEnv?function(){const e=Hi.navigator&&/(msie|trident)/i.test(Hi.navigator.userAgent),n=document.createElement("a");let r;function i(s){let a=s;return e&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(a){const o=Re.isString(a)?i(a):a;return o.protocol===r.protocol&&o.host===r.host}}():function(){return function(){return!0}}(),eO=Hi.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];Re.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Re.isString(r)&&a.push("path="+r),Re.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tO(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function nO(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function dw(t,e){return t&&!tO(e)?nO(t,e):e}const uw=t=>t instanceof Ui?{...t}:t;function Wl(t,e){e=e||{};const n={};function r(g,y,v){return Re.isPlainObject(g)&&Re.isPlainObject(y)?Re.merge.call({caseless:v},g,y):Re.isPlainObject(y)?Re.merge({},y):Re.isArray(y)?y.slice():y}function i(g,y,v){if(Re.isUndefined(y)){if(!Re.isUndefined(g))return r(void 0,g,v)}else return r(g,y,v)}function s(g,y){if(!Re.isUndefined(y))return r(void 0,y)}function a(g,y){if(Re.isUndefined(y)){if(!Re.isUndefined(g))return r(void 0,g)}else return r(void 0,y)}function o(g,y,v){if(v in e)return r(g,y);if(v in t)return r(void 0,g)}const p={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(g,y)=>i(uw(g),uw(y),!0)};return Re.forEach(Object.keys(Object.assign({},t,e)),function(y){const v=p[y]||i,E=v(t[y],e[y],y);Re.isUndefined(E)&&v!==o||(n[y]=E)}),n}const hw=t=>{const e=Wl({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:o}=e;e.headers=a=Ui.from(a),e.url=tw(dw(e.baseURL,e.url),t.params,t.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let p;if(Re.isFormData(n)){if(Hi.hasStandardBrowserEnv||Hi.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((p=a.getContentType())!==!1){const[g,...y]=p?p.split(";").map(v=>v.trim()).filter(Boolean):[];a.setContentType([g||"multipart/form-data",...y].join("; "))}}if(Hi.hasStandardBrowserEnv&&(r&&Re.isFunction(r)&&(r=r(e)),r||r!==!1&&QR(e.url))){const g=i&&s&&eO.read(s);g&&a.set(i,g)}return e},rO=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const i=hw(t);let s=i.data;const a=Ui.from(i.headers).normalize();let{responseType:o,onUploadProgress:p,onDownloadProgress:g}=i,y,v,E,T,D;function N(){T&&T(),D&&D(),i.cancelToken&&i.cancelToken.unsubscribe(y),i.signal&&i.signal.removeEventListener("abort",y)}let B=new XMLHttpRequest;B.open(i.method.toUpperCase(),i.url,!0),B.timeout=i.timeout;function F(){if(!B)return;const te=Ui.from("getAllResponseHeaders"in B&&B.getAllResponseHeaders()),ke={data:!o||o==="text"||o==="json"?B.responseText:B.response,status:B.status,statusText:B.statusText,headers:te,config:t,request:B};aw(function(Se){n(Se),N()},function(Se){r(Se),N()},ke),B=null}"onloadend"in B?B.onloadend=F:B.onreadystatechange=function(){!B||B.readyState!==4||B.status===0&&!(B.responseURL&&B.responseURL.indexOf("file:")===0)||setTimeout(F)},B.onabort=function(){B&&(r(new Jt("Request aborted",Jt.ECONNABORTED,t,B)),B=null)},B.onerror=function(){r(new Jt("Network Error",Jt.ERR_NETWORK,t,B)),B=null},B.ontimeout=function(){let H=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const ke=i.transitional||rw;i.timeoutErrorMessage&&(H=i.timeoutErrorMessage),r(new Jt(H,ke.clarifyTimeoutError?Jt.ETIMEDOUT:Jt.ECONNABORTED,t,B)),B=null},s===void 0&&a.setContentType(null),"setRequestHeader"in B&&Re.forEach(a.toJSON(),function(H,ke){B.setRequestHeader(ke,H)}),Re.isUndefined(i.withCredentials)||(B.withCredentials=!!i.withCredentials),o&&o!=="json"&&(B.responseType=i.responseType),g&&([E,D]=Dp(g,!0),B.addEventListener("progress",E)),p&&B.upload&&([v,T]=Dp(p),B.upload.addEventListener("progress",v),B.upload.addEventListener("loadend",T)),(i.cancelToken||i.signal)&&(y=te=>{B&&(r(!te||te.type?new td(null,t,B):te),B.abort(),B=null)},i.cancelToken&&i.cancelToken.subscribe(y),i.signal&&(i.signal.aborted?y():i.signal.addEventListener("abort",y)));const X=XR(i.url);if(X&&Hi.protocols.indexOf(X)===-1){r(new Jt("Unsupported protocol "+X+":",Jt.ERR_BAD_REQUEST,t));return}B.send(s||null)})},iO=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const s=function(g){if(!i){i=!0,o();const y=g instanceof Error?g:this.reason;r.abort(y instanceof Jt?y:new td(y instanceof Error?y.message:y))}};let a=e&&setTimeout(()=>{a=null,s(new Jt(`timeout ${e} of ms exceeded`,Jt.ETIMEDOUT))},e);const o=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(g=>{g.unsubscribe?g.unsubscribe(s):g.removeEventListener("abort",s)}),t=null)};t.forEach(g=>g.addEventListener("abort",s));const{signal:p}=r;return p.unsubscribe=()=>Re.asap(o),p}},sO=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},oO=async function*(t,e){for await(const n of aO(t))yield*sO(n,e)},aO=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},fw=(t,e,n,r)=>{const i=oO(t,e);let s=0,a,o=p=>{a||(a=!0,r&&r(p))};return new ReadableStream({async pull(p){try{const{done:g,value:y}=await i.next();if(g){o(),p.close();return}let v=y.byteLength;if(n){let E=s+=v;n(E)}p.enqueue(new Uint8Array(y))}catch(g){throw o(g),g}},cancel(p){return o(p),i.return()}},{highWaterMark:2})},Ip=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",pw=Ip&&typeof ReadableStream=="function",lO=Ip&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),mw=(t,...e)=>{try{return!!t(...e)}catch{return!1}},cO=pw&&mw(()=>{let t=!1;const e=new Request(Hi.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),gw=64*1024,l0=pw&&mw(()=>Re.isReadableStream(new Response("").body)),Pp={stream:l0&&(t=>t.body)};Ip&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Pp[e]&&(Pp[e]=Re.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new Jt(`Response type '${e}' is not supported`,Jt.ERR_NOT_SUPPORT,r)})})})(new Response);const dO=async t=>{if(t==null)return 0;if(Re.isBlob(t))return t.size;if(Re.isSpecCompliantForm(t))return(await new Request(Hi.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(Re.isArrayBufferView(t)||Re.isArrayBuffer(t))return t.byteLength;if(Re.isURLSearchParams(t)&&(t=t+""),Re.isString(t))return(await lO(t)).byteLength},uO=async(t,e)=>{const n=Re.toFiniteNumber(t.getContentLength());return n??dO(e)},c0={http:PR,xhr:rO,fetch:Ip&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:o,onUploadProgress:p,responseType:g,headers:y,withCredentials:v="same-origin",fetchOptions:E}=hw(t);g=g?(g+"").toLowerCase():"text";let T=iO([i,s&&s.toAbortSignal()],a),D;const N=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let B;try{if(p&&cO&&n!=="get"&&n!=="head"&&(B=await uO(y,r))!==0){let ke=new Request(e,{method:"POST",body:r,duplex:"half"}),ge;if(Re.isFormData(r)&&(ge=ke.headers.get("content-type"))&&y.setContentType(ge),ke.body){const[Se,Pe]=lw(B,Dp(cw(p)));r=fw(ke.body,gw,Se,Pe)}}Re.isString(v)||(v=v?"include":"omit");const F="credentials"in Request.prototype;D=new Request(e,{...E,signal:T,method:n.toUpperCase(),headers:y.normalize().toJSON(),body:r,duplex:"half",credentials:F?v:void 0});let X=await fetch(D);const te=l0&&(g==="stream"||g==="response");if(l0&&(o||te&&N)){const ke={};["status","statusText","headers"].forEach(Ne=>{ke[Ne]=X[Ne]});const ge=Re.toFiniteNumber(X.headers.get("content-length")),[Se,Pe]=o&&lw(ge,Dp(cw(o),!0))||[];X=new Response(fw(X.body,gw,Se,()=>{Pe&&Pe(),N&&N()}),ke)}g=g||"text";let H=await Pp[Re.findKey(Pp,g)||"text"](X,t);return!te&&N&&N(),await new Promise((ke,ge)=>{aw(ke,ge,{data:H,headers:Ui.from(X.headers),status:X.status,statusText:X.statusText,config:t,request:D})})}catch(F){throw N&&N(),F&&F.name==="TypeError"&&/fetch/i.test(F.message)?Object.assign(new Jt("Network Error",Jt.ERR_NETWORK,t,D),{cause:F.cause||F}):Jt.from(F,F&&F.code,t,D)}})};Re.forEach(c0,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const yw=t=>`- ${t}`,hO=t=>Re.isFunction(t)||t===null||t===!1,bw={getAdapter:t=>{t=Re.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!hO(n)&&(r=c0[(a=String(n)).toLowerCase()],r===void 0))throw new Jt(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+s]=r}if(!r){const s=Object.entries(i).map(([o,p])=>`adapter ${o} `+(p===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
|
4
4
|
`+s.map(yw).join(`
|
5
5
|
`):" "+yw(s[0]):"as no adapter specified";throw new Jt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:c0};function d0(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new td(null,t)}function _w(t){return d0(t),t.headers=Ui.from(t.headers),t.data=a0.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),bw.getAdapter(t.adapter||Qu.adapter)(t).then(function(r){return d0(t),r.data=a0.call(t,t.transformResponse,r),r.headers=Ui.from(r.headers),r},function(r){return ow(r)||(d0(t),r&&r.response&&(r.response.data=a0.call(t,t.transformResponse,r.response),r.response.headers=Ui.from(r.response.headers))),Promise.reject(r)})}const xw="1.7.7",u0={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{u0[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const vw={};u0.transitional=function(e,n,r){function i(s,a){return"[Axios v"+xw+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,o)=>{if(e===!1)throw new Jt(i(a," has been removed"+(n?" in "+n:"")),Jt.ERR_DEPRECATED);return n&&!vw[a]&&(vw[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,a,o):!0}};function fO(t,e,n){if(typeof t!="object")throw new Jt("options must be an object",Jt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],a=e[s];if(a){const o=t[s],p=o===void 0||a(o,s,t);if(p!==!0)throw new Jt("option "+s+" must be "+p,Jt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Jt("Unknown option "+s,Jt.ERR_BAD_OPTION)}}const h0={assertOptions:fO,validators:u0},Ia=h0.validators;class ql{constructor(e){this.defaults=e,this.interceptors={request:new nw,response:new nw}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
6
|
-
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Wl(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&h0.assertOptions(r,{silentJSONParsing:Ia.transitional(Ia.boolean),forcedJSONParsing:Ia.transitional(Ia.boolean),clarifyTimeoutError:Ia.transitional(Ia.boolean)},!1),i!=null&&(Re.isFunction(i)?n.paramsSerializer={serialize:i}:h0.assertOptions(i,{encode:Ia.function,serialize:Ia.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&Re.merge(s.common,s[n.method]);s&&Re.forEach(["delete","get","head","post","put","patch","common"],D=>{delete s[D]}),n.headers=Ui.concat(a,s);const o=[];let p=!0;this.interceptors.request.forEach(function(N){typeof N.runWhen=="function"&&N.runWhen(n)===!1||(p=p&&N.synchronous,o.unshift(N.fulfilled,N.rejected))});const g=[];this.interceptors.response.forEach(function(N){g.push(N.fulfilled,N.rejected)});let y,v=0,E;if(!p){const D=[_w.bind(this),void 0];for(D.unshift.apply(D,o),D.push.apply(D,g),E=D.length,y=Promise.resolve(n);v<E;)y=y.then(D[v++],D[v++]);return y}E=o.length;let T=n;for(v=0;v<E;){const D=o[v++],N=o[v++];try{T=D(T)}catch(B){N.call(this,B);break}}try{y=_w.call(this,T)}catch(D){return Promise.reject(D)}for(v=0,E=g.length;v<E;)y=y.then(g[v++],g[v++]);return y}getUri(e){e=Wl(this.defaults,e);const n=dw(e.baseURL,e.url);return tw(n,e.params,e.paramsSerializer)}}Re.forEach(["delete","get","head","options"],function(e){ql.prototype[e]=function(n,r){return this.request(Wl(r||{},{method:e,url:n,data:(r||{}).data}))}}),Re.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,o){return this.request(Wl(o||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}ql.prototype[e]=n(),ql.prototype[e+"Form"]=n(!0)});class f0{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(o=>{r.subscribe(o),s=o}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,o){r.reason||(r.reason=new td(s,a,o),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new f0(function(i){e=i}),cancel:e}}}function pO(t){return function(n){return t.apply(null,n)}}function mO(t){return Re.isObject(t)&&t.isAxiosError===!0}const p0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(p0).forEach(([t,e])=>{p0[e]=t});function ww(t){const e=new ql(t),n=Qc(ql.prototype.request,e);return Re.extend(n,ql.prototype,e,{allOwnKeys:!0}),Re.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return ww(Wl(t,i))},n}const tt=ww(Qu);tt.Axios=ql,tt.CanceledError=td,tt.CancelToken=f0,tt.isCancel=ow,tt.VERSION=xw,tt.toFormData=Ap,tt.AxiosError=Jt,tt.Cancel=tt.CanceledError,tt.all=function(e){return Promise.all(e)},tt.spread=pO,tt.isAxiosError=mO,tt.mergeConfig=Wl,tt.AxiosHeaders=Ui,tt.formToJSON=t=>iw(Re.isHTMLForm(t)?new FormData(t):t),tt.getAdapter=bw.getAdapter,tt.HttpStatusCode=p0,tt.default=tt;const Vn=h.ref({}),gO=()=>{const t=new CustomEvent("reloadTablePage");window.dispatchEvent(t)},Rp=()=>{const t=new CustomEvent("reloadCardPage");window.dispatchEvent(t)},yO={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},bO={__name:"vs-plugin-form",setup(t){var y;const{$notify:e=()=>1}=(y=h.getCurrentInstance())==null?void 0:y.proxy,n=h.ref(!1),r=h.ref(null),i=h.ref({}),s=h.ref(),a=h.ref({}),o=v=>{n.value=!1,r.value=null,i.value={},a.value={};const E=new CustomEvent("closeFormPlugin");E.message=v,window.dispatchEvent(E)},p=async()=>{var v,E,T,D,N,B;try{if((v=a.value)!=null&&v.token){const X=await tt.get(`/api/table/${(E=a.value)==null?void 0:E.token}`);i.value=X.data}(T=a.value)!=null&&T.init&&(i.value=(D=a.value)==null?void 0:D.init);const{data:F}=await tt.get(`/api/template/form/${((N=a.value)==null?void 0:N.token)||((B=a.value)==null?void 0:B.form)}`);F!=null&&F.obj&&(i.value={...i.value,...F.obj}),r.value=(F==null?void 0:F.schema)||F}catch(F){console.error("Error fetching form scheme:",F)}finally{n.value=!0}},g=async()=>{var v,E,T,D,N;try{await s.value.doValidation();const{data:B}=await tt({method:((v=a.value)==null?void 0:v.method)||"PUT",url:`${((E=a.value)==null?void 0:E.api)||"/api/table/"}${((T=a.value)==null?void 0:T.token)||((D=a.value)==null?void 0:D.id)||""}`,data:i.value});Rp(),gO(),o(B),e({title:"Успішно!",type:"success",message:"Операція виконана успішно"})}catch(B){e({title:"Помилка!",type:"error",message:((N=B==null?void 0:B.response)==null?void 0:N.data)||"Сталася помилка"})}};return h.onMounted(()=>{window.addEventListener("openFormPlugin",({options:v})=>{a.value=v,n.value=!0,p()})}),(v,E)=>{var N;const T=h.resolveComponent("VsForm"),D=h.resolveComponent("VsDialog");return r.value?(h.openBlock(),h.createBlock(D,{key:0,title:((N=a.value)==null?void 0:N.title)||"Редагувати",visible:n.value,"onUpdate:visible":E[2]||(E[2]=B=>n.value=B),onOnClose:o},{footer:h.withCtx(()=>[h.createElementVNode("div",yO,[h.createElementVNode("button",{style:{border:"1px solid #000"},onClick:E[1]||(E[1]=B=>n.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),h.createElementVNode("button",{onClick:g,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700"}," Зберегти ")])]),default:h.withCtx(()=>[h.createVNode(T,{ref_key:"form",ref:s,scheme:r.value,modelValue:i.value,"onUpdate:modelValue":E[0]||(E[0]=B=>i.value=B),class:"p-0"},null,8,["scheme","modelValue"])]),_:1},8,["title","visible"])):h.createCommentVNode("",!0)}}},_O={__name:"admin",setup(t){var n,r;document.title=((n=Vn.value)==null?void 0:n.titlePrefix)||""+((r=Vn.value)==null?void 0:r.title)||"",e(Vn.value.favicon);function e(i){let s=document.querySelector("link[rel~='icon']");s||(s=document.createElement("link"),s.rel="icon",document.getElementsByTagName("head")[0].appendChild(s)),s.href=i}return(i,s)=>{const a=h.resolveComponent("router-view");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createVNode(a),h.createVNode(bO)],64)}}};function xO(){return kw().__VUE_DEVTOOLS_GLOBAL_HOOK__}function kw(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const vO=typeof Proxy=="function",wO="devtools-plugin:setup",kO="plugin:settings:set";let nd,m0;function EO(){var t;return nd!==void 0||(typeof window<"u"&&window.performance?(nd=!0,m0=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(nd=!0,m0=globalThis.perf_hooks.performance):nd=!1),nd}function SO(){return EO()?m0.now():Date.now()}class CO{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const a in e.settings){const o=e.settings[a];r[a]=o.defaultValue}const i=`__vue-devtools-plugin-settings__${e.id}`;let s=Object.assign({},r);try{const a=localStorage.getItem(i),o=JSON.parse(a);Object.assign(s,o)}catch{}this.fallbacks={getSettings(){return s},setSettings(a){try{localStorage.setItem(i,JSON.stringify(a))}catch{}s=a},now(){return SO()}},n&&n.on(kO,(a,o)=>{a===this.plugin.id&&this.fallbacks.setSettings(o)}),this.proxiedOn=new Proxy({},{get:(a,o)=>this.target?this.target.on[o]:(...p)=>{this.onQueue.push({method:o,args:p})}}),this.proxiedTarget=new Proxy({},{get:(a,o)=>this.target?this.target[o]:o==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(o)?(...p)=>(this.targetQueue.push({method:o,args:p,resolve:()=>{}}),this.fallbacks[o](...p)):(...p)=>new Promise(g=>{this.targetQueue.push({method:o,args:p,resolve:g})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function TO(t,e){const n=t,r=kw(),i=xO(),s=vO&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))i.emit(wO,t,e);else{const a=s?new CO(n,i):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:a}),a&&e(a.proxiedTarget)}}/*!
|
6
|
+
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Wl(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&h0.assertOptions(r,{silentJSONParsing:Ia.transitional(Ia.boolean),forcedJSONParsing:Ia.transitional(Ia.boolean),clarifyTimeoutError:Ia.transitional(Ia.boolean)},!1),i!=null&&(Re.isFunction(i)?n.paramsSerializer={serialize:i}:h0.assertOptions(i,{encode:Ia.function,serialize:Ia.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&Re.merge(s.common,s[n.method]);s&&Re.forEach(["delete","get","head","post","put","patch","common"],D=>{delete s[D]}),n.headers=Ui.concat(a,s);const o=[];let p=!0;this.interceptors.request.forEach(function(N){typeof N.runWhen=="function"&&N.runWhen(n)===!1||(p=p&&N.synchronous,o.unshift(N.fulfilled,N.rejected))});const g=[];this.interceptors.response.forEach(function(N){g.push(N.fulfilled,N.rejected)});let y,v=0,E;if(!p){const D=[_w.bind(this),void 0];for(D.unshift.apply(D,o),D.push.apply(D,g),E=D.length,y=Promise.resolve(n);v<E;)y=y.then(D[v++],D[v++]);return y}E=o.length;let T=n;for(v=0;v<E;){const D=o[v++],N=o[v++];try{T=D(T)}catch(B){N.call(this,B);break}}try{y=_w.call(this,T)}catch(D){return Promise.reject(D)}for(v=0,E=g.length;v<E;)y=y.then(g[v++],g[v++]);return y}getUri(e){e=Wl(this.defaults,e);const n=dw(e.baseURL,e.url);return tw(n,e.params,e.paramsSerializer)}}Re.forEach(["delete","get","head","options"],function(e){ql.prototype[e]=function(n,r){return this.request(Wl(r||{},{method:e,url:n,data:(r||{}).data}))}}),Re.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,o){return this.request(Wl(o||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}ql.prototype[e]=n(),ql.prototype[e+"Form"]=n(!0)});class f0{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(o=>{r.subscribe(o),s=o}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,o){r.reason||(r.reason=new td(s,a,o),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new f0(function(i){e=i}),cancel:e}}}function pO(t){return function(n){return t.apply(null,n)}}function mO(t){return Re.isObject(t)&&t.isAxiosError===!0}const p0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(p0).forEach(([t,e])=>{p0[e]=t});function ww(t){const e=new ql(t),n=Qc(ql.prototype.request,e);return Re.extend(n,ql.prototype,e,{allOwnKeys:!0}),Re.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return ww(Wl(t,i))},n}const tt=ww(Qu);tt.Axios=ql,tt.CanceledError=td,tt.CancelToken=f0,tt.isCancel=ow,tt.VERSION=xw,tt.toFormData=Ap,tt.AxiosError=Jt,tt.Cancel=tt.CanceledError,tt.all=function(e){return Promise.all(e)},tt.spread=pO,tt.isAxiosError=mO,tt.mergeConfig=Wl,tt.AxiosHeaders=Ui,tt.formToJSON=t=>iw(Re.isHTMLForm(t)?new FormData(t):t),tt.getAdapter=bw.getAdapter,tt.HttpStatusCode=p0,tt.default=tt;const Vn=h.ref({}),gO=()=>{const t=new CustomEvent("reloadTablePage");window.dispatchEvent(t)},Rp=()=>{const t=new CustomEvent("reloadCardPage");window.dispatchEvent(t)},yO={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},bO={__name:"vs-plugin-form",setup(t){var y;const{$notify:e=()=>1}=(y=h.getCurrentInstance())==null?void 0:y.proxy,n=h.ref(!1),r=h.ref(null),i=h.ref({}),s=h.ref(),a=h.ref({}),o=v=>{n.value=!1,r.value=null,i.value={},a.value={};const E=new CustomEvent("closeFormPlugin");E.message=v,window.dispatchEvent(E)},p=async()=>{var v,E,T,D,N,B;try{if((v=a.value)!=null&&v.token){const X=await tt.get(`/api/table/${(E=a.value)==null?void 0:E.token}`);i.value=X.data}(T=a.value)!=null&&T.init&&(i.value=(D=a.value)==null?void 0:D.init);const{data:F}=await tt.get(`/api/template/form/${((N=a.value)==null?void 0:N.token)||((B=a.value)==null?void 0:B.form)}`);F!=null&&F.obj&&(i.value={...i.value,...F.obj}),r.value=(F==null?void 0:F.schema)||F}catch(F){console.error("Error fetching form scheme:",F)}finally{n.value=!0}},g=async()=>{var v,E,T,D,N;try{await s.value.doValidation();const{data:B}=await tt({method:((v=a.value)==null?void 0:v.method)||"PUT",url:`${((E=a.value)==null?void 0:E.api)||"/api/table/"}${((T=a.value)==null?void 0:T.token)||((D=a.value)==null?void 0:D.id)||""}`,data:i.value});Rp(),gO(),o(B),e({title:"Успішно!",type:"success",message:"Операція виконана успішно"})}catch(B){e({title:"Помилка!",type:"error",message:B.message==="validation error"?"Перевірте правильність полів.":((N=B==null?void 0:B.response)==null?void 0:N.data)||"Сталася помилка"})}};return h.onMounted(()=>{window.addEventListener("openFormPlugin",({options:v})=>{a.value=v,n.value=!0,p()})}),(v,E)=>{var N;const T=h.resolveComponent("VsForm"),D=h.resolveComponent("VsDialog");return r.value?(h.openBlock(),h.createBlock(D,{key:0,title:((N=a.value)==null?void 0:N.title)||"Редагувати",visible:n.value,"onUpdate:visible":E[2]||(E[2]=B=>n.value=B),onOnClose:o},{footer:h.withCtx(()=>[h.createElementVNode("div",yO,[h.createElementVNode("button",{style:{border:"1px solid #000"},onClick:E[1]||(E[1]=B=>n.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),h.createElementVNode("button",{onClick:g,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700"}," Зберегти ")])]),default:h.withCtx(()=>[h.createVNode(T,{ref_key:"form",ref:s,scheme:r.value,modelValue:i.value,"onUpdate:modelValue":E[0]||(E[0]=B=>i.value=B),class:"p-0"},null,8,["scheme","modelValue"])]),_:1},8,["title","visible"])):h.createCommentVNode("",!0)}}},_O={__name:"admin",setup(t){var n,r;document.title=((n=Vn.value)==null?void 0:n.titlePrefix)||""+((r=Vn.value)==null?void 0:r.title)||"",e(Vn.value.favicon);function e(i){let s=document.querySelector("link[rel~='icon']");s||(s=document.createElement("link"),s.rel="icon",document.getElementsByTagName("head")[0].appendChild(s)),s.href=i}return(i,s)=>{const a=h.resolveComponent("router-view");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createVNode(a),h.createVNode(bO)],64)}}};function xO(){return kw().__VUE_DEVTOOLS_GLOBAL_HOOK__}function kw(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const vO=typeof Proxy=="function",wO="devtools-plugin:setup",kO="plugin:settings:set";let nd,m0;function EO(){var t;return nd!==void 0||(typeof window<"u"&&window.performance?(nd=!0,m0=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(nd=!0,m0=globalThis.perf_hooks.performance):nd=!1),nd}function SO(){return EO()?m0.now():Date.now()}class CO{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const a in e.settings){const o=e.settings[a];r[a]=o.defaultValue}const i=`__vue-devtools-plugin-settings__${e.id}`;let s=Object.assign({},r);try{const a=localStorage.getItem(i),o=JSON.parse(a);Object.assign(s,o)}catch{}this.fallbacks={getSettings(){return s},setSettings(a){try{localStorage.setItem(i,JSON.stringify(a))}catch{}s=a},now(){return SO()}},n&&n.on(kO,(a,o)=>{a===this.plugin.id&&this.fallbacks.setSettings(o)}),this.proxiedOn=new Proxy({},{get:(a,o)=>this.target?this.target.on[o]:(...p)=>{this.onQueue.push({method:o,args:p})}}),this.proxiedTarget=new Proxy({},{get:(a,o)=>this.target?this.target[o]:o==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(o)?(...p)=>(this.targetQueue.push({method:o,args:p,resolve:()=>{}}),this.fallbacks[o](...p)):(...p)=>new Promise(g=>{this.targetQueue.push({method:o,args:p,resolve:g})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function TO(t,e){const n=t,r=kw(),i=xO(),s=vO&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))i.emit(wO,t,e);else{const a=s?new CO(n,i):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:a}),a&&e(a.proxiedTarget)}}/*!
|
7
7
|
* vue-router v4.4.5
|
8
8
|
* (c) 2024 Eduardo San Martin Morote
|
9
9
|
* @license MIT
|
@@ -626,7 +626,7 @@ uniform ${$} ${j} u_${Y};
|
|
626
626
|
<div class="fancybox__carousel"></div>
|
627
627
|
<div class="fancybox__footer"></div>
|
628
628
|
</div>`},trapFocus:!0,wheel:"zoom"};var Lr,hi;(function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Closing=2]="Closing",t[t.CustomClosing=3]="CustomClosing",t[t.Destroy=4]="Destroy"})(Lr||(Lr={})),function(t){t[t.Loading=0]="Loading",t[t.Opening=1]="Opening",t[t.Ready=2]="Ready",t[t.Closing=3]="Closing"}(hi||(hi={}));let DE="",_h=!1,pm=!1,Kl=null;const IE=()=>{let t="",e="";const n=vn.getInstance();if(n){const r=n.carousel,i=n.getSlide();if(r&&i){let s=i.slug||void 0,a=i.triggerEl||void 0;e=s||n.option("slug")||"",!e&&a&&a.dataset&&(e=a.dataset.fancybox||""),e&&e!=="true"&&(t="#"+e+(!s&&r.slides.length>1?"-"+(i.index+1):""))}}return{hash:t,slug:e,index:1}},mm=()=>{const t=new URL(document.URL).hash,e=t.slice(1).split("-"),n=e[e.length-1],r=n&&/^\+?\d+$/.test(n)&&parseInt(e.pop()||"1",10)||1;return{hash:t,slug:e.join("-"),index:r}},PE=()=>{const{slug:t,index:e}=mm();if(!t)return;let n=document.querySelector(`[data-slug="${t}"]`);if(n&&n.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})),vn.getInstance())return;const r=document.querySelectorAll(`[data-fancybox="${t}"]`);r.length&&(n=r[e-1],n&&n.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})))},RE=()=>{if(vn.defaults.Hash===!1)return;const t=vn.getInstance();if((t==null?void 0:t.options.Hash)===!1)return;const{slug:e,index:n}=mm(),{slug:r}=IE();t&&(e===r?t.jumpTo(n-1):(_h=!0,t.close())),PE()},OE=()=>{Kl&&clearTimeout(Kl),queueMicrotask(()=>{RE()})},NE=()=>{window.addEventListener("hashchange",OE,!1),setTimeout(()=>{RE()},500)};bh&&(/complete|interactive|loaded/.test(document.readyState)?NE():document.addEventListener("DOMContentLoaded",NE));const gm="is-zooming-in";class BE extends io{onCreateSlide(e,n,r){const i=this.instance.optionFor(r,"src")||"";r.el&&r.type==="image"&&typeof i=="string"&&this.setImage(r,i)}onRemoveSlide(e,n,r){r.panzoom&&r.panzoom.destroy(),r.panzoom=void 0,r.imageEl=void 0}onChange(e,n,r,i){Pn(this.instance.container,gm);for(const s of n.slides){const a=s.panzoom;a&&s.index!==r&&a.reset(.35)}}onClose(){var e;const n=this.instance,r=n.container,i=n.getSlide();if(!r||!r.parentElement||!i)return;const{el:s,contentEl:a,panzoom:o,thumbElSrc:p}=i;if(!s||!p||!a||!o||o.isContentLoading||o.state===Bn.Init||o.state===Bn.Destroy)return;o.updateMetrics();let g=this.getZoomInfo(i);if(!g)return;this.instance.state=Lr.CustomClosing,r.classList.remove(gm),r.classList.add("is-zooming-out"),a.style.backgroundImage=`url('${p}')`;const y=r.getBoundingClientRect();(((e=window.visualViewport)===null||e===void 0?void 0:e.scale)||1)===1&&Object.assign(r.style,{position:"absolute",top:`${r.offsetTop+window.scrollY}px`,left:`${r.offsetLeft+window.scrollX}px`,bottom:"auto",right:"auto",width:`${y.width}px`,height:`${y.height}px`,overflow:"hidden"});const{x:v,y:E,scale:T,opacity:D}=g;if(D){const N=((B,F,X,te)=>{const H=F-B,ke=te-X;return ge=>X+((ge-B)/H*ke||0)})(o.scale,T,1,0);o.on("afterTransform",()=>{a.style.opacity=N(o.scale)+""})}o.on("endAnimation",()=>{n.destroy()}),o.target.a=T,o.target.b=0,o.target.c=0,o.target.d=T,o.panTo({x:v,y:E,scale:T,friction:D?.2:.33,ignoreBounds:!0}),o.isResting&&n.destroy()}setImage(e,n){const r=this.instance;e.src=n,this.process(e,n).then(i=>{const{contentEl:s,imageEl:a,thumbElSrc:o,el:p}=e;if(r.isClosing()||!s||!a)return;s.offsetHeight;const g=!!r.isOpeningSlide(e)&&this.getZoomInfo(e);if(this.option("protected")&&p){p.addEventListener("contextmenu",E=>{E.preventDefault()});const v=document.createElement("div");Dt(v,"fancybox-protected"),s.appendChild(v)}if(o&&g){const v=i.contentRect,E=Math.max(v.fullWidth,v.fullHeight);let T=null;!g.opacity&&E>1200&&(T=document.createElement("img"),Dt(T,"fancybox-ghost"),T.src=o,s.appendChild(T));const D=()=>{T&&(Dt(T,"f-fadeFastOut"),setTimeout(()=>{T&&(T.remove(),T=null)},200))};(y=o,new Promise((N,B)=>{const F=new Image;F.onload=N,F.onerror=B,F.src=y})).then(()=>{r.hideLoading(e),e.state=hi.Opening,this.instance.emit("reveal",e),this.zoomIn(e).then(()=>{D(),this.instance.done(e)},()=>{}),T&&setTimeout(()=>{D()},E>2500?800:200)},()=>{r.hideLoading(e),r.revealContent(e)})}else{const v=this.optionFor(e,"initialSize"),E=this.optionFor(e,"zoom"),T={event:r.prevMouseMoveEvent||r.options.event,friction:E?.12:0};let D=r.optionFor(e,"showClass")||void 0,N=!0;r.isOpeningSlide(e)&&(v==="full"?i.zoomToFull(T):v==="cover"?i.zoomToCover(T):v==="max"?i.zoomToMax(T):N=!1,i.stop("current")),N&&D&&(D=i.isDragging?"f-fadeIn":""),r.hideLoading(e),r.revealContent(e,D)}var y},()=>{r.setError(e,"{{IMAGE_ERROR}}")})}process(e,n){return new Promise((r,i)=>{var s;const a=this.instance,o=e.el;a.clearContent(e),a.showLoading(e);let p=this.optionFor(e,"content");if(typeof p=="string"&&(p=xo(p)),!p||!Yi(p)){if(p=document.createElement("img"),p instanceof HTMLImageElement){let g="",y=e.caption;g=typeof y=="string"&&y?y.replace(/<[^>]+>/gi,"").substring(0,1e3):`Image ${e.index+1} of ${((s=a.carousel)===null||s===void 0?void 0:s.pages.length)||1}`,p.src=n||"",p.alt=g,p.draggable=!1,e.srcset&&p.setAttribute("srcset",e.srcset),this.instance.isOpeningSlide(e)&&(p.fetchPriority="high")}e.sizes&&p.setAttribute("sizes",e.sizes)}Dt(p,"fancybox-image"),e.imageEl=p,a.setContent(e,p,!1),e.panzoom=new yd(o,Gi({transformParent:!0},this.option("Panzoom")||{},{content:p,width:(g,y)=>a.optionFor(e,"width","auto",y)||"auto",height:(g,y)=>a.optionFor(e,"height","auto",y)||"auto",wheel:()=>{const g=a.option("wheel");return(g==="zoom"||g=="pan")&&g},click:(g,y)=>{var v,E;if(a.isCompact||a.isClosing()||e.index!==((v=a.getSlide())===null||v===void 0?void 0:v.index))return!1;if(y){const D=y.composedPath()[0];if(["A","BUTTON","TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].includes(D.nodeName))return!1}let T=!y||y.target&&((E=e.contentEl)===null||E===void 0?void 0:E.contains(y.target));return a.option(T?"contentClick":"backdropClick")||!1},dblClick:()=>a.isCompact?"toggleZoom":a.option("contentDblClick")||!1,spinner:!1,panOnlyZoomed:!0,wheelLimit:1/0,on:{ready:g=>{r(g)},error:()=>{i()},destroy:()=>{i()}}}))})}zoomIn(e){return new Promise((n,r)=>{const i=this.instance,s=i.container,{panzoom:a,contentEl:o,el:p}=e;a&&a.updateMetrics();const g=this.getZoomInfo(e);if(!(g&&p&&o&&a&&s))return void r();const{x:y,y:v,scale:E,opacity:T}=g,D=()=>{e.state!==hi.Closing&&(T&&(o.style.opacity=Math.max(Math.min(1,1-(1-a.scale)/(1-E)),0)+""),a.scale>=1&&a.scale>a.targetScale-.1&&n(a))},N=X=>{(X.scale<.99||X.scale>1.01)&&!X.isDragging||(Pn(s,gm),o.style.opacity="",X.off("endAnimation",N),X.off("touchStart",N),X.off("afterTransform",D),n(X))};a.on("endAnimation",N),a.on("touchStart",N),a.on("afterTransform",D),a.on(["error","destroy"],()=>{r()}),a.panTo({x:y,y:v,scale:E,friction:0,ignoreBounds:!0}),a.stop("current");const B={event:a.panMode==="mousemove"?i.prevMouseMoveEvent||i.options.event:void 0},F=this.optionFor(e,"initialSize");Dt(s,gm),i.hideLoading(e),F==="full"?a.zoomToFull(B):F==="cover"?a.zoomToCover(B):F==="max"?a.zoomToMax(B):a.reset(.172)})}getZoomInfo(e){const{el:n,imageEl:r,thumbEl:i,panzoom:s}=e,a=this.instance,o=a.container;if(!n||!r||!i||!s||TE(i)<3||!this.optionFor(e,"zoom")||!o||a.state===Lr.Destroy||getComputedStyle(o).getPropertyValue("--f-images-zoom")==="0")return!1;const p=window.visualViewport||null;if((p?p.scale:1)!==1)return!1;let{top:g,left:y,width:v,height:E}=i.getBoundingClientRect(),{top:T,left:D,fitWidth:N,fitHeight:B}=s.contentRect;if(!(v&&E&&N&&B))return!1;const F=s.container.getBoundingClientRect();D+=F.left,T+=F.top;const X=-1*(D+.5*N-(y+.5*v)),te=-1*(T+.5*B-(g+.5*E)),H=v/N;let ke=this.option("zoomOpacity")||!1;return ke==="auto"&&(ke=Math.abs(v/E-N/B)>.1),{x:X,y:te,scale:H,opacity:ke}}attach(){const e=this,n=e.instance;n.on("Carousel.change",e.onChange),n.on("Carousel.createSlide",e.onCreateSlide),n.on("Carousel.removeSlide",e.onRemoveSlide),n.on("close",e.onClose)}detach(){const e=this,n=e.instance;n.off("Carousel.change",e.onChange),n.off("Carousel.createSlide",e.onCreateSlide),n.off("Carousel.removeSlide",e.onRemoveSlide),n.off("close",e.onClose)}}Object.defineProperty(BE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{initialSize:"fit",Panzoom:{maxScale:1},protected:!1,zoom:!0,zoomOpacity:"auto"}}),typeof SuppressedError=="function"&&SuppressedError;const vb="html",zE="image",wb="map",ea="youtube",Jl="vimeo",xh="html5video",LE=(t,e={})=>{const n=new URL(t),r=new URLSearchParams(n.search),i=new URLSearchParams;for(const[o,p]of[...r,...Object.entries(e)]){let g=p+"";if(o==="t"){let y=g.match(/((\d*)m)?(\d*)s?/);y&&i.set("start",60*parseInt(y[2]||"0")+parseInt(y[3]||"0")+"")}else i.set(o,g)}let s=i+"",a=t.match(/#t=((.*)?\d+s)/);return a&&(s+=`#t=${a[1]}`),s},x5={ajax:null,autoSize:!0,iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"},preload:!0,videoAutoplay:!0,videoRatio:16/9,videoTpl:`<video class="fancybox__html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">
|
629
|
-
<source src="{{src}}" type="{{format}}" />Sorry, your browser doesn't support embedded videos.</video>`,videoFormat:"",vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}},v5=["image","html","ajax","inline","clone","iframe","map","pdf","html5video","youtube","vimeo"];class VE extends io{onBeforeInitSlide(e,n,r){this.processType(r)}onCreateSlide(e,n,r){this.setContent(r)}onClearContent(e,n){n.xhr&&(n.xhr.abort(),n.xhr=null);const r=n.iframeEl;r&&(r.onload=r.onerror=null,r.src="//about:blank",n.iframeEl=null);const i=n.contentEl,s=n.placeholderEl;if(n.type==="inline"&&i&&s)i.classList.remove("fancybox__content"),getComputedStyle(i).getPropertyValue("display")!=="none"&&(i.style.display="none"),setTimeout(()=>{s&&(i&&s.parentNode&&s.parentNode.insertBefore(i,s),s.remove())},0),n.contentEl=void 0,n.placeholderEl=void 0;else for(;n.el&&n.el.firstChild;)n.el.removeChild(n.el.firstChild)}onSelectSlide(e,n,r){r.state===hi.Ready&&this.playVideo()}onUnselectSlide(e,n,r){var i,s;if(r.type===xh){try{(s=(i=r.el)===null||i===void 0?void 0:i.querySelector("video"))===null||s===void 0||s.pause()}catch{}return}let a;r.type===Jl?a={method:"pause",value:"true"}:r.type===ea&&(a={event:"command",func:"pauseVideo"}),a&&r.iframeEl&&r.iframeEl.contentWindow&&r.iframeEl.contentWindow.postMessage(JSON.stringify(a),"*"),r.poller&&clearTimeout(r.poller)}onDone(e,n){e.isCurrentSlide(n)&&!e.isClosing()&&this.playVideo()}onRefresh(e,n){n.slides.forEach(r=>{r.el&&(this.resizeIframe(r),this.setAspectRatio(r))})}onMessage(e){try{let n=JSON.parse(e.data);if(e.origin==="https://player.vimeo.com"){if(n.event==="ready")for(let r of Array.from(document.getElementsByClassName("fancybox__iframe")))r instanceof HTMLIFrameElement&&r.contentWindow===e.source&&(r.dataset.ready="true")}else if(e.origin.match(/^https:\/\/(www.)?youtube(-nocookie)?.com$/)&&n.event==="onReady"){const r=document.getElementById(n.id);r&&(r.dataset.ready="true")}}catch{}}loadAjaxContent(e){const n=this.instance.optionFor(e,"src")||"";this.instance.showLoading(e);const r=this.instance,i=new XMLHttpRequest;r.showLoading(e),i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&r.state===Lr.Ready&&(r.hideLoading(e),i.status===200?r.setContent(e,i.responseText):r.setError(e,i.status===404?"{{AJAX_NOT_FOUND}}":"{{AJAX_FORBIDDEN}}"))};const s=e.ajax||null;i.open(s?"POST":"GET",n+""),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(s),e.xhr=i}setInlineContent(e){let n=null;if(Yi(e.src))n=e.src;else if(typeof e.src=="string"){const r=e.src.split("#",2).pop();n=r?document.getElementById(r):null}if(n){if(e.type==="clone"||n.closest(".fancybox__slide")){n=n.cloneNode(!0);const r=n.dataset.animationName;r&&(n.classList.remove(r),delete n.dataset.animationName);let i=n.getAttribute("id");i=i?`${i}--clone`:`clone-${this.instance.id}-${e.index}`,n.setAttribute("id",i)}else if(n.parentNode){const r=document.createElement("div");r.classList.add("fancybox-placeholder"),n.parentNode.insertBefore(r,n),e.placeholderEl=r}this.instance.setContent(e,n)}else this.instance.setError(e,"{{ELEMENT_NOT_FOUND}}")}setIframeContent(e){const{src:n,el:r}=e;if(!n||typeof n!="string"||!r)return;r.classList.add("is-loading");const i=this.instance,s=document.createElement("iframe");s.className="fancybox__iframe",s.setAttribute("id",`fancybox__iframe_${i.id}_${e.index}`);for(const[o,p]of Object.entries(this.optionFor(e,"iframeAttr")||{}))s.setAttribute(o,p);s.onerror=()=>{i.setError(e,"{{IFRAME_ERROR}}")},e.iframeEl=s;const a=this.optionFor(e,"preload");if(e.type!=="iframe"||a===!1)return s.setAttribute("src",e.src+""),i.setContent(e,s,!1),this.resizeIframe(e),void i.revealContent(e);i.showLoading(e),s.onload=()=>{if(!s.src.length)return;const o=s.dataset.ready!=="true";s.dataset.ready="true",this.resizeIframe(e),o?i.revealContent(e):i.hideLoading(e)},s.setAttribute("src",n),i.setContent(e,s,!1)}resizeIframe(e){const{type:n,iframeEl:r}=e;if(n===ea||n===Jl)return;const i=r==null?void 0:r.parentElement;if(!r||!i)return;let s=e.autoSize;s===void 0&&(s=this.optionFor(e,"autoSize"));let a=e.width||0,o=e.height||0;a&&o&&(s=!1);const p=i&&i.style;if(e.preload!==!1&&s!==!1&&p)try{const g=window.getComputedStyle(i),y=parseFloat(g.paddingLeft)+parseFloat(g.paddingRight),v=parseFloat(g.paddingTop)+parseFloat(g.paddingBottom),E=r.contentWindow;if(E){const T=E.document,D=T.getElementsByTagName(vb)[0],N=T.body;p.width="",N.style.overflow="hidden",a=a||D.scrollWidth+y,p.width=`${a}px`,N.style.overflow="",p.flex="0 0 auto",p.height=`${N.scrollHeight}px`,o=D.scrollHeight+v}}catch{}if(a||o){const g={flex:"0 1 auto",width:"",height:""};a&&a!=="auto"&&(g.width=`${a}px`),o&&o!=="auto"&&(g.height=`${o}px`),Object.assign(p,g)}}playVideo(){const e=this.instance.getSlide();if(!e)return;const{el:n}=e;if(!n||!n.offsetParent||!this.optionFor(e,"videoAutoplay"))return;if(e.type===xh)try{const i=n.querySelector("video");if(i){const s=i.play();s!==void 0&&s.then(()=>{}).catch(a=>{i.muted=!0,i.play()})}}catch{}if(e.type!==ea&&e.type!==Jl)return;const r=()=>{if(e.iframeEl&&e.iframeEl.contentWindow){let i;if(e.iframeEl.dataset.ready==="true")return i=e.type===ea?{event:"command",func:"playVideo"}:{method:"play",value:"true"},i&&e.iframeEl.contentWindow.postMessage(JSON.stringify(i),"*"),void(e.poller=void 0);e.type===ea&&(i={event:"listening",id:e.iframeEl.getAttribute("id")},e.iframeEl.contentWindow.postMessage(JSON.stringify(i),"*"))}e.poller=setTimeout(r,250)};r()}processType(e){if(e.html)return e.type=vb,e.src=e.html,void(e.html="");const n=this.instance.optionFor(e,"src","");if(!n||typeof n!="string")return;let r=e.type,i=null;if(i=n.match(/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|shorts\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listType=(?:.*)&list=(?:.*))(?:.*)/i)){const s=this.optionFor(e,ea),{nocookie:a}=s,o=function(v,E){var T={};for(var D in v)Object.prototype.hasOwnProperty.call(v,D)&&E.indexOf(D)<0&&(T[D]=v[D]);if(v!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(D=Object.getOwnPropertySymbols(v);N<D.length;N++)E.indexOf(D[N])<0&&Object.prototype.propertyIsEnumerable.call(v,D[N])&&(T[D[N]]=v[D[N]])}return T}(s,["nocookie"]),p=`www.youtube${a?"-nocookie":""}.com`,g=LE(n,o),y=encodeURIComponent(i[2]);e.videoId=y,e.src=`https://${p}/embed/${y}?${g}`,e.thumbSrc=e.thumbSrc||`https://i.ytimg.com/vi/${y}/mqdefault.jpg`,r=ea}else if(i=n.match(/^.+vimeo.com\/(?:\/)?([\d]+)((\/|\?h=)([a-z0-9]+))?(.*)?/)){const s=LE(n,this.optionFor(e,Jl)),a=encodeURIComponent(i[1]),o=i[4]||"";e.videoId=a,e.src=`https://player.vimeo.com/video/${a}?${o?`h=${o}${s?"&":""}`:""}${s}`,r=Jl}if(!r&&e.triggerEl){const s=e.triggerEl.dataset.type;v5.includes(s)&&(r=s)}r||typeof n=="string"&&(n.charAt(0)==="#"?r="inline":(i=n.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(r=xh,e.videoFormat=e.videoFormat||"video/"+(i[1]==="ogv"?"ogg":i[1])):n.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?r=zE:n.match(/\.(pdf)((\?|#).*)?$/i)&&(r="pdf")),(i=n.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i))?(e.src=`https://maps.google.${i[1]}/?ll=${(i[2]?i[2]+"&z="+Math.floor(parseFloat(i[3]))+(i[4]?i[4].replace(/^\//,"&"):""):i[4]+"").replace(/\?/,"&")}&output=${i[4]&&i[4].indexOf("layer=c")>0?"svembed":"embed"}`,r=wb):(i=n.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i))&&(e.src=`https://maps.google.${i[1]}/maps?q=${i[2].replace("query=","q=").replace("api=1","")}&output=embed`,r=wb),r=r||this.instance.option("defaultType"),e.type=r,r===zE&&(e.thumbSrc=e.thumbSrc||e.src)}setContent(e){const n=this.instance.optionFor(e,"src")||"";if(e&&e.type&&n){switch(e.type){case vb:this.instance.setContent(e,n);break;case xh:const r=this.option("videoTpl");r&&this.instance.setContent(e,r.replace(/\{\{src\}\}/gi,n+"").replace(/\{\{format\}\}/gi,this.optionFor(e,"videoFormat")||"").replace(/\{\{poster\}\}/gi,e.poster||e.thumbSrc||""));break;case"inline":case"clone":this.setInlineContent(e);break;case"ajax":this.loadAjaxContent(e);break;case"pdf":case wb:case ea:case Jl:e.preload=!1;case"iframe":this.setIframeContent(e)}this.setAspectRatio(e)}}setAspectRatio(e){const n=e.contentEl;if(!(e.el&&n&&e.type&&[ea,Jl,xh].includes(e.type)))return;let r,i=e.width||"auto",s=e.height||"auto";if(i==="auto"||s==="auto"){r=this.optionFor(e,"videoRatio");const g=(r+"").match(/(\d+)\s*\/\s?(\d+)/);r=g&&g.length>2?parseFloat(g[1])/parseFloat(g[2]):parseFloat(r+"")}else i&&s&&(r=i/s);if(!r)return;n.style.aspectRatio="",n.style.width="",n.style.height="",n.offsetHeight;const a=n.getBoundingClientRect(),o=a.width||1,p=a.height||1;n.style.aspectRatio=r+"",r<o/p?(s=s==="auto"?p:Math.min(p,s),n.style.width="auto",n.style.height=`${s}px`):(i=i==="auto"?o:Math.min(o,i),n.style.width=`${i}px`,n.style.height="auto")}attach(){const e=this,n=e.instance;n.on("Carousel.beforeInitSlide",e.onBeforeInitSlide),n.on("Carousel.createSlide",e.onCreateSlide),n.on("Carousel.selectSlide",e.onSelectSlide),n.on("Carousel.unselectSlide",e.onUnselectSlide),n.on("Carousel.Panzoom.refresh",e.onRefresh),n.on("done",e.onDone),n.on("clearContent",e.onClearContent),window.addEventListener("message",e.onMessage)}detach(){const e=this,n=e.instance;n.off("Carousel.beforeInitSlide",e.onBeforeInitSlide),n.off("Carousel.createSlide",e.onCreateSlide),n.off("Carousel.selectSlide",e.onSelectSlide),n.off("Carousel.unselectSlide",e.onUnselectSlide),n.off("Carousel.Panzoom.refresh",e.onRefresh),n.off("done",e.onDone),n.off("clearContent",e.onClearContent),window.removeEventListener("message",e.onMessage)}}Object.defineProperty(VE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:x5});const ym="play",bm="pause",vh="ready";class FE extends io{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:vh}),Object.defineProperty(this,"inHover",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"progressBar",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return this.state!==vh}onReady(e){this.option("autoStart")&&(e.isInfinite||e.page<e.pages.length-1)&&this.start()}onChange(){this.removeProgressBar(),this.pause()}onSettle(){this.resume()}onVisibilityChange(){document.visibilityState==="visible"?this.resume():this.pause()}onMouseEnter(){this.inHover=!0,this.pause()}onMouseLeave(){var e;this.inHover=!1,!((e=this.instance.panzoom)===null||e===void 0)&&e.isResting&&this.resume()}onTimerEnd(){const e=this.instance;this.state==="play"&&(e.isInfinite||e.page!==e.pages.length-1?e.slideNext():e.slideTo(0))}removeProgressBar(){this.progressBar&&(this.progressBar.remove(),this.progressBar=null)}createProgressBar(){var e;if(!this.option("showProgress"))return null;this.removeProgressBar();const n=this.instance,r=((e=n.pages[n.page])===null||e===void 0?void 0:e.slides)||[];let i=this.option("progressParentEl");if(i||(i=(r.length===1?r[0].el:null)||n.viewport),!i)return null;const s=document.createElement("div");return Dt(s,"f-progress"),i.prepend(s),this.progressBar=s,s.offsetHeight,s}set(){const e=this,n=e.instance;if(n.pages.length<2||e.timer)return;const r=e.option("timeout");e.state=ym,Dt(n.container,"has-autoplay");let i=e.createProgressBar();i&&(i.style.transitionDuration=`${r}ms`,i.style.transform="scaleX(1)"),e.timer=setTimeout(()=>{e.timer=null,e.inHover||e.onTimerEnd()},r),e.emit("set")}clear(){const e=this;e.timer&&(clearTimeout(e.timer),e.timer=null),e.removeProgressBar()}start(){const e=this;if(e.set(),e.state!==vh){if(e.option("pauseOnHover")){const n=e.instance.container;n.addEventListener("mouseenter",e.onMouseEnter,!1),n.addEventListener("mouseleave",e.onMouseLeave,!1)}document.addEventListener("visibilitychange",e.onVisibilityChange,!1),e.emit("start")}}stop(){const e=this,n=e.state,r=e.instance.container;e.clear(),e.state=vh,r.removeEventListener("mouseenter",e.onMouseEnter,!1),r.removeEventListener("mouseleave",e.onMouseLeave,!1),document.removeEventListener("visibilitychange",e.onVisibilityChange,!1),Pn(r,"has-autoplay"),n!==vh&&e.emit("stop")}pause(){const e=this;e.state===ym&&(e.state=bm,e.clear(),e.emit(bm))}resume(){const e=this,n=e.instance;if(n.isInfinite||n.page!==n.pages.length-1)if(e.state!==ym){if(e.state===bm&&!e.inHover){const r=new Event("resume",{bubbles:!0,cancelable:!0});e.emit("resume",r),r.defaultPrevented||e.set()}}else e.set();else e.stop()}toggle(){this.state===ym||this.state===bm?this.stop():this.start()}attach(){const e=this,n=e.instance;n.on("ready",e.onReady),n.on("Panzoom.startAnimation",e.onChange),n.on("Panzoom.endAnimation",e.onSettle),n.on("Panzoom.touchMove",e.onChange)}detach(){const e=this,n=e.instance;n.off("ready",e.onReady),n.off("Panzoom.startAnimation",e.onChange),n.off("Panzoom.endAnimation",e.onSettle),n.off("Panzoom.touchMove",e.onChange),e.stop()}}Object.defineProperty(FE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}});class $E extends io{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null})}onPrepare(e){const n=e.carousel;if(!n)return;const r=e.container;r&&(n.options.Autoplay=Gi({autoStart:!1},this.option("Autoplay")||{},{pauseOnHover:!1,timeout:this.option("timeout"),progressParentEl:()=>this.option("progressParentEl")||null,on:{start:()=>{e.emit("startSlideshow")},set:i=>{var s;r.classList.add("has-slideshow"),((s=e.getSlide())===null||s===void 0?void 0:s.state)!==hi.Ready&&i.pause()},stop:()=>{r.classList.remove("has-slideshow"),e.isCompact||e.endIdle(),e.emit("endSlideshow")},resume:(i,s)=>{var a,o,p;!s||!s.cancelable||((a=e.getSlide())===null||a===void 0?void 0:a.state)===hi.Ready&&(!((p=(o=e.carousel)===null||o===void 0?void 0:o.panzoom)===null||p===void 0)&&p.isResting)||s.preventDefault()}}}),n.attachPlugins({Autoplay:FE}),this.ref=n.plugins.Autoplay)}onReady(e){const n=e.carousel,r=this.ref;r&&n&&this.option("playOnStart")&&(n.isInfinite||n.page<n.pages.length-1)&&r.start()}onDone(e,n){const r=this.ref,i=e.carousel;if(!r||!i)return;const s=n.panzoom;s&&s.on("startAnimation",()=>{e.isCurrentSlide(n)&&r.stop()}),e.isCurrentSlide(n)&&r.resume()}onKeydown(e,n){var r;const i=this.ref;i&&n===this.option("key")&&((r=document.activeElement)===null||r===void 0?void 0:r.nodeName)!=="BUTTON"&&i.toggle()}attach(){const e=this,n=e.instance;n.on("Carousel.init",e.onPrepare),n.on("Carousel.ready",e.onReady),n.on("done",e.onDone),n.on("keydown",e.onKeydown)}detach(){const e=this,n=e.instance;n.off("Carousel.init",e.onPrepare),n.off("Carousel.ready",e.onReady),n.off("done",e.onDone),n.off("keydown",e.onKeydown)}}Object.defineProperty($E,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{key:" ",playOnStart:!1,progressParentEl:t=>{var e;return((e=t.instance.container)===null||e===void 0?void 0:e.querySelector(".fancybox__toolbar [data-fancybox-toggle-slideshow]"))||t.instance.container},timeout:3e3}});const jE={classes:{container:"f-thumbs f-carousel__thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide",isResting:"is-resting",isSelected:"is-selected",isLoading:"is-loading",hasThumbs:"has-thumbs"},minCount:2,parentEl:null,thumbTpl:'<button class="f-thumbs__slide__button" tabindex="0" type="button" aria-label="{{GOTO}}" data-carousel-index="%i"><img class="f-thumbs__slide__img" data-lazy-src="{{%s}}" alt="" /></button>',type:"modern"};var ta;(function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Hidden=2]="Hidden"})(ta||(ta={}));const HE="isResting",_m="thumbWidth",bd="thumbHeight",wo="thumbClipWidth";let UE=class extends io{constructor(){super(...arguments),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:"modern"}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"thumbWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbClipWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbExtraGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:ta.Init})}get isModern(){return this.type==="modern"}onInitSlide(t,e){const n=e.el?e.el.dataset:void 0;n&&(e.thumbSrc=n.thumbSrc||e.thumbSrc||"",e[wo]=parseFloat(n[wo]||"")||e[wo]||0,e[bd]=parseFloat(n.thumbHeight||"")||e[bd]||0),this.addSlide(e)}onInitSlides(){this.build()}onChange(){var t;if(!this.isModern)return;const e=this.container,n=this.instance,r=n.panzoom,i=this.carousel,s=i?i.panzoom:null,a=n.page;if(r&&i&&s){if(r.isDragging){Pn(e,this.cn(HE));let o=((t=i.pages[a])===null||t===void 0?void 0:t.pos)||0;o+=n.getProgress(a)*(this[wo]+this.thumbGap);let p=s.getBounds();-1*o>p.x.min&&-1*o<p.x.max&&s.panTo({x:-1*o,friction:.12})}else vo(e,this.cn(HE),r.isResting);this.shiftModern()}}onRefresh(){this.updateProps();for(const t of this.instance.slides||[])this.resizeModernSlide(t);this.shiftModern()}isDisabled(){const t=this.option("minCount")||0;if(t){const n=this.instance;let r=0;for(const i of n.slides||[])i.thumbSrc&&r++;if(r<t)return!0}const e=this.option("type");return["modern","classic"].indexOf(e)<0}getThumb(t){const e=this.option("thumbTpl")||"";return{html:this.instance.localize(e,[["%i",t.index],["%d",t.index+1],["%s",t.thumbSrc||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"]])}}addSlide(t){const e=this.carousel;e&&e.addSlide(t.index,this.getThumb(t))}getSlides(){const t=[];for(const e of this.instance.slides||[])t.push(this.getThumb(e));return t}resizeModernSlide(t){this.isModern&&(t[_m]=t[wo]&&t[bd]?Math.round(this[bd]*(t[wo]/t[bd])):this[_m])}updateProps(){const t=this.container;if(!t)return;const e=n=>parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-"+n))||0;this.thumbGap=e("gap"),this.thumbExtraGap=e("extra-gap"),this[_m]=e("width")||40,this[wo]=e("clip-width")||40,this[bd]=e("height")||40}build(){const t=this;if(t.state!==ta.Init)return;if(t.isDisabled())return void t.emit("disabled");const e=t.instance,n=e.container,r=t.getSlides(),i=t.option("type");t.type=i;const s=t.option("parentEl"),a=t.cn("container"),o=t.cn("track");let p=s==null?void 0:s.querySelector("."+a);p||(p=document.createElement("div"),Dt(p,a),s?s.appendChild(p):n.after(p)),Dt(p,`is-${i}`),Dt(n,t.cn("hasThumbs")),t.container=p,t.updateProps();let g=p.querySelector("."+o);g||(g=document.createElement("div"),Dt(g,t.cn("track")),p.appendChild(g)),t.track=g;const y=Gi({},{track:g,infinite:!1,center:!0,fill:i==="classic",dragFree:!0,slidesPerPage:1,transition:!1,preload:.25,friction:.12,Panzoom:{maxVelocity:0},Dots:!1,Navigation:!1,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide"}},t.option("Carousel")||{},{Sync:{target:e},slides:r}),v=new e.constructor(p,y);v.on("createSlide",(E,T)=>{t.setProps(T.index),t.emit("createSlide",T,T.el)}),v.on("ready",()=>{t.shiftModern(),t.emit("ready")}),v.on("refresh",()=>{t.shiftModern()}),v.on("Panzoom.click",(E,T,D)=>{t.onClick(D)}),t.carousel=v,t.state=ta.Ready}onClick(t){t.preventDefault(),t.stopPropagation();const e=this.instance,{pages:n,page:r}=e,i=N=>{if(N){const B=N.closest("[data-carousel-index]");if(B)return[parseInt(B.dataset.carouselIndex||"",10)||0,B]}return[-1,void 0]},s=(N,B)=>{const F=document.elementFromPoint(N,B);return F?i(F):[-1,void 0]};let[a,o]=i(t.target);if(a>-1)return;const p=this[wo],g=t.clientX,y=t.clientY;let[v,E]=s(g-p,y),[T,D]=s(g+p,y);E&&D?(a=Math.abs(g-E.getBoundingClientRect().right)<Math.abs(g-D.getBoundingClientRect().left)?v:T,a===r&&(a=a===v?T:v)):E?a=v:D&&(a=T),a>-1&&n[a]&&e.slideTo(a)}getShift(t){var e;const n=this,{instance:r}=n,i=n.carousel;if(!r||!i)return 0;const s=n[_m],a=n[wo],o=n.thumbGap,p=n.thumbExtraGap;if(!(!((e=i.slides[t])===null||e===void 0)&&e.el))return 0;const g=.5*(s-a),y=r.pages.length-1;let v=r.getProgress(0),E=r.getProgress(y),T=r.getProgress(t,!1,!0),D=0,N=g+p+o;const B=v<0&&v>-1,F=E>0&&E<1;return t===0?(D=N*Math.abs(v),F&&v===1&&(D-=N*Math.abs(E))):t===y?(D=N*Math.abs(E)*-1,B&&E===-1&&(D+=N*Math.abs(v))):B||F?(D=-1*N,D+=N*Math.abs(v),D+=N*(1-Math.abs(E))):D=N*T,D}setProps(t){var e;const n=this;if(!n.isModern)return;const{instance:r}=n,i=n.carousel;if(r&&i){const s=(e=i.slides[t])===null||e===void 0?void 0:e.el;if(s&&s.childNodes.length){let a=ut(1-Math.abs(r.getProgress(t))),o=ut(n.getShift(t));s.style.setProperty("--progress",a?a+"":""),s.style.setProperty("--shift",o+"")}}}shiftModern(){const t=this;if(!t.isModern)return;const{instance:e,track:n}=t,r=e.panzoom,i=t.carousel;if(!(e&&n&&r&&i)||r.state===Bn.Init||r.state===Bn.Destroy)return;for(const a of e.slides)t.setProps(a.index);let s=(t[wo]+t.thumbGap)*(i.slides.length||0);n.style.setProperty("--width",s+"")}cleanup(){const t=this;t.carousel&&t.carousel.destroy(),t.carousel=null,t.container&&t.container.remove(),t.container=null,t.track&&t.track.remove(),t.track=null,t.state=ta.Init,Pn(t.instance.container,t.cn("hasThumbs"))}attach(){const t=this,e=t.instance;e.on("initSlide",t.onInitSlide),e.state===Sr.Init?e.on("initSlides",t.onInitSlides):t.onInitSlides(),e.on(["change","Panzoom.afterTransform"],t.onChange),e.on("Panzoom.refresh",t.onRefresh)}detach(){const t=this,e=t.instance;e.off("initSlide",t.onInitSlide),e.off("initSlides",t.onInitSlides),e.off(["change","Panzoom.afterTransform"],t.onChange),e.off("Panzoom.refresh",t.onRefresh),t.cleanup()}};Object.defineProperty(UE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:jE});const w5=Object.assign(Object.assign({},jE),{key:"t",showOnStart:!0,parentEl:null}),WE="is-masked",qE="aria-hidden";class GE extends io{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isEnabled(){const e=this.ref;return e&&!e.isDisabled()}get isHidden(){return this.hidden}onClick(e,n){n.stopPropagation()}onCreateSlide(e,n){var r,i,s;const a=((s=(i=(r=this.instance)===null||r===void 0?void 0:r.carousel)===null||i===void 0?void 0:i.slides[n.index])===null||s===void 0?void 0:s.type)||"",o=n.el;if(o&&a){let p=`for-${a}`;["video","youtube","vimeo","html5video"].includes(a)&&(p+=" for-video"),Dt(o,p)}}onInit(){var e;const n=this,r=n.instance,i=r.carousel;if(n.ref||!i)return;const s=n.option("parentEl")||r.footer||r.container;if(!s)return;const a=Gi({},n.options,{parentEl:s,classes:{container:"f-thumbs fancybox__thumbs"},Carousel:{Sync:{friction:r.option("Carousel.friction")||0}},on:{ready:o=>{const p=o.container;p&&this.hidden&&(n.refresh(),p.style.transition="none",n.hide(),p.offsetHeight,queueMicrotask(()=>{p.style.transition="",n.show()}))}}});a.Carousel=a.Carousel||{},a.Carousel.on=Gi(((e=n.options.Carousel)===null||e===void 0?void 0:e.on)||{},{click:this.onClick,createSlide:this.onCreateSlide}),i.options.Thumbs=a,i.attachPlugins({Thumbs:UE}),n.ref=i.plugins.Thumbs,n.option("showOnStart")||(n.ref.state=ta.Hidden,n.hidden=!0)}onResize(){var e;const n=(e=this.ref)===null||e===void 0?void 0:e.container;n&&(n.style.maxHeight="")}onKeydown(e,n){const r=this.option("key");r&&r===n&&this.toggle()}toggle(){const e=this.ref;if(e&&!e.isDisabled())return e.state===ta.Hidden?(e.state=ta.Init,void e.build()):void(this.hidden?this.show():this.hide())}show(){const e=this.ref;if(!e||e.isDisabled())return;const n=e.container;n&&(this.refresh(),n.offsetHeight,n.removeAttribute(qE),n.classList.remove(WE),this.hidden=!1)}hide(){const e=this.ref,n=e&&e.container;n&&(this.refresh(),n.offsetHeight,n.classList.add(WE),n.setAttribute(qE,"true")),this.hidden=!0}refresh(){const e=this.ref;if(!e||!e.state)return;const n=e.container,r=(n==null?void 0:n.firstChild)||null;n&&r&&r.childNodes.length&&(n.style.maxHeight=`${r.getBoundingClientRect().height}px`)}attach(){const e=this,n=e.instance;n.state===Lr.Init?n.on("Carousel.init",e.onInit):e.onInit(),n.on("resize",e.onResize),n.on("keydown",e.onKeydown)}detach(){var e;const n=this,r=n.instance;r.off("Carousel.init",n.onInit),r.off("resize",n.onResize),r.off("keydown",n.onKeydown),(e=r.carousel)===null||e===void 0||e.detachPlugins(["Thumbs"]),n.ref=null}}Object.defineProperty(GE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:w5});const kb={panLeft:{icon:'<svg><path d="M5 12h14M5 12l6 6M5 12l6-6"/></svg>',change:{panX:-100}},panRight:{icon:'<svg><path d="M5 12h14M13 18l6-6M13 6l6 6"/></svg>',change:{panX:100}},panUp:{icon:'<svg><path d="M12 5v14M18 11l-6-6M6 11l6-6"/></svg>',change:{panY:-100}},panDown:{icon:'<svg><path d="M12 5v14M18 13l-6 6M6 13l6 6"/></svg>',change:{panY:100}},zoomIn:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M11 8v6M8 11h6"/></svg>',action:"zoomIn"},zoomOut:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"zoomOut"},toggle1to1:{icon:'<svg><path d="M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z"/><path d="M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0"/></svg>',action:"toggleZoom"},toggleZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"toggleZoom"},iterateZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"iterateZoom"},rotateCCW:{icon:'<svg><path d="M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01"/></svg>',action:"rotateCCW"},rotateCW:{icon:'<svg><path d="M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01"/></svg>',action:"rotateCW"},flipX:{icon:'<svg style="stroke-width: 1.3"><path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/></svg>',action:"flipX"},flipY:{icon:'<svg style="stroke-width: 1.3"><path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/></svg>',action:"flipY"},fitX:{icon:'<svg><path d="M4 12V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v6M10 18H3M21 18h-7M6 15l-3 3 3 3M18 15l3 3-3 3"/></svg>',action:"fitX"},fitY:{icon:'<svg><path d="M12 20H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h6M18 14v7M18 3v7M15 18l3 3 3-3M15 6l3-3 3 3"/></svg>',action:"fitY"},reset:{icon:'<svg><path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/></svg>',action:"reset"},toggleFS:{icon:'<svg><g><path d="M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6"/></g><g><path d="m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4"/></g></svg>',action:"toggleFS"}};var Ql;(function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Disabled=2]="Disabled"})(Ql||(Ql={}));const k5={absolute:"auto",display:{left:["infobar"],middle:[],right:["iterateZoom","slideshow","fullscreen","thumbs","close"]},enabled:"auto",items:{infobar:{tpl:'<div class="fancybox__infobar" tabindex="-1"><span data-fancybox-current-index></span>/<span data-fancybox-count></span></div>'},download:{tpl:'<a class="f-button" title="{{DOWNLOAD}}" data-fancybox-download href="javasript:;"><svg><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12"/></svg></a>'},prev:{tpl:'<button class="f-button" title="{{PREV}}" data-fancybox-prev><svg><path d="m15 6-6 6 6 6"/></svg></button>'},next:{tpl:'<button class="f-button" title="{{NEXT}}" data-fancybox-next><svg><path d="m9 6 6 6-6 6"/></svg></button>'},slideshow:{tpl:'<button class="f-button" title="{{TOGGLE_SLIDESHOW}}" data-fancybox-toggle-slideshow><svg><g><path d="M8 4v16l13 -8z"></path></g><g><path d="M8 4v15M17 4v15"/></g></svg></button>'},fullscreen:{tpl:'<button class="f-button" title="{{TOGGLE_FULLSCREEN}}" data-fancybox-toggle-fullscreen><svg><g><path d="M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2M16 4h2a2 2 0 0 1 2 2v2M16 20h2a2 2 0 0 0 2-2v-2"/></g><g><path d="M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5"/></g></svg></button>'},thumbs:{tpl:'<button class="f-button" title="{{TOGGLE_THUMBS}}" data-fancybox-toggle-thumbs><svg><circle cx="5.5" cy="5.5" r="1"/><circle cx="12" cy="5.5" r="1"/><circle cx="18.5" cy="5.5" r="1"/><circle cx="5.5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18.5" cy="12" r="1"/><circle cx="5.5" cy="18.5" r="1"/><circle cx="12" cy="18.5" r="1"/><circle cx="18.5" cy="18.5" r="1"/></svg></button>'},close:{tpl:'<button class="f-button" title="{{CLOSE}}" data-fancybox-close><svg><path d="m19.5 4.5-15 15M4.5 4.5l15 15"/></svg></button>'}},parentEl:null},E5={tabindex:"-1",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},YE="has-toolbar",Eb="fancybox__toolbar";class ZE extends io{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Ql.Init}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null})}onReady(e){var n;if(!e.carousel)return;let r=this.option("display"),i=this.option("absolute"),s=this.option("enabled");if(s==="auto"){const g=this.instance.carousel;let y=0;if(g)for(const v of g.slides)(v.panzoom||v.type==="image")&&y++;y||(s=!1)}s||(r=void 0);let a=0;const o={left:[],middle:[],right:[]};if(r)for(const g of["left","middle","right"])for(const y of r[g]){const v=this.createEl(y);v&&((n=o[g])===null||n===void 0||n.push(v),a++)}let p=null;if(a&&(p=this.createContainer()),p){for(const[g,y]of Object.entries(o)){const v=document.createElement("div");Dt(v,Eb+"__column is-"+g);for(const E of y)v.appendChild(E);i!=="auto"||g!=="middle"||y.length||(i=!0),p.appendChild(v)}i===!0&&Dt(p,"is-absolute"),this.state=Ql.Ready,this.onRefresh()}else this.state=Ql.Disabled}onClick(e){var n,r;const i=this.instance,s=i.getSlide(),a=s==null?void 0:s.panzoom,o=e.target,p=o&&Yi(o)?o.dataset:null;if(!p)return;if(p.fancyboxToggleThumbs!==void 0)return e.preventDefault(),e.stopPropagation(),void((n=i.plugins.Thumbs)===null||n===void 0||n.toggle());if(p.fancyboxToggleFullscreen!==void 0)return e.preventDefault(),e.stopPropagation(),void this.instance.toggleFullscreen();if(p.fancyboxToggleSlideshow!==void 0){e.preventDefault(),e.stopPropagation();const v=(r=i.carousel)===null||r===void 0?void 0:r.plugins.Autoplay;let E=v.isActive;return a&&a.panMode==="mousemove"&&!E&&a.reset(),void(E?v.stop():v.start())}const g=p.panzoomAction,y=p.panzoomChange;if((y||g)&&(e.preventDefault(),e.stopPropagation()),y){let v={};try{v=JSON.parse(y)}catch{}a&&a.applyChange(v)}else g&&a&&a[g]&&a[g]()}onChange(){this.onRefresh()}onRefresh(){if(this.instance.isClosing())return;const e=this.container;if(!e)return;const n=this.instance.getSlide();if(!n||n.state!==hi.Ready)return;const r=n&&!n.error&&n.panzoom;for(const a of e.querySelectorAll("[data-panzoom-action]"))r?(a.removeAttribute("disabled"),a.removeAttribute("tabindex")):(a.setAttribute("disabled",""),a.setAttribute("tabindex","-1"));let i=r&&r.canZoomIn(),s=r&&r.canZoomOut();for(const a of e.querySelectorAll('[data-panzoom-action="zoomIn"]'))i?(a.removeAttribute("disabled"),a.removeAttribute("tabindex")):(a.setAttribute("disabled",""),a.setAttribute("tabindex","-1"));for(const a of e.querySelectorAll('[data-panzoom-action="zoomOut"]'))s?(a.removeAttribute("disabled"),a.removeAttribute("tabindex")):(a.setAttribute("disabled",""),a.setAttribute("tabindex","-1"));for(const a of e.querySelectorAll('[data-panzoom-action="toggleZoom"],[data-panzoom-action="iterateZoom"]')){s||i?(a.removeAttribute("disabled"),a.removeAttribute("tabindex")):(a.setAttribute("disabled",""),a.setAttribute("tabindex","-1"));const o=a.querySelector("g");o&&(o.style.display=i?"":"none")}}onDone(e,n){var r;(r=n.panzoom)===null||r===void 0||r.on("afterTransform",()=>{this.instance.isCurrentSlide(n)&&this.onRefresh()}),this.instance.isCurrentSlide(n)&&this.onRefresh()}createContainer(){const e=this.instance.container;if(!e)return null;const n=this.option("parentEl")||e;let r=n.querySelector("."+Eb);return r||(r=document.createElement("div"),Dt(r,Eb),n.prepend(r)),r.addEventListener("click",this.onClick,{passive:!1,capture:!0}),e&&Dt(e,YE),this.container=r,r}createEl(e){const n=this.instance,r=n.carousel;if(!r||e==="toggleFS"||e==="fullscreen"&&!ME())return null;let i=null;const s=r.slides.length||0;let a=0,o=0;for(const g of r.slides)(g.panzoom||g.type==="image")&&a++,(g.type==="image"||g.downloadSrc)&&o++;if(s<2&&["infobar","prev","next"].includes(e))return i;if(kb[e]!==void 0&&!a||e==="download"&&!o)return null;if(e==="thumbs"){const g=n.plugins.Thumbs;if(!g||!g.isEnabled)return null}if(e==="slideshow"&&(!r.plugins.Autoplay||s<2))return null;if(kb[e]!==void 0){const g=kb[e];i=document.createElement("button"),i.setAttribute("title",this.instance.localize(`{{${e.toUpperCase()}}}`)),Dt(i,"f-button"),g.action&&(i.dataset.panzoomAction=g.action),g.change&&(i.dataset.panzoomChange=JSON.stringify(g.change)),i.appendChild(xo(this.instance.localize(g.icon)))}else{const g=(this.option("items")||[])[e];g&&(i=xo(this.instance.localize(g.tpl)),typeof g.click=="function"&&i.addEventListener("click",y=>{y.preventDefault(),y.stopPropagation(),typeof g.click=="function"&&g.click.call(this,this,y)}))}const p=i==null?void 0:i.querySelector("svg");if(p)for(const[g,y]of Object.entries(E5))p.getAttribute(g)||p.setAttribute(g,String(y));return i}removeContainer(){const e=this.container;e&&e.remove(),this.container=null,this.state=Ql.Disabled;const n=this.instance.container;n&&Pn(n,YE)}attach(){const e=this,n=e.instance;n.on("Carousel.initSlides",e.onReady),n.on("done",e.onDone),n.on(["reveal","Carousel.change"],e.onChange),e.onReady(e.instance)}detach(){const e=this,n=e.instance;n.off("Carousel.initSlides",e.onReady),n.off("done",e.onDone),n.off(["reveal","Carousel.change"],e.onChange),e.removeContainer()}}Object.defineProperty(ZE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:k5});const S5={Hash:class extends io{onReady(){_h=!1}onChange(t){Kl&&clearTimeout(Kl);const{hash:e}=IE(),{hash:n}=mm(),r=t.isOpeningSlide(t.getSlide());r&&(DE=n===e?"":n),e&&e!==n&&(Kl=setTimeout(()=>{try{if(t.state===Lr.Ready){let i="replaceState";r&&!pm&&(i="pushState",pm=!0),window.history[i]({},document.title,window.location.pathname+window.location.search+e)}}catch{}},300))}onClose(t){if(Kl&&clearTimeout(Kl),!_h&&pm)return pm=!1,_h=!1,void window.history.back();if(!_h)try{window.history.replaceState({},document.title,window.location.pathname+window.location.search+(DE||""))}catch{}}attach(){const t=this.instance;t.on("ready",this.onReady),t.on(["Carousel.ready","Carousel.change"],this.onChange),t.on("close",this.onClose)}detach(){const t=this.instance;t.off("ready",this.onReady),t.off(["Carousel.ready","Carousel.change"],this.onChange),t.off("close",this.onClose)}static parseURL(){return mm()}static startFromUrl(){PE()}static destroy(){window.removeEventListener("hashchange",OE,!1)}},Html:VE,Images:BE,Slideshow:$E,Thumbs:GE,Toolbar:ZE},XE="with-fancybox",Sb="hide-scrollbar",KE="--fancybox-scrollbar-compensate",JE="--fancybox-body-margin",Cb="aria-hidden",Tb="is-using-tab",Ab="is-animated",QE="is-compact",e2="is-loading",Mb="is-opening",xm="has-caption",_d="disabled",ec="tabindex",t2="download",Db="href",xd="src",La=t=>typeof t=="string",n2=function(){var t=window.getSelection();return!!t&&t.type==="Range"};let Bs,zs=null,tc=null,r2=0,i2=0,s2=0,o2=0;const vd=new Map;let C5=0;class vn extends fb{get isIdle(){return this.idle}get isCompact(){return this.option("compact")}constructor(e=[],n={},r={}){super(n),Object.defineProperty(this,"userSlides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"idle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"idleTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ignoreFocusChange",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"startedFs",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Init}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"footer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastFocus",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevMouseMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Bs||(Bs=ME()),this.id=n.id||++C5,vd.set(this.id,this),this.userSlides=e,this.userPlugins=r,queueMicrotask(()=>{this.init()})}init(){if(this.state===Lr.Destroy)return;this.state=Lr.Init,this.attachPlugins(Object.assign(Object.assign({},vn.Plugins),this.userPlugins)),this.emit("init"),this.emit("attachPlugins"),this.option("hideScrollbar")===!0&&(()=>{if(!bh)return;const n=document,r=n.body,i=n.documentElement;if(r.classList.contains(Sb))return;let s=window.innerWidth-i.getBoundingClientRect().width;const a=parseFloat(window.getComputedStyle(r).marginRight);s<0&&(s=0),i.style.setProperty(KE,`${s}px`),a&&r.style.setProperty(JE,`${a}px`),r.classList.add(Sb)})(),this.initLayout(),this.scale();const e=()=>{this.initCarousel(this.userSlides),this.state=Lr.Ready,this.attachEvents(),this.emit("ready"),setTimeout(()=>{this.container&&this.container.setAttribute(Cb,"false")},16)};this.option("Fullscreen.autoStart")&&Bs&&!Bs.isFullscreen()?Bs.request().then(()=>{this.startedFs=!0,e()}).catch(()=>e()):e()}initLayout(){var e,n;const r=this.option("parentEl")||document.body,i=xo(this.localize(this.option("tpl.main")||""));if(i){if(i.setAttribute("id",`fancybox-${this.id}`),i.setAttribute("aria-label",this.localize("{{MODAL}}")),i.classList.toggle(QE,this.isCompact),Dt(i,this.option("mainClass")||""),Dt(i,Mb),this.container=i,this.footer=i.querySelector(".fancybox__footer"),r.appendChild(i),Dt(document.documentElement,XE),zs&&tc||(zs=document.createElement("span"),Dt(zs,"fancybox-focus-guard"),zs.setAttribute(ec,"0"),zs.setAttribute(Cb,"true"),zs.setAttribute("aria-label","Focus guard"),tc=zs.cloneNode(),(e=i.parentElement)===null||e===void 0||e.insertBefore(zs,i),(n=i.parentElement)===null||n===void 0||n.append(tc)),i.addEventListener("mousedown",s=>{r2=s.pageX,i2=s.pageY,Pn(i,Tb)}),this.option("closeExisting"))for(const s of vd.values())s.id!==this.id&&s.close();else this.option("animated")&&(Dt(i,Ab),setTimeout(()=>{this.isClosing()||Pn(i,Ab)},350));this.emit("initLayout")}}initCarousel(e){const n=this.container;if(!n)return;const r=n.querySelector(".fancybox__carousel");if(!r)return;const i=this.carousel=new yh(r,Gi({},{slides:e,transition:"fade",Panzoom:{lockAxis:this.option("dragToClose")?"xy":"x",infinite:!!this.option("dragToClose")&&"y"},Dots:!1,Navigation:{classes:{container:"fancybox__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"}},initialPage:this.option("startIndex"),l10n:this.option("l10n")},this.option("Carousel")||{}));i.on("*",(s,a,...o)=>{this.emit(`Carousel.${a}`,s,...o)}),i.on(["ready","change"],()=>{this.manageCaption()}),this.on("Carousel.removeSlide",(s,a,o)=>{this.clearContent(o),o.state=void 0}),i.on("Panzoom.touchStart",()=>{var s,a;this.isCompact||this.endIdle(),!((s=document.activeElement)===null||s===void 0)&&s.closest(".f-thumbs")&&((a=this.container)===null||a===void 0||a.focus())}),i.on("settle",()=>{this.idleTimer||this.isCompact||!this.option("idle")||this.setIdle(),this.option("autoFocus")&&!this.isClosing&&this.checkFocus()}),this.option("dragToClose")&&(i.on("Panzoom.afterTransform",(s,a)=>{const o=this.getSlide();if(o&&cb(o.el))return;const p=this.container;if(p){const g=Math.abs(a.current.f),y=g<1?"":Math.max(.5,Math.min(1,1-g/a.contentRect.fitHeight*1.5));p.style.setProperty("--fancybox-ts",y?"0s":""),p.style.setProperty("--fancybox-opacity",y+"")}}),i.on("Panzoom.touchEnd",(s,a,o)=>{var p;const g=this.getSlide();if(g&&cb(g.el)||a.isMobile&&document.activeElement&&["TEXTAREA","INPUT"].indexOf((p=document.activeElement)===null||p===void 0?void 0:p.nodeName)!==-1)return;const y=Math.abs(a.dragOffset.y);a.lockedAxis==="y"&&(y>=200||y>=50&&a.dragOffset.time<300)&&(o&&o.cancelable&&o.preventDefault(),this.close(o,"f-throwOut"+(a.current.f<0?"Up":"Down")))})),i.on("change",s=>{var a;let o=(a=this.getSlide())===null||a===void 0?void 0:a.triggerEl;if(o){const p=new CustomEvent("slideTo",{bubbles:!0,cancelable:!0,detail:s.page});o.dispatchEvent(p)}}),i.on(["refresh","change"],s=>{const a=this.container;if(!a)return;for(const g of a.querySelectorAll("[data-fancybox-current-index]"))g.innerHTML=s.page+1;for(const g of a.querySelectorAll("[data-fancybox-count]"))g.innerHTML=s.pages.length;if(!s.isInfinite){for(const g of a.querySelectorAll("[data-fancybox-next]"))s.page<s.pages.length-1?(g.removeAttribute(_d),g.removeAttribute(ec)):(g.setAttribute(_d,""),g.setAttribute(ec,"-1"));for(const g of a.querySelectorAll("[data-fancybox-prev]"))s.page>0?(g.removeAttribute(_d),g.removeAttribute(ec)):(g.setAttribute(_d,""),g.setAttribute(ec,"-1"))}const o=this.getSlide();if(!o)return;let p=o.downloadSrc||"";p||o.type!=="image"||o.error||!La(o[xd])||(p=o[xd]);for(const g of a.querySelectorAll("[data-fancybox-download]")){const y=o.downloadFilename;p?(g.removeAttribute(_d),g.removeAttribute(ec),g.setAttribute(Db,p),g.setAttribute(t2,y||p),g.setAttribute("target","_blank")):(g.setAttribute(_d,""),g.setAttribute(ec,"-1"),g.removeAttribute(Db),g.removeAttribute(t2))}}),this.emit("initCarousel")}attachEvents(){const e=this,n=e.container;if(!n)return;n.addEventListener("click",e.onClick,{passive:!1,capture:!1}),n.addEventListener("wheel",e.onWheel,{passive:!1,capture:!1}),document.addEventListener("keydown",e.onKeydown,{passive:!1,capture:!0}),document.addEventListener("visibilitychange",e.onVisibilityChange,!1),document.addEventListener("mousemove",e.onMousemove),e.option("trapFocus")&&document.addEventListener("focus",e.onFocus,!0),window.addEventListener("resize",e.onResize);const r=window.visualViewport;r&&(r.addEventListener("scroll",e.onResize),r.addEventListener("resize",e.onResize))}detachEvents(){const e=this,n=e.container;if(!n)return;document.removeEventListener("keydown",e.onKeydown,{passive:!1,capture:!0}),n.removeEventListener("wheel",e.onWheel,{passive:!1,capture:!1}),n.removeEventListener("click",e.onClick,{passive:!1,capture:!1}),document.removeEventListener("mousemove",e.onMousemove),window.removeEventListener("resize",e.onResize);const r=window.visualViewport;r&&(r.removeEventListener("resize",e.onResize),r.removeEventListener("scroll",e.onResize)),document.removeEventListener("visibilitychange",e.onVisibilityChange,!1),document.removeEventListener("focus",e.onFocus,!0)}scale(){const e=this.container;if(!e)return;const n=window.visualViewport,r=Math.max(1,(n==null?void 0:n.scale)||1);let i="",s="",a="";if(n&&r>1){let o=`${n.offsetLeft}px`,p=`${n.offsetTop}px`;i=n.width*r+"px",s=n.height*r+"px",a=`translate3d(${o}, ${p}, 0) scale(${1/r})`}e.style.transform=a,e.style.width=i,e.style.height=s}onClick(e){var n;const{container:r,isCompact:i}=this;if(!r||this.isClosing())return;!i&&this.option("idle")&&this.resetIdle();const s=e.composedPath()[0];if(s.closest(".fancybox-spinner")||s.closest("[data-fancybox-close]"))return e.preventDefault(),void this.close(e);if(s.closest("[data-fancybox-prev]"))return e.preventDefault(),void this.prev();if(s.closest("[data-fancybox-next]"))return e.preventDefault(),void this.next();if(e.type==="click"&&e.detail===0||Math.abs(e.pageX-r2)>30||Math.abs(e.pageY-i2)>30)return;const a=document.activeElement;if(n2()&&a&&r.contains(a))return;if(i&&((n=this.getSlide())===null||n===void 0?void 0:n.type)==="image")return void(this.clickTimer?(clearTimeout(this.clickTimer),this.clickTimer=null):this.clickTimer=setTimeout(()=>{this.toggleIdle(),this.clickTimer=null},350));if(this.emit("click",e),e.defaultPrevented)return;let o=!1;if(s.closest(".fancybox__content")){if(a){if(a.closest("[contenteditable]"))return;s.matches(_b)||a.blur()}if(n2())return;o=this.option("contentClick")}else s.closest(".fancybox__carousel")&&!s.matches(_b)&&(o=this.option("backdropClick"));o==="close"?(e.preventDefault(),this.close(e)):o==="next"?(e.preventDefault(),this.next()):o==="prev"&&(e.preventDefault(),this.prev())}onWheel(e){const n=e.target;let r=this.option("wheel",e);n.closest(".fancybox__thumbs")&&(r="slide");const i=r==="slide",s=[-e.deltaX||0,-e.deltaY||0,-e.detail||0].reduce(function(p,g){return Math.abs(g)>Math.abs(p)?g:p}),a=Math.max(-1,Math.min(1,s)),o=Date.now();this.pwt&&o-this.pwt<300?i&&e.preventDefault():(this.pwt=o,this.emit("wheel",e,a),e.defaultPrevented||(r==="close"?(e.preventDefault(),this.close(e)):r==="slide"&&(om(n)||(e.preventDefault(),this[a>0?"prev":"next"]()))))}onScroll(){window.scrollTo(s2,o2)}onKeydown(e){if(!this.isTopmost())return;this.isCompact||!this.option("idle")||this.isClosing()||this.resetIdle();const n=e.key,r=this.option("keyboard");if(!r)return;const i=e.composedPath()[0],s=document.activeElement&&document.activeElement.classList,a=s&&s.contains("f-button")||i.dataset.carouselPage||i.dataset.carouselIndex;if(n!=="Escape"&&!a&&Yi(i)&&(i.isContentEditable||["TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].indexOf(i.nodeName)!==-1)||(e.key==="Tab"?Dt(this.container,Tb):Pn(this.container,Tb),e.ctrlKey||e.altKey||e.shiftKey))return;this.emit("keydown",n,e);const o=r[n];o&&typeof this[o]=="function"&&(e.preventDefault(),this[o]())}onResize(){const e=this.container;if(!e)return;const n=this.isCompact;e.classList.toggle(QE,n),this.manageCaption(this.getSlide()),this.isCompact?this.clearIdle():this.endIdle(),this.scale(),this.emit("resize")}onFocus(e){this.isTopmost()&&this.checkFocus(e)}onMousemove(e){this.prevMouseMoveEvent=e,!this.isCompact&&this.option("idle")&&this.resetIdle()}onVisibilityChange(){document.visibilityState==="visible"?this.checkFocus():this.endIdle()}manageCloseBtn(e){const n=this.optionFor(e,"closeButton")||!1;if(n==="auto"){const i=this.plugins.Toolbar;if(i&&i.state===Ql.Ready)return}if(!n||!e.contentEl||e.closeBtnEl)return;const r=this.option("tpl.closeButton");if(r){const i=xo(this.localize(r));e.closeBtnEl=e.contentEl.appendChild(i),e.el&&Dt(e.el,"has-close-btn")}}manageCaption(e=void 0){var n,r;const i="fancybox__caption",s=this.container;if(!s)return;Pn(s,xm);const a=this.isCompact||this.option("commonCaption"),o=!a;if(this.caption&&this.stop(this.caption),o&&this.caption&&(this.caption.remove(),this.caption=null),a&&!this.caption)for(const v of((n=this.carousel)===null||n===void 0?void 0:n.slides)||[])v.captionEl&&(v.captionEl.remove(),v.captionEl=void 0,Pn(v.el,xm),(r=v.el)===null||r===void 0||r.removeAttribute("aria-labelledby"));if(e||(e=this.getSlide()),!e||a&&!this.isCurrentSlide(e))return;const p=e.el;let g=this.optionFor(e,"caption","");if(!g)return void(a&&this.caption&&this.animate(this.caption,"f-fadeOut",()=>{this.caption&&(this.caption.innerHTML="")}));let y=null;if(o){if(y=e.captionEl||null,p&&!y){const v=i+`_${this.id}_${e.index}`;y=document.createElement("div"),Dt(y,i),y.setAttribute("id",v),e.captionEl=p.appendChild(y),Dt(p,xm),p.setAttribute("aria-labelledby",v)}}else y=this.caption,y||(y=s.querySelector("."+i)),!y&&(y=document.createElement("div"),y.dataset.fancyboxCaption="",Dt(y,i),(this.footer||s).prepend(y)),Dt(s,xm),this.caption=y;y&&(y.innerHTML="",La(g)||typeof g=="number"?y.innerHTML=g+"":g instanceof HTMLElement&&y.appendChild(g))}checkFocus(e){this.focus(e)}focus(e){var n;if(this.ignoreFocusChange)return;const r=document.activeElement||null,i=(e==null?void 0:e.target)||null,s=this.container,a=(n=this.carousel)===null||n===void 0?void 0:n.viewport;if(!s||!a||!e&&r&&s.contains(r))return;const o=this.getSlide(),p=o&&o.state===hi.Ready?o.el:null;if(!p||p.contains(r)||s===r)return;e&&e.cancelable&&e.preventDefault(),this.ignoreFocusChange=!0;const g=Array.from(s.querySelectorAll(_b));let y=[],v=null;for(let T of g){const D=!T.offsetParent||!!T.closest('[aria-hidden="true"]'),N=p&&p.contains(T),B=!a.contains(T);if(T===s||(N||B)&&!D){y.push(T);const F=T.dataset.origTabindex;F!==void 0&&F&&(T.tabIndex=parseFloat(F)),T.removeAttribute("data-orig-tabindex"),!T.hasAttribute("autoFocus")&&v||(v=T)}else{const F=T.dataset.origTabindex===void 0?T.getAttribute("tabindex")||"":T.dataset.origTabindex;F&&(T.dataset.origTabindex=F),T.tabIndex=-1}}let E=null;e?(!i||y.indexOf(i)<0)&&(E=v||s,y.length&&(r===tc?E=y[0]:this.lastFocus!==s&&r!==zs||(E=y[y.length-1]))):E=o&&o.type==="image"?s:v||s,E&&AE(E),this.lastFocus=document.activeElement,this.ignoreFocusChange=!1}next(){const e=this.carousel;e&&e.pages.length>1&&e.slideNext()}prev(){const e=this.carousel;e&&e.pages.length>1&&e.slidePrev()}jumpTo(...e){this.carousel&&this.carousel.slideTo(...e)}isTopmost(){var e;return((e=vn.getInstance())===null||e===void 0?void 0:e.id)==this.id}animate(e=null,n="",r){if(!e||!n)return void(r&&r());this.stop(e);const i=s=>{s.target===e&&e.dataset.animationName&&(e.removeEventListener("animationend",i),delete e.dataset.animationName,r&&r(),Pn(e,n))};e.dataset.animationName=n,e.addEventListener("animationend",i),Dt(e,n)}stop(e){e&&e.dispatchEvent(new CustomEvent("animationend",{bubbles:!1,cancelable:!0,currentTarget:e}))}setContent(e,n="",r=!0){if(this.isClosing())return;const i=e.el;if(!i)return;let s=null;if(Yi(n)?s=n:(s=xo(n+""),Yi(s)||(s=document.createElement("div"),s.innerHTML=n+"")),["img","picture","iframe","video","audio"].includes(s.nodeName.toLowerCase())){const a=document.createElement("div");a.appendChild(s),s=a}Yi(s)&&e.filter&&!e.error&&(s=s.querySelector(e.filter)),s&&Yi(s)?(Dt(s,"fancybox__content"),e.id&&s.setAttribute("id",e.id),i.classList.add(`has-${e.error?"error":e.type||"unknown"}`),i.prepend(s),s.style.display==="none"&&(s.style.display=""),getComputedStyle(s).getPropertyValue("display")==="none"&&(s.style.display=e.display||this.option("defaultDisplay")||"flex"),e.contentEl=s,r&&this.revealContent(e),this.manageCloseBtn(e),this.manageCaption(e)):this.setError(e,"{{ELEMENT_NOT_FOUND}}")}revealContent(e,n){const r=e.el,i=e.contentEl;r&&i&&(this.emit("reveal",e),this.hideLoading(e),e.state=hi.Opening,(n=this.isOpeningSlide(e)?n===void 0?this.optionFor(e,"showClass"):n:"f-fadeIn")?this.animate(i,n,()=>{this.done(e)}):this.done(e))}done(e){this.isClosing()||(e.state=hi.Ready,this.emit("done",e),Dt(e.el,"is-done"),this.isCurrentSlide(e)&&this.option("autoFocus")&&queueMicrotask(()=>{var n;(n=e.panzoom)===null||n===void 0||n.updateControls(),this.option("autoFocus")&&this.focus()}),this.isOpeningSlide(e)&&(Pn(this.container,Mb),!this.isCompact&&this.option("idle")&&this.setIdle()))}isCurrentSlide(e){const n=this.getSlide();return!(!e||!n)&&n.index===e.index}isOpeningSlide(e){var n,r;return((n=this.carousel)===null||n===void 0?void 0:n.prevPage)===null&&e&&e.index===((r=this.getSlide())===null||r===void 0?void 0:r.index)}showLoading(e){e.state=hi.Loading;const n=e.el;n&&(Dt(n,e2),this.emit("loading",e),e.spinnerEl||setTimeout(()=>{if(!this.isClosing()&&!e.spinnerEl&&e.state===hi.Loading){let r=xo(pb);Dt(r,"fancybox-spinner"),e.spinnerEl=r,n.prepend(r),this.animate(r,"f-fadeIn")}},250))}hideLoading(e){const n=e.el;if(!n)return;const r=e.spinnerEl;this.isClosing()?r==null||r.remove():(Pn(n,e2),r&&this.animate(r,"f-fadeOut",()=>{r.remove()}),e.state===hi.Loading&&(this.emit("loaded",e),e.state=hi.Ready))}setError(e,n){if(this.isClosing())return;const r=new Event("error",{bubbles:!0,cancelable:!0});if(this.emit("error",r,e),r.defaultPrevented)return;e.error=n,this.hideLoading(e),this.clearContent(e);const i=document.createElement("div");i.classList.add("fancybox-error"),i.innerHTML=this.localize(n||"<p>{{ERROR}}</p>"),this.setContent(e,i)}clearContent(e){if(e.state===void 0)return;this.emit("clearContent",e),e.contentEl&&(e.contentEl.remove(),e.contentEl=void 0);const n=e.el;n&&(Pn(n,"has-error"),Pn(n,"has-unknown"),Pn(n,`has-${e.type||"unknown"}`)),e.closeBtnEl&&e.closeBtnEl.remove(),e.closeBtnEl=void 0,e.captionEl&&e.captionEl.remove(),e.captionEl=void 0,e.spinnerEl&&e.spinnerEl.remove(),e.spinnerEl=void 0}getSlide(){var e;const n=this.carousel;return((e=n==null?void 0:n.pages[n==null?void 0:n.page])===null||e===void 0?void 0:e.slides[0])||void 0}close(e,n){if(this.isClosing())return;const r=new Event("shouldClose",{bubbles:!0,cancelable:!0});if(this.emit("shouldClose",r,e),r.defaultPrevented)return;e&&e.cancelable&&(e.preventDefault(),e.stopPropagation());const i=()=>{this.proceedClose(e,n)};this.startedFs&&Bs&&Bs.isFullscreen()?Promise.resolve(Bs.exit()).then(()=>i()):i()}clearIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null}setIdle(e=!1){const n=()=>{this.clearIdle(),this.idle=!0,Dt(this.container,"is-idle"),this.emit("setIdle")};if(this.clearIdle(),!this.isClosing())if(e)n();else{const r=this.option("idle");r&&(this.idleTimer=setTimeout(n,r))}}endIdle(){this.clearIdle(),this.idle&&!this.isClosing()&&(this.idle=!1,Pn(this.container,"is-idle"),this.emit("endIdle"))}resetIdle(){this.endIdle(),this.setIdle()}toggleIdle(){this.idle?this.endIdle():this.setIdle(!0)}toggleFullscreen(){Bs&&(Bs.isFullscreen()?Bs.exit():Bs.request().then(()=>{this.startedFs=!0}))}isClosing(){return[Lr.Closing,Lr.CustomClosing,Lr.Destroy].includes(this.state)}proceedClose(e,n){var r,i;this.state=Lr.Closing,this.clearIdle(),this.detachEvents();const s=this.container,a=this.carousel,o=this.getSlide(),p=o&&this.option("placeFocusBack")?o.triggerEl||this.option("triggerEl"):null;if(p&&(TE(p)?AE(p):p.focus()),s&&(Pn(s,Mb),Dt(s,"is-closing"),s.setAttribute(Cb,"true"),this.option("animated")&&Dt(s,Ab),s.style.pointerEvents="none"),a){a.clearTransitions(),(r=a.panzoom)===null||r===void 0||r.destroy(),(i=a.plugins.Navigation)===null||i===void 0||i.detach();for(const g of a.slides){g.state=hi.Closing,this.hideLoading(g);const y=g.contentEl;y&&this.stop(y);const v=g==null?void 0:g.panzoom;v&&(v.stop(),v.detachEvents(),v.detachObserver()),this.isCurrentSlide(g)||a.emit("removeSlide",g)}}s2=window.scrollX,o2=window.scrollY,window.addEventListener("scroll",this.onScroll),this.emit("close",e),this.state!==Lr.CustomClosing?(n===void 0&&o&&(n=this.optionFor(o,"hideClass")),n&&o?(this.animate(o.contentEl,n,()=>{a&&a.emit("removeSlide",o)}),setTimeout(()=>{this.destroy()},500)):this.destroy()):setTimeout(()=>{this.destroy()},500)}destroy(){var e;if(this.state===Lr.Destroy)return;window.removeEventListener("scroll",this.onScroll),this.state=Lr.Destroy,(e=this.carousel)===null||e===void 0||e.destroy();const n=this.container;n&&n.remove(),vd.delete(this.id);const r=vn.getInstance();r?r.focus():(zs&&(zs.remove(),zs=null),tc&&(tc.remove(),tc=null),Pn(document.documentElement,XE),(()=>{if(!bh)return;const i=document,s=i.body;s.classList.remove(Sb),s.style.setProperty(JE,""),i.documentElement.style.setProperty(KE,"")})(),this.emit("destroy"))}static bind(e,n,r){if(!bh)return;let i,s="",a={};if(e===void 0?i=document.body:La(e)?(i=document.body,s=e,typeof n=="object"&&(a=n||{})):(i=e,La(n)&&(s=n),typeof r=="object"&&(a=r||{})),!i||!Yi(i))return;s=s||"[data-fancybox]";const o=vn.openers.get(i)||new Map;o.set(s,a),vn.openers.set(i,o),o.size===1&&i.addEventListener("click",vn.fromEvent)}static unbind(e,n){let r,i="";if(La(e)?(r=document.body,i=e):(r=e,La(n)&&(i=n)),!r)return;const s=vn.openers.get(r);s&&i&&s.delete(i),i&&s||(vn.openers.delete(r),r.removeEventListener("click",vn.fromEvent))}static destroy(){let e;for(;e=vn.getInstance();)e.destroy();for(const n of vn.openers.keys())n.removeEventListener("click",vn.fromEvent);vn.openers=new Map}static fromEvent(e){if(e.defaultPrevented||e.button&&e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey)return;let n=e.composedPath()[0];const r=n.closest("[data-fancybox-trigger]");if(r){const D=r.dataset.fancyboxTrigger||"",N=document.querySelectorAll(`[data-fancybox="${D}"]`),B=parseInt(r.dataset.fancyboxIndex||"",10)||0;n=N[B]||n}if(!(n&&n instanceof Element))return;let i,s,a,o;if([...vn.openers].reverse().find(([D,N])=>!(!D.contains(n)||![...N].reverse().find(([B,F])=>{let X=n.closest(B);return!!X&&(i=D,s=B,a=X,o=F,!0)}))),!i||!s||!a)return;o=o||{},e.preventDefault(),n=a;let p=[],g=Gi({},xb,o);g.event=e,g.triggerEl=n,g.delegate=r;const y=g.groupAll,v=g.groupAttr,E=v&&n?n.getAttribute(`${v}`):"";if((!n||E||y)&&(p=[].slice.call(i.querySelectorAll(s))),n&&!y&&(p=E?p.filter(D=>D.getAttribute(`${v}`)===E):[n]),!p.length)return;const T=vn.getInstance();return T&&T.options.triggerEl&&p.indexOf(T.options.triggerEl)>-1?void 0:(n&&(g.startIndex=p.indexOf(n)),vn.fromNodes(p,g))}static fromSelector(e,n,r){let i=null,s="",a={};if(La(e)?(i=document.body,s=e,typeof n=="object"&&(a=n||{})):e instanceof HTMLElement&&La(n)&&(i=e,s=n,typeof r=="object"&&(a=r||{})),!i||!s)return!1;const o=vn.openers.get(i);return!!o&&(a=Gi({},o.get(s)||{},a),!!a&&vn.fromNodes(Array.from(i.querySelectorAll(s)),a))}static fromNodes(e,n){n=Gi({},xb,n||{});const r=[];for(const i of e){const s=i.dataset||{},a=s[xd]||i.getAttribute(Db)||i.getAttribute("currentSrc")||i.getAttribute(xd)||void 0;let o;const p=n.delegate;let g;p&&r.length===n.startIndex&&(o=p instanceof HTMLImageElement?p:p.querySelector("img:not([aria-hidden])")),o||(o=i instanceof HTMLImageElement?i:i.querySelector("img:not([aria-hidden])")),o&&(g=o.currentSrc||o[xd]||void 0,!g&&o.dataset&&(g=o.dataset.lazySrc||o.dataset[xd]||void 0));const y={src:a,triggerEl:i,thumbEl:o,thumbElSrc:g,thumbSrc:g};for(const v in s){let E=s[v]+"";E=E!=="false"&&(E==="true"||E),y[v]=E}r.push(y)}return new vn(r,n)}static getInstance(e){return e?vd.get(e):Array.from(vd.values()).reverse().find(n=>!n.isClosing()&&n)||null}static getSlide(){var e;return((e=vn.getInstance())===null||e===void 0?void 0:e.getSlide())||null}static show(e=[],n={}){return new vn(e,n)}static next(){const e=vn.getInstance();e&&e.next()}static prev(){const e=vn.getInstance();e&&e.prev()}static close(e=!0,...n){if(e)for(const r of vd.values())r.close(...n);else{const r=vn.getInstance();r&&r.close(...n)}}}Object.defineProperty(vn,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.36"}),Object.defineProperty(vn,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:xb}),Object.defineProperty(vn,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:S5}),Object.defineProperty(vn,"openers",{enumerable:!0,configurable:!0,writable:!0,value:new Map});const vm=Object.freeze(Object.defineProperty({__proto__:null,Carousel:yh,Fancybox:vn,Panzoom:yd},Symbol.toStringTag,{value:"Module"})),{Fancybox:wm}=vm,T5={props:{options:Object},mounted(){wm.defaults={...this.options||{}}},updated(){wm.close(),wm.defaults={...this.options||{}}},unmounted(){wm.close()}},A5={ref:"container"};function M5(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",A5,[h.renderSlot(t.$slots,"default")],512)}const D5=Ve(T5,[["render",M5]]),I5={},P5={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-file"};function R5(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",P5,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"},null,-1),h.createElementVNode("path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"},null,-1)]))}const a2=Ve(I5,[["render",R5]]),O5={componens:{IconFile:a2},props:{item:null},computed:{createDate(){try{const t=ft(this.item.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},methods:{formatBytes(t){if(t<1024)return`${t} B`;const e=t/1024;return e<1024?`${e.toFixed(2)} KB`:`${(e/1024).toFixed(2)} MB`}}},N5={class:"max-w-[55vw]"},B5={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},z5={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},L5={class:"px-[5px]"},V5={class:""};function F5(t,e,n,r,i,s){var a,o;return h.openBlock(),h.createElementBlock(h.Fragment,null,[e[1]||(e[1]=h.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),h.createElementVNode("div",N5,[h.createElementVNode("p",B5,h.toDisplayString(n.item.uploaded_name),1),h.createElementVNode("p",z5,[h.createElementVNode("span",null,h.toDisplayString(n.item.username),1),h.withDirectives(h.createElementVNode("span",L5,"|",512),[[h.vShow,(a=n.item)==null?void 0:a.username]]),h.createElementVNode("span",null,h.toDisplayString(s.createDate),1),e[0]||(e[0]=h.createElementVNode("span",{class:"px-[5px]"},"|",-1)),h.createElementVNode("span",V5,h.toDisplayString(s.formatBytes((o=n.item)==null?void 0:o.size)),1)])])],64)}const $5=Ve(O5,[["render",F5]]),j5={},H5={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function U5(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",H5,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),h.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),h.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const l2=Ve(j5,[["render",U5]]),W5={},q5={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function G5(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",q5,e[0]||(e[0]=[h.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const c2=Ve(W5,[["render",G5]]),Y5={components:{Fancybox:D5,VsWidgetFileInfo:$5,IconDownload:l2,IconTrash:c2},props:{item:null},data(){return{optionsFile:{defaultType:"iframe"}}},computed:{createDate(){try{const t=ft(this.item.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},methods:{isSupportedFile(t){return["pdf","txt","json"].includes(t.ext)&&parseInt(t.size,10)<=10485760},async downloadFile(t){const e=document.createElement("a");e.setAttribute("download",t.uploaded_name),e.href=t.file_path,e.click()},confirnDeleteFile(){this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteFile,updateListOnConfirm:!0})},async deleteFile(){try{await tt.delete(`/api/widget/file/${this.item.entity_id}/${this.item.file_id}`),this.$emit("update")}catch(t){console.error(t)}}}},Z5={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},X5={key:0,class:"flex w-full gap-x-3 items-center"},K5=["href"],J5={key:1,class:"flex gap-x-3 w-full items-center"},Q5=["href"],e3={key:2,class:"flex gap-x-3 w-full items-center"},t3={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},n3={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},r3={class:"inline-block"},i3={class:"inline-block"};function s3(t,e,n,r,i,s){const a=h.resolveComponent("VsWidgetFileInfo"),o=h.resolveComponent("Fancybox"),p=h.resolveComponent("IconDownload"),g=h.resolveComponent("IconTrash");return h.openBlock(),h.createElementBlock("div",Z5,[n.item.ext==="jpg"||n.item.ext==="png"?(h.openBlock(),h.createElementBlock("div",X5,[h.createVNode(o,null,{default:h.withCtx(()=>[h.createElementVNode("a",{"data-fancybox":"gallery",href:n.item.file_path,target:"_blank",class:"flex gap-x-3 w-full items-center"},[h.createVNode(a,{item:n.item},null,8,["item"])],8,K5)]),_:1})])):s.isSupportedFile(n.item)?(h.openBlock(),h.createElementBlock("div",J5,[h.createVNode(o,{options:i.optionsFile},{default:h.withCtx(()=>[h.createElementVNode("a",{"data-fancybox":"gallery",href:n.item.file_path,target:"_blank",class:"flex gap-x-3 w-full items-center"},[h.createVNode(a,{item:n.item},null,8,["item"])],8,Q5)]),_:1},8,["options"])])):(h.openBlock(),h.createElementBlock("div",e3,[h.createVNode(a,{item:n.item},null,8,["item"])])),h.createElementVNode("div",t3,[h.createElementVNode("div",n3,[h.createElementVNode("div",r3,[h.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[0]||(e[0]=y=>s.downloadFile(n.item))},[h.createVNode(p,{height:"14",width:"14"})])]),e[2]||(e[2]=h.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),h.createElementVNode("div",i3,[h.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:e[1]||(e[1]=y=>s.confirnDeleteFile())},[h.createVNode(g,{height:"14",width:"14"})])])])])])}const o3=Ve(Y5,[["render",s3]]),a3={props:["text"]},l3={class:"pl-3 text-sm font-medium text-gray-600"};function c3(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("p",l3,h.toDisplayString(n.text),1)])}const d2=Ve(a3,[["render",c3]]),d3={},u3={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-upload"};function h3(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",u3,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),h.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),h.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const u2=Ve(d3,[["render",h3]]),{Fancybox:f3}=vm,p3={components:{VsWidgetFileItem:o3,VsEmptyWidget:d2,IconUpload:u2},props:{id:{type:String,default(){return""}},prefilledData:{}},data(){return{isModalVisible:!1,modal:{},files:"",searchValue:""}},mounted(){this.getFileList()},computed:{filteredFiles(){return this.searchValue===""?this.files:this.files.filter(e=>e.uploaded_name.includes(this.searchValue))}},methods:{async getFileList(){if(this.prefilledData){this.files=this.prefilledData.rows;return}try{const{data:t}=await tt.get(`/api/widget/file/${this.id}`);f3.bind("[data-fancybox='gallery']"),this.files=t==null?void 0:t.rows}catch(t){console.error(t)}},async addFile(t){console.log(t),await Promise.all(Array.from(t.target.files).map(async e=>{const n=new FormData;n.append("file",e);try{const r=`/api/widget/file/${this.id}`;return await tt.post(r,n),this.$emit("update","file-list"),e}catch(r){return console.error(r),null}})),await this.getFileList()},prepareModal(t){const e={...t};return t.cancel||(e.cancel=()=>{this.isModalVisible=!1}),t.updateListOnConfirm&&(e.confirm=async()=>{await t.confirm(),this.isModalVisible=!1,this.getFileList()}),e},handleOpenModal(t){this.modal=this.prepareModal(t),this.isModalVisible=!0}}},m3={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700"},g3={class:"flex w-full mb-[12px] items-baseline gap-x-2"},y3={class:"font-semibold text-gray-800 dark:text-neutral-200"},b3={class1:"ml-auto"},_3={class:"inline-flex cursor-pointer items-center py-[6px] px-[10px] text-sm font-normal text-white duration-300 bg-blue-600 border border-transparent rounded-md gap-x-2 hover:bg-blue-700 hover:text-white"},x3={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},v3={class:"relative"},w3={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},k3={key:0},E3={class:"p-4"},S3={class:"mt-1 text-gray-500 dark:text-neutral-500"},C3={class:"flex justify-end mt-4 gap-x-3"};function T3(t,e,n,r,i,s){var y,v;const a=h.resolveComponent("IconUpload"),o=h.resolveComponent("VsWidgetFileItem"),p=h.resolveComponent("VsEmptyWidget"),g=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock("div",m3,[h.createElementVNode("div",g3,[h.createElementVNode("h2",y3," Кількість: "+h.toDisplayString(i.files.length),1),h.createElementVNode("div",b3,[h.createElementVNode("label",null,[h.createElementVNode("input",{type:"file",class:"hidden",onChange:e[0]||(e[0]=E=>s.addFile(E))},null,32),h.createElementVNode("div",_3,[h.createVNode(a,{height:"16",width:"16"})])])])]),((y=i.files)==null?void 0:y.length)>4?(h.openBlock(),h.createElementBlock("div",x3,[h.createElementVNode("div",null,[h.createElementVNode("div",v3,[e[7]||(e[7]=h.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[h.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[h.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),h.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),h.withDirectives(h.createElementVNode("input",{type:"text","onUpdate:modelValue":e[1]||(e[1]=E=>i.searchValue=E),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[h.vModelText,i.searchValue,void 0,{trim:!0}]])])])])):h.createCommentVNode("",!0),(v=i.files)!=null&&v.length?(h.openBlock(),h.createElementBlock("div",w3,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.filteredFiles,(E,T)=>(h.openBlock(),h.createBlock(o,{key:T,id:n.id,item:E,onUpdate:e[2]||(e[2]=D=>t.$emit("update","file-list")),onOpenModal:e[3]||(e[3]=D=>s.handleOpenModal(D))},null,8,["id","item"]))),128)),s.filteredFiles.length?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",k3,e[8]||(e[8]=[h.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):(h.openBlock(),h.createBlock(p,{key:2,text:"Файли відсутні"})),h.createVNode(g,{title:i.modal.title,size:"small",visible:i.isModalVisible,"onUpdate:visible":e[6]||(e[6]=E=>i.isModalVisible=E)},{default:h.withCtx(()=>[h.createElementVNode("div",E3,[h.createElementVNode("p",S3,h.toDisplayString(i.modal.message),1),h.createElementVNode("div",C3,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=(...E)=>i.modal.cancel&&i.modal.cancel(...E))},h.toDisplayString(i.modal.cancelButtonText),1),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[5]||(e[5]=(...E)=>i.modal.confirm&&i.modal.confirm(...E))},h.toDisplayString(i.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const h2=Ve(p3,[["render",T3]]),A3={class:"flex flex-col vs-widget-images xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700"},M3={class:"flex items-center gap-x-2"},D3={class:"inline-block font-semibold text-gray-800 dark:text-neutral-200"},I3={class:"flex items-center gap-x-2"},P3={class:"inline-flex items-center py-[6px] px-[10px] text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},R3={class:"flex flex-wrap gap-[16px]"},O3=["href","data-caption"],N3=["src","alt"],B3={class:"item__text-content bg-white opacity-0 rounded-b-lg absolute w-full bottom-0 p-3 flex gap-2.5 items-center justify-between"},z3={class:"text-xs w-[180px] block overflow-hidden text-nowrap overflow-ellipsis"},L3={class:"flex flex-wrap items-center text-xs text-gray-600 widget-images__item-desc"},V3={class:"flex items-center"},F3={class:"text-xs"},$3=["onClick"],j3=["onClick"],H3={class:"p-4"},U3={class:"mt-1 text-gray-500 dark:text-neutral-500"},W3={class:"flex justify-end mt-4 gap-x-3"},q3={__name:"vs-widget-gallery",props:{id:{type:String,default:""},readonly:{type:Boolean,default:!1},prefilledData:{type:Array,default:()=>[]}},setup(t){const{Fancybox:e}=vm,n=t,r=h.ref([]),i=h.ref(!1),s=h.ref(null),a=h.ref({}),o=async()=>{var D;if((D=n==null?void 0:n.prefilledData)!=null&&D.length){r.value=n==null?void 0:n.prefilledData,e.bind("[data-fancybox='gallery']");return}try{const{data:N}=await tt.get(`/api/widget/gallery/${n==null?void 0:n.id}`);r.value=N==null?void 0:N.rows,e.bind("[data-fancybox='gallery']")}catch(N){console.error(N)}},p=async D=>{var B;const N=Array.from((B=D.target)==null?void 0:B.files);await Promise.all(N.map(async F=>{const X=new FormData;X.append("file",F);try{await tt.post(`/api/widget/file/${n==null?void 0:n.id}`,X)}catch(te){console.error(te)}})),await o()},g=D=>{const N=document.createElement("a");N.setAttribute("download",D==null?void 0:D.uploaded_name),N.href=D==null?void 0:D.file_path,N.click()},y=D=>{s.value=D,a.value={title:"Ви впевнені?",message:"Ви впевнені що хочете видалити зображення?",confirmButtonText:"Так, видалити ",cancelButtonText:"Відмінити",confirm:async()=>{await v(),i.value=!1,await o()},cancel:()=>{i.value=!1}},i.value=!0},v=async()=>{var D,N;try{await tt.delete(`/api/widget/gallery/${(D=s.value)==null?void 0:D.entity_id}/${(N=s.value)==null?void 0:N.file_id}`)}catch(B){console.error(B)}},E=(D,N=2)=>{if(D===0)return"0 Bytes";const B=1024,F=N<0?0:N,X=["Bytes","KB","MB","GB","TB"],te=Math.floor(Math.log(D)/Math.log(B));return`${parseFloat((D/B**te).toFixed(F))} ${X[te]}`},T=D=>{const N={day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"};return new Date(D).toLocaleDateString("ru-RU",N)};return h.watch(()=>n.id,o),h.onMounted(o),(D,N)=>{const B=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock("div",A3,[h.createElementVNode("div",M3,[h.createElementVNode("h2",D3," Кількість: "+h.toDisplayString(r.value.length),1),h.createElementVNode("div",I3,[h.createElementVNode("div",null,[h.createElementVNode("label",null,[h.createElementVNode("input",{type:"file",class:"hidden",onChange:p},null,32),h.createElementVNode("div",P3,[h.createVNode(u2,{height:"16",width:"16"})])])])])]),h.createElementVNode("div",R3,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.value,F=>(h.openBlock(),h.createElementBlock("div",{key:F.file_path,class:"relative cursor-pointer rounded-b-lg item hover:shadow-lg h-[200px] w-[300px]"},[h.createElementVNode("a",{href:F.file_path,"data-fancybox":"gallery","data-caption":F.uploaded_name,target:"_blank"},[h.createElementVNode("img",{class:"object-cover w-full h-full rounded-lg",src:F.file_path||"/icons/no-image.jpg",alt:F.uploaded_name},null,8,N3),h.createElementVNode("div",B3,[h.createElementVNode("div",null,[h.createElementVNode("span",z3,h.toDisplayString(F.uploaded_name),1),h.createElementVNode("div",L3,[h.createElementVNode("span",V3,h.toDisplayString(E(F.size)),1),h.createElementVNode("span",null,h.toDisplayString(T(F.cdate)),1)]),h.createElementVNode("span",F3,h.toDisplayString(F.username),1)]),h.createElementVNode("div",null,[h.createElementVNode("div",{class:"flex items-center justify-center gap-2 hover:bg-gray-200 p-[6px] rounded",onClick:h.withModifiers(X=>g(F),["prevent"])},[h.createVNode(l2,{height:"14",width:"14"})],8,$3),h.createElementVNode("div",{class:"flex items-center gap-2 hover:bg-gray-200 p-[6px] rounded hover:cursor-pointer",onClick:h.withModifiers(X=>y(F),["prevent"])},[h.createVNode(c2,{height:"14",width:"14"})],8,j3)])])],8,O3)]))),128))]),h.createVNode(B,{title:a.value.title,size:"small",visible:i.value,"onUpdate:visible":N[2]||(N[2]=F=>i.value=F)},{default:h.withCtx(()=>[h.createElementVNode("div",H3,[h.createElementVNode("p",U3,h.toDisplayString(a.value.message),1),h.createElementVNode("div",W3,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:N[0]||(N[0]=(...F)=>a.value.cancel&&a.value.cancel(...F))},h.toDisplayString(a.value.cancelButtonText),1),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600",onClick:N[1]||(N[1]=(...F)=>a.value.confirm&&a.value.confirm(...F))},h.toDisplayString(a.value.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}}};function Qr(t){this.content=t}Qr.prototype={constructor:Qr,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new Qr(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Qr(n)},addToStart:function(t,e){return new Qr([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Qr(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new Qr(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Qr.from(t),t.size?new Qr(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Qr.from(t),t.size?new Qr(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Qr.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},Qr.from=function(t){if(t instanceof Qr)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Qr(e)};function f2(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){let a=f2(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function p2(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let a=t.child(--i),o=e.child(--s),p=a.nodeSize;if(a==o){n-=p,r-=p;continue}if(!a.sameMarkup(o))return{a:n,b:r};if(a.isText&&a.text!=o.text){let g=0,y=Math.min(a.text.length,o.text.length);for(;g<y&&a.text[a.text.length-g-1]==o.text[o.text.length-g-1];)g++,n--,r--;return{a:n,b:r}}if(a.content.size||o.content.size){let g=p2(a.content,o.content,n-1,r-1);if(g)return g}n-=p,r-=p}}class je{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let a=0,o=0;o<n;a++){let p=this.content[a],g=o+p.nodeSize;if(g>e&&r(p,i+o,s||null,a)!==!1&&p.content.size){let y=o+1;p.nodesBetween(Math.max(0,e-y),Math.min(p.content.size,n-y),r,i+y)}o=g}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",a=!0;return this.nodesBetween(e,n,(o,p)=>{let g=o.isText?o.text.slice(Math.max(e,p)-p,n-p):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&g||o.isTextblock)&&r&&(a?a=!1:s+=r),s+=g},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new je(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,a=0;a<n;s++){let o=this.content[s],p=a+o.nodeSize;p>e&&((a<e||p>n)&&(o.isText?o=o.cut(Math.max(0,e-a),Math.min(o.text.length,n-a)):o=o.cut(Math.max(0,e-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=p}return new je(r,i)}cutByIndex(e,n){return e==n?je.empty:e==0&&n==this.content.length?this:new je(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new je(i,s)}addToStart(e){return new je([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new je(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return f2(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return p2(this,e,n,r)}findIndex(e,n=-1){if(e==0)return km(0,e);if(e==this.size)return km(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),a=i+s.nodeSize;if(a>=e)return a==e||n>0?km(r+1,a):km(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return je.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new je(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return je.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new je(n||e,r)}static from(e){if(!e)return je.empty;if(e instanceof je)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new je([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}je.empty=new je([],0);const Ib={index:0,offset:0};function km(t,e){return Ib.index=t,Ib.offset=e,Ib}function Em(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Em(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Em(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Jn=class B1{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Em(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return B1.none;if(e instanceof B1)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Jn.none=[];class Sm extends Error{}class gt{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=g2(this.content,e+this.openStart,n);return r&&new gt(r,this.openStart,this.openEnd)}removeBetween(e,n){return new gt(m2(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return gt.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new gt(je.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new gt(e,r,i)}}gt.empty=new gt(je.empty,0,0);function m2(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:a,offset:o}=t.findIndex(n);if(i==e||s.isText){if(o!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(m2(s.content,e-i-1,n-i-1)))}function g2(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),a=t.maybeChild(i);if(s==e||a.isText)return t.cut(0,e).append(n).append(t.cut(e));let o=g2(a.content,e-s-1,n);return o&&t.replaceChild(i,a.copy(o))}function G3(t,e,n){if(n.openStart>t.depth)throw new Sm("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Sm("Inconsistent open depths");return y2(t,e,n,0)}function y2(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let a=y2(t,e,n,r+1);return s.copy(s.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,o=a.content;return rc(a,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:a,end:o}=Y3(n,t);return rc(s,_2(t,a,o,e,r))}else return rc(s,Cm(t,e,r))}function b2(t,e){if(!e.type.compatibleContent(t.type))throw new Sm("Cannot join "+e.type.name+" onto "+t.type.name)}function Pb(t,e,n){let r=t.node(n);return b2(r,e.node(n)),r}function nc(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function wh(t,e,n,r){let i=(e||t).node(n),s=0,a=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(nc(t.nodeAfter,r),s++));for(let o=s;o<a;o++)nc(i.child(o),r);e&&e.depth==n&&e.textOffset&&nc(e.nodeBefore,r)}function rc(t,e){return t.type.checkContent(e),t.copy(e)}function _2(t,e,n,r,i){let s=t.depth>i&&Pb(t,e,i+1),a=r.depth>i&&Pb(n,r,i+1),o=[];return wh(null,t,i,o),s&&a&&e.index(i)==n.index(i)?(b2(s,a),nc(rc(s,_2(t,e,n,r,i+1)),o)):(s&&nc(rc(s,Cm(t,e,i+1)),o),wh(e,n,i,o),a&&nc(rc(a,Cm(n,r,i+1)),o)),wh(r,null,i,o),new je(o)}function Cm(t,e,n){let r=[];if(wh(null,t,n,r),t.depth>n){let i=Pb(t,e,n+1);nc(rc(i,Cm(t,e,n+1)),r)}return wh(e,null,n,r),new je(r)}function Y3(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(je.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class kh{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Jn.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let o=r;r=i,i=o}let s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Tm(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let a=e;;){let{index:o,offset:p}=a.content.findIndex(s),g=s-p;if(r.push(a,o,i+p),!g||(a=a.child(o),a.isText))break;s=g-1,i+=p+1}return new kh(n,r,s)}static resolveCached(e,n){let r=x2.get(e);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==n)return a}else x2.set(e,r=new Z3);let i=r.elts[r.i]=kh.resolve(e,n);return r.i=(r.i+1)%X3,i}}class Z3{constructor(){this.elts=[],this.i=0}}const X3=12,x2=new WeakMap;class Tm{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const K3=Object.create(null);let Va=class z1{constructor(e,n,r,i=Jn.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||je.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Em(this.attrs,n||e.defaultAttrs||K3)&&Jn.sameSet(this.marks,r||Jn.none)}copy(e=null){return e==this.content?this:new z1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new z1(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return gt.empty;let i=this.resolve(e),s=this.resolve(n),a=r?0:i.sharedDepth(n),o=i.start(a),g=i.node(a).content.cut(i.pos-o,s.pos-o);return new gt(g,i.depth-a,s.depth-a)}replace(e,n,r){return G3(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return kh.resolveCached(this,e)}resolveNoCache(e){return kh.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),v2(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=je.empty,i=0,s=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,s),o=a&&a.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let p=i;p<s;p++)if(!this.type.allowsMarks(r.child(p).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),a=s&&s.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Jn.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Jn.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=je.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Va.prototype.text=void 0;class Am extends Va{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):v2(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Am(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Am(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function v2(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ic{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new J3(e,n);if(r.next==null)return ic.empty;let i=w2(r);r.next&&r.err("Unexpected trailing text");let s=sF(iF(i));return oF(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(a,o){let p=a.matchFragment(e,r);if(p&&(!n||p.validEnd))return je.from(o.map(g=>g.createAndFill()));for(let g=0;g<a.next.length;g++){let{type:y,next:v}=a.next[g];if(!(y.isText||y.hasRequiredAttrs())&&i.indexOf(v)==-1){i.push(v);let E=s(v,o.concat(y));if(E)return E}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let o=i;o.type;o=o.via)a.push(o.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:o,next:p}=s.next[a];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||p.validEnd)&&(r.push({match:o.contentMatch,type:o,via:i}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return s}).join(`
|
629
|
+
<source src="{{src}}" type="{{format}}" />Sorry, your browser doesn't support embedded videos.</video>`,videoFormat:"",vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}},v5=["image","html","ajax","inline","clone","iframe","map","pdf","html5video","youtube","vimeo"];class VE extends io{onBeforeInitSlide(e,n,r){this.processType(r)}onCreateSlide(e,n,r){this.setContent(r)}onClearContent(e,n){n.xhr&&(n.xhr.abort(),n.xhr=null);const r=n.iframeEl;r&&(r.onload=r.onerror=null,r.src="//about:blank",n.iframeEl=null);const i=n.contentEl,s=n.placeholderEl;if(n.type==="inline"&&i&&s)i.classList.remove("fancybox__content"),getComputedStyle(i).getPropertyValue("display")!=="none"&&(i.style.display="none"),setTimeout(()=>{s&&(i&&s.parentNode&&s.parentNode.insertBefore(i,s),s.remove())},0),n.contentEl=void 0,n.placeholderEl=void 0;else for(;n.el&&n.el.firstChild;)n.el.removeChild(n.el.firstChild)}onSelectSlide(e,n,r){r.state===hi.Ready&&this.playVideo()}onUnselectSlide(e,n,r){var i,s;if(r.type===xh){try{(s=(i=r.el)===null||i===void 0?void 0:i.querySelector("video"))===null||s===void 0||s.pause()}catch{}return}let a;r.type===Jl?a={method:"pause",value:"true"}:r.type===ea&&(a={event:"command",func:"pauseVideo"}),a&&r.iframeEl&&r.iframeEl.contentWindow&&r.iframeEl.contentWindow.postMessage(JSON.stringify(a),"*"),r.poller&&clearTimeout(r.poller)}onDone(e,n){e.isCurrentSlide(n)&&!e.isClosing()&&this.playVideo()}onRefresh(e,n){n.slides.forEach(r=>{r.el&&(this.resizeIframe(r),this.setAspectRatio(r))})}onMessage(e){try{let n=JSON.parse(e.data);if(e.origin==="https://player.vimeo.com"){if(n.event==="ready")for(let r of Array.from(document.getElementsByClassName("fancybox__iframe")))r instanceof HTMLIFrameElement&&r.contentWindow===e.source&&(r.dataset.ready="true")}else if(e.origin.match(/^https:\/\/(www.)?youtube(-nocookie)?.com$/)&&n.event==="onReady"){const r=document.getElementById(n.id);r&&(r.dataset.ready="true")}}catch{}}loadAjaxContent(e){const n=this.instance.optionFor(e,"src")||"";this.instance.showLoading(e);const r=this.instance,i=new XMLHttpRequest;r.showLoading(e),i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&r.state===Lr.Ready&&(r.hideLoading(e),i.status===200?r.setContent(e,i.responseText):r.setError(e,i.status===404?"{{AJAX_NOT_FOUND}}":"{{AJAX_FORBIDDEN}}"))};const s=e.ajax||null;i.open(s?"POST":"GET",n+""),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(s),e.xhr=i}setInlineContent(e){let n=null;if(Yi(e.src))n=e.src;else if(typeof e.src=="string"){const r=e.src.split("#",2).pop();n=r?document.getElementById(r):null}if(n){if(e.type==="clone"||n.closest(".fancybox__slide")){n=n.cloneNode(!0);const r=n.dataset.animationName;r&&(n.classList.remove(r),delete n.dataset.animationName);let i=n.getAttribute("id");i=i?`${i}--clone`:`clone-${this.instance.id}-${e.index}`,n.setAttribute("id",i)}else if(n.parentNode){const r=document.createElement("div");r.classList.add("fancybox-placeholder"),n.parentNode.insertBefore(r,n),e.placeholderEl=r}this.instance.setContent(e,n)}else this.instance.setError(e,"{{ELEMENT_NOT_FOUND}}")}setIframeContent(e){const{src:n,el:r}=e;if(!n||typeof n!="string"||!r)return;r.classList.add("is-loading");const i=this.instance,s=document.createElement("iframe");s.className="fancybox__iframe",s.setAttribute("id",`fancybox__iframe_${i.id}_${e.index}`);for(const[o,p]of Object.entries(this.optionFor(e,"iframeAttr")||{}))s.setAttribute(o,p);s.onerror=()=>{i.setError(e,"{{IFRAME_ERROR}}")},e.iframeEl=s;const a=this.optionFor(e,"preload");if(e.type!=="iframe"||a===!1)return s.setAttribute("src",e.src+""),i.setContent(e,s,!1),this.resizeIframe(e),void i.revealContent(e);i.showLoading(e),s.onload=()=>{if(!s.src.length)return;const o=s.dataset.ready!=="true";s.dataset.ready="true",this.resizeIframe(e),o?i.revealContent(e):i.hideLoading(e)},s.setAttribute("src",n),i.setContent(e,s,!1)}resizeIframe(e){const{type:n,iframeEl:r}=e;if(n===ea||n===Jl)return;const i=r==null?void 0:r.parentElement;if(!r||!i)return;let s=e.autoSize;s===void 0&&(s=this.optionFor(e,"autoSize"));let a=e.width||0,o=e.height||0;a&&o&&(s=!1);const p=i&&i.style;if(e.preload!==!1&&s!==!1&&p)try{const g=window.getComputedStyle(i),y=parseFloat(g.paddingLeft)+parseFloat(g.paddingRight),v=parseFloat(g.paddingTop)+parseFloat(g.paddingBottom),E=r.contentWindow;if(E){const T=E.document,D=T.getElementsByTagName(vb)[0],N=T.body;p.width="",N.style.overflow="hidden",a=a||D.scrollWidth+y,p.width=`${a}px`,N.style.overflow="",p.flex="0 0 auto",p.height=`${N.scrollHeight}px`,o=D.scrollHeight+v}}catch{}if(a||o){const g={flex:"0 1 auto",width:"",height:""};a&&a!=="auto"&&(g.width=`${a}px`),o&&o!=="auto"&&(g.height=`${o}px`),Object.assign(p,g)}}playVideo(){const e=this.instance.getSlide();if(!e)return;const{el:n}=e;if(!n||!n.offsetParent||!this.optionFor(e,"videoAutoplay"))return;if(e.type===xh)try{const i=n.querySelector("video");if(i){const s=i.play();s!==void 0&&s.then(()=>{}).catch(a=>{i.muted=!0,i.play()})}}catch{}if(e.type!==ea&&e.type!==Jl)return;const r=()=>{if(e.iframeEl&&e.iframeEl.contentWindow){let i;if(e.iframeEl.dataset.ready==="true")return i=e.type===ea?{event:"command",func:"playVideo"}:{method:"play",value:"true"},i&&e.iframeEl.contentWindow.postMessage(JSON.stringify(i),"*"),void(e.poller=void 0);e.type===ea&&(i={event:"listening",id:e.iframeEl.getAttribute("id")},e.iframeEl.contentWindow.postMessage(JSON.stringify(i),"*"))}e.poller=setTimeout(r,250)};r()}processType(e){if(e.html)return e.type=vb,e.src=e.html,void(e.html="");const n=this.instance.optionFor(e,"src","");if(!n||typeof n!="string")return;let r=e.type,i=null;if(i=n.match(/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|shorts\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listType=(?:.*)&list=(?:.*))(?:.*)/i)){const s=this.optionFor(e,ea),{nocookie:a}=s,o=function(v,E){var T={};for(var D in v)Object.prototype.hasOwnProperty.call(v,D)&&E.indexOf(D)<0&&(T[D]=v[D]);if(v!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(D=Object.getOwnPropertySymbols(v);N<D.length;N++)E.indexOf(D[N])<0&&Object.prototype.propertyIsEnumerable.call(v,D[N])&&(T[D[N]]=v[D[N]])}return T}(s,["nocookie"]),p=`www.youtube${a?"-nocookie":""}.com`,g=LE(n,o),y=encodeURIComponent(i[2]);e.videoId=y,e.src=`https://${p}/embed/${y}?${g}`,e.thumbSrc=e.thumbSrc||`https://i.ytimg.com/vi/${y}/mqdefault.jpg`,r=ea}else if(i=n.match(/^.+vimeo.com\/(?:\/)?([\d]+)((\/|\?h=)([a-z0-9]+))?(.*)?/)){const s=LE(n,this.optionFor(e,Jl)),a=encodeURIComponent(i[1]),o=i[4]||"";e.videoId=a,e.src=`https://player.vimeo.com/video/${a}?${o?`h=${o}${s?"&":""}`:""}${s}`,r=Jl}if(!r&&e.triggerEl){const s=e.triggerEl.dataset.type;v5.includes(s)&&(r=s)}r||typeof n=="string"&&(n.charAt(0)==="#"?r="inline":(i=n.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(r=xh,e.videoFormat=e.videoFormat||"video/"+(i[1]==="ogv"?"ogg":i[1])):n.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?r=zE:n.match(/\.(pdf)((\?|#).*)?$/i)&&(r="pdf")),(i=n.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i))?(e.src=`https://maps.google.${i[1]}/?ll=${(i[2]?i[2]+"&z="+Math.floor(parseFloat(i[3]))+(i[4]?i[4].replace(/^\//,"&"):""):i[4]+"").replace(/\?/,"&")}&output=${i[4]&&i[4].indexOf("layer=c")>0?"svembed":"embed"}`,r=wb):(i=n.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i))&&(e.src=`https://maps.google.${i[1]}/maps?q=${i[2].replace("query=","q=").replace("api=1","")}&output=embed`,r=wb),r=r||this.instance.option("defaultType"),e.type=r,r===zE&&(e.thumbSrc=e.thumbSrc||e.src)}setContent(e){const n=this.instance.optionFor(e,"src")||"";if(e&&e.type&&n){switch(e.type){case vb:this.instance.setContent(e,n);break;case xh:const r=this.option("videoTpl");r&&this.instance.setContent(e,r.replace(/\{\{src\}\}/gi,n+"").replace(/\{\{format\}\}/gi,this.optionFor(e,"videoFormat")||"").replace(/\{\{poster\}\}/gi,e.poster||e.thumbSrc||""));break;case"inline":case"clone":this.setInlineContent(e);break;case"ajax":this.loadAjaxContent(e);break;case"pdf":case wb:case ea:case Jl:e.preload=!1;case"iframe":this.setIframeContent(e)}this.setAspectRatio(e)}}setAspectRatio(e){const n=e.contentEl;if(!(e.el&&n&&e.type&&[ea,Jl,xh].includes(e.type)))return;let r,i=e.width||"auto",s=e.height||"auto";if(i==="auto"||s==="auto"){r=this.optionFor(e,"videoRatio");const g=(r+"").match(/(\d+)\s*\/\s?(\d+)/);r=g&&g.length>2?parseFloat(g[1])/parseFloat(g[2]):parseFloat(r+"")}else i&&s&&(r=i/s);if(!r)return;n.style.aspectRatio="",n.style.width="",n.style.height="",n.offsetHeight;const a=n.getBoundingClientRect(),o=a.width||1,p=a.height||1;n.style.aspectRatio=r+"",r<o/p?(s=s==="auto"?p:Math.min(p,s),n.style.width="auto",n.style.height=`${s}px`):(i=i==="auto"?o:Math.min(o,i),n.style.width=`${i}px`,n.style.height="auto")}attach(){const e=this,n=e.instance;n.on("Carousel.beforeInitSlide",e.onBeforeInitSlide),n.on("Carousel.createSlide",e.onCreateSlide),n.on("Carousel.selectSlide",e.onSelectSlide),n.on("Carousel.unselectSlide",e.onUnselectSlide),n.on("Carousel.Panzoom.refresh",e.onRefresh),n.on("done",e.onDone),n.on("clearContent",e.onClearContent),window.addEventListener("message",e.onMessage)}detach(){const e=this,n=e.instance;n.off("Carousel.beforeInitSlide",e.onBeforeInitSlide),n.off("Carousel.createSlide",e.onCreateSlide),n.off("Carousel.selectSlide",e.onSelectSlide),n.off("Carousel.unselectSlide",e.onUnselectSlide),n.off("Carousel.Panzoom.refresh",e.onRefresh),n.off("done",e.onDone),n.off("clearContent",e.onClearContent),window.removeEventListener("message",e.onMessage)}}Object.defineProperty(VE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:x5});const ym="play",bm="pause",vh="ready";class FE extends io{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:vh}),Object.defineProperty(this,"inHover",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"progressBar",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return this.state!==vh}onReady(e){this.option("autoStart")&&(e.isInfinite||e.page<e.pages.length-1)&&this.start()}onChange(){this.removeProgressBar(),this.pause()}onSettle(){this.resume()}onVisibilityChange(){document.visibilityState==="visible"?this.resume():this.pause()}onMouseEnter(){this.inHover=!0,this.pause()}onMouseLeave(){var e;this.inHover=!1,!((e=this.instance.panzoom)===null||e===void 0)&&e.isResting&&this.resume()}onTimerEnd(){const e=this.instance;this.state==="play"&&(e.isInfinite||e.page!==e.pages.length-1?e.slideNext():e.slideTo(0))}removeProgressBar(){this.progressBar&&(this.progressBar.remove(),this.progressBar=null)}createProgressBar(){var e;if(!this.option("showProgress"))return null;this.removeProgressBar();const n=this.instance,r=((e=n.pages[n.page])===null||e===void 0?void 0:e.slides)||[];let i=this.option("progressParentEl");if(i||(i=(r.length===1?r[0].el:null)||n.viewport),!i)return null;const s=document.createElement("div");return Dt(s,"f-progress"),i.prepend(s),this.progressBar=s,s.offsetHeight,s}set(){const e=this,n=e.instance;if(n.pages.length<2||e.timer)return;const r=e.option("timeout");e.state=ym,Dt(n.container,"has-autoplay");let i=e.createProgressBar();i&&(i.style.transitionDuration=`${r}ms`,i.style.transform="scaleX(1)"),e.timer=setTimeout(()=>{e.timer=null,e.inHover||e.onTimerEnd()},r),e.emit("set")}clear(){const e=this;e.timer&&(clearTimeout(e.timer),e.timer=null),e.removeProgressBar()}start(){const e=this;if(e.set(),e.state!==vh){if(e.option("pauseOnHover")){const n=e.instance.container;n.addEventListener("mouseenter",e.onMouseEnter,!1),n.addEventListener("mouseleave",e.onMouseLeave,!1)}document.addEventListener("visibilitychange",e.onVisibilityChange,!1),e.emit("start")}}stop(){const e=this,n=e.state,r=e.instance.container;e.clear(),e.state=vh,r.removeEventListener("mouseenter",e.onMouseEnter,!1),r.removeEventListener("mouseleave",e.onMouseLeave,!1),document.removeEventListener("visibilitychange",e.onVisibilityChange,!1),Pn(r,"has-autoplay"),n!==vh&&e.emit("stop")}pause(){const e=this;e.state===ym&&(e.state=bm,e.clear(),e.emit(bm))}resume(){const e=this,n=e.instance;if(n.isInfinite||n.page!==n.pages.length-1)if(e.state!==ym){if(e.state===bm&&!e.inHover){const r=new Event("resume",{bubbles:!0,cancelable:!0});e.emit("resume",r),r.defaultPrevented||e.set()}}else e.set();else e.stop()}toggle(){this.state===ym||this.state===bm?this.stop():this.start()}attach(){const e=this,n=e.instance;n.on("ready",e.onReady),n.on("Panzoom.startAnimation",e.onChange),n.on("Panzoom.endAnimation",e.onSettle),n.on("Panzoom.touchMove",e.onChange)}detach(){const e=this,n=e.instance;n.off("ready",e.onReady),n.off("Panzoom.startAnimation",e.onChange),n.off("Panzoom.endAnimation",e.onSettle),n.off("Panzoom.touchMove",e.onChange),e.stop()}}Object.defineProperty(FE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}});class $E extends io{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null})}onPrepare(e){const n=e.carousel;if(!n)return;const r=e.container;r&&(n.options.Autoplay=Gi({autoStart:!1},this.option("Autoplay")||{},{pauseOnHover:!1,timeout:this.option("timeout"),progressParentEl:()=>this.option("progressParentEl")||null,on:{start:()=>{e.emit("startSlideshow")},set:i=>{var s;r.classList.add("has-slideshow"),((s=e.getSlide())===null||s===void 0?void 0:s.state)!==hi.Ready&&i.pause()},stop:()=>{r.classList.remove("has-slideshow"),e.isCompact||e.endIdle(),e.emit("endSlideshow")},resume:(i,s)=>{var a,o,p;!s||!s.cancelable||((a=e.getSlide())===null||a===void 0?void 0:a.state)===hi.Ready&&(!((p=(o=e.carousel)===null||o===void 0?void 0:o.panzoom)===null||p===void 0)&&p.isResting)||s.preventDefault()}}}),n.attachPlugins({Autoplay:FE}),this.ref=n.plugins.Autoplay)}onReady(e){const n=e.carousel,r=this.ref;r&&n&&this.option("playOnStart")&&(n.isInfinite||n.page<n.pages.length-1)&&r.start()}onDone(e,n){const r=this.ref,i=e.carousel;if(!r||!i)return;const s=n.panzoom;s&&s.on("startAnimation",()=>{e.isCurrentSlide(n)&&r.stop()}),e.isCurrentSlide(n)&&r.resume()}onKeydown(e,n){var r;const i=this.ref;i&&n===this.option("key")&&((r=document.activeElement)===null||r===void 0?void 0:r.nodeName)!=="BUTTON"&&i.toggle()}attach(){const e=this,n=e.instance;n.on("Carousel.init",e.onPrepare),n.on("Carousel.ready",e.onReady),n.on("done",e.onDone),n.on("keydown",e.onKeydown)}detach(){const e=this,n=e.instance;n.off("Carousel.init",e.onPrepare),n.off("Carousel.ready",e.onReady),n.off("done",e.onDone),n.off("keydown",e.onKeydown)}}Object.defineProperty($E,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{key:" ",playOnStart:!1,progressParentEl:t=>{var e;return((e=t.instance.container)===null||e===void 0?void 0:e.querySelector(".fancybox__toolbar [data-fancybox-toggle-slideshow]"))||t.instance.container},timeout:3e3}});const jE={classes:{container:"f-thumbs f-carousel__thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide",isResting:"is-resting",isSelected:"is-selected",isLoading:"is-loading",hasThumbs:"has-thumbs"},minCount:2,parentEl:null,thumbTpl:'<button class="f-thumbs__slide__button" tabindex="0" type="button" aria-label="{{GOTO}}" data-carousel-index="%i"><img class="f-thumbs__slide__img" data-lazy-src="{{%s}}" alt="" /></button>',type:"modern"};var ta;(function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Hidden=2]="Hidden"})(ta||(ta={}));const HE="isResting",_m="thumbWidth",bd="thumbHeight",wo="thumbClipWidth";let UE=class extends io{constructor(){super(...arguments),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:"modern"}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"thumbWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbClipWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbExtraGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:ta.Init})}get isModern(){return this.type==="modern"}onInitSlide(t,e){const n=e.el?e.el.dataset:void 0;n&&(e.thumbSrc=n.thumbSrc||e.thumbSrc||"",e[wo]=parseFloat(n[wo]||"")||e[wo]||0,e[bd]=parseFloat(n.thumbHeight||"")||e[bd]||0),this.addSlide(e)}onInitSlides(){this.build()}onChange(){var t;if(!this.isModern)return;const e=this.container,n=this.instance,r=n.panzoom,i=this.carousel,s=i?i.panzoom:null,a=n.page;if(r&&i&&s){if(r.isDragging){Pn(e,this.cn(HE));let o=((t=i.pages[a])===null||t===void 0?void 0:t.pos)||0;o+=n.getProgress(a)*(this[wo]+this.thumbGap);let p=s.getBounds();-1*o>p.x.min&&-1*o<p.x.max&&s.panTo({x:-1*o,friction:.12})}else vo(e,this.cn(HE),r.isResting);this.shiftModern()}}onRefresh(){this.updateProps();for(const t of this.instance.slides||[])this.resizeModernSlide(t);this.shiftModern()}isDisabled(){const t=this.option("minCount")||0;if(t){const n=this.instance;let r=0;for(const i of n.slides||[])i.thumbSrc&&r++;if(r<t)return!0}const e=this.option("type");return["modern","classic"].indexOf(e)<0}getThumb(t){const e=this.option("thumbTpl")||"";return{html:this.instance.localize(e,[["%i",t.index],["%d",t.index+1],["%s",t.thumbSrc||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"]])}}addSlide(t){const e=this.carousel;e&&e.addSlide(t.index,this.getThumb(t))}getSlides(){const t=[];for(const e of this.instance.slides||[])t.push(this.getThumb(e));return t}resizeModernSlide(t){this.isModern&&(t[_m]=t[wo]&&t[bd]?Math.round(this[bd]*(t[wo]/t[bd])):this[_m])}updateProps(){const t=this.container;if(!t)return;const e=n=>parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-"+n))||0;this.thumbGap=e("gap"),this.thumbExtraGap=e("extra-gap"),this[_m]=e("width")||40,this[wo]=e("clip-width")||40,this[bd]=e("height")||40}build(){const t=this;if(t.state!==ta.Init)return;if(t.isDisabled())return void t.emit("disabled");const e=t.instance,n=e.container,r=t.getSlides(),i=t.option("type");t.type=i;const s=t.option("parentEl"),a=t.cn("container"),o=t.cn("track");let p=s==null?void 0:s.querySelector("."+a);p||(p=document.createElement("div"),Dt(p,a),s?s.appendChild(p):n.after(p)),Dt(p,`is-${i}`),Dt(n,t.cn("hasThumbs")),t.container=p,t.updateProps();let g=p.querySelector("."+o);g||(g=document.createElement("div"),Dt(g,t.cn("track")),p.appendChild(g)),t.track=g;const y=Gi({},{track:g,infinite:!1,center:!0,fill:i==="classic",dragFree:!0,slidesPerPage:1,transition:!1,preload:.25,friction:.12,Panzoom:{maxVelocity:0},Dots:!1,Navigation:!1,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide"}},t.option("Carousel")||{},{Sync:{target:e},slides:r}),v=new e.constructor(p,y);v.on("createSlide",(E,T)=>{t.setProps(T.index),t.emit("createSlide",T,T.el)}),v.on("ready",()=>{t.shiftModern(),t.emit("ready")}),v.on("refresh",()=>{t.shiftModern()}),v.on("Panzoom.click",(E,T,D)=>{t.onClick(D)}),t.carousel=v,t.state=ta.Ready}onClick(t){t.preventDefault(),t.stopPropagation();const e=this.instance,{pages:n,page:r}=e,i=N=>{if(N){const B=N.closest("[data-carousel-index]");if(B)return[parseInt(B.dataset.carouselIndex||"",10)||0,B]}return[-1,void 0]},s=(N,B)=>{const F=document.elementFromPoint(N,B);return F?i(F):[-1,void 0]};let[a,o]=i(t.target);if(a>-1)return;const p=this[wo],g=t.clientX,y=t.clientY;let[v,E]=s(g-p,y),[T,D]=s(g+p,y);E&&D?(a=Math.abs(g-E.getBoundingClientRect().right)<Math.abs(g-D.getBoundingClientRect().left)?v:T,a===r&&(a=a===v?T:v)):E?a=v:D&&(a=T),a>-1&&n[a]&&e.slideTo(a)}getShift(t){var e;const n=this,{instance:r}=n,i=n.carousel;if(!r||!i)return 0;const s=n[_m],a=n[wo],o=n.thumbGap,p=n.thumbExtraGap;if(!(!((e=i.slides[t])===null||e===void 0)&&e.el))return 0;const g=.5*(s-a),y=r.pages.length-1;let v=r.getProgress(0),E=r.getProgress(y),T=r.getProgress(t,!1,!0),D=0,N=g+p+o;const B=v<0&&v>-1,F=E>0&&E<1;return t===0?(D=N*Math.abs(v),F&&v===1&&(D-=N*Math.abs(E))):t===y?(D=N*Math.abs(E)*-1,B&&E===-1&&(D+=N*Math.abs(v))):B||F?(D=-1*N,D+=N*Math.abs(v),D+=N*(1-Math.abs(E))):D=N*T,D}setProps(t){var e;const n=this;if(!n.isModern)return;const{instance:r}=n,i=n.carousel;if(r&&i){const s=(e=i.slides[t])===null||e===void 0?void 0:e.el;if(s&&s.childNodes.length){let a=ut(1-Math.abs(r.getProgress(t))),o=ut(n.getShift(t));s.style.setProperty("--progress",a?a+"":""),s.style.setProperty("--shift",o+"")}}}shiftModern(){const t=this;if(!t.isModern)return;const{instance:e,track:n}=t,r=e.panzoom,i=t.carousel;if(!(e&&n&&r&&i)||r.state===Bn.Init||r.state===Bn.Destroy)return;for(const a of e.slides)t.setProps(a.index);let s=(t[wo]+t.thumbGap)*(i.slides.length||0);n.style.setProperty("--width",s+"")}cleanup(){const t=this;t.carousel&&t.carousel.destroy(),t.carousel=null,t.container&&t.container.remove(),t.container=null,t.track&&t.track.remove(),t.track=null,t.state=ta.Init,Pn(t.instance.container,t.cn("hasThumbs"))}attach(){const t=this,e=t.instance;e.on("initSlide",t.onInitSlide),e.state===Sr.Init?e.on("initSlides",t.onInitSlides):t.onInitSlides(),e.on(["change","Panzoom.afterTransform"],t.onChange),e.on("Panzoom.refresh",t.onRefresh)}detach(){const t=this,e=t.instance;e.off("initSlide",t.onInitSlide),e.off("initSlides",t.onInitSlides),e.off(["change","Panzoom.afterTransform"],t.onChange),e.off("Panzoom.refresh",t.onRefresh),t.cleanup()}};Object.defineProperty(UE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:jE});const w5=Object.assign(Object.assign({},jE),{key:"t",showOnStart:!0,parentEl:null}),WE="is-masked",qE="aria-hidden";class GE extends io{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isEnabled(){const e=this.ref;return e&&!e.isDisabled()}get isHidden(){return this.hidden}onClick(e,n){n.stopPropagation()}onCreateSlide(e,n){var r,i,s;const a=((s=(i=(r=this.instance)===null||r===void 0?void 0:r.carousel)===null||i===void 0?void 0:i.slides[n.index])===null||s===void 0?void 0:s.type)||"",o=n.el;if(o&&a){let p=`for-${a}`;["video","youtube","vimeo","html5video"].includes(a)&&(p+=" for-video"),Dt(o,p)}}onInit(){var e;const n=this,r=n.instance,i=r.carousel;if(n.ref||!i)return;const s=n.option("parentEl")||r.footer||r.container;if(!s)return;const a=Gi({},n.options,{parentEl:s,classes:{container:"f-thumbs fancybox__thumbs"},Carousel:{Sync:{friction:r.option("Carousel.friction")||0}},on:{ready:o=>{const p=o.container;p&&this.hidden&&(n.refresh(),p.style.transition="none",n.hide(),p.offsetHeight,queueMicrotask(()=>{p.style.transition="",n.show()}))}}});a.Carousel=a.Carousel||{},a.Carousel.on=Gi(((e=n.options.Carousel)===null||e===void 0?void 0:e.on)||{},{click:this.onClick,createSlide:this.onCreateSlide}),i.options.Thumbs=a,i.attachPlugins({Thumbs:UE}),n.ref=i.plugins.Thumbs,n.option("showOnStart")||(n.ref.state=ta.Hidden,n.hidden=!0)}onResize(){var e;const n=(e=this.ref)===null||e===void 0?void 0:e.container;n&&(n.style.maxHeight="")}onKeydown(e,n){const r=this.option("key");r&&r===n&&this.toggle()}toggle(){const e=this.ref;if(e&&!e.isDisabled())return e.state===ta.Hidden?(e.state=ta.Init,void e.build()):void(this.hidden?this.show():this.hide())}show(){const e=this.ref;if(!e||e.isDisabled())return;const n=e.container;n&&(this.refresh(),n.offsetHeight,n.removeAttribute(qE),n.classList.remove(WE),this.hidden=!1)}hide(){const e=this.ref,n=e&&e.container;n&&(this.refresh(),n.offsetHeight,n.classList.add(WE),n.setAttribute(qE,"true")),this.hidden=!0}refresh(){const e=this.ref;if(!e||!e.state)return;const n=e.container,r=(n==null?void 0:n.firstChild)||null;n&&r&&r.childNodes.length&&(n.style.maxHeight=`${r.getBoundingClientRect().height}px`)}attach(){const e=this,n=e.instance;n.state===Lr.Init?n.on("Carousel.init",e.onInit):e.onInit(),n.on("resize",e.onResize),n.on("keydown",e.onKeydown)}detach(){var e;const n=this,r=n.instance;r.off("Carousel.init",n.onInit),r.off("resize",n.onResize),r.off("keydown",n.onKeydown),(e=r.carousel)===null||e===void 0||e.detachPlugins(["Thumbs"]),n.ref=null}}Object.defineProperty(GE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:w5});const kb={panLeft:{icon:'<svg><path d="M5 12h14M5 12l6 6M5 12l6-6"/></svg>',change:{panX:-100}},panRight:{icon:'<svg><path d="M5 12h14M13 18l6-6M13 6l6 6"/></svg>',change:{panX:100}},panUp:{icon:'<svg><path d="M12 5v14M18 11l-6-6M6 11l6-6"/></svg>',change:{panY:-100}},panDown:{icon:'<svg><path d="M12 5v14M18 13l-6 6M6 13l6 6"/></svg>',change:{panY:100}},zoomIn:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M11 8v6M8 11h6"/></svg>',action:"zoomIn"},zoomOut:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"zoomOut"},toggle1to1:{icon:'<svg><path d="M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z"/><path d="M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0"/></svg>',action:"toggleZoom"},toggleZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"toggleZoom"},iterateZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"iterateZoom"},rotateCCW:{icon:'<svg><path d="M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01"/></svg>',action:"rotateCCW"},rotateCW:{icon:'<svg><path d="M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01"/></svg>',action:"rotateCW"},flipX:{icon:'<svg style="stroke-width: 1.3"><path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/></svg>',action:"flipX"},flipY:{icon:'<svg style="stroke-width: 1.3"><path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/></svg>',action:"flipY"},fitX:{icon:'<svg><path d="M4 12V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v6M10 18H3M21 18h-7M6 15l-3 3 3 3M18 15l3 3-3 3"/></svg>',action:"fitX"},fitY:{icon:'<svg><path d="M12 20H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h6M18 14v7M18 3v7M15 18l3 3 3-3M15 6l3-3 3 3"/></svg>',action:"fitY"},reset:{icon:'<svg><path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/></svg>',action:"reset"},toggleFS:{icon:'<svg><g><path d="M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6"/></g><g><path d="m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4"/></g></svg>',action:"toggleFS"}};var Ql;(function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Disabled=2]="Disabled"})(Ql||(Ql={}));const k5={absolute:"auto",display:{left:["infobar"],middle:[],right:["iterateZoom","slideshow","fullscreen","thumbs","close"]},enabled:"auto",items:{infobar:{tpl:'<div class="fancybox__infobar" tabindex="-1"><span data-fancybox-current-index></span>/<span data-fancybox-count></span></div>'},download:{tpl:'<a class="f-button" title="{{DOWNLOAD}}" data-fancybox-download href="javasript:;"><svg><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12"/></svg></a>'},prev:{tpl:'<button class="f-button" title="{{PREV}}" data-fancybox-prev><svg><path d="m15 6-6 6 6 6"/></svg></button>'},next:{tpl:'<button class="f-button" title="{{NEXT}}" data-fancybox-next><svg><path d="m9 6 6 6-6 6"/></svg></button>'},slideshow:{tpl:'<button class="f-button" title="{{TOGGLE_SLIDESHOW}}" data-fancybox-toggle-slideshow><svg><g><path d="M8 4v16l13 -8z"></path></g><g><path d="M8 4v15M17 4v15"/></g></svg></button>'},fullscreen:{tpl:'<button class="f-button" title="{{TOGGLE_FULLSCREEN}}" data-fancybox-toggle-fullscreen><svg><g><path d="M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2M16 4h2a2 2 0 0 1 2 2v2M16 20h2a2 2 0 0 0 2-2v-2"/></g><g><path d="M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5"/></g></svg></button>'},thumbs:{tpl:'<button class="f-button" title="{{TOGGLE_THUMBS}}" data-fancybox-toggle-thumbs><svg><circle cx="5.5" cy="5.5" r="1"/><circle cx="12" cy="5.5" r="1"/><circle cx="18.5" cy="5.5" r="1"/><circle cx="5.5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18.5" cy="12" r="1"/><circle cx="5.5" cy="18.5" r="1"/><circle cx="12" cy="18.5" r="1"/><circle cx="18.5" cy="18.5" r="1"/></svg></button>'},close:{tpl:'<button class="f-button" title="{{CLOSE}}" data-fancybox-close><svg><path d="m19.5 4.5-15 15M4.5 4.5l15 15"/></svg></button>'}},parentEl:null},E5={tabindex:"-1",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},YE="has-toolbar",Eb="fancybox__toolbar";class ZE extends io{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Ql.Init}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null})}onReady(e){var n;if(!e.carousel)return;let r=this.option("display"),i=this.option("absolute"),s=this.option("enabled");if(s==="auto"){const g=this.instance.carousel;let y=0;if(g)for(const v of g.slides)(v.panzoom||v.type==="image")&&y++;y||(s=!1)}s||(r=void 0);let a=0;const o={left:[],middle:[],right:[]};if(r)for(const g of["left","middle","right"])for(const y of r[g]){const v=this.createEl(y);v&&((n=o[g])===null||n===void 0||n.push(v),a++)}let p=null;if(a&&(p=this.createContainer()),p){for(const[g,y]of Object.entries(o)){const v=document.createElement("div");Dt(v,Eb+"__column is-"+g);for(const E of y)v.appendChild(E);i!=="auto"||g!=="middle"||y.length||(i=!0),p.appendChild(v)}i===!0&&Dt(p,"is-absolute"),this.state=Ql.Ready,this.onRefresh()}else this.state=Ql.Disabled}onClick(e){var n,r;const i=this.instance,s=i.getSlide(),a=s==null?void 0:s.panzoom,o=e.target,p=o&&Yi(o)?o.dataset:null;if(!p)return;if(p.fancyboxToggleThumbs!==void 0)return e.preventDefault(),e.stopPropagation(),void((n=i.plugins.Thumbs)===null||n===void 0||n.toggle());if(p.fancyboxToggleFullscreen!==void 0)return e.preventDefault(),e.stopPropagation(),void this.instance.toggleFullscreen();if(p.fancyboxToggleSlideshow!==void 0){e.preventDefault(),e.stopPropagation();const v=(r=i.carousel)===null||r===void 0?void 0:r.plugins.Autoplay;let E=v.isActive;return a&&a.panMode==="mousemove"&&!E&&a.reset(),void(E?v.stop():v.start())}const g=p.panzoomAction,y=p.panzoomChange;if((y||g)&&(e.preventDefault(),e.stopPropagation()),y){let v={};try{v=JSON.parse(y)}catch{}a&&a.applyChange(v)}else g&&a&&a[g]&&a[g]()}onChange(){this.onRefresh()}onRefresh(){if(this.instance.isClosing())return;const e=this.container;if(!e)return;const n=this.instance.getSlide();if(!n||n.state!==hi.Ready)return;const r=n&&!n.error&&n.panzoom;for(const a of e.querySelectorAll("[data-panzoom-action]"))r?(a.removeAttribute("disabled"),a.removeAttribute("tabindex")):(a.setAttribute("disabled",""),a.setAttribute("tabindex","-1"));let i=r&&r.canZoomIn(),s=r&&r.canZoomOut();for(const a of e.querySelectorAll('[data-panzoom-action="zoomIn"]'))i?(a.removeAttribute("disabled"),a.removeAttribute("tabindex")):(a.setAttribute("disabled",""),a.setAttribute("tabindex","-1"));for(const a of e.querySelectorAll('[data-panzoom-action="zoomOut"]'))s?(a.removeAttribute("disabled"),a.removeAttribute("tabindex")):(a.setAttribute("disabled",""),a.setAttribute("tabindex","-1"));for(const a of e.querySelectorAll('[data-panzoom-action="toggleZoom"],[data-panzoom-action="iterateZoom"]')){s||i?(a.removeAttribute("disabled"),a.removeAttribute("tabindex")):(a.setAttribute("disabled",""),a.setAttribute("tabindex","-1"));const o=a.querySelector("g");o&&(o.style.display=i?"":"none")}}onDone(e,n){var r;(r=n.panzoom)===null||r===void 0||r.on("afterTransform",()=>{this.instance.isCurrentSlide(n)&&this.onRefresh()}),this.instance.isCurrentSlide(n)&&this.onRefresh()}createContainer(){const e=this.instance.container;if(!e)return null;const n=this.option("parentEl")||e;let r=n.querySelector("."+Eb);return r||(r=document.createElement("div"),Dt(r,Eb),n.prepend(r)),r.addEventListener("click",this.onClick,{passive:!1,capture:!0}),e&&Dt(e,YE),this.container=r,r}createEl(e){const n=this.instance,r=n.carousel;if(!r||e==="toggleFS"||e==="fullscreen"&&!ME())return null;let i=null;const s=r.slides.length||0;let a=0,o=0;for(const g of r.slides)(g.panzoom||g.type==="image")&&a++,(g.type==="image"||g.downloadSrc)&&o++;if(s<2&&["infobar","prev","next"].includes(e))return i;if(kb[e]!==void 0&&!a||e==="download"&&!o)return null;if(e==="thumbs"){const g=n.plugins.Thumbs;if(!g||!g.isEnabled)return null}if(e==="slideshow"&&(!r.plugins.Autoplay||s<2))return null;if(kb[e]!==void 0){const g=kb[e];i=document.createElement("button"),i.setAttribute("title",this.instance.localize(`{{${e.toUpperCase()}}}`)),Dt(i,"f-button"),g.action&&(i.dataset.panzoomAction=g.action),g.change&&(i.dataset.panzoomChange=JSON.stringify(g.change)),i.appendChild(xo(this.instance.localize(g.icon)))}else{const g=(this.option("items")||[])[e];g&&(i=xo(this.instance.localize(g.tpl)),typeof g.click=="function"&&i.addEventListener("click",y=>{y.preventDefault(),y.stopPropagation(),typeof g.click=="function"&&g.click.call(this,this,y)}))}const p=i==null?void 0:i.querySelector("svg");if(p)for(const[g,y]of Object.entries(E5))p.getAttribute(g)||p.setAttribute(g,String(y));return i}removeContainer(){const e=this.container;e&&e.remove(),this.container=null,this.state=Ql.Disabled;const n=this.instance.container;n&&Pn(n,YE)}attach(){const e=this,n=e.instance;n.on("Carousel.initSlides",e.onReady),n.on("done",e.onDone),n.on(["reveal","Carousel.change"],e.onChange),e.onReady(e.instance)}detach(){const e=this,n=e.instance;n.off("Carousel.initSlides",e.onReady),n.off("done",e.onDone),n.off(["reveal","Carousel.change"],e.onChange),e.removeContainer()}}Object.defineProperty(ZE,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:k5});const S5={Hash:class extends io{onReady(){_h=!1}onChange(t){Kl&&clearTimeout(Kl);const{hash:e}=IE(),{hash:n}=mm(),r=t.isOpeningSlide(t.getSlide());r&&(DE=n===e?"":n),e&&e!==n&&(Kl=setTimeout(()=>{try{if(t.state===Lr.Ready){let i="replaceState";r&&!pm&&(i="pushState",pm=!0),window.history[i]({},document.title,window.location.pathname+window.location.search+e)}}catch{}},300))}onClose(t){if(Kl&&clearTimeout(Kl),!_h&&pm)return pm=!1,_h=!1,void window.history.back();if(!_h)try{window.history.replaceState({},document.title,window.location.pathname+window.location.search+(DE||""))}catch{}}attach(){const t=this.instance;t.on("ready",this.onReady),t.on(["Carousel.ready","Carousel.change"],this.onChange),t.on("close",this.onClose)}detach(){const t=this.instance;t.off("ready",this.onReady),t.off(["Carousel.ready","Carousel.change"],this.onChange),t.off("close",this.onClose)}static parseURL(){return mm()}static startFromUrl(){PE()}static destroy(){window.removeEventListener("hashchange",OE,!1)}},Html:VE,Images:BE,Slideshow:$E,Thumbs:GE,Toolbar:ZE},XE="with-fancybox",Sb="hide-scrollbar",KE="--fancybox-scrollbar-compensate",JE="--fancybox-body-margin",Cb="aria-hidden",Tb="is-using-tab",Ab="is-animated",QE="is-compact",e2="is-loading",Mb="is-opening",xm="has-caption",_d="disabled",ec="tabindex",t2="download",Db="href",xd="src",La=t=>typeof t=="string",n2=function(){var t=window.getSelection();return!!t&&t.type==="Range"};let Bs,zs=null,tc=null,r2=0,i2=0,s2=0,o2=0;const vd=new Map;let C5=0;class vn extends fb{get isIdle(){return this.idle}get isCompact(){return this.option("compact")}constructor(e=[],n={},r={}){super(n),Object.defineProperty(this,"userSlides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"idle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"idleTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ignoreFocusChange",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"startedFs",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Init}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"footer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastFocus",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevMouseMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Bs||(Bs=ME()),this.id=n.id||++C5,vd.set(this.id,this),this.userSlides=e,this.userPlugins=r,queueMicrotask(()=>{this.init()})}init(){if(this.state===Lr.Destroy)return;this.state=Lr.Init,this.attachPlugins(Object.assign(Object.assign({},vn.Plugins),this.userPlugins)),this.emit("init"),this.emit("attachPlugins"),this.option("hideScrollbar")===!0&&(()=>{if(!bh)return;const n=document,r=n.body,i=n.documentElement;if(r.classList.contains(Sb))return;let s=window.innerWidth-i.getBoundingClientRect().width;const a=parseFloat(window.getComputedStyle(r).marginRight);s<0&&(s=0),i.style.setProperty(KE,`${s}px`),a&&r.style.setProperty(JE,`${a}px`),r.classList.add(Sb)})(),this.initLayout(),this.scale();const e=()=>{this.initCarousel(this.userSlides),this.state=Lr.Ready,this.attachEvents(),this.emit("ready"),setTimeout(()=>{this.container&&this.container.setAttribute(Cb,"false")},16)};this.option("Fullscreen.autoStart")&&Bs&&!Bs.isFullscreen()?Bs.request().then(()=>{this.startedFs=!0,e()}).catch(()=>e()):e()}initLayout(){var e,n;const r=this.option("parentEl")||document.body,i=xo(this.localize(this.option("tpl.main")||""));if(i){if(i.setAttribute("id",`fancybox-${this.id}`),i.setAttribute("aria-label",this.localize("{{MODAL}}")),i.classList.toggle(QE,this.isCompact),Dt(i,this.option("mainClass")||""),Dt(i,Mb),this.container=i,this.footer=i.querySelector(".fancybox__footer"),r.appendChild(i),Dt(document.documentElement,XE),zs&&tc||(zs=document.createElement("span"),Dt(zs,"fancybox-focus-guard"),zs.setAttribute(ec,"0"),zs.setAttribute(Cb,"true"),zs.setAttribute("aria-label","Focus guard"),tc=zs.cloneNode(),(e=i.parentElement)===null||e===void 0||e.insertBefore(zs,i),(n=i.parentElement)===null||n===void 0||n.append(tc)),i.addEventListener("mousedown",s=>{r2=s.pageX,i2=s.pageY,Pn(i,Tb)}),this.option("closeExisting"))for(const s of vd.values())s.id!==this.id&&s.close();else this.option("animated")&&(Dt(i,Ab),setTimeout(()=>{this.isClosing()||Pn(i,Ab)},350));this.emit("initLayout")}}initCarousel(e){const n=this.container;if(!n)return;const r=n.querySelector(".fancybox__carousel");if(!r)return;const i=this.carousel=new yh(r,Gi({},{slides:e,transition:"fade",Panzoom:{lockAxis:this.option("dragToClose")?"xy":"x",infinite:!!this.option("dragToClose")&&"y"},Dots:!1,Navigation:{classes:{container:"fancybox__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"}},initialPage:this.option("startIndex"),l10n:this.option("l10n")},this.option("Carousel")||{}));i.on("*",(s,a,...o)=>{this.emit(`Carousel.${a}`,s,...o)}),i.on(["ready","change"],()=>{this.manageCaption()}),this.on("Carousel.removeSlide",(s,a,o)=>{this.clearContent(o),o.state=void 0}),i.on("Panzoom.touchStart",()=>{var s,a;this.isCompact||this.endIdle(),!((s=document.activeElement)===null||s===void 0)&&s.closest(".f-thumbs")&&((a=this.container)===null||a===void 0||a.focus())}),i.on("settle",()=>{this.idleTimer||this.isCompact||!this.option("idle")||this.setIdle(),this.option("autoFocus")&&!this.isClosing&&this.checkFocus()}),this.option("dragToClose")&&(i.on("Panzoom.afterTransform",(s,a)=>{const o=this.getSlide();if(o&&cb(o.el))return;const p=this.container;if(p){const g=Math.abs(a.current.f),y=g<1?"":Math.max(.5,Math.min(1,1-g/a.contentRect.fitHeight*1.5));p.style.setProperty("--fancybox-ts",y?"0s":""),p.style.setProperty("--fancybox-opacity",y+"")}}),i.on("Panzoom.touchEnd",(s,a,o)=>{var p;const g=this.getSlide();if(g&&cb(g.el)||a.isMobile&&document.activeElement&&["TEXTAREA","INPUT"].indexOf((p=document.activeElement)===null||p===void 0?void 0:p.nodeName)!==-1)return;const y=Math.abs(a.dragOffset.y);a.lockedAxis==="y"&&(y>=200||y>=50&&a.dragOffset.time<300)&&(o&&o.cancelable&&o.preventDefault(),this.close(o,"f-throwOut"+(a.current.f<0?"Up":"Down")))})),i.on("change",s=>{var a;let o=(a=this.getSlide())===null||a===void 0?void 0:a.triggerEl;if(o){const p=new CustomEvent("slideTo",{bubbles:!0,cancelable:!0,detail:s.page});o.dispatchEvent(p)}}),i.on(["refresh","change"],s=>{const a=this.container;if(!a)return;for(const g of a.querySelectorAll("[data-fancybox-current-index]"))g.innerHTML=s.page+1;for(const g of a.querySelectorAll("[data-fancybox-count]"))g.innerHTML=s.pages.length;if(!s.isInfinite){for(const g of a.querySelectorAll("[data-fancybox-next]"))s.page<s.pages.length-1?(g.removeAttribute(_d),g.removeAttribute(ec)):(g.setAttribute(_d,""),g.setAttribute(ec,"-1"));for(const g of a.querySelectorAll("[data-fancybox-prev]"))s.page>0?(g.removeAttribute(_d),g.removeAttribute(ec)):(g.setAttribute(_d,""),g.setAttribute(ec,"-1"))}const o=this.getSlide();if(!o)return;let p=o.downloadSrc||"";p||o.type!=="image"||o.error||!La(o[xd])||(p=o[xd]);for(const g of a.querySelectorAll("[data-fancybox-download]")){const y=o.downloadFilename;p?(g.removeAttribute(_d),g.removeAttribute(ec),g.setAttribute(Db,p),g.setAttribute(t2,y||p),g.setAttribute("target","_blank")):(g.setAttribute(_d,""),g.setAttribute(ec,"-1"),g.removeAttribute(Db),g.removeAttribute(t2))}}),this.emit("initCarousel")}attachEvents(){const e=this,n=e.container;if(!n)return;n.addEventListener("click",e.onClick,{passive:!1,capture:!1}),n.addEventListener("wheel",e.onWheel,{passive:!1,capture:!1}),document.addEventListener("keydown",e.onKeydown,{passive:!1,capture:!0}),document.addEventListener("visibilitychange",e.onVisibilityChange,!1),document.addEventListener("mousemove",e.onMousemove),e.option("trapFocus")&&document.addEventListener("focus",e.onFocus,!0),window.addEventListener("resize",e.onResize);const r=window.visualViewport;r&&(r.addEventListener("scroll",e.onResize),r.addEventListener("resize",e.onResize))}detachEvents(){const e=this,n=e.container;if(!n)return;document.removeEventListener("keydown",e.onKeydown,{passive:!1,capture:!0}),n.removeEventListener("wheel",e.onWheel,{passive:!1,capture:!1}),n.removeEventListener("click",e.onClick,{passive:!1,capture:!1}),document.removeEventListener("mousemove",e.onMousemove),window.removeEventListener("resize",e.onResize);const r=window.visualViewport;r&&(r.removeEventListener("resize",e.onResize),r.removeEventListener("scroll",e.onResize)),document.removeEventListener("visibilitychange",e.onVisibilityChange,!1),document.removeEventListener("focus",e.onFocus,!0)}scale(){const e=this.container;if(!e)return;const n=window.visualViewport,r=Math.max(1,(n==null?void 0:n.scale)||1);let i="",s="",a="";if(n&&r>1){let o=`${n.offsetLeft}px`,p=`${n.offsetTop}px`;i=n.width*r+"px",s=n.height*r+"px",a=`translate3d(${o}, ${p}, 0) scale(${1/r})`}e.style.transform=a,e.style.width=i,e.style.height=s}onClick(e){var n;const{container:r,isCompact:i}=this;if(!r||this.isClosing())return;!i&&this.option("idle")&&this.resetIdle();const s=e.composedPath()[0];if(s.closest(".fancybox-spinner")||s.closest("[data-fancybox-close]"))return e.preventDefault(),void this.close(e);if(s.closest("[data-fancybox-prev]"))return e.preventDefault(),void this.prev();if(s.closest("[data-fancybox-next]"))return e.preventDefault(),void this.next();if(e.type==="click"&&e.detail===0||Math.abs(e.pageX-r2)>30||Math.abs(e.pageY-i2)>30)return;const a=document.activeElement;if(n2()&&a&&r.contains(a))return;if(i&&((n=this.getSlide())===null||n===void 0?void 0:n.type)==="image")return void(this.clickTimer?(clearTimeout(this.clickTimer),this.clickTimer=null):this.clickTimer=setTimeout(()=>{this.toggleIdle(),this.clickTimer=null},350));if(this.emit("click",e),e.defaultPrevented)return;let o=!1;if(s.closest(".fancybox__content")){if(a){if(a.closest("[contenteditable]"))return;s.matches(_b)||a.blur()}if(n2())return;o=this.option("contentClick")}else s.closest(".fancybox__carousel")&&!s.matches(_b)&&(o=this.option("backdropClick"));o==="close"?(e.preventDefault(),this.close(e)):o==="next"?(e.preventDefault(),this.next()):o==="prev"&&(e.preventDefault(),this.prev())}onWheel(e){const n=e.target;let r=this.option("wheel",e);n.closest(".fancybox__thumbs")&&(r="slide");const i=r==="slide",s=[-e.deltaX||0,-e.deltaY||0,-e.detail||0].reduce(function(p,g){return Math.abs(g)>Math.abs(p)?g:p}),a=Math.max(-1,Math.min(1,s)),o=Date.now();this.pwt&&o-this.pwt<300?i&&e.preventDefault():(this.pwt=o,this.emit("wheel",e,a),e.defaultPrevented||(r==="close"?(e.preventDefault(),this.close(e)):r==="slide"&&(om(n)||(e.preventDefault(),this[a>0?"prev":"next"]()))))}onScroll(){window.scrollTo(s2,o2)}onKeydown(e){if(!this.isTopmost())return;this.isCompact||!this.option("idle")||this.isClosing()||this.resetIdle();const n=e.key,r=this.option("keyboard");if(!r)return;const i=e.composedPath()[0],s=document.activeElement&&document.activeElement.classList,a=s&&s.contains("f-button")||i.dataset.carouselPage||i.dataset.carouselIndex;if(n!=="Escape"&&!a&&Yi(i)&&(i.isContentEditable||["TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].indexOf(i.nodeName)!==-1)||(e.key==="Tab"?Dt(this.container,Tb):Pn(this.container,Tb),e.ctrlKey||e.altKey||e.shiftKey))return;this.emit("keydown",n,e);const o=r[n];o&&typeof this[o]=="function"&&(e.preventDefault(),this[o]())}onResize(){const e=this.container;if(!e)return;const n=this.isCompact;e.classList.toggle(QE,n),this.manageCaption(this.getSlide()),this.isCompact?this.clearIdle():this.endIdle(),this.scale(),this.emit("resize")}onFocus(e){this.isTopmost()&&this.checkFocus(e)}onMousemove(e){this.prevMouseMoveEvent=e,!this.isCompact&&this.option("idle")&&this.resetIdle()}onVisibilityChange(){document.visibilityState==="visible"?this.checkFocus():this.endIdle()}manageCloseBtn(e){const n=this.optionFor(e,"closeButton")||!1;if(n==="auto"){const i=this.plugins.Toolbar;if(i&&i.state===Ql.Ready)return}if(!n||!e.contentEl||e.closeBtnEl)return;const r=this.option("tpl.closeButton");if(r){const i=xo(this.localize(r));e.closeBtnEl=e.contentEl.appendChild(i),e.el&&Dt(e.el,"has-close-btn")}}manageCaption(e=void 0){var n,r;const i="fancybox__caption",s=this.container;if(!s)return;Pn(s,xm);const a=this.isCompact||this.option("commonCaption"),o=!a;if(this.caption&&this.stop(this.caption),o&&this.caption&&(this.caption.remove(),this.caption=null),a&&!this.caption)for(const v of((n=this.carousel)===null||n===void 0?void 0:n.slides)||[])v.captionEl&&(v.captionEl.remove(),v.captionEl=void 0,Pn(v.el,xm),(r=v.el)===null||r===void 0||r.removeAttribute("aria-labelledby"));if(e||(e=this.getSlide()),!e||a&&!this.isCurrentSlide(e))return;const p=e.el;let g=this.optionFor(e,"caption","");if(!g)return void(a&&this.caption&&this.animate(this.caption,"f-fadeOut",()=>{this.caption&&(this.caption.innerHTML="")}));let y=null;if(o){if(y=e.captionEl||null,p&&!y){const v=i+`_${this.id}_${e.index}`;y=document.createElement("div"),Dt(y,i),y.setAttribute("id",v),e.captionEl=p.appendChild(y),Dt(p,xm),p.setAttribute("aria-labelledby",v)}}else y=this.caption,y||(y=s.querySelector("."+i)),!y&&(y=document.createElement("div"),y.dataset.fancyboxCaption="",Dt(y,i),(this.footer||s).prepend(y)),Dt(s,xm),this.caption=y;y&&(y.innerHTML="",La(g)||typeof g=="number"?y.innerHTML=g+"":g instanceof HTMLElement&&y.appendChild(g))}checkFocus(e){this.focus(e)}focus(e){var n;if(this.ignoreFocusChange)return;const r=document.activeElement||null,i=(e==null?void 0:e.target)||null,s=this.container,a=(n=this.carousel)===null||n===void 0?void 0:n.viewport;if(!s||!a||!e&&r&&s.contains(r))return;const o=this.getSlide(),p=o&&o.state===hi.Ready?o.el:null;if(!p||p.contains(r)||s===r)return;e&&e.cancelable&&e.preventDefault(),this.ignoreFocusChange=!0;const g=Array.from(s.querySelectorAll(_b));let y=[],v=null;for(let T of g){const D=!T.offsetParent||!!T.closest('[aria-hidden="true"]'),N=p&&p.contains(T),B=!a.contains(T);if(T===s||(N||B)&&!D){y.push(T);const F=T.dataset.origTabindex;F!==void 0&&F&&(T.tabIndex=parseFloat(F)),T.removeAttribute("data-orig-tabindex"),!T.hasAttribute("autoFocus")&&v||(v=T)}else{const F=T.dataset.origTabindex===void 0?T.getAttribute("tabindex")||"":T.dataset.origTabindex;F&&(T.dataset.origTabindex=F),T.tabIndex=-1}}let E=null;e?(!i||y.indexOf(i)<0)&&(E=v||s,y.length&&(r===tc?E=y[0]:this.lastFocus!==s&&r!==zs||(E=y[y.length-1]))):E=o&&o.type==="image"?s:v||s,E&&AE(E),this.lastFocus=document.activeElement,this.ignoreFocusChange=!1}next(){const e=this.carousel;e&&e.pages.length>1&&e.slideNext()}prev(){const e=this.carousel;e&&e.pages.length>1&&e.slidePrev()}jumpTo(...e){this.carousel&&this.carousel.slideTo(...e)}isTopmost(){var e;return((e=vn.getInstance())===null||e===void 0?void 0:e.id)==this.id}animate(e=null,n="",r){if(!e||!n)return void(r&&r());this.stop(e);const i=s=>{s.target===e&&e.dataset.animationName&&(e.removeEventListener("animationend",i),delete e.dataset.animationName,r&&r(),Pn(e,n))};e.dataset.animationName=n,e.addEventListener("animationend",i),Dt(e,n)}stop(e){e&&e.dispatchEvent(new CustomEvent("animationend",{bubbles:!1,cancelable:!0,currentTarget:e}))}setContent(e,n="",r=!0){if(this.isClosing())return;const i=e.el;if(!i)return;let s=null;if(Yi(n)?s=n:(s=xo(n+""),Yi(s)||(s=document.createElement("div"),s.innerHTML=n+"")),["img","picture","iframe","video","audio"].includes(s.nodeName.toLowerCase())){const a=document.createElement("div");a.appendChild(s),s=a}Yi(s)&&e.filter&&!e.error&&(s=s.querySelector(e.filter)),s&&Yi(s)?(Dt(s,"fancybox__content"),e.id&&s.setAttribute("id",e.id),i.classList.add(`has-${e.error?"error":e.type||"unknown"}`),i.prepend(s),s.style.display==="none"&&(s.style.display=""),getComputedStyle(s).getPropertyValue("display")==="none"&&(s.style.display=e.display||this.option("defaultDisplay")||"flex"),e.contentEl=s,r&&this.revealContent(e),this.manageCloseBtn(e),this.manageCaption(e)):this.setError(e,"{{ELEMENT_NOT_FOUND}}")}revealContent(e,n){const r=e.el,i=e.contentEl;r&&i&&(this.emit("reveal",e),this.hideLoading(e),e.state=hi.Opening,(n=this.isOpeningSlide(e)?n===void 0?this.optionFor(e,"showClass"):n:"f-fadeIn")?this.animate(i,n,()=>{this.done(e)}):this.done(e))}done(e){this.isClosing()||(e.state=hi.Ready,this.emit("done",e),Dt(e.el,"is-done"),this.isCurrentSlide(e)&&this.option("autoFocus")&&queueMicrotask(()=>{var n;(n=e.panzoom)===null||n===void 0||n.updateControls(),this.option("autoFocus")&&this.focus()}),this.isOpeningSlide(e)&&(Pn(this.container,Mb),!this.isCompact&&this.option("idle")&&this.setIdle()))}isCurrentSlide(e){const n=this.getSlide();return!(!e||!n)&&n.index===e.index}isOpeningSlide(e){var n,r;return((n=this.carousel)===null||n===void 0?void 0:n.prevPage)===null&&e&&e.index===((r=this.getSlide())===null||r===void 0?void 0:r.index)}showLoading(e){e.state=hi.Loading;const n=e.el;n&&(Dt(n,e2),this.emit("loading",e),e.spinnerEl||setTimeout(()=>{if(!this.isClosing()&&!e.spinnerEl&&e.state===hi.Loading){let r=xo(pb);Dt(r,"fancybox-spinner"),e.spinnerEl=r,n.prepend(r),this.animate(r,"f-fadeIn")}},250))}hideLoading(e){const n=e.el;if(!n)return;const r=e.spinnerEl;this.isClosing()?r==null||r.remove():(Pn(n,e2),r&&this.animate(r,"f-fadeOut",()=>{r.remove()}),e.state===hi.Loading&&(this.emit("loaded",e),e.state=hi.Ready))}setError(e,n){if(this.isClosing())return;const r=new Event("error",{bubbles:!0,cancelable:!0});if(this.emit("error",r,e),r.defaultPrevented)return;e.error=n,this.hideLoading(e),this.clearContent(e);const i=document.createElement("div");i.classList.add("fancybox-error"),i.innerHTML=this.localize(n||"<p>{{ERROR}}</p>"),this.setContent(e,i)}clearContent(e){if(e.state===void 0)return;this.emit("clearContent",e),e.contentEl&&(e.contentEl.remove(),e.contentEl=void 0);const n=e.el;n&&(Pn(n,"has-error"),Pn(n,"has-unknown"),Pn(n,`has-${e.type||"unknown"}`)),e.closeBtnEl&&e.closeBtnEl.remove(),e.closeBtnEl=void 0,e.captionEl&&e.captionEl.remove(),e.captionEl=void 0,e.spinnerEl&&e.spinnerEl.remove(),e.spinnerEl=void 0}getSlide(){var e;const n=this.carousel;return((e=n==null?void 0:n.pages[n==null?void 0:n.page])===null||e===void 0?void 0:e.slides[0])||void 0}close(e,n){if(this.isClosing())return;const r=new Event("shouldClose",{bubbles:!0,cancelable:!0});if(this.emit("shouldClose",r,e),r.defaultPrevented)return;e&&e.cancelable&&(e.preventDefault(),e.stopPropagation());const i=()=>{this.proceedClose(e,n)};this.startedFs&&Bs&&Bs.isFullscreen()?Promise.resolve(Bs.exit()).then(()=>i()):i()}clearIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null}setIdle(e=!1){const n=()=>{this.clearIdle(),this.idle=!0,Dt(this.container,"is-idle"),this.emit("setIdle")};if(this.clearIdle(),!this.isClosing())if(e)n();else{const r=this.option("idle");r&&(this.idleTimer=setTimeout(n,r))}}endIdle(){this.clearIdle(),this.idle&&!this.isClosing()&&(this.idle=!1,Pn(this.container,"is-idle"),this.emit("endIdle"))}resetIdle(){this.endIdle(),this.setIdle()}toggleIdle(){this.idle?this.endIdle():this.setIdle(!0)}toggleFullscreen(){Bs&&(Bs.isFullscreen()?Bs.exit():Bs.request().then(()=>{this.startedFs=!0}))}isClosing(){return[Lr.Closing,Lr.CustomClosing,Lr.Destroy].includes(this.state)}proceedClose(e,n){var r,i;this.state=Lr.Closing,this.clearIdle(),this.detachEvents();const s=this.container,a=this.carousel,o=this.getSlide(),p=o&&this.option("placeFocusBack")?o.triggerEl||this.option("triggerEl"):null;if(p&&(TE(p)?AE(p):p.focus()),s&&(Pn(s,Mb),Dt(s,"is-closing"),s.setAttribute(Cb,"true"),this.option("animated")&&Dt(s,Ab),s.style.pointerEvents="none"),a){a.clearTransitions(),(r=a.panzoom)===null||r===void 0||r.destroy(),(i=a.plugins.Navigation)===null||i===void 0||i.detach();for(const g of a.slides){g.state=hi.Closing,this.hideLoading(g);const y=g.contentEl;y&&this.stop(y);const v=g==null?void 0:g.panzoom;v&&(v.stop(),v.detachEvents(),v.detachObserver()),this.isCurrentSlide(g)||a.emit("removeSlide",g)}}s2=window.scrollX,o2=window.scrollY,window.addEventListener("scroll",this.onScroll),this.emit("close",e),this.state!==Lr.CustomClosing?(n===void 0&&o&&(n=this.optionFor(o,"hideClass")),n&&o?(this.animate(o.contentEl,n,()=>{a&&a.emit("removeSlide",o)}),setTimeout(()=>{this.destroy()},500)):this.destroy()):setTimeout(()=>{this.destroy()},500)}destroy(){var e;if(this.state===Lr.Destroy)return;window.removeEventListener("scroll",this.onScroll),this.state=Lr.Destroy,(e=this.carousel)===null||e===void 0||e.destroy();const n=this.container;n&&n.remove(),vd.delete(this.id);const r=vn.getInstance();r?r.focus():(zs&&(zs.remove(),zs=null),tc&&(tc.remove(),tc=null),Pn(document.documentElement,XE),(()=>{if(!bh)return;const i=document,s=i.body;s.classList.remove(Sb),s.style.setProperty(JE,""),i.documentElement.style.setProperty(KE,"")})(),this.emit("destroy"))}static bind(e,n,r){if(!bh)return;let i,s="",a={};if(e===void 0?i=document.body:La(e)?(i=document.body,s=e,typeof n=="object"&&(a=n||{})):(i=e,La(n)&&(s=n),typeof r=="object"&&(a=r||{})),!i||!Yi(i))return;s=s||"[data-fancybox]";const o=vn.openers.get(i)||new Map;o.set(s,a),vn.openers.set(i,o),o.size===1&&i.addEventListener("click",vn.fromEvent)}static unbind(e,n){let r,i="";if(La(e)?(r=document.body,i=e):(r=e,La(n)&&(i=n)),!r)return;const s=vn.openers.get(r);s&&i&&s.delete(i),i&&s||(vn.openers.delete(r),r.removeEventListener("click",vn.fromEvent))}static destroy(){let e;for(;e=vn.getInstance();)e.destroy();for(const n of vn.openers.keys())n.removeEventListener("click",vn.fromEvent);vn.openers=new Map}static fromEvent(e){if(e.defaultPrevented||e.button&&e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey)return;let n=e.composedPath()[0];const r=n.closest("[data-fancybox-trigger]");if(r){const D=r.dataset.fancyboxTrigger||"",N=document.querySelectorAll(`[data-fancybox="${D}"]`),B=parseInt(r.dataset.fancyboxIndex||"",10)||0;n=N[B]||n}if(!(n&&n instanceof Element))return;let i,s,a,o;if([...vn.openers].reverse().find(([D,N])=>!(!D.contains(n)||![...N].reverse().find(([B,F])=>{let X=n.closest(B);return!!X&&(i=D,s=B,a=X,o=F,!0)}))),!i||!s||!a)return;o=o||{},e.preventDefault(),n=a;let p=[],g=Gi({},xb,o);g.event=e,g.triggerEl=n,g.delegate=r;const y=g.groupAll,v=g.groupAttr,E=v&&n?n.getAttribute(`${v}`):"";if((!n||E||y)&&(p=[].slice.call(i.querySelectorAll(s))),n&&!y&&(p=E?p.filter(D=>D.getAttribute(`${v}`)===E):[n]),!p.length)return;const T=vn.getInstance();return T&&T.options.triggerEl&&p.indexOf(T.options.triggerEl)>-1?void 0:(n&&(g.startIndex=p.indexOf(n)),vn.fromNodes(p,g))}static fromSelector(e,n,r){let i=null,s="",a={};if(La(e)?(i=document.body,s=e,typeof n=="object"&&(a=n||{})):e instanceof HTMLElement&&La(n)&&(i=e,s=n,typeof r=="object"&&(a=r||{})),!i||!s)return!1;const o=vn.openers.get(i);return!!o&&(a=Gi({},o.get(s)||{},a),!!a&&vn.fromNodes(Array.from(i.querySelectorAll(s)),a))}static fromNodes(e,n){n=Gi({},xb,n||{});const r=[];for(const i of e){const s=i.dataset||{},a=s[xd]||i.getAttribute(Db)||i.getAttribute("currentSrc")||i.getAttribute(xd)||void 0;let o;const p=n.delegate;let g;p&&r.length===n.startIndex&&(o=p instanceof HTMLImageElement?p:p.querySelector("img:not([aria-hidden])")),o||(o=i instanceof HTMLImageElement?i:i.querySelector("img:not([aria-hidden])")),o&&(g=o.currentSrc||o[xd]||void 0,!g&&o.dataset&&(g=o.dataset.lazySrc||o.dataset[xd]||void 0));const y={src:a,triggerEl:i,thumbEl:o,thumbElSrc:g,thumbSrc:g};for(const v in s){let E=s[v]+"";E=E!=="false"&&(E==="true"||E),y[v]=E}r.push(y)}return new vn(r,n)}static getInstance(e){return e?vd.get(e):Array.from(vd.values()).reverse().find(n=>!n.isClosing()&&n)||null}static getSlide(){var e;return((e=vn.getInstance())===null||e===void 0?void 0:e.getSlide())||null}static show(e=[],n={}){return new vn(e,n)}static next(){const e=vn.getInstance();e&&e.next()}static prev(){const e=vn.getInstance();e&&e.prev()}static close(e=!0,...n){if(e)for(const r of vd.values())r.close(...n);else{const r=vn.getInstance();r&&r.close(...n)}}}Object.defineProperty(vn,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.36"}),Object.defineProperty(vn,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:xb}),Object.defineProperty(vn,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:S5}),Object.defineProperty(vn,"openers",{enumerable:!0,configurable:!0,writable:!0,value:new Map});const vm=Object.freeze(Object.defineProperty({__proto__:null,Carousel:yh,Fancybox:vn,Panzoom:yd},Symbol.toStringTag,{value:"Module"})),{Fancybox:wm}=vm,T5={props:{options:Object},mounted(){wm.defaults={...this.options||{}}},updated(){wm.close(),wm.defaults={...this.options||{}}},unmounted(){wm.close()}},A5={ref:"container"};function M5(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",A5,[h.renderSlot(t.$slots,"default")],512)}const D5=Ve(T5,[["render",M5]]),I5={},P5={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-file"};function R5(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",P5,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"},null,-1),h.createElementVNode("path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"},null,-1)]))}const a2=Ve(I5,[["render",R5]]),O5={componens:{IconFile:a2},props:{item:null},computed:{createDate(){try{const t=ft(this.item.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},methods:{formatBytes(t){if(t<1024)return`${t} B`;const e=t/1024;return e<1024?`${e.toFixed(2)} KB`:`${(e/1024).toFixed(2)} MB`}}},N5={class:"max-w-[55vw]"},B5={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},z5={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},L5={class:"px-[5px]"},V5={class:""};function F5(t,e,n,r,i,s){var a,o;return h.openBlock(),h.createElementBlock(h.Fragment,null,[e[1]||(e[1]=h.createStaticVNode('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),h.createElementVNode("div",N5,[h.createElementVNode("p",B5,h.toDisplayString(n.item.uploaded_name),1),h.createElementVNode("p",z5,[h.createElementVNode("span",null,h.toDisplayString(n.item.username),1),h.withDirectives(h.createElementVNode("span",L5,"|",512),[[h.vShow,(a=n.item)==null?void 0:a.username]]),h.createElementVNode("span",null,h.toDisplayString(s.createDate),1),e[0]||(e[0]=h.createElementVNode("span",{class:"px-[5px]"},"|",-1)),h.createElementVNode("span",V5,h.toDisplayString(s.formatBytes((o=n.item)==null?void 0:o.size)),1)])])],64)}const $5=Ve(O5,[["render",F5]]),j5={},H5={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function U5(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",H5,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),h.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),h.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const l2=Ve(j5,[["render",U5]]),W5={},q5={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function G5(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",q5,e[0]||(e[0]=[h.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const c2=Ve(W5,[["render",G5]]),Y5={components:{Fancybox:D5,VsWidgetFileInfo:$5,IconDownload:l2,IconTrash:c2},props:{item:null},data(){return{optionsFile:{defaultType:"iframe"}}},computed:{createDate(){try{const t=ft(this.item.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},methods:{isSupportedFile(t){return["pdf","json"].includes(t.ext)&&parseInt(t.size,10)<=10485760},async downloadFile(t){const e=document.createElement("a");e.setAttribute("download",t.uploaded_name),e.href=t.file_path,e.click()},confirnDeleteFile(){this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteFile,updateListOnConfirm:!0})},async deleteFile(){try{await tt.delete(`/api/widget/file/${this.item.entity_id}/${this.item.file_id}`),this.$emit("update")}catch(t){console.error(t)}}}},Z5={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},X5={key:0,class:"flex w-full gap-x-3 items-center"},K5=["href"],J5={key:1,class:"flex gap-x-3 w-full items-center"},Q5=["href"],e3={key:2,class:"flex gap-x-3 w-full items-center"},t3={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},n3={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},r3={class:"inline-block"},i3={class:"inline-block"};function s3(t,e,n,r,i,s){const a=h.resolveComponent("VsWidgetFileInfo"),o=h.resolveComponent("Fancybox"),p=h.resolveComponent("IconDownload"),g=h.resolveComponent("IconTrash");return h.openBlock(),h.createElementBlock("div",Z5,[n.item.ext==="jpg"||n.item.ext==="png"?(h.openBlock(),h.createElementBlock("div",X5,[h.createVNode(o,null,{default:h.withCtx(()=>[h.createElementVNode("a",{"data-fancybox":"gallery",href:n.item.file_path,target:"_blank",class:"flex gap-x-3 w-full items-center"},[h.createVNode(a,{item:n.item},null,8,["item"])],8,K5)]),_:1})])):s.isSupportedFile(n.item)?(h.openBlock(),h.createElementBlock("div",J5,[h.createVNode(o,{options:i.optionsFile},{default:h.withCtx(()=>[h.createElementVNode("a",{"data-fancybox":"gallery",href:n.item.file_path,target:"_blank",class:"flex gap-x-3 w-full items-center"},[h.createVNode(a,{item:n.item},null,8,["item"])],8,Q5)]),_:1},8,["options"])])):(h.openBlock(),h.createElementBlock("div",e3,[h.createVNode(a,{item:n.item},null,8,["item"])])),h.createElementVNode("div",t3,[h.createElementVNode("div",n3,[h.createElementVNode("div",r3,[h.createElementVNode("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[0]||(e[0]=y=>s.downloadFile(n.item))},[h.createVNode(p,{height:"14",width:"14"})])]),e[2]||(e[2]=h.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),h.createElementVNode("div",i3,[h.createElementVNode("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:e[1]||(e[1]=y=>s.confirnDeleteFile())},[h.createVNode(g,{height:"14",width:"14"})])])])])])}const o3=Ve(Y5,[["render",s3]]),a3={props:["text"]},l3={class:"pl-3 text-sm font-medium text-gray-600"};function c3(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("p",l3,h.toDisplayString(n.text),1)])}const d2=Ve(a3,[["render",c3]]),d3={},u3={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-upload"};function h3(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",u3,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),h.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),h.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const u2=Ve(d3,[["render",h3]]),{Fancybox:f3}=vm,p3={components:{VsWidgetFileItem:o3,VsEmptyWidget:d2,IconUpload:u2},props:{id:{type:String,default(){return""}},prefilledData:{}},data(){return{isModalVisible:!1,modal:{},files:"",searchValue:""}},mounted(){this.getFileList()},computed:{filteredFiles(){return this.searchValue===""?this.files:this.files.filter(e=>e.uploaded_name.includes(this.searchValue))}},methods:{async getFileList(){if(this.prefilledData){this.files=this.prefilledData.rows;return}try{const{data:t}=await tt.get(`/api/widget/file/${this.id}`);f3.bind("[data-fancybox='gallery']"),this.files=t==null?void 0:t.rows}catch(t){console.error(t)}},async addFile(t){console.log(t),await Promise.all(Array.from(t.target.files).map(async e=>{const n=new FormData;n.append("file",e);try{const r=`/api/widget/file/${this.id}`;return await tt.post(r,n),this.$emit("update","file-list"),e}catch(r){return console.error(r),null}})),await this.getFileList()},prepareModal(t){const e={...t};return t.cancel||(e.cancel=()=>{this.isModalVisible=!1}),t.updateListOnConfirm&&(e.confirm=async()=>{await t.confirm(),this.isModalVisible=!1,this.getFileList()}),e},handleOpenModal(t){this.modal=this.prepareModal(t),this.isModalVisible=!0}}},m3={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700"},g3={class:"flex w-full mb-[12px] items-baseline gap-x-2"},y3={class:"font-semibold text-gray-800 dark:text-neutral-200"},b3={class1:"ml-auto"},_3={class:"inline-flex cursor-pointer items-center py-[6px] px-[10px] text-sm font-normal text-white duration-300 bg-blue-600 border border-transparent rounded-md gap-x-2 hover:bg-blue-700 hover:text-white"},x3={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},v3={class:"relative"},w3={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},k3={key:0},E3={class:"p-4"},S3={class:"mt-1 text-gray-500 dark:text-neutral-500"},C3={class:"flex justify-end mt-4 gap-x-3"};function T3(t,e,n,r,i,s){var y,v;const a=h.resolveComponent("IconUpload"),o=h.resolveComponent("VsWidgetFileItem"),p=h.resolveComponent("VsEmptyWidget"),g=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock("div",m3,[h.createElementVNode("div",g3,[h.createElementVNode("h2",y3," Кількість: "+h.toDisplayString(i.files.length),1),h.createElementVNode("div",b3,[h.createElementVNode("label",null,[h.createElementVNode("input",{type:"file",class:"hidden",onChange:e[0]||(e[0]=E=>s.addFile(E))},null,32),h.createElementVNode("div",_3,[h.createVNode(a,{height:"16",width:"16"})])])])]),((y=i.files)==null?void 0:y.length)>4?(h.openBlock(),h.createElementBlock("div",x3,[h.createElementVNode("div",null,[h.createElementVNode("div",v3,[e[7]||(e[7]=h.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[h.createElementVNode("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[h.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),h.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),h.withDirectives(h.createElementVNode("input",{type:"text","onUpdate:modelValue":e[1]||(e[1]=E=>i.searchValue=E),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[h.vModelText,i.searchValue,void 0,{trim:!0}]])])])])):h.createCommentVNode("",!0),(v=i.files)!=null&&v.length?(h.openBlock(),h.createElementBlock("div",w3,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.filteredFiles,(E,T)=>(h.openBlock(),h.createBlock(o,{key:T,id:n.id,item:E,onUpdate:e[2]||(e[2]=D=>t.$emit("update","file-list")),onOpenModal:e[3]||(e[3]=D=>s.handleOpenModal(D))},null,8,["id","item"]))),128)),s.filteredFiles.length?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",k3,e[8]||(e[8]=[h.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):(h.openBlock(),h.createBlock(p,{key:2,text:"Файли відсутні"})),h.createVNode(g,{title:i.modal.title,size:"small",visible:i.isModalVisible,"onUpdate:visible":e[6]||(e[6]=E=>i.isModalVisible=E)},{default:h.withCtx(()=>[h.createElementVNode("div",E3,[h.createElementVNode("p",S3,h.toDisplayString(i.modal.message),1),h.createElementVNode("div",C3,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=(...E)=>i.modal.cancel&&i.modal.cancel(...E))},h.toDisplayString(i.modal.cancelButtonText),1),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[5]||(e[5]=(...E)=>i.modal.confirm&&i.modal.confirm(...E))},h.toDisplayString(i.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const h2=Ve(p3,[["render",T3]]),A3={class:"flex flex-col vs-widget-images xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700"},M3={class:"flex items-center gap-x-2"},D3={class:"inline-block font-semibold text-gray-800 dark:text-neutral-200"},I3={class:"flex items-center gap-x-2"},P3={class:"inline-flex items-center py-[6px] px-[10px] text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},R3={class:"flex flex-wrap gap-[16px]"},O3=["href","data-caption"],N3=["src","alt"],B3={class:"item__text-content bg-white opacity-0 rounded-b-lg absolute w-full bottom-0 p-3 flex gap-2.5 items-center justify-between"},z3={class:"text-xs w-[180px] block overflow-hidden text-nowrap overflow-ellipsis"},L3={class:"flex flex-wrap items-center text-xs text-gray-600 widget-images__item-desc"},V3={class:"flex items-center"},F3={class:"text-xs"},$3=["onClick"],j3=["onClick"],H3={class:"p-4"},U3={class:"mt-1 text-gray-500 dark:text-neutral-500"},W3={class:"flex justify-end mt-4 gap-x-3"},q3={__name:"vs-widget-gallery",props:{id:{type:String,default:""},readonly:{type:Boolean,default:!1},prefilledData:{type:Array,default:()=>[]}},setup(t){const{Fancybox:e}=vm,n=t,r=h.ref([]),i=h.ref(!1),s=h.ref(null),a=h.ref({}),o=async()=>{var D;if((D=n==null?void 0:n.prefilledData)!=null&&D.length){r.value=n==null?void 0:n.prefilledData,e.bind("[data-fancybox='gallery']");return}try{const{data:N}=await tt.get(`/api/widget/gallery/${n==null?void 0:n.id}`);r.value=N==null?void 0:N.rows,e.bind("[data-fancybox='gallery']")}catch(N){console.error(N)}},p=async D=>{var B;const N=Array.from((B=D.target)==null?void 0:B.files);await Promise.all(N.map(async F=>{const X=new FormData;X.append("file",F);try{await tt.post(`/api/widget/file/${n==null?void 0:n.id}`,X)}catch(te){console.error(te)}})),await o()},g=D=>{const N=document.createElement("a");N.setAttribute("download",D==null?void 0:D.uploaded_name),N.href=D==null?void 0:D.file_path,N.click()},y=D=>{s.value=D,a.value={title:"Ви впевнені?",message:"Ви впевнені що хочете видалити зображення?",confirmButtonText:"Так, видалити ",cancelButtonText:"Відмінити",confirm:async()=>{await v(),i.value=!1,await o()},cancel:()=>{i.value=!1}},i.value=!0},v=async()=>{var D,N;try{await tt.delete(`/api/widget/gallery/${(D=s.value)==null?void 0:D.entity_id}/${(N=s.value)==null?void 0:N.file_id}`)}catch(B){console.error(B)}},E=(D,N=2)=>{if(D===0)return"0 Bytes";const B=1024,F=N<0?0:N,X=["Bytes","KB","MB","GB","TB"],te=Math.floor(Math.log(D)/Math.log(B));return`${parseFloat((D/B**te).toFixed(F))} ${X[te]}`},T=D=>{const N={day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"};return new Date(D).toLocaleDateString("ru-RU",N)};return h.watch(()=>n.id,o),h.onMounted(o),(D,N)=>{const B=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock("div",A3,[h.createElementVNode("div",M3,[h.createElementVNode("h2",D3," Кількість: "+h.toDisplayString(r.value.length),1),h.createElementVNode("div",I3,[h.createElementVNode("div",null,[h.createElementVNode("label",null,[h.createElementVNode("input",{type:"file",class:"hidden",onChange:p},null,32),h.createElementVNode("div",P3,[h.createVNode(u2,{height:"16",width:"16"})])])])])]),h.createElementVNode("div",R3,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.value,F=>(h.openBlock(),h.createElementBlock("div",{key:F.file_path,class:"relative cursor-pointer rounded-b-lg item hover:shadow-lg h-[200px] w-[300px]"},[h.createElementVNode("a",{href:F.file_path,"data-fancybox":"gallery","data-caption":F.uploaded_name,target:"_blank"},[h.createElementVNode("img",{class:"object-cover w-full h-full rounded-lg",src:F.file_path||"/icons/no-image.jpg",alt:F.uploaded_name},null,8,N3),h.createElementVNode("div",B3,[h.createElementVNode("div",null,[h.createElementVNode("span",z3,h.toDisplayString(F.uploaded_name),1),h.createElementVNode("div",L3,[h.createElementVNode("span",V3,h.toDisplayString(E(F.size)),1),h.createElementVNode("span",null,h.toDisplayString(T(F.cdate)),1)]),h.createElementVNode("span",F3,h.toDisplayString(F.username),1)]),h.createElementVNode("div",null,[h.createElementVNode("div",{class:"flex items-center justify-center gap-2 hover:bg-gray-200 p-[6px] rounded",onClick:h.withModifiers(X=>g(F),["prevent"])},[h.createVNode(l2,{height:"14",width:"14"})],8,$3),h.createElementVNode("div",{class:"flex items-center gap-2 hover:bg-gray-200 p-[6px] rounded hover:cursor-pointer",onClick:h.withModifiers(X=>y(F),["prevent"])},[h.createVNode(c2,{height:"14",width:"14"})],8,j3)])])],8,O3)]))),128))]),h.createVNode(B,{title:a.value.title,size:"small",visible:i.value,"onUpdate:visible":N[2]||(N[2]=F=>i.value=F)},{default:h.withCtx(()=>[h.createElementVNode("div",H3,[h.createElementVNode("p",U3,h.toDisplayString(a.value.message),1),h.createElementVNode("div",W3,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:N[0]||(N[0]=(...F)=>a.value.cancel&&a.value.cancel(...F))},h.toDisplayString(a.value.cancelButtonText),1),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600",onClick:N[1]||(N[1]=(...F)=>a.value.confirm&&a.value.confirm(...F))},h.toDisplayString(a.value.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}}};function Qr(t){this.content=t}Qr.prototype={constructor:Qr,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new Qr(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Qr(n)},addToStart:function(t,e){return new Qr([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Qr(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new Qr(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Qr.from(t),t.size?new Qr(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Qr.from(t),t.size?new Qr(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Qr.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},Qr.from=function(t){if(t instanceof Qr)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Qr(e)};function f2(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){let a=f2(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function p2(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let a=t.child(--i),o=e.child(--s),p=a.nodeSize;if(a==o){n-=p,r-=p;continue}if(!a.sameMarkup(o))return{a:n,b:r};if(a.isText&&a.text!=o.text){let g=0,y=Math.min(a.text.length,o.text.length);for(;g<y&&a.text[a.text.length-g-1]==o.text[o.text.length-g-1];)g++,n--,r--;return{a:n,b:r}}if(a.content.size||o.content.size){let g=p2(a.content,o.content,n-1,r-1);if(g)return g}n-=p,r-=p}}class je{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let a=0,o=0;o<n;a++){let p=this.content[a],g=o+p.nodeSize;if(g>e&&r(p,i+o,s||null,a)!==!1&&p.content.size){let y=o+1;p.nodesBetween(Math.max(0,e-y),Math.min(p.content.size,n-y),r,i+y)}o=g}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",a=!0;return this.nodesBetween(e,n,(o,p)=>{let g=o.isText?o.text.slice(Math.max(e,p)-p,n-p):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&g||o.isTextblock)&&r&&(a?a=!1:s+=r),s+=g},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new je(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,a=0;a<n;s++){let o=this.content[s],p=a+o.nodeSize;p>e&&((a<e||p>n)&&(o.isText?o=o.cut(Math.max(0,e-a),Math.min(o.text.length,n-a)):o=o.cut(Math.max(0,e-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=p}return new je(r,i)}cutByIndex(e,n){return e==n?je.empty:e==0&&n==this.content.length?this:new je(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new je(i,s)}addToStart(e){return new je([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new je(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return f2(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return p2(this,e,n,r)}findIndex(e,n=-1){if(e==0)return km(0,e);if(e==this.size)return km(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),a=i+s.nodeSize;if(a>=e)return a==e||n>0?km(r+1,a):km(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return je.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new je(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return je.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new je(n||e,r)}static from(e){if(!e)return je.empty;if(e instanceof je)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new je([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}je.empty=new je([],0);const Ib={index:0,offset:0};function km(t,e){return Ib.index=t,Ib.offset=e,Ib}function Em(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Em(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Em(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Jn=class B1{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Em(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return B1.none;if(e instanceof B1)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Jn.none=[];class Sm extends Error{}class gt{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=g2(this.content,e+this.openStart,n);return r&&new gt(r,this.openStart,this.openEnd)}removeBetween(e,n){return new gt(m2(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return gt.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new gt(je.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new gt(e,r,i)}}gt.empty=new gt(je.empty,0,0);function m2(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:a,offset:o}=t.findIndex(n);if(i==e||s.isText){if(o!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(m2(s.content,e-i-1,n-i-1)))}function g2(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),a=t.maybeChild(i);if(s==e||a.isText)return t.cut(0,e).append(n).append(t.cut(e));let o=g2(a.content,e-s-1,n);return o&&t.replaceChild(i,a.copy(o))}function G3(t,e,n){if(n.openStart>t.depth)throw new Sm("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Sm("Inconsistent open depths");return y2(t,e,n,0)}function y2(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let a=y2(t,e,n,r+1);return s.copy(s.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,o=a.content;return rc(a,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:a,end:o}=Y3(n,t);return rc(s,_2(t,a,o,e,r))}else return rc(s,Cm(t,e,r))}function b2(t,e){if(!e.type.compatibleContent(t.type))throw new Sm("Cannot join "+e.type.name+" onto "+t.type.name)}function Pb(t,e,n){let r=t.node(n);return b2(r,e.node(n)),r}function nc(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function wh(t,e,n,r){let i=(e||t).node(n),s=0,a=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(nc(t.nodeAfter,r),s++));for(let o=s;o<a;o++)nc(i.child(o),r);e&&e.depth==n&&e.textOffset&&nc(e.nodeBefore,r)}function rc(t,e){return t.type.checkContent(e),t.copy(e)}function _2(t,e,n,r,i){let s=t.depth>i&&Pb(t,e,i+1),a=r.depth>i&&Pb(n,r,i+1),o=[];return wh(null,t,i,o),s&&a&&e.index(i)==n.index(i)?(b2(s,a),nc(rc(s,_2(t,e,n,r,i+1)),o)):(s&&nc(rc(s,Cm(t,e,i+1)),o),wh(e,n,i,o),a&&nc(rc(a,Cm(n,r,i+1)),o)),wh(r,null,i,o),new je(o)}function Cm(t,e,n){let r=[];if(wh(null,t,n,r),t.depth>n){let i=Pb(t,e,n+1);nc(rc(i,Cm(t,e,n+1)),r)}return wh(e,null,n,r),new je(r)}function Y3(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(je.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class kh{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Jn.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let o=r;r=i,i=o}let s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Tm(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let a=e;;){let{index:o,offset:p}=a.content.findIndex(s),g=s-p;if(r.push(a,o,i+p),!g||(a=a.child(o),a.isText))break;s=g-1,i+=p+1}return new kh(n,r,s)}static resolveCached(e,n){let r=x2.get(e);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==n)return a}else x2.set(e,r=new Z3);let i=r.elts[r.i]=kh.resolve(e,n);return r.i=(r.i+1)%X3,i}}class Z3{constructor(){this.elts=[],this.i=0}}const X3=12,x2=new WeakMap;class Tm{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const K3=Object.create(null);let Va=class z1{constructor(e,n,r,i=Jn.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||je.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Em(this.attrs,n||e.defaultAttrs||K3)&&Jn.sameSet(this.marks,r||Jn.none)}copy(e=null){return e==this.content?this:new z1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new z1(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return gt.empty;let i=this.resolve(e),s=this.resolve(n),a=r?0:i.sharedDepth(n),o=i.start(a),g=i.node(a).content.cut(i.pos-o,s.pos-o);return new gt(g,i.depth-a,s.depth-a)}replace(e,n,r){return G3(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return kh.resolveCached(this,e)}resolveNoCache(e){return kh.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),v2(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=je.empty,i=0,s=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,s),o=a&&a.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let p=i;p<s;p++)if(!this.type.allowsMarks(r.child(p).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),a=s&&s.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Jn.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Jn.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=je.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Va.prototype.text=void 0;class Am extends Va{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):v2(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Am(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Am(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function v2(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ic{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new J3(e,n);if(r.next==null)return ic.empty;let i=w2(r);r.next&&r.err("Unexpected trailing text");let s=sF(iF(i));return oF(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(a,o){let p=a.matchFragment(e,r);if(p&&(!n||p.validEnd))return je.from(o.map(g=>g.createAndFill()));for(let g=0;g<a.next.length;g++){let{type:y,next:v}=a.next[g];if(!(y.isText||y.hasRequiredAttrs())&&i.indexOf(v)==-1){i.push(v);let E=s(v,o.concat(y));if(E)return E}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let o=i;o.type;o=o.via)a.push(o.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:o,next:p}=s.next[a];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||p.validEnd)&&(r.push({match:o.contentMatch,type:o,via:i}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return s}).join(`
|
630
630
|
`)}}ic.empty=new ic(!0);class J3{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function w2(t){let e=[];do e.push(Q3(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Q3(t){let e=[];do e.push(eF(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function eF(t){let e=rF(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=tF(t,e);else break;return e}function k2(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function tF(t,e){let n=k2(t),r=n;return t.eat(",")&&(t.next!="}"?r=k2(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function nF(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let a=n[s];a.isInGroup(e)&&i.push(a)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function rF(t){if(t.eat("(")){let e=w2(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=nF(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function iF(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(a,o,p){let g={term:p,to:o};return e[a].push(g),g}function i(a,o){a.forEach(p=>p.to=o)}function s(a,o){if(a.type=="choice")return a.exprs.reduce((p,g)=>p.concat(s(g,o)),[]);if(a.type=="seq")for(let p=0;;p++){let g=s(a.exprs[p],o);if(p==a.exprs.length-1)return g;i(g,o=n())}else if(a.type=="star"){let p=n();return r(o,p),i(s(a.expr,p),p),[r(p)]}else if(a.type=="plus"){let p=n();return i(s(a.expr,o),p),i(s(a.expr,p),p),[r(p)]}else{if(a.type=="opt")return[r(o)].concat(s(a.expr,o));if(a.type=="range"){let p=o;for(let g=0;g<a.min;g++){let y=n();i(s(a.expr,p),y),p=y}if(a.max==-1)i(s(a.expr,p),p);else for(let g=a.min;g<a.max;g++){let y=n();r(p,y),i(s(a.expr,p),y),p=y}return[r(p)]}else{if(a.type=="name")return[r(o,void 0,a.value)];throw new Error("Unknown expr type")}}}}function E2(t,e){return e-t}function S2(t,e){let n=[];return r(e),n.sort(E2);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let a=0;a<s.length;a++){let{term:o,to:p}=s[a];!o&&n.indexOf(p)==-1&&r(p)}}}function sF(t){let e=Object.create(null);return n(S2(t,0));function n(r){let i=[];r.forEach(a=>{t[a].forEach(({term:o,to:p})=>{if(!o)return;let g;for(let y=0;y<i.length;y++)i[y][0]==o&&(g=i[y][1]);S2(t,p).forEach(y=>{g||i.push([o,g=[]]),g.indexOf(y)==-1&&g.push(y)})})});let s=e[r.join(",")]=new ic(r.indexOf(t.length-1)>-1);for(let a=0;a<i.length;a++){let o=i[a][1].sort(E2);s.next.push({type:i[a][0],next:e[o.join(",")]||n(o)})}return s}}function oF(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,a=[];for(let o=0;o<i.next.length;o++){let{type:p,next:g}=i.next[o];a.push(p.name),s&&!(p.isText||p.hasRequiredAttrs())&&(s=!1),r.indexOf(g)==-1&&r.push(g)}s&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function C2(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function T2(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function A2(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function M2(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new lF(t,r,e[r]);return n}let D2=class qP{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=M2(e,r.attrs),this.defaultAttrs=C2(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ic.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:T2(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Va(this,this.computeAttrs(e),je.from(n),Jn.setFrom(r))}createChecked(e=null,n,r){return n=je.from(n),this.checkContent(n),new Va(this,this.computeAttrs(e),n,Jn.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=je.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(je.empty,!0);return s?new Va(this,e,n.append(s),Jn.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){A2(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Jn.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,a)=>r[s]=new qP(s,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function aF(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class lF{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?aF(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Mm{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=M2(e,i.attrs),this.excluded=null;let s=C2(this.attrs);this.instance=s?new Jn(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Jn(this,T2(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,a)=>r[s]=new Mm(s,i++,n,a)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){A2(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class I2{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Qr.from(e.nodes),n.marks=Qr.from(e.marks||{}),this.nodes=D2.compile(this.spec.nodes,this),this.marks=Mm.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],a=s.spec.content||"",o=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=ic.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=o=="_"?null:o?P2(this,o.split(" ")):o==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:P2(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof D2){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Am(r,r.defaultAttrs,e,Jn.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Va.fromJSON(this,e)}markFromJSON(e){return Jn.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function P2(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],a=s;if(s)n.push(s);else for(let o in t.marks){let p=t.marks[o];(i=="_"||p.spec.group&&p.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=p)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function cF(t){return t.tag!=null}function dF(t){return t.style!=null}let Eh=class L1{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(cF(i))this.tags.push(i);else if(dF(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new B2(this,n,!1);return r.addAll(e,Jn.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new B2(this,n,!0);return r.addAll(e,Jn.none,n.from,n.to),gt.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(fF(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],o=a.style;if(!(o.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(a.getAttrs){let p=a.getAttrs(n);if(p===!1)continue;a.attrs=p||void 0}return a}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let o=n[a];if((o.priority==null?50:o.priority)<s)break}n.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{r(a=z2(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{r(a=z2(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new L1(e,L1.schemaRules(e)))}};const R2={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},uF={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},O2={ol:!0,ul:!0},Sh=1,Rb=2,Ch=4;function N2(t,e,n){return e!=null?(e?Sh:0)|(e==="full"?Rb:0):t&&t.whitespace=="pre"?Sh|Rb:n&~Ch}class Dm{constructor(e,n,r,i,s,a){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=Jn.none,this.match=s||(a&Ch?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(je.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Sh)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=je.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(je.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!R2.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class B2{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,a=N2(null,n.preserveWhitespace,0)|(r?Ch:0);i?s=new Dm(i.type,i.attrs,Jn.none,!0,n.topMatch||i.type.contentMatch,a):r?s=new Dm(null,null,Jn.none,!0,null,a):s=new Dm(e.schema.topNodeType,null,Jn.none,!0,null,a),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&Rb?"full":this.localPreserveWS||(i.options&Sh)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)s!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
631
631
|
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],o=e.previousSibling;(!a||o&&o.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;O2.hasOwnProperty(a)&&this.parser.normalizeLists&&hF(e);let p=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(p?p.ignore:uF.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!p||p.skip||p.closeParent){p&&p.closeParent?this.open=Math.max(0,this.open-1):p&&p.skip.nodeType&&(e=p.skip);let g,y=this.needsBlock;if(R2.hasOwnProperty(a))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),g=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let v=p&&p.skip?n:this.readStyles(e,n);v&&this.addAll(e,v),g&&this.sync(s),this.needsBlock=y}else{let g=this.readStyles(e,n);g&&this.addElementByRule(e,p,g,p.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
632
632
|
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=r.getPropertyValue(s);if(a)for(let o=void 0;;){let p=this.parser.matchStyle(s,a,this,o);if(!p)break;if(p.ignore)return null;if(p.clearMark?n=n.filter(g=>!p.clearMark(g)):n=n.concat(this.parser.schema.marks[p.mark].create(p.attrs)),p.consuming===!1)o=p;else break}}return n}addElementByRule(e,n,r,i){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r)||this.leafFallback(e,r);else{let p=this.enter(a,n.attrs||null,r,n.preserveWhitespace);p&&(s=!0,r=p)}else{let p=this.parser.schema.marks[n.mark];r=r.concat(p.create(n.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(p=>this.insertNode(p,r));else{let p=e;typeof n.contentElement=="string"?p=e.querySelector(n.contentElement):typeof n.contentElement=="function"?p=n.contentElement(e):n.contentElement&&(p=n.contentElement),this.findAround(e,p,!0),this.addAll(p,r),this.findAround(e,p,!1)}s&&this.sync(o)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let a=r?e.childNodes[r]:e.firstChild,o=i==null?null:e.childNodes[i];a!=o;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,n);this.findAtPoint(e,s)}findPlace(e,n){let r,i;for(let s=this.open;s>=0;s--){let a=this.nodes[s],o=a.findWrapping(e);if(o&&(!r||r.length>o.length)&&(r=o,i=a,!o.length)||a.solid)break}if(!r)return null;this.sync(i);for(let s=0;s<r.length;s++)n=this.enterInner(r[s],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=Jn.none;for(let a of r.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):L2(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=N2(e,s,a.options);a.options&Ch&&a.content.length==0&&(o|=Ch);let p=Jn.none;return r=r.filter(g=>(a.type?a.type.allowsMarkType(g.type):L2(g.type,e))?(p=g.addToSet(p),!1):!0),this.nodes.push(new Dm(e,n,p,i,null,o)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Sh)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),a=(o,p)=>{for(;o>=0;o--){let g=n[o];if(g==""){if(o==n.length-1||o==0)continue;for(;p>=s;p--)if(a(o-1,p))return!0;return!1}else{let y=p>0||p==0&&i?this.nodes[p].type:r&&p>=s?r.node(p-s).type:null;if(!y||y.name!=g&&!y.isInGroup(g))return!1;p--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function hF(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&O2.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function fF(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function z2(t){let e={};for(let n in t)e[n]=t[n];return e}function L2(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],a=o=>{s.push(o);for(let p=0;p<o.edgeCount;p++){let{type:g,next:y}=o.edge(p);if(g==e||s.indexOf(y)<0&&a(y))return!0}};if(a(i.contentMatch))return!0}}class sc{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ob(n).createDocumentFragment());let i=r,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let o=0,p=0;for(;o<s.length&&p<a.marks.length;){let g=a.marks[p];if(!this.marks[g.type.name]){p++;continue}if(!g.eq(s[o][0])||g.type.spec.spanning===!1)break;o++,p++}for(;o<s.length;)i=s.pop()[1];for(;p<a.marks.length;){let g=a.marks[p++],y=this.serializeMark(g,a.isInline,n);y&&(s.push([g,i]),i.appendChild(y.dom),i=y.contentDOM||y.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Im(Ob(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Im(Ob(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Im(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new sc(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=V2(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return V2(e.marks)}}function V2(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ob(t){return t.document||window.document}const F2=new WeakMap;function pF(t){let e=F2.get(t);return e===void 0&&F2.set(t,e=mF(t)),e}function mF(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Im(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=pF(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let o,p=n?t.createElementNS(n,i):t.createElement(i),g=e[1],y=1;if(g&&typeof g=="object"&&g.nodeType==null&&!Array.isArray(g)){y=2;for(let v in g)if(g[v]!=null){let E=v.indexOf(" ");E>0?p.setAttributeNS(v.slice(0,E),v.slice(E+1),g[v]):p.setAttribute(v,g[v])}}for(let v=y;v<e.length;v++){let E=e[v];if(E===0){if(v<e.length-1||v>y)throw new RangeError("Content hole must be the only child of its parent node");return{dom:p,contentDOM:p}}else{let{dom:T,contentDOM:D}=Im(t,E,n,r);if(p.appendChild(T),D){if(o)throw new RangeError("Multiple content holes");o=D}}}return{dom:p,contentDOM:o}}const $2=65535,j2=Math.pow(2,16);function gF(t,e){return t+e*j2}function H2(t){return t&$2}function yF(t){return(t-(t&$2))/j2}const U2=1,W2=2,Pm=4,q2=8;class Nb{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&q2)>0}get deletedBefore(){return(this.delInfo&(U2|Pm))>0}get deletedAfter(){return(this.delInfo&(W2|Pm))>0}get deletedAcross(){return(this.delInfo&Pm)>0}}class hs{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&hs.empty)return hs.empty}recover(e){let n=0,r=H2(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+yF(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let p=this.ranges[o]-(this.inverted?i:0);if(p>e)break;let g=this.ranges[o+s],y=this.ranges[o+a],v=p+g;if(e<=v){let E=g?e==p?-1:e==v?1:n:n,T=p+i+(E<0?0:y);if(r)return T;let D=e==(n<0?p:v)?null:gF(o/3,e-p),N=e==p?W2:e==v?U2:Pm;return(n<0?e!=p:e!=v)&&(N|=q2),new Nb(T,N,D)}i+=y-g}return r?e+i:new Nb(e+i,0,null)}touches(e,n){let r=0,i=H2(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let p=this.ranges[o]-(this.inverted?r:0);if(p>e)break;let g=this.ranges[o+s],y=p+g;if(e<=y&&o==i*3)return!0;r+=this.ranges[o+a]-g}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],o=a-(this.inverted?s:0),p=a+(this.inverted?0:s),g=this.ranges[i+n],y=this.ranges[i+r];e(o,o+g,p,p+y),s+=y-g}}invert(){return new hs(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?hs.empty:new hs(e<0?[0,-e,0]:[0,0,e])}}hs.empty=new hs([]);class wd{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new wd(this.maps,this.mirror,e,n)}copy(){return new wd(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new wd;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let a=this.maps[s],o=a.mapResult(e,n);if(o.recover!=null){let p=this.getMirror(s);if(p!=null&&p>s&&p<this.to){s=p,e=this.maps[p].recover(o.recover);continue}}i|=o.delInfo,e=o.pos}return r?e:new Nb(e,i,null)}}const Bb=Object.create(null);class fi{getMap(){return hs.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Bb[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Bb)throw new RangeError("Duplicate use of step JSON ID "+e);return Bb[e]=n,n.prototype.jsonID=e,n}}class Cr{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Cr(e,null)}static fail(e){return new Cr(null,e)}static fromReplace(e,n,r,i){try{return Cr.ok(e.replace(n,r,i))}catch(s){if(s instanceof Sm)return Cr.fail(s.message);throw s}}}function zb(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(zb(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return je.fromArray(r)}class Fa extends fi{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new gt(zb(n.content,(a,o)=>!a.isAtom||!o.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Cr.fromReplace(e,this.from,this.to,s)}invert(){return new ko(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Fa(n.pos,r.pos,this.mark)}merge(e){return e instanceof Fa&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Fa(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Fa(n.from,n.to,e.markFromJSON(n.mark))}}fi.jsonID("addMark",Fa);class ko extends fi{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new gt(zb(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Cr.fromReplace(e,this.from,this.to,r)}invert(){return new Fa(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ko(n.pos,r.pos,this.mark)}merge(e){return e instanceof ko&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ko(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ko(n.from,n.to,e.markFromJSON(n.mark))}}fi.jsonID("removeMark",ko);class $a extends fi{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Cr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Cr.fromReplace(e,this.pos,this.pos+1,new gt(je.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new $a(this.pos,n.marks[i]);return new $a(this.pos,this.mark)}}return new kd(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new $a(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new $a(n.pos,e.markFromJSON(n.mark))}}fi.jsonID("addNodeMark",$a);class kd extends fi{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Cr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Cr.fromReplace(e,this.pos,this.pos+1,new gt(je.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new $a(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new kd(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new kd(n.pos,e.markFromJSON(n.mark))}}fi.jsonID("removeNodeMark",kd);class Vr extends fi{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Lb(e,this.from,this.to)?Cr.fail("Structure replace would overwrite content"):Cr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new hs([this.from,this.to-this.from,this.slice.size])}invert(e){return new Vr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Vr(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Vr)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?gt.empty:new gt(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Vr(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?gt.empty:new gt(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Vr(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Vr(n.from,n.to,gt.fromJSON(e,n.slice),!!n.structure)}}fi.jsonID("replace",Vr);class Fr extends fi{constructor(e,n,r,i,s,a,o=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Lb(e,this.from,this.gapFrom)||Lb(e,this.gapTo,this.to)))return Cr.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Cr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Cr.fromReplace(e,this.from,this.to,r):Cr.fail("Content does not fit in gap")}getMap(){return new hs([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Fr(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new Fr(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Fr(n.from,n.to,n.gapFrom,n.gapTo,gt.fromJSON(e,n.slice),n.insert,!!n.structure)}}fi.jsonID("replaceAround",Fr);function Lb(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function bF(t,e,n,r){let i=[],s=[],a,o;t.doc.nodesBetween(e,n,(p,g,y)=>{if(!p.isInline)return;let v=p.marks;if(!r.isInSet(v)&&y.type.allowsMarkType(r.type)){let E=Math.max(g,e),T=Math.min(g+p.nodeSize,n),D=r.addToSet(v);for(let N=0;N<v.length;N++)v[N].isInSet(D)||(a&&a.to==E&&a.mark.eq(v[N])?a.to=T:i.push(a=new ko(E,T,v[N])));o&&o.to==E?o.to=T:s.push(o=new Fa(E,T,r))}}),i.forEach(p=>t.step(p)),s.forEach(p=>t.step(p))}function _F(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(a,o)=>{if(!a.isInline)return;s++;let p=null;if(r instanceof Mm){let g=a.marks,y;for(;y=r.isInSet(g);)(p||(p=[])).push(y),g=y.removeFromSet(g)}else r?r.isInSet(a.marks)&&(p=[r]):p=a.marks;if(p&&p.length){let g=Math.min(o+a.nodeSize,n);for(let y=0;y<p.length;y++){let v=p[y],E;for(let T=0;T<i.length;T++){let D=i[T];D.step==s-1&&v.eq(i[T].style)&&(E=D)}E?(E.to=g,E.step=s):i.push({style:v,from:Math.max(o,e),to:g,step:s})}}}),i.forEach(a=>t.step(new ko(a.from,a.to,a.style)))}function Vb(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),a=[],o=e+1;for(let p=0;p<s.childCount;p++){let g=s.child(p),y=o+g.nodeSize,v=r.matchType(g.type);if(!v)a.push(new Vr(o,y,gt.empty));else{r=v;for(let E=0;E<g.marks.length;E++)n.allowsMarkType(g.marks[E].type)||t.step(new ko(o,y,g.marks[E]));if(i&&g.isText&&n.whitespace!="pre"){let E,T=/\r?\n|\r/g,D;for(;E=T.exec(g.text);)D||(D=new gt(je.from(n.schema.text(" ",n.allowedMarks(g.marks))),0,0)),a.push(new Vr(o+E.index,o+E.index+E[0].length,D))}}o=y}if(!r.validEnd){let p=r.fillBefore(je.empty,!0);t.replace(o,o,new gt(p,0,0))}for(let p=a.length-1;p>=0;p--)t.step(a[p])}function xF(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ed(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),s=t.$from.index(r),a=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(s,a,n))return r;if(r==0||i.type.spec.isolating||!xF(i,s,a))break}return null}function vF(t,e,n){let{$from:r,$to:i,depth:s}=e,a=r.before(s+1),o=i.after(s+1),p=a,g=o,y=je.empty,v=0;for(let D=s,N=!1;D>n;D--)N||r.index(D)>0?(N=!0,y=je.from(r.node(D).copy(y)),v++):p--;let E=je.empty,T=0;for(let D=s,N=!1;D>n;D--)N||i.after(D+1)<i.end(D)?(N=!0,E=je.from(i.node(D).copy(E)),T++):g++;t.step(new Fr(p,g,a,o,new gt(y.append(E),v,T),y.size-v,!0))}function Fb(t,e,n=null,r=t){let i=wF(t,e),s=i&&kF(r,e);return s?i.map(G2).concat({type:e,attrs:n}).concat(s.map(G2)):null}function G2(t){return{type:t,attrs:null}}function wF(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return n.canReplaceWith(r,i,a)?s:null}function kF(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let p=(a.length?a[a.length-1]:e).contentMatch;for(let g=r;p&&g<i;g++)p=p.matchType(n.child(g).type);return!p||!p.validEnd?null:a}function EF(t,e,n){let r=je.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let o=n[a].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=je.from(n[a].type.create(n[a].attrs,r))}let i=e.start,s=e.end;t.step(new Fr(i,s,i,s,new gt(r,0,0),n.length,!0))}function SF(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(a,o)=>{let p=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,p)&&CF(t.doc,t.mapping.slice(s).map(o),r)){let g=null;if(r.schema.linebreakReplacement){let T=r.whitespace=="pre",D=!!r.contentMatch.matchType(r.schema.linebreakReplacement);T&&!D?g=!1:!T&&D&&(g=!0)}g===!1&&Z2(t,a,o,s),Vb(t,t.mapping.slice(s).map(o,1),r,void 0,g===null);let y=t.mapping.slice(s),v=y.map(o,1),E=y.map(o+a.nodeSize,1);return t.step(new Fr(v,E,v+1,E-1,new gt(je.from(r.create(p,null,a.marks)),0,0),1,!0)),g===!0&&Y2(t,a,o,s),!1}})}function Y2(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let a,o=/\r?\n|\r/g;for(;a=o.exec(i.text);){let p=t.mapping.slice(r).map(n+1+s+a.index);t.replaceWith(p,p+1,e.type.schema.linebreakReplacement.create())}}})}function Z2(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+s);t.replaceWith(a,a+1,e.type.schema.text(`
|
@@ -738,7 +738,7 @@ img.ProseMirror-separator {
|
|
738
738
|
|
739
739
|
`);return!s||!a?!1:t.chain().command(({tr:o})=>(o.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const o=i.after();return o===void 0?!1:r.nodeAt(o)?t.commands.command(({tr:g})=>(g.setSelection(en.near(r.resolve(o))),!0)):t.commands.exitCode()}}},addInputRules(){return[P_({find:MH,type:this.type,getAttributes:t=>({language:t[1]})}),P_({find:DH,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ei({key:new Zi("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:a,schema:o}=t.state,p=o.text(n.replace(/\r\n?/g,`
|
740
740
|
`));return a.replaceSelectionWith(this.type.create({language:s},p)),a.selection.$from.parent.type!==this.type&&a.setSelection(Gt.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),IH=js.create({name:"doc",topNode:!0,content:"block+"});function PH(t={}){return new ei({view(e){return new RH(e,t)}})}class RH{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let o=e.nodeBefore,p=e.nodeAfter;if(o||p){let g=this.editorView.nodeDOM(this.cursorPos-(o?o.nodeSize:0));if(g){let y=g.getBoundingClientRect(),v=o?y.bottom:y.top;o&&p&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:y.left,right:y.right,top:v-this.width/2,bottom:v+this.width/2}}}}if(!r){let o=this.editorView.coordsAtPos(this.cursorPos);r={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,a;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,a=-pageYOffset;else{let o=i.getBoundingClientRect();s=o.left-i.scrollLeft,a=o.top-i.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=K2(this.editorView.state.doc,a,this.editorView.dragging.slice);o!=null&&(a=o)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const OH=jr.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[PH(this.options)]}});class gr extends en{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return gr.valid(r)?new gr(r):en.near(r)}content(){return gt.empty}eq(e){return e instanceof gr&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new gr(e.resolve(n.pos))}getBookmark(){return new X_(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!NH(e)||!BH(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&gr.valid(e))return e;let i=e.pos,s=null;for(let a=e.depth;;a--){let o=e.node(a);if(n>0?e.indexAfter(a)<o.childCount:e.index(a)>0){s=o.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let p=e.doc.resolve(i);if(gr.valid(p))return p}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Lt.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=a,i+=n;let o=e.doc.resolve(i);if(gr.valid(o))return o}return null}}}gr.prototype.visible=!1,gr.findFrom=gr.findGapCursorFrom,en.jsonID("gapcursor",gr);class X_{constructor(e){this.pos=e}map(e){return new X_(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return gr.valid(n)?new gr(n):en.near(n)}}function NH(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function BH(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function zH(){return new ei({props:{decorations:$H,createSelectionBetween(t,e,n){return e.pos==n.pos&&gr.valid(n)?new gr(n):null},handleClick:VH,handleKeyDown:LH,handleDOMEvents:{beforeinput:FH}}})}const LH=kC({ArrowLeft:ug("horiz",-1),ArrowRight:ug("horiz",1),ArrowUp:ug("vert",-1),ArrowDown:ug("vert",1)});function ug(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let a=r.selection,o=e>0?a.$to:a.$from,p=a.empty;if(a instanceof Gt){if(!s.endOfTextblock(n)||o.depth==0)return!1;p=!1,o=r.doc.resolve(e>0?o.after():o.before())}let g=gr.findGapCursorFrom(o,e,p);return g?(i&&i(r.tr.setSelection(new gr(g))),!0):!1}}function VH(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!gr.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Lt.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new gr(r))),!0)}function FH(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof gr))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=je.empty;for(let a=r.length-1;a>=0;a--)i=je.from(r[a].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new gt(i,0,0));return s.setSelection(Gt.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function $H(t){if(!(t.selection instanceof gr))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Tr.create(t.doc,[fs.widget(t.selection.head,e,{key:"gapcursor"})])}const jH=jr.create({name:"gapCursor",addProseMirrorPlugins(){return[zH()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ln(St(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),HH=js.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",kr(this.options.HTMLAttributes,t)]},renderText(){return`
|
741
|
-
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,p=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:g,dispatch:y})=>{if(y&&p&&a){const v=p.filter(E=>o.includes(E.type.name));g.ensureMarks(v)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),UH=js.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,kr(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>P_({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var hg=200,Hr=function(){};Hr.prototype.append=function(e){return e.length?(e=Hr.from(e),!this.length&&e||e.length<hg&&this.leafAppend(e)||this.length<hg&&e.leafPrepend(this)||this.appendInner(e)):this},Hr.prototype.prepend=function(e){return e.length?Hr.from(e).append(this):this},Hr.prototype.appendInner=function(e){return new WH(this,e)},Hr.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Hr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Hr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Hr.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Hr.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},n,r),i},Hr.from=function(e){return e instanceof Hr?e:e&&e.length?new jT(e):Hr.empty};var jT=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,o){for(var p=s;p<a;p++)if(i(this.values[p],o+p)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,o){for(var p=s-1;p>=a;p--)if(i(this.values[p],o+p)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=hg)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=hg)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Hr);Hr.empty=new jT([]);var WH=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,a){var o=this.left.length;if(i<o&&this.left.forEachInner(r,i,Math.min(s,o),a)===!1||s>o&&this.right.forEachInner(r,Math.max(i-o,0),Math.min(this.length,s)-o,a+o)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,a){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(r,i-o,Math.max(s,o)-o,a+o)===!1||s<o&&this.left.forEachInvertedInner(r,Math.min(i,o),s,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Hr);const qH=500;class ao{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=e.tr,o,p,g=[],y=[];return this.items.forEach((v,E)=>{if(!v.step){i||(i=this.remapping(r,E+1),s=i.maps.length),s--,y.push(v);return}if(i){y.push(new Do(v.map));let T=v.step.map(i.slice(s)),D;T&&a.maybeStep(T).doc&&(D=a.mapping.maps[a.mapping.maps.length-1],g.push(new Do(D,void 0,void 0,g.length+y.length))),s--,D&&i.appendMap(D,s)}else a.maybeStep(v.step);if(v.selection)return o=i?v.selection.map(i.slice(s)):v.selection,p=new ao(this.items.slice(0,r).append(y.reverse().concat(g)),this.eventCount-1),!1},this.items.length,0),{remaining:p,transform:a,selection:o}}addTransform(e,n,r,i){let s=[],a=this.eventCount,o=this.items,p=!i&&o.length?o.get(o.length-1):null;for(let y=0;y<e.steps.length;y++){let v=e.steps[y].invert(e.docs[y]),E=new Do(e.mapping.maps[y],v,n),T;(T=p&&p.merge(E))&&(E=T,y?s.pop():o=o.slice(0,o.length-1)),s.push(E),n&&(a++,n=void 0),i||(p=E)}let g=a-r.depth;return g>YH&&(o=GH(o,g),a-=g),new ao(o.append(s),a)}remapping(e,n){let r=new wd;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new ao(this.items.append(e.map(n=>new Do(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach(E=>{E.selection&&o--},i);let p=n;this.items.forEach(E=>{let T=s.getMirror(--p);if(T==null)return;a=Math.min(a,T);let D=s.maps[T];if(E.step){let N=e.steps[T].invert(e.docs[T]),B=E.selection&&E.selection.map(s.slice(p+1,T));B&&o++,r.push(new Do(D,N,B))}else r.push(new Do(D))},i);let g=[];for(let E=n;E<a;E++)g.push(new Do(s.maps[E]));let y=this.items.slice(0,i).append(g).append(r),v=new ao(y,o);return v.emptyItemCount()>qH&&(v=v.compress(this.items.length-r.length)),v}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((a,o)=>{if(o>=e)i.push(a),a.selection&&s++;else if(a.step){let p=a.step.map(n.slice(r)),g=p&&p.getMap();if(r--,g&&n.appendMap(g,r),p){let y=a.selection&&a.selection.map(n.slice(r));y&&s++;let v=new Do(g.invert(),p,y),E,T=i.length-1;(E=i.length&&i[T].merge(v))?i[T]=E:i.push(v)}}else a.map&&r--},this.items.length,0),new ao(Hr.from(i.reverse()),s)}}ao.empty=new ao(Hr.empty,0);function GH(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Do{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Do(n.getMap().invert(),n,this.selection)}}}class el{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const YH=20;function ZH(t,e,n,r){let i=n.getMeta(yc),s;if(i)return i.historyState;n.getMeta(JH)&&(t=new el(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(yc))return a.getMeta(yc).redo?new el(t.done.addTransform(n,void 0,r,fg(e)),t.undone,HT(n.mapping.maps),t.prevTime,t.prevComposition):new el(t.done,t.undone.addTransform(n,void 0,r,fg(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),p=t.prevTime==0||!a&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!XH(n,t.prevRanges)),g=a?K_(t.prevRanges,n.mapping):HT(n.mapping.maps);return new el(t.done.addTransform(n,p?e.selection.getBookmark():void 0,r,fg(e)),ao.empty,g,n.time,o??t.prevComposition)}else return(s=n.getMeta("rebased"))?new el(t.done.rebased(n,s),t.undone.rebased(n,s),K_(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new el(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),K_(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function XH(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function HT(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,a)=>e.push(s,a));return e}function K_(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function KH(t,e,n){let r=fg(e),i=yc.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),o=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),p=new el(n?o:s.remaining,n?s.remaining:o,null,0,-1);return s.transform.setSelection(a).setMeta(yc,{redo:n,historyState:p})}let J_=!1,UT=null;function fg(t){let e=t.plugins;if(UT!=e){J_=!1,UT=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){J_=!0;break}}return J_}const yc=new Zi("history"),JH=new Zi("closeHistory");function QH(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ei({key:yc,state:{init(){return new el(ao.empty,ao.empty,null,0,-1)},apply(e,n,r){return ZH(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?qT:r=="historyRedo"?GT:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function WT(t,e){return(n,r)=>{let i=yc.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=KH(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const qT=WT(!1,!0),GT=WT(!0,!0),eU=jr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>qT(t,e),redo:()=>({state:t,dispatch:e})=>GT(t,e)}},addProseMirrorPlugins(){return[QH(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),tU=js.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",kr(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):GC(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:a,dispatch:o})=>{var p;if(o){const{$to:g}=a.selection,y=g.end();if(g.nodeAfter)g.nodeAfter.isTextblock?a.setSelection(Gt.create(a.doc,g.pos+1)):g.nodeAfter.isBlock?a.setSelection(Lt.create(a.doc,g.pos)):a.setSelection(Gt.create(a.doc,g.pos));else{const v=(p=g.parent.type.contentMatch.defaultType)===null||p===void 0?void 0:p.create();v&&(a.insert(y,v),a.setSelection(Gt.create(a.doc,y+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[P8({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),nU=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,rU=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,iU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,sU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,oU=Co.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[zd({find:nU,type:this.type}),zd({find:iU,type:this.type})]},addPasteRules(){return[Ld({find:rU,type:this.type}),Ld({find:sU,type:this.type})]}}),aU=js.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",kr(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),lU="listItem",YT="textStyle",ZT=/^(\d+)\.\s$/,cU=js.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",kr(this.options.HTMLAttributes,n),0]:["ol",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(lU,this.editor.getAttributes(YT)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=jh({find:ZT,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=jh({find:ZT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(YT)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),dU=js.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),uU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,hU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,fU=Co.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[zd({find:uU,type:this.type})]},addPasteRules(){return[Ld({find:hU,type:this.type})]}}),XT=js.create({name:"text",group:"inline"}),pU=jr.create({name:"starterKit",addExtensions(){var t,e,n,r,i,s,a,o,p,g,y,v,E,T,D,N,B,F;const X=[];return this.options.bold!==!1&&X.push(kH.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&X.push(bH.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&X.push(SH.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&X.push(AH.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&X.push($T.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&X.push(IH.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&X.push(OH.configure((a=this.options)===null||a===void 0?void 0:a.dropcursor)),this.options.gapcursor!==!1&&X.push(jH.configure((o=this.options)===null||o===void 0?void 0:o.gapcursor)),this.options.hardBreak!==!1&&X.push(HH.configure((p=this.options)===null||p===void 0?void 0:p.hardBreak)),this.options.heading!==!1&&X.push(UH.configure((g=this.options)===null||g===void 0?void 0:g.heading)),this.options.history!==!1&&X.push(eU.configure((y=this.options)===null||y===void 0?void 0:y.history)),this.options.horizontalRule!==!1&&X.push(tU.configure((v=this.options)===null||v===void 0?void 0:v.horizontalRule)),this.options.italic!==!1&&X.push(oU.configure((E=this.options)===null||E===void 0?void 0:E.italic)),this.options.listItem!==!1&&X.push(aU.configure((T=this.options)===null||T===void 0?void 0:T.listItem)),this.options.orderedList!==!1&&X.push(cU.configure((D=this.options)===null||D===void 0?void 0:D.orderedList)),this.options.paragraph!==!1&&X.push(dU.configure((N=this.options)===null||N===void 0?void 0:N.paragraph)),this.options.strike!==!1&&X.push(fU.configure((B=this.options)===null||B===void 0?void 0:B.strike)),this.options.text!==!1&&X.push(XT.configure((F=this.options)===null||F===void 0?void 0:F.text)),X}}),mU=Co.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=C_(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),gU=jr.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});function yU(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:s,$position:a}=t,o=R8(n),p=new RegExp(`\\s${o}$`),g=s?"^":"",y=r?new RegExp(`${g}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${g}(?:^)?${o}[^\\s${o}]*`,"gm"),v=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!v)return null;const E=a.pos-v.length,T=Array.from(v.matchAll(y)).pop();if(!T||T.input===void 0||T.index===void 0)return null;const D=T.input.slice(Math.max(0,T.index-1),T.index),N=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(D);if(i!==null&&!N)return null;const B=E+T.index;let F=B+T[0].length;return r&&p.test(v.slice(F-1,F+1))&&(T[0]+=" ",F+=1),B<a.pos&&F>=a.pos?{range:{from:B,to:F},query:T[0].slice(n.length),text:T[0]}:null}const bU=new Zi("suggestion");function _U({pluginKey:t=bU,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:o="suggestion",command:p=()=>null,items:g=()=>[],render:y=()=>({}),allow:v=()=>!0,findSuggestionMatch:E=yU}){let T;const D=y==null?void 0:y(),N=new ei({key:t,view(){return{update:async(B,F)=>{var X,te,H,ke,ge,Se,Pe;const Ne=(X=this.key)===null||X===void 0?void 0:X.getState(F),at=(te=this.key)===null||te===void 0?void 0:te.getState(B.state),Je=Ne.active&&at.active&&Ne.range.from!==at.range.from,mt=!Ne.active&&at.active,nt=Ne.active&&!at.active,Ct=!mt&&!nt&&Ne.query!==at.query,$t=mt||Je&&Ct,jt=Ct||Je,Ot=nt||Je&&Ct;if(!$t&&!jt&&!Ot)return;const qt=Ot&&!$t?Ne:at,wn=B.dom.querySelector(`[data-decoration-id="${qt.decorationId}"]`);T={editor:e,range:qt.range,query:qt.query,text:qt.text,items:[],command:yn=>p({editor:e,range:qt.range,props:yn}),decorationNode:wn,clientRect:wn?()=>{var yn;const{decorationId:An}=(yn=this.key)===null||yn===void 0?void 0:yn.getState(e.state),bn=B.dom.querySelector(`[data-decoration-id="${An}"]`);return(bn==null?void 0:bn.getBoundingClientRect())||null}:null},$t&&((H=D==null?void 0:D.onBeforeStart)===null||H===void 0||H.call(D,T)),jt&&((ke=D==null?void 0:D.onBeforeUpdate)===null||ke===void 0||ke.call(D,T)),(jt||$t)&&(T.items=await g({editor:e,query:qt.query})),Ot&&((ge=D==null?void 0:D.onExit)===null||ge===void 0||ge.call(D,T)),jt&&((Se=D==null?void 0:D.onUpdate)===null||Se===void 0||Se.call(D,T)),$t&&((Pe=D==null?void 0:D.onStart)===null||Pe===void 0||Pe.call(D,T))},destroy:()=>{var B;T&&((B=D==null?void 0:D.onExit)===null||B===void 0||B.call(D,T))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(B,F,X,te){const{isEditable:H}=e,{composing:ke}=e.view,{selection:ge}=B,{empty:Se,from:Pe}=ge,Ne={...F};if(Ne.composing=ke,H&&(Se||e.view.composing)){(Pe<F.range.from||Pe>F.range.to)&&!ke&&!F.composing&&(Ne.active=!1);const at=E({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:s,$position:ge.$from}),Je=`id_${Math.floor(Math.random()*4294967295)}`;at&&v({editor:e,state:te,range:at.range,isActive:F.active})?(Ne.active=!0,Ne.decorationId=F.decorationId?F.decorationId:Je,Ne.range=at.range,Ne.query=at.query,Ne.text=at.text):Ne.active=!1}else Ne.active=!1;return Ne.active||(Ne.decorationId=null,Ne.range={from:0,to:0},Ne.query=null,Ne.text=null),Ne}},props:{handleKeyDown(B,F){var X;const{active:te,range:H}=N.getState(B.state);return te&&((X=D==null?void 0:D.onKeyDown)===null||X===void 0?void 0:X.call(D,{view:B,event:F,range:H}))||!1},decorations(B){const{active:F,range:X,decorationId:te}=N.getState(B);return F?Tr.create(B.doc,[fs.inline(X.from,X.to,{nodeName:a,class:o,"data-decoration-id":te})]):null}}});return N}const xU=new Zi("mention"),vU=js.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",kr(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:xU,command:({editor:t,range:e,props:n})=>{var r,i,s;const a=t.view.state.selection.$to.nodeAfter;((r=a==null?void 0:a.text)===null||r===void 0?void 0:r.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(s=(i=t.view.dom.ownerDocument.defaultView)===null||i===void 0?void 0:i.getSelection())===null||s===void 0||s.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",kr({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=kr({"data-type":this.name},this.options.HTMLAttributes,e);const r=this.options.renderHTML({options:n,node:t});return typeof r=="string"?["span",kr({"data-type":this.name},this.options.HTMLAttributes,e),r]:r},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:i,anchor:s}=r;return i?(e.doc.nodesBetween(s-1,s,(a,o)=>{if(a.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",o,o+a.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[_U({editor:this.editor,...this.options.suggestion})]}}),wU=Co.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),kU={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function EU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleBlockquote&&s.toggleBlockquote(...a)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[h.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const SU=Ve(kU,[["render",EU]]),CU={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function TU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleBulletList&&s.toggleBulletList(...a)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const AU=Ve(CU,[["render",TU]]),MU={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function DU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleOrderedList&&s.toggleOrderedList(...a)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const IU=Ve(MU,[["render",DU]]),PU={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function RU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleCodeBlock&&s.toggleCodeBlock(...a)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const OU=Ve(PU,[["render",RU]]),NU={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function BU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleBold&&s.toggleBold(...a)),class:h.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("bold")}])},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),h.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const zU=Ve(NU,[["render",BU]]),LU={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function VU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleItalic&&s.toggleItalic(...a)),class:h.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("italic")}])},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),h.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const FU=Ve(LU,[["render",VU]]),$U={},jU={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function HU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",jU,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"},null,-1)]))}const UU={components:{IconA:Ve($U,[["render",HU]])},props:{editor:Object},data(){return{color:"#000000",colors:["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{setColor(t){this.editor&&(this.editor.chain().focus().setColor(t).run(),this.$refs.popover.togglePopover(),this.color=t)}}},WU={class:"relative flex"},qU={class:"flex w-[160px] flex-wrap gap-[4px]"},GU=["onClick"];function YU(t,e,n,r,i,s){const a=h.resolveComponent("IconA"),o=h.resolveComponent("VsPopover");return h.openBlock(),h.createBlock(o,{ref:"popover",placement:"bottom"},{reference:h.withCtx(()=>[h.createElementVNode("button",WU,[h.createVNode(a,{height:"20",width:"20",class:"text-gray-500"}),h.createElementVNode("span",{class:"absolute h-[4px] w-[80%] bottom-[2px] left-[2px]",style:h.normalizeStyle({backgroundColor:i.color})},null,4)])]),default:h.withCtx(()=>[h.createElementVNode("div",null,[h.createElementVNode("ul",qU,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.colors,p=>(h.openBlock(),h.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:h.normalizeStyle({backgroundColor:p}),onClick:g=>s.setColor(p),key:p},null,12,GU))),128))])])]),_:1},512)}const ZU=Ve(UU,[["render",YU]]),XU={},KU={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"};function JU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",KU,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),h.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),h.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const Q_=Ve(XU,[["render",JU]]),QU={components:{IconMore:Q_},props:{editor:Object},methods:{toggleUnderline(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleUnderline().run()},toggleStrike(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleStrike().run()}}};function e9(t,e,n,r,i,s){const a=h.resolveComponent("IconMore"),o=h.resolveComponent("VsPopover");return h.openBlock(),h.createBlock(o,{ref:"popover",placement:"bottom"},{reference:h.withCtx(()=>[h.createElementVNode("button",{class:h.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("underline")||n.editor.isActive("strike")}])},[h.createVNode(a,{height:"18",width:"18",class:"rotate-90"})],2)]),default:h.withCtx(()=>[h.createElementVNode("div",null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=(...p)=>s.toggleUnderline&&s.toggleUnderline(...p)),class:h.normalizeClass(["p-[8px] block rounded-lg w-[140px] mb-[4px] text-start hover:bg-gray-100 !duration-300 underline underline-offset-1",{"bg-gray-100 text-gray-900":n.editor.isActive("underline")}])}," Підкресленний ",2),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...p)=>s.toggleStrike&&s.toggleStrike(...p)),class:h.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300 line-through",{"bg-gray-100 text-gray-900":n.editor.isActive("strike")}])}," Перекресленний ",2)])]),_:1},512)}const t9={bold:zU,italic:FU,text_more:Ve(QU,[["render",e9]]),color:ZU,bullet_list:AU,ordered_list:IU,blockquote:SU,codeblock:OU},n9={components:{EditorContent:gH},props:{controls:{type:Array,default:()=>["bold","italic","color","blockquote","bullet_list","ordered_list","codeblock","text_more"]},options:{type:Array,default:()=>[]},modelValue:{type:String,default:()=>""}},data(){return{editor:null}},computed:{controlsList(){return Object.entries(t9).filter(([t])=>this.controls.includes(t)).map(([t,e])=>e)}},watch:{modelValue(t){this.editor&&this.editor.getHTML()!==t&&this.editor.commands.setContent(t)},editor(t){t&&this.editor.on("update",({editor:e})=>{const n=e.getHTML();n!==this.modelValue&&this.$emit("update:modelValue",n)})}},mounted(){this.editor&&this.editor.destroy(),this.initEditor()},beforeDestroy(){this.editor&&this.editor.destroy()},methods:{initEditor(){this.editor=new mH({content:this.modelValue,extensions:[pU,$T,mU,gU,wU,XT,vU.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:t})=>{var n;const e=(n=this.options)==null?void 0:n.filter(r=>{var i,s;return(s=(i=r==null?void 0:r.email)==null?void 0:i.toLowerCase())==null?void 0:s.includes(t==null?void 0:t.toLowerCase())}).slice(0,5);return e.length?e:[{id:null,text:"Данні відсутні",email:null}]},render:()=>{let t,e;return{onStart:n=>{var s;t=document.createElement("div"),t.className="mention-popup",(s=n.items)==null||s.forEach(a=>{const o=document.createElement("div");o.className="mention-option",a.id===null?(o.textContent=a.text,o.style.pointerEvents="none",o.style.color="#999"):(o.textContent=a.text,o.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(o)}),document.body.appendChild(t);const{from:r}=n.range,i=n.editor.view.coordsAtPos(r);t.style.position="absolute",t.style.left=`${i.left}px`,t.style.top=`${i.top-t.offsetHeight}px`,e=t},onUpdate:n=>{var s;for(;t.firstChild;)t.removeChild(t.firstChild);(s=n.items)==null||s.forEach(a=>{const o=document.createElement("div");o.className="mention-option",a.id===null?(o.textContent=a.text,o.style.pointerEvents="none",o.style.color="#999"):(o.textContent=a.text,o.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(o)});const{from:r}=n.range,i=n.editor.view.coordsAtPos(r);t.style.left=`${i.left}px`,t.style.top=`${i.top-t.offsetHeight}px`},onExit:()=>{e&&e.remove()}}}}})]})},focusEditor(){this.editor&&!this.editor.isFocused&&this.editor.commands.focus()}}},r9={class:"w-full border border-gray-200 rounded-lg editor-container bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},i9={key:0,class:"flex flex-wrap items-center w-full gap-2 px-3 py-2 border-b editor-toolbar dark:border-gray-600"};function s9(t,e,n,r,i,s){const a=h.resolveComponent("EditorContent");return h.openBlock(),h.createElementBlock("div",r9,[i.editor?(h.openBlock(),h.createElementBlock("div",i9,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.controlsList,(o,p)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(o),{key:p,editor:i.editor},null,8,["editor"]))),128))])):h.createCommentVNode("",!0),h.createElementVNode("div",{onClick:e[0]||(e[0]=(...o)=>s.focusEditor&&s.focusEditor(...o)),class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800"},[h.createVNode(a,{editor:i.editor,class:"relative w-full"},null,8,["editor"])])])}const KT=Ve(n9,[["render",s9]]),o9={components:{VsTextEditor:KT},props:{comment:{type:Object,default:()=>({})},user:{type:Object,default:()=>({})},id:{type:String,default:""},options:Array},data(){return{commentContent:this.comment.body,isCommentActionVisible:!1,isOpen:!1,hovered:!1,windowWidth:null,textareaValue:""}},computed:{isElementVisible(){return this.windowWidth>=600?this.hovered:!0},isUserAutor(){return this.user.uid===this.comment.uid},createDate(){try{const t=ft(this.comment.cdate,"YYYY-MM-DD");return new Date(t).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},mounted(){window.addEventListener("resize",this.updateWindowWidth)},beforeDestroy(){window.removeEventListener("resize",this.updateWindowWidth)},watch:{isOpen(t){t&&(this.textareaValue=this.comment.body)}},methods:{updateWindowWidth(){this.windowWidth=typeof window>"u"?null:window==null?void 0:window.innerWidth},confirnDeleteComment(){document.body.click(),this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей коментар?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteComment,updateListOnConfirm:!0})},async updateComment(){try{await tt.post(`/api/widget/comment/${this.id}/${this.comment.communication_id}`,{body:this.textareaValue}),this.$emit("list-update"),this.isOpen=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},openEditModal(){document.body.click(),this.isOpen=!0},async deleteComment(){try{await tt.delete(`/api/widget/comment/${this.id}/${this.comment.communication_id}`),this.$emit("list-update"),this.isCommentActionVisible=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},toggleCommentAction(){this.isCommentActionVisible=!this.isCommentActionVisible}}},a9={class:"relative group-last:after:hidden after:absolute after:top-7 after:bottom-1 after:start-3 after:w-px after:-translate-x-[0.5px] after:bg-gray-200 dark:after:bg-neutral-700"},l9={class:"relative flex items-center justify-center size-6 overflow-hidden rounded-full"},c9=["src"],d9={key:1,class:"flex shrink-0 justify-center items-center size-[38px] border border-gray-200 text-sm font-semibold uppercase text-gray-800 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-400"},u9={class:"pb-8 grow"},h9={class:"flex justify-between -mt-[5px]"},f9={class:"flex items-center"},p9={class:"text-sm font-semibold text-gray-800 dark:text-neutral-200"},m9={class:"text-xs text-gray-400 ms-1 dark:text-neutral-500"},g9={class:"min-h-[32px]"},y9={class:"p-0.5 inline-flex items-center gap-x-0.5 bg-white border border-gray-200 shadow-sm rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},b9=["innerHTML"],_9={class:"flex flex-col gap-[8px] p-[10px] text-sm font-medium text-gray-500"},x9={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function v9(t,e,n,r,i,s){var p;const a=h.resolveComponent("VsTextEditor"),o=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",{class:"group relative flex gap-x-3.5",onMouseenter:e[2]||(e[2]=g=>i.hovered=!0),onMouseleave:e[3]||(e[3]=g=>i.hovered=!1)},[h.createElementVNode("div",a9,[h.createElementVNode("div",l9,[n.comment.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"shrink-0 object-cover",src:n.comment.avatar,alt:"Avatar"},null,8,c9)):(h.openBlock(),h.createElementBlock("span",d9,h.toDisplayString((p=n.comment.username)==null?void 0:p.charAt(0)),1))])]),h.createElementVNode("div",u9,[h.createElementVNode("span",h9,[h.createElementVNode("div",f9,[h.createElementVNode("span",p9,h.toDisplayString(n.comment.username),1),h.createElementVNode("span",m9,h.toDisplayString(s.createDate),1)]),h.createElementVNode("div",g9,[h.withDirectives(h.createElementVNode("div",y9,[h.createElementVNode("div",{class:"inline-block",onClick:e[0]||(e[0]=g=>s.openEditModal())},e[8]||(e[8]=[h.createStaticVNode('<button type="button" class="hs-tooltip-toggle size-[26px] inline-flex justify-center items-center gap-x-1 text-xs font-medium rounded-md border border-transparent bg-white text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:bg-neutral-800 dark:border-transparent dark:text-neutral-500 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"><svg class="shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg><span class="sr-only">Edit message</span></button>',1),h.createElementVNode("span",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded-lg whitespace-nowrap dark:bg-neutral-700",role:"tooltip"}," Edit message ",-1)])),h.createElementVNode("div",{class:"inline-block",onClick:e[1]||(e[1]=g=>s.confirnDeleteComment())},e[9]||(e[9]=[h.createStaticVNode('<button type="button" class="hs-tooltip-toggle size-[26px] inline-flex justify-center items-center gap-x-1 text-xs font-medium rounded-md border border-transparent bg-white text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:bg-neutral-800 dark:border-transparent dark:text-neutral-500 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"><svg class="shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg><span class="sr-only">Delete message</span></button>',1),h.createElementVNode("span",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded-lg whitespace-nowrap dark:bg-neutral-700",role:"tooltip"}," Delete message ",-1)]))],512),[[h.vShow,s.isElementVisible]])])]),h.createElementVNode("p",{class:"mt-1 text-sm text-gray-800 dark:text-neutral-200",innerHTML:n.comment.body},null,8,b9)])],32),h.createVNode(o,{visible:i.isOpen,"onUpdate:visible":e[7]||(e[7]=g=>i.isOpen=g),title:"Редагувати",size:"small"},{footer:h.withCtx(()=>[h.createElementVNode("div",x9,[h.createElementVNode("button",{onClick:e[5]||(e[5]=g=>i.isOpen=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),h.createElementVNode("button",{onClick:e[6]||(e[6]=(...g)=>s.updateComment&&s.updateComment(...g)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:h.withCtx(()=>[h.createElementVNode("div",_9,[h.createVNode(a,{modelValue:i.textareaValue,"onUpdate:modelValue":e[4]||(e[4]=g=>i.textareaValue=g),options:n.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const w9={components:{VsWidgetCommentsItem:Ve(o9,[["render",v9]])},inject:["activeAddFormEditor"],props:{id:{type:String,default:()=>""},prefilledData:{type:Object,default:null},options:Array},data(){return{isLoaded:!1,isLoadFailed:!1,comments:[],user:{},modal:{title:"",message:"",cancel:"",confirm:"",cancelButtonText:"",confirmButtonText:""},isModalVisible:!1}},async created(){await this.getComments()},methods:{async getComments(){if(this.prefilledData){this.comments=this.prefilledData.rows,this.isLoaded=!0;return}try{const{data:t}=await tt.get(`/api/widget/comment/${this.id}`);this.comments=t.rows,this.user=t.user}catch(t){this.isLoadFailed=!0,console.error(t)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(t){const e={...t};return t.cancel||(e.cancel=()=>{this.isModalVisible=!1}),t.updateListOnConfirm&&(e.confirm=async()=>{await t.confirm(),this.isModalVisible=!1}),e},handleOpenModal(t){this.modal=this.prepareModal(t),this.isModalVisible=!0}}},k9={class:"flex flex-col"},E9={key:0,class:"max-h-[300px] p-[10px] overflow-y-auto overflow-x-hidden [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},S9={key:1},C9={class:"p-4"},T9={class:"mt-1 text-gray-500 dark:text-neutral-500"},A9={class:"mt-4 flex justify-end gap-x-3"};function M9(t,e,n,r,i,s){var y;const a=h.resolveComponent("VsErrorOnLoading"),o=h.resolveComponent("VsWidgetCommentsItem"),p=h.resolveComponent("VsLoader"),g=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock("div",k9,[i.isLoaded?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[i.isLoadFailed?(h.openBlock(),h.createBlock(a,{key:0})):(h.openBlock(),h.createElementBlock(h.Fragment,{key:1},[(y=i.comments)!=null&&y.length?(h.openBlock(),h.createElementBlock("div",E9,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.comments,(v,E)=>(h.openBlock(),h.createBlock(o,{key:E,comment:v,user:i.user,options:n.options,index:E,id:n.id,onListUpdate:s.getComments,onOpenModal:e[0]||(e[0]=T=>s.handleOpenModal(T))},null,8,["comment","user","options","index","id","onListUpdate"]))),128))])):(h.openBlock(),h.createElementBlock("div",S9,e[4]||(e[4]=[h.createElementVNode("p",{class:"pl-3 text-sm font-medium text-gray-600"}," Коментарі відсутні ",-1)])))],64))],64)):(h.openBlock(),h.createBlock(p,{key:1,class:"justify-center",text:"Please wait..."})),h.createVNode(g,{title:i.modal.title,size:"small",visible:i.isModalVisible,"onUpdate:visible":e[3]||(e[3]=v=>i.isModalVisible=v)},{default:h.withCtx(()=>[h.createElementVNode("div",C9,[h.createElementVNode("p",T9,h.toDisplayString(i.modal.message),1),h.createElementVNode("div",A9,[h.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[1]||(e[1]=(...v)=>i.modal.cancel&&i.modal.cancel(...v))},h.toDisplayString(i.modal.cancelButtonText),1),h.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...v)=>i.modal.confirm&&i.modal.confirm(...v))},h.toDisplayString(i.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const D9=Ve(w9,[["render",M9]]),I9={components:{VsTextEditor:KT},props:{id:{type:String,default:()=>""},autofocus:{type:Boolean,default:()=>!0},options:Array},data(){return{isEditorOpen:!1,commentContent:""}},methods:{async addNewComment(){if(this.commentContent)try{await tt.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.closeEditor(),this.$emit("list-update")}catch(t){console.error(t)}},setNewContent(t){this.commentContent=t},closeEditor(){this.isEditorOpen=!1,this.commentContent=""}}},P9={class:"flex flex-col items-start w-full widget-comment-form"},R9={class:"w-full mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},O9={key:0,class:"flex gap-[10px]"};function N9(t,e,n,r,i,s){const a=h.resolveComponent("VsTextEditor");return h.openBlock(),h.createElementBlock("div",P9,[h.createElementVNode("div",R9,[h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>[i.isEditorOpen?(h.openBlock(),h.createBlock(a,{key:0,modelValue:i.commentContent,"onUpdate:modelValue":e[0]||(e[0]=o=>i.commentContent=o),options:n.options},null,8,["modelValue","options"])):h.createCommentVNode("",!0)]),_:1}),i.isEditorOpen?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",{key:0,onClick:e[1]||(e[1]=o=>i.isEditorOpen=!0),class:"border flex items-center pl-[20px] border-gray-200 rounded-lg h-[40px] hover:bg-gray-50 text-gray-500 duration-300 hover:text-gray-900"}," Додати коментар... "))]),i.isEditorOpen?(h.openBlock(),h.createElementBlock("div",O9,[h.createElementVNode("button",{ref:"buttonAdd",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:e[2]||(e[2]=(...o)=>s.addNewComment&&s.addNewComment(...o))}," Відправити коментар ",512),h.createElementVNode("button",{onClick:e[3]||(e[3]=(...o)=>s.closeEditor&&s.closeEditor(...o)),ref:"buttonAdd",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-black duration-300 border rounded-lg gap-x-2 hover:bg-gray-100"}," Скасувати ",512)])):h.createCommentVNode("",!0)])}const B9={components:{VsWidgetCommentsList:D9,VsWidgetCommentsAddForm:Ve(I9,[["render",N9]])},props:{id:{type:String,default(){return""}},prefilledData:{type:Object,default:null}},data(){return{activeAddFormEditor:"",comments:[],totalComment:"0",options:[]}},mounted(){this.comments=this.$refs.commentListRef.comments,this.getUsersList()},watch:{comments(t){this.$emit("count-change",t.length)}},methods:{async getUsersList(){try{const{data:t}=await tt.get("/api/suggest/core.user_mentioned");this.options=t}catch(t){console.log(t)}},listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},z9={class:"w-full bg-white-200"};function L9(t,e,n,r,i,s){const a=h.resolveComponent("VsWidgetCommentsAddForm"),o=h.resolveComponent("VsWidgetCommentsList");return h.openBlock(),h.createElementBlock("div",z9,[e[2]||(e[2]=h.createElementVNode("div",{class:"flex items-center justify-between w-full mb-4 gap-x-2"},null,-1)),h.createVNode(a,{options:i.options,class:"mb-6",id:n.id,onListUpdate:e[0]||(e[0]=p=>s.listUpdate())},null,8,["options","id"]),h.createVNode(o,{options:i.options,id:n.id,onUpdateCommentCount:e[1]||(e[1]=p=>s.updateCommentCount()),"prefilled-data":n.prefilledData,ref:"commentListRef"},null,8,["options","id","prefilled-data"])])}const JT=Ve(B9,[["render",L9]]),QT=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),V9=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),F9={},$9={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-user"};function j9(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",$9,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0"},null,-1),h.createElementVNode("path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"},null,-1)]))}const eA=Ve(F9,[["render",j9]]),H9=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},U9=h.defineComponent({props:{username:{type:String,default:()=>""}},components:{IconUserOutline:eA},computed:{inItials(){return H9(this.username)}}}),W9={class:"flex shrink-0 bg-white justify-center items-center size-[38px] border border-gray-200 text-sm font-semibold uppercase text-gray-800 rounded-full"},q9={key:0};function G9(t,e,n,r,i,s){const a=h.resolveComponent("IconUserOutline");return h.openBlock(),h.createElementBlock("div",W9,[t.inItials?(h.openBlock(),h.createElementBlock("span",q9,h.toDisplayString(t.inItials),1)):(h.openBlock(),h.createBlock(a,{key:1,class:"w-[16px] h-[16px]"}))])}const Y9=Ve(U9,[["render",G9]]),ex={load(){try{const t=Array.from(arguments);window.headLoadedFiles||(window.headLoadedFiles=[]);const e=typeof arguments[arguments.length-1]=="function"?arguments[arguments.length-1]:null,n=t.filter(r=>typeof r!="function").reduce((r,i)=>r.concat(i),[]).filter(r=>r&&!window.headLoadedFiles[r.url||r.split("?")[0]]);Promise.all(n.map(r=>this.loadFile1(r))).then(()=>{e&&e()})}catch(t){console.log(t)}},promise(t){return new Promise((e,n)=>{ex.load(t,()=>{e()})})},loadFile1(t){let e=!1;typeof t=="object"&&(e=t.type,t=t.url);const n=t.split("?")[0];return new Promise((r,i)=>{function s(o){delete window.headLoadedFiles[`_${n}`],window.headLoadedFiles[n]=o.type,r(o.type)}let a;window.headLoadedFiles[`_${n}`]?a=window.headLoadedFiles[`_${n}`]:(n.includes(".css")?(a=document.createElement("link"),a.href=t,a.type="text/css",a.rel="stylesheet"):(a=document.createElement("script"),a.type="text/javascript",a.src=t,e&&(a.type=e)),window.headLoadedFiles[`_${n}`]=a,document.head.appendChild(a)),a.addEventListener("load",s),a.addEventListener("error",s)})}},Z9={props:{point:{type:String,default:()=>""}},data(){return{zoom:18}},computed:{parsedPoint(){return JSON.parse(this.point)},tooltipText(){return this.parsedPoint.coordinates.join(", ")},coordinates(){return[...this.parsedPoint.coordinates].reverse()}},async mounted(){typeof window>"u"||(window!=null&&window.L||(await ex.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await ex.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js")),this.initMap())},methods:{initMap(){const t=window.L.map("map",{center:this.coordinates,zoom:this.zoom});window.L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(t),window.L.circle(this.coordinates,{color:"red",fillColor:"red",fillOpacity:.2,radius:10}).addTo(t).bindTooltip(this.tooltipText)}}},X9={id:"map",style:{height:"9rem",width:"24rem"}};function K9(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",X9)}const J9=Ve(Z9,[["render",K9]]),Q9=h.defineComponent({components:{VsWidgetHistoryItemAvatar:Y9,VsWidgetHistoryItemMap:J9,IconFile:a2},props:{item:{type:Object,default:()=>{}}},methods:{getTitle(t){return t.title||t.attr},getOldValue(t){return t.old||"Не вказано"},getNewValue(t){return t.new||"Не вказано"},getDate(t){return V9(t.cdate)}}}),eW={class:"relative"},tW={class:"w-full flex gap-x-5"},nW={class:"grow"},rW={class:"text-sm font-semibold text-gray-800 dark:text-neutral-300"},iW={key:0,class:"text-sm text-gray-500 dark:text-neutral-500"},sW={key:1,class:"text-sm text-gray-500 dark:text-neutral-500"},oW={key:2,class:"text-sm text-gray-500 dark:text-neutral-500"},aW={key:1,class:"text-sm text-gray-500 dark:text-neutral-500"},lW={key:2,class:"text-sm text-gray-500 dark:text-neutral-500"},cW={key:3,class:"text-sm text-gray-500 dark:text-neutral-500"},dW={key:4,class:"mt-2"},uW={class:"grid grid-cols-2 gap-2"},hW={class:"bg-white border border-gray-200 rounded-lg p-2 dark:bg-neutral-800 dark:border-neutral-700"},fW={class:"flex gap-x-2"},pW={class:"grow truncate"},mW={class:"block truncate text-xs text-gray-800 dark:text-neutral-300"},gW={class:"block text-xs text-gray-400 dark:text-neutral-500"},yW={class:"mt-2 text-[11px] uppercase text-gray-400 dark:text-neutral-500"};function bW(t,e,n,r,i,s){var p,g,y,v,E,T,D,N,B,F,X,te,H,ke;const a=h.resolveComponent("VsWidgetHistoryItemAvatar"),o=h.resolveComponent("IconFile");return h.openBlock(),h.createElementBlock("div",eW,[h.createElementVNode("div",tW,[h.createVNode(a,{username:t.item.username},null,8,["username"]),h.createElementVNode("div",nW,[h.createElementVNode("h4",rW,h.toDisplayString(t.item.username||"User User"),1),t.item.entity_type!=="crm.files"?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(t.item.changes,ge=>(h.openBlock(),h.createElementBlock("li",null,[ge.value_old&&ge.value_new?(h.openBlock(),h.createElementBlock("p",iW," Дані "+h.toDisplayString(ge.entity_key)+" змінились з "+h.toDisplayString(ge.value_old)+" на "+h.toDisplayString(ge.value_new),1)):h.createCommentVNode("",!0),!ge.value_old&&ge.value_new?(h.openBlock(),h.createElementBlock("p",sW," Дані "+h.toDisplayString(ge.entity_key)+" внесено до БД: "+h.toDisplayString(ge.value_new),1)):h.createCommentVNode("",!0),ge.value_old&&!ge.value_new?(h.openBlock(),h.createElementBlock("p",oW," Дані "+h.toDisplayString(ge.entity_key)+" очищено ",1)):h.createCommentVNode("",!0)]))),256)):h.createCommentVNode("",!0),t.item.entity_type==="crm.files"&&t.item.change_type==="INSERT"&&((g=(p=t.item.changes)==null?void 0:p[0])==null?void 0:g.entity_key)==="uploaded_name"?(h.openBlock(),h.createElementBlock("p",aW," Завантажено файл "+h.toDisplayString((v=(y=t.item.changes)==null?void 0:y[0])==null?void 0:v.value_new)+" ("+h.toDisplayString((D=(T=(E=t.item)==null?void 0:E.changes)==null?void 0:T[0])==null?void 0:D.entity_key)+") ",1)):h.createCommentVNode("",!0),t.item.entity_type==="crm.files"&&t.item.change_type==="DELETE"?(h.openBlock(),h.createElementBlock("p",lW," Видалено файл "+h.toDisplayString((F=(B=(N=t.item)==null?void 0:N.changes)==null?void 0:B[0])==null?void 0:F.value_old)+" ("+h.toDisplayString((H=(te=(X=t.item)==null?void 0:X.changes)==null?void 0:te[0])==null?void 0:H.entity_key)+") ",1)):h.createCommentVNode("",!0),t.item.change_type!=="DELETE"&&!((ke=t.item.changes)!=null&&ke.length)?(h.openBlock(),h.createElementBlock("p",cW," Зміни відсутні ")):h.createCommentVNode("",!0),t.item.change_type==="addFile"?(h.openBlock(),h.createElementBlock("div",dW,[h.createElementVNode("div",uW,[h.createElementVNode("div",hW,[h.createElementVNode("div",fW,[h.createVNode(o,{class:"w-[24px] h-[24px] text-gray-800"}),h.createElementVNode("div",pW,[h.createElementVNode("p",mW,h.toDisplayString(t.item.file_name||"example file_name"),1),h.createElementVNode("small",gW,h.toDisplayString(t.item.file_weight||"example file_weight kb"),1)])])])])])):h.createCommentVNode("",!0),h.createElementVNode("p",yW,h.toDisplayString(t.getDate(t.item)),1)])])])}const _W=Ve(Q9,[["render",bW]]),xW={},vW={class:"shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function wW(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",vW,e[0]||(e[0]=[h.createElementVNode("path",{d:"m7 15 5 5 5-5"},null,-1),h.createElementVNode("path",{d:"m7 9 5-5 5 5"},null,-1)]))}const kW=Ve(xW,[["render",wW]]),EW=h.defineComponent({components:{VsWidgetHistoryItem:_W,VsEmptyWidget:d2,IconUpDown:kW},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{},showAll:!1,limitVisible:5}),computed:{createdDate(){var t,e,n;return(t=this.history)!=null&&t.data?QT((n=(e=this.history)==null?void 0:e.data)==null?void 0:n.cdate):""},lastEditDate(){var t,e,n;return(t=this.history)!=null&&t.data?QT((n=(e=this.history)==null?void 0:e.data)==null?void 0:n.edate):""},authorName(){var t;return(t=this.history)!=null&&t.data?this.history.data.author:""},displayedRows(){var t,e,n;return this.showAll?(t=this.history)==null?void 0:t.rows:(n=(e=this.history)==null?void 0:e.rows)==null?void 0:n.slice(0,this.limitVisible)}},methods:{async getHistoryData(){if(this.prefilledData){this.history=this.prefilledData;return}try{const{data:t}=await tt.get(`/api/widget/history/${this.id}`);this.history=t}catch(t){console.error(t)}},showMore(){this.showAll=!0}},async mounted(){await this.getHistoryData()},watch:{"history.rows":function(t){this.$emit("count-change",t.length)}}}),SW={class:"bg-white"},CW={key:0,class:""},TW={key:0,class:"relative last:pb-0 pb-8 last:after:hidden after:absolute after:top-[38px] after:bottom-0 after:start-[19px] after:w-px after:bg-gray-200 dark:after:bg-neutral-700"},AW={class:"w-[38px]"},MW={class:"flex shrink-0 justify-center items-center w-6 h-7 border border-gray-200 text-sm font-semibold text-gray-800 rounded-md mx-auto dark:border-neutral-700 dark:text-neutral-400"},DW={class:"grow"},IW={class:"text-sm font-semibold text-gray-800 group-focus:text-blue-600 dark:text-neutral-300 dark:group-focus:text-blue-500"},PW={key:1,class:"w-full h-[330px] flex items-center justify-center"};function RW(t,e,n,r,i,s){var p,g,y,v,E,T;const a=h.resolveComponent("VsWidgetHistoryItem"),o=h.resolveComponent("IconUpDown");return h.openBlock(),h.createElementBlock("div",SW,[e[1]||(e[1]=h.createElementVNode("div",{class:"flex items-center justify-between mb-4 gap-x-2"},null,-1)),(g=(p=t.history)==null?void 0:p.rows)!=null&&g.length?(h.openBlock(),h.createElementBlock("ul",CW,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.displayedRows,(D,N)=>{var B,F;return h.openBlock(),h.createElementBlock("li",{class:"list-none mr-[10px]",key:D.uid},[h.createVNode(a,{item:D,class:h.normalizeClass(N===((F=(B=t.history)==null?void 0:B.rows)==null?void 0:F.length)-1?"pb-0 after:hidden":"pb-8 after:absolute after:top-[38px] after:bottom-0 after:start-[19px] after:w-px after:bg-gray-200 dark:after:bg-neutral-700")},null,8,["item","class"])])}),128)),((v=(y=t.history)==null?void 0:y.rows)==null?void 0:v.length)>4&&!t.showAll?(h.openBlock(),h.createElementBlock("div",TW,[h.createElementVNode("button",{type:"button",onClick:e[0]||(e[0]=(...D)=>t.showMore&&t.showMore(...D)),class:"hs-collapse-toggle hs-collapse-open:hidden group w-full text-start flex items-center gap-x-5 focus:outline-none",id:"hs-pro-dnao","aria-expanded":"false","aria-controls":"hs-pro-dnao-button","data-hs-collapse":"#hs-pro-dnao-button"},[h.createElementVNode("span",AW,[h.createElementVNode("span",MW,[h.createVNode(o)])]),h.createElementVNode("span",DW,[h.createElementVNode("span",IW," Показати ще "+h.toDisplayString(((T=(E=t.history)==null?void 0:E.rows)==null?void 0:T.length)-t.limitVisible),1)])])])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createElementBlock("div",PW," Історія відсутні "))])}const OW=Ve(EW,[["render",RW]]),NW={props:{id:{type:String,default:""},data:{type:Object,default:null}},data(){return{mode:"base"}},methods:{getPdfUrl(){const t=`/api/print-template/crm.accounts.doc/${this.id}`;return this.mode==="demo"?t+"?demo=1&format=pdf":this.mode==="preview"?t+"?preview=1&format=pdf":t},setMode(t){this.mode=t},downloadPdf(){const t=document.createElement("a");t.href=`/api/print-template/crm.accounts.doc/${this.id}`,t.download=`document_${this.id}.pdf`,t.click()},downloadWord(){const t=document.createElement("a");t.href=`/api/print-template/crm.accounts.doc/${this.id}?format=word`,t.download=`document_${this.id}.docx`,t.click()}}},BW={class:"flex flex-col h-[calc(100vh-300px)] text-sm"},zW={class:"flex justify-between"},LW={class:"flex gap-4 mb-4"},VW={class:"flex mb-4 border rounded overflow-hidden"},FW=["src"];function $W(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",BW,[h.createElementVNode("div",zW,[h.createElementVNode("div",LW,[h.createElementVNode("button",{onClick:e[0]||(e[0]=(...a)=>s.downloadPdf&&s.downloadPdf(...a)),class:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"}," Завантажити PDF "),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...a)=>s.downloadWord&&s.downloadWord(...a)),class:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600"}," Завантажити Word ")]),h.createElementVNode("div",VW,[h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="base","bg-white":i.mode!=="base"},"px-4 py-2 border-r text-black"]),onClick:e[2]||(e[2]=a=>s.setMode("base"))}," Базовий ",2),h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="demo","bg-white":i.mode!=="demo"},"px-4 py-2 border-r text-black"]),onClick:e[3]||(e[3]=a=>s.setMode("demo"))}," Демо ",2),h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="preview","bg-white":i.mode!=="preview"},"px-4 py-2 text-black"]),onClick:e[4]||(e[4]=a=>s.setMode("preview"))}," Перегляд шаблону ",2)])]),h.createElementVNode("iframe",{src:s.getPdfUrl(),type:"application/pdf",class:"flex-grow w-full border-0 rounded-lg shadow-lg"},null,8,FW)])}const jW=Ve(NW,[["render",$W]]),HW={},UW={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function WW(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",UW,e[0]||(e[0]=[h.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const tA=Ve(HW,[["render",WW]]),qW={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},GW={style:{display:"none"}},YW=["height","width","fill"];function ZW(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock(h.Fragment,null,[(h.openBlock(),h.createElementBlock("svg",GW,e[0]||(e[0]=[h.createElementVNode("symbol",{id:"icon-pencil",viewBox:"0 0 32 32"},[h.createElementVNode("path",{d:"M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z"})],-1)]))),(h.openBlock(),h.createElementBlock("svg",{height:n.height,width:n.width,fill:n.color},e[1]||(e[1]=[h.createElementVNode("use",{"xlink:href":"#icon-pencil"},null,-1)]),8,YW))],64)}const nA=Ve(qW,[["render",ZW]]),XW={class:"hs-dropdown [--placement:bottom-right] inline-flex"},KW={class:"inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},JW={class:"flex flex-col items-start"},QW={key:0,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},eq={class:"p-4"},tq={class:"flex justify-end mt-4 gap-x-3"},nq={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},rq={__name:"vs-widget-table-controls",props:{table:{type:String,default:()=>""},id:{type:String,default:()=>""},form:{type:String,default:()=>""}},emits:["update-table"],setup(t,{emit:e}){const n=t,r=e,i=h.ref(!1),s=h.ref(!1),a=h.ref({}),o=h.ref(null),p=()=>{i.value=!0,document.body.click()},g=async()=>{var E;try{const T=await tt.get(`/api/table/${n.table}/${n.id}`);a.value=T==null?void 0:T.data;const{data:D}=await tt.get(`/api/form/${n.form}`);o.value=((E=D==null?void 0:D.form)==null?void 0:E.schema)||(D==null?void 0:D.form),document.body.click(),s.value=!0}catch{}},y=async()=>{try{await tt.delete(`/api/table/${n.table}/${n.id}`),await r("update-table")}catch(E){console.log(E)}},v=async()=>{try{await tt.put(`/api/table/${n.table}/${n.id}`,a.value),s.value=!1,await r("update-table")}catch{}};return h.onMounted(()=>{n.isForm&&g()}),(E,T)=>{const D=h.resolveComponent("VsPopover"),N=h.resolveComponent("VsConfirm"),B=h.resolveComponent("VsForm"),F=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",XW,[h.createVNode(D,{trigger:"click",placement:"bottom-left"},{reference:h.withCtx(()=>[h.createElementVNode("button",KW,[h.createVNode(Q_,{height:"16",width:"16"})])]),default:h.withCtx(()=>[h.createElementVNode("div",JW,[h.createElementVNode("button",{onClick:g,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(nA,{color:"#000"}),T[5]||(T[5]=h.createTextVNode(" Редагувати "))]),E.isForm?(h.openBlock(),h.createElementBlock("div",QW)):h.createCommentVNode("",!0),h.createElementVNode("button",{onClick:h.withModifiers(p,["stop"]),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(tA),T[6]||(T[6]=h.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])])]),_:1})]),h.createVNode(N,{visible:i.value,"onUpdate:visible":T[1]||(T[1]=X=>i.value=X),size:"small",title:"Ви впевнені?"},{default:h.withCtx(()=>[h.createElementVNode("div",eq,[T[7]||(T[7]=h.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),h.createElementVNode("div",tq,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:T[0]||(T[0]=X=>i.value=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:y}," Так, я впевнена/ий ")])])]),_:1},8,["visible"]),h.createVNode(F,{visible:s.value,"onUpdate:visible":T[4]||(T[4]=X=>s.value=X),title:"Редагувати об'єкт"},{footer:h.withCtx(()=>[h.createElementVNode("div",nq,[h.createElementVNode("button",{onClick:T[3]||(T[3]=X=>s.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),h.createElementVNode("button",{onClick:v,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:h.withCtx(()=>[h.createVNode(B,{scheme:o.value,modelValue:a.value,"onUpdate:modelValue":T[2]||(T[2]=X=>a.value=X),ref:"form"},null,8,["scheme","modelValue"])]),_:1},8,["visible"])],64)}}},iq={},sq={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function oq(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",sq,e[0]||(e[0]=[h.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"},null,-1)]))}const Qh=Ve(iq,[["render",oq]]),aq={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},lq={__name:"vs-widget-table-add-form",props:{token:{type:String,default:()=>""},form:{type:String,default:()=>""}},setup(t){const e=t,n=h.ref(!1),r=h.ref(null),i=h.ref({}),s=h.ref(),a=async()=>{var p;try{const{data:g}=await tt.get(`/api/form/${e.form}`);r.value=((p=g==null?void 0:g.form)==null?void 0:p.schema)||(g==null?void 0:g.form),n.value=!0}catch{}},o=async()=>{var p;try{await((p=s.value)==null?void 0:p.doValidation()),await tt.post(`/api/table/${e.token}`,i.value)}catch(g){console.log(g)}};return(p,g)=>{const y=h.resolveComponent("VsForm"),v=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:a,class:"h-[34px] w-[34px] shadow bg-blue-500 rounded-lg flex items-center justify-center text-white duration-300 hover:bg-blue-700"},[h.createVNode(Qh)]),h.createVNode(v,{visible:n.value,"onUpdate:visible":g[2]||(g[2]=E=>n.value=E),title:"Створити об'єкт"},{footer:h.withCtx(()=>[h.createElementVNode("div",aq,[h.createElementVNode("button",{onClick:g[1]||(g[1]=E=>n.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),h.createElementVNode("button",{onClick:o,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:h.withCtx(()=>[h.createVNode(y,{scheme:r.value,modelValue:i.value,"onUpdate:modelValue":g[0]||(g[0]=E=>i.value=E),ref_key:"form",ref:s},null,8,["scheme","modelValue"])]),_:1},8,["visible"])],64)}}},cq={props:{row:Object,column:Object,table:String}};function dq(t,e,n,r,i,s){var a,o,p,g,y,v,E,T;return h.openBlock(),h.createBlock(h.resolveDynamicComponent(((a=n.column)==null?void 0:a.format)==="custom"?(o=n.column)==null?void 0:o.component:`table-format-${((g=(p=n.column)==null?void 0:p.format)==null?void 0:g.toLowerCase())||"text"}`),{onUpdateTable:e[0]||(e[0]=D=>t.$emit("update-table")),name:(y=n.column)==null?void 0:y.name,data:n.row,value:(E=n.row)==null?void 0:E[(v=n.column)==null?void 0:v.name],table:n.table,column:n.column,edit:(T=n.column)==null?void 0:T.edit},null,40,["name","data","value","table","column","edit"])}const ef=Ve(cq,[["render",dq]]),uq={},hq={class:"h21yx vs0hq",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function fq(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",hq,e[0]||(e[0]=[h.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)]))}const rA=Ve(uq,[["render",fq]]),pq={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number},table:{type:String},filter:{type:Array},data:{type:Object}},components:{IconFilter:rA},mounted(){setTimeout(()=>{var t,e;typeof this.filter=="string"?(e=this.$refs.filter)==null||e.setFilter(this.filter,(t=this.data)==null?void 0:t[this.filter]):typeof this.filter=="object"&&this.filter.forEach(n=>{var r,i;(i=this.$refs.filter)==null||i.setFilter(n,(r=this.data)==null?void 0:r[n])})})},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},mq={key:0,class:"py-[1px] px-[6px] text-white text-[10px] rounded-full bg-blue-500"},gq={class:"filter-content h-screen bg-white w-[400px] overflow-x-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function yq(t,e,n,r,i,s){const a=h.resolveComponent("IconFilter"),o=h.resolveComponent("VsFilter");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=p=>i.isFilters=!i.isFilters),class:"py-2 px-2.5 max-h-[34px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none"},[h.createVNode(a,{height:"16",width:"16"}),e[4]||(e[4]=h.createTextVNode(" Фільтри ")),n.onFilters?(h.openBlock(),h.createElementBlock("span",mq,h.toDisplayString(n.onFilters),1)):h.createCommentVNode("",!0)]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var p;return[h.withDirectives(h.createElementVNode("div",{onClick:e[3]||(e[3]=(...g)=>s.closeFilter&&s.closeFilter(...g)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.2)]"},[h.createElementVNode("div",gq,[(p=n.scheme)!=null&&p.length?(h.openBlock(),h.createBlock(o,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",token:n.table,name:"filter",footer:!0,background:!0,onFilterChange:e[1]||(e[1]=g=>t.$emit("filterChange",g)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=g=>i.isFilters=!1)},null,8,["scheme","token"])):h.createCommentVNode("",!0)])],512),[[h.vShow,i.isFilters]])]}),_:1})],64)}const bq=Ve(pq,[["render",yq]]),_q={class:"h-full"},xq={class:"flex justify-between mb-[4px]"},vq={class:"flex gap-[4px]"},wq={class:"inline-block w-full align-middle"},kq={class:"relative min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},Eq={class:"dark:bg-neutral-700 sticky top-[-1px] bg-white"},Sq={key:0,class:"w-[70px] bg-white text-center sticky right-[-1px]"},Cq={class:"divide-y divide-gray-200 dark:divide-neutral-700"},Tq={key:0,class:"w-[70px] bg-white text-center sticky right-[-1px] px-[10px]"},Aq={key:0,class:"h-[60px] flex items-center justify-center"},Mq={__name:"vs-widget-table",props:{data:Object,columns:Array,token:String,table:{type:String,default:()=>""},id:{type:String,default:()=>""},api:{type:String,default:()=>""},data:{type:Object,default:()=>null},filter:{type:Array,default:()=>[]}},setup(t){const e=t,n=h.ref(null),r=h.ref([]),i=h.ref(1),s=h.ref(""),a=h.ref(null),o=h.ref(null),p=h.ref(0),g=async()=>{var E;try{const T=await tt.get(`/api/table-filter/${e.table}`);a.value=(E=T==null?void 0:T.data)==null?void 0:E.list;const{data:D}=await tt.get((e!=null&&e.api?e.api:"/api/table-data")+(e.token?`/${e.token}`:e.table&&e.id?`/${e.table}`:""),{params:{page:i.value,limit:10,search:s.value,filter:o.value}});n.value=D,r.value=(D==null?void 0:D.columns)||(e==null?void 0:e.columns)}catch(T){console.error("Ошибка при загрузке данных таблицы:",T)}},y=E=>{i.value=E,g()},v=async({url:E,state:T})=>{var D;o.value=E!=="no-url"?E:null,p.value=(D=Object.entries(T))==null?void 0:D.length,i.value=1,await g()};return h.watch(s,g),h.onMounted(()=>{g()}),(E,T)=>{var B,F,X,te,H,ke,ge,Se,Pe,Ne,at,Je;const D=h.resolveComponent("VsText"),N=h.resolveComponent("VsPagination");return h.openBlock(),h.createElementBlock("div",_q,[h.createElementVNode("div",xq,[h.createVNode(D,{modelValue:s.value,"onUpdate:modelValue":T[0]||(T[0]=mt=>s.value=mt),class:"h-[40px] w-[300px]",placeholder:"Пошук..."},null,8,["modelValue"]),h.createElementVNode("div",vq,[a.value?(h.openBlock(),h.createBlock(bq,{key:0,scheme:a.value,table:t.table,onFilterChange:v,onFilters:p.value,filter:t.filter,data:(F=(B=t.data)==null?void 0:B.rows)==null?void 0:F[0]},null,8,["scheme","table","onFilters","filter","data"])):h.createCommentVNode("",!0),h.createVNode(lq,{token:(X=n.value)==null?void 0:X.addToken,form:(te=n.value)==null?void 0:te.form},null,8,["token","form"])])]),h.createElementVNode("div",{class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:h.normalizeStyle({height:((ke=(H=n.value)==null?void 0:H.rows)==null?void 0:ke.length)>E.limit?"calc(100% - 60px)":"100%"})},[h.createElementVNode("div",wq,[h.createElementVNode("table",kq,[(ge=r.value)!=null&&ge.length?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[h.createElementVNode("thead",Eq,[h.createElementVNode("tr",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.value,(mt,nt)=>(h.openBlock(),h.createElementBlock("th",{key:nt,scope:"col",class:"px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase dark:text-neutral-400 min-w-[200px]"},h.toDisplayString((mt==null?void 0:mt.title)||(mt==null?void 0:mt.description)||(mt==null?void 0:mt.ua)),1))),128)),(Pe=(Se=n.value)==null?void 0:Se.actions)!=null&&Pe.length?(h.openBlock(),h.createElementBlock("th",Sq)):h.createCommentVNode("",!0)])]),h.createElementVNode("tbody",Cq,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((Ne=n.value)==null?void 0:Ne.rows,(mt,nt)=>{var Ct,$t,jt;return h.openBlock(),h.createElementBlock("tr",{key:nt},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.value,(Ot,qt)=>(h.openBlock(),h.createElementBlock("td",{key:qt,class:"px-6 py-4 text-sm text-gray-800 dark:text-neutral-200"},[h.createVNode(ef,{row:mt,column:Ot,table:t.table},null,8,["row","column","table"])]))),128)),($t=(Ct=n.value)==null?void 0:Ct.actions)!=null&&$t.length?(h.openBlock(),h.createElementBlock("td",Tq,[h.createVNode(rq,{id:mt==null?void 0:mt.id,table:t.table,token:mt==null?void 0:mt.token,form:(jt=n.value)==null?void 0:jt.form,onUpdateTable:g},null,8,["id","table","token","form"])])):h.createCommentVNode("",!0)])}),128))])],64)):h.createCommentVNode("",!0)])])],4),((at=n.value)==null?void 0:at.filtered)>20?(h.openBlock(),h.createElementBlock("div",Aq,[h.createVNode(N,{goTo:!1,"default-page":i.value,total:(Je=n.value)==null?void 0:Je.filtered,class:"w-fit",pageSize:10,onPageChange:y,backgroundColor:"#F3F4F6"},null,8,["default-page","total"])])):h.createCommentVNode("",!0)])}}},Dq={},Iq={class:"shrink-0",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Pq(t,e){return h.openBlock(),h.createElementBlock("svg",Iq,e[0]||(e[0]=[h.createElementVNode("path",{d:"M18 6 7 17l-5-5"},null,-1),h.createElementVNode("path",{d:"m22 10-7.5 7.5L13 16"},null,-1)]))}const Rq=Ve(Dq,[["render",Pq]]),Oq={},Nq={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-user"};function Bq(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Nq,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z"},null,-1),h.createElementVNode("path",{d:"M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z"},null,-1)]))}const iA=Ve(Oq,[["render",Bq]]),zq={},Lq={class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Vq(t,e){return h.openBlock(),h.createElementBlock("svg",Lq,e[0]||(e[0]=[h.createElementVNode("polyline",{points:"9 11 12 14 22 4"},null,-1),h.createElementVNode("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"},null,-1)]))}const Fq=Ve(zq,[["render",Vq]]),$q={class:"relative shrink-0"},jq=["src"],Hq={key:1,class:"h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"},Uq={key:2,class:"absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"},Wq={class:"grow"},qq={class:"text-xs text-gray-500 dark:text-neutral-500"},Gq={class:"block text-sm font-medium text-gray-800 dark:text-neutral-300"},Yq={class:"text-sm text-gray-500 dark:text-neutral-500"},Zq={key:0,class:"sm:group-hover:opacity-100 sm:opacity-0 sm:absolute sm:top-5 sm:end-5 inline-block p-0.5 bg-white border border-gray-200 rounded-lg shadow-sm transition ease-out"},Xq={__name:"admin-notification-item",props:{item:Object},emits:["update-notification"],setup(t,{emit:e}){const n=e,r=h.ref(!1),i=()=>r.value=!0,s=()=>r.value=!1,a=async()=>{var o;try{await tt.get(`/api/notification-read/${(o=t.item)==null?void 0:o.id}`),await n("update-notification")}catch{}};return(o,p)=>{var y,v,E,T,D,N;const g=h.resolveComponent("VsPopover");return h.openBlock(),h.createElementBlock("li",{class:h.normalizeClass(["relative group w-full flex gap-x-5 text-start p-5 border-b",[(y=t.item)!=null&&y.read?"bg-gray-100":"bg-white"]]),onMouseenter:i,onMouseleave:s},[h.createElementVNode("div",$q,[(v=t.item)!=null&&v.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"shrink-0 size-[38px] rounded-full",src:(E=t.item)==null?void 0:E.avatar,alt:"Avatar"},null,8,jq)):(h.openBlock(),h.createElementBlock("div",Hq,[h.createVNode(iA)])),(T=t.item)!=null&&T.read?(h.openBlock(),h.createElementBlock("span",Uq)):h.createCommentVNode("",!0)]),h.createElementVNode("div",Wq,[h.createElementVNode("p",qq,[h.createVNode(ab,{name:"cdate",data:t.item},null,8,["data"])]),h.createElementVNode("span",Gq,h.toDisplayString((D=t.item)==null?void 0:D.author),1),h.createElementVNode("p",Yq,h.toDisplayString((N=t.item)==null?void 0:N.subject),1)]),r.value?(h.openBlock(),h.createElementBlock("div",Zq,[h.createVNode(g,{trigger:"hover",placement:"left"},{reference:h.withCtx(()=>[h.createElementVNode("button",{onClick:a,type:"button",class:"hs-tooltip-toggle hs-tooltip relative inline-block size-7 flex shrink-0 justify-center items-center text-gray-500 hover:bg-gray-100 hover:text-gray-800 rounded"},[h.createVNode(Fq)])]),default:h.withCtx(()=>[p[0]||(p[0]=h.createTextVNode(" Прочитати "))]),_:1})])):h.createCommentVNode("",!0)],34)}}},Kq={},Jq={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Qq(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Jq,e[0]||(e[0]=[h.createElementVNode("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"},null,-1),h.createElementVNode("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"},null,-1)]))}const eG=Ve(Kq,[["render",Qq]]),tG={},nG={class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function rG(t,e){return h.openBlock(),h.createElementBlock("svg",nG,e[0]||(e[0]=[h.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1),h.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)]))}const iG=Ve(tG,[["render",rG]]),sG={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},oG={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},aG={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},lG={class:"max-w-sm mx-auto mt-6"},cG={class:"font-medium text-gray-800 dark:text-neutral-200"},dG={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function uG(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",oG,[h.createElementVNode("div",null,[h.createElementVNode("div",aG,[e[0]||(e[0]=h.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),h.createElementVNode("div",lG,[h.createElementVNode("p",cG,h.toDisplayString(n.title),1),h.createElementVNode("p",dG,h.toDisplayString(n.text),1)])])])])}const tx=Ve(sG,[["render",uG]]),hG={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},fG={class:"relative min-w-[18px] min-h-[18px] inline-flex justify-center items-center text-[10px] bg-red-500 text-white rounded-full px-1"},pG={key:0,class:"w-96 h-[100px] z-[11] absolute top-[40px] right-0"},mG={class:"h-[50px] px-[20px] border-b w-full flex items-center justify-between rounded-t-lg bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)]"},gG={class:"h-[30px] w-[30px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100"},yG={class:"max-h-[400px] bg-white overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300"},bG={key:0},_G={key:1},sA={__name:"admin-notification",setup(t){const e=h.ref(0),n=h.ref([]),r=h.ref(!1),i=h.ref(null),{$notify:s}=h.getCurrentInstance().proxy,a=g=>{i.value&&!i.value.contains(g.target)&&(r.value=!1)};h.watch(r,g=>{g?window.addEventListener("click",a):window.removeEventListener("click",a)}),h.onBeforeUnmount(()=>{window.removeEventListener("click",a)});const o=async()=>{try{const{data:g}=await tt.get("/api/notification");n.value=(g==null?void 0:g.rows)||[]}catch{s({type:"error",message:"При спробі завантаження нотифікацій виникла помилка",title:"Помилка!"})}};o();const p=async()=>{try{await tt.get("/api/notification-read"),await o()}catch{s({type:"error",message:"Виникла помилка",title:"Помилка!"})}};return(g,y)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"notificationRef",ref:i,class:"hs-tooltip [--placement:bottom] inline-block show relative"},[h.createElementVNode("button",{onClick:y[0]||(y[0]=v=>r.value=!r.value),class:"hs-tooltip-toggle relative size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"},[h.createVNode(eG,{height:"24",width:"24"}),e.value?(h.openBlock(),h.createElementBlock("span",hG,[y[1]||(y[1]=h.createElementVNode("span",{class:"absolute inline-flex bg-red-400 rounded-full opacity-75 animate-ping size-full dark:bg-red-600"},null,-1)),h.createElementVNode("span",fG,h.toDisplayString(e.value),1)])):h.createCommentVNode("",!0)]),h.createVNode(h.Transition,null,{default:h.withCtx(()=>{var v;return[r.value?(h.openBlock(),h.createElementBlock("div",pG,[h.createElementVNode("div",mG,[y[2]||(y[2]=h.createElementVNode("nav",{class:"flex"},[h.createElementVNode("button",{type:"button",class:"px-2 py-1.5 relative inline-flex justify-center items-center gap-x-2 text-nowrap hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg focus:outline-none focus:bg-gray-100 after:absolute after:bottom-[-9px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800"}," Всі ")],-1)),h.createElementVNode("button",gG,[h.createVNode(iG)])]),h.createElementVNode("div",yG,[(v=n.value)!=null&&v.length?(h.openBlock(),h.createElementBlock("ul",bG,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.value,E=>(h.openBlock(),h.createBlock(Xq,{key:E==null?void 0:E.id,item:E,onUpdateNotification:o},null,8,["item"]))),128))])):(h.openBlock(),h.createElementBlock("div",_G,[h.createVNode(tx,{class:"[&>div>div]:min-h-[300px]",text:""})]))]),h.createElementVNode("button",{onClick:p,class:"h-[50px] border-t w-full rounded-b-lg bg-white shadow p-4 flex justify-center items-center gap-x-2 text-sm text-gray-500 font-medium sm:rounded-b-lg hover:text-blue-600 focus:outline-none"},[h.createVNode(Rq,{height:"16",width:"16"}),y[3]||(y[3]=h.createTextVNode(" Прочитати усі "))])])):h.createCommentVNode("",!0)]}),_:1})],512))}};var pg,Vt,oA,aA,qd,bc,lA,cA,dA,mg={},uA=[],xG=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function tl(t,e){for(var n in e)t[n]=e[n];return t}function hA(t){var e=t.parentNode;e&&e.removeChild(t)}function ce(t,e,n){var r,i,s,a={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?pg.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)a[s]===void 0&&(a[s]=t.defaultProps[s]);return gg(t,a,r,i,null)}function gg(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++oA};return i==null&&Vt.vnode!=null&&Vt.vnode(s),s}function Mi(){return{current:null}}function Qn(t){return t.children}function vG(t,e,n,r,i){var s;for(s in n)s==="children"||s==="key"||s in e||yg(t,s,null,n[s],r);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||n[s]===e[s]||yg(t,s,e[s],n[s],r)}function fA(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||xG.test(e)?n:n+"px"}function yg(t,e,n,r,i){var s;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||fA(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||fA(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r||t.addEventListener(e,s?mA:pA,s):t.removeEventListener(e,s?mA:pA,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e.indexOf("-")==-1?t.removeAttribute(e):t.setAttribute(e,n))}}function pA(t){qd=!0;try{return this.l[t.type+!1](Vt.event?Vt.event(t):t)}finally{qd=!1}}function mA(t){qd=!0;try{return this.l[t.type+!0](Vt.event?Vt.event(t):t)}finally{qd=!1}}function gs(t,e){this.props=t,this.context=e}function tf(t,e){if(e==null)return t.__?tf(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?tf(t):null}function gA(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return gA(t)}}function wG(t){qd?setTimeout(t):cA(t)}function nx(t){(!t.__d&&(t.__d=!0)&&bc.push(t)&&!bg.__r++||lA!==Vt.debounceRendering)&&((lA=Vt.debounceRendering)||wG)(bg)}function bg(){var t,e,n,r,i,s,a,o;for(bc.sort(function(p,g){return p.__v.__b-g.__v.__b});t=bc.shift();)t.__d&&(e=bc.length,r=void 0,i=void 0,a=(s=(n=t).__v).__e,(o=n.__P)&&(r=[],(i=tl({},s)).__v=s.__v+1,rx(o,s,i,n.__n,o.ownerSVGElement!==void 0,s.__h!=null?[a]:null,r,a??tf(s),s.__h),vA(r,s),s.__e!=a&&gA(s)),bc.length>e&&bc.sort(function(p,g){return p.__v.__b-g.__v.__b}));bg.__r=0}function yA(t,e,n,r,i,s,a,o,p,g){var y,v,E,T,D,N,B,F=r&&r.__k||uA,X=F.length;for(n.__k=[],y=0;y<e.length;y++)if((T=n.__k[y]=(T=e[y])==null||typeof T=="boolean"?null:typeof T=="string"||typeof T=="number"||typeof T=="bigint"?gg(null,T,null,null,T):Array.isArray(T)?gg(Qn,{children:T},null,null,null):T.__b>0?gg(T.type,T.props,T.key,T.ref?T.ref:null,T.__v):T)!=null){if(T.__=n,T.__b=n.__b+1,(E=F[y])===null||E&&T.key==E.key&&T.type===E.type)F[y]=void 0;else for(v=0;v<X;v++){if((E=F[v])&&T.key==E.key&&T.type===E.type){F[v]=void 0;break}E=null}rx(t,T,E=E||mg,i,s,a,o,p,g),D=T.__e,(v=T.ref)&&E.ref!=v&&(B||(B=[]),E.ref&&B.push(E.ref,null,T),B.push(v,T.__c||D,T)),D!=null?(N==null&&(N=D),typeof T.type=="function"&&T.__k===E.__k?T.__d=p=bA(T,p,t):p=_A(t,T,E,F,D,p),typeof n.type=="function"&&(n.__d=p)):p&&E.__e==p&&p.parentNode!=t&&(p=tf(E))}for(n.__e=N,y=X;y--;)F[y]!=null&&(typeof n.type=="function"&&F[y].__e!=null&&F[y].__e==n.__d&&(n.__d=xA(r).nextSibling),kA(F[y],F[y]));if(B)for(y=0;y<B.length;y++)wA(B[y],B[++y],B[++y])}function bA(t,e,n){for(var r,i=t.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=t,e=typeof r.type=="function"?bA(r,e,n):_A(n,r,r,i,r.__e,e));return e}function _g(t,e){return e=e||[],t==null||typeof t=="boolean"||(Array.isArray(t)?t.some(function(n){_g(n,e)}):e.push(t)),e}function _A(t,e,n,r,i,s){var a,o,p;if(e.__d!==void 0)a=e.__d,e.__d=void 0;else if(n==null||i!=s||i.parentNode==null)e:if(s==null||s.parentNode!==t)t.appendChild(i),a=null;else{for(o=s,p=0;(o=o.nextSibling)&&p<r.length;p+=1)if(o==i)break e;t.insertBefore(i,s),a=s}return a!==void 0?a:i.nextSibling}function xA(t){var e,n,r;if(t.type==null||typeof t.type=="string")return t.__e;if(t.__k){for(e=t.__k.length-1;e>=0;e--)if((n=t.__k[e])&&(r=xA(n)))return r}return null}function rx(t,e,n,r,i,s,a,o,p){var g,y,v,E,T,D,N,B,F,X,te,H,ke,ge,Se,Pe=e.type;if(e.constructor!==void 0)return null;n.__h!=null&&(p=n.__h,o=e.__e=n.__e,e.__h=null,s=[o]),(g=Vt.__b)&&g(e);try{e:if(typeof Pe=="function"){if(B=e.props,F=(g=Pe.contextType)&&r[g.__c],X=g?F?F.props.value:g.__:r,n.__c?N=(y=e.__c=n.__c).__=y.__E:("prototype"in Pe&&Pe.prototype.render?e.__c=y=new Pe(B,X):(e.__c=y=new gs(B,X),y.constructor=Pe,y.render=EG),F&&F.sub(y),y.props=B,y.state||(y.state={}),y.context=X,y.__n=r,v=y.__d=!0,y.__h=[],y._sb=[]),y.__s==null&&(y.__s=y.state),Pe.getDerivedStateFromProps!=null&&(y.__s==y.state&&(y.__s=tl({},y.__s)),tl(y.__s,Pe.getDerivedStateFromProps(B,y.__s))),E=y.props,T=y.state,y.__v=e,v)Pe.getDerivedStateFromProps==null&&y.componentWillMount!=null&&y.componentWillMount(),y.componentDidMount!=null&&y.__h.push(y.componentDidMount);else{if(Pe.getDerivedStateFromProps==null&&B!==E&&y.componentWillReceiveProps!=null&&y.componentWillReceiveProps(B,X),!y.__e&&y.shouldComponentUpdate!=null&&y.shouldComponentUpdate(B,y.__s,X)===!1||e.__v===n.__v){for(e.__v!==n.__v&&(y.props=B,y.state=y.__s,y.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(Ne){Ne&&(Ne.__=e)}),te=0;te<y._sb.length;te++)y.__h.push(y._sb[te]);y._sb=[],y.__h.length&&a.push(y);break e}y.componentWillUpdate!=null&&y.componentWillUpdate(B,y.__s,X),y.componentDidUpdate!=null&&y.__h.push(function(){y.componentDidUpdate(E,T,D)})}if(y.context=X,y.props=B,y.__P=t,H=Vt.__r,ke=0,"prototype"in Pe&&Pe.prototype.render){for(y.state=y.__s,y.__d=!1,H&&H(e),g=y.render(y.props,y.state,y.context),ge=0;ge<y._sb.length;ge++)y.__h.push(y._sb[ge]);y._sb=[]}else do y.__d=!1,H&&H(e),g=y.render(y.props,y.state,y.context),y.state=y.__s;while(y.__d&&++ke<25);y.state=y.__s,y.getChildContext!=null&&(r=tl(tl({},r),y.getChildContext())),v||y.getSnapshotBeforeUpdate==null||(D=y.getSnapshotBeforeUpdate(E,T)),Se=g!=null&&g.type===Qn&&g.key==null?g.props.children:g,yA(t,Array.isArray(Se)?Se:[Se],e,n,r,i,s,a,o,p),y.base=e.__e,e.__h=null,y.__h.length&&a.push(y),N&&(y.__E=y.__=null),y.__e=!1}else s==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=kG(n.__e,e,n,r,i,s,a,p);(g=Vt.diffed)&&g(e)}catch(Ne){e.__v=null,(p||s!=null)&&(e.__e=o,e.__h=!!p,s[s.indexOf(o)]=null),Vt.__e(Ne,e,n)}}function vA(t,e){Vt.__c&&Vt.__c(e,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(r){r.call(n)})}catch(r){Vt.__e(r,n.__v)}})}function kG(t,e,n,r,i,s,a,o){var p,g,y,v=n.props,E=e.props,T=e.type,D=0;if(T==="svg"&&(i=!0),s!=null){for(;D<s.length;D++)if((p=s[D])&&"setAttribute"in p==!!T&&(T?p.localName===T:p.nodeType===3)){t=p,s[D]=null;break}}if(t==null){if(T===null)return document.createTextNode(E);t=i?document.createElementNS("http://www.w3.org/2000/svg",T):document.createElement(T,E.is&&E),s=null,o=!1}if(T===null)v===E||o&&t.data===E||(t.data=E);else{if(s=s&&pg.call(t.childNodes),g=(v=n.props||mg).dangerouslySetInnerHTML,y=E.dangerouslySetInnerHTML,!o){if(s!=null)for(v={},D=0;D<t.attributes.length;D++)v[t.attributes[D].name]=t.attributes[D].value;(y||g)&&(y&&(g&&y.__html==g.__html||y.__html===t.innerHTML)||(t.innerHTML=y&&y.__html||""))}if(vG(t,E,v,i,o),y)e.__k=[];else if(D=e.props.children,yA(t,Array.isArray(D)?D:[D],e,n,r,i&&T!=="foreignObject",s,a,s?s[0]:n.__k&&tf(n,0),o),s!=null)for(D=s.length;D--;)s[D]!=null&&hA(s[D]);o||("value"in E&&(D=E.value)!==void 0&&(D!==t.value||T==="progress"&&!D||T==="option"&&D!==v.value)&&yg(t,"value",D,v.value,!1),"checked"in E&&(D=E.checked)!==void 0&&D!==t.checked&&yg(t,"checked",D,v.checked,!1))}return t}function wA(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(r){Vt.__e(r,n)}}function kA(t,e,n){var r,i;if(Vt.unmount&&Vt.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||wA(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){Vt.__e(s,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&kA(r[i],e,n||typeof t.type!="function");n||t.__e==null||hA(t.__e),t.__=t.__e=t.__d=void 0}function EG(t,e,n){return this.constructor(t,n)}function nf(t,e,n){var r,i,s;Vt.__&&Vt.__(t,e),i=(r=typeof n=="function")?null:e.__k,s=[],rx(e,t=(!r&&n||e).__k=ce(Qn,null,[t]),i||mg,mg,e.ownerSVGElement!==void 0,!r&&n?[n]:i?null:e.firstChild?pg.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r),vA(s,t)}function SG(t,e){var n={__c:e="__cC"+dA++,__:t,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(o){o.__e=!0,nx(o)})},this.sub=function(a){i.push(a);var o=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),o&&o.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}pg=uA.slice,Vt={__e:function(t,e,n,r){for(var i,s,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(o){t=o}throw t}},oA=0,aA=function(t){return t!=null&&t.constructor===void 0},qd=!1,gs.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=tl({},this.state),typeof t=="function"&&(t=t(tl({},n),this.props)),t&&tl(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),nx(this))},gs.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),nx(this))},gs.prototype.render=Qn,bc=[],cA=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,bg.__r=0,dA=0;var Io,ix,EA,SA=[],sx=[],CA=Vt.__b,TA=Vt.__r,AA=Vt.diffed,MA=Vt.__c,DA=Vt.unmount;function CG(){for(var t;t=SA.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(xg),t.__H.__h.forEach(ox),t.__H.__h=[]}catch(e){t.__H.__h=[],Vt.__e(e,t.__v)}}Vt.__b=function(t){Io=null,CA&&CA(t)},Vt.__r=function(t){TA&&TA(t);var e=(Io=t.__c).__H;e&&(ix===Io?(e.__h=[],Io.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=sx,n.__N=n.i=void 0})):(e.__h.forEach(xg),e.__h.forEach(ox),e.__h=[])),ix=Io},Vt.diffed=function(t){AA&&AA(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(SA.push(e)!==1&&EA===Vt.requestAnimationFrame||((EA=Vt.requestAnimationFrame)||TG)(CG)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==sx&&(n.__=n.__V),n.i=void 0,n.__V=sx})),ix=Io=null},Vt.__c=function(t,e){e.some(function(n){try{n.__h.forEach(xg),n.__h=n.__h.filter(function(r){return!r.__||ox(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Vt.__e(r,n.__v)}}),MA&&MA(t,e)},Vt.unmount=function(t){DA&&DA(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{xg(r)}catch(i){e=i}}),n.__H=void 0,e&&Vt.__e(e,n.__v))};var IA=typeof requestAnimationFrame=="function";function TG(t){var e,n=function(){clearTimeout(r),IA&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);IA&&(e=requestAnimationFrame(n))}function xg(t){var e=Io,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Io=e}function ox(t){var e=Io;t.__c=t.__(),Io=e}function AG(t,e){for(var n in e)t[n]=e[n];return t}function PA(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function RA(t){this.props=t}(RA.prototype=new gs).isPureReactComponent=!0,RA.prototype.shouldComponentUpdate=function(t,e){return PA(this.props,t)||PA(this.state,e)};var OA=Vt.__b;Vt.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),OA&&OA(t)};var MG=Vt.__e;Vt.__e=function(t,e,n,r){if(t.then){for(var i,s=e;s=s.__;)if((i=s.__c)&&i.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e)}MG(t,e,n,r)};var NA=Vt.unmount;function BA(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=AG({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return BA(r,e,n)})),t}function zA(t,e,n){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return zA(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=n)),t}function ax(){this.__u=0,this.t=null,this.__b=null}function LA(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function vg(){this.u=null,this.o=null}Vt.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&t.__h===!0&&(t.type=null),NA&&NA(t)},(ax.prototype=new gs).__c=function(t,e){var n=e.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var i=LA(r.__v),s=!1,a=function(){s||(s=!0,n.__R=null,i?i(o):o())};n.__R=a;var o=function(){if(!--r.__u){if(r.state.__a){var g=r.state.__a;r.__v.__k[0]=zA(g,g.__c.__P,g.__c.__O)}var y;for(r.setState({__a:r.__b=null});y=r.t.pop();)y.forceUpdate()}},p=e.__h===!0;r.__u++||p||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},ax.prototype.componentWillUnmount=function(){this.t=[]},ax.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=BA(this.__b,n,r.__O=r.__P)}this.__b=null}var i=e.__a&&ce(Qn,null,t.fallback);return i&&(i.__h=null),[ce(Qn,null,e.__a?null:t.children),i]};var VA=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function DG(t){return this.getChildContext=function(){return t.context},t.children}function IG(t){var e=this,n=t.i;e.componentWillUnmount=function(){nf(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),e.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),e.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.i.removeChild(r)}}),nf(ce(DG,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}function PG(t,e){var n=ce(IG,{__v:t,i:e});return n.containerInfo=e,n}(vg.prototype=new gs).__a=function(t){var e=this,n=LA(e.__v),r=e.o.get(t);return r[0]++,function(i){var s=function(){e.props.revealOrder?(r.push(i),VA(e,t,r)):i()};n?n(s):s()}},vg.prototype.render=function(t){this.u=null,this.o=new Map;var e=_g(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},vg.prototype.componentDidUpdate=vg.prototype.componentDidMount=function(){var t=this;this.o.forEach(function(e,n){VA(t,n,e)})};var RG=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,OG=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,NG=typeof document<"u",BG=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(t)};gs.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(gs.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var FA=Vt.event;function zG(){}function LG(){return this.cancelBubble}function VG(){return this.defaultPrevented}Vt.event=function(t){return FA&&(t=FA(t)),t.persist=zG,t.isPropagationStopped=LG,t.isDefaultPrevented=VG,t.nativeEvent=t};var $A={configurable:!0,get:function(){return this.class}},jA=Vt.vnode;Vt.vnode=function(t){var e=t.type,n=t.props,r=n;if(typeof e=="string"){var i=e.indexOf("-")===-1;for(var s in r={},n){var a=n[s];NG&&s==="children"&&e==="noscript"||s==="value"&&"defaultValue"in n&&a==null||(s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&a===!0?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+e)&&!BG(n.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():i&&OG.test(s)?s=s.replace(/[A-Z0-9]/g,"-$&").toLowerCase():a===null&&(a=void 0),/^oninput$/i.test(s)&&(s=s.toLowerCase(),r[s]&&(s="oninputCapture")),r[s]=a)}e=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=_g(n.children).forEach(function(o){o.props.selected=r.value.indexOf(o.props.value)!=-1})),e=="select"&&r.defaultValue!=null&&(r.value=_g(n.children).forEach(function(o){o.props.selected=r.multiple?r.defaultValue.indexOf(o.props.value)!=-1:r.defaultValue==o.props.value})),t.props=r,n.class!=n.className&&($A.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",$A))}t.$$typeof=RG,jA&&jA(t)};var HA=Vt.__r;Vt.__r=function(t){HA&&HA(t),t.__c};const UA=[],lx=new Map;function wg(t){UA.push(t),lx.forEach(e=>{qA(e,t)})}function FG(t){t.isConnected&&t.getRootNode&&WA(t.getRootNode())}function WA(t){let e=lx.get(t);if(!e||!e.isConnected){if(e=t.querySelector("style[data-fullcalendar]"),!e){e=document.createElement("style"),e.setAttribute("data-fullcalendar","");const n=jG();n&&(e.nonce=n);const r=t===document?document.head:t,i=t===document?r.querySelector("script,link[rel=stylesheet],link[as=style],style"):r.firstChild;r.insertBefore(e,i)}lx.set(t,e),$G(e)}}function $G(t){for(const e of UA)qA(t,e)}function qA(t,e){const{sheet:n}=t,r=n.cssRules.length;e.split("}").forEach((i,s)=>{i=i.trim(),i&&n.insertRule(i+"}",r+s)})}let cx;function jG(){return cx===void 0&&(cx=HG()),cx}function HG(){const t=document.querySelector('meta[name="csp-nonce"]');if(t&&t.hasAttribute("content"))return t.getAttribute("content");const e=document.querySelector("script[nonce]");return e&&e.nonce||""}typeof document<"u"&&WA(document);var UG=':root{--fc-small-font-size:.85em;--fc-page-bg-color:#fff;--fc-neutral-bg-color:hsla(0,0%,82%,.3);--fc-neutral-text-color:grey;--fc-border-color:#ddd;--fc-button-text-color:#fff;--fc-button-bg-color:#2c3e50;--fc-button-border-color:#2c3e50;--fc-button-hover-bg-color:#1e2b37;--fc-button-hover-border-color:#1a252f;--fc-button-active-bg-color:#1a252f;--fc-button-active-border-color:#151e27;--fc-event-bg-color:#3788d8;--fc-event-border-color:#3788d8;--fc-event-text-color:#fff;--fc-event-selected-overlay-color:rgba(0,0,0,.25);--fc-more-link-bg-color:#d0d0d0;--fc-more-link-text-color:inherit;--fc-event-resizer-thickness:8px;--fc-event-resizer-dot-total-width:8px;--fc-event-resizer-dot-border-width:1px;--fc-non-business-color:hsla(0,0%,84%,.3);--fc-bg-event-color:#8fdf82;--fc-bg-event-opacity:0.3;--fc-highlight-color:rgba(188,232,241,.3);--fc-today-bg-color:rgba(255,220,40,.15);--fc-now-indicator-color:red}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc{display:flex;flex-direction:column;font-size:1em}.fc,.fc *,.fc :after,.fc :before{box-sizing:border-box}.fc table{border-collapse:collapse;border-spacing:0;font-size:1em}.fc th{text-align:center}.fc td,.fc th{padding:0;vertical-align:top}.fc a[data-navlink]{cursor:pointer}.fc a[data-navlink]:hover{text-decoration:underline}.fc-direction-ltr{direction:ltr;text-align:left}.fc-direction-rtl{direction:rtl;text-align:right}.fc-theme-standard td,.fc-theme-standard th{border:1px solid var(--fc-border-color)}.fc-liquid-hack td,.fc-liquid-hack th{position:relative}@font-face{font-family:fcicons;font-style:normal;font-weight:400;src:url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBfAAAAC8AAAAYGNtYXAXVtKNAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZgYydxIAAAF4AAAFNGhlYWQUJ7cIAAAGrAAAADZoaGVhB20DzAAABuQAAAAkaG10eCIABhQAAAcIAAAALGxvY2ED4AU6AAAHNAAAABhtYXhwAA8AjAAAB0wAAAAgbmFtZXsr690AAAdsAAABhnBvc3QAAwAAAAAI9AAAACAAAwPAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpBgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6Qb//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAWIAjQKeAskAEwAAJSc3NjQnJiIHAQYUFwEWMjc2NCcCnuLiDQ0MJAz/AA0NAQAMJAwNDcni4gwjDQwM/wANIwz/AA0NDCMNAAAAAQFiAI0CngLJABMAACUBNjQnASYiBwYUHwEHBhQXFjI3AZ4BAA0N/wAMJAwNDeLiDQ0MJAyNAQAMIw0BAAwMDSMM4uINIwwNDQAAAAIA4gC3Ax4CngATACcAACUnNzY0JyYiDwEGFB8BFjI3NjQnISc3NjQnJiIPAQYUHwEWMjc2NCcB87e3DQ0MIw3VDQ3VDSMMDQ0BK7e3DQ0MJAzVDQ3VDCQMDQ3zuLcMJAwNDdUNIwzWDAwNIwy4twwkDA0N1Q0jDNYMDA0jDAAAAgDiALcDHgKeABMAJwAAJTc2NC8BJiIHBhQfAQcGFBcWMjchNzY0LwEmIgcGFB8BBwYUFxYyNwJJ1Q0N1Q0jDA0Nt7cNDQwjDf7V1Q0N1QwkDA0Nt7cNDQwkDLfWDCMN1Q0NDCQMt7gMIw0MDNYMIw3VDQ0MJAy3uAwjDQwMAAADAFUAAAOrA1UAMwBoAHcAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMhMjY1NCYjISIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAAVYRGRkR/qoRGRkRA1UFBAUOCQkVDAsZDf2rDRkLDBUJCA4FBQUFBQUOCQgVDAsZDQJVDRkLDBUJCQ4FBAVVAgECBQMCBwQECAX9qwQJAwQHAwMFAQICAgIBBQMDBwQDCQQCVQUIBAQHAgMFAgEC/oAZEhEZGRESGQAAAAADAFUAAAOrA1UAMwBoAIkAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMzFRQWMzI2PQEzMjY1NCYrATU0JiMiBh0BIyIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAgBkSEhmAERkZEYAZEhIZgBEZGREDVQUEBQ4JCRUMCxkN/asNGQsMFQkIDgUFBQUFBQ4JCBUMCxkNAlUNGQsMFQkJDgUEBVUCAQIFAwIHBAQIBf2rBAkDBAcDAwUBAgICAgEFAwMHBAMJBAJVBQgEBAcCAwUCAQL+gIASGRkSgBkSERmAEhkZEoAZERIZAAABAOIAjQMeAskAIAAAExcHBhQXFjI/ARcWMjc2NC8BNzY0JyYiDwEnJiIHBhQX4uLiDQ0MJAzi4gwkDA0N4uINDQwkDOLiDCQMDQ0CjeLiDSMMDQ3h4Q0NDCMN4uIMIw0MDOLiDAwNIwwAAAABAAAAAQAAa5n0y18PPPUACwQAAAAAANivOVsAAAAA2K85WwAAAAADqwNVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAOrAAEAAAAAAAAAAAAAAAAAAAALBAAAAAAAAAAAAAAAAgAAAAQAAWIEAAFiBAAA4gQAAOIEAABVBAAAVQQAAOIAAAAAAAoAFAAeAEQAagCqAOoBngJkApoAAQAAAAsAigADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGZjaWNvbnMAZgBjAGkAYwBvAG4Ac1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGZjaWNvbnMAZgBjAGkAYwBvAG4Ac2ZjaWNvbnMAZgBjAGkAYwBvAG4Ac1JlZ3VsYXIAUgBlAGcAdQBsAGEAcmZjaWNvbnMAZgBjAGkAYwBvAG4Ac0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") format("truetype")}.fc-icon{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:fcicons!important;font-style:normal;font-variant:normal;font-weight:400;height:1em;line-height:1;text-align:center;text-transform:none;-moz-user-select:none;user-select:none;width:1em}.fc-icon-chevron-left:before{content:"\\e900"}.fc-icon-chevron-right:before{content:"\\e901"}.fc-icon-chevrons-left:before{content:"\\e902"}.fc-icon-chevrons-right:before{content:"\\e903"}.fc-icon-minus-square:before{content:"\\e904"}.fc-icon-plus-square:before{content:"\\e905"}.fc-icon-x:before{content:"\\e906"}.fc .fc-button{border-radius:0;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none}.fc .fc-button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.fc .fc-button{-webkit-appearance:button}.fc .fc-button:not(:disabled){cursor:pointer}.fc .fc-button{background-color:transparent;border:1px solid transparent;border-radius:.25em;display:inline-block;font-size:1em;font-weight:400;line-height:1.5;padding:.4em .65em;text-align:center;-moz-user-select:none;user-select:none;vertical-align:middle}.fc .fc-button:hover{text-decoration:none}.fc .fc-button:focus{box-shadow:0 0 0 .2rem rgba(44,62,80,.25);outline:0}.fc .fc-button:disabled{opacity:.65}.fc .fc-button-primary{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:hover{background-color:var(--fc-button-hover-bg-color);border-color:var(--fc-button-hover-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:disabled{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button-primary:not(:disabled).fc-button-active,.fc .fc-button-primary:not(:disabled):active{background-color:var(--fc-button-active-bg-color);border-color:var(--fc-button-active-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:not(:disabled).fc-button-active:focus,.fc .fc-button-primary:not(:disabled):active:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button .fc-icon{font-size:1.5em;vertical-align:middle}.fc .fc-button-group{display:inline-flex;position:relative;vertical-align:middle}.fc .fc-button-group>.fc-button{flex:1 1 auto;position:relative}.fc .fc-button-group>.fc-button.fc-button-active,.fc .fc-button-group>.fc-button:active,.fc .fc-button-group>.fc-button:focus,.fc .fc-button-group>.fc-button:hover{z-index:1}.fc-direction-ltr .fc-button-group>.fc-button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.fc-direction-ltr .fc-button-group>.fc-button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.fc-direction-rtl .fc-button-group>.fc-button:not(:first-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.fc-direction-rtl .fc-button-group>.fc-button:not(:last-child){border-bottom-left-radius:0;border-top-left-radius:0}.fc .fc-toolbar{align-items:center;display:flex;justify-content:space-between}.fc .fc-toolbar.fc-header-toolbar{margin-bottom:1.5em}.fc .fc-toolbar.fc-footer-toolbar{margin-top:1.5em}.fc .fc-toolbar-title{font-size:1.75em;margin:0}.fc-direction-ltr .fc-toolbar>*>:not(:first-child){margin-left:.75em}.fc-direction-rtl .fc-toolbar>*>:not(:first-child){margin-right:.75em}.fc-direction-rtl .fc-toolbar-ltr{flex-direction:row-reverse}.fc .fc-scroller{-webkit-overflow-scrolling:touch;position:relative}.fc .fc-scroller-liquid{height:100%}.fc .fc-scroller-liquid-absolute{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-scroller-harness{direction:ltr;overflow:hidden;position:relative}.fc .fc-scroller-harness-liquid{height:100%}.fc-direction-rtl .fc-scroller-harness>.fc-scroller{direction:rtl}.fc-theme-standard .fc-scrollgrid{border:1px solid var(--fc-border-color)}.fc .fc-scrollgrid,.fc .fc-scrollgrid table{table-layout:fixed;width:100%}.fc .fc-scrollgrid table{border-left-style:hidden;border-right-style:hidden;border-top-style:hidden}.fc .fc-scrollgrid{border-bottom-width:0;border-collapse:separate;border-right-width:0}.fc .fc-scrollgrid-liquid{height:100%}.fc .fc-scrollgrid-section,.fc .fc-scrollgrid-section table,.fc .fc-scrollgrid-section>td{height:1px}.fc .fc-scrollgrid-section-liquid>td{height:100%}.fc .fc-scrollgrid-section>*{border-left-width:0;border-top-width:0}.fc .fc-scrollgrid-section-footer>*,.fc .fc-scrollgrid-section-header>*{border-bottom-width:0}.fc .fc-scrollgrid-section-body table,.fc .fc-scrollgrid-section-footer table{border-bottom-style:hidden}.fc .fc-scrollgrid-section-sticky>*{background:var(--fc-page-bg-color);position:sticky;z-index:3}.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>*{top:0}.fc .fc-scrollgrid-section-footer.fc-scrollgrid-section-sticky>*{bottom:0}.fc .fc-scrollgrid-sticky-shim{height:1px;margin-bottom:-1px}.fc-sticky{position:sticky}.fc .fc-view-harness{flex-grow:1;position:relative}.fc .fc-view-harness-active>.fc-view{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-col-header-cell-cushion{display:inline-block;padding:2px 4px}.fc .fc-bg-event,.fc .fc-highlight,.fc .fc-non-business{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-non-business{background:var(--fc-non-business-color)}.fc .fc-bg-event{background:var(--fc-bg-event-color);opacity:var(--fc-bg-event-opacity)}.fc .fc-bg-event .fc-event-title{font-size:var(--fc-small-font-size);font-style:italic;margin:.5em}.fc .fc-highlight{background:var(--fc-highlight-color)}.fc .fc-cell-shaded,.fc .fc-day-disabled{background:var(--fc-neutral-bg-color)}a.fc-event,a.fc-event:hover{text-decoration:none}.fc-event.fc-event-draggable,.fc-event[href]{cursor:pointer}.fc-event .fc-event-main{position:relative;z-index:2}.fc-event-dragging:not(.fc-event-selected){opacity:.75}.fc-event-dragging.fc-event-selected{box-shadow:0 2px 7px rgba(0,0,0,.3)}.fc-event .fc-event-resizer{display:none;position:absolute;z-index:4}.fc-event-selected .fc-event-resizer,.fc-event:hover .fc-event-resizer{display:block}.fc-event-selected .fc-event-resizer{background:var(--fc-page-bg-color);border-color:inherit;border-radius:calc(var(--fc-event-resizer-dot-total-width)/2);border-style:solid;border-width:var(--fc-event-resizer-dot-border-width);height:var(--fc-event-resizer-dot-total-width);width:var(--fc-event-resizer-dot-total-width)}.fc-event-selected .fc-event-resizer:before{bottom:-20px;content:"";left:-20px;position:absolute;right:-20px;top:-20px}.fc-event-selected,.fc-event:focus{box-shadow:0 2px 5px rgba(0,0,0,.2)}.fc-event-selected:before,.fc-event:focus:before{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:3}.fc-event-selected:after,.fc-event:focus:after{background:var(--fc-event-selected-overlay-color);bottom:-1px;content:"";left:-1px;position:absolute;right:-1px;top:-1px;z-index:1}.fc-h-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-h-event .fc-event-main{color:var(--fc-event-text-color)}.fc-h-event .fc-event-main-frame{display:flex}.fc-h-event .fc-event-time{max-width:100%;overflow:hidden}.fc-h-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-width:0}.fc-h-event .fc-event-title{display:inline-block;left:0;max-width:100%;overflow:hidden;right:0;vertical-align:top}.fc-h-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-bottom-left-radius:0;border-left-width:0;border-top-left-radius:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.fc-h-event:not(.fc-event-selected) .fc-event-resizer{bottom:0;top:0;width:var(--fc-event-resizer-thickness)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end{cursor:w-resize;left:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start{cursor:e-resize;right:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-h-event.fc-event-selected .fc-event-resizer{margin-top:calc(var(--fc-event-resizer-dot-total-width)*-.5);top:50%}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-start,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-end{left:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-end,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-start{right:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc .fc-popover{box-shadow:0 2px 6px rgba(0,0,0,.15);position:absolute;z-index:9999}.fc .fc-popover-header{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:3px 4px}.fc .fc-popover-title{margin:0 2px}.fc .fc-popover-close{cursor:pointer;font-size:1.1em;opacity:.65}.fc-theme-standard .fc-popover{background:var(--fc-page-bg-color);border:1px solid var(--fc-border-color)}.fc-theme-standard .fc-popover-header{background:var(--fc-neutral-bg-color)}';wg(UG);class dx{constructor(e){this.drainedOption=e,this.isRunning=!1,this.isDirty=!1,this.pauseDepths={},this.timeoutId=0}request(e){this.isDirty=!0,this.isPaused()||(this.clearTimeout(),e==null?this.tryDrain():this.timeoutId=setTimeout(this.tryDrain.bind(this),e))}pause(e=""){let{pauseDepths:n}=this;n[e]=(n[e]||0)+1,this.clearTimeout()}resume(e="",n){let{pauseDepths:r}=this;e in r&&(n?delete r[e]:(r[e]-=1,r[e]<=0&&delete r[e]),this.tryDrain())}isPaused(){return Object.keys(this.pauseDepths).length}tryDrain(){if(!this.isRunning&&!this.isPaused()){for(this.isRunning=!0;this.isDirty;)this.isDirty=!1,this.drained();this.isRunning=!1}}clear(){this.clearTimeout(),this.isDirty=!1,this.pauseDepths={}}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=0)}drained(){this.drainedOption&&this.drainedOption()}}function ux(t){t.parentNode&&t.parentNode.removeChild(t)}function gi(t,e){if(t.closest)return t.closest(e);if(!document.documentElement.contains(t))return null;do{if(WG(t,e))return t;t=t.parentElement||t.parentNode}while(t!==null&&t.nodeType===1);return null}function WG(t,e){return(t.matches||t.matchesSelector||t.msMatchesSelector).call(t,e)}function qG(t,e){let n=t instanceof HTMLElement?[t]:t,r=[];for(let i=0;i<n.length;i+=1){let s=n[i].querySelectorAll(e);for(let a=0;a<s.length;a+=1)r.push(s[a])}return r}const GG=/(top|left|right|bottom|width|height)$/i;function rf(t,e){for(let n in e)GA(t,n,e[n])}function GA(t,e,n){n==null?t.style[e]="":typeof n=="number"&&GG.test(e)?t.style[e]=`${n}px`:t.style[e]=n}function YA(t){var e,n;return(n=(e=t.composedPath)===null||e===void 0?void 0:e.call(t)[0])!==null&&n!==void 0?n:t.target}let ZA=0;function nl(){return ZA+=1,"fc-dom-"+ZA}function kg(t){t.preventDefault()}function YG(t,e){return n=>{let r=gi(n.target,t);r&&e.call(r,n,r)}}function XA(t,e,n,r){let i=YG(n,r);return t.addEventListener(e,i),()=>{t.removeEventListener(e,i)}}function ZG(t,e,n,r){let i;return XA(t,"mouseover",e,(s,a)=>{if(a!==i){i=a,n(s,a);let o=p=>{i=null,r(p,a),a.removeEventListener("mouseleave",o)};a.addEventListener("mouseleave",o)}})}const KA=["webkitTransitionEnd","otransitionend","oTransitionEnd","msTransitionEnd","transitionend"];function XG(t,e){let n=r=>{e(r),KA.forEach(i=>{t.removeEventListener(i,n)})};KA.forEach(r=>{t.addEventListener(r,n)})}function JA(t){return Object.assign({onClick:t},QA(t))}function QA(t){return{tabIndex:0,onKeyDown(e){(e.key==="Enter"||e.key===" ")&&(t(e),e.preventDefault())}}}let eM=0;function _c(){return eM+=1,String(eM)}function hx(){document.body.classList.add("fc-not-allowed")}function fx(){document.body.classList.remove("fc-not-allowed")}function KG(t){t.style.userSelect="none",t.style.webkitUserSelect="none",t.addEventListener("selectstart",kg)}function JG(t){t.style.userSelect="",t.style.webkitUserSelect="",t.removeEventListener("selectstart",kg)}function QG(t){t.addEventListener("contextmenu",kg)}function eY(t){t.removeEventListener("contextmenu",kg)}function tY(t){let e=[],n=[],r,i;for(typeof t=="string"?n=t.split(/\s*,\s*/):typeof t=="function"?n=[t]:Array.isArray(t)&&(n=t),r=0;r<n.length;r+=1)i=n[r],typeof i=="string"?e.push(i.charAt(0)==="-"?{field:i.substring(1),order:-1}:{field:i,order:1}):typeof i=="function"&&e.push({func:i});return e}function nY(t,e,n){let r,i;for(r=0;r<n.length;r+=1)if(i=rY(t,e,n[r]),i)return i;return 0}function rY(t,e,n){return n.func?n.func(t,e):iY(t[n.field],e[n.field])*(n.order||1)}function iY(t,e){return!t&&!e?0:e==null?-1:t==null?1:typeof t=="string"||typeof e=="string"?String(t).localeCompare(String(e)):t-e}function Gd(t,e){let n=String(t);return"000".substr(0,e-n.length)+n}function sf(t,e,n){return typeof t=="function"?t(...e):typeof t=="string"?e.reduce((r,i,s)=>r.replace("$"+s,i||""),t):n}function sY(t,e){return t-e}function Eg(t){return t%1===0}function oY(t){let e=t.querySelector(".fc-scrollgrid-shrink-frame"),n=t.querySelector(".fc-scrollgrid-shrink-cushion");if(!e)throw new Error("needs fc-scrollgrid-shrink-frame className");if(!n)throw new Error("needs fc-scrollgrid-shrink-cushion className");return t.getBoundingClientRect().width-e.getBoundingClientRect().width+n.getBoundingClientRect().width}const tM=["years","months","days","milliseconds"],aY=/^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/;function gn(t,e){return typeof t=="string"?lY(t):typeof t=="object"&&t?nM(t):typeof t=="number"?nM({[e||"milliseconds"]:t}):null}function lY(t){let e=aY.exec(t);if(e){let n=e[1]?-1:1;return{years:0,months:0,days:n*(e[2]?parseInt(e[2],10):0),milliseconds:n*((e[3]?parseInt(e[3],10):0)*60*60*1e3+(e[4]?parseInt(e[4],10):0)*60*1e3+(e[5]?parseInt(e[5],10):0)*1e3+(e[6]?parseInt(e[6],10):0))}}return null}function nM(t){let e={years:t.years||t.year||0,months:t.months||t.month||0,days:t.days||t.day||0,milliseconds:(t.hours||t.hour||0)*60*60*1e3+(t.minutes||t.minute||0)*60*1e3+(t.seconds||t.second||0)*1e3+(t.milliseconds||t.millisecond||t.ms||0)},n=t.weeks||t.week;return n&&(e.days+=n*7,e.specifiedWeeks=!0),e}function cY(t,e){return t.years===e.years&&t.months===e.months&&t.days===e.days&&t.milliseconds===e.milliseconds}function px(t,e){return{years:t.years+e.years,months:t.months+e.months,days:t.days+e.days,milliseconds:t.milliseconds+e.milliseconds}}function dY(t,e){return{years:t.years-e.years,months:t.months-e.months,days:t.days-e.days,milliseconds:t.milliseconds-e.milliseconds}}function uY(t,e){return{years:t.years*e,months:t.months*e,days:t.days*e,milliseconds:t.milliseconds*e}}function hY(t){return Yd(t)/365}function fY(t){return Yd(t)/30}function Yd(t){return lo(t)/864e5}function lo(t){return t.years*(365*864e5)+t.months*(30*864e5)+t.days*864e5+t.milliseconds}function mx(t,e){let n=null;for(let r=0;r<tM.length;r+=1){let i=tM[r];if(e[i]){let s=t[i]/e[i];if(!Eg(s)||n!==null&&n!==s)return null;n=s}else if(t[i])return null}return n}function gx(t){let e=t.milliseconds;if(e){if(e%1e3!==0)return{unit:"millisecond",value:e};if(e%(1e3*60)!==0)return{unit:"second",value:e/1e3};if(e%(1e3*60*60)!==0)return{unit:"minute",value:e/(1e3*60)};if(e)return{unit:"hour",value:e/(1e3*60*60)}}return t.days?t.specifiedWeeks&&t.days%7===0?{unit:"week",value:t.days/7}:{unit:"day",value:t.days}:t.months?{unit:"month",value:t.months}:t.years?{unit:"year",value:t.years}:{unit:"millisecond",value:0}}function rl(t,e,n){if(t===e)return!0;let r=t.length,i;if(r!==e.length)return!1;for(i=0;i<r;i+=1)if(!(n?n(t[i],e[i]):t[i]===e[i]))return!1;return!0}const pY=["sun","mon","tue","wed","thu","fri","sat"];function rM(t,e){let n=ol(t);return n[2]+=e*7,Qi(n)}function Ur(t,e){let n=ol(t);return n[2]+=e,Qi(n)}function il(t,e){let n=ol(t);return n[6]+=e,Qi(n)}function mY(t,e){return sl(t,e)/7}function sl(t,e){return(e.valueOf()-t.valueOf())/(1e3*60*60*24)}function gY(t,e){return(e.valueOf()-t.valueOf())/(1e3*60*60)}function yY(t,e){return(e.valueOf()-t.valueOf())/(1e3*60)}function bY(t,e){return(e.valueOf()-t.valueOf())/1e3}function _Y(t,e){let n=er(t),r=er(e);return{years:0,months:0,days:Math.round(sl(n,r)),milliseconds:e.valueOf()-r.valueOf()-(t.valueOf()-n.valueOf())}}function xY(t,e){let n=Sg(t,e);return n!==null&&n%7===0?n/7:null}function Sg(t,e){return al(t)===al(e)?Math.round(sl(t,e)):null}function er(t){return Qi([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()])}function vY(t){return Qi([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()])}function wY(t){return Qi([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes()])}function kY(t){return Qi([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()])}function EY(t,e,n){let r=t.getUTCFullYear(),i=yx(t,r,e,n);if(i<1)return yx(t,r-1,e,n);let s=yx(t,r+1,e,n);return s>=1?Math.min(i,s):i}function yx(t,e,n,r){let i=Qi([e,0,1+SY(e,n,r)]),s=er(t),a=Math.round(sl(i,s));return Math.floor(a/7)+1}function SY(t,e,n){let r=7+e-n;return-((7+Qi([t,0,r]).getUTCDay()-e)%7)+r-1}function iM(t){return[t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()]}function sM(t){return new Date(t[0],t[1]||0,t[2]==null?1:t[2],t[3]||0,t[4]||0,t[5]||0)}function ol(t){return[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()]}function Qi(t){return t.length===1&&(t=t.concat([0])),new Date(Date.UTC(...t))}function oM(t){return!isNaN(t.valueOf())}function al(t){return t.getUTCHours()*1e3*60*60+t.getUTCMinutes()*1e3*60+t.getUTCSeconds()*1e3+t.getUTCMilliseconds()}function aM(t,e,n=!1){let r=t.toISOString();return r=r.replace(".000",""),n&&(r=r.replace("T00:00:00Z","")),r.length>10&&(e==null?r=r.replace("Z",""):e!==0&&(r=r.replace("Z",bx(e,!0)))),r}function of(t){return t.toISOString().replace(/T.*$/,"")}function CY(t){return t.toISOString().match(/^\d{4}-\d{2}/)[0]}function TY(t){return Gd(t.getUTCHours(),2)+":"+Gd(t.getUTCMinutes(),2)+":"+Gd(t.getUTCSeconds(),2)}function bx(t,e=!1){let n=t<0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),s=Math.round(r%60);return e?`${n+Gd(i,2)}:${Gd(s,2)}`:`GMT${n}${i}${s?`:${Gd(s,2)}`:""}`}function Ft(t,e,n){let r,i;return function(...s){if(!r)i=t.apply(this,s);else if(!rl(r,s)){let a=t.apply(this,s);(!e||!e(a,i))&&(i=a)}return r=s,i}}function Cg(t,e,n){let r,i;return s=>(r?Po(r,s)||(i=t.call(this,s)):i=t.call(this,s),r=s,i)}const lM={week:3,separator:0,omitZeroMinute:0,meridiem:0,omitCommas:0},Tg={timeZoneName:7,era:6,year:5,month:4,day:2,weekday:2,hour:1,minute:1,second:1},Ag=/\s*([ap])\.?m\.?/i,AY=/,/g,MY=/\s+/g,DY=/\u200e/g,IY=/UTC|GMT/;class PY{constructor(e){let n={},r={},i=0;for(let s in e)s in lM?(r[s]=e[s],i=Math.max(lM[s],i)):(n[s]=e[s],s in Tg&&(i=Math.max(Tg[s],i)));this.standardDateProps=n,this.extendedSettings=r,this.severity=i,this.buildFormattingFunc=Ft(cM)}format(e,n){return this.buildFormattingFunc(this.standardDateProps,this.extendedSettings,n)(e)}formatRange(e,n,r,i){let{standardDateProps:s,extendedSettings:a}=this,o=LY(e.marker,n.marker,r.calendarSystem);if(!o)return this.format(e,r);let p=o;p>1&&(s.year==="numeric"||s.year==="2-digit")&&(s.month==="numeric"||s.month==="2-digit")&&(s.day==="numeric"||s.day==="2-digit")&&(p=1);let g=this.format(e,r),y=this.format(n,r);if(g===y)return g;let v=VY(s,p),E=cM(v,a,r),T=E(e),D=E(n),N=FY(g,T,y,D),B=a.separator||i||r.defaultSeparator||"";return N?N.before+T+B+D+N.after:g+B+y}getLargestUnit(){switch(this.severity){case 7:case 6:case 5:return"year";case 4:return"month";case 3:return"week";case 2:return"day";default:return"time"}}}function cM(t,e,n){let r=Object.keys(t).length;return r===1&&t.timeZoneName==="short"?i=>bx(i.timeZoneOffset):r===0&&e.week?i=>zY(n.computeWeekNumber(i.marker),n.weekText,n.weekTextLong,n.locale,e.week):RY(t,e,n)}function RY(t,e,n){t=Object.assign({},t),e=Object.assign({},e),OY(t,e),t.timeZone="UTC";let r=new Intl.DateTimeFormat(n.locale.codes,t),i;if(e.omitZeroMinute){let s=Object.assign({},t);delete s.minute,i=new Intl.DateTimeFormat(n.locale.codes,s)}return s=>{let{marker:a}=s,o;i&&!a.getUTCMinutes()?o=i:o=r;let p=o.format(a);return NY(p,s,t,e,n)}}function OY(t,e){t.timeZoneName&&(t.hour||(t.hour="2-digit"),t.minute||(t.minute="2-digit")),t.timeZoneName==="long"&&(t.timeZoneName="short"),e.omitZeroMinute&&(t.second||t.millisecond)&&delete e.omitZeroMinute}function NY(t,e,n,r,i){return t=t.replace(DY,""),n.timeZoneName==="short"&&(t=BY(t,i.timeZone==="UTC"||e.timeZoneOffset==null?"UTC":bx(e.timeZoneOffset))),r.omitCommas&&(t=t.replace(AY,"").trim()),r.omitZeroMinute&&(t=t.replace(":00","")),r.meridiem===!1?t=t.replace(Ag,"").trim():r.meridiem==="narrow"?t=t.replace(Ag,(s,a)=>a.toLocaleLowerCase()):r.meridiem==="short"?t=t.replace(Ag,(s,a)=>`${a.toLocaleLowerCase()}m`):r.meridiem==="lowercase"&&(t=t.replace(Ag,s=>s.toLocaleLowerCase())),t=t.replace(MY," "),t=t.trim(),t}function BY(t,e){let n=!1;return t=t.replace(IY,()=>(n=!0,e)),n||(t+=` ${e}`),t}function zY(t,e,n,r,i){let s=[];return i==="long"?s.push(n):(i==="short"||i==="narrow")&&s.push(e),(i==="long"||i==="short")&&s.push(" "),s.push(r.simpleNumberFormat.format(t)),r.options.direction==="rtl"&&s.reverse(),s.join("")}function LY(t,e,n){return n.getMarkerYear(t)!==n.getMarkerYear(e)?5:n.getMarkerMonth(t)!==n.getMarkerMonth(e)?4:n.getMarkerDay(t)!==n.getMarkerDay(e)?2:al(t)!==al(e)?1:0}function VY(t,e){let n={};for(let r in t)(!(r in Tg)||Tg[r]<=e)&&(n[r]=t[r]);return n}function FY(t,e,n,r){let i=0;for(;i<t.length;){let s=t.indexOf(e,i);if(s===-1)break;let a=t.substr(0,s);i=s+e.length;let o=t.substr(i),p=0;for(;p<n.length;){let g=n.indexOf(r,p);if(g===-1)break;let y=n.substr(0,g);p=g+r.length;let v=n.substr(p);if(a===y&&o===v)return{before:a,after:o}}}return null}function dM(t,e){let n=e.markerToArray(t.marker);return{marker:t.marker,timeZoneOffset:t.timeZoneOffset,array:n,year:n[0],month:n[1],day:n[2],hour:n[3],minute:n[4],second:n[5],millisecond:n[6]}}function Mg(t,e,n,r){let i=dM(t,n.calendarSystem),s=e?dM(e,n.calendarSystem):null;return{date:i,start:i,end:s,timeZone:n.timeZone,localeCodes:n.locale.codes,defaultSeparator:r||n.defaultSeparator}}class $Y{constructor(e){this.cmdStr=e}format(e,n,r){return n.cmdFormatter(this.cmdStr,Mg(e,null,n,r))}formatRange(e,n,r,i){return r.cmdFormatter(this.cmdStr,Mg(e,n,r,i))}}class jY{constructor(e){this.func=e}format(e,n,r){return this.func(Mg(e,null,n,r))}formatRange(e,n,r,i){return this.func(Mg(e,n,r,i))}}function ir(t){return typeof t=="object"&&t?new PY(t):typeof t=="string"?new $Y(t):typeof t=="function"?new jY(t):null}const uM={navLinkDayClick:De,navLinkWeekClick:De,duration:gn,bootstrapFontAwesome:De,buttonIcons:De,customButtons:De,defaultAllDayEventDuration:gn,defaultTimedEventDuration:gn,nextDayThreshold:gn,scrollTime:gn,scrollTimeReset:Boolean,slotMinTime:gn,slotMaxTime:gn,dayPopoverFormat:ir,slotDuration:gn,snapDuration:gn,headerToolbar:De,footerToolbar:De,defaultRangeSeparator:String,titleRangeSeparator:String,forceEventDuration:Boolean,dayHeaders:Boolean,dayHeaderFormat:ir,dayHeaderClassNames:De,dayHeaderContent:De,dayHeaderDidMount:De,dayHeaderWillUnmount:De,dayCellClassNames:De,dayCellContent:De,dayCellDidMount:De,dayCellWillUnmount:De,initialView:String,aspectRatio:Number,weekends:Boolean,weekNumberCalculation:De,weekNumbers:Boolean,weekNumberClassNames:De,weekNumberContent:De,weekNumberDidMount:De,weekNumberWillUnmount:De,editable:Boolean,viewClassNames:De,viewDidMount:De,viewWillUnmount:De,nowIndicator:Boolean,nowIndicatorClassNames:De,nowIndicatorContent:De,nowIndicatorDidMount:De,nowIndicatorWillUnmount:De,showNonCurrentDates:Boolean,lazyFetching:Boolean,startParam:String,endParam:String,timeZoneParam:String,timeZone:String,locales:De,locale:De,themeSystem:String,dragRevertDuration:Number,dragScroll:Boolean,allDayMaintainDuration:Boolean,unselectAuto:Boolean,dropAccept:De,eventOrder:tY,eventOrderStrict:Boolean,handleWindowResize:Boolean,windowResizeDelay:Number,longPressDelay:Number,eventDragMinDistance:Number,expandRows:Boolean,height:De,contentHeight:De,direction:String,weekNumberFormat:ir,eventResizableFromStart:Boolean,displayEventTime:Boolean,displayEventEnd:Boolean,weekText:String,weekTextLong:String,progressiveEventRendering:Boolean,businessHours:De,initialDate:De,now:De,eventDataTransform:De,stickyHeaderDates:De,stickyFooterScrollbar:De,viewHeight:De,defaultAllDay:Boolean,eventSourceFailure:De,eventSourceSuccess:De,eventDisplay:String,eventStartEditable:Boolean,eventDurationEditable:Boolean,eventOverlap:De,eventConstraint:De,eventAllow:De,eventBackgroundColor:String,eventBorderColor:String,eventTextColor:String,eventColor:String,eventClassNames:De,eventContent:De,eventDidMount:De,eventWillUnmount:De,selectConstraint:De,selectOverlap:De,selectAllow:De,droppable:Boolean,unselectCancel:String,slotLabelFormat:De,slotLaneClassNames:De,slotLaneContent:De,slotLaneDidMount:De,slotLaneWillUnmount:De,slotLabelClassNames:De,slotLabelContent:De,slotLabelDidMount:De,slotLabelWillUnmount:De,dayMaxEvents:De,dayMaxEventRows:De,dayMinWidth:Number,slotLabelInterval:gn,allDayText:String,allDayClassNames:De,allDayContent:De,allDayDidMount:De,allDayWillUnmount:De,slotMinWidth:Number,navLinks:Boolean,eventTimeFormat:ir,rerenderDelay:Number,moreLinkText:De,moreLinkHint:De,selectMinDistance:Number,selectable:Boolean,selectLongPressDelay:Number,eventLongPressDelay:Number,selectMirror:Boolean,eventMaxStack:Number,eventMinHeight:Number,eventMinWidth:Number,eventShortHeight:Number,slotEventOverlap:Boolean,plugins:De,firstDay:Number,dayCount:Number,dateAlignment:String,dateIncrement:gn,hiddenDays:De,fixedWeekCount:Boolean,validRange:De,visibleRange:De,titleFormat:De,eventInteractive:Boolean,noEventsText:String,viewHint:De,navLinkHint:De,closeHint:String,timeHint:String,eventHint:String,moreLinkClick:De,moreLinkClassNames:De,moreLinkContent:De,moreLinkDidMount:De,moreLinkWillUnmount:De,monthStartFormat:ir,handleCustomRendering:De,customRenderingMetaMap:De,customRenderingReplaces:Boolean},af={eventDisplay:"auto",defaultRangeSeparator:" - ",titleRangeSeparator:" – ",defaultTimedEventDuration:"01:00:00",defaultAllDayEventDuration:{day:1},forceEventDuration:!1,nextDayThreshold:"00:00:00",dayHeaders:!0,initialView:"",aspectRatio:1.35,headerToolbar:{start:"title",center:"",end:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"local",editable:!1,nowIndicator:!1,scrollTime:"06:00:00",scrollTimeReset:!0,slotMinTime:"00:00:00",slotMaxTime:"24:00:00",showNonCurrentDates:!0,lazyFetching:!0,startParam:"start",endParam:"end",timeZoneParam:"timeZone",timeZone:"local",locales:[],locale:"",themeSystem:"standard",dragRevertDuration:500,dragScroll:!0,allDayMaintainDuration:!1,unselectAuto:!0,dropAccept:"*",eventOrder:"start,-duration,allDay,title",dayPopoverFormat:{month:"long",day:"numeric",year:"numeric"},handleWindowResize:!0,windowResizeDelay:100,longPressDelay:1e3,eventDragMinDistance:5,expandRows:!1,navLinks:!1,selectable:!1,eventMinHeight:15,eventMinWidth:30,eventShortHeight:30,monthStartFormat:{month:"long",day:"numeric"}},hM={datesSet:De,eventsSet:De,eventAdd:De,eventChange:De,eventRemove:De,windowResize:De,eventClick:De,eventMouseEnter:De,eventMouseLeave:De,select:De,unselect:De,loading:De,_unmount:De,_beforeprint:De,_afterprint:De,_noEventDrop:De,_noEventResize:De,_resize:De,_scrollRequest:De},fM={buttonText:De,buttonHints:De,views:De,plugins:De,initialEvents:De,events:De,eventSources:De},xc={headerToolbar:vc,footerToolbar:vc,buttonText:vc,buttonHints:vc,buttonIcons:vc,dateIncrement:vc,plugins:Dg,events:Dg,eventSources:Dg,resources:Dg};function vc(t,e){return typeof t=="object"&&typeof e=="object"&&t&&e?Po(t,e):t===e}function Dg(t,e){return Array.isArray(t)&&Array.isArray(e)?rl(t,e):t===e}const HY={type:String,component:De,buttonText:String,buttonTextKey:String,dateProfileGeneratorClass:De,usesMinMaxTime:Boolean,classNames:De,content:De,didMount:De,willUnmount:De};function _x(t){return vx(t,xc)}function xx(t,e){let n={},r={};for(let i in e)i in t&&(n[i]=e[i](t[i]));for(let i in t)i in e||(r[i]=t[i]);return{refined:n,extra:r}}function De(t){return t}const{hasOwnProperty:Ig}=Object.prototype;function vx(t,e){let n={};if(e){for(let r in e)if(e[r]===vc){let i=[];for(let s=t.length-1;s>=0;s-=1){let a=t[s][r];if(typeof a=="object"&&a)i.unshift(a);else if(a!==void 0){n[r]=a;break}}i.length&&(n[r]=vx(i))}}for(let r=t.length-1;r>=0;r-=1){let i=t[r];for(let s in i)s in n||(n[s]=i[s])}return n}function wc(t,e){let n={};for(let r in t)e(t[r],r)&&(n[r]=t[r]);return n}function la(t,e){let n={};for(let r in t)n[r]=e(t[r],r);return n}function pM(t){let e={};for(let n of t)e[n]=!0;return e}function wx(t){let e=[];for(let n in t)e.push(t[n]);return e}function Po(t,e){if(t===e)return!0;for(let n in t)if(Ig.call(t,n)&&!(n in e))return!1;for(let n in e)if(Ig.call(e,n)&&t[n]!==e[n])return!1;return!0}const UY=/^on[A-Z]/;function WY(t,e){const n=kx(t,e);for(let r of n)if(!UY.test(r))return!1;return!0}function kx(t,e){let n=[];for(let r in t)Ig.call(t,r)&&(r in e||n.push(r));for(let r in e)Ig.call(e,r)&&t[r]!==e[r]&&n.push(r);return n}function Ex(t,e,n={}){if(t===e)return!0;for(let r in e)if(!(r in t&&qY(t[r],e[r],n[r])))return!1;for(let r in t)if(!(r in e))return!1;return!0}function qY(t,e,n){return t===e||n===!0?!0:n?n(t,e):!1}function GY(t,e=0,n,r=1){let i=[];n==null&&(n=Object.keys(t).length);for(let s=e;s<n;s+=r){let a=t[s];a!==void 0&&i.push(a)}return i}let mM={};function YY(t,e){mM[t]=e}function ZY(t){return new mM[t]}class XY{getMarkerYear(e){return e.getUTCFullYear()}getMarkerMonth(e){return e.getUTCMonth()}getMarkerDay(e){return e.getUTCDate()}arrayToMarker(e){return Qi(e)}markerToArray(e){return ol(e)}}YY("gregory",XY);const KY=/^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/;function JY(t){let e=KY.exec(t);if(e){let n=new Date(Date.UTC(Number(e[1]),e[3]?Number(e[3])-1:0,Number(e[5]||1),Number(e[7]||0),Number(e[8]||0),Number(e[10]||0),e[12]?+`0.${e[12]}`*1e3:0));if(oM(n)){let r=null;return e[13]&&(r=(e[15]==="-"?-1:1)*(Number(e[16]||0)*60+Number(e[18]||0))),{marker:n,isTimeUnspecified:!e[6],timeZoneOffset:r}}}return null}class QY{constructor(e){let n=this.timeZone=e.timeZone,r=n!=="local"&&n!=="UTC";e.namedTimeZoneImpl&&r&&(this.namedTimeZoneImpl=new e.namedTimeZoneImpl(n)),this.canComputeOffset=!!(!r||this.namedTimeZoneImpl),this.calendarSystem=ZY(e.calendarSystem),this.locale=e.locale,this.weekDow=e.locale.week.dow,this.weekDoy=e.locale.week.doy,e.weekNumberCalculation==="ISO"&&(this.weekDow=1,this.weekDoy=4),typeof e.firstDay=="number"&&(this.weekDow=e.firstDay),typeof e.weekNumberCalculation=="function"&&(this.weekNumberFunc=e.weekNumberCalculation),this.weekText=e.weekText!=null?e.weekText:e.locale.options.weekText,this.weekTextLong=(e.weekTextLong!=null?e.weekTextLong:e.locale.options.weekTextLong)||this.weekText,this.cmdFormatter=e.cmdFormatter,this.defaultSeparator=e.defaultSeparator}createMarker(e){let n=this.createMarkerMeta(e);return n===null?null:n.marker}createNowMarker(){return this.canComputeOffset?this.timestampToMarker(new Date().valueOf()):Qi(iM(new Date))}createMarkerMeta(e){if(typeof e=="string")return this.parse(e);let n=null;return typeof e=="number"?n=this.timestampToMarker(e):e instanceof Date?(e=e.valueOf(),isNaN(e)||(n=this.timestampToMarker(e))):Array.isArray(e)&&(n=Qi(e)),n===null||!oM(n)?null:{marker:n,isTimeUnspecified:!1,forcedTzo:null}}parse(e){let n=JY(e);if(n===null)return null;let{marker:r}=n,i=null;return n.timeZoneOffset!==null&&(this.canComputeOffset?r=this.timestampToMarker(r.valueOf()-n.timeZoneOffset*60*1e3):i=n.timeZoneOffset),{marker:r,isTimeUnspecified:n.isTimeUnspecified,forcedTzo:i}}getYear(e){return this.calendarSystem.getMarkerYear(e)}getMonth(e){return this.calendarSystem.getMarkerMonth(e)}getDay(e){return this.calendarSystem.getMarkerDay(e)}add(e,n){let r=this.calendarSystem.markerToArray(e);return r[0]+=n.years,r[1]+=n.months,r[2]+=n.days,r[6]+=n.milliseconds,this.calendarSystem.arrayToMarker(r)}subtract(e,n){let r=this.calendarSystem.markerToArray(e);return r[0]-=n.years,r[1]-=n.months,r[2]-=n.days,r[6]-=n.milliseconds,this.calendarSystem.arrayToMarker(r)}addYears(e,n){let r=this.calendarSystem.markerToArray(e);return r[0]+=n,this.calendarSystem.arrayToMarker(r)}addMonths(e,n){let r=this.calendarSystem.markerToArray(e);return r[1]+=n,this.calendarSystem.arrayToMarker(r)}diffWholeYears(e,n){let{calendarSystem:r}=this;return al(e)===al(n)&&r.getMarkerDay(e)===r.getMarkerDay(n)&&r.getMarkerMonth(e)===r.getMarkerMonth(n)?r.getMarkerYear(n)-r.getMarkerYear(e):null}diffWholeMonths(e,n){let{calendarSystem:r}=this;return al(e)===al(n)&&r.getMarkerDay(e)===r.getMarkerDay(n)?r.getMarkerMonth(n)-r.getMarkerMonth(e)+(r.getMarkerYear(n)-r.getMarkerYear(e))*12:null}greatestWholeUnit(e,n){let r=this.diffWholeYears(e,n);return r!==null?{unit:"year",value:r}:(r=this.diffWholeMonths(e,n),r!==null?{unit:"month",value:r}:(r=xY(e,n),r!==null?{unit:"week",value:r}:(r=Sg(e,n),r!==null?{unit:"day",value:r}:(r=gY(e,n),Eg(r)?{unit:"hour",value:r}:(r=yY(e,n),Eg(r)?{unit:"minute",value:r}:(r=bY(e,n),Eg(r)?{unit:"second",value:r}:{unit:"millisecond",value:n.valueOf()-e.valueOf()}))))))}countDurationsBetween(e,n,r){let i;return r.years&&(i=this.diffWholeYears(e,n),i!==null)?i/hY(r):r.months&&(i=this.diffWholeMonths(e,n),i!==null)?i/fY(r):r.days&&(i=Sg(e,n),i!==null)?i/Yd(r):(n.valueOf()-e.valueOf())/lo(r)}startOf(e,n){return n==="year"?this.startOfYear(e):n==="month"?this.startOfMonth(e):n==="week"?this.startOfWeek(e):n==="day"?er(e):n==="hour"?vY(e):n==="minute"?wY(e):n==="second"?kY(e):null}startOfYear(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e)])}startOfMonth(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e)])}startOfWeek(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e),e.getUTCDate()-(e.getUTCDay()-this.weekDow+7)%7])}computeWeekNumber(e){return this.weekNumberFunc?this.weekNumberFunc(this.toDate(e)):EY(e,this.weekDow,this.weekDoy)}format(e,n,r={}){return n.format({marker:e,timeZoneOffset:r.forcedTzo!=null?r.forcedTzo:this.offsetForMarker(e)},this)}formatRange(e,n,r,i={}){return i.isEndExclusive&&(n=il(n,-1)),r.formatRange({marker:e,timeZoneOffset:i.forcedStartTzo!=null?i.forcedStartTzo:this.offsetForMarker(e)},{marker:n,timeZoneOffset:i.forcedEndTzo!=null?i.forcedEndTzo:this.offsetForMarker(n)},this,i.defaultSeparator)}formatIso(e,n={}){let r=null;return n.omitTimeZoneOffset||(n.forcedTzo!=null?r=n.forcedTzo:r=this.offsetForMarker(e)),aM(e,r,n.omitTime)}timestampToMarker(e){return this.timeZone==="local"?Qi(iM(new Date(e))):this.timeZone==="UTC"||!this.namedTimeZoneImpl?new Date(e):Qi(this.namedTimeZoneImpl.timestampToArray(e))}offsetForMarker(e){return this.timeZone==="local"?-sM(ol(e)).getTimezoneOffset():this.timeZone==="UTC"?0:this.namedTimeZoneImpl?this.namedTimeZoneImpl.offsetForArray(ol(e)):null}toDate(e,n){return this.timeZone==="local"?sM(ol(e)):this.timeZone==="UTC"?new Date(e.valueOf()):this.namedTimeZoneImpl?new Date(e.valueOf()-this.namedTimeZoneImpl.offsetForArray(ol(e))*1e3*60):new Date(e.valueOf()-(n||0))}}class lf{constructor(e){this.iconOverrideOption&&this.setIconOverride(e[this.iconOverrideOption])}setIconOverride(e){let n,r;if(typeof e=="object"&&e){n=Object.assign({},this.iconClasses);for(r in e)n[r]=this.applyIconOverridePrefix(e[r]);this.iconClasses=n}else e===!1&&(this.iconClasses={})}applyIconOverridePrefix(e){let n=this.iconOverridePrefix;return n&&e.indexOf(n)!==0&&(e=n+e),e}getClass(e){return this.classes[e]||""}getIconClass(e,n){let r;return n&&this.rtlIconClasses?r=this.rtlIconClasses[e]||this.iconClasses[e]:r=this.iconClasses[e],r?`${this.baseIconClass} ${r}`:""}getCustomButtonIconClass(e){let n;return this.iconOverrideCustomButtonOption&&(n=e[this.iconOverrideCustomButtonOption],n)?`${this.baseIconClass} ${this.applyIconOverridePrefix(n)}`:""}}lf.prototype.classes={},lf.prototype.iconClasses={},lf.prototype.baseIconClass="",lf.prototype.iconOverridePrefix="";function Pg(t){t();let e=Vt.debounceRendering,n=[];function r(i){n.push(i)}for(Vt.debounceRendering=r,nf(ce(eZ,{}),document.createElement("div"));n.length;)n.shift()();Vt.debounceRendering=e}class eZ extends gs{render(){return ce("div",{})}componentDidMount(){this.setState({})}}function gM(t){let e=SG(t),n=e.Provider;return e.Provider=function(){let r=!this.getChildContext,i=n.apply(this,arguments);if(r){let s=[];this.shouldComponentUpdate=a=>{this.props.value!==a.value&&s.forEach(o=>{o.context=a.value,o.forceUpdate()})},this.sub=a=>{s.push(a);let o=a.componentWillUnmount;a.componentWillUnmount=()=>{s.splice(s.indexOf(a),1),o&&o.call(a)}}}return i},e}class tZ{constructor(e,n,r,i){this.execFunc=e,this.emitter=n,this.scrollTime=r,this.scrollTimeReset=i,this.handleScrollRequest=s=>{this.queuedRequest=Object.assign({},this.queuedRequest||{},s),this.drain()},n.on("_scrollRequest",this.handleScrollRequest),this.fireInitialScroll()}detach(){this.emitter.off("_scrollRequest",this.handleScrollRequest)}update(e){e&&this.scrollTimeReset?this.fireInitialScroll():this.drain()}fireInitialScroll(){this.handleScrollRequest({time:this.scrollTime})}drain(){this.queuedRequest&&this.execFunc(this.queuedRequest)&&(this.queuedRequest=null)}}const ca=gM({});function nZ(t,e,n,r,i,s,a,o,p,g,y,v,E){return{dateEnv:i,options:n,pluginHooks:a,emitter:g,dispatch:o,getCurrentData:p,calendarApi:y,viewSpec:t,viewApi:e,dateProfileGenerator:r,theme:s,isRtl:n.direction==="rtl",addResizeHandler(T){g.on("_resize",T)},removeResizeHandler(T){g.off("_resize",T)},createScrollResponder(T){return new tZ(T,g,gn(n.scrollTime),n.scrollTimeReset)},registerInteractiveComponent:v,unregisterInteractiveComponent:E}}class kc extends gs{shouldComponentUpdate(e,n){return this.debug&&console.log(kx(e,this.props),kx(n,this.state)),!Ex(this.props,e,this.propEquality)||!Ex(this.state,n,this.stateEquality)}safeSetState(e){Ex(this.state,Object.assign(Object.assign({},this.state),e),this.stateEquality)||this.setState(e)}}kc.addPropsEquality=rZ,kc.addStateEquality=iZ,kc.contextType=ca,kc.prototype.propEquality={},kc.prototype.stateEquality={};class Tn extends kc{}Tn.contextType=ca;function rZ(t){let e=Object.create(this.prototype.propEquality);Object.assign(e,t),this.prototype.propEquality=e}function iZ(t){let e=Object.create(this.prototype.stateEquality);Object.assign(e,t),this.prototype.stateEquality=e}function da(t,e){typeof t=="function"?t(e):t&&(t.current=e)}class Sx extends Tn{constructor(){super(...arguments),this.id=_c(),this.queuedDomNodes=[],this.currentDomNodes=[],this.handleEl=e=>{const{options:n}=this.context,{generatorName:r}=this.props;(!n.customRenderingReplaces||!Cx(r,n))&&this.updateElRef(e)},this.updateElRef=e=>{this.props.elRef&&da(this.props.elRef,e)}}render(){const{props:e,context:n}=this,{options:r}=n,{customGenerator:i,defaultGenerator:s,renderProps:a}=e,o=yM(e,[],this.handleEl);let p=!1,g,y=[],v;if(i!=null){const E=typeof i=="function"?i(a,ce):i;if(E===!0)p=!0;else{const T=E&&typeof E=="object";T&&"html"in E?o.dangerouslySetInnerHTML={__html:E.html}:T&&"domNodes"in E?y=Array.prototype.slice.call(E.domNodes):(T?aA(E):typeof E!="function")?g=E:v=E}}else p=!Cx(e.generatorName,r);return p&&s&&(g=s(a)),this.queuedDomNodes=y,this.currentGeneratorMeta=v,ce(e.elTag,o,g)}componentDidMount(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentDidUpdate(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentWillUnmount(){this.triggerCustomRendering(!1)}triggerCustomRendering(e){var n;const{props:r,context:i}=this,{handleCustomRendering:s,customRenderingMetaMap:a}=i.options;if(s){const o=(n=this.currentGeneratorMeta)!==null&&n!==void 0?n:a==null?void 0:a[r.generatorName];o&&s(Object.assign(Object.assign({id:this.id,isActive:e,containerEl:this.base,reportNewContainerEl:this.updateElRef,generatorMeta:o},r),{elClasses:(r.elClasses||[]).filter(sZ)}))}}applyQueueudDomNodes(){const{queuedDomNodes:e,currentDomNodes:n}=this,r=this.base;if(!rl(e,n)){n.forEach(ux);for(let i of e)r.appendChild(i);this.currentDomNodes=e}}}Sx.addPropsEquality({elClasses:rl,elStyle:Po,elAttrs:WY,renderProps:Po});function Cx(t,e){var n;return!!(e.handleCustomRendering&&t&&(!((n=e.customRenderingMetaMap)===null||n===void 0)&&n[t]))}function yM(t,e,n){const r=Object.assign(Object.assign({},t.elAttrs),{ref:n});return(t.elClasses||e)&&(r.className=(t.elClasses||[]).concat(e||[]).concat(r.className||[]).filter(Boolean).join(" ")),t.elStyle&&(r.style=t.elStyle),r}function sZ(t){return!!t}const bM=gM(0);class yi extends gs{constructor(){super(...arguments),this.InnerContent=oZ.bind(void 0,this),this.handleEl=e=>{this.el=e,this.props.elRef&&(da(this.props.elRef,e),e&&this.didMountMisfire&&this.componentDidMount())}}render(){const{props:e}=this,n=aZ(e.classNameGenerator,e.renderProps);if(e.children){const r=yM(e,n,this.handleEl),i=e.children(this.InnerContent,e.renderProps,r);return e.elTag?ce(e.elTag,r,i):i}else return ce(Sx,Object.assign(Object.assign({},e),{elRef:this.handleEl,elTag:e.elTag||"div",elClasses:(e.elClasses||[]).concat(n),renderId:this.context}))}componentDidMount(){var e,n;this.el?(n=(e=this.props).didMount)===null||n===void 0||n.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el})):this.didMountMisfire=!0}componentWillUnmount(){var e,n;(n=(e=this.props).willUnmount)===null||n===void 0||n.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el}))}}yi.contextType=bM;function oZ(t,e){const n=t.props;return ce(Sx,Object.assign({renderProps:n.renderProps,generatorName:n.generatorName,customGenerator:n.customGenerator,defaultGenerator:n.defaultGenerator,renderId:t.context},e))}function aZ(t,e){const n=typeof t=="function"?t(e):t||[];return typeof n=="string"?[n]:n}class cf extends Tn{render(){let{props:e,context:n}=this,{options:r}=n,i={view:n.viewApi};return ce(yi,Object.assign({},e,{elTag:e.elTag||"div",elClasses:[..._M(e.viewSpec),...e.elClasses||[]],renderProps:i,classNameGenerator:r.viewClassNames,generatorName:void 0,didMount:r.viewDidMount,willUnmount:r.viewWillUnmount}),()=>e.children)}}function _M(t){return[`fc-${t.type}-view`,"fc-view"]}function lZ(t,e){let n=null,r=null;return t.start&&(n=e.createMarker(t.start)),t.end&&(r=e.createMarker(t.end)),!n&&!r||n&&r&&r<n?null:{start:n,end:r}}function xM(t,e){let n=[],{start:r}=e,i,s;for(t.sort(cZ),i=0;i<t.length;i+=1)s=t[i],s.start>r&&n.push({start:r,end:s.start}),s.end>r&&(r=s.end);return r<e.end&&n.push({start:r,end:e.end}),n}function cZ(t,e){return t.start.valueOf()-e.start.valueOf()}function ll(t,e){let{start:n,end:r}=t,i=null;return e.start!==null&&(n===null?n=e.start:n=new Date(Math.max(n.valueOf(),e.start.valueOf()))),e.end!=null&&(r===null?r=e.end:r=new Date(Math.min(r.valueOf(),e.end.valueOf()))),(n===null||r===null||n<r)&&(i={start:n,end:r}),i}function dZ(t,e){return(t.start===null?null:t.start.valueOf())===(e.start===null?null:e.start.valueOf())&&(t.end===null?null:t.end.valueOf())===(e.end===null?null:e.end.valueOf())}function Tx(t,e){return(t.end===null||e.start===null||t.end>e.start)&&(t.start===null||e.end===null||t.start<e.end)}function Rg(t,e){return(t.start===null||e.start!==null&&e.start>=t.start)&&(t.end===null||e.end!==null&&e.end<=t.end)}function ua(t,e){return(t.start===null||e>=t.start)&&(t.end===null||e<t.end)}function uZ(t,e){return e.start!=null&&t<e.start?e.start:e.end!=null&&t>=e.end?new Date(e.end.valueOf()-1):t}function vM(t){let e=Math.floor(sl(t.start,t.end))||1,n=er(t.start),r=Ur(n,e);return{start:n,end:r}}function Ax(t,e=gn(0)){let n=null,r=null;if(t.end){r=er(t.end);let i=t.end.valueOf()-r.valueOf();i&&i>=lo(e)&&(r=Ur(r,1))}return t.start&&(n=er(t.start),r&&r<=n&&(r=Ur(n,1))),{start:n,end:r}}function hZ(t){let e=Ax(t);return sl(e.start,e.end)>1}function Zd(t,e,n,r){return r==="year"?gn(n.diffWholeYears(t,e),"year"):r==="month"?gn(n.diffWholeMonths(t,e),"month"):_Y(t,e)}function fZ(t,e){switch(e.type){case"CHANGE_DATE":return e.dateMarker;default:return t}}function pZ(t,e){let n=t.initialDate;return n!=null?e.createMarker(n):df(t.now,e)}function df(t,e){return typeof t=="function"&&(t=t()),t==null?e.createNowMarker():e.createMarker(t)}class wM{constructor(e){this.props=e,this.nowDate=df(e.nowInput,e.dateEnv),this.initHiddenDays()}buildPrev(e,n,r){let{dateEnv:i}=this.props,s=i.subtract(i.startOf(n,e.currentRangeUnit),e.dateIncrement);return this.build(s,-1,r)}buildNext(e,n,r){let{dateEnv:i}=this.props,s=i.add(i.startOf(n,e.currentRangeUnit),e.dateIncrement);return this.build(s,1,r)}build(e,n,r=!0){let{props:i}=this,s,a,o,p,g,y;return s=this.buildValidRange(),s=this.trimHiddenDays(s),r&&(e=uZ(e,s)),a=this.buildCurrentRangeInfo(e,n),o=/^(year|month|week|day)$/.test(a.unit),p=this.buildRenderRange(this.trimHiddenDays(a.range),a.unit,o),p=this.trimHiddenDays(p),g=p,i.showNonCurrentDates||(g=ll(g,a.range)),g=this.adjustActiveRange(g),g=ll(g,s),y=Tx(a.range,s),ua(p,e)||(e=p.start),{currentDate:e,validRange:s,currentRange:a.range,currentRangeUnit:a.unit,isRangeAllDay:o,activeRange:g,renderRange:p,slotMinTime:i.slotMinTime,slotMaxTime:i.slotMaxTime,isValid:y,dateIncrement:this.buildDateIncrement(a.duration)}}buildValidRange(){let e=this.props.validRangeInput,n=typeof e=="function"?e.call(this.props.calendarApi,this.nowDate):e;return this.refineRange(n)||{start:null,end:null}}buildCurrentRangeInfo(e,n){let{props:r}=this,i=null,s=null,a=null,o;return r.duration?(i=r.duration,s=r.durationUnit,a=this.buildRangeFromDuration(e,n,i,s)):(o=this.props.dayCount)?(s="day",a=this.buildRangeFromDayCount(e,n,o)):(a=this.buildCustomVisibleRange(e))?s=r.dateEnv.greatestWholeUnit(a.start,a.end).unit:(i=this.getFallbackDuration(),s=gx(i).unit,a=this.buildRangeFromDuration(e,n,i,s)),{duration:i,unit:s,range:a}}getFallbackDuration(){return gn({day:1})}adjustActiveRange(e){let{dateEnv:n,usesMinMaxTime:r,slotMinTime:i,slotMaxTime:s}=this.props,{start:a,end:o}=e;return r&&(Yd(i)<0&&(a=er(a),a=n.add(a,i)),Yd(s)>1&&(o=er(o),o=Ur(o,-1),o=n.add(o,s))),{start:a,end:o}}buildRangeFromDuration(e,n,r,i){let{dateEnv:s,dateAlignment:a}=this.props,o,p,g;if(!a){let{dateIncrement:v}=this.props;v&&lo(v)<lo(r)?a=gx(v).unit:a=i}Yd(r)<=1&&this.isHiddenDay(o)&&(o=this.skipHiddenDays(o,n),o=er(o));function y(){o=s.startOf(e,a),p=s.add(o,r),g={start:o,end:p}}return y(),this.trimHiddenDays(g)||(e=this.skipHiddenDays(e,n),y()),g}buildRangeFromDayCount(e,n,r){let{dateEnv:i,dateAlignment:s}=this.props,a=0,o=e,p;s&&(o=i.startOf(o,s)),o=er(o),o=this.skipHiddenDays(o,n),p=o;do p=Ur(p,1),this.isHiddenDay(p)||(a+=1);while(a<r);return{start:o,end:p}}buildCustomVisibleRange(e){let{props:n}=this,r=n.visibleRangeInput,i=typeof r=="function"?r.call(n.calendarApi,n.dateEnv.toDate(e)):r,s=this.refineRange(i);return s&&(s.start==null||s.end==null)?null:s}buildRenderRange(e,n,r){return e}buildDateIncrement(e){let{dateIncrement:n}=this.props,r;return n||((r=this.props.dateAlignment)?gn(1,r):e||gn({days:1}))}refineRange(e){if(e){let n=lZ(e,this.props.dateEnv);return n&&(n=Ax(n)),n}return null}initHiddenDays(){let e=this.props.hiddenDays||[],n=[],r=0,i;for(this.props.weekends===!1&&e.push(0,6),i=0;i<7;i+=1)(n[i]=e.indexOf(i)!==-1)||(r+=1);if(!r)throw new Error("invalid hiddenDays");this.isHiddenDayHash=n}trimHiddenDays(e){let{start:n,end:r}=e;return n&&(n=this.skipHiddenDays(n)),r&&(r=this.skipHiddenDays(r,-1,!0)),n==null||r==null||n<r?{start:n,end:r}:null}isHiddenDay(e){return e instanceof Date&&(e=e.getUTCDay()),this.isHiddenDayHash[e]}skipHiddenDays(e,n=1,r=!1){for(;this.isHiddenDayHash[(e.getUTCDay()+(r?n:0)+7)%7];)e=Ur(e,n);return e}}function Mx(t,e,n,r){return{instanceId:_c(),defId:t,range:e,forcedStartTzo:n??null,forcedEndTzo:r??null}}function mZ(t,e,n,r){for(let i=0;i<r.length;i+=1){let s=r[i].parse(t,n);if(s){let{allDay:a}=t;return a==null&&(a=e,a==null&&(a=s.allDayGuess,a==null&&(a=!1))),{allDay:a,duration:s.duration,typeData:s.typeData,typeId:i}}}return null}function Ec(t,e,n){let{dateEnv:r,pluginHooks:i,options:s}=n,{defs:a,instances:o}=t;o=wc(o,p=>!a[p.defId].recurringDef);for(let p in a){let g=a[p];if(g.recurringDef){let{duration:y}=g.recurringDef;y||(y=g.allDay?s.defaultAllDayEventDuration:s.defaultTimedEventDuration);let v=gZ(g,y,e,r,i.recurringTypes);for(let E of v){let T=Mx(p,{start:E,end:r.add(E,y)});o[T.instanceId]=T}}}return{defs:a,instances:o}}function gZ(t,e,n,r,i){let a=i[t.recurringDef.typeId].expand(t.recurringDef.typeData,{start:r.subtract(n.start,e),end:n.end},r);return t.allDay&&(a=a.map(er)),a}const Og={id:String,groupId:String,title:String,url:String,interactive:Boolean},kM={start:De,end:De,date:De,allDay:Boolean},yZ=Object.assign(Object.assign(Object.assign({},Og),kM),{extendedProps:De});function EM(t,e,n,r,i=Dx(n),s,a){let{refined:o,extra:p}=SM(t,n,i),g=_Z(e,n),y=mZ(o,g,n.dateEnv,n.pluginHooks.recurringTypes);if(y){let E=Ix(o,p,e?e.sourceId:"",y.allDay,!!y.duration,n,s);return E.recurringDef={typeId:y.typeId,typeData:y.typeData,duration:y.duration},{def:E,instance:null}}let v=bZ(o,g,n,r);if(v){let E=Ix(o,p,e?e.sourceId:"",v.allDay,v.hasEnd,n,s),T=Mx(E.defId,v.range,v.forcedStartTzo,v.forcedEndTzo);return a&&E.publicId&&a[E.publicId]&&(T.instanceId=a[E.publicId]),{def:E,instance:T}}return null}function SM(t,e,n=Dx(e)){return xx(t,n)}function Dx(t){return Object.assign(Object.assign(Object.assign({},Bg),yZ),t.pluginHooks.eventRefiners)}function Ix(t,e,n,r,i,s,a){let o={title:t.title||"",groupId:t.groupId||"",publicId:t.id||"",url:t.url||"",recurringDef:null,defId:(a&&t.id?a[t.id]:"")||_c(),sourceId:n,allDay:r,hasEnd:i,interactive:t.interactive,ui:zg(t,s),extendedProps:Object.assign(Object.assign({},t.extendedProps||{}),e)};for(let p of s.pluginHooks.eventDefMemberAdders)Object.assign(o,p(t));return Object.freeze(o.ui.classNames),Object.freeze(o.extendedProps),o}function bZ(t,e,n,r){let{allDay:i}=t,s,a=null,o=!1,p,g=null,y=t.start!=null?t.start:t.date;if(s=n.dateEnv.createMarkerMeta(y),s)a=s.marker;else if(!r)return null;return t.end!=null&&(p=n.dateEnv.createMarkerMeta(t.end)),i==null&&(e!=null?i=e:i=(!s||s.isTimeUnspecified)&&(!p||p.isTimeUnspecified)),i&&a&&(a=er(a)),p&&(g=p.marker,i&&(g=er(g)),a&&g<=a&&(g=null)),g?o=!0:r||(o=n.options.forceEventDuration||!1,g=n.dateEnv.add(a,i?n.options.defaultAllDayEventDuration:n.options.defaultTimedEventDuration)),{allDay:i,hasEnd:o,range:{start:a,end:g},forcedStartTzo:s?s.forcedTzo:null,forcedEndTzo:p?p.forcedTzo:null}}function _Z(t,e){let n=null;return t&&(n=t.defaultAllDay),n==null&&(n=e.options.defaultAllDay),n}function uf(t,e,n,r,i,s){let a=ys(),o=Dx(n);for(let p of t){let g=EM(p,e,n,r,o,i,s);g&&Px(g,a)}return a}function Px(t,e=ys()){return e.defs[t.def.defId]=t.def,t.instance&&(e.instances[t.instance.instanceId]=t.instance),e}function Rx(t,e){let n=t.instances[e];if(n){let r=t.defs[n.defId],i=Ng(t,s=>xZ(r,s));return i.defs[r.defId]=r,i.instances[n.instanceId]=n,i}return ys()}function xZ(t,e){return!!(t.groupId&&t.groupId===e.groupId)}function ys(){return{defs:{},instances:{}}}function Ox(t,e){return{defs:Object.assign(Object.assign({},t.defs),e.defs),instances:Object.assign(Object.assign({},t.instances),e.instances)}}function Ng(t,e){let n=wc(t.defs,e),r=wc(t.instances,i=>n[i.defId]);return{defs:n,instances:r}}function vZ(t,e){let{defs:n,instances:r}=t,i={},s={};for(let a in n)e.defs[a]||(i[a]=n[a]);for(let a in r)!e.instances[a]&&i[r[a].defId]&&(s[a]=r[a]);return{defs:i,instances:s}}function wZ(t,e){return Array.isArray(t)?uf(t,null,e,!0):typeof t=="object"&&t?uf([t],null,e,!0):t!=null?String(t):null}function CM(t){return Array.isArray(t)?t:typeof t=="string"?t.split(/\s+/):[]}const Bg={display:String,editable:Boolean,startEditable:Boolean,durationEditable:Boolean,constraint:De,overlap:De,allow:De,className:CM,classNames:CM,color:String,backgroundColor:String,borderColor:String,textColor:String},kZ={display:null,startEditable:null,durationEditable:null,constraints:[],overlap:null,allows:[],backgroundColor:"",borderColor:"",textColor:"",classNames:[]};function zg(t,e){let n=wZ(t.constraint,e);return{display:t.display||null,startEditable:t.startEditable!=null?t.startEditable:t.editable,durationEditable:t.durationEditable!=null?t.durationEditable:t.editable,constraints:n!=null?[n]:[],overlap:t.overlap!=null?t.overlap:null,allows:t.allow!=null?[t.allow]:[],backgroundColor:t.backgroundColor||t.color||"",borderColor:t.borderColor||t.color||"",textColor:t.textColor||"",classNames:(t.className||[]).concat(t.classNames||[])}}function TM(t){return t.reduce(EZ,kZ)}function EZ(t,e){return{display:e.display!=null?e.display:t.display,startEditable:e.startEditable!=null?e.startEditable:t.startEditable,durationEditable:e.durationEditable!=null?e.durationEditable:t.durationEditable,constraints:t.constraints.concat(e.constraints),overlap:typeof e.overlap=="boolean"?e.overlap:t.overlap,allows:t.allows.concat(e.allows),backgroundColor:e.backgroundColor||t.backgroundColor,borderColor:e.borderColor||t.borderColor,textColor:e.textColor||t.textColor,classNames:t.classNames.concat(e.classNames)}}const SZ={id:String,defaultAllDay:Boolean,url:String,format:String,events:De,eventDataTransform:De,success:De,failure:De};function AM(t,e,n=MM(e)){let r;if(typeof t=="string"?r={url:t}:typeof t=="function"||Array.isArray(t)?r={events:t}:typeof t=="object"&&t&&(r=t),r){let{refined:i,extra:s}=xx(r,n),a=CZ(i,e);if(a)return{_raw:t,isFetching:!1,latestFetchId:"",fetchRange:null,defaultAllDay:i.defaultAllDay,eventDataTransform:i.eventDataTransform,success:i.success,failure:i.failure,publicId:i.id||"",sourceId:_c(),sourceDefId:a.sourceDefId,meta:a.meta,ui:zg(i,e),extendedProps:s}}return null}function MM(t){return Object.assign(Object.assign(Object.assign({},Bg),SZ),t.pluginHooks.eventSourceRefiners)}function CZ(t,e){let n=e.pluginHooks.eventSourceDefs;for(let r=n.length-1;r>=0;r-=1){let s=n[r].parseMeta(t);if(s)return{sourceDefId:r,meta:s}}return null}function TZ(t,e,n,r,i){switch(e.type){case"RECEIVE_EVENTS":return AZ(t,n[e.sourceId],e.fetchId,e.fetchRange,e.rawEvents,i);case"RESET_RAW_EVENTS":return MZ(t,n[e.sourceId],e.rawEvents,r.activeRange,i);case"ADD_EVENTS":return DZ(t,e.eventStore,r?r.activeRange:null,i);case"RESET_EVENTS":return e.eventStore;case"MERGE_EVENTS":return Ox(t,e.eventStore);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return r?Ec(t,r.activeRange,i):t;case"REMOVE_EVENTS":return vZ(t,e.eventStore);case"REMOVE_EVENT_SOURCE":return RM(t,e.sourceId);case"REMOVE_ALL_EVENT_SOURCES":return Ng(t,s=>!s.sourceId);case"REMOVE_ALL_EVENTS":return ys();default:return t}}function AZ(t,e,n,r,i,s){if(e&&n===e.latestFetchId){let a=uf(DM(i,e,s),e,s);return r&&(a=Ec(a,r,s)),Ox(RM(t,e.sourceId),a)}return t}function MZ(t,e,n,r,i){const{defIdMap:s,instanceIdMap:a}=PZ(t);let o=uf(DM(n,e,i),e,i,!1,s,a);return Ec(o,r,i)}function DM(t,e,n){let r=n.options.eventDataTransform,i=e?e.eventDataTransform:null;return i&&(t=IM(t,i)),r&&(t=IM(t,r)),t}function IM(t,e){let n;if(!e)n=t;else{n=[];for(let r of t){let i=e(r);i?n.push(i):i==null&&n.push(r)}}return n}function DZ(t,e,n,r){return n&&(e=Ec(e,n,r)),Ox(t,e)}function PM(t,e,n){let{defs:r}=t,i=la(t.instances,s=>r[s.defId].allDay?s:Object.assign(Object.assign({},s),{range:{start:n.createMarker(e.toDate(s.range.start,s.forcedStartTzo)),end:n.createMarker(e.toDate(s.range.end,s.forcedEndTzo))},forcedStartTzo:n.canComputeOffset?null:s.forcedStartTzo,forcedEndTzo:n.canComputeOffset?null:s.forcedEndTzo}));return{defs:r,instances:i}}function RM(t,e){return Ng(t,n=>n.sourceId!==e)}function IZ(t,e){return{defs:t.defs,instances:wc(t.instances,n=>!e[n.instanceId])}}function PZ(t){const{defs:e,instances:n}=t,r={},i={};for(let s in e){const a=e[s],{publicId:o}=a;o&&(r[o]=s)}for(let s in n){const a=n[s],o=e[a.defId],{publicId:p}=o;p&&(i[p]=s)}return{defIdMap:r,instanceIdMap:i}}class Lg{constructor(){this.handlers={},this.thisContext=null}setThisContext(e){this.thisContext=e}setOptions(e){this.options=e}on(e,n){RZ(this.handlers,e,n)}off(e,n){OZ(this.handlers,e,n)}trigger(e,...n){let r=this.handlers[e]||[],i=this.options&&this.options[e],s=[].concat(i||[],r);for(let a of s)a.apply(this.thisContext,n)}hasHandlers(e){return!!(this.handlers[e]&&this.handlers[e].length||this.options&&this.options[e])}}function RZ(t,e,n){(t[e]||(t[e]=[])).push(n)}function OZ(t,e,n){n?t[e]&&(t[e]=t[e].filter(r=>r!==n)):delete t[e]}const NZ={startTime:"09:00",endTime:"17:00",daysOfWeek:[1,2,3,4,5],display:"inverse-background",classNames:"fc-non-business",groupId:"_businessHours"};function BZ(t,e){return uf(zZ(t),null,e)}function zZ(t){let e;return t===!0?e=[{}]:Array.isArray(t)?e=t.filter(n=>n.daysOfWeek):typeof t=="object"&&t?e=[t]:e=[],e=e.map(n=>Object.assign(Object.assign({},NZ),n)),e}function OM(t,e,n){n.emitter.trigger("select",Object.assign(Object.assign({},Nx(t,n)),{jsEvent:e?e.origEvent:null,view:n.viewApi||n.calendarApi.view}))}function LZ(t,e){e.emitter.trigger("unselect",{jsEvent:t?t.origEvent:null,view:e.viewApi||e.calendarApi.view})}function Nx(t,e){let n={};for(let r of e.pluginHooks.dateSpanTransforms)Object.assign(n,r(t,e));return Object.assign(n,JZ(t,e.dateEnv)),n}function NM(t,e,n){let{dateEnv:r,options:i}=n,s=e;return t?(s=er(s),s=r.add(s,i.defaultAllDayEventDuration)):s=r.add(s,i.defaultTimedEventDuration),s}function Bx(t,e,n,r){let i=Vg(t.defs,e),s=ys();for(let a in t.defs){let o=t.defs[a];s.defs[a]=VZ(o,i[a],n,r)}for(let a in t.instances){let o=t.instances[a],p=s.defs[o.defId];s.instances[a]=FZ(o,p,i[o.defId],n,r)}return s}function VZ(t,e,n,r){let i=n.standardProps||{};i.hasEnd==null&&e.durationEditable&&(n.startDelta||n.endDelta)&&(i.hasEnd=!0);let s=Object.assign(Object.assign(Object.assign({},t),i),{ui:Object.assign(Object.assign({},t.ui),i.ui)});n.extendedProps&&(s.extendedProps=Object.assign(Object.assign({},s.extendedProps),n.extendedProps));for(let a of r.pluginHooks.eventDefMutationAppliers)a(s,n,r);return!s.hasEnd&&r.options.forceEventDuration&&(s.hasEnd=!0),s}function FZ(t,e,n,r,i){let{dateEnv:s}=i,a=r.standardProps&&r.standardProps.allDay===!0,o=r.standardProps&&r.standardProps.hasEnd===!1,p=Object.assign({},t);return a&&(p.range=vM(p.range)),r.datesDelta&&n.startEditable&&(p.range={start:s.add(p.range.start,r.datesDelta),end:s.add(p.range.end,r.datesDelta)}),r.startDelta&&n.durationEditable&&(p.range={start:s.add(p.range.start,r.startDelta),end:p.range.end}),r.endDelta&&n.durationEditable&&(p.range={start:p.range.start,end:s.add(p.range.end,r.endDelta)}),o&&(p.range={start:p.range.start,end:NM(e.allDay,p.range.start,i)}),e.allDay&&(p.range={start:er(p.range.start),end:er(p.range.end)}),p.range.end<p.range.start&&(p.range.end=NM(e.allDay,p.range.start,i)),p}class Xd{constructor(e,n){this.context=e,this.internalEventSource=n}remove(){this.context.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:this.internalEventSource.sourceId})}refetch(){this.context.dispatch({type:"FETCH_EVENT_SOURCES",sourceIds:[this.internalEventSource.sourceId],isRefetch:!0})}get id(){return this.internalEventSource.publicId}get url(){return this.internalEventSource.meta.url}get format(){return this.internalEventSource.meta.format}}class lr{constructor(e,n,r){this._context=e,this._def=n,this._instance=r||null}setProp(e,n){if(e in kM)console.warn("Could not set date-related prop 'name'. Use one of the date-related methods instead.");else if(e==="id")n=Og[e](n),this.mutate({standardProps:{publicId:n}});else if(e in Og)n=Og[e](n),this.mutate({standardProps:{[e]:n}});else if(e in Bg){let r=Bg[e](n);e==="color"?r={backgroundColor:n,borderColor:n}:e==="editable"?r={startEditable:n,durationEditable:n}:r={[e]:n},this.mutate({standardProps:{ui:r}})}else console.warn(`Could not set prop '${e}'. Use setExtendedProp instead.`)}setExtendedProp(e,n){this.mutate({extendedProps:{[e]:n}})}setStart(e,n={}){let{dateEnv:r}=this._context,i=r.createMarker(e);if(i&&this._instance){let s=this._instance.range,a=Zd(s.start,i,r,n.granularity);n.maintainDuration?this.mutate({datesDelta:a}):this.mutate({startDelta:a})}}setEnd(e,n={}){let{dateEnv:r}=this._context,i;if(!(e!=null&&(i=r.createMarker(e),!i))&&this._instance)if(i){let s=Zd(this._instance.range.end,i,r,n.granularity);this.mutate({endDelta:s})}else this.mutate({standardProps:{hasEnd:!1}})}setDates(e,n,r={}){let{dateEnv:i}=this._context,s={allDay:r.allDay},a=i.createMarker(e),o;if(a&&!(n!=null&&(o=i.createMarker(n),!o))&&this._instance){let p=this._instance.range;r.allDay===!0&&(p=vM(p));let g=Zd(p.start,a,i,r.granularity);if(o){let y=Zd(p.end,o,i,r.granularity);cY(g,y)?this.mutate({datesDelta:g,standardProps:s}):this.mutate({startDelta:g,endDelta:y,standardProps:s})}else s.hasEnd=!1,this.mutate({datesDelta:g,standardProps:s})}}moveStart(e){let n=gn(e);n&&this.mutate({startDelta:n})}moveEnd(e){let n=gn(e);n&&this.mutate({endDelta:n})}moveDates(e){let n=gn(e);n&&this.mutate({datesDelta:n})}setAllDay(e,n={}){let r={allDay:e},{maintainDuration:i}=n;i==null&&(i=this._context.options.allDayMaintainDuration),this._def.allDay!==e&&(r.hasEnd=i),this.mutate({standardProps:r})}formatRange(e){let{dateEnv:n}=this._context,r=this._instance,i=ir(e);return this._def.hasEnd?n.formatRange(r.range.start,r.range.end,i,{forcedStartTzo:r.forcedStartTzo,forcedEndTzo:r.forcedEndTzo}):n.format(r.range.start,i,{forcedTzo:r.forcedStartTzo})}mutate(e){let n=this._instance;if(n){let r=this._def,i=this._context,{eventStore:s}=i.getCurrentData(),a=Rx(s,n.instanceId);a=Bx(a,{"":{display:"",startEditable:!0,durationEditable:!0,constraints:[],overlap:null,allows:[],backgroundColor:"",borderColor:"",textColor:"",classNames:[]}},e,i);let p=new lr(i,r,n);this._def=a.defs[r.defId],this._instance=a.instances[n.instanceId],i.dispatch({type:"MERGE_EVENTS",eventStore:a}),i.emitter.trigger("eventChange",{oldEvent:p,event:this,relatedEvents:Sc(a,i,n),revert(){i.dispatch({type:"RESET_EVENTS",eventStore:s})}})}}remove(){let e=this._context,n=BM(this);e.dispatch({type:"REMOVE_EVENTS",eventStore:n}),e.emitter.trigger("eventRemove",{event:this,relatedEvents:[],revert(){e.dispatch({type:"MERGE_EVENTS",eventStore:n})}})}get source(){let{sourceId:e}=this._def;return e?new Xd(this._context,this._context.getCurrentData().eventSources[e]):null}get start(){return this._instance?this._context.dateEnv.toDate(this._instance.range.start):null}get end(){return this._instance&&this._def.hasEnd?this._context.dateEnv.toDate(this._instance.range.end):null}get startStr(){let e=this._instance;return e?this._context.dateEnv.formatIso(e.range.start,{omitTime:this._def.allDay,forcedTzo:e.forcedStartTzo}):""}get endStr(){let e=this._instance;return e&&this._def.hasEnd?this._context.dateEnv.formatIso(e.range.end,{omitTime:this._def.allDay,forcedTzo:e.forcedEndTzo}):""}get id(){return this._def.publicId}get groupId(){return this._def.groupId}get allDay(){return this._def.allDay}get title(){return this._def.title}get url(){return this._def.url}get display(){return this._def.ui.display||"auto"}get startEditable(){return this._def.ui.startEditable}get durationEditable(){return this._def.ui.durationEditable}get constraint(){return this._def.ui.constraints[0]||null}get overlap(){return this._def.ui.overlap}get allow(){return this._def.ui.allows[0]||null}get backgroundColor(){return this._def.ui.backgroundColor}get borderColor(){return this._def.ui.borderColor}get textColor(){return this._def.ui.textColor}get classNames(){return this._def.ui.classNames}get extendedProps(){return this._def.extendedProps}toPlainObject(e={}){let n=this._def,{ui:r}=n,{startStr:i,endStr:s}=this,a={allDay:n.allDay};return n.title&&(a.title=n.title),i&&(a.start=i),s&&(a.end=s),n.publicId&&(a.id=n.publicId),n.groupId&&(a.groupId=n.groupId),n.url&&(a.url=n.url),r.display&&r.display!=="auto"&&(a.display=r.display),e.collapseColor&&r.backgroundColor&&r.backgroundColor===r.borderColor?a.color=r.backgroundColor:(r.backgroundColor&&(a.backgroundColor=r.backgroundColor),r.borderColor&&(a.borderColor=r.borderColor)),r.textColor&&(a.textColor=r.textColor),r.classNames.length&&(a.classNames=r.classNames),Object.keys(n.extendedProps).length&&(e.collapseExtendedProps?Object.assign(a,n.extendedProps):a.extendedProps=n.extendedProps),a}toJSON(){return this.toPlainObject()}}function BM(t){let e=t._def,n=t._instance;return{defs:{[e.defId]:e},instances:n?{[n.instanceId]:n}:{}}}function Sc(t,e,n){let{defs:r,instances:i}=t,s=[],a=n?n.instanceId:"";for(let o in i){let p=i[o],g=r[p.defId];p.instanceId!==a&&s.push(new lr(e,g,p))}return s}function zx(t,e,n,r){let i={},s={},a={},o=[],p=[],g=Vg(t.defs,e);for(let y in t.defs){let v=t.defs[y];g[v.defId].display==="inverse-background"&&(v.groupId?(i[v.groupId]=[],a[v.groupId]||(a[v.groupId]=v)):s[y]=[])}for(let y in t.instances){let v=t.instances[y],E=t.defs[v.defId],T=g[E.defId],D=v.range,N=!E.allDay&&r?Ax(D,r):D,B=ll(N,n);B&&(T.display==="inverse-background"?E.groupId?i[E.groupId].push(B):s[v.defId].push(B):T.display!=="none"&&(T.display==="background"?o:p).push({def:E,ui:T,instance:v,range:B,isStart:N.start&&N.start.valueOf()===B.start.valueOf(),isEnd:N.end&&N.end.valueOf()===B.end.valueOf()}))}for(let y in i){let v=i[y],E=xM(v,n);for(let T of E){let D=a[y],N=g[D.defId];o.push({def:D,ui:N,instance:null,range:T,isStart:!1,isEnd:!1})}}for(let y in s){let v=s[y],E=xM(v,n);for(let T of E)o.push({def:t.defs[y],ui:g[y],instance:null,range:T,isStart:!1,isEnd:!1})}return{bg:o,fg:p}}function $Z(t){return t.ui.display==="background"||t.ui.display==="inverse-background"}function zM(t,e){t.fcSeg=e}function Kd(t){return t.fcSeg||t.parentNode.fcSeg||null}function Vg(t,e){return la(t,n=>LM(n,e))}function LM(t,e){let n=[];return e[""]&&n.push(e[""]),e[t.defId]&&n.push(e[t.defId]),n.push(t.ui),TM(n)}function Lx(t,e){let n=t.map(jZ);return n.sort((r,i)=>nY(r,i,e)),n.map(r=>r._seg)}function jZ(t){let{eventRange:e}=t,n=e.def,r=e.instance?e.instance.range:e.range,i=r.start?r.start.valueOf():0,s=r.end?r.end.valueOf():0;return Object.assign(Object.assign(Object.assign({},n.extendedProps),n),{id:n.publicId,start:i,end:s,duration:s-i,allDay:Number(n.allDay),_seg:t})}function HZ(t,e){let{pluginHooks:n}=e,r=n.isDraggableTransformers,{def:i,ui:s}=t.eventRange,a=s.startEditable;for(let o of r)a=o(a,i,s,e);return a}function UZ(t,e){return t.isStart&&t.eventRange.ui.durationEditable&&e.options.eventResizableFromStart}function WZ(t,e){return t.isEnd&&t.eventRange.ui.durationEditable}function hf(t,e,n,r,i,s,a){let{dateEnv:o,options:p}=n,{displayEventTime:g,displayEventEnd:y}=p,v=t.eventRange.def,E=t.eventRange.instance;g==null&&(g=r!==!1),y==null&&(y=i!==!1);let T=E.range.start,D=E.range.end,N=s||t.start||t.eventRange.range.start,B=a||t.end||t.eventRange.range.end,F=er(T).valueOf()===er(N).valueOf(),X=er(il(D,-1)).valueOf()===er(il(B,-1)).valueOf();return g&&!v.allDay&&(F||X)?(N=F?T:N,B=X?D:B,y&&v.hasEnd?o.formatRange(N,B,e,{forcedStartTzo:s?null:E.forcedStartTzo,forcedEndTzo:a?null:E.forcedEndTzo}):o.format(N,e,{forcedTzo:s?null:E.forcedStartTzo})):""}function ha(t,e,n){let r=t.eventRange.range;return{isPast:r.end<=(n||e.start),isFuture:r.start>=(n||e.end),isToday:e&&ua(e,r.start)}}function qZ(t){let e=["fc-event"];return t.isMirror&&e.push("fc-event-mirror"),t.isDraggable&&e.push("fc-event-draggable"),(t.isStartResizable||t.isEndResizable)&&e.push("fc-event-resizable"),t.isDragging&&e.push("fc-event-dragging"),t.isResizing&&e.push("fc-event-resizing"),t.isSelected&&e.push("fc-event-selected"),t.isStart&&e.push("fc-event-start"),t.isEnd&&e.push("fc-event-end"),t.isPast&&e.push("fc-event-past"),t.isToday&&e.push("fc-event-today"),t.isFuture&&e.push("fc-event-future"),e}function VM(t){return t.instance?t.instance.instanceId:`${t.def.defId}:${t.range.start.toISOString()}`}function Vx(t,e){let{def:n,instance:r}=t.eventRange,{url:i}=n;if(i)return{href:i};let{emitter:s,options:a}=e,{eventInteractive:o}=a;return o==null&&(o=n.interactive,o==null&&(o=!!s.hasHandlers("eventClick"))),o?QA(p=>{s.trigger("eventClick",{el:p.target,event:new lr(e,n,r),jsEvent:p,view:e.viewApi})}):{}}const GZ={start:De,end:De,allDay:Boolean};function YZ(t,e,n){let r=ZZ(t,e),{range:i}=r;if(!i.start)return null;if(!i.end){if(n==null)return null;i.end=e.add(i.start,n)}return r}function ZZ(t,e){let{refined:n,extra:r}=xx(t,GZ),i=n.start?e.createMarkerMeta(n.start):null,s=n.end?e.createMarkerMeta(n.end):null,{allDay:a}=n;return a==null&&(a=i&&i.isTimeUnspecified&&(!s||s.isTimeUnspecified)),Object.assign({range:{start:i?i.marker:null,end:s?s.marker:null},allDay:a},r)}function XZ(t,e){return dZ(t.range,e.range)&&t.allDay===e.allDay&&KZ(t,e)}function KZ(t,e){for(let n in e)if(n!=="range"&&n!=="allDay"&&t[n]!==e[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}function JZ(t,e){return Object.assign(Object.assign({},$M(t.range,e,t.allDay)),{allDay:t.allDay})}function FM(t,e,n){return Object.assign(Object.assign({},$M(t,e,n)),{timeZone:e.timeZone})}function $M(t,e,n){return{start:e.toDate(t.start),end:e.toDate(t.end),startStr:e.formatIso(t.start,{omitTime:n}),endStr:e.formatIso(t.end,{omitTime:n})}}function QZ(t,e,n){let r=SM({editable:!1},n),i=Ix(r.refined,r.extra,"",t.allDay,!0,n);return{def:i,ui:LM(i,e),instance:Mx(i.defId,t.range),range:t.range,isStart:!0,isEnd:!0}}function eX(t,e,n){let r=!1,i=function(o){r||(r=!0,e(o))},s=function(o){r||(r=!0,n(o))},a=t(i,s);a&&typeof a.then=="function"&&a.then(i,s)}class jM extends Error{constructor(e,n){super(e),this.response=n}}function tX(t,e,n){t=t.toUpperCase();const r={method:t};return t==="GET"?e+=(e.indexOf("?")===-1?"?":"&")+new URLSearchParams(n):(r.body=new URLSearchParams(n),r.headers={"Content-Type":"application/x-www-form-urlencoded"}),fetch(e,r).then(i=>{if(i.ok)return i.json().then(s=>[s,i],()=>{throw new jM("Failure parsing JSON",i)});throw new jM("Request failed",i)})}let Fx;function HM(){return Fx==null&&(Fx=nX()),Fx}function nX(){if(typeof document>"u")return!0;let t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.innerHTML="<table><tr><td><div></div></td></tr></table>",t.querySelector("table").style.height="100px",t.querySelector("div").style.height="100%",document.body.appendChild(t);let n=t.querySelector("div").offsetHeight>0;return document.body.removeChild(t),n}class rX extends Tn{constructor(){super(...arguments),this.state={forPrint:!1},this.handleBeforePrint=()=>{Pg(()=>{this.setState({forPrint:!0})})},this.handleAfterPrint=()=>{Pg(()=>{this.setState({forPrint:!1})})}}render(){let{props:e}=this,{options:n}=e,{forPrint:r}=this.state,i=r||n.height==="auto"||n.contentHeight==="auto",s=!i&&n.height!=null?n.height:"",a=["fc",r?"fc-media-print":"fc-media-screen",`fc-direction-${n.direction}`,e.theme.getClass("root")];return HM()||a.push("fc-liquid-hack"),e.children(a,s,i,r)}componentDidMount(){let{emitter:e}=this.props;e.on("_beforeprint",this.handleBeforePrint),e.on("_afterprint",this.handleAfterPrint)}componentWillUnmount(){let{emitter:e}=this.props;e.off("_beforeprint",this.handleBeforePrint),e.off("_afterprint",this.handleAfterPrint)}}class Jd{constructor(e){this.component=e.component,this.isHitComboAllowed=e.isHitComboAllowed||null}destroy(){}}function iX(t,e){return{component:t,el:e.el,useEventCenter:e.useEventCenter!=null?e.useEventCenter:!0,isHitComboAllowed:e.isHitComboAllowed||null}}function $x(t){return{[t.component.uid]:t}}const jx={};class sX{getCurrentData(){return this.currentDataManager.getCurrentData()}dispatch(e){this.currentDataManager.dispatch(e)}get view(){return this.getCurrentData().viewApi}batchRendering(e){e()}updateSize(){this.trigger("_resize",!0)}setOption(e,n){this.dispatch({type:"SET_OPTION",optionName:e,rawOptionValue:n})}getOption(e){return this.currentDataManager.currentCalendarOptionsInput[e]}getAvailableLocaleCodes(){return Object.keys(this.getCurrentData().availableRawLocales)}on(e,n){let{currentDataManager:r}=this;r.currentCalendarOptionsRefiners[e]?r.emitter.on(e,n):console.warn(`Unknown listener name '${e}'`)}off(e,n){this.currentDataManager.emitter.off(e,n)}trigger(e,...n){this.currentDataManager.emitter.trigger(e,...n)}changeView(e,n){this.batchRendering(()=>{if(this.unselect(),n)if(n.start&&n.end)this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e}),this.dispatch({type:"SET_OPTION",optionName:"visibleRange",rawOptionValue:n});else{let{dateEnv:r}=this.getCurrentData();this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e,dateMarker:r.createMarker(n)})}else this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e})})}zoomTo(e,n){let r=this.getCurrentData(),i;n=n||"day",i=r.viewSpecs[n]||this.getUnitViewSpec(n),this.unselect(),i?this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:i.type,dateMarker:e}):this.dispatch({type:"CHANGE_DATE",dateMarker:e})}getUnitViewSpec(e){let{viewSpecs:n,toolbarConfig:r}=this.getCurrentData(),i=[].concat(r.header?r.header.viewsWithButtons:[],r.footer?r.footer.viewsWithButtons:[]),s,a;for(let o in n)i.push(o);for(s=0;s<i.length;s+=1)if(a=n[i[s]],a&&a.singleUnit===e)return a;return null}prev(){this.unselect(),this.dispatch({type:"PREV"})}next(){this.unselect(),this.dispatch({type:"NEXT"})}prevYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,-1)})}nextYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,1)})}today(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:df(e.calendarOptions.now,e.dateEnv)})}gotoDate(e){let n=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:n.dateEnv.createMarker(e)})}incrementDate(e){let n=this.getCurrentData(),r=gn(e);r&&(this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:n.dateEnv.add(n.currentDate,r)}))}getDate(){let e=this.getCurrentData();return e.dateEnv.toDate(e.currentDate)}formatDate(e,n){let{dateEnv:r}=this.getCurrentData();return r.format(r.createMarker(e),ir(n))}formatRange(e,n,r){let{dateEnv:i}=this.getCurrentData();return i.formatRange(i.createMarker(e),i.createMarker(n),ir(r),r)}formatIso(e,n){let{dateEnv:r}=this.getCurrentData();return r.formatIso(r.createMarker(e),{omitTime:n})}select(e,n){let r;n==null?e.start!=null?r=e:r={start:e,end:null}:r={start:e,end:n};let i=this.getCurrentData(),s=YZ(r,i.dateEnv,gn({days:1}));s&&(this.dispatch({type:"SELECT_DATES",selection:s}),OM(s,null,i))}unselect(e){let n=this.getCurrentData();n.dateSelection&&(this.dispatch({type:"UNSELECT_DATES"}),LZ(e,n))}addEvent(e,n){if(e instanceof lr){let a=e._def,o=e._instance;return this.getCurrentData().eventStore.defs[a.defId]||(this.dispatch({type:"ADD_EVENTS",eventStore:Px({def:a,instance:o})}),this.triggerEventAdd(e)),e}let r=this.getCurrentData(),i;if(n instanceof Xd)i=n.internalEventSource;else if(typeof n=="boolean")n&&([i]=wx(r.eventSources));else if(n!=null){let a=this.getEventSourceById(n);if(!a)return console.warn(`Could not find an event source with ID "${n}"`),null;i=a.internalEventSource}let s=EM(e,i,r,!1);if(s){let a=new lr(r,s.def,s.def.recurringDef?null:s.instance);return this.dispatch({type:"ADD_EVENTS",eventStore:Px(s)}),this.triggerEventAdd(a),a}return null}triggerEventAdd(e){let{emitter:n}=this.getCurrentData();n.trigger("eventAdd",{event:e,relatedEvents:[],revert:()=>{this.dispatch({type:"REMOVE_EVENTS",eventStore:BM(e)})}})}getEventById(e){let n=this.getCurrentData(),{defs:r,instances:i}=n.eventStore;e=String(e);for(let s in r){let a=r[s];if(a.publicId===e){if(a.recurringDef)return new lr(n,a,null);for(let o in i){let p=i[o];if(p.defId===a.defId)return new lr(n,a,p)}}}return null}getEvents(){let e=this.getCurrentData();return Sc(e.eventStore,e)}removeAllEvents(){this.dispatch({type:"REMOVE_ALL_EVENTS"})}getEventSources(){let e=this.getCurrentData(),n=e.eventSources,r=[];for(let i in n)r.push(new Xd(e,n[i]));return r}getEventSourceById(e){let n=this.getCurrentData(),r=n.eventSources;e=String(e);for(let i in r)if(r[i].publicId===e)return new Xd(n,r[i]);return null}addEventSource(e){let n=this.getCurrentData();if(e instanceof Xd)return n.eventSources[e.internalEventSource.sourceId]||this.dispatch({type:"ADD_EVENT_SOURCES",sources:[e.internalEventSource]}),e;let r=AM(e,n);return r?(this.dispatch({type:"ADD_EVENT_SOURCES",sources:[r]}),new Xd(n,r)):null}removeAllEventSources(){this.dispatch({type:"REMOVE_ALL_EVENT_SOURCES"})}refetchEvents(){this.dispatch({type:"FETCH_EVENT_SOURCES",isRefetch:!0})}scrollToTime(e){let n=gn(e);n&&this.trigger("_scrollRequest",{time:n})}}function oX(t,e){return t.left>=e.left&&t.left<e.right&&t.top>=e.top&&t.top<e.bottom}function UM(t,e){let n={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)};return n.left<n.right&&n.top<n.bottom?n:!1}function aX(t,e){return{left:Math.min(Math.max(t.left,e.left),e.right),top:Math.min(Math.max(t.top,e.top),e.bottom)}}function lX(t){return{left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}}function cX(t,e){return{left:t.left-e.left,top:t.top-e.top}}const Hx=ys();class dX{constructor(){this.getKeysForEventDefs=Ft(this._getKeysForEventDefs),this.splitDateSelection=Ft(this._splitDateSpan),this.splitEventStore=Ft(this._splitEventStore),this.splitIndividualUi=Ft(this._splitIndividualUi),this.splitEventDrag=Ft(this._splitInteraction),this.splitEventResize=Ft(this._splitInteraction),this.eventUiBuilders={}}splitProps(e){let n=this.getKeyInfo(e),r=this.getKeysForEventDefs(e.eventStore),i=this.splitDateSelection(e.dateSelection),s=this.splitIndividualUi(e.eventUiBases,r),a=this.splitEventStore(e.eventStore,r),o=this.splitEventDrag(e.eventDrag),p=this.splitEventResize(e.eventResize),g={};this.eventUiBuilders=la(n,(y,v)=>this.eventUiBuilders[v]||Ft(uX));for(let y in n){let v=n[y],E=a[y]||Hx,T=this.eventUiBuilders[y];g[y]={businessHours:v.businessHours||e.businessHours,dateSelection:i[y]||null,eventStore:E,eventUiBases:T(e.eventUiBases[""],v.ui,s[y]),eventSelection:E.instances[e.eventSelection]?e.eventSelection:"",eventDrag:o[y]||null,eventResize:p[y]||null}}return g}_splitDateSpan(e){let n={};if(e){let r=this.getKeysForDateSpan(e);for(let i of r)n[i]=e}return n}_getKeysForEventDefs(e){return la(e.defs,n=>this.getKeysForEventDef(n))}_splitEventStore(e,n){let{defs:r,instances:i}=e,s={};for(let a in r)for(let o of n[a])s[o]||(s[o]=ys()),s[o].defs[a]=r[a];for(let a in i){let o=i[a];for(let p of n[o.defId])s[p]&&(s[p].instances[a]=o)}return s}_splitIndividualUi(e,n){let r={};for(let i in e)if(i)for(let s of n[i])r[s]||(r[s]={}),r[s][i]=e[i];return r}_splitInteraction(e){let n={};if(e){let r=this._splitEventStore(e.affectedEvents,this._getKeysForEventDefs(e.affectedEvents)),i=this._getKeysForEventDefs(e.mutatedEvents),s=this._splitEventStore(e.mutatedEvents,i),a=o=>{n[o]||(n[o]={affectedEvents:r[o]||Hx,mutatedEvents:s[o]||Hx,isEvent:e.isEvent})};for(let o in r)a(o);for(let o in s)a(o)}return n}}function uX(t,e,n){let r=[];t&&r.push(t),e&&r.push(e);let i={"":TM(r)};return n&&Object.assign(i,n),i}function Ux(t,e,n,r){return{dow:t.getUTCDay(),isDisabled:!!(r&&!ua(r.activeRange,t)),isOther:!!(r&&!ua(r.currentRange,t)),isToday:!!(e&&ua(e,t)),isPast:!!(n?t<n:e&&t<e.start),isFuture:!!(n?t>n:e&&t>=e.end)}}function Fg(t,e){let n=["fc-day",`fc-day-${pY[t.dow]}`];return t.isDisabled?n.push("fc-day-disabled"):(t.isToday&&(n.push("fc-day-today"),n.push(e.getClass("today"))),t.isPast&&n.push("fc-day-past"),t.isFuture&&n.push("fc-day-future"),t.isOther&&n.push("fc-day-other")),n}const hX=ir({year:"numeric",month:"long",day:"numeric"}),fX=ir({week:"long"});function Qd(t,e,n="day",r=!0){const{dateEnv:i,options:s,calendarApi:a}=t;let o=i.format(e,n==="week"?fX:hX);if(s.navLinks){let p=i.toDate(e);const g=y=>{let v=n==="day"?s.navLinkDayClick:n==="week"?s.navLinkWeekClick:null;typeof v=="function"?v.call(a,i.toDate(e),y):(typeof v=="string"&&(n=v),a.zoomTo(e,n))};return Object.assign({title:sf(s.navLinkHint,[o,p],o),"data-navlink":""},r?JA(g):{onClick:g})}return{"aria-label":o}}let Wx=null;function pX(){return Wx===null&&(Wx=mX()),Wx}function mX(){let t=document.createElement("div");rf(t,{position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}),t.innerHTML="<div></div>",document.body.appendChild(t);let n=t.firstChild.getBoundingClientRect().left>t.getBoundingClientRect().left;return ux(t),n}let qx;function gX(){return qx||(qx=yX()),qx}function yX(){let t=document.createElement("div");t.style.overflow="scroll",t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",document.body.appendChild(t);let e=WM(t);return document.body.removeChild(t),e}function WM(t){return{x:t.offsetHeight-t.clientHeight,y:t.offsetWidth-t.clientWidth}}function bX(t,e=!1){let n=window.getComputedStyle(t),r=parseInt(n.borderLeftWidth,10)||0,i=parseInt(n.borderRightWidth,10)||0,s=parseInt(n.borderTopWidth,10)||0,a=parseInt(n.borderBottomWidth,10)||0,o=WM(t),p=o.y-r-i,g=o.x-s-a,y={borderLeft:r,borderRight:i,borderTop:s,borderBottom:a,scrollbarBottom:g,scrollbarLeft:0,scrollbarRight:0};return pX()&&n.direction==="rtl"?y.scrollbarLeft=p:y.scrollbarRight=p,e&&(y.paddingLeft=parseInt(n.paddingLeft,10)||0,y.paddingRight=parseInt(n.paddingRight,10)||0,y.paddingTop=parseInt(n.paddingTop,10)||0,y.paddingBottom=parseInt(n.paddingBottom,10)||0),y}function _X(t,e=!1,n){let r=Gx(t),i=bX(t,e),s={left:r.left+i.borderLeft+i.scrollbarLeft,right:r.right-i.borderRight-i.scrollbarRight,top:r.top+i.borderTop,bottom:r.bottom-i.borderBottom-i.scrollbarBottom};return e&&(s.left+=i.paddingLeft,s.right-=i.paddingRight,s.top+=i.paddingTop,s.bottom-=i.paddingBottom),s}function Gx(t){let e=t.getBoundingClientRect();return{left:e.left+window.scrollX,top:e.top+window.scrollY,right:e.right+window.scrollX,bottom:e.bottom+window.scrollY}}function xX(t){let e=qM(t),n=t.getBoundingClientRect();for(let r of e){let i=UM(n,r.getBoundingClientRect());if(i)n=i;else return null}return n}function qM(t){let e=[];for(;t instanceof HTMLElement;){let n=window.getComputedStyle(t);if(n.position==="fixed")break;/(auto|scroll)/.test(n.overflow+n.overflowY+n.overflowX)&&e.push(t),t=t.parentNode}return e}class eu{constructor(e,n,r,i){this.els=n;let s=this.originClientRect=e.getBoundingClientRect();r&&this.buildElHorizontals(s.left),i&&this.buildElVerticals(s.top)}buildElHorizontals(e){let n=[],r=[];for(let i of this.els){let s=i.getBoundingClientRect();n.push(s.left-e),r.push(s.right-e)}this.lefts=n,this.rights=r}buildElVerticals(e){let n=[],r=[];for(let i of this.els){let s=i.getBoundingClientRect();n.push(s.top-e),r.push(s.bottom-e)}this.tops=n,this.bottoms=r}leftToIndex(e){let{lefts:n,rights:r}=this,i=n.length,s;for(s=0;s<i;s+=1)if(e>=n[s]&&e<r[s])return s}topToIndex(e){let{tops:n,bottoms:r}=this,i=n.length,s;for(s=0;s<i;s+=1)if(e>=n[s]&&e<r[s])return s}getWidth(e){return this.rights[e]-this.lefts[e]}getHeight(e){return this.bottoms[e]-this.tops[e]}similarTo(e){return $g(this.tops||[],e.tops||[])&&$g(this.bottoms||[],e.bottoms||[])&&$g(this.lefts||[],e.lefts||[])&&$g(this.rights||[],e.rights||[])}}function $g(t,e){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(Math.round(t[r])!==Math.round(e[r]))return!1;return!0}class Yx{getMaxScrollTop(){return this.getScrollHeight()-this.getClientHeight()}getMaxScrollLeft(){return this.getScrollWidth()-this.getClientWidth()}canScrollVertically(){return this.getMaxScrollTop()>0}canScrollHorizontally(){return this.getMaxScrollLeft()>0}canScrollUp(){return this.getScrollTop()>0}canScrollDown(){return this.getScrollTop()<this.getMaxScrollTop()}canScrollLeft(){return this.getScrollLeft()>0}canScrollRight(){return this.getScrollLeft()<this.getMaxScrollLeft()}}class vX extends Yx{constructor(e){super(),this.el=e}getScrollTop(){return this.el.scrollTop}getScrollLeft(){return this.el.scrollLeft}setScrollTop(e){this.el.scrollTop=e}setScrollLeft(e){this.el.scrollLeft=e}getScrollWidth(){return this.el.scrollWidth}getScrollHeight(){return this.el.scrollHeight}getClientHeight(){return this.el.clientHeight}getClientWidth(){return this.el.clientWidth}}class wX extends Yx{getScrollTop(){return window.scrollY}getScrollLeft(){return window.scrollX}setScrollTop(e){window.scroll(window.scrollX,e)}setScrollLeft(e){window.scroll(e,window.scrollY)}getScrollWidth(){return document.documentElement.scrollWidth}getScrollHeight(){return document.documentElement.scrollHeight}getClientHeight(){return document.documentElement.clientHeight}getClientWidth(){return document.documentElement.clientWidth}}class co extends Tn{constructor(){super(...arguments),this.uid=_c()}prepareHits(){}queryHit(e,n,r,i){return null}isValidSegDownEl(e){return!this.props.eventDrag&&!this.props.eventResize&&!gi(e,".fc-event-mirror")}isValidDateDownEl(e){return!gi(e,".fc-event:not(.fc-bg-event)")&&!gi(e,".fc-more-link")&&!gi(e,"a[data-navlink]")&&!gi(e,".fc-popover")}}class GM{constructor(e=n=>n.thickness||1){this.getEntryThickness=e,this.strictOrder=!1,this.allowReslicing=!1,this.maxCoord=-1,this.maxStackCnt=-1,this.levelCoords=[],this.entriesByLevel=[],this.stackCnts={}}addSegs(e){let n=[];for(let r of e)this.insertEntry(r,n);return n}insertEntry(e,n){let r=this.findInsertion(e);this.isInsertionValid(r,e)?this.insertEntryAt(e,r):this.handleInvalidInsertion(r,e,n)}isInsertionValid(e,n){return(this.maxCoord===-1||e.levelCoord+this.getEntryThickness(n)<=this.maxCoord)&&(this.maxStackCnt===-1||e.stackCnt<this.maxStackCnt)}handleInvalidInsertion(e,n,r){if(this.allowReslicing&&e.touchingEntry){const i=Object.assign(Object.assign({},n),{span:Xx(n.span,e.touchingEntry.span)});r.push(i),this.splitEntry(n,e.touchingEntry,r)}else r.push(n)}splitEntry(e,n,r){let i=e.span,s=n.span;i.start<s.start&&this.insertEntry({index:e.index,thickness:e.thickness,span:{start:i.start,end:s.start}},r),i.end>s.end&&this.insertEntry({index:e.index,thickness:e.thickness,span:{start:s.end,end:i.end}},r)}insertEntryAt(e,n){let{entriesByLevel:r,levelCoords:i}=this;n.lateral===-1?(Kx(i,n.level,n.levelCoord),Kx(r,n.level,[e])):Kx(r[n.level],n.lateral,e),this.stackCnts[Cc(e)]=n.stackCnt}findInsertion(e){let{levelCoords:n,entriesByLevel:r,strictOrder:i,stackCnts:s}=this,a=n.length,o=0,p=-1,g=-1,y=null,v=0;for(let D=0;D<a;D+=1){const N=n[D];if(!i&&N>=o+this.getEntryThickness(e))break;let B=r[D],F,X=Jx(B,e.span.start,Zx),te=X[0]+X[1];for(;(F=B[te])&&F.span.start<e.span.end;){let H=N+this.getEntryThickness(F);H>o&&(o=H,y=F,p=D,g=te),H===o&&(v=Math.max(v,s[Cc(F)]+1)),te+=1}}let E=0;if(y)for(E=p+1;E<a&&n[E]<o;)E+=1;let T=-1;return E<a&&n[E]===o&&(T=Jx(r[E],e.span.end,Zx)[0]),{touchingLevel:p,touchingLateral:g,touchingEntry:y,stackCnt:v,levelCoord:o,level:E,lateral:T}}toRects(){let{entriesByLevel:e,levelCoords:n}=this,r=e.length,i=[];for(let s=0;s<r;s+=1){let a=e[s],o=n[s];for(let p of a)i.push(Object.assign(Object.assign({},p),{thickness:this.getEntryThickness(p),levelCoord:o}))}return i}}function Zx(t){return t.span.end}function Cc(t){return t.index+":"+t.span.start}function kX(t){let e=[];for(let n of t){let r=[],i={span:n.span,entries:[n]};for(let s of e)Xx(s.span,i.span)?i={entries:s.entries.concat(i.entries),span:EX(s.span,i.span)}:r.push(s);r.push(i),e=r}return e}function EX(t,e){return{start:Math.min(t.start,e.start),end:Math.max(t.end,e.end)}}function Xx(t,e){let n=Math.max(t.start,e.start),r=Math.min(t.end,e.end);return n<r?{start:n,end:r}:null}function Kx(t,e,n){t.splice(e,0,n)}function Jx(t,e,n){let r=0,i=t.length;if(!i||e<n(t[r]))return[0,0];if(e>n(t[i-1]))return[i,0];for(;r<i;){let s=Math.floor(r+(i-r)/2),a=n(t[s]);if(e<a)i=s;else if(e>a)r=s+1;else return[s,1]}return[r,0]}class SX{constructor(e,n){this.emitter=new Lg}destroy(){}setMirrorIsVisible(e){}setMirrorNeedsRevert(e){}setAutoScrollEnabled(e){}}const Qx={};function CX(t,e){return!t||e>10?ir({weekday:"short"}):e>1?ir({weekday:"short",month:"numeric",day:"numeric",omitCommas:!0}):ir({weekday:"long"})}const YM="fc-col-header-cell";function ZM(t){return t.text}class TX extends Tn{render(){let{dateEnv:e,options:n,theme:r,viewApi:i}=this.context,{props:s}=this,{date:a,dateProfile:o}=s,p=Ux(a,s.todayRange,null,o),g=[YM].concat(Fg(p,r)),y=e.format(a,s.dayHeaderFormat),v=!p.isDisabled&&s.colCnt>1?Qd(this.context,a):{},E=Object.assign(Object.assign(Object.assign({date:e.toDate(a),view:i},s.extraRenderProps),{text:y}),p);return ce(yi,{elTag:"th",elClasses:g,elAttrs:Object.assign({role:"columnheader",colSpan:s.colSpan,"data-date":p.isDisabled?void 0:of(a)},s.extraDataAttrs),renderProps:E,generatorName:"dayHeaderContent",customGenerator:n.dayHeaderContent,defaultGenerator:ZM,classNameGenerator:n.dayHeaderClassNames,didMount:n.dayHeaderDidMount,willUnmount:n.dayHeaderWillUnmount},T=>ce("div",{className:"fc-scrollgrid-sync-inner"},!p.isDisabled&&ce(T,{elTag:"a",elAttrs:v,elClasses:["fc-col-header-cell-cushion",s.isSticky&&"fc-sticky"]})))}}const AX=ir({weekday:"long"});class MX extends Tn{render(){let{props:e}=this,{dateEnv:n,theme:r,viewApi:i,options:s}=this.context,a=Ur(new Date(2592e5),e.dow),o={dow:e.dow,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},p=n.format(a,e.dayHeaderFormat),g=Object.assign(Object.assign(Object.assign(Object.assign({date:a},o),{view:i}),e.extraRenderProps),{text:p});return ce(yi,{elTag:"th",elClasses:[YM,...Fg(o,r),...e.extraClassNames||[]],elAttrs:Object.assign({role:"columnheader",colSpan:e.colSpan},e.extraDataAttrs),renderProps:g,generatorName:"dayHeaderContent",customGenerator:s.dayHeaderContent,defaultGenerator:ZM,classNameGenerator:s.dayHeaderClassNames,didMount:s.dayHeaderDidMount,willUnmount:s.dayHeaderWillUnmount},y=>ce("div",{className:"fc-scrollgrid-sync-inner"},ce(y,{elTag:"a",elClasses:["fc-col-header-cell-cushion",e.isSticky&&"fc-sticky"],elAttrs:{"aria-label":n.format(a,AX)}})))}}class tu extends gs{constructor(e,n){super(e,n),this.initialNowDate=df(n.options.now,n.dateEnv),this.initialNowQueriedMs=new Date().valueOf(),this.state=this.computeTiming().currentState}render(){let{props:e,state:n}=this;return e.children(n.nowDate,n.todayRange)}componentDidMount(){this.setTimeout()}componentDidUpdate(e){e.unit!==this.props.unit&&(this.clearTimeout(),this.setTimeout())}componentWillUnmount(){this.clearTimeout()}computeTiming(){let{props:e,context:n}=this,r=il(this.initialNowDate,new Date().valueOf()-this.initialNowQueriedMs),i=n.dateEnv.startOf(r,e.unit),s=n.dateEnv.add(i,gn(1,e.unit)),a=s.valueOf()-r.valueOf();return a=Math.min(1e3*60*60*24,a),{currentState:{nowDate:i,todayRange:XM(i)},nextState:{nowDate:s,todayRange:XM(s)},waitMs:a}}setTimeout(){let{nextState:e,waitMs:n}=this.computeTiming();this.timeoutId=setTimeout(()=>{this.setState(e,()=>{this.setTimeout()})},n)}clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}}tu.contextType=ca;function XM(t){let e=er(t),n=Ur(e,1);return{start:e,end:n}}class KM extends Tn{constructor(){super(...arguments),this.createDayHeaderFormatter=Ft(DX)}render(){let{context:e}=this,{dates:n,dateProfile:r,datesRepDistinctDays:i,renderIntro:s}=this.props,a=this.createDayHeaderFormatter(e.options.dayHeaderFormat,i,n.length);return ce(tu,{unit:"day"},(o,p)=>ce("tr",{role:"row"},s&&s("day"),n.map(g=>i?ce(TX,{key:g.toISOString(),date:g,dateProfile:r,todayRange:p,colCnt:n.length,dayHeaderFormat:a}):ce(MX,{key:g.getUTCDay(),dow:g.getUTCDay(),dayHeaderFormat:a}))))}}function DX(t,e,n){return t||CX(e,n)}class JM{constructor(e,n){let r=e.start,{end:i}=e,s=[],a=[],o=-1;for(;r<i;)n.isHiddenDay(r)?s.push(o+.5):(o+=1,s.push(o),a.push(r)),r=Ur(r,1);this.dates=a,this.indices=s,this.cnt=a.length}sliceRange(e){let n=this.getDateDayIndex(e.start),r=this.getDateDayIndex(Ur(e.end,-1)),i=Math.max(0,n),s=Math.min(this.cnt-1,r);return i=Math.ceil(i),s=Math.floor(s),i<=s?{firstIndex:i,lastIndex:s,isStart:n===i,isEnd:r===s}:null}getDateDayIndex(e){let{indices:n}=this,r=Math.floor(sl(this.dates[0],e));return r<0?n[0]-1:r>=n.length?n[n.length-1]+1:n[r]}}class QM{constructor(e,n){let{dates:r}=e,i,s,a;if(n){for(s=r[0].getUTCDay(),i=1;i<r.length&&r[i].getUTCDay()!==s;i+=1);a=Math.ceil(r.length/i)}else a=1,i=r.length;this.rowCnt=a,this.colCnt=i,this.daySeries=e,this.cells=this.buildCells(),this.headerDates=this.buildHeaderDates()}buildCells(){let e=[];for(let n=0;n<this.rowCnt;n+=1){let r=[];for(let i=0;i<this.colCnt;i+=1)r.push(this.buildCell(n,i));e.push(r)}return e}buildCell(e,n){let r=this.daySeries.dates[e*this.colCnt+n];return{key:r.toISOString(),date:r}}buildHeaderDates(){let e=[];for(let n=0;n<this.colCnt;n+=1)e.push(this.cells[0][n].date);return e}sliceRange(e){let{colCnt:n}=this,r=this.daySeries.sliceRange(e),i=[];if(r){let{firstIndex:s,lastIndex:a}=r,o=s;for(;o<=a;){let p=Math.floor(o/n),g=Math.min((p+1)*n,a+1);i.push({row:p,firstCol:o%n,lastCol:(g-1)%n,isStart:r.isStart&&o===s,isEnd:r.isEnd&&g-1===a}),o=g}}return i}}class eD{constructor(){this.sliceBusinessHours=Ft(this._sliceBusinessHours),this.sliceDateSelection=Ft(this._sliceDateSpan),this.sliceEventStore=Ft(this._sliceEventStore),this.sliceEventDrag=Ft(this._sliceInteraction),this.sliceEventResize=Ft(this._sliceInteraction),this.forceDayIfListItem=!1}sliceProps(e,n,r,i,...s){let{eventUiBases:a}=e,o=this.sliceEventStore(e.eventStore,a,n,r,...s);return{dateSelectionSegs:this.sliceDateSelection(e.dateSelection,n,r,a,i,...s),businessHourSegs:this.sliceBusinessHours(e.businessHours,n,r,i,...s),fgEventSegs:o.fg,bgEventSegs:o.bg,eventDrag:this.sliceEventDrag(e.eventDrag,a,n,r,...s),eventResize:this.sliceEventResize(e.eventResize,a,n,r,...s),eventSelection:e.eventSelection}}sliceNowDate(e,n,r,i,...s){return this._sliceDateSpan({range:{start:e,end:il(e,1)},allDay:!1},n,r,{},i,...s)}_sliceBusinessHours(e,n,r,i,...s){return e?this._sliceEventStore(Ec(e,jg(n,!!r),i),{},n,r,...s).bg:[]}_sliceEventStore(e,n,r,i,...s){if(e){let a=zx(e,n,jg(r,!!i),i);return{bg:this.sliceEventRanges(a.bg,s),fg:this.sliceEventRanges(a.fg,s)}}return{bg:[],fg:[]}}_sliceInteraction(e,n,r,i,...s){if(!e)return null;let a=zx(e.mutatedEvents,n,jg(r,!!i),i);return{segs:this.sliceEventRanges(a.fg,s),affectedInstances:e.affectedEvents.instances,isEvent:e.isEvent}}_sliceDateSpan(e,n,r,i,s,...a){if(!e)return[];let o=jg(n,!!r),p=ll(e.range,o);if(p){e=Object.assign(Object.assign({},e),{range:p});let g=QZ(e,i,s),y=this.sliceRange(e.range,...a);for(let v of y)v.eventRange=g;return y}return[]}sliceEventRanges(e,n){let r=[];for(let i of e)r.push(...this.sliceEventRange(i,n));return r}sliceEventRange(e,n){let r=e.range;this.forceDayIfListItem&&e.ui.display==="list-item"&&(r={start:r.start,end:Ur(r.start,1)});let i=this.sliceRange(r,...n);for(let s of i)s.eventRange=e,s.isStart=e.isStart&&s.isStart,s.isEnd=e.isEnd&&s.isEnd;return i}}function jg(t,e){let n=t.activeRange;return e?n:{start:il(n.start,t.slotMinTime.milliseconds),end:il(n.end,t.slotMaxTime.milliseconds-864e5)}}function tD(t,e,n){let{instances:r}=t.mutatedEvents;for(let i in r)if(!Rg(e.validRange,r[i].range))return!1;return nD({eventDrag:t},n)}function IX(t,e,n){return Rg(e.validRange,t.range)?nD({dateSelection:t},n):!1}function nD(t,e){let n=e.getCurrentData(),r=Object.assign({businessHours:n.businessHours,dateSelection:"",eventStore:n.eventStore,eventUiBases:n.eventUiBases,eventSelection:"",eventDrag:null,eventResize:null},t);return(e.pluginHooks.isPropsValid||PX)(r,e)}function PX(t,e,n={},r){return!(t.eventDrag&&!RX(t,e,n,r)||t.dateSelection&&!OX(t,e,n,r))}function RX(t,e,n,r){let i=e.getCurrentData(),s=t.eventDrag,a=s.mutatedEvents,o=a.defs,p=a.instances,g=Vg(o,s.isEvent?t.eventUiBases:{"":i.selectionConfig});r&&(g=la(g,r));let y=IZ(t.eventStore,s.affectedEvents.instances),v=y.defs,E=y.instances,T=Vg(v,t.eventUiBases);for(let D in p){let N=p[D],B=N.range,F=g[N.defId],X=o[N.defId];if(!rD(F.constraints,B,y,t.businessHours,e))return!1;let{eventOverlap:te}=e.options,H=typeof te=="function"?te:null;for(let ge in E){let Se=E[ge];if(Tx(B,Se.range)&&(T[Se.defId].overlap===!1&&s.isEvent||F.overlap===!1||H&&!H(new lr(e,v[Se.defId],Se),new lr(e,X,N))))return!1}let ke=i.eventStore;for(let ge of F.allows){let Se=Object.assign(Object.assign({},n),{range:N.range,allDay:X.allDay}),Pe=ke.defs[X.defId],Ne=ke.instances[D],at;if(Pe?at=new lr(e,Pe,Ne):at=new lr(e,X),!ge(Nx(Se,e),at))return!1}}return!0}function OX(t,e,n,r){let i=t.eventStore,s=i.defs,a=i.instances,o=t.dateSelection,p=o.range,{selectionConfig:g}=e.getCurrentData();if(r&&(g=r(g)),!rD(g.constraints,p,i,t.businessHours,e))return!1;let{selectOverlap:y}=e.options,v=typeof y=="function"?y:null;for(let E in a){let T=a[E];if(Tx(p,T.range)&&(g.overlap===!1||v&&!v(new lr(e,s[T.defId],T),null)))return!1}for(let E of g.allows){let T=Object.assign(Object.assign({},n),o);if(!E(Nx(T,e),null))return!1}return!0}function rD(t,e,n,r,i){for(let s of t)if(!BX(NX(s,e,n,r,i),e))return!1;return!0}function NX(t,e,n,r,i){return t==="businessHours"?ev(Ec(r,e,i)):typeof t=="string"?ev(Ng(n,s=>s.groupId===t)):typeof t=="object"&&t?ev(Ec(t,e,i)):[]}function ev(t){let{instances:e}=t,n=[];for(let r in e)n.push(e[r].range);return n}function BX(t,e){for(let n of t)if(Rg(n,e))return!0;return!1}const Hg=/^(visible|hidden)$/;class iD extends Tn{constructor(){super(...arguments),this.handleEl=e=>{this.el=e,da(this.props.elRef,e)}}render(){let{props:e}=this,{liquid:n,liquidIsAbsolute:r}=e,i=n&&r,s=["fc-scroller"];return n&&(r?s.push("fc-scroller-liquid-absolute"):s.push("fc-scroller-liquid")),ce("div",{ref:this.handleEl,className:s.join(" "),style:{overflowX:e.overflowX,overflowY:e.overflowY,left:i&&-(e.overcomeLeft||0)||"",right:i&&-(e.overcomeRight||0)||"",bottom:i&&-(e.overcomeBottom||0)||"",marginLeft:!i&&-(e.overcomeLeft||0)||"",marginRight:!i&&-(e.overcomeRight||0)||"",marginBottom:!i&&-(e.overcomeBottom||0)||"",maxHeight:e.maxHeight||""}},e.children)}needsXScrolling(){if(Hg.test(this.props.overflowX))return!1;let{el:e}=this,n=this.el.getBoundingClientRect().width-this.getYScrollbarWidth(),{children:r}=e;for(let i=0;i<r.length;i+=1)if(r[i].getBoundingClientRect().width>n)return!0;return!1}needsYScrolling(){if(Hg.test(this.props.overflowY))return!1;let{el:e}=this,n=this.el.getBoundingClientRect().height-this.getXScrollbarWidth(),{children:r}=e;for(let i=0;i<r.length;i+=1)if(r[i].getBoundingClientRect().height>n)return!0;return!1}getXScrollbarWidth(){return Hg.test(this.props.overflowX)?0:this.el.offsetHeight-this.el.clientHeight}getYScrollbarWidth(){return Hg.test(this.props.overflowY)?0:this.el.offsetWidth-this.el.clientWidth}}class fa{constructor(e){this.masterCallback=e,this.currentMap={},this.depths={},this.callbackMap={},this.handleValue=(n,r)=>{let{depths:i,currentMap:s}=this,a=!1,o=!1;n!==null?(a=r in s,s[r]=n,i[r]=(i[r]||0)+1,o=!0):(i[r]-=1,i[r]||(delete s[r],delete this.callbackMap[r],a=!0)),this.masterCallback&&(a&&this.masterCallback(null,String(r)),o&&this.masterCallback(n,String(r)))}}createRef(e){let n=this.callbackMap[e];return n||(n=this.callbackMap[e]=r=>{this.handleValue(r,String(e))}),n}collect(e,n,r){return GY(this.currentMap,e,n,r)}getAll(){return wx(this.currentMap)}}function zX(t){let e=qG(t,".fc-scrollgrid-shrink"),n=0;for(let r of e)n=Math.max(n,oY(r));return Math.ceil(n)}function sD(t,e){return t.liquid&&e.liquid}function LX(t,e){return e.maxHeight!=null||sD(t,e)}function VX(t,e,n,r){let{expandRows:i}=n;return typeof e.content=="function"?e.content(n):ce("table",{role:"presentation",className:[e.tableClassName,t.syncRowHeights?"fc-scrollgrid-sync-table":""].join(" "),style:{minWidth:n.tableMinWidth,width:n.clientWidth,height:i?n.clientHeight:""}},n.tableColGroupNode,ce(r?"thead":"tbody",{role:"presentation"},typeof e.rowContent=="function"?e.rowContent(n):e.rowContent))}function FX(t,e){return rl(t,e,Po)}function $X(t,e){let n=[];for(let r of t){let i=r.span||1;for(let s=0;s<i;s+=1)n.push(ce("col",{style:{width:r.width==="shrink"?jX(e):r.width||"",minWidth:r.minWidth||""}}))}return ce("colgroup",{},...n)}function jX(t){return t??4}function HX(t){for(let e of t)if(e.width==="shrink")return!0;return!1}function UX(t,e){let n=["fc-scrollgrid",e.theme.getClass("table")];return t&&n.push("fc-scrollgrid-liquid"),n}function WX(t,e){let n=["fc-scrollgrid-section",`fc-scrollgrid-section-${t.type}`,t.className];return e&&t.liquid&&t.maxHeight==null&&n.push("fc-scrollgrid-section-liquid"),t.isSticky&&n.push("fc-scrollgrid-section-sticky"),n}function tv(t){return ce("div",{className:"fc-scrollgrid-sticky-shim",style:{width:t.clientWidth,minWidth:t.tableMinWidth}})}function Ug(t){let{stickyHeaderDates:e}=t;return(e==null||e==="auto")&&(e=t.height==="auto"||t.viewHeight==="auto"),e}function oD(t){let{stickyFooterScrollbar:e}=t;return(e==null||e==="auto")&&(e=t.height==="auto"||t.viewHeight==="auto"),e}class nv extends Tn{constructor(){super(...arguments),this.processCols=Ft(e=>e,FX),this.renderMicroColGroup=Ft($X),this.scrollerRefs=new fa,this.scrollerElRefs=new fa(this._handleScrollerEl.bind(this)),this.state={shrinkWidth:null,forceYScrollbars:!1,scrollerClientWidths:{},scrollerClientHeights:{}},this.handleSizing=()=>{this.safeSetState(Object.assign({shrinkWidth:this.computeShrinkWidth()},this.computeScrollerDims()))}}render(){let{props:e,state:n,context:r}=this,i=e.sections||[],s=this.processCols(e.cols),a=this.renderMicroColGroup(s,n.shrinkWidth),o=UX(e.liquid,r);e.collapsibleWidth&&o.push("fc-scrollgrid-collapsible");let p=i.length,g=0,y,v=[],E=[],T=[];for(;g<p&&(y=i[g]).type==="header";)v.push(this.renderSection(y,a,!0)),g+=1;for(;g<p&&(y=i[g]).type==="body";)E.push(this.renderSection(y,a,!1)),g+=1;for(;g<p&&(y=i[g]).type==="footer";)T.push(this.renderSection(y,a,!0)),g+=1;let D=!HM();const N={role:"rowgroup"};return ce("table",{role:"grid",className:o.join(" "),style:{height:e.height}},!!(!D&&v.length)&&ce("thead",N,...v),!!(!D&&E.length)&&ce("tbody",N,...E),!!(!D&&T.length)&&ce("tfoot",N,...T),D&&ce("tbody",N,...v,...E,...T))}renderSection(e,n,r){return"outerContent"in e?ce(Qn,{key:e.key},e.outerContent):ce("tr",{key:e.key,role:"presentation",className:WX(e,this.props.liquid).join(" ")},this.renderChunkTd(e,n,e.chunk,r))}renderChunkTd(e,n,r,i){if("outerContent"in r)return r.outerContent;let{props:s}=this,{forceYScrollbars:a,scrollerClientWidths:o,scrollerClientHeights:p}=this.state,g=LX(s,e),y=sD(s,e),v=s.liquid?a?"scroll":g?"auto":"hidden":"visible",E=e.key,T=VX(e,r,{tableColGroupNode:n,tableMinWidth:"",clientWidth:!s.collapsibleWidth&&o[E]!==void 0?o[E]:null,clientHeight:p[E]!==void 0?p[E]:null,expandRows:e.expandRows,syncRowHeights:!1,rowSyncHeights:[],reportRowHeightChange:()=>{}},i);return ce(i?"th":"td",{ref:r.elRef,role:"presentation"},ce("div",{className:`fc-scroller-harness${y?" fc-scroller-harness-liquid":""}`},ce(iD,{ref:this.scrollerRefs.createRef(E),elRef:this.scrollerElRefs.createRef(E),overflowY:v,overflowX:s.liquid?"hidden":"visible",maxHeight:e.maxHeight,liquid:y,liquidIsAbsolute:!0},T)))}_handleScrollerEl(e,n){let r=qX(this.props.sections,n);r&&da(r.chunk.scrollerElRef,e)}componentDidMount(){this.handleSizing(),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(){this.handleSizing()}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing)}computeShrinkWidth(){return HX(this.props.cols)?zX(this.scrollerElRefs.getAll()):0}computeScrollerDims(){let e=gX(),{scrollerRefs:n,scrollerElRefs:r}=this,i=!1,s={},a={};for(let o in n.currentMap){let p=n.currentMap[o];if(p&&p.needsYScrolling()){i=!0;break}}for(let o of this.props.sections){let p=o.key,g=r.currentMap[p];if(g){let y=g.parentNode;s[p]=Math.floor(y.getBoundingClientRect().width-(i?e.y:0)),a[p]=Math.floor(y.getBoundingClientRect().height)}}return{forceYScrollbars:i,scrollerClientWidths:s,scrollerClientHeights:a}}}nv.addStateEquality({scrollerClientWidths:Po,scrollerClientHeights:Po});function qX(t,e){for(let n of t)if(n.key===e)return n;return null}class Wg extends Tn{constructor(){super(...arguments),this.handleEl=e=>{this.el=e,e&&zM(e,this.props.seg)}}render(){const{props:e,context:n}=this,{options:r}=n,{seg:i}=e,{eventRange:s}=i,{ui:a}=s,o={event:new lr(n,s.def,s.instance),view:n.viewApi,timeText:e.timeText,textColor:a.textColor,backgroundColor:a.backgroundColor,borderColor:a.borderColor,isDraggable:!e.disableDragging&&HZ(i,n),isStartResizable:!e.disableResizing&&UZ(i,n),isEndResizable:!e.disableResizing&&WZ(i),isMirror:!!(e.isDragging||e.isResizing||e.isDateSelecting),isStart:!!i.isStart,isEnd:!!i.isEnd,isPast:!!e.isPast,isFuture:!!e.isFuture,isToday:!!e.isToday,isSelected:!!e.isSelected,isDragging:!!e.isDragging,isResizing:!!e.isResizing};return ce(yi,Object.assign({},e,{elRef:this.handleEl,elClasses:[...qZ(o),...i.eventRange.ui.classNames,...e.elClasses||[]],renderProps:o,generatorName:"eventContent",customGenerator:r.eventContent,defaultGenerator:e.defaultGenerator,classNameGenerator:r.eventClassNames,didMount:r.eventDidMount,willUnmount:r.eventWillUnmount}))}componentDidUpdate(e){this.el&&this.props.seg!==e.seg&&zM(this.el,this.props.seg)}}class aD extends Tn{render(){let{props:e,context:n}=this,{options:r}=n,{seg:i}=e,{ui:s}=i.eventRange,a=r.eventTimeFormat||e.defaultTimeFormat,o=hf(i,a,n,e.defaultDisplayEventTime,e.defaultDisplayEventEnd);return ce(Wg,Object.assign({},e,{elTag:"a",elStyle:{borderColor:s.borderColor,backgroundColor:s.backgroundColor},elAttrs:Vx(i,n),defaultGenerator:GX,timeText:o}),(p,g)=>ce(Qn,null,ce(p,{elTag:"div",elClasses:["fc-event-main"],elStyle:{color:g.textColor}}),!!g.isStartResizable&&ce("div",{className:"fc-event-resizer fc-event-resizer-start"}),!!g.isEndResizable&&ce("div",{className:"fc-event-resizer fc-event-resizer-end"})))}}function GX(t){return ce("div",{className:"fc-event-main-frame"},t.timeText&&ce("div",{className:"fc-event-time"},t.timeText),ce("div",{className:"fc-event-title-container"},ce("div",{className:"fc-event-title fc-sticky"},t.event.title||ce(Qn,null," "))))}const rv=t=>ce(ca.Consumer,null,e=>{let{options:n}=e,r={isAxis:t.isAxis,date:e.dateEnv.toDate(t.date),view:e.viewApi};return ce(yi,Object.assign({},t,{elTag:t.elTag||"div",renderProps:r,generatorName:"nowIndicatorContent",customGenerator:n.nowIndicatorContent,classNameGenerator:n.nowIndicatorClassNames,didMount:n.nowIndicatorDidMount,willUnmount:n.nowIndicatorWillUnmount}))}),YX=ir({day:"numeric"});class iv extends Tn{constructor(){super(...arguments),this.refineRenderProps=Cg(ZX)}render(){let{props:e,context:n}=this,{options:r}=n,i=this.refineRenderProps({date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,isMonthStart:e.isMonthStart||!1,showDayNumber:e.showDayNumber,extraRenderProps:e.extraRenderProps,viewApi:n.viewApi,dateEnv:n.dateEnv,monthStartFormat:r.monthStartFormat});return ce(yi,Object.assign({},e,{elClasses:[...Fg(i,n.theme),...e.elClasses||[]],elAttrs:Object.assign(Object.assign({},e.elAttrs),i.isDisabled?{}:{"data-date":of(e.date)}),renderProps:i,generatorName:"dayCellContent",customGenerator:r.dayCellContent,defaultGenerator:e.defaultGenerator,classNameGenerator:i.isDisabled?void 0:r.dayCellClassNames,didMount:r.dayCellDidMount,willUnmount:r.dayCellWillUnmount}))}}function sv(t){return!!(t.dayCellContent||Cx("dayCellContent",t))}function ZX(t){let{date:e,dateEnv:n,dateProfile:r,isMonthStart:i}=t,s=Ux(e,t.todayRange,null,r),a=t.showDayNumber?n.format(e,i?t.monthStartFormat:YX):"";return Object.assign(Object.assign(Object.assign({date:n.toDate(e),view:t.viewApi},s),{isMonthStart:i,dayNumberText:a}),t.extraRenderProps)}class lD extends Tn{render(){let{props:e}=this,{seg:n}=e;return ce(Wg,{elTag:"div",elClasses:["fc-bg-event"],elStyle:{backgroundColor:n.eventRange.ui.backgroundColor},defaultGenerator:XX,seg:n,timeText:"",isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,disableDragging:!0,disableResizing:!0})}}function XX(t){let{title:e}=t.event;return e&&ce("div",{className:"fc-event-title"},t.event.title)}function cD(t){return ce("div",{className:`fc-${t}`})}const dD=t=>ce(ca.Consumer,null,e=>{let{dateEnv:n,options:r}=e,{date:i}=t,s=r.weekNumberFormat||t.defaultFormat,a=n.computeWeekNumber(i),o=n.format(i,s);return ce(yi,Object.assign({},t,{renderProps:{num:a,text:o,date:i},generatorName:"weekNumberContent",customGenerator:r.weekNumberContent,defaultGenerator:KX,classNameGenerator:r.weekNumberClassNames,didMount:r.weekNumberDidMount,willUnmount:r.weekNumberWillUnmount}))});function KX(t){return t.text}const ov=10;class JX extends Tn{constructor(){super(...arguments),this.state={titleId:nl()},this.handleRootEl=e=>{this.rootEl=e,this.props.elRef&&da(this.props.elRef,e)},this.handleDocumentMouseDown=e=>{const n=YA(e);this.rootEl.contains(n)||this.handleCloseClick()},this.handleDocumentKeyDown=e=>{e.key==="Escape"&&this.handleCloseClick()},this.handleCloseClick=()=>{let{onClose:e}=this.props;e&&e()}}render(){let{theme:e,options:n}=this.context,{props:r,state:i}=this,s=["fc-popover",e.getClass("popover")].concat(r.extraClassNames||[]);return PG(ce("div",Object.assign({},r.extraAttrs,{id:r.id,className:s.join(" "),"aria-labelledby":i.titleId,ref:this.handleRootEl}),ce("div",{className:"fc-popover-header "+e.getClass("popoverHeader")},ce("span",{className:"fc-popover-title",id:i.titleId},r.title),ce("span",{className:"fc-popover-close "+e.getIconClass("close"),title:n.closeHint,onClick:this.handleCloseClick})),ce("div",{className:"fc-popover-body "+e.getClass("popoverContent")},r.children)),r.parentEl)}componentDidMount(){document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown),this.updateSize()}componentWillUnmount(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown)}updateSize(){let{isRtl:e}=this.context,{alignmentEl:n,alignGridTop:r}=this.props,{rootEl:i}=this,s=xX(n);if(s){let a=i.getBoundingClientRect(),o=r?gi(n,".fc-scrollgrid").getBoundingClientRect().top:s.top,p=e?s.right-a.width:s.left;o=Math.max(o,ov),p=Math.min(p,document.documentElement.clientWidth-ov-a.width),p=Math.max(p,ov);let g=i.offsetParent.getBoundingClientRect();rf(i,{top:o-g.top,left:p-g.left})}}}class QX extends co{constructor(){super(...arguments),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,useEventCenter:!1}):this.context.unregisterInteractiveComponent(this)}}render(){let{options:e,dateEnv:n}=this.context,{props:r}=this,{startDate:i,todayRange:s,dateProfile:a}=r,o=n.format(i,e.dayPopoverFormat);return ce(iv,{elRef:this.handleRootEl,date:i,dateProfile:a,todayRange:s},(p,g,y)=>ce(JX,{elRef:y.ref,id:r.id,title:o,extraClassNames:["fc-more-popover"].concat(y.className||[]),extraAttrs:y,parentEl:r.parentEl,alignmentEl:r.alignmentEl,alignGridTop:r.alignGridTop,onClose:r.onClose},sv(e)&&ce(p,{elTag:"div",elClasses:["fc-more-popover-misc"]}),r.children))}queryHit(e,n,r,i){let{rootEl:s,props:a}=this;return e>=0&&e<r&&n>=0&&n<i?{dateProfile:a.dateProfile,dateSpan:Object.assign({allDay:!a.forceTimed,range:{start:a.startDate,end:a.endDate}},a.extraDateSpan),dayEl:s,rect:{left:0,top:0,right:r,bottom:i},layer:1}:null}}class uD extends Tn{constructor(){super(...arguments),this.state={isPopoverOpen:!1,popoverId:nl()},this.handleLinkEl=e=>{this.linkEl=e,this.props.elRef&&da(this.props.elRef,e)},this.handleClick=e=>{let{props:n,context:r}=this,{moreLinkClick:i}=r.options,s=hD(n).start;function a(o){let{def:p,instance:g,range:y}=o.eventRange;return{event:new lr(r,p,g),start:r.dateEnv.toDate(y.start),end:r.dateEnv.toDate(y.end),isStart:o.isStart,isEnd:o.isEnd}}typeof i=="function"&&(i=i({date:s,allDay:!!n.allDayDate,allSegs:n.allSegs.map(a),hiddenSegs:n.hiddenSegs.map(a),jsEvent:e,view:r.viewApi})),!i||i==="popover"?this.setState({isPopoverOpen:!0}):typeof i=="string"&&r.calendarApi.zoomTo(s,i)},this.handlePopoverClose=()=>{this.setState({isPopoverOpen:!1})}}render(){let{props:e,state:n}=this;return ce(ca.Consumer,null,r=>{let{viewApi:i,options:s,calendarApi:a}=r,{moreLinkText:o}=s,{moreCnt:p}=e,g=hD(e),y=typeof o=="function"?o.call(a,p):`+${p} ${o}`,v=sf(s.moreLinkHint,[p],y),E={num:p,shortText:`+${p}`,text:y,view:i};return ce(Qn,null,!!e.moreCnt&&ce(yi,{elTag:e.elTag||"a",elRef:this.handleLinkEl,elClasses:[...e.elClasses||[],"fc-more-link"],elStyle:e.elStyle,elAttrs:Object.assign(Object.assign(Object.assign({},e.elAttrs),JA(this.handleClick)),{title:v,"aria-expanded":n.isPopoverOpen,"aria-controls":n.isPopoverOpen?n.popoverId:""}),renderProps:E,generatorName:"moreLinkContent",customGenerator:s.moreLinkContent,defaultGenerator:e.defaultGenerator||eK,classNameGenerator:s.moreLinkClassNames,didMount:s.moreLinkDidMount,willUnmount:s.moreLinkWillUnmount},e.children),n.isPopoverOpen&&ce(QX,{id:n.popoverId,startDate:g.start,endDate:g.end,dateProfile:e.dateProfile,todayRange:e.todayRange,extraDateSpan:e.extraDateSpan,parentEl:this.parentEl,alignmentEl:e.alignmentElRef?e.alignmentElRef.current:this.linkEl,alignGridTop:e.alignGridTop,forceTimed:e.forceTimed,onClose:this.handlePopoverClose},e.popoverContent()))})}componentDidMount(){this.updateParentEl()}componentDidUpdate(){this.updateParentEl()}updateParentEl(){this.linkEl&&(this.parentEl=gi(this.linkEl,".fc-view-harness"))}}function eK(t){return t.text}function hD(t){if(t.allDayDate)return{start:t.allDayDate,end:Ur(t.allDayDate,1)};let{hiddenSegs:e}=t;return{start:fD(e),end:nK(e)}}function fD(t){return t.reduce(tK).eventRange.range.start}function tK(t,e){return t.eventRange.range.start<e.eventRange.range.start?t:e}function nK(t){return t.reduce(rK).eventRange.range.end}function rK(t,e){return t.eventRange.range.end>e.eventRange.range.end?t:e}class iK{constructor(){this.handlers=[]}set(e){this.currentValue=e;for(let n of this.handlers)n(e)}subscribe(e){this.handlers.push(e),this.currentValue!==void 0&&e(this.currentValue)}}class sK extends iK{constructor(){super(...arguments),this.map=new Map}handle(e){const{map:n}=this;let r=!1;e.isActive?(n.set(e.id,e),r=!0):n.has(e.id)&&(n.delete(e.id),r=!0),r&&this.set(n)}}const oK=[],pD={code:"en",week:{dow:0,doy:4},direction:"ltr",buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day",list:"list"},weekText:"W",weekTextLong:"Week",closeHint:"Close",timeHint:"Time",eventHint:"Event",allDayText:"all-day",moreLinkText:"more",noEventsText:"No events to display"},mD=Object.assign(Object.assign({},pD),{buttonHints:{prev:"Previous $0",next:"Next $0",today(t,e){return e==="day"?"Today":`This ${t}`}},viewHint:"$0 view",navLinkHint:"Go to $0",moreLinkHint(t){return`Show ${t} more event${t===1?"":"s"}`}});function aK(t){let e=t.length>0?t[0].code:"en",n=oK.concat(t),r={en:mD};for(let i of n)r[i.code]=i;return{map:r,defaultCode:e}}function gD(t,e){return typeof t=="object"&&!Array.isArray(t)?yD(t.code,[t.code],t):lK(t,e)}function lK(t,e){let n=[].concat(t||[]),r=cK(n,e)||mD;return yD(t,n,r)}function cK(t,e){for(let n=0;n<t.length;n+=1){let r=t[n].toLocaleLowerCase().split("-");for(let i=r.length;i>0;i-=1){let s=r.slice(0,i).join("-");if(e[s])return e[s]}}return null}function yD(t,e,n){let r=vx([pD,n],["buttonText"]);delete r.code;let{week:i}=r;return delete r.week,{codeArg:t,codes:e,week:i,simpleNumberFormat:new Intl.NumberFormat(t),options:r}}function Ro(t){return{id:_c(),name:t.name,premiumReleaseDate:t.premiumReleaseDate?new Date(t.premiumReleaseDate):void 0,deps:t.deps||[],reducers:t.reducers||[],isLoadingFuncs:t.isLoadingFuncs||[],contextInit:[].concat(t.contextInit||[]),eventRefiners:t.eventRefiners||{},eventDefMemberAdders:t.eventDefMemberAdders||[],eventSourceRefiners:t.eventSourceRefiners||{},isDraggableTransformers:t.isDraggableTransformers||[],eventDragMutationMassagers:t.eventDragMutationMassagers||[],eventDefMutationAppliers:t.eventDefMutationAppliers||[],dateSelectionTransformers:t.dateSelectionTransformers||[],datePointTransforms:t.datePointTransforms||[],dateSpanTransforms:t.dateSpanTransforms||[],views:t.views||{},viewPropsTransformers:t.viewPropsTransformers||[],isPropsValid:t.isPropsValid||null,externalDefTransforms:t.externalDefTransforms||[],viewContainerAppends:t.viewContainerAppends||[],eventDropTransformers:t.eventDropTransformers||[],componentInteractions:t.componentInteractions||[],calendarInteractions:t.calendarInteractions||[],themeClasses:t.themeClasses||{},eventSourceDefs:t.eventSourceDefs||[],cmdFormatter:t.cmdFormatter,recurringTypes:t.recurringTypes||[],namedTimeZonedImpl:t.namedTimeZonedImpl,initialView:t.initialView||"",elementDraggingImpl:t.elementDraggingImpl,optionChangeHandlers:t.optionChangeHandlers||{},scrollGridImpl:t.scrollGridImpl||null,listenerRefiners:t.listenerRefiners||{},optionRefiners:t.optionRefiners||{},propSetHandlers:t.propSetHandlers||{}}}function dK(t,e){let n={},r={premiumReleaseDate:void 0,reducers:[],isLoadingFuncs:[],contextInit:[],eventRefiners:{},eventDefMemberAdders:[],eventSourceRefiners:{},isDraggableTransformers:[],eventDragMutationMassagers:[],eventDefMutationAppliers:[],dateSelectionTransformers:[],datePointTransforms:[],dateSpanTransforms:[],views:{},viewPropsTransformers:[],isPropsValid:null,externalDefTransforms:[],viewContainerAppends:[],eventDropTransformers:[],componentInteractions:[],calendarInteractions:[],themeClasses:{},eventSourceDefs:[],cmdFormatter:null,recurringTypes:[],namedTimeZonedImpl:null,initialView:"",elementDraggingImpl:null,optionChangeHandlers:{},scrollGridImpl:null,listenerRefiners:{},optionRefiners:{},propSetHandlers:{}};function i(s){for(let a of s){const o=a.name,p=n[o];p===void 0?(n[o]=a.id,i(a.deps),r=hK(r,a)):p!==a.id&&console.warn(`Duplicate plugin '${o}'`)}}return t&&i(t),i(e),r}function uK(){let t=[],e=[],n;return(r,i)=>((!n||!rl(r,t)||!rl(i,e))&&(n=dK(r,i)),t=r,e=i,n)}function hK(t,e){return{premiumReleaseDate:fK(t.premiumReleaseDate,e.premiumReleaseDate),reducers:t.reducers.concat(e.reducers),isLoadingFuncs:t.isLoadingFuncs.concat(e.isLoadingFuncs),contextInit:t.contextInit.concat(e.contextInit),eventRefiners:Object.assign(Object.assign({},t.eventRefiners),e.eventRefiners),eventDefMemberAdders:t.eventDefMemberAdders.concat(e.eventDefMemberAdders),eventSourceRefiners:Object.assign(Object.assign({},t.eventSourceRefiners),e.eventSourceRefiners),isDraggableTransformers:t.isDraggableTransformers.concat(e.isDraggableTransformers),eventDragMutationMassagers:t.eventDragMutationMassagers.concat(e.eventDragMutationMassagers),eventDefMutationAppliers:t.eventDefMutationAppliers.concat(e.eventDefMutationAppliers),dateSelectionTransformers:t.dateSelectionTransformers.concat(e.dateSelectionTransformers),datePointTransforms:t.datePointTransforms.concat(e.datePointTransforms),dateSpanTransforms:t.dateSpanTransforms.concat(e.dateSpanTransforms),views:Object.assign(Object.assign({},t.views),e.views),viewPropsTransformers:t.viewPropsTransformers.concat(e.viewPropsTransformers),isPropsValid:e.isPropsValid||t.isPropsValid,externalDefTransforms:t.externalDefTransforms.concat(e.externalDefTransforms),viewContainerAppends:t.viewContainerAppends.concat(e.viewContainerAppends),eventDropTransformers:t.eventDropTransformers.concat(e.eventDropTransformers),calendarInteractions:t.calendarInteractions.concat(e.calendarInteractions),componentInteractions:t.componentInteractions.concat(e.componentInteractions),themeClasses:Object.assign(Object.assign({},t.themeClasses),e.themeClasses),eventSourceDefs:t.eventSourceDefs.concat(e.eventSourceDefs),cmdFormatter:e.cmdFormatter||t.cmdFormatter,recurringTypes:t.recurringTypes.concat(e.recurringTypes),namedTimeZonedImpl:e.namedTimeZonedImpl||t.namedTimeZonedImpl,initialView:t.initialView||e.initialView,elementDraggingImpl:t.elementDraggingImpl||e.elementDraggingImpl,optionChangeHandlers:Object.assign(Object.assign({},t.optionChangeHandlers),e.optionChangeHandlers),scrollGridImpl:e.scrollGridImpl||t.scrollGridImpl,listenerRefiners:Object.assign(Object.assign({},t.listenerRefiners),e.listenerRefiners),optionRefiners:Object.assign(Object.assign({},t.optionRefiners),e.optionRefiners),propSetHandlers:Object.assign(Object.assign({},t.propSetHandlers),e.propSetHandlers)}}function fK(t,e){return t===void 0?e:e===void 0?t:new Date(Math.max(t.valueOf(),e.valueOf()))}class cl extends lf{}cl.prototype.classes={root:"fc-theme-standard",tableCellShaded:"fc-cell-shaded",buttonGroup:"fc-button-group",button:"fc-button fc-button-primary",buttonActive:"fc-button-active"},cl.prototype.baseIconClass="fc-icon",cl.prototype.iconClasses={close:"fc-icon-x",prev:"fc-icon-chevron-left",next:"fc-icon-chevron-right",prevYear:"fc-icon-chevrons-left",nextYear:"fc-icon-chevrons-right"},cl.prototype.rtlIconClasses={prev:"fc-icon-chevron-right",next:"fc-icon-chevron-left",prevYear:"fc-icon-chevrons-right",nextYear:"fc-icon-chevrons-left"},cl.prototype.iconOverrideOption="buttonIcons",cl.prototype.iconOverrideCustomButtonOption="icon",cl.prototype.iconOverridePrefix="fc-icon-";function pK(t,e){let n={},r;for(r in t)av(r,n,t,e);for(r in e)av(r,n,t,e);return n}function av(t,e,n,r){if(e[t])return e[t];let i=mK(t,e,n,r);return i&&(e[t]=i),i}function mK(t,e,n,r){let i=n[t],s=r[t],a=y=>i&&i[y]!==null?i[y]:s&&s[y]!==null?s[y]:null,o=a("component"),p=a("superType"),g=null;if(p){if(p===t)throw new Error("Can't have a custom view type that references itself");g=av(p,e,n,r)}return!o&&g&&(o=g.component),o?{type:t,component:o,defaults:Object.assign(Object.assign({},g?g.defaults:{}),i?i.rawOptions:{}),overrides:Object.assign(Object.assign({},g?g.overrides:{}),s?s.rawOptions:{})}:null}function bD(t){return la(t,gK)}function gK(t){let e=typeof t=="function"?{component:t}:t,{component:n}=e;return e.content?n=_D(e):n&&!(n.prototype instanceof Tn)&&(n=_D(Object.assign(Object.assign({},e),{content:n}))),{superType:e.type,component:n,rawOptions:e}}function _D(t){return e=>ce(ca.Consumer,null,n=>ce(yi,{elTag:"div",elClasses:_M(n.viewSpec),renderProps:Object.assign(Object.assign({},e),{nextDayThreshold:n.options.nextDayThreshold}),generatorName:void 0,customGenerator:t.content,classNameGenerator:t.classNames,didMount:t.didMount,willUnmount:t.willUnmount}))}function yK(t,e,n,r){let i=bD(t),s=bD(e.views),a=pK(i,s);return la(a,o=>bK(o,s,e,n,r))}function bK(t,e,n,r,i){let s=t.overrides.duration||t.defaults.duration||r.duration||n.duration,a=null,o="",p="",g={};if(s&&(a=_K(s),a)){let E=gx(a);o=E.unit,E.value===1&&(p=o,g=e[o]?e[o].rawOptions:{})}let y=E=>{let T=E.buttonText||{},D=t.defaults.buttonTextKey;return D!=null&&T[D]!=null?T[D]:T[t.type]!=null?T[t.type]:T[p]!=null?T[p]:null},v=E=>{let T=E.buttonHints||{},D=t.defaults.buttonTextKey;return D!=null&&T[D]!=null?T[D]:T[t.type]!=null?T[t.type]:T[p]!=null?T[p]:null};return{type:t.type,component:t.component,duration:a,durationUnit:o,singleUnit:p,optionDefaults:t.defaults,optionOverrides:Object.assign(Object.assign({},g),t.overrides),buttonTextOverride:y(r)||y(n)||t.overrides.buttonText,buttonTextDefault:y(i)||t.defaults.buttonText||y(af)||t.type,buttonTitleOverride:v(r)||v(n)||t.overrides.buttonHint,buttonTitleDefault:v(i)||t.defaults.buttonHint||v(af)}}let xD={};function _K(t){let e=JSON.stringify(t),n=xD[e];return n===void 0&&(n=gn(t),xD[e]=n),n}function xK(t,e){switch(e.type){case"CHANGE_VIEW_TYPE":t=e.viewType}return t}function vK(t,e){switch(e.type){case"SET_OPTION":return Object.assign(Object.assign({},t),{[e.optionName]:e.rawOptionValue});default:return t}}function wK(t,e,n,r){let i;switch(e.type){case"CHANGE_VIEW_TYPE":return r.build(e.dateMarker||n);case"CHANGE_DATE":return r.build(e.dateMarker);case"PREV":if(i=r.buildPrev(t,n),i.isValid)return i;break;case"NEXT":if(i=r.buildNext(t,n),i.isValid)return i;break}return t}function kK(t,e,n){let r=e?e.activeRange:null;return wD({},DK(t,n),r,n)}function EK(t,e,n,r){let i=n?n.activeRange:null;switch(e.type){case"ADD_EVENT_SOURCES":return wD(t,e.sources,i,r);case"REMOVE_EVENT_SOURCE":return CK(t,e.sourceId);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return n?kD(t,i,r):t;case"FETCH_EVENT_SOURCES":return lv(t,e.sourceIds?pM(e.sourceIds):ED(t,r),i,e.isRefetch||!1,r);case"RECEIVE_EVENTS":case"RECEIVE_EVENT_ERROR":return MK(t,e.sourceId,e.fetchId,e.fetchRange);case"REMOVE_ALL_EVENT_SOURCES":return{};default:return t}}function SK(t,e,n){let r=e?e.activeRange:null;return lv(t,ED(t,n),r,!0,n)}function vD(t){for(let e in t)if(t[e].isFetching)return!0;return!1}function wD(t,e,n,r){let i={};for(let s of e)i[s.sourceId]=s;return n&&(i=kD(i,n,r)),Object.assign(Object.assign({},t),i)}function CK(t,e){return wc(t,n=>n.sourceId!==e)}function kD(t,e,n){return lv(t,wc(t,r=>TK(r,e,n)),e,!1,n)}function TK(t,e,n){return SD(t,n)?!n.options.lazyFetching||!t.fetchRange||t.isFetching||e.start<t.fetchRange.start||e.end>t.fetchRange.end:!t.latestFetchId}function lv(t,e,n,r,i){let s={};for(let a in t){let o=t[a];e[a]?s[a]=AK(o,n,r,i):s[a]=o}return s}function AK(t,e,n,r){let{options:i,calendarApi:s}=r,a=r.pluginHooks.eventSourceDefs[t.sourceDefId],o=_c();return a.fetch({eventSource:t,range:e,isRefetch:n,context:r},p=>{let{rawEvents:g}=p;i.eventSourceSuccess&&(g=i.eventSourceSuccess.call(s,g,p.response)||g),t.success&&(g=t.success.call(s,g,p.response)||g),r.dispatch({type:"RECEIVE_EVENTS",sourceId:t.sourceId,fetchId:o,fetchRange:e,rawEvents:g})},p=>{let g=!1;i.eventSourceFailure&&(i.eventSourceFailure.call(s,p),g=!0),t.failure&&(t.failure(p),g=!0),g||console.warn(p.message,p),r.dispatch({type:"RECEIVE_EVENT_ERROR",sourceId:t.sourceId,fetchId:o,fetchRange:e,error:p})}),Object.assign(Object.assign({},t),{isFetching:!0,latestFetchId:o})}function MK(t,e,n,r){let i=t[e];return i&&n===i.latestFetchId?Object.assign(Object.assign({},t),{[e]:Object.assign(Object.assign({},i),{isFetching:!1,fetchRange:r})}):t}function ED(t,e){return wc(t,n=>SD(n,e))}function DK(t,e){let n=MM(e),r=[].concat(t.eventSources||[]),i=[];t.initialEvents&&r.unshift(t.initialEvents),t.events&&r.unshift(t.events);for(let s of r){let a=AM(s,e,n);a&&i.push(a)}return i}function SD(t,e){return!e.pluginHooks.eventSourceDefs[t.sourceDefId].ignoreRange}function IK(t,e){switch(e.type){case"UNSELECT_DATES":return null;case"SELECT_DATES":return e.selection;default:return t}}function PK(t,e){switch(e.type){case"UNSELECT_EVENT":return"";case"SELECT_EVENT":return e.eventInstanceId;default:return t}}function RK(t,e){let n;switch(e.type){case"UNSET_EVENT_DRAG":return null;case"SET_EVENT_DRAG":return n=e.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return t}}function OK(t,e){let n;switch(e.type){case"UNSET_EVENT_RESIZE":return null;case"SET_EVENT_RESIZE":return n=e.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return t}}function NK(t,e,n,r,i){let s=t.headerToolbar?CD(t.headerToolbar,t,e,n,r,i):null,a=t.footerToolbar?CD(t.footerToolbar,t,e,n,r,i):null;return{header:s,footer:a}}function CD(t,e,n,r,i,s){let a={},o=[],p=!1;for(let g in t){let y=t[g],v=BK(y,e,n,r,i,s);a[g]=v.widgets,o.push(...v.viewsWithButtons),p=p||v.hasTitle}return{sectionWidgets:a,viewsWithButtons:o,hasTitle:p}}function BK(t,e,n,r,i,s){let a=e.direction==="rtl",o=e.customButtons||{},p=n.buttonText||{},g=e.buttonText||{},y=n.buttonHints||{},v=e.buttonHints||{},E=t?t.split(" "):[],T=[],D=!1;return{widgets:E.map(B=>B.split(",").map(F=>{if(F==="title")return D=!0,{buttonName:F};let X,te,H,ke,ge,Se;if(X=o[F])H=Pe=>{X.click&&X.click.call(Pe.target,Pe,Pe.target)},(ke=r.getCustomButtonIconClass(X))||(ke=r.getIconClass(F,a))||(ge=X.text),Se=X.hint||X.text;else if(te=i[F]){T.push(F),H=()=>{s.changeView(F)},(ge=te.buttonTextOverride)||(ke=r.getIconClass(F,a))||(ge=te.buttonTextDefault);let Pe=te.buttonTextOverride||te.buttonTextDefault;Se=sf(te.buttonTitleOverride||te.buttonTitleDefault||e.viewHint,[Pe,F],Pe)}else if(s[F])if(H=()=>{s[F]()},(ge=p[F])||(ke=r.getIconClass(F,a))||(ge=g[F]),F==="prevYear"||F==="nextYear"){let Pe=F==="prevYear"?"prev":"next";Se=sf(y[Pe]||v[Pe],[g.year||"year","year"],g[F])}else Se=Pe=>sf(y[F]||v[F],[g[Pe]||Pe,Pe],g[F]);return{buttonName:F,buttonClick:H,buttonIcon:ke,buttonText:ge,buttonHint:Se}})),viewsWithButtons:T,hasTitle:D}}class zK{constructor(e,n,r){this.type=e,this.getCurrentData=n,this.dateEnv=r}get calendar(){return this.getCurrentData().calendarApi}get title(){return this.getCurrentData().viewTitle}get activeStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start)}get activeEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end)}get currentStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start)}get currentEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end)}getOption(e){return this.getCurrentData().options[e]}}const LK=Ro({name:"array-event-source",eventSourceDefs:[{ignoreRange:!0,parseMeta(t){return Array.isArray(t.events)?t.events:null},fetch(t,e){e({rawEvents:t.eventSource.meta})}}]}),VK=Ro({name:"func-event-source",eventSourceDefs:[{parseMeta(t){return typeof t.events=="function"?t.events:null},fetch(t,e,n){const{dateEnv:r}=t.context,i=t.eventSource.meta;eX(i.bind(null,FM(t.range,r)),s=>e({rawEvents:s}),n)}}]}),FK=Ro({name:"json-event-source",eventSourceRefiners:{method:String,extraParams:De,startParam:String,endParam:String,timeZoneParam:String},eventSourceDefs:[{parseMeta(t){return t.url&&(t.format==="json"||!t.format)?{url:t.url,format:"json",method:(t.method||"GET").toUpperCase(),extraParams:t.extraParams,startParam:t.startParam,endParam:t.endParam,timeZoneParam:t.timeZoneParam}:null},fetch(t,e,n){const{meta:r}=t.eventSource,i=$K(r,t.range,t.context);tX(r.method,r.url,i).then(([s,a])=>{e({rawEvents:s,response:a})},n)}}]});function $K(t,e,n){let{dateEnv:r,options:i}=n,s,a,o,p,g={};return s=t.startParam,s==null&&(s=i.startParam),a=t.endParam,a==null&&(a=i.endParam),o=t.timeZoneParam,o==null&&(o=i.timeZoneParam),typeof t.extraParams=="function"?p=t.extraParams():p=t.extraParams||{},Object.assign(g,p),g[s]=r.formatIso(e.start),g[a]=r.formatIso(e.end),r.timeZone!=="local"&&(g[o]=r.timeZone),g}const jK=Ro({name:"simple-recurring-event",recurringTypes:[{parse(t,e){if(t.daysOfWeek||t.startTime||t.endTime||t.startRecur||t.endRecur){let n={daysOfWeek:t.daysOfWeek||null,startTime:t.startTime||null,endTime:t.endTime||null,startRecur:t.startRecur?e.createMarker(t.startRecur):null,endRecur:t.endRecur?e.createMarker(t.endRecur):null},r;return t.duration&&(r=t.duration),!r&&t.startTime&&t.endTime&&(r=dY(t.endTime,t.startTime)),{allDayGuess:!t.startTime&&!t.endTime,duration:r,typeData:n}}return null},expand(t,e,n){let r=ll(e,{start:t.startRecur,end:t.endRecur});return r?HK(t.daysOfWeek,t.startTime,r,n):[]}}],eventRefiners:{daysOfWeek:De,startTime:gn,endTime:gn,duration:gn,startRecur:De,endRecur:De}});function HK(t,e,n,r){let i=t?pM(t):null,s=er(n.start),a=n.end,o=[];for(;s<a;){let p;(!i||i[s.getUTCDay()])&&(e?p=r.add(s,e):p=s,o.push(p)),s=Ur(s,1)}return o}const UK=Ro({name:"change-handler",optionChangeHandlers:{events(t,e){TD([t],e)},eventSources:TD}});function TD(t,e){let n=wx(e.getCurrentData().eventSources);if(n.length===1&&t.length===1&&Array.isArray(n[0]._raw)&&Array.isArray(t[0])){e.dispatch({type:"RESET_RAW_EVENTS",sourceId:n[0].sourceId,rawEvents:t[0]});return}let r=[];for(let i of t){let s=!1;for(let a=0;a<n.length;a+=1)if(n[a]._raw===i){n.splice(a,1),s=!0;break}s||r.push(i)}for(let i of n)e.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:i.sourceId});for(let i of r)e.calendarApi.addEventSource(i)}function WK(t,e){e.emitter.trigger("datesSet",Object.assign(Object.assign({},FM(t.activeRange,e.dateEnv)),{view:e.viewApi}))}function qK(t,e){let{emitter:n}=e;n.hasHandlers("eventsSet")&&n.trigger("eventsSet",Sc(t,e))}const GK=[LK,VK,FK,jK,UK,Ro({name:"misc",isLoadingFuncs:[t=>vD(t.eventSources)],propSetHandlers:{dateProfile:WK,eventStore:qK}})];class YK{constructor(e,n){this.runTaskOption=e,this.drainedOption=n,this.queue=[],this.delayedRunner=new dx(this.drain.bind(this))}request(e,n){this.queue.push(e),this.delayedRunner.request(n)}pause(e){this.delayedRunner.pause(e)}resume(e,n){this.delayedRunner.resume(e,n)}drain(){let{queue:e}=this;for(;e.length;){let n=[],r;for(;r=e.shift();)this.runTask(r),n.push(r);this.drained(n)}}runTask(e){this.runTaskOption&&this.runTaskOption(e)}drained(e){this.drainedOption&&this.drainedOption(e)}}function ZK(t,e,n){let r;return/^(year|month)$/.test(t.currentRangeUnit)?r=t.currentRange:r=t.activeRange,n.formatRange(r.start,r.end,ir(e.titleFormat||XK(t)),{isEndExclusive:t.isRangeAllDay,defaultSeparator:e.titleRangeSeparator})}function XK(t){let{currentRangeUnit:e}=t;if(e==="year")return{year:"numeric"};if(e==="month")return{year:"numeric",month:"long"};let n=Sg(t.currentRange.start,t.currentRange.end);return n!==null&&n>1?{year:"numeric",month:"short",day:"numeric"}:{year:"numeric",month:"long",day:"numeric"}}class KK{constructor(e){this.computeCurrentViewData=Ft(this._computeCurrentViewData),this.organizeRawLocales=Ft(aK),this.buildLocale=Ft(gD),this.buildPluginHooks=uK(),this.buildDateEnv=Ft(JK),this.buildTheme=Ft(QK),this.parseToolbars=Ft(NK),this.buildViewSpecs=Ft(yK),this.buildDateProfileGenerator=Cg(eJ),this.buildViewApi=Ft(tJ),this.buildViewUiProps=Cg(iJ),this.buildEventUiBySource=Ft(nJ,Po),this.buildEventUiBases=Ft(rJ),this.parseContextBusinessHours=Cg(sJ),this.buildTitle=Ft(ZK),this.emitter=new Lg,this.actionRunner=new YK(this._handleAction.bind(this),this.updateData.bind(this)),this.currentCalendarOptionsInput={},this.currentCalendarOptionsRefined={},this.currentViewOptionsInput={},this.currentViewOptionsRefined={},this.currentCalendarOptionsRefiners={},this.optionsForRefining=[],this.optionsForHandling=[],this.getCurrentData=()=>this.data,this.dispatch=E=>{this.actionRunner.request(E)},this.props=e,this.actionRunner.pause();let n={},r=this.computeOptionsData(e.optionOverrides,n,e.calendarApi),i=r.calendarOptions.initialView||r.pluginHooks.initialView,s=this.computeCurrentViewData(i,r,e.optionOverrides,n);e.calendarApi.currentDataManager=this,this.emitter.setThisContext(e.calendarApi),this.emitter.setOptions(s.options);let a=pZ(r.calendarOptions,r.dateEnv),o=s.dateProfileGenerator.build(a);ua(o.activeRange,a)||(a=o.currentRange.start);let p={dateEnv:r.dateEnv,options:r.calendarOptions,pluginHooks:r.pluginHooks,calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData};for(let E of r.pluginHooks.contextInit)E(p);let g=kK(r.calendarOptions,o,p),y={dynamicOptionOverrides:n,currentViewType:i,currentDate:a,dateProfile:o,businessHours:this.parseContextBusinessHours(p),eventSources:g,eventUiBases:{},eventStore:ys(),renderableEventStore:ys(),dateSelection:null,eventSelection:"",eventDrag:null,eventResize:null,selectionConfig:this.buildViewUiProps(p).selectionConfig},v=Object.assign(Object.assign({},p),y);for(let E of r.pluginHooks.reducers)Object.assign(y,E(null,null,v));cv(y,p)&&this.emitter.trigger("loading",!0),this.state=y,this.updateData(),this.actionRunner.resume()}resetOptions(e,n){let{props:r}=this;n===void 0?r.optionOverrides=e:(r.optionOverrides=Object.assign(Object.assign({},r.optionOverrides||{}),e),this.optionsForRefining.push(...n)),(n===void 0||n.length)&&this.actionRunner.request({type:"NOTHING"})}_handleAction(e){let{props:n,state:r,emitter:i}=this,s=vK(r.dynamicOptionOverrides,e),a=this.computeOptionsData(n.optionOverrides,s,n.calendarApi),o=xK(r.currentViewType,e),p=this.computeCurrentViewData(o,a,n.optionOverrides,s);n.calendarApi.currentDataManager=this,i.setThisContext(n.calendarApi),i.setOptions(p.options);let g={dateEnv:a.dateEnv,options:a.calendarOptions,pluginHooks:a.pluginHooks,calendarApi:n.calendarApi,dispatch:this.dispatch,emitter:i,getCurrentData:this.getCurrentData},{currentDate:y,dateProfile:v}=r;this.data&&this.data.dateProfileGenerator!==p.dateProfileGenerator&&(v=p.dateProfileGenerator.build(y)),y=fZ(y,e),v=wK(v,e,y,p.dateProfileGenerator),(e.type==="PREV"||e.type==="NEXT"||!ua(v.currentRange,y))&&(y=v.currentRange.start);let E=EK(r.eventSources,e,v,g),T=TZ(r.eventStore,e,E,v,g),N=vD(E)&&!p.options.progressiveEventRendering&&r.renderableEventStore||T,{eventUiSingleBase:B,selectionConfig:F}=this.buildViewUiProps(g),X=this.buildEventUiBySource(E),te=this.buildEventUiBases(N.defs,B,X),H={dynamicOptionOverrides:s,currentViewType:o,currentDate:y,dateProfile:v,eventSources:E,eventStore:T,renderableEventStore:N,selectionConfig:F,eventUiBases:te,businessHours:this.parseContextBusinessHours(g),dateSelection:IK(r.dateSelection,e),eventSelection:PK(r.eventSelection,e),eventDrag:RK(r.eventDrag,e),eventResize:OK(r.eventResize,e)},ke=Object.assign(Object.assign({},g),H);for(let Pe of a.pluginHooks.reducers)Object.assign(H,Pe(r,e,ke));let ge=cv(r,g),Se=cv(H,g);!ge&&Se?i.trigger("loading",!0):ge&&!Se&&i.trigger("loading",!1),this.state=H,n.onAction&&n.onAction(e)}updateData(){let{props:e,state:n}=this,r=this.data,i=this.computeOptionsData(e.optionOverrides,n.dynamicOptionOverrides,e.calendarApi),s=this.computeCurrentViewData(n.currentViewType,i,e.optionOverrides,n.dynamicOptionOverrides),a=this.data=Object.assign(Object.assign(Object.assign({viewTitle:this.buildTitle(n.dateProfile,s.options,i.dateEnv),calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},i),s),n),o=i.pluginHooks.optionChangeHandlers,p=r&&r.calendarOptions,g=i.calendarOptions;if(p&&p!==g){p.timeZone!==g.timeZone&&(n.eventSources=a.eventSources=SK(a.eventSources,n.dateProfile,a),n.eventStore=a.eventStore=PM(a.eventStore,r.dateEnv,a.dateEnv),n.renderableEventStore=a.renderableEventStore=PM(a.renderableEventStore,r.dateEnv,a.dateEnv));for(let y in o)(this.optionsForHandling.indexOf(y)!==-1||p[y]!==g[y])&&o[y](g[y],a)}this.optionsForHandling=[],e.onData&&e.onData(a)}computeOptionsData(e,n,r){if(!this.optionsForRefining.length&&e===this.stableOptionOverrides&&n===this.stableDynamicOptionOverrides)return this.stableCalendarOptionsData;let{refinedOptions:i,pluginHooks:s,localeDefaults:a,availableLocaleData:o,extra:p}=this.processRawCalendarOptions(e,n);AD(p);let g=this.buildDateEnv(i.timeZone,i.locale,i.weekNumberCalculation,i.firstDay,i.weekText,s,o,i.defaultRangeSeparator),y=this.buildViewSpecs(s.views,this.stableOptionOverrides,this.stableDynamicOptionOverrides,a),v=this.buildTheme(i,s),E=this.parseToolbars(i,this.stableOptionOverrides,v,y,r);return this.stableCalendarOptionsData={calendarOptions:i,pluginHooks:s,dateEnv:g,viewSpecs:y,theme:v,toolbarConfig:E,localeDefaults:a,availableRawLocales:o.map}}processRawCalendarOptions(e,n){let{locales:r,locale:i}=_x([af,e,n]),s=this.organizeRawLocales(r),a=s.map,o=this.buildLocale(i||s.defaultCode,a).options,p=this.buildPluginHooks(e.plugins||[],GK),g=this.currentCalendarOptionsRefiners=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},uM),hM),fM),p.listenerRefiners),p.optionRefiners),y={},v=_x([af,o,e,n]),E={},T=this.currentCalendarOptionsInput,D=this.currentCalendarOptionsRefined,N=!1;for(let B in v)this.optionsForRefining.indexOf(B)===-1&&(v[B]===T[B]||xc[B]&&B in T&&xc[B](T[B],v[B]))?E[B]=D[B]:g[B]?(E[B]=g[B](v[B]),N=!0):y[B]=T[B];return N&&(this.currentCalendarOptionsInput=v,this.currentCalendarOptionsRefined=E,this.stableOptionOverrides=e,this.stableDynamicOptionOverrides=n),this.optionsForHandling.push(...this.optionsForRefining),this.optionsForRefining=[],{rawOptions:this.currentCalendarOptionsInput,refinedOptions:this.currentCalendarOptionsRefined,pluginHooks:p,availableLocaleData:s,localeDefaults:o,extra:y}}_computeCurrentViewData(e,n,r,i){let s=n.viewSpecs[e];if(!s)throw new Error(`viewType "${e}" is not available. Please make sure you've loaded all neccessary plugins`);let{refinedOptions:a,extra:o}=this.processRawViewOptions(s,n.pluginHooks,n.localeDefaults,r,i);AD(o);let p=this.buildDateProfileGenerator({dateProfileGeneratorClass:s.optionDefaults.dateProfileGeneratorClass,duration:s.duration,durationUnit:s.durationUnit,usesMinMaxTime:s.optionDefaults.usesMinMaxTime,dateEnv:n.dateEnv,calendarApi:this.props.calendarApi,slotMinTime:a.slotMinTime,slotMaxTime:a.slotMaxTime,showNonCurrentDates:a.showNonCurrentDates,dayCount:a.dayCount,dateAlignment:a.dateAlignment,dateIncrement:a.dateIncrement,hiddenDays:a.hiddenDays,weekends:a.weekends,nowInput:a.now,validRangeInput:a.validRange,visibleRangeInput:a.visibleRange,fixedWeekCount:a.fixedWeekCount}),g=this.buildViewApi(e,this.getCurrentData,n.dateEnv);return{viewSpec:s,options:a,dateProfileGenerator:p,viewApi:g}}processRawViewOptions(e,n,r,i,s){let a=_x([af,e.optionDefaults,r,i,e.optionOverrides,s]),o=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},uM),hM),fM),HY),n.listenerRefiners),n.optionRefiners),p={},g=this.currentViewOptionsInput,y=this.currentViewOptionsRefined,v=!1,E={};for(let T in a)a[T]===g[T]||xc[T]&&xc[T](a[T],g[T])?p[T]=y[T]:(a[T]===this.currentCalendarOptionsInput[T]||xc[T]&&xc[T](a[T],this.currentCalendarOptionsInput[T])?T in this.currentCalendarOptionsRefined&&(p[T]=this.currentCalendarOptionsRefined[T]):o[T]?p[T]=o[T](a[T]):E[T]=a[T],v=!0);return v&&(this.currentViewOptionsInput=a,this.currentViewOptionsRefined=p),{rawOptions:this.currentViewOptionsInput,refinedOptions:this.currentViewOptionsRefined,extra:E}}}function JK(t,e,n,r,i,s,a,o){let p=gD(e||a.defaultCode,a.map);return new QY({calendarSystem:"gregory",timeZone:t,namedTimeZoneImpl:s.namedTimeZonedImpl,locale:p,weekNumberCalculation:n,firstDay:r,weekText:i,cmdFormatter:s.cmdFormatter,defaultSeparator:o})}function QK(t,e){let n=e.themeClasses[t.themeSystem]||cl;return new n(t)}function eJ(t){let e=t.dateProfileGeneratorClass||wM;return new e(t)}function tJ(t,e,n){return new zK(t,e,n)}function nJ(t){return la(t,e=>e.ui)}function rJ(t,e,n){let r={"":e};for(let i in t){let s=t[i];s.sourceId&&n[s.sourceId]&&(r[i]=n[s.sourceId])}return r}function iJ(t){let{options:e}=t;return{eventUiSingleBase:zg({display:e.eventDisplay,editable:e.editable,startEditable:e.eventStartEditable,durationEditable:e.eventDurationEditable,constraint:e.eventConstraint,overlap:typeof e.eventOverlap=="boolean"?e.eventOverlap:void 0,allow:e.eventAllow,backgroundColor:e.eventBackgroundColor,borderColor:e.eventBorderColor,textColor:e.eventTextColor,color:e.eventColor},t),selectionConfig:zg({constraint:e.selectConstraint,overlap:typeof e.selectOverlap=="boolean"?e.selectOverlap:void 0,allow:e.selectAllow},t)}}function cv(t,e){for(let n of e.pluginHooks.isLoadingFuncs)if(n(t))return!0;return!1}function sJ(t){return BZ(t.options.businessHours,t)}function AD(t,e){for(let n in t)console.warn(`Unknown option '${n}'`)}class oJ extends Tn{render(){let e=this.props.widgetGroups.map(n=>this.renderWidgetGroup(n));return ce("div",{className:"fc-toolbar-chunk"},...e)}renderWidgetGroup(e){let{props:n}=this,{theme:r}=this.context,i=[],s=!0;for(let a of e){let{buttonName:o,buttonClick:p,buttonText:g,buttonIcon:y,buttonHint:v}=a;if(o==="title")s=!1,i.push(ce("h2",{className:"fc-toolbar-title",id:n.titleId},n.title));else{let E=o===n.activeButton,T=!n.isTodayEnabled&&o==="today"||!n.isPrevEnabled&&o==="prev"||!n.isNextEnabled&&o==="next",D=[`fc-${o}-button`,r.getClass("button")];E&&D.push(r.getClass("buttonActive")),i.push(ce("button",{type:"button",title:typeof v=="function"?v(n.navUnit):v,disabled:T,"aria-pressed":E,className:D.join(" "),onClick:p},g||(y?ce("span",{className:y,role:"img"}):"")))}}if(i.length>1){let a=s&&r.getClass("buttonGroup")||"";return ce("div",{className:a},...i)}return i[0]}}class MD extends Tn{render(){let{model:e,extraClassName:n}=this.props,r=!1,i,s,a=e.sectionWidgets,o=a.center;return a.left?(r=!0,i=a.left):i=a.start,a.right?(r=!0,s=a.right):s=a.end,ce("div",{className:[n||"","fc-toolbar",r?"fc-toolbar-ltr":""].join(" ")},this.renderSection("start",i||[]),this.renderSection("center",o||[]),this.renderSection("end",s||[]))}renderSection(e,n){let{props:r}=this;return ce(oJ,{key:e,widgetGroups:n,title:r.title,navUnit:r.navUnit,activeButton:r.activeButton,isTodayEnabled:r.isTodayEnabled,isPrevEnabled:r.isPrevEnabled,isNextEnabled:r.isNextEnabled,titleId:r.titleId})}}class aJ extends Tn{constructor(){super(...arguments),this.state={availableWidth:null},this.handleEl=e=>{this.el=e,da(this.props.elRef,e),this.updateAvailableWidth()},this.handleResize=()=>{this.updateAvailableWidth()}}render(){let{props:e,state:n}=this,{aspectRatio:r}=e,i=["fc-view-harness",r||e.liquid||e.height?"fc-view-harness-active":"fc-view-harness-passive"],s="",a="";return r?n.availableWidth!==null?s=n.availableWidth/r:a=`${1/r*100}%`:s=e.height||"",ce("div",{"aria-labelledby":e.labeledById,ref:this.handleEl,className:i.join(" "),style:{height:s,paddingBottom:a}},e.children)}componentDidMount(){this.context.addResizeHandler(this.handleResize)}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}updateAvailableWidth(){this.el&&this.props.aspectRatio&&this.setState({availableWidth:this.el.offsetWidth})}}class lJ extends Jd{constructor(e){super(e),this.handleSegClick=(n,r)=>{let{component:i}=this,{context:s}=i,a=Kd(r);if(a&&i.isValidSegDownEl(n.target)){let o=gi(n.target,".fc-event-forced-url"),p=o?o.querySelector("a[href]").href:"";s.emitter.trigger("eventClick",{el:r,event:new lr(i.context,a.eventRange.def,a.eventRange.instance),jsEvent:n,view:s.viewApi}),p&&!n.defaultPrevented&&(window.location.href=p)}},this.destroy=XA(e.el,"click",".fc-event",this.handleSegClick)}}class cJ extends Jd{constructor(e){super(e),this.handleEventElRemove=n=>{n===this.currentSegEl&&this.handleSegLeave(null,this.currentSegEl)},this.handleSegEnter=(n,r)=>{Kd(r)&&(this.currentSegEl=r,this.triggerEvent("eventMouseEnter",n,r))},this.handleSegLeave=(n,r)=>{this.currentSegEl&&(this.currentSegEl=null,this.triggerEvent("eventMouseLeave",n,r))},this.removeHoverListeners=ZG(e.el,".fc-event",this.handleSegEnter,this.handleSegLeave)}destroy(){this.removeHoverListeners()}triggerEvent(e,n,r){let{component:i}=this,{context:s}=i,a=Kd(r);(!n||i.isValidSegDownEl(n.target))&&s.emitter.trigger(e,{el:r,event:new lr(s,a.eventRange.def,a.eventRange.instance),jsEvent:n,view:s.viewApi})}}class dJ extends kc{constructor(){super(...arguments),this.buildViewContext=Ft(nZ),this.buildViewPropTransformers=Ft(hJ),this.buildToolbarProps=Ft(uJ),this.headerRef=Mi(),this.footerRef=Mi(),this.interactionsStore={},this.state={viewLabelId:nl()},this.registerInteractiveComponent=(e,n)=>{let r=iX(e,n),a=[lJ,cJ].concat(this.props.pluginHooks.componentInteractions).map(o=>new o(r));this.interactionsStore[e.uid]=a,jx[e.uid]=r},this.unregisterInteractiveComponent=e=>{let n=this.interactionsStore[e.uid];if(n){for(let r of n)r.destroy();delete this.interactionsStore[e.uid]}delete jx[e.uid]},this.resizeRunner=new dx(()=>{this.props.emitter.trigger("_resize",!0),this.props.emitter.trigger("windowResize",{view:this.props.viewApi})}),this.handleWindowResize=e=>{let{options:n}=this.props;n.handleWindowResize&&e.target===window&&this.resizeRunner.request(n.windowResizeDelay)}}render(){let{props:e}=this,{toolbarConfig:n,options:r}=e,i=this.buildToolbarProps(e.viewSpec,e.dateProfile,e.dateProfileGenerator,e.currentDate,df(e.options.now,e.dateEnv),e.viewTitle),s=!1,a="",o;e.isHeightAuto||e.forPrint?a="":r.height!=null?s=!0:r.contentHeight!=null?a=r.contentHeight:o=Math.max(r.aspectRatio,.5);let p=this.buildViewContext(e.viewSpec,e.viewApi,e.options,e.dateProfileGenerator,e.dateEnv,e.theme,e.pluginHooks,e.dispatch,e.getCurrentData,e.emitter,e.calendarApi,this.registerInteractiveComponent,this.unregisterInteractiveComponent),g=n.header&&n.header.hasTitle?this.state.viewLabelId:void 0;return ce(ca.Provider,{value:p},n.header&&ce(MD,Object.assign({ref:this.headerRef,extraClassName:"fc-header-toolbar",model:n.header,titleId:g},i)),ce(aJ,{liquid:s,height:a,aspectRatio:o,labeledById:g},this.renderView(e),this.buildAppendContent()),n.footer&&ce(MD,Object.assign({ref:this.footerRef,extraClassName:"fc-footer-toolbar",model:n.footer,titleId:""},i)))}componentDidMount(){let{props:e}=this;this.calendarInteractions=e.pluginHooks.calendarInteractions.map(r=>new r(e)),window.addEventListener("resize",this.handleWindowResize);let{propSetHandlers:n}=e.pluginHooks;for(let r in n)n[r](e[r],e)}componentDidUpdate(e){let{props:n}=this,{propSetHandlers:r}=n.pluginHooks;for(let i in r)n[i]!==e[i]&&r[i](n[i],n)}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize),this.resizeRunner.clear();for(let e of this.calendarInteractions)e.destroy();this.props.emitter.trigger("_unmount")}buildAppendContent(){let{props:e}=this,n=e.pluginHooks.viewContainerAppends.map(r=>r(e));return ce(Qn,{},...n)}renderView(e){let{pluginHooks:n}=e,{viewSpec:r}=e,i={dateProfile:e.dateProfile,businessHours:e.businessHours,eventStore:e.renderableEventStore,eventUiBases:e.eventUiBases,dateSelection:e.dateSelection,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,isHeightAuto:e.isHeightAuto,forPrint:e.forPrint},s=this.buildViewPropTransformers(n.viewPropsTransformers);for(let o of s)Object.assign(i,o.transform(i,e));let a=r.component;return ce(a,Object.assign({},i))}}function uJ(t,e,n,r,i,s){let a=n.build(i,void 0,!1),o=n.buildPrev(e,r,!1),p=n.buildNext(e,r,!1);return{title:s,activeButton:t.type,navUnit:t.singleUnit,isTodayEnabled:a.isValid&&!ua(e.currentRange,i),isPrevEnabled:o.isValid,isNextEnabled:p.isValid}}function hJ(t){return t.map(e=>new e)}class fJ extends sX{constructor(e,n={}){super(),this.isRendering=!1,this.isRendered=!1,this.currentClassNames=[],this.customContentRenderId=0,this.handleAction=r=>{switch(r.type){case"SET_EVENT_DRAG":case"SET_EVENT_RESIZE":this.renderRunner.tryDrain()}},this.handleData=r=>{this.currentData=r,this.renderRunner.request(r.calendarOptions.rerenderDelay)},this.handleRenderRequest=()=>{if(this.isRendering){this.isRendered=!0;let{currentData:r}=this;Pg(()=>{nf(ce(rX,{options:r.calendarOptions,theme:r.theme,emitter:r.emitter},(i,s,a,o)=>(this.setClassNames(i),this.setHeight(s),ce(bM.Provider,{value:this.customContentRenderId},ce(dJ,Object.assign({isHeightAuto:a,forPrint:o},r))))),this.el)})}else this.isRendered&&(this.isRendered=!1,nf(null,this.el),this.setClassNames([]),this.setHeight(""))},FG(e),this.el=e,this.renderRunner=new dx(this.handleRenderRequest),new KK({optionOverrides:n,calendarApi:this,onAction:this.handleAction,onData:this.handleData})}render(){let e=this.isRendering;e?this.customContentRenderId+=1:this.isRendering=!0,this.renderRunner.request(),e&&this.updateSize()}destroy(){this.isRendering&&(this.isRendering=!1,this.renderRunner.request())}updateSize(){Pg(()=>{super.updateSize()})}batchRendering(e){this.renderRunner.pause("batchRendering"),e(),this.renderRunner.resume("batchRendering")}pauseRendering(){this.renderRunner.pause("pauseRendering")}resumeRendering(){this.renderRunner.resume("pauseRendering",!0)}resetOptions(e,n){this.currentDataManager.resetOptions(e,n)}setClassNames(e){if(!rl(e,this.currentClassNames)){let{classList:n}=this.el;for(let r of this.currentClassNames)n.remove(r);for(let r of e)n.add(r);this.currentClassNames=e}}setHeight(e){GA(this.el,"height",e)}}const pJ={headerToolbar:!0,footerToolbar:!0,events:!0,eventSources:!0,resources:!0},mJ=h.defineComponent({props:{options:Object},data(){return{renderId:0,customRenderingMap:new Map}},methods:{getApi(){return this.calendar},buildOptions(t){return{...t,customRenderingMetaMap:bJ(this.$slots),handleCustomRendering:this.handleCustomRendering}}},render(){const t=[];for(const e of this.customRenderingMap.values())t.push(h.h(gJ,{key:e.id,customRendering:e}));return h.h("div",{attrs:{"data-fc-render-id":this.renderId}},h.h(h.Fragment,t))},mounted(){const t=new sK;this.handleCustomRendering=t.handle.bind(t);const e=this.buildOptions(this.options),n=new fJ(this.$el,e);this.calendar=n,n.render(),t.subscribe(r=>{this.customRenderingMap=r,this.renderId++,this.needCustomRenderingResize=!0})},beforeUpdate(){this.getApi().resumeRendering()},updated(){this.needCustomRenderingResize&&(this.needCustomRenderingResize=!1,this.getApi().updateSize())},beforeUnmount(){this.getApi().destroy()},watch:yJ()}),gJ=h.defineComponent({props:{customRendering:Object},render(){const t=this.customRendering,e=typeof t.generatorMeta=="function"?t.generatorMeta(t.renderProps):t.generatorMeta;return h.h(h.Teleport,{to:t.containerEl},e)}});function Nce(t){return t}function yJ(){let t={options:{deep:!0,handler(e){let n=this.getApi();n.pauseRendering();let r=this.buildOptions(e);n.resetOptions(r),this.renderId++}}};for(let e in pJ)t[`options.${e}`]={deep:!0,handler(n){if(n!==void 0){let r=this.getApi();r.pauseRendering(),r.resetOptions({[e]:n},[e]),this.renderId++}}};return t}function bJ(t){const e={};for(const n in t)e[_J(n)]=t[n];return e}function _J(t){return t.split("-").map((e,n)=>n?xJ(e):e).join("")}function xJ(t){return t.charAt(0).toUpperCase()+t.slice(1)}class vJ extends co{constructor(){super(...arguments),this.headerElRef=Mi()}renderSimpleLayout(e,n){let{props:r,context:i}=this,s=[],a=Ug(i.options);return e&&s.push({type:"header",key:"header",isSticky:a,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),s.push({type:"body",key:"body",liquid:!0,chunk:{content:n}}),ce(cf,{elClasses:["fc-daygrid"],viewSpec:i.viewSpec},ce(nv,{liquid:!r.isHeightAuto&&!r.forPrint,collapsibleWidth:r.forPrint,cols:[],sections:s}))}renderHScrollLayout(e,n,r,i){let s=this.context.pluginHooks.scrollGridImpl;if(!s)throw new Error("No ScrollGrid implementation");let{props:a,context:o}=this,p=!a.forPrint&&Ug(o.options),g=!a.forPrint&&oD(o.options),y=[];return e&&y.push({type:"header",key:"header",isSticky:p,chunks:[{key:"main",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),y.push({type:"body",key:"body",liquid:!0,chunks:[{key:"main",content:n}]}),g&&y.push({type:"footer",key:"footer",isSticky:!0,chunks:[{key:"main",content:tv}]}),ce(cf,{elClasses:["fc-daygrid"],viewSpec:o.viewSpec},ce(s,{liquid:!a.isHeightAuto&&!a.forPrint,forPrint:a.forPrint,collapsibleWidth:a.forPrint,colGroups:[{cols:[{span:r,minWidth:i}]}],sections:y}))}}function qg(t,e){let n=[];for(let r=0;r<e;r+=1)n[r]=[];for(let r of t)n[r.row].push(r);return n}function Gg(t,e){let n=[];for(let r=0;r<e;r+=1)n[r]=[];for(let r of t)n[r.firstCol].push(r);return n}function DD(t,e){let n=[];if(t){for(let r=0;r<e;r+=1)n[r]={affectedInstances:t.affectedInstances,isEvent:t.isEvent,segs:[]};for(let r of t.segs)n[r.row].segs.push(r)}else for(let r=0;r<e;r+=1)n[r]=null;return n}const ID=ir({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});function PD(t){let{display:e}=t.eventRange.ui;return e==="list-item"||e==="auto"&&!t.eventRange.def.allDay&&t.firstCol===t.lastCol&&t.isStart&&t.isEnd}class RD extends Tn{render(){let{props:e}=this;return ce(aD,Object.assign({},e,{elClasses:["fc-daygrid-event","fc-daygrid-block-event","fc-h-event"],defaultTimeFormat:ID,defaultDisplayEventEnd:e.defaultDisplayEventEnd,disableResizing:!e.seg.eventRange.def.allDay}))}}class OD extends Tn{render(){let{props:e,context:n}=this,{options:r}=n,{seg:i}=e,s=r.eventTimeFormat||ID,a=hf(i,s,n,!0,e.defaultDisplayEventEnd);return ce(Wg,Object.assign({},e,{elTag:"a",elClasses:["fc-daygrid-event","fc-daygrid-dot-event"],elAttrs:Vx(e.seg,n),defaultGenerator:wJ,timeText:a,isResizing:!1,isDateSelecting:!1}))}}function wJ(t){return ce(Qn,null,ce("div",{className:"fc-daygrid-event-dot",style:{borderColor:t.borderColor||t.backgroundColor}}),t.timeText&&ce("div",{className:"fc-event-time"},t.timeText),ce("div",{className:"fc-event-title"},t.event.title||ce(Qn,null," ")))}class kJ extends Tn{constructor(){super(...arguments),this.compileSegs=Ft(EJ)}render(){let{props:e}=this,{allSegs:n,invisibleSegs:r}=this.compileSegs(e.singlePlacements);return ce(uD,{elClasses:["fc-daygrid-more-link"],dateProfile:e.dateProfile,todayRange:e.todayRange,allDayDate:e.allDayDate,moreCnt:e.moreCnt,allSegs:n,hiddenSegs:r,alignmentElRef:e.alignmentElRef,alignGridTop:e.alignGridTop,extraDateSpan:e.extraDateSpan,popoverContent:()=>{let i=(e.eventDrag?e.eventDrag.affectedInstances:null)||(e.eventResize?e.eventResize.affectedInstances:null)||{};return ce(Qn,null,n.map(s=>{let a=s.eventRange.instance.instanceId;return ce("div",{className:"fc-daygrid-event-harness",key:a,style:{visibility:i[a]?"hidden":""}},PD(s)?ce(OD,Object.assign({seg:s,isDragging:!1,isSelected:a===e.eventSelection,defaultDisplayEventEnd:!1},ha(s,e.todayRange))):ce(RD,Object.assign({seg:s,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:a===e.eventSelection,defaultDisplayEventEnd:!1},ha(s,e.todayRange))))}))}})}}function EJ(t){let e=[],n=[];for(let r of t)e.push(r.seg),r.isVisible||n.push(r.seg);return{allSegs:e,invisibleSegs:n}}const SJ=ir({week:"narrow"});class CJ extends co{constructor(){super(...arguments),this.rootElRef=Mi(),this.state={dayNumberId:nl()},this.handleRootEl=e=>{da(this.rootElRef,e),da(this.props.elRef,e)}}render(){let{context:e,props:n,state:r,rootElRef:i}=this,{options:s,dateEnv:a}=e,{date:o,dateProfile:p}=n;const g=n.showDayNumber&&AJ(o,p.currentRange,a);return ce(iv,{elTag:"td",elRef:this.handleRootEl,elClasses:["fc-daygrid-day",...n.extraClassNames||[]],elAttrs:Object.assign(Object.assign(Object.assign({},n.extraDataAttrs),n.showDayNumber?{"aria-labelledby":r.dayNumberId}:{}),{role:"gridcell"}),defaultGenerator:TJ,date:o,dateProfile:p,todayRange:n.todayRange,showDayNumber:n.showDayNumber,isMonthStart:g,extraRenderProps:n.extraRenderProps},(y,v)=>ce("div",{ref:n.innerElRef,className:"fc-daygrid-day-frame fc-scrollgrid-sync-inner",style:{minHeight:n.minHeight}},n.showWeekNumber&&ce(dD,{elTag:"a",elClasses:["fc-daygrid-week-number"],elAttrs:Qd(e,o,"week"),date:o,defaultFormat:SJ}),!v.isDisabled&&(n.showDayNumber||sv(s)||n.forceDayTop)?ce("div",{className:"fc-daygrid-day-top"},ce(y,{elTag:"a",elClasses:["fc-daygrid-day-number",g&&"fc-daygrid-month-start"],elAttrs:Object.assign(Object.assign({},Qd(e,o)),{id:r.dayNumberId})})):n.showDayNumber?ce("div",{className:"fc-daygrid-day-top",style:{visibility:"hidden"}},ce("a",{className:"fc-daygrid-day-number"}," ")):void 0,ce("div",{className:"fc-daygrid-day-events",ref:n.fgContentElRef},n.fgContent,ce("div",{className:"fc-daygrid-day-bottom",style:{marginTop:n.moreMarginTop}},ce(kJ,{allDayDate:o,singlePlacements:n.singlePlacements,moreCnt:n.moreCnt,alignmentElRef:i,alignGridTop:!n.showDayNumber,extraDateSpan:n.extraDateSpan,dateProfile:n.dateProfile,eventSelection:n.eventSelection,eventDrag:n.eventDrag,eventResize:n.eventResize,todayRange:n.todayRange}))),ce("div",{className:"fc-daygrid-day-bg"},n.bgContent)))}}function TJ(t){return t.dayNumberText||ce(Qn,null," ")}function AJ(t,e,n){const{start:r,end:i}=e,s=il(i,-1),a=n.getYear(r),o=n.getMonth(r),p=n.getYear(s),g=n.getMonth(s);return!(a===p&&o===g)&&(t.valueOf()===r.valueOf()||n.getDay(t)===1&&t.valueOf()<i.valueOf())}function ND(t){return t.eventRange.instance.instanceId+":"+t.firstCol}function BD(t){return ND(t)+":"+t.lastCol}function MJ(t,e,n,r,i,s,a){let o=new PJ(F=>{let X=t[F.index].eventRange.instance.instanceId+":"+F.span.start+":"+(F.span.end-1);return i[X]||1});o.allowReslicing=!0,o.strictOrder=r,e===!0||n===!0?(o.maxCoord=s,o.hiddenConsumes=!0):typeof e=="number"?o.maxStackCnt=e:typeof n=="number"&&(o.maxStackCnt=n,o.hiddenConsumes=!0);let p=[],g=[];for(let F=0;F<t.length;F+=1){let X=t[F],te=BD(X);i[te]!=null?p.push({index:F,span:{start:X.firstCol,end:X.lastCol+1}}):g.push(X)}let y=o.addSegs(p),v=o.toRects(),{singleColPlacements:E,multiColPlacements:T,leftoverMargins:D}=DJ(v,t,a),N=[],B=[];for(let F of g){T[F.firstCol].push({seg:F,isVisible:!1,isAbsolute:!0,absoluteTop:0,marginTop:0});for(let X=F.firstCol;X<=F.lastCol;X+=1)E[X].push({seg:nu(F,X,X+1,a),isVisible:!1,isAbsolute:!1,absoluteTop:0,marginTop:0})}for(let F=0;F<a.length;F+=1)N.push(0);for(let F of y){let X=t[F.index],te=F.span;T[te.start].push({seg:nu(X,te.start,te.end,a),isVisible:!1,isAbsolute:!0,absoluteTop:0,marginTop:0});for(let H=te.start;H<te.end;H+=1)N[H]+=1,E[H].push({seg:nu(X,H,H+1,a),isVisible:!1,isAbsolute:!1,absoluteTop:0,marginTop:0})}for(let F=0;F<a.length;F+=1)B.push(D[F]);return{singleColPlacements:E,multiColPlacements:T,moreCnts:N,moreMarginTops:B}}function DJ(t,e,n){let r=IJ(t,n.length),i=[],s=[],a=[];for(let o=0;o<n.length;o+=1){let p=r[o],g=[],y=0,v=0;for(let T of p){let D=e[T.index];g.push({seg:nu(D,o,o+1,n),isVisible:!0,isAbsolute:!1,absoluteTop:T.levelCoord,marginTop:T.levelCoord-y}),y=T.levelCoord+T.thickness}let E=[];y=0,v=0;for(let T of p){let D=e[T.index],N=T.span.end-T.span.start>1,B=T.span.start===o;v+=T.levelCoord-y,y=T.levelCoord+T.thickness,N?(v+=T.thickness,B&&E.push({seg:nu(D,T.span.start,T.span.end,n),isVisible:!0,isAbsolute:!0,absoluteTop:T.levelCoord,marginTop:0})):B&&(E.push({seg:nu(D,T.span.start,T.span.end,n),isVisible:!0,isAbsolute:!1,absoluteTop:T.levelCoord,marginTop:v}),v=0)}i.push(g),s.push(E),a.push(v)}return{singleColPlacements:i,multiColPlacements:s,leftoverMargins:a}}function IJ(t,e){let n=[];for(let r=0;r<e;r+=1)n.push([]);for(let r of t)for(let i=r.span.start;i<r.span.end;i+=1)n[i].push(r);return n}function nu(t,e,n,r){if(t.firstCol===e&&t.lastCol===n-1)return t;let i=t.eventRange,s=i.range,a=ll(s,{start:r[e].date,end:Ur(r[n-1].date,1)});return Object.assign(Object.assign({},t),{firstCol:e,lastCol:n-1,eventRange:{def:i.def,ui:Object.assign(Object.assign({},i.ui),{durationEditable:!1}),instance:i.instance,range:a},isStart:t.isStart&&a.start.valueOf()===s.start.valueOf(),isEnd:t.isEnd&&a.end.valueOf()===s.end.valueOf()})}class PJ extends GM{constructor(){super(...arguments),this.hiddenConsumes=!1,this.forceHidden={}}addSegs(e){const n=super.addSegs(e),{entriesByLevel:r}=this,i=s=>!this.forceHidden[Cc(s)];for(let s=0;s<r.length;s+=1)r[s]=r[s].filter(i);return n}handleInvalidInsertion(e,n,r){const{entriesByLevel:i,forceHidden:s}=this,{touchingEntry:a,touchingLevel:o,touchingLateral:p}=e;if(this.hiddenConsumes&&a){const g=Cc(a);if(!s[g])if(this.allowReslicing){const y=Object.assign(Object.assign({},a),{span:Xx(a.span,n.span)}),v=Cc(y);s[v]=!0,i[o][p]=y,r.push(y),this.splitEntry(a,n,r)}else s[g]=!0,r.push(a)}super.handleInvalidInsertion(e,n,r)}}class zD extends co{constructor(){super(...arguments),this.cellElRefs=new fa,this.frameElRefs=new fa,this.fgElRefs=new fa,this.segHarnessRefs=new fa,this.rootElRef=Mi(),this.state={framePositions:null,maxContentHeight:null,segHeights:{}},this.handleResize=e=>{e&&this.updateSizing(!0)}}render(){let{props:e,state:n,context:r}=this,{options:i}=r,s=e.cells.length,a=Gg(e.businessHourSegs,s),o=Gg(e.bgEventSegs,s),p=Gg(this.getHighlightSegs(),s),g=Gg(this.getMirrorSegs(),s),{singleColPlacements:y,multiColPlacements:v,moreCnts:E,moreMarginTops:T}=MJ(Lx(e.fgEventSegs,i.eventOrder),e.dayMaxEvents,e.dayMaxEventRows,i.eventOrderStrict,n.segHeights,n.maxContentHeight,e.cells),D=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{};return ce("tr",{ref:this.rootElRef,role:"row"},e.renderIntro&&e.renderIntro(),e.cells.map((N,B)=>{let F=this.renderFgSegs(B,e.forPrint?y[B]:v[B],e.todayRange,D),X=this.renderFgSegs(B,RJ(g[B],v),e.todayRange,{},!!e.eventDrag,!!e.eventResize,!1);return ce(CJ,{key:N.key,elRef:this.cellElRefs.createRef(N.key),innerElRef:this.frameElRefs.createRef(N.key),dateProfile:e.dateProfile,date:N.date,showDayNumber:e.showDayNumbers,showWeekNumber:e.showWeekNumbers&&B===0,forceDayTop:e.showWeekNumbers,todayRange:e.todayRange,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,extraRenderProps:N.extraRenderProps,extraDataAttrs:N.extraDataAttrs,extraClassNames:N.extraClassNames,extraDateSpan:N.extraDateSpan,moreCnt:E[B],moreMarginTop:T[B],singlePlacements:y[B],fgContentElRef:this.fgElRefs.createRef(N.key),fgContent:ce(Qn,null,ce(Qn,null,F),ce(Qn,null,X)),bgContent:ce(Qn,null,this.renderFillSegs(p[B],"highlight"),this.renderFillSegs(a[B],"non-business"),this.renderFillSegs(o[B],"bg-event")),minHeight:e.cellMinHeight})}))}componentDidMount(){this.updateSizing(!0),this.context.addResizeHandler(this.handleResize)}componentDidUpdate(e,n){let r=this.props;this.updateSizing(!Po(e,r))}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}getHighlightSegs(){let{props:e}=this;return e.eventDrag&&e.eventDrag.segs.length?e.eventDrag.segs:e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:e.dateSelectionSegs}getMirrorSegs(){let{props:e}=this;return e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:[]}renderFgSegs(e,n,r,i,s,a,o){let{context:p}=this,{eventSelection:g}=this.props,{framePositions:y}=this.state,v=this.props.cells.length===1,E=s||a||o,T=[];if(y)for(let D of n){let{seg:N}=D,{instanceId:B}=N.eventRange.instance,F=D.isVisible&&!i[B],X=D.isAbsolute,te="",H="";X&&(p.isRtl?(H=0,te=y.lefts[N.lastCol]-y.lefts[N.firstCol]):(te=0,H=y.rights[N.firstCol]-y.rights[N.lastCol])),T.push(ce("div",{className:"fc-daygrid-event-harness"+(X?" fc-daygrid-event-harness-abs":""),key:ND(N),ref:E?null:this.segHarnessRefs.createRef(BD(N)),style:{visibility:F?"":"hidden",marginTop:X?"":D.marginTop,top:X?D.absoluteTop:"",left:te,right:H}},PD(N)?ce(OD,Object.assign({seg:N,isDragging:s,isSelected:B===g,defaultDisplayEventEnd:v},ha(N,r))):ce(RD,Object.assign({seg:N,isDragging:s,isResizing:a,isDateSelecting:o,isSelected:B===g,defaultDisplayEventEnd:v},ha(N,r)))))}return T}renderFillSegs(e,n){let{isRtl:r}=this.context,{todayRange:i}=this.props,{framePositions:s}=this.state,a=[];if(s)for(let o of e){let p=r?{right:0,left:s.lefts[o.lastCol]-s.lefts[o.firstCol]}:{left:0,right:s.rights[o.firstCol]-s.rights[o.lastCol]};a.push(ce("div",{key:VM(o.eventRange),className:"fc-daygrid-bg-harness",style:p},n==="bg-event"?ce(lD,Object.assign({seg:o},ha(o,i))):cD(n)))}return ce(Qn,{},...a)}updateSizing(e){let{props:n,state:r,frameElRefs:i}=this;if(!n.forPrint&&n.clientWidth!==null){if(e){let p=n.cells.map(g=>i.currentMap[g.key]);if(p.length){let g=this.rootElRef.current,y=new eu(g,p,!0,!1);(!r.framePositions||!r.framePositions.similarTo(y))&&this.setState({framePositions:new eu(g,p,!0,!1)})}}const s=this.state.segHeights,a=this.querySegHeights(),o=n.dayMaxEvents===!0||n.dayMaxEventRows===!0;this.safeSetState({segHeights:Object.assign(Object.assign({},s),a),maxContentHeight:o?this.computeMaxContentHeight():null})}}querySegHeights(){let e=this.segHarnessRefs.currentMap,n={};for(let r in e){let i=Math.round(e[r].getBoundingClientRect().height);n[r]=Math.max(n[r]||0,i)}return n}computeMaxContentHeight(){let e=this.props.cells[0].key,n=this.cellElRefs.currentMap[e],r=this.fgElRefs.currentMap[e];return n.getBoundingClientRect().bottom-r.getBoundingClientRect().top}getCellEls(){let e=this.cellElRefs.currentMap;return this.props.cells.map(n=>e[n.key])}}zD.addStateEquality({segHeights:Po});function RJ(t,e){if(!t.length)return[];let n=OJ(e);return t.map(r=>({seg:r,isVisible:!0,isAbsolute:!0,absoluteTop:n[r.eventRange.instance.instanceId],marginTop:0}))}function OJ(t){let e={};for(let n of t)for(let r of n)e[r.seg.eventRange.instance.instanceId]=r.absoluteTop;return e}class NJ extends co{constructor(){super(...arguments),this.splitBusinessHourSegs=Ft(qg),this.splitBgEventSegs=Ft(qg),this.splitFgEventSegs=Ft(qg),this.splitDateSelectionSegs=Ft(qg),this.splitEventDrag=Ft(DD),this.splitEventResize=Ft(DD),this.rowRefs=new fa}render(){let{props:e,context:n}=this,r=e.cells.length,i=this.splitBusinessHourSegs(e.businessHourSegs,r),s=this.splitBgEventSegs(e.bgEventSegs,r),a=this.splitFgEventSegs(e.fgEventSegs,r),o=this.splitDateSelectionSegs(e.dateSelectionSegs,r),p=this.splitEventDrag(e.eventDrag,r),g=this.splitEventResize(e.eventResize,r),y=r>=7&&e.clientWidth?e.clientWidth/n.options.aspectRatio/6:null;return ce(tu,{unit:"day"},(v,E)=>ce(Qn,null,e.cells.map((T,D)=>ce(zD,{ref:this.rowRefs.createRef(D),key:T.length?T[0].date.toISOString():D,showDayNumbers:r>1,showWeekNumbers:e.showWeekNumbers,todayRange:E,dateProfile:e.dateProfile,cells:T,renderIntro:e.renderRowIntro,businessHourSegs:i[D],eventSelection:e.eventSelection,bgEventSegs:s[D].filter(BJ),fgEventSegs:a[D],dateSelectionSegs:o[D],eventDrag:p[D],eventResize:g[D],dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,clientWidth:e.clientWidth,clientHeight:e.clientHeight,cellMinHeight:y,forPrint:e.forPrint}))))}componentDidMount(){this.registerInteractiveComponent()}componentDidUpdate(){this.registerInteractiveComponent()}registerInteractiveComponent(){if(!this.rootEl){const e=this.rowRefs.currentMap[0].getCellEls()[0],n=e?e.closest(".fc-daygrid-body"):null;n&&(this.rootEl=n,this.context.registerInteractiveComponent(this,{el:n,isHitComboAllowed:this.props.isHitComboAllowed}))}}componentWillUnmount(){this.rootEl&&(this.context.unregisterInteractiveComponent(this),this.rootEl=null)}prepareHits(){this.rowPositions=new eu(this.rootEl,this.rowRefs.collect().map(e=>e.getCellEls()[0]),!1,!0),this.colPositions=new eu(this.rootEl,this.rowRefs.currentMap[0].getCellEls(),!0,!1)}queryHit(e,n){let{colPositions:r,rowPositions:i}=this,s=r.leftToIndex(e),a=i.topToIndex(n);if(a!=null&&s!=null){let o=this.props.cells[a][s];return{dateProfile:this.props.dateProfile,dateSpan:Object.assign({range:this.getCellRange(a,s),allDay:!0},o.extraDateSpan),dayEl:this.getCellEl(a,s),rect:{left:r.lefts[s],right:r.rights[s],top:i.tops[a],bottom:i.bottoms[a]},layer:0}}return null}getCellEl(e,n){return this.rowRefs.currentMap[e].getCellEls()[n]}getCellRange(e,n){let r=this.props.cells[e][n].date,i=Ur(r,1);return{start:r,end:i}}}function BJ(t){return t.eventRange.def.allDay}class zJ extends co{constructor(){super(...arguments),this.elRef=Mi(),this.needsScrollReset=!1}render(){let{props:e}=this,{dayMaxEventRows:n,dayMaxEvents:r,expandRows:i}=e,s=r===!0||n===!0;s&&!i&&(s=!1,n=null,r=null);let a=["fc-daygrid-body",s?"fc-daygrid-body-balanced":"fc-daygrid-body-unbalanced",i?"":"fc-daygrid-body-natural"];return ce("div",{ref:this.elRef,className:a.join(" "),style:{width:e.clientWidth,minWidth:e.tableMinWidth}},ce("table",{role:"presentation",className:"fc-scrollgrid-sync-table",style:{width:e.clientWidth,minWidth:e.tableMinWidth,height:i?e.clientHeight:""}},e.colGroupNode,ce("tbody",{role:"presentation"},ce(NJ,{dateProfile:e.dateProfile,cells:e.cells,renderRowIntro:e.renderRowIntro,showWeekNumbers:e.showWeekNumbers,clientWidth:e.clientWidth,clientHeight:e.clientHeight,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,dayMaxEvents:r,dayMaxEventRows:n,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed}))))}componentDidMount(){this.requestScrollReset()}componentDidUpdate(e){e.dateProfile!==this.props.dateProfile?this.requestScrollReset():this.flushScrollReset()}requestScrollReset(){this.needsScrollReset=!0,this.flushScrollReset()}flushScrollReset(){if(this.needsScrollReset&&this.props.clientWidth){const e=LJ(this.elRef.current,this.props.dateProfile);if(e){const n=e.closest(".fc-daygrid-body"),r=n.closest(".fc-scroller"),i=e.getBoundingClientRect().top-n.getBoundingClientRect().top;r.scrollTop=i?i+1:0}this.needsScrollReset=!1}}}function LJ(t,e){let n;return e.currentRangeUnit.match(/year|month/)&&(n=t.querySelector(`[data-date="${CY(e.currentDate)}-01"]`)),n||(n=t.querySelector(`[data-date="${of(e.currentDate)}"]`)),n}class VJ extends eD{constructor(){super(...arguments),this.forceDayIfListItem=!0}sliceRange(e,n){return n.sliceRange(e)}}class LD extends co{constructor(){super(...arguments),this.slicer=new VJ,this.tableRef=Mi()}render(){let{props:e,context:n}=this;return ce(zJ,Object.assign({ref:this.tableRef},this.slicer.sliceProps(e,e.dateProfile,e.nextDayThreshold,n,e.dayTableModel),{dateProfile:e.dateProfile,cells:e.dayTableModel.cells,colGroupNode:e.colGroupNode,tableMinWidth:e.tableMinWidth,renderRowIntro:e.renderRowIntro,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.showWeekNumbers,expandRows:e.expandRows,headerAlignElRef:e.headerAlignElRef,clientWidth:e.clientWidth,clientHeight:e.clientHeight,forPrint:e.forPrint}))}}class FJ extends vJ{constructor(){super(...arguments),this.buildDayTableModel=Ft($J),this.headerRef=Mi(),this.tableRef=Mi()}render(){let{options:e,dateProfileGenerator:n}=this.context,{props:r}=this,i=this.buildDayTableModel(r.dateProfile,n),s=e.dayHeaders&&ce(KM,{ref:this.headerRef,dateProfile:r.dateProfile,dates:i.headerDates,datesRepDistinctDays:i.rowCnt===1}),a=o=>ce(LD,{ref:this.tableRef,dateProfile:r.dateProfile,dayTableModel:i,businessHours:r.businessHours,dateSelection:r.dateSelection,eventStore:r.eventStore,eventUiBases:r.eventUiBases,eventSelection:r.eventSelection,eventDrag:r.eventDrag,eventResize:r.eventResize,nextDayThreshold:e.nextDayThreshold,colGroupNode:o.tableColGroupNode,tableMinWidth:o.tableMinWidth,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.weekNumbers,expandRows:!r.isHeightAuto,headerAlignElRef:this.headerElRef,clientWidth:o.clientWidth,clientHeight:o.clientHeight,forPrint:r.forPrint});return e.dayMinWidth?this.renderHScrollLayout(s,a,i.colCnt,e.dayMinWidth):this.renderSimpleLayout(s,a)}}function $J(t,e){let n=new JM(t.renderRange,e);return new QM(n,/year|month|week/.test(t.currentRangeUnit))}class jJ extends wM{buildRenderRange(e,n,r){let i=super.buildRenderRange(e,n,r),{props:s}=this;return HJ({currentRange:i,snapToWeek:/^(year|month)$/.test(n),fixedWeekCount:s.fixedWeekCount,dateEnv:s.dateEnv})}}function HJ(t){let{dateEnv:e,currentRange:n}=t,{start:r,end:i}=n,s;if(t.snapToWeek&&(r=e.startOfWeek(r),s=e.startOfWeek(i),s.valueOf()!==i.valueOf()&&(i=rM(s,1))),t.fixedWeekCount){let a=e.startOfWeek(e.startOfMonth(Ur(n.end,-1))),o=Math.ceil(mY(a,i));i=rM(i,6-o)}return{start:r,end:i}}var UJ=':root{--fc-daygrid-event-dot-width:8px}.fc-daygrid-day-events:after,.fc-daygrid-day-events:before,.fc-daygrid-day-frame:after,.fc-daygrid-day-frame:before,.fc-daygrid-event-harness:after,.fc-daygrid-event-harness:before{clear:both;content:"";display:table}.fc .fc-daygrid-body{position:relative;z-index:1}.fc .fc-daygrid-day.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-daygrid-day-frame{min-height:100%;position:relative}.fc .fc-daygrid-day-top{display:flex;flex-direction:row-reverse}.fc .fc-day-other .fc-daygrid-day-top{opacity:.3}.fc .fc-daygrid-day-number{padding:4px;position:relative;z-index:4}.fc .fc-daygrid-month-start{font-size:1.1em;font-weight:700}.fc .fc-daygrid-day-events{margin-top:1px}.fc .fc-daygrid-body-balanced .fc-daygrid-day-events{left:0;position:absolute;right:0}.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events{min-height:2em;position:relative}.fc .fc-daygrid-body-natural .fc-daygrid-day-events{margin-bottom:1em}.fc .fc-daygrid-event-harness{position:relative}.fc .fc-daygrid-event-harness-abs{left:0;position:absolute;right:0;top:0}.fc .fc-daygrid-bg-harness{bottom:0;position:absolute;top:0}.fc .fc-daygrid-day-bg .fc-non-business{z-index:1}.fc .fc-daygrid-day-bg .fc-bg-event{z-index:2}.fc .fc-daygrid-day-bg .fc-highlight{z-index:3}.fc .fc-daygrid-event{margin-top:1px;z-index:6}.fc .fc-daygrid-event.fc-event-mirror{z-index:7}.fc .fc-daygrid-day-bottom{font-size:.85em;margin:0 2px}.fc .fc-daygrid-day-bottom:after,.fc .fc-daygrid-day-bottom:before{clear:both;content:"";display:table}.fc .fc-daygrid-more-link{border-radius:3px;cursor:pointer;line-height:1;margin-top:1px;max-width:100%;overflow:hidden;padding:2px;position:relative;white-space:nowrap;z-index:4}.fc .fc-daygrid-more-link:hover{background-color:rgba(0,0,0,.1)}.fc .fc-daygrid-week-number{background-color:var(--fc-neutral-bg-color);color:var(--fc-neutral-text-color);min-width:1.5em;padding:2px;position:absolute;text-align:center;top:0;z-index:5}.fc .fc-more-popover .fc-popover-body{min-width:220px;padding:10px}.fc-direction-ltr .fc-daygrid-event.fc-event-start,.fc-direction-rtl .fc-daygrid-event.fc-event-end{margin-left:2px}.fc-direction-ltr .fc-daygrid-event.fc-event-end,.fc-direction-rtl .fc-daygrid-event.fc-event-start{margin-right:2px}.fc-direction-ltr .fc-daygrid-more-link{float:left}.fc-direction-ltr .fc-daygrid-week-number{border-radius:0 0 3px 0;left:0}.fc-direction-rtl .fc-daygrid-more-link{float:right}.fc-direction-rtl .fc-daygrid-week-number{border-radius:0 0 0 3px;right:0}.fc-liquid-hack .fc-daygrid-day-frame{position:static}.fc-daygrid-event{border-radius:3px;font-size:var(--fc-small-font-size);position:relative;white-space:nowrap}.fc-daygrid-block-event .fc-event-time{font-weight:700}.fc-daygrid-block-event .fc-event-time,.fc-daygrid-block-event .fc-event-title{padding:1px}.fc-daygrid-dot-event{align-items:center;display:flex;padding:2px 0}.fc-daygrid-dot-event .fc-event-title{flex-grow:1;flex-shrink:1;font-weight:700;min-width:0;overflow:hidden}.fc-daygrid-dot-event.fc-event-mirror,.fc-daygrid-dot-event:hover{background:rgba(0,0,0,.1)}.fc-daygrid-dot-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-daygrid-event-dot{border:calc(var(--fc-daygrid-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-daygrid-event-dot-width)/2);box-sizing:content-box;height:0;margin:0 4px;width:0}.fc-direction-ltr .fc-daygrid-event .fc-event-time{margin-right:3px}.fc-direction-rtl .fc-daygrid-event .fc-event-time{margin-left:3px}';wg(UJ);var WJ=Ro({name:"@fullcalendar/daygrid",initialView:"dayGridMonth",views:{dayGrid:{component:FJ,dateProfileGeneratorClass:jJ},dayGridDay:{type:"dayGrid",duration:{days:1}},dayGridWeek:{type:"dayGrid",duration:{weeks:1}},dayGridMonth:{type:"dayGrid",duration:{months:1},fixedWeekCount:!0},dayGridYear:{type:"dayGrid",duration:{years:1}}}});class qJ extends dX{getKeyInfo(){return{allDay:{},timed:{}}}getKeysForDateSpan(e){return e.allDay?["allDay"]:["timed"]}getKeysForEventDef(e){return e.allDay?$Z(e)?["timed","allDay"]:["allDay"]:["timed"]}}const GJ=ir({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"});function VD(t){let e=["fc-timegrid-slot","fc-timegrid-slot-label",t.isLabeled?"fc-scrollgrid-shrink":"fc-timegrid-slot-minor"];return ce(ca.Consumer,null,n=>{if(!t.isLabeled)return ce("td",{className:e.join(" "),"data-time":t.isoTimeStr});let{dateEnv:r,options:i,viewApi:s}=n,a=i.slotLabelFormat==null?GJ:Array.isArray(i.slotLabelFormat)?ir(i.slotLabelFormat[0]):ir(i.slotLabelFormat),o={level:0,time:t.time,date:r.toDate(t.date),view:s,text:r.format(t.date,a)};return ce(yi,{elTag:"td",elClasses:e,elAttrs:{"data-time":t.isoTimeStr},renderProps:o,generatorName:"slotLabelContent",customGenerator:i.slotLabelContent,defaultGenerator:YJ,classNameGenerator:i.slotLabelClassNames,didMount:i.slotLabelDidMount,willUnmount:i.slotLabelWillUnmount},p=>ce("div",{className:"fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame"},ce(p,{elTag:"div",elClasses:["fc-timegrid-slot-label-cushion","fc-scrollgrid-shrink-cushion"]})))})}function YJ(t){return t.text}class ZJ extends Tn{render(){return this.props.slatMetas.map(e=>ce("tr",{key:e.key},ce(VD,Object.assign({},e))))}}const XJ=ir({week:"short"}),KJ=5;class JJ extends co{constructor(){super(...arguments),this.allDaySplitter=new qJ,this.headerElRef=Mi(),this.rootElRef=Mi(),this.scrollerElRef=Mi(),this.state={slatCoords:null},this.handleScrollTopRequest=e=>{let n=this.scrollerElRef.current;n&&(n.scrollTop=e)},this.renderHeadAxis=(e,n="")=>{let{options:r}=this.context,{dateProfile:i}=this.props,s=i.renderRange,o=sl(s.start,s.end)===1?Qd(this.context,s.start,"week"):{};return r.weekNumbers&&e==="day"?ce(dD,{elTag:"th",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},date:s.start,defaultFormat:XJ},p=>ce("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame","fc-timegrid-axis-frame-liquid"].join(" "),style:{height:n}},ce(p,{elTag:"a",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"],elAttrs:o}))):ce("th",{"aria-hidden":!0,className:"fc-timegrid-axis"},ce("div",{className:"fc-timegrid-axis-frame",style:{height:n}}))},this.renderTableRowAxis=e=>{let{options:n,viewApi:r}=this.context,i={text:n.allDayText,view:r};return ce(yi,{elTag:"td",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},renderProps:i,generatorName:"allDayContent",customGenerator:n.allDayContent,defaultGenerator:QJ,classNameGenerator:n.allDayClassNames,didMount:n.allDayDidMount,willUnmount:n.allDayWillUnmount},s=>ce("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame",e==null?" fc-timegrid-axis-frame-liquid":""].join(" "),style:{height:e}},ce(s,{elTag:"span",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"]})))},this.handleSlatCoords=e=>{this.setState({slatCoords:e})}}renderSimpleLayout(e,n,r){let{context:i,props:s}=this,a=[],o=Ug(i.options);return e&&a.push({type:"header",key:"header",isSticky:o,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),n&&(a.push({type:"body",key:"all-day",chunk:{content:n}}),a.push({type:"body",key:"all-day-divider",outerContent:ce("tr",{role:"presentation",className:"fc-scrollgrid-section"},ce("td",{className:"fc-timegrid-divider "+i.theme.getClass("tableCellShaded")}))})),a.push({type:"body",key:"body",liquid:!0,expandRows:!!i.options.expandRows,chunk:{scrollerElRef:this.scrollerElRef,content:r}}),ce(cf,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:i.viewSpec},ce(nv,{liquid:!s.isHeightAuto&&!s.forPrint,collapsibleWidth:s.forPrint,cols:[{width:"shrink"}],sections:a}))}renderHScrollLayout(e,n,r,i,s,a,o){let p=this.context.pluginHooks.scrollGridImpl;if(!p)throw new Error("No ScrollGrid implementation");let{context:g,props:y}=this,v=!y.forPrint&&Ug(g.options),E=!y.forPrint&&oD(g.options),T=[];e&&T.push({type:"header",key:"header",isSticky:v,syncRowHeights:!0,chunks:[{key:"axis",rowContent:N=>ce("tr",{role:"presentation"},this.renderHeadAxis("day",N.rowSyncHeights[0]))},{key:"cols",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),n&&(T.push({type:"body",key:"all-day",syncRowHeights:!0,chunks:[{key:"axis",rowContent:N=>ce("tr",{role:"presentation"},this.renderTableRowAxis(N.rowSyncHeights[0]))},{key:"cols",content:n}]}),T.push({key:"all-day-divider",type:"body",outerContent:ce("tr",{role:"presentation",className:"fc-scrollgrid-section"},ce("td",{colSpan:2,className:"fc-timegrid-divider "+g.theme.getClass("tableCellShaded")}))}));let D=g.options.nowIndicator;return T.push({type:"body",key:"body",liquid:!0,expandRows:!!g.options.expandRows,chunks:[{key:"axis",content:N=>ce("div",{className:"fc-timegrid-axis-chunk"},ce("table",{"aria-hidden":!0,style:{height:N.expandRows?N.clientHeight:""}},N.tableColGroupNode,ce("tbody",null,ce(ZJ,{slatMetas:a}))),ce("div",{className:"fc-timegrid-now-indicator-container"},ce(tu,{unit:D?"minute":"day"},B=>{let F=D&&o&&o.safeComputeTop(B);return typeof F=="number"?ce(rv,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:F},isAxis:!0,date:B}):null})))},{key:"cols",scrollerElRef:this.scrollerElRef,content:r}]}),E&&T.push({key:"footer",type:"footer",isSticky:!0,chunks:[{key:"axis",content:tv},{key:"cols",content:tv}]}),ce(cf,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:g.viewSpec},ce(p,{liquid:!y.isHeightAuto&&!y.forPrint,forPrint:y.forPrint,collapsibleWidth:!1,colGroups:[{width:"shrink",cols:[{width:"shrink"}]},{cols:[{span:i,minWidth:s}]}],sections:T}))}getAllDayMaxEventProps(){let{dayMaxEvents:e,dayMaxEventRows:n}=this.context.options;return(e===!0||n===!0)&&(e=void 0,n=KJ),{dayMaxEvents:e,dayMaxEventRows:n}}}function QJ(t){return t.text}class eQ{constructor(e,n,r){this.positions=e,this.dateProfile=n,this.slotDuration=r}safeComputeTop(e){let{dateProfile:n}=this;if(ua(n.currentRange,e)){let r=er(e),i=e.valueOf()-r.valueOf();if(i>=lo(n.slotMinTime)&&i<lo(n.slotMaxTime))return this.computeTimeTop(gn(i))}return null}computeDateTop(e,n){return n||(n=er(e)),this.computeTimeTop(gn(e.valueOf()-n.valueOf()))}computeTimeTop(e){let{positions:n,dateProfile:r}=this,i=n.els.length,s=(e.milliseconds-lo(r.slotMinTime))/lo(this.slotDuration),a,o;return s=Math.max(0,s),s=Math.min(i,s),a=Math.floor(s),a=Math.min(a,i-1),o=s-a,n.tops[a]+n.getHeight(a)*o}}class tQ extends Tn{render(){let{props:e,context:n}=this,{options:r}=n,{slatElRefs:i}=e;return ce("tbody",null,e.slatMetas.map((s,a)=>{let o={time:s.time,date:n.dateEnv.toDate(s.date),view:n.viewApi};return ce("tr",{key:s.key,ref:i.createRef(s.key)},e.axis&&ce(VD,Object.assign({},s)),ce(yi,{elTag:"td",elClasses:["fc-timegrid-slot","fc-timegrid-slot-lane",!s.isLabeled&&"fc-timegrid-slot-minor"],elAttrs:{"data-time":s.isoTimeStr},renderProps:o,generatorName:"slotLaneContent",customGenerator:r.slotLaneContent,classNameGenerator:r.slotLaneClassNames,didMount:r.slotLaneDidMount,willUnmount:r.slotLaneWillUnmount}))}))}}class nQ extends Tn{constructor(){super(...arguments),this.rootElRef=Mi(),this.slatElRefs=new fa}render(){let{props:e,context:n}=this;return ce("div",{ref:this.rootElRef,className:"fc-timegrid-slots"},ce("table",{"aria-hidden":!0,className:n.theme.getClass("table"),style:{minWidth:e.tableMinWidth,width:e.clientWidth,height:e.minHeight}},e.tableColGroupNode,ce(tQ,{slatElRefs:this.slatElRefs,axis:e.axis,slatMetas:e.slatMetas})))}componentDidMount(){this.updateSizing()}componentDidUpdate(){this.updateSizing()}componentWillUnmount(){this.props.onCoords&&this.props.onCoords(null)}updateSizing(){let{context:e,props:n}=this;n.onCoords&&n.clientWidth!==null&&this.rootElRef.current.offsetHeight&&n.onCoords(new eQ(new eu(this.rootElRef.current,rQ(this.slatElRefs.currentMap,n.slatMetas),!1,!0),this.props.dateProfile,e.options.slotDuration))}}function rQ(t,e){return e.map(n=>t[n.key])}function ff(t,e){let n=[],r;for(r=0;r<e;r+=1)n.push([]);if(t)for(r=0;r<t.length;r+=1)n[t[r].col].push(t[r]);return n}function FD(t,e){let n=[];if(t){for(let r=0;r<e;r+=1)n[r]={affectedInstances:t.affectedInstances,isEvent:t.isEvent,segs:[]};for(let r of t.segs)n[r.col].segs.push(r)}else for(let r=0;r<e;r+=1)n[r]=null;return n}class iQ extends Tn{render(){let{props:e}=this;return ce(uD,{elClasses:["fc-timegrid-more-link"],elStyle:{top:e.top,bottom:e.bottom},allDayDate:null,moreCnt:e.hiddenSegs.length,allSegs:e.hiddenSegs,hiddenSegs:e.hiddenSegs,extraDateSpan:e.extraDateSpan,dateProfile:e.dateProfile,todayRange:e.todayRange,popoverContent:()=>UD(e.hiddenSegs,e),defaultGenerator:sQ,forceTimed:!0},n=>ce(n,{elTag:"div",elClasses:["fc-timegrid-more-link-inner","fc-sticky"]}))}}function sQ(t){return t.shortText}function oQ(t,e,n){let r=new GM;e!=null&&(r.strictOrder=e),n!=null&&(r.maxStackCnt=n);let i=r.addSegs(t),s=kX(i),a=aQ(r);return a=uQ(a,1),{segRects:hQ(a),hiddenGroups:s}}function aQ(t){const{entriesByLevel:e}=t,n=dv((r,i)=>r+":"+i,(r,i)=>{let s=dQ(t,r,i),a=$D(s,n),o=e[r][i];return[Object.assign(Object.assign({},o),{nextLevelNodes:a[0]}),o.thickness+a[1]]});return $D(e.length?{level:0,lateralStart:0,lateralEnd:e[0].length}:null,n)[0]}function $D(t,e){if(!t)return[[],0];let{level:n,lateralStart:r,lateralEnd:i}=t,s=r,a=[];for(;s<i;)a.push(e(n,s)),s+=1;return a.sort(lQ),[a.map(cQ),a[0][1]]}function lQ(t,e){return e[1]-t[1]}function cQ(t){return t[0]}function dQ(t,e,n){let{levelCoords:r,entriesByLevel:i}=t,s=i[e][n],a=r[e]+s.thickness,o=r.length,p=e;for(;p<o&&r[p]<a;p+=1);for(;p<o;p+=1){let g=i[p],y,v=Jx(g,s.span.start,Zx),E=v[0]+v[1],T=E;for(;(y=g[T])&&y.span.start<s.span.end;)T+=1;if(E<T)return{level:p,lateralStart:E,lateralEnd:T}}return null}function uQ(t,e){const n=dv((r,i,s)=>Cc(r),(r,i,s)=>{let{nextLevelNodes:a,thickness:o}=r,p=o+s,g=o/p,y,v=[];if(!a.length)y=e;else for(let T of a)if(y===void 0){let D=n(T,i,p);y=D[0],v.push(D[1])}else{let D=n(T,y,0);v.push(D[1])}let E=(y-i)*g;return[y-E,Object.assign(Object.assign({},r),{thickness:E,nextLevelNodes:v})]});return t.map(r=>n(r,0,0)[1])}function hQ(t){let e=[];const n=dv((i,s,a)=>Cc(i),(i,s,a)=>{let o=Object.assign(Object.assign({},i),{levelCoord:s,stackDepth:a,stackForward:0});return e.push(o),o.stackForward=r(i.nextLevelNodes,s+i.thickness,a+1)+1});function r(i,s,a){let o=0;for(let p of i)o=Math.max(n(p,s,a),o);return o}return r(t,0,0),e}function dv(t,e){const n={};return(...r)=>{let i=t(...r);return i in n?n[i]:n[i]=e(...r)}}function jD(t,e,n=null,r=0){let i=[];if(n)for(let s=0;s<t.length;s+=1){let a=t[s],o=n.computeDateTop(a.start,e),p=Math.max(o+(r||0),n.computeDateTop(a.end,e));i.push({start:Math.round(o),end:Math.round(p)})}return i}function fQ(t,e,n,r){let i=[],s=[];for(let g=0;g<t.length;g+=1){let y=e[g];y?i.push({index:g,thickness:1,span:y}):s.push(t[g])}let{segRects:a,hiddenGroups:o}=oQ(i,n,r),p=[];for(let g of a)p.push({seg:t[g.index],rect:g});for(let g of s)p.push({seg:g,rect:null});return{segPlacements:p,hiddenGroups:o}}const pQ=ir({hour:"numeric",minute:"2-digit",meridiem:!1});class HD extends Tn{render(){return ce(aD,Object.assign({},this.props,{elClasses:["fc-timegrid-event","fc-v-event",this.props.isShort&&"fc-timegrid-event-short"],defaultTimeFormat:pQ}))}}class mQ extends Tn{constructor(){super(...arguments),this.sortEventSegs=Ft(Lx)}render(){let{props:e,context:n}=this,{options:r}=n,i=r.selectMirror,s=e.eventDrag&&e.eventDrag.segs||e.eventResize&&e.eventResize.segs||i&&e.dateSelectionSegs||[],a=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{},o=this.sortEventSegs(e.fgEventSegs,r.eventOrder);return ce(iv,{elTag:"td",elRef:e.elRef,elClasses:["fc-timegrid-col",...e.extraClassNames||[]],elAttrs:Object.assign({role:"gridcell"},e.extraDataAttrs),date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,extraRenderProps:e.extraRenderProps},p=>ce("div",{className:"fc-timegrid-col-frame"},ce("div",{className:"fc-timegrid-col-bg"},this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(e.dateSelectionSegs,"highlight")),ce("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(o,a,!1,!1,!1)),ce("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(s,{},!!e.eventDrag,!!e.eventResize,!!i,"mirror")),ce("div",{className:"fc-timegrid-now-indicator-container"},this.renderNowIndicator(e.nowIndicatorSegs)),sv(r)&&ce(p,{elTag:"div",elClasses:["fc-timegrid-col-misc"]})))}renderFgSegs(e,n,r,i,s,a){let{props:o}=this;return o.forPrint?UD(e,o):this.renderPositionedFgSegs(e,n,r,i,s,a)}renderPositionedFgSegs(e,n,r,i,s,a){let{eventMaxStack:o,eventShortHeight:p,eventOrderStrict:g,eventMinHeight:y}=this.context.options,{date:v,slatCoords:E,eventSelection:T,todayRange:D,nowDate:N}=this.props,B=r||i||s,F=jD(e,v,E,y),{segPlacements:X,hiddenGroups:te}=fQ(e,F,g,o);return ce(Qn,null,this.renderHiddenGroups(te,e),X.map(H=>{let{seg:ke,rect:ge}=H,Se=ke.eventRange.instance.instanceId,Pe=B||!!(!n[Se]&&ge),Ne=uv(ge&&ge.span),at=!B&&ge?this.computeSegHStyle(ge):{left:0,right:0},Je=!!ge&&ge.stackForward>0,mt=!!ge&&ge.span.end-ge.span.start<p;return ce("div",{className:"fc-timegrid-event-harness"+(Je?" fc-timegrid-event-harness-inset":""),key:a||Se,style:Object.assign(Object.assign({visibility:Pe?"":"hidden"},Ne),at)},ce(HD,Object.assign({seg:ke,isDragging:r,isResizing:i,isDateSelecting:s,isSelected:Se===T,isShort:mt},ha(ke,D,N))))}))}renderHiddenGroups(e,n){let{extraDateSpan:r,dateProfile:i,todayRange:s,nowDate:a,eventSelection:o,eventDrag:p,eventResize:g}=this.props;return ce(Qn,null,e.map(y=>{let v=uv(y.span),E=gQ(y.entries,n);return ce(iQ,{key:aM(fD(E)),hiddenSegs:E,top:v.top,bottom:v.bottom,extraDateSpan:r,dateProfile:i,todayRange:s,nowDate:a,eventSelection:o,eventDrag:p,eventResize:g})}))}renderFillSegs(e,n){let{props:r,context:i}=this,a=jD(e,r.date,r.slatCoords,i.options.eventMinHeight).map((o,p)=>{let g=e[p];return ce("div",{key:VM(g.eventRange),className:"fc-timegrid-bg-harness",style:uv(o)},n==="bg-event"?ce(lD,Object.assign({seg:g},ha(g,r.todayRange,r.nowDate))):cD(n))});return ce(Qn,null,a)}renderNowIndicator(e){let{slatCoords:n,date:r}=this.props;return n?e.map((i,s)=>ce(rv,{key:s,elClasses:["fc-timegrid-now-indicator-line"],elStyle:{top:n.computeDateTop(i.start,r)},isAxis:!1,date:r})):null}computeSegHStyle(e){let{isRtl:n,options:r}=this.context,i=r.slotEventOverlap,s=e.levelCoord,a=e.levelCoord+e.thickness,o,p;i&&(a=Math.min(1,s+(a-s)*2)),n?(o=1-a,p=s):(o=s,p=1-a);let g={zIndex:e.stackDepth+1,left:o*100+"%",right:p*100+"%"};return i&&!e.stackForward&&(g[n?"marginLeft":"marginRight"]=10*2),g}}function UD(t,{todayRange:e,nowDate:n,eventSelection:r,eventDrag:i,eventResize:s}){let a=(i?i.affectedInstances:null)||(s?s.affectedInstances:null)||{};return ce(Qn,null,t.map(o=>{let p=o.eventRange.instance.instanceId;return ce("div",{key:p,style:{visibility:a[p]?"hidden":""}},ce(HD,Object.assign({seg:o,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:p===r,isShort:!1},ha(o,e,n))))}))}function uv(t){return t?{top:t.start,bottom:-t.end}:{top:"",bottom:""}}function gQ(t,e){return t.map(n=>e[n.index])}class yQ extends Tn{constructor(){super(...arguments),this.splitFgEventSegs=Ft(ff),this.splitBgEventSegs=Ft(ff),this.splitBusinessHourSegs=Ft(ff),this.splitNowIndicatorSegs=Ft(ff),this.splitDateSelectionSegs=Ft(ff),this.splitEventDrag=Ft(FD),this.splitEventResize=Ft(FD),this.rootElRef=Mi(),this.cellElRefs=new fa}render(){let{props:e,context:n}=this,r=n.options.nowIndicator&&e.slatCoords&&e.slatCoords.safeComputeTop(e.nowDate),i=e.cells.length,s=this.splitFgEventSegs(e.fgEventSegs,i),a=this.splitBgEventSegs(e.bgEventSegs,i),o=this.splitBusinessHourSegs(e.businessHourSegs,i),p=this.splitNowIndicatorSegs(e.nowIndicatorSegs,i),g=this.splitDateSelectionSegs(e.dateSelectionSegs,i),y=this.splitEventDrag(e.eventDrag,i),v=this.splitEventResize(e.eventResize,i);return ce("div",{className:"fc-timegrid-cols",ref:this.rootElRef},ce("table",{role:"presentation",style:{minWidth:e.tableMinWidth,width:e.clientWidth}},e.tableColGroupNode,ce("tbody",{role:"presentation"},ce("tr",{role:"row"},e.axis&&ce("td",{"aria-hidden":!0,className:"fc-timegrid-col fc-timegrid-axis"},ce("div",{className:"fc-timegrid-col-frame"},ce("div",{className:"fc-timegrid-now-indicator-container"},typeof r=="number"&&ce(rv,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:r},isAxis:!0,date:e.nowDate})))),e.cells.map((E,T)=>ce(mQ,{key:E.key,elRef:this.cellElRefs.createRef(E.key),dateProfile:e.dateProfile,date:E.date,nowDate:e.nowDate,todayRange:e.todayRange,extraRenderProps:E.extraRenderProps,extraDataAttrs:E.extraDataAttrs,extraClassNames:E.extraClassNames,extraDateSpan:E.extraDateSpan,fgEventSegs:s[T],bgEventSegs:a[T],businessHourSegs:o[T],nowIndicatorSegs:p[T],dateSelectionSegs:g[T],eventDrag:y[T],eventResize:v[T],slatCoords:e.slatCoords,eventSelection:e.eventSelection,forPrint:e.forPrint}))))))}componentDidMount(){this.updateCoords()}componentDidUpdate(){this.updateCoords()}updateCoords(){let{props:e}=this;e.onColCoords&&e.clientWidth!==null&&e.onColCoords(new eu(this.rootElRef.current,bQ(this.cellElRefs.currentMap,e.cells),!0,!1))}}function bQ(t,e){return e.map(n=>t[n.key])}class _Q extends co{constructor(){super(...arguments),this.processSlotOptions=Ft(xQ),this.state={slatCoords:null},this.handleRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)},this.handleScrollRequest=e=>{let{onScrollTopRequest:n}=this.props,{slatCoords:r}=this.state;if(n&&r){if(e.time){let i=r.computeTimeTop(e.time);i=Math.ceil(i),i&&(i+=1),n(i)}return!0}return!1},this.handleColCoords=e=>{this.colCoords=e},this.handleSlatCoords=e=>{this.setState({slatCoords:e}),this.props.onSlatCoords&&this.props.onSlatCoords(e)}}render(){let{props:e,state:n}=this;return ce("div",{className:"fc-timegrid-body",ref:this.handleRootEl,style:{width:e.clientWidth,minWidth:e.tableMinWidth}},ce(nQ,{axis:e.axis,dateProfile:e.dateProfile,slatMetas:e.slatMetas,clientWidth:e.clientWidth,minHeight:e.expandRows?e.clientHeight:"",tableMinWidth:e.tableMinWidth,tableColGroupNode:e.axis?e.tableColGroupNode:null,onCoords:this.handleSlatCoords}),ce(yQ,{cells:e.cells,axis:e.axis,dateProfile:e.dateProfile,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange,nowDate:e.nowDate,nowIndicatorSegs:e.nowIndicatorSegs,clientWidth:e.clientWidth,tableMinWidth:e.tableMinWidth,tableColGroupNode:e.tableColGroupNode,slatCoords:n.slatCoords,onColCoords:this.handleColCoords,forPrint:e.forPrint}))}componentDidMount(){this.scrollResponder=this.context.createScrollResponder(this.handleScrollRequest)}componentDidUpdate(e){this.scrollResponder.update(e.dateProfile!==this.props.dateProfile)}componentWillUnmount(){this.scrollResponder.detach()}queryHit(e,n){let{dateEnv:r,options:i}=this.context,{colCoords:s}=this,{dateProfile:a}=this.props,{slatCoords:o}=this.state,{snapDuration:p,snapsPerSlot:g}=this.processSlotOptions(this.props.slotDuration,i.snapDuration),y=s.leftToIndex(e),v=o.positions.topToIndex(n);if(y!=null&&v!=null){let E=this.props.cells[y],T=o.positions.tops[v],D=o.positions.getHeight(v),N=(n-T)/D,B=Math.floor(N*g),F=v*g+B,X=this.props.cells[y].date,te=px(a.slotMinTime,uY(p,F)),H=r.add(X,te),ke=r.add(H,p);return{dateProfile:a,dateSpan:Object.assign({range:{start:H,end:ke},allDay:!1},E.extraDateSpan),dayEl:s.els[y],rect:{left:s.lefts[y],right:s.rights[y],top:T,bottom:T+D},layer:0}}return null}}function xQ(t,e){let n=e||t,r=mx(t,n);return r===null&&(n=t,r=1),{snapDuration:n,snapsPerSlot:r}}class vQ extends eD{sliceRange(e,n){let r=[];for(let i=0;i<n.length;i+=1){let s=ll(e,n[i]);s&&r.push({start:s.start,end:s.end,isStart:s.start.valueOf()===e.start.valueOf(),isEnd:s.end.valueOf()===e.end.valueOf(),col:i})}return r}}class wQ extends co{constructor(){super(...arguments),this.buildDayRanges=Ft(kQ),this.slicer=new vQ,this.timeColsRef=Mi()}render(){let{props:e,context:n}=this,{dateProfile:r,dayTableModel:i}=e,{nowIndicator:s,nextDayThreshold:a}=n.options,o=this.buildDayRanges(i,r,n.dateEnv);return ce(tu,{unit:s?"minute":"day"},(p,g)=>ce(_Q,Object.assign({ref:this.timeColsRef},this.slicer.sliceProps(e,r,null,n,o),{forPrint:e.forPrint,axis:e.axis,dateProfile:r,slatMetas:e.slatMetas,slotDuration:e.slotDuration,cells:i.cells[0],tableColGroupNode:e.tableColGroupNode,tableMinWidth:e.tableMinWidth,clientWidth:e.clientWidth,clientHeight:e.clientHeight,expandRows:e.expandRows,nowDate:p,nowIndicatorSegs:s&&this.slicer.sliceNowDate(p,r,a,n,o),todayRange:g,onScrollTopRequest:e.onScrollTopRequest,onSlatCoords:e.onSlatCoords})))}}function kQ(t,e,n){let r=[];for(let i of t.headerDates)r.push({start:n.add(i,e.slotMinTime),end:n.add(i,e.slotMaxTime)});return r}const WD=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];function EQ(t,e,n,r,i){let s=new Date(0),a=t,o=gn(0),p=n||SQ(r),g=[];for(;lo(a)<lo(e);){let y=i.add(s,a),v=mx(o,p)!==null;g.push({date:y,time:a,key:y.toISOString(),isoTimeStr:TY(y),isLabeled:v}),a=px(a,r),o=px(o,r)}return g}function SQ(t){let e,n,r;for(e=WD.length-1;e>=0;e-=1)if(n=gn(WD[e]),r=mx(n,t),r!==null&&r>1)return n;return t}class CQ extends JJ{constructor(){super(...arguments),this.buildTimeColsModel=Ft(TQ),this.buildSlatMetas=Ft(EQ)}render(){let{options:e,dateEnv:n,dateProfileGenerator:r}=this.context,{props:i}=this,{dateProfile:s}=i,a=this.buildTimeColsModel(s,r),o=this.allDaySplitter.splitProps(i),p=this.buildSlatMetas(s.slotMinTime,s.slotMaxTime,e.slotLabelInterval,e.slotDuration,n),{dayMinWidth:g}=e,y=!g,v=g,E=e.dayHeaders&&ce(KM,{dates:a.headerDates,dateProfile:s,datesRepDistinctDays:!0,renderIntro:y?this.renderHeadAxis:null}),T=e.allDaySlot!==!1&&(N=>ce(LD,Object.assign({},o.allDay,{dateProfile:s,dayTableModel:a,nextDayThreshold:e.nextDayThreshold,tableMinWidth:N.tableMinWidth,colGroupNode:N.tableColGroupNode,renderRowIntro:y?this.renderTableRowAxis:null,showWeekNumbers:!1,expandRows:!1,headerAlignElRef:this.headerElRef,clientWidth:N.clientWidth,clientHeight:N.clientHeight,forPrint:i.forPrint},this.getAllDayMaxEventProps()))),D=N=>ce(wQ,Object.assign({},o.timed,{dayTableModel:a,dateProfile:s,axis:y,slotDuration:e.slotDuration,slatMetas:p,forPrint:i.forPrint,tableColGroupNode:N.tableColGroupNode,tableMinWidth:N.tableMinWidth,clientWidth:N.clientWidth,clientHeight:N.clientHeight,onSlatCoords:this.handleSlatCoords,expandRows:N.expandRows,onScrollTopRequest:this.handleScrollTopRequest}));return v?this.renderHScrollLayout(E,T,D,a.colCnt,g,p,this.state.slatCoords):this.renderSimpleLayout(E,T,D)}}function TQ(t,e){let n=new JM(t.renderRange,e);return new QM(n,!1)}var AQ='.fc-v-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-v-event .fc-event-main{color:var(--fc-event-text-color);height:100%}.fc-v-event .fc-event-main-frame{display:flex;flex-direction:column;height:100%}.fc-v-event .fc-event-time{flex-grow:0;flex-shrink:0;max-height:100%;overflow:hidden}.fc-v-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-height:0}.fc-v-event .fc-event-title{bottom:0;max-height:100%;overflow:hidden;top:0}.fc-v-event:not(.fc-event-start){border-top-left-radius:0;border-top-right-radius:0;border-top-width:0}.fc-v-event:not(.fc-event-end){border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-width:0}.fc-v-event.fc-event-selected:before{left:-10px;right:-10px}.fc-v-event .fc-event-resizer-start{cursor:n-resize}.fc-v-event .fc-event-resizer-end{cursor:s-resize}.fc-v-event:not(.fc-event-selected) .fc-event-resizer{height:var(--fc-event-resizer-thickness);left:0;right:0}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start{top:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer{left:50%;margin-left:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-start{top:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc .fc-timegrid .fc-daygrid-body{z-index:2}.fc .fc-timegrid-divider{padding:0 0 2px}.fc .fc-timegrid-body{min-height:100%;position:relative;z-index:1}.fc .fc-timegrid-axis-chunk{position:relative}.fc .fc-timegrid-axis-chunk>table,.fc .fc-timegrid-slots{position:relative;z-index:1}.fc .fc-timegrid-slot{border-bottom:0;height:1.5em}.fc .fc-timegrid-slot:empty:before{content:"\\00a0"}.fc .fc-timegrid-slot-minor{border-top-style:dotted}.fc .fc-timegrid-slot-label-cushion{display:inline-block;white-space:nowrap}.fc .fc-timegrid-slot-label{vertical-align:middle}.fc .fc-timegrid-axis-cushion,.fc .fc-timegrid-slot-label-cushion{padding:0 4px}.fc .fc-timegrid-axis-frame-liquid{height:100%}.fc .fc-timegrid-axis-frame{align-items:center;display:flex;justify-content:flex-end;overflow:hidden}.fc .fc-timegrid-axis-cushion{flex-shrink:0;max-width:60px}.fc-direction-ltr .fc-timegrid-slot-label-frame{text-align:right}.fc-direction-rtl .fc-timegrid-slot-label-frame{text-align:left}.fc-liquid-hack .fc-timegrid-axis-frame-liquid{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-timegrid-col-frame{min-height:100%;position:relative}.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols{bottom:0;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols>table{height:100%}.fc-media-screen .fc-timegrid-col-bg,.fc-media-screen .fc-timegrid-col-events,.fc-media-screen .fc-timegrid-now-indicator-container{left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col-bg{z-index:2}.fc .fc-timegrid-col-bg .fc-non-business{z-index:1}.fc .fc-timegrid-col-bg .fc-bg-event{z-index:2}.fc .fc-timegrid-col-bg .fc-highlight{z-index:3}.fc .fc-timegrid-bg-harness{left:0;position:absolute;right:0}.fc .fc-timegrid-col-events{z-index:3}.fc .fc-timegrid-now-indicator-container{bottom:0;overflow:hidden}.fc-direction-ltr .fc-timegrid-col-events{margin:0 2.5% 0 2px}.fc-direction-rtl .fc-timegrid-col-events{margin:0 2px 0 2.5%}.fc-timegrid-event-harness{position:absolute}.fc-timegrid-event-harness>.fc-timegrid-event{bottom:0;left:0;position:absolute;right:0;top:0}.fc-timegrid-event-harness-inset .fc-timegrid-event,.fc-timegrid-event.fc-event-mirror,.fc-timegrid-more-link{box-shadow:0 0 0 1px var(--fc-page-bg-color)}.fc-timegrid-event,.fc-timegrid-more-link{border-radius:3px;font-size:var(--fc-small-font-size)}.fc-timegrid-event{margin-bottom:1px}.fc-timegrid-event .fc-event-main{padding:1px 1px 0}.fc-timegrid-event .fc-event-time{font-size:var(--fc-small-font-size);margin-bottom:1px;white-space:nowrap}.fc-timegrid-event-short .fc-event-main-frame{flex-direction:row;overflow:hidden}.fc-timegrid-event-short .fc-event-time:after{content:"\\00a0-\\00a0"}.fc-timegrid-event-short .fc-event-title{font-size:var(--fc-small-font-size)}.fc-timegrid-more-link{background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;margin-bottom:1px;position:absolute;z-index:9999}.fc-timegrid-more-link-inner{padding:3px 2px;top:0}.fc-direction-ltr .fc-timegrid-more-link{right:0}.fc-direction-rtl .fc-timegrid-more-link{left:0}.fc .fc-timegrid-now-indicator-arrow,.fc .fc-timegrid-now-indicator-line{pointer-events:none}.fc .fc-timegrid-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;border-width:1px 0 0;left:0;position:absolute;right:0;z-index:4}.fc .fc-timegrid-now-indicator-arrow{border-color:var(--fc-now-indicator-color);border-style:solid;margin-top:-5px;position:absolute;z-index:4}.fc-direction-ltr .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 0 5px 6px;left:0}.fc-direction-rtl .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 6px 5px 0;right:0}';wg(AQ);var MQ=Ro({name:"@fullcalendar/timegrid",initialView:"timeGridWeek",optionRefiners:{allDaySlot:Boolean},views:{timeGrid:{component:CQ,usesMinMaxTime:!0,allDaySlot:!0,slotDuration:"00:30:00",slotEventOverlap:!0},timeGridDay:{type:"timeGrid",duration:{days:1}},timeGridWeek:{type:"timeGrid",duration:{weeks:1}}}});class DQ extends Tn{constructor(){super(...arguments),this.state={textId:nl()}}render(){let{theme:e,dateEnv:n,options:r,viewApi:i}=this.context,{cellId:s,dayDate:a,todayRange:o}=this.props,{textId:p}=this.state,g=Ux(a,o),y=r.listDayFormat?n.format(a,r.listDayFormat):"",v=r.listDaySideFormat?n.format(a,r.listDaySideFormat):"",E=Object.assign({date:n.toDate(a),view:i,textId:p,text:y,sideText:v,navLinkAttrs:Qd(this.context,a),sideNavLinkAttrs:Qd(this.context,a,"day",!1)},g);return ce(yi,{elTag:"tr",elClasses:["fc-list-day",...Fg(g,e)],elAttrs:{"data-date":of(a)},renderProps:E,generatorName:"dayHeaderContent",customGenerator:r.dayHeaderContent,defaultGenerator:IQ,classNameGenerator:r.dayHeaderClassNames,didMount:r.dayHeaderDidMount,willUnmount:r.dayHeaderWillUnmount},T=>ce("th",{scope:"colgroup",colSpan:3,id:s,"aria-labelledby":p},ce(T,{elTag:"div",elClasses:["fc-list-day-cushion",e.getClass("tableCellShaded")]})))}}function IQ(t){return ce(Qn,null,t.text&&ce("a",Object.assign({id:t.textId,className:"fc-list-day-text"},t.navLinkAttrs),t.text),t.sideText&&ce("a",Object.assign({"aria-hidden":!0,className:"fc-list-day-side-text"},t.sideNavLinkAttrs),t.sideText))}const PQ=ir({hour:"numeric",minute:"2-digit",meridiem:"short"});class RQ extends Tn{render(){let{props:e,context:n}=this,{options:r}=n,{seg:i,timeHeaderId:s,eventHeaderId:a,dateHeaderId:o}=e,p=r.eventTimeFormat||PQ;return ce(Wg,Object.assign({},e,{elTag:"tr",elClasses:["fc-list-event",i.eventRange.def.url&&"fc-event-forced-url"],defaultGenerator:()=>OQ(i,n),seg:i,timeText:"",disableDragging:!0,disableResizing:!0}),(g,y)=>ce(Qn,null,NQ(i,p,n,s,o),ce("td",{"aria-hidden":!0,className:"fc-list-event-graphic"},ce("span",{className:"fc-list-event-dot",style:{borderColor:y.borderColor||y.backgroundColor}})),ce(g,{elTag:"td",elClasses:["fc-list-event-title"],elAttrs:{headers:`${a} ${o}`}})))}}function OQ(t,e){let n=Vx(t,e);return ce("a",Object.assign({},n),t.eventRange.def.title)}function NQ(t,e,n,r,i){let{options:s}=n;if(s.displayEventTime!==!1){let a=t.eventRange.def,o=t.eventRange.instance,p=!1,g;if(a.allDay?p=!0:hZ(t.eventRange.range)?t.isStart?g=hf(t,e,n,null,null,o.range.start,t.end):t.isEnd?g=hf(t,e,n,null,null,t.start,o.range.end):p=!0:g=hf(t,e,n),p){let y={text:n.options.allDayText,view:n.viewApi};return ce(yi,{elTag:"td",elClasses:["fc-list-event-time"],elAttrs:{headers:`${r} ${i}`},renderProps:y,generatorName:"allDayContent",customGenerator:s.allDayContent,defaultGenerator:BQ,classNameGenerator:s.allDayClassNames,didMount:s.allDayDidMount,willUnmount:s.allDayWillUnmount})}return ce("td",{className:"fc-list-event-time"},g)}return null}function BQ(t){return t.text}class zQ extends co{constructor(){super(...arguments),this.computeDateVars=Ft(VQ),this.eventStoreToSegs=Ft(this._eventStoreToSegs),this.state={timeHeaderId:nl(),eventHeaderId:nl(),dateHeaderIdRoot:nl()},this.setRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:n}=this,{dayDates:r,dayRanges:i}=this.computeDateVars(e.dateProfile),s=this.eventStoreToSegs(e.eventStore,e.eventUiBases,i);return ce(cf,{elRef:this.setRootEl,elClasses:["fc-list",n.theme.getClass("table"),n.options.stickyHeaderDates!==!1?"fc-list-sticky":""],viewSpec:n.viewSpec},ce(iD,{liquid:!e.isHeightAuto,overflowX:e.isHeightAuto?"visible":"hidden",overflowY:e.isHeightAuto?"visible":"auto"},s.length>0?this.renderSegList(s,r):this.renderEmptyMessage()))}renderEmptyMessage(){let{options:e,viewApi:n}=this.context,r={text:e.noEventsText,view:n};return ce(yi,{elTag:"div",elClasses:["fc-list-empty"],renderProps:r,generatorName:"noEventsContent",customGenerator:e.noEventsContent,defaultGenerator:LQ,classNameGenerator:e.noEventsClassNames,didMount:e.noEventsDidMount,willUnmount:e.noEventsWillUnmount},i=>ce(i,{elTag:"div",elClasses:["fc-list-empty-cushion"]}))}renderSegList(e,n){let{theme:r,options:i}=this.context,{timeHeaderId:s,eventHeaderId:a,dateHeaderIdRoot:o}=this.state,p=FQ(e);return ce(tu,{unit:"day"},(g,y)=>{let v=[];for(let E=0;E<p.length;E+=1){let T=p[E];if(T){let D=of(n[E]),N=o+"-"+D;v.push(ce(DQ,{key:D,cellId:N,dayDate:n[E],todayRange:y})),T=Lx(T,i.eventOrder);for(let B of T)v.push(ce(RQ,Object.assign({key:D+":"+B.eventRange.instance.instanceId,seg:B,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,timeHeaderId:s,eventHeaderId:a,dateHeaderId:N},ha(B,y,g))))}}return ce("table",{className:"fc-list-table "+r.getClass("table")},ce("thead",null,ce("tr",null,ce("th",{scope:"col",id:s},i.timeHint),ce("th",{scope:"col","aria-hidden":!0}),ce("th",{scope:"col",id:a},i.eventHint))),ce("tbody",null,v))})}_eventStoreToSegs(e,n,r){return this.eventRangesToSegs(zx(e,n,this.props.dateProfile.activeRange,this.context.options.nextDayThreshold).fg,r)}eventRangesToSegs(e,n){let r=[];for(let i of e)r.push(...this.eventRangeToSegs(i,n));return r}eventRangeToSegs(e,n){let{dateEnv:r}=this.context,{nextDayThreshold:i}=this.context.options,s=e.range,a=e.def.allDay,o,p,g,y=[];for(o=0;o<n.length;o+=1)if(p=ll(s,n[o]),p&&(g={component:this,eventRange:e,start:p.start,end:p.end,isStart:e.isStart&&p.start.valueOf()===s.start.valueOf(),isEnd:e.isEnd&&p.end.valueOf()===s.end.valueOf(),dayIndex:o},y.push(g),!g.isEnd&&!a&&o+1<n.length&&s.end<r.add(n[o+1].start,i))){g.end=s.end,g.isEnd=!0;break}return y}}function LQ(t){return t.text}function VQ(t){let e=er(t.renderRange.start),n=t.renderRange.end,r=[],i=[];for(;e<n;)r.push(e),i.push({start:e,end:Ur(e,1)}),e=Ur(e,1);return{dayDates:r,dayRanges:i}}function FQ(t){let e=[],n,r;for(n=0;n<t.length;n+=1)r=t[n],(e[r.dayIndex]||(e[r.dayIndex]=[])).push(r);return e}var $Q=':root{--fc-list-event-dot-width:10px;--fc-list-event-hover-bg-color:#f5f5f5}.fc-theme-standard .fc-list{border:1px solid var(--fc-border-color)}.fc .fc-list-empty{align-items:center;background-color:var(--fc-neutral-bg-color);display:flex;height:100%;justify-content:center}.fc .fc-list-empty-cushion{margin:5em 0}.fc .fc-list-table{border-style:hidden;width:100%}.fc .fc-list-table tr>*{border-left:0;border-right:0}.fc .fc-list-sticky .fc-list-day>*{background:var(--fc-page-bg-color);position:sticky;top:0}.fc .fc-list-table thead{left:-10000px;position:absolute}.fc .fc-list-table tbody>tr:first-child th{border-top:0}.fc .fc-list-table th{padding:0}.fc .fc-list-day-cushion,.fc .fc-list-table td{padding:8px 14px}.fc .fc-list-day-cushion:after{clear:both;content:"";display:table}.fc-theme-standard .fc-list-day-cushion{background-color:var(--fc-neutral-bg-color)}.fc-direction-ltr .fc-list-day-text,.fc-direction-rtl .fc-list-day-side-text{float:left}.fc-direction-ltr .fc-list-day-side-text,.fc-direction-rtl .fc-list-day-text{float:right}.fc-direction-ltr .fc-list-table .fc-list-event-graphic{padding-right:0}.fc-direction-rtl .fc-list-table .fc-list-event-graphic{padding-left:0}.fc .fc-list-event.fc-event-forced-url{cursor:pointer}.fc .fc-list-event:hover td{background-color:var(--fc-list-event-hover-bg-color)}.fc .fc-list-event-graphic,.fc .fc-list-event-time{white-space:nowrap;width:1px}.fc .fc-list-event-dot{border:calc(var(--fc-list-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-list-event-dot-width)/2);box-sizing:content-box;display:inline-block;height:0;width:0}.fc .fc-list-event-title a{color:inherit;text-decoration:none}.fc .fc-list-event.fc-event-forced-url:hover a{text-decoration:underline}';wg($Q);const jQ={listDayFormat:qD,listDaySideFormat:qD,noEventsClassNames:De,noEventsContent:De,noEventsDidMount:De,noEventsWillUnmount:De};function qD(t){return t===!1?null:ir(t)}var HQ=Ro({name:"@fullcalendar/list",optionRefiners:jQ,views:{list:{component:zQ,buttonTextKey:"list",listDayFormat:{month:"long",day:"numeric",year:"numeric"}},listDay:{type:"list",duration:{days:1},listDayFormat:{weekday:"long"}},listWeek:{type:"list",duration:{weeks:1},listDayFormat:{weekday:"long"},listDaySideFormat:{month:"long",day:"numeric",year:"numeric"}},listMonth:{type:"list",duration:{month:1},listDaySideFormat:{weekday:"long"}},listYear:{type:"list",duration:{year:1},listDaySideFormat:{weekday:"long"}}}});Qx.touchMouseIgnoreWait=500;let hv=0,Yg=0,fv=!1;class GD{constructor(e){this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=n=>{if(!this.shouldIgnoreMouse()&&UQ(n)&&this.tryStart(n)){let r=this.createEventFromMouse(n,!0);this.emitter.trigger("pointerdown",r),this.initScrollWatch(r),this.shouldIgnoreMove||document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}},this.handleMouseMove=n=>{let r=this.createEventFromMouse(n);this.recordCoords(r),this.emitter.trigger("pointermove",r)},this.handleMouseUp=n=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.emitter.trigger("pointerup",this.createEventFromMouse(n)),this.cleanup()},this.handleTouchStart=n=>{if(this.tryStart(n)){this.isTouchDragging=!0;let r=this.createEventFromTouch(n,!0);this.emitter.trigger("pointerdown",r),this.initScrollWatch(r);let i=n.target;this.shouldIgnoreMove||i.addEventListener("touchmove",this.handleTouchMove),i.addEventListener("touchend",this.handleTouchEnd),i.addEventListener("touchcancel",this.handleTouchEnd),window.addEventListener("scroll",this.handleTouchScroll,!0)}},this.handleTouchMove=n=>{let r=this.createEventFromTouch(n);this.recordCoords(r),this.emitter.trigger("pointermove",r)},this.handleTouchEnd=n=>{if(this.isDragging){let r=n.target;r.removeEventListener("touchmove",this.handleTouchMove),r.removeEventListener("touchend",this.handleTouchEnd),r.removeEventListener("touchcancel",this.handleTouchEnd),window.removeEventListener("scroll",this.handleTouchScroll,!0),this.emitter.trigger("pointerup",this.createEventFromTouch(n)),this.cleanup(),this.isTouchDragging=!1,WQ()}},this.handleTouchScroll=()=>{this.wasTouchScroll=!0},this.handleScroll=n=>{if(!this.shouldIgnoreMove){let r=window.scrollX-this.prevScrollX+this.prevPageX,i=window.scrollY-this.prevScrollY+this.prevPageY;this.emitter.trigger("pointermove",{origEvent:n,isTouch:this.isTouchDragging,subjectEl:this.subjectEl,pageX:r,pageY:i,deltaX:r-this.origPageX,deltaY:i-this.origPageY})}},this.containerEl=e,this.emitter=new Lg,e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),qQ()}destroy(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),GQ()}tryStart(e){let n=this.querySubjectEl(e),r=e.target;return n&&(!this.handleSelector||gi(r,this.handleSelector))?(this.subjectEl=n,this.isDragging=!0,this.wasTouchScroll=!1,!0):!1}cleanup(){fv=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()}querySubjectEl(e){return this.selector?gi(e.target,this.selector):this.containerEl}shouldIgnoreMouse(){return hv||this.isTouchDragging}cancelTouchScroll(){this.isDragging&&(fv=!0)}initScrollWatch(e){this.shouldWatchScroll&&(this.recordCoords(e),window.addEventListener("scroll",this.handleScroll,!0))}recordCoords(e){this.shouldWatchScroll&&(this.prevPageX=e.pageX,this.prevPageY=e.pageY,this.prevScrollX=window.scrollX,this.prevScrollY=window.scrollY)}destroyScrollWatch(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)}createEventFromMouse(e,n){let r=0,i=0;return n?(this.origPageX=e.pageX,this.origPageY=e.pageY):(r=e.pageX-this.origPageX,i=e.pageY-this.origPageY),{origEvent:e,isTouch:!1,subjectEl:this.subjectEl,pageX:e.pageX,pageY:e.pageY,deltaX:r,deltaY:i}}createEventFromTouch(e,n){let r=e.touches,i,s,a=0,o=0;return r&&r.length?(i=r[0].pageX,s=r[0].pageY):(i=e.pageX,s=e.pageY),n?(this.origPageX=i,this.origPageY=s):(a=i-this.origPageX,o=s-this.origPageY),{origEvent:e,isTouch:!0,subjectEl:this.subjectEl,pageX:i,pageY:s,deltaX:a,deltaY:o}}}function UQ(t){return t.button===0&&!t.ctrlKey}function WQ(){hv+=1,setTimeout(()=>{hv-=1},Qx.touchMouseIgnoreWait)}function qQ(){Yg+=1,Yg===1&&window.addEventListener("touchmove",YD,{passive:!1})}function GQ(){Yg-=1,Yg||window.removeEventListener("touchmove",YD,{passive:!1})}function YD(t){fv&&t.preventDefault()}class YQ{constructor(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0}start(e,n,r){this.sourceEl=e,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=n-window.scrollX,this.origScreenY=r-window.scrollY,this.deltaX=0,this.deltaY=0,this.updateElPosition()}handleMove(e,n){this.deltaX=e-window.scrollX-this.origScreenX,this.deltaY=n-window.scrollY-this.origScreenY,this.updateElPosition()}setIsVisible(e){e?this.isVisible||(this.mirrorEl&&(this.mirrorEl.style.display=""),this.isVisible=e,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&(this.mirrorEl.style.display="none"),this.isVisible=e)}stop(e,n){let r=()=>{this.cleanup(),n()};e&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(r,this.revertDuration):setTimeout(r,0)}doRevertAnimation(e,n){let r=this.mirrorEl,i=this.sourceEl.getBoundingClientRect();r.style.transition="top "+n+"ms,left "+n+"ms",rf(r,{left:i.left,top:i.top}),XG(r,()=>{r.style.transition="",e()})}cleanup(){this.mirrorEl&&(ux(this.mirrorEl),this.mirrorEl=null),this.sourceEl=null}updateElPosition(){this.sourceEl&&this.isVisible&&rf(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})}getMirrorEl(){let e=this.sourceElRect,n=this.mirrorEl;return n||(n=this.mirrorEl=this.sourceEl.cloneNode(!0),n.style.userSelect="none",n.style.webkitUserSelect="none",n.style.pointerEvents="none",n.classList.add("fc-event-dragging"),rf(n,{position:"fixed",zIndex:this.zIndex,visibility:"",boxSizing:"border-box",width:e.right-e.left,height:e.bottom-e.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(n)),n}}class ZD extends Yx{constructor(e,n){super(),this.handleScroll=()=>{this.scrollTop=this.scrollController.getScrollTop(),this.scrollLeft=this.scrollController.getScrollLeft(),this.handleScrollChange()},this.scrollController=e,this.doesListening=n,this.scrollTop=this.origScrollTop=e.getScrollTop(),this.scrollLeft=this.origScrollLeft=e.getScrollLeft(),this.scrollWidth=e.getScrollWidth(),this.scrollHeight=e.getScrollHeight(),this.clientWidth=e.getClientWidth(),this.clientHeight=e.getClientHeight(),this.clientRect=this.computeClientRect(),this.doesListening&&this.getEventTarget().addEventListener("scroll",this.handleScroll)}destroy(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)}getScrollTop(){return this.scrollTop}getScrollLeft(){return this.scrollLeft}setScrollTop(e){this.scrollController.setScrollTop(e),this.doesListening||(this.scrollTop=Math.max(Math.min(e,this.getMaxScrollTop()),0),this.handleScrollChange())}setScrollLeft(e){this.scrollController.setScrollLeft(e),this.doesListening||(this.scrollLeft=Math.max(Math.min(e,this.getMaxScrollLeft()),0),this.handleScrollChange())}getClientWidth(){return this.clientWidth}getClientHeight(){return this.clientHeight}getScrollWidth(){return this.scrollWidth}getScrollHeight(){return this.scrollHeight}handleScrollChange(){}}class XD extends ZD{constructor(e,n){super(new vX(e),n)}getEventTarget(){return this.scrollController.el}computeClientRect(){return _X(this.scrollController.el)}}class ZQ extends ZD{constructor(e){super(new wX,e)}getEventTarget(){return window}computeClientRect(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}}handleScrollChange(){this.clientRect=this.computeClientRect()}}const KD=typeof performance=="function"?performance.now:Date.now;class XQ{constructor(){this.isEnabled=!0,this.scrollQuery=[window,".fc-scroller"],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=()=>{if(this.isAnimating){let e=this.computeBestEdge(this.pointerScreenX+window.scrollX,this.pointerScreenY+window.scrollY);if(e){let n=KD();this.handleSide(e,(n-this.msSinceRequest)/1e3),this.requestAnimation(n)}else this.isAnimating=!1}}}start(e,n,r){this.isEnabled&&(this.scrollCaches=this.buildCaches(r),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(e,n))}handleMove(e,n){if(this.isEnabled){let r=e-window.scrollX,i=n-window.scrollY,s=this.pointerScreenY===null?0:i-this.pointerScreenY,a=this.pointerScreenX===null?0:r-this.pointerScreenX;s<0?this.everMovedUp=!0:s>0&&(this.everMovedDown=!0),a<0?this.everMovedLeft=!0:a>0&&(this.everMovedRight=!0),this.pointerScreenX=r,this.pointerScreenY=i,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(KD()))}}stop(){if(this.isEnabled){this.isAnimating=!1;for(let e of this.scrollCaches)e.destroy();this.scrollCaches=null}}requestAnimation(e){this.msSinceRequest=e,requestAnimationFrame(this.animate)}handleSide(e,n){let{scrollCache:r}=e,{edgeThreshold:i}=this,s=i-e.distance,a=s*s/(i*i)*this.maxVelocity*n,o=1;switch(e.name){case"left":o=-1;case"right":r.setScrollLeft(r.getScrollLeft()+a*o);break;case"top":o=-1;case"bottom":r.setScrollTop(r.getScrollTop()+a*o);break}}computeBestEdge(e,n){let{edgeThreshold:r}=this,i=null,s=this.scrollCaches||[];for(let a of s){let o=a.clientRect,p=e-o.left,g=o.right-e,y=n-o.top,v=o.bottom-n;p>=0&&g>=0&&y>=0&&v>=0&&(y<=r&&this.everMovedUp&&a.canScrollUp()&&(!i||i.distance>y)&&(i={scrollCache:a,name:"top",distance:y}),v<=r&&this.everMovedDown&&a.canScrollDown()&&(!i||i.distance>v)&&(i={scrollCache:a,name:"bottom",distance:v}),p<=r&&this.everMovedLeft&&a.canScrollLeft()&&(!i||i.distance>p)&&(i={scrollCache:a,name:"left",distance:p}),g<=r&&this.everMovedRight&&a.canScrollRight()&&(!i||i.distance>g)&&(i={scrollCache:a,name:"right",distance:g}))}return i}buildCaches(e){return this.queryScrollEls(e).map(n=>n===window?new ZQ(!1):new XD(n,!1))}queryScrollEls(e){let n=[];for(let r of this.scrollQuery)typeof r=="object"?n.push(r):n.push(...Array.prototype.slice.call(e.getRootNode().querySelectorAll(r)));return n}}class pf extends SX{constructor(e,n){super(e),this.containerEl=e,this.delay=null,this.minDistance=0,this.touchScrollAllowed=!0,this.mirrorNeedsRevert=!1,this.isInteracting=!1,this.isDragging=!1,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.delayTimeoutId=null,this.onPointerDown=i=>{this.isDragging||(this.isInteracting=!0,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,KG(document.body),QG(document.body),i.isTouch||i.origEvent.preventDefault(),this.emitter.trigger("pointerdown",i),this.isInteracting&&!this.pointer.shouldIgnoreMove&&(this.mirror.setIsVisible(!1),this.mirror.start(i.subjectEl,i.pageX,i.pageY),this.startDelay(i),this.minDistance||this.handleDistanceSurpassed(i)))},this.onPointerMove=i=>{if(this.isInteracting){if(this.emitter.trigger("pointermove",i),!this.isDistanceSurpassed){let s=this.minDistance,a,{deltaX:o,deltaY:p}=i;a=o*o+p*p,a>=s*s&&this.handleDistanceSurpassed(i)}this.isDragging&&(i.origEvent.type!=="scroll"&&(this.mirror.handleMove(i.pageX,i.pageY),this.autoScroller.handleMove(i.pageX,i.pageY)),this.emitter.trigger("dragmove",i))}},this.onPointerUp=i=>{this.isInteracting&&(this.isInteracting=!1,JG(document.body),eY(document.body),this.emitter.trigger("pointerup",i),this.isDragging&&(this.autoScroller.stop(),this.tryStopDrag(i)),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null))};let r=this.pointer=new GD(e);r.emitter.on("pointerdown",this.onPointerDown),r.emitter.on("pointermove",this.onPointerMove),r.emitter.on("pointerup",this.onPointerUp),n&&(r.selector=n),this.mirror=new YQ,this.autoScroller=new XQ}destroy(){this.pointer.destroy(),this.onPointerUp({})}startDelay(e){typeof this.delay=="number"?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=null,this.handleDelayEnd(e)},this.delay):this.handleDelayEnd(e)}handleDelayEnd(e){this.isDelayEnded=!0,this.tryStartDrag(e)}handleDistanceSurpassed(e){this.isDistanceSurpassed=!0,this.tryStartDrag(e)}tryStartDrag(e){this.isDelayEnded&&this.isDistanceSurpassed&&(!this.pointer.wasTouchScroll||this.touchScrollAllowed)&&(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(e.pageX,e.pageY,this.containerEl),this.emitter.trigger("dragstart",e),this.touchScrollAllowed===!1&&this.pointer.cancelTouchScroll())}tryStopDrag(e){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,e))}stopDrag(e){this.isDragging=!1,this.emitter.trigger("dragend",e)}setIgnoreMove(e){this.pointer.shouldIgnoreMove=e}setMirrorIsVisible(e){this.mirror.setIsVisible(e)}setMirrorNeedsRevert(e){this.mirrorNeedsRevert=e}setAutoScrollEnabled(e){this.autoScroller.isEnabled=e}}class KQ{constructor(e){this.el=e,this.origRect=Gx(e),this.scrollCaches=qM(e).map(n=>new XD(n,!0))}destroy(){for(let e of this.scrollCaches)e.destroy()}computeLeft(){let e=this.origRect.left;for(let n of this.scrollCaches)e+=n.origScrollLeft-n.getScrollLeft();return e}computeTop(){let e=this.origRect.top;for(let n of this.scrollCaches)e+=n.origScrollTop-n.getScrollTop();return e}isWithinClipping(e,n){let r={left:e,top:n};for(let i of this.scrollCaches)if(!JQ(i.getEventTarget())&&!oX(r,i.clientRect))return!1;return!0}}function JQ(t){let e=t.tagName;return e==="HTML"||e==="BODY"}class Zg{constructor(e,n){this.useSubjectCenter=!1,this.requireInitial=!0,this.disablePointCheck=!1,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=r=>{let{dragging:i}=this;this.initialHit=null,this.movingHit=null,this.finalHit=null,this.prepareHits(),this.processFirstCoord(r),this.initialHit||!this.requireInitial?(i.setIgnoreMove(!1),this.emitter.trigger("pointerdown",r)):i.setIgnoreMove(!0)},this.handleDragStart=r=>{this.emitter.trigger("dragstart",r),this.handleMove(r,!0)},this.handleDragMove=r=>{this.emitter.trigger("dragmove",r),this.handleMove(r)},this.handlePointerUp=r=>{this.releaseHits(),this.emitter.trigger("pointerup",r)},this.handleDragEnd=r=>{this.movingHit&&this.emitter.trigger("hitupdate",null,!0,r),this.finalHit=this.movingHit,this.movingHit=null,this.emitter.trigger("dragend",r)},this.droppableStore=n,e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("dragstart",this.handleDragStart),e.emitter.on("dragmove",this.handleDragMove),e.emitter.on("pointerup",this.handlePointerUp),e.emitter.on("dragend",this.handleDragEnd),this.dragging=e,this.emitter=new Lg}processFirstCoord(e){let n={left:e.pageX,top:e.pageY},r=n,i=e.subjectEl,s;i instanceof HTMLElement&&(s=Gx(i),r=aX(r,s));let a=this.initialHit=this.queryHitForOffset(r.left,r.top);if(a){if(this.useSubjectCenter&&s){let o=UM(s,a.rect);o&&(r=lX(o))}this.coordAdjust=cX(r,n)}else this.coordAdjust={left:0,top:0}}handleMove(e,n){let r=this.queryHitForOffset(e.pageX+this.coordAdjust.left,e.pageY+this.coordAdjust.top);(n||!Xg(this.movingHit,r))&&(this.movingHit=r,this.emitter.trigger("hitupdate",r,!1,e))}prepareHits(){this.offsetTrackers=la(this.droppableStore,e=>(e.component.prepareHits(),new KQ(e.el)))}releaseHits(){let{offsetTrackers:e}=this;for(let n in e)e[n].destroy();this.offsetTrackers={}}queryHitForOffset(e,n){let{droppableStore:r,offsetTrackers:i}=this,s=null;for(let a in r){let o=r[a].component,p=i[a];if(p&&p.isWithinClipping(e,n)){let g=p.computeLeft(),y=p.computeTop(),v=e-g,E=n-y,{origRect:T}=p,D=T.right-T.left,N=T.bottom-T.top;if(v>=0&&v<D&&E>=0&&E<N){let B=o.queryHit(v,E,D,N);B&&Rg(B.dateProfile.activeRange,B.dateSpan.range)&&(this.disablePointCheck||p.el.contains(p.el.getRootNode().elementFromPoint(v+g-window.scrollX,E+y-window.scrollY)))&&(!s||B.layer>s.layer)&&(B.componentId=a,B.context=o.context,B.rect.left+=g,B.rect.right+=g,B.rect.top+=y,B.rect.bottom+=y,s=B)}}}return s}}function Xg(t,e){return!t&&!e?!0:!!t!=!!e?!1:XZ(t.dateSpan,e.dateSpan)}function JD(t,e){let n={};for(let r of e.pluginHooks.datePointTransforms)Object.assign(n,r(t,e));return Object.assign(n,QQ(t,e.dateEnv)),n}function QQ(t,e){return{date:e.toDate(t.range.start),dateStr:e.formatIso(t.range.start,{omitTime:t.allDay}),allDay:t.allDay}}class eee extends Jd{constructor(e){super(e),this.handlePointerDown=r=>{let{dragging:i}=this,s=r.origEvent.target;i.setIgnoreMove(!this.component.isValidDateDownEl(s))},this.handleDragEnd=r=>{let{component:i}=this,{pointer:s}=this.dragging;if(!s.wasTouchScroll){let{initialHit:a,finalHit:o}=this.hitDragging;if(a&&o&&Xg(a,o)){let{context:p}=i,g=Object.assign(Object.assign({},JD(a.dateSpan,p)),{dayEl:a.dayEl,jsEvent:r.origEvent,view:p.viewApi||p.calendarApi.view});p.emitter.trigger("dateClick",g)}}},this.dragging=new pf(e.el),this.dragging.autoScroller.isEnabled=!1;let n=this.hitDragging=new Zg(this.dragging,$x(e));n.emitter.on("pointerdown",this.handlePointerDown),n.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}}class tee extends Jd{constructor(e){super(e),this.dragSelection=null,this.handlePointerDown=a=>{let{component:o,dragging:p}=this,{options:g}=o.context,y=g.selectable&&o.isValidDateDownEl(a.origEvent.target);p.setIgnoreMove(!y),p.delay=a.isTouch?nee(o):null},this.handleDragStart=a=>{this.component.context.calendarApi.unselect(a)},this.handleHitUpdate=(a,o)=>{let{context:p}=this.component,g=null,y=!1;if(a){let v=this.hitDragging.initialHit;a.componentId===v.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(v,a)||(g=ree(v,a,p.pluginHooks.dateSelectionTransformers)),(!g||!IX(g,a.dateProfile,p))&&(y=!0,g=null)}g?p.dispatch({type:"SELECT_DATES",selection:g}):o||p.dispatch({type:"UNSELECT_DATES"}),y?hx():fx(),o||(this.dragSelection=g)},this.handlePointerUp=a=>{this.dragSelection&&(OM(this.dragSelection,a,this.component.context),this.dragSelection=null)};let{component:n}=e,{options:r}=n.context,i=this.dragging=new pf(e.el);i.touchScrollAllowed=!1,i.minDistance=r.selectMinDistance||0,i.autoScroller.isEnabled=r.dragScroll;let s=this.hitDragging=new Zg(this.dragging,$x(e));s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.dragging.destroy()}}function nee(t){let{options:e}=t.context,n=e.selectLongPressDelay;return n==null&&(n=e.longPressDelay),n}function ree(t,e,n){let r=t.dateSpan,i=e.dateSpan,s=[r.range.start,r.range.end,i.range.start,i.range.end];s.sort(sY);let a={};for(let o of n){let p=o(t,e);if(p===!1)return null;p&&Object.assign(a,p)}return a.range={start:s[0],end:s[3]},a.allDay=r.allDay,a}class mf extends Jd{constructor(e){super(e),this.subjectEl=null,this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=a=>{let o=a.origEvent.target,{component:p,dragging:g}=this,{mirror:y}=g,{options:v}=p.context,E=p.context;this.subjectEl=a.subjectEl;let T=this.subjectSeg=Kd(a.subjectEl),N=(this.eventRange=T.eventRange).instance.instanceId;this.relevantEvents=Rx(E.getCurrentData().eventStore,N),g.minDistance=a.isTouch?0:v.eventDragMinDistance,g.delay=a.isTouch&&N!==p.props.eventSelection?see(p):null,v.fixedMirrorParent?y.parentNode=v.fixedMirrorParent:y.parentNode=gi(o,".fc"),y.revertDuration=v.dragRevertDuration;let B=p.isValidSegDownEl(o)&&!gi(o,".fc-event-resizer");g.setIgnoreMove(!B),this.isDragging=B&&a.subjectEl.classList.contains("fc-event-draggable")},this.handleDragStart=a=>{let o=this.component.context,p=this.eventRange,g=p.instance.instanceId;a.isTouch?g!==this.component.props.eventSelection&&o.dispatch({type:"SELECT_EVENT",eventInstanceId:g}):o.dispatch({type:"UNSELECT_EVENT"}),this.isDragging&&(o.calendarApi.unselect(a),o.emitter.trigger("eventDragStart",{el:this.subjectEl,event:new lr(o,p.def,p.instance),jsEvent:a.origEvent,view:o.viewApi}))},this.handleHitUpdate=(a,o)=>{if(!this.isDragging)return;let p=this.relevantEvents,g=this.hitDragging.initialHit,y=this.component.context,v=null,E=null,T=null,D=!1,N={affectedEvents:p,mutatedEvents:ys(),isEvent:!0};if(a){v=a.context;let B=v.options;y===v||B.editable&&B.droppable?(E=iee(g,a,this.eventRange.instance.range.start,v.getCurrentData().pluginHooks.eventDragMutationMassagers),E&&(T=Bx(p,v.getCurrentData().eventUiBases,E,v),N.mutatedEvents=T,tD(N,a.dateProfile,v)||(D=!0,E=null,T=null,N.mutatedEvents=ys()))):v=null}this.displayDrag(v,N),D?hx():fx(),o||(y===v&&Xg(g,a)&&(E=null),this.dragging.setMirrorNeedsRevert(!E),this.dragging.setMirrorIsVisible(!a||!this.subjectEl.getRootNode().querySelector(".fc-event-mirror")),this.receivingContext=v,this.validMutation=E,this.mutatedRelevantEvents=T)},this.handlePointerUp=()=>{this.isDragging||this.cleanup()},this.handleDragEnd=a=>{if(this.isDragging){let o=this.component.context,p=o.viewApi,{receivingContext:g,validMutation:y}=this,v=this.eventRange.def,E=this.eventRange.instance,T=new lr(o,v,E),D=this.relevantEvents,N=this.mutatedRelevantEvents,{finalHit:B}=this.hitDragging;if(this.clearDrag(),o.emitter.trigger("eventDragStop",{el:this.subjectEl,event:T,jsEvent:a.origEvent,view:p}),y){if(g===o){let F=new lr(o,N.defs[v.defId],E?N.instances[E.instanceId]:null);o.dispatch({type:"MERGE_EVENTS",eventStore:N});let X={oldEvent:T,event:F,relatedEvents:Sc(N,o,E),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:D})}},te={};for(let H of o.getCurrentData().pluginHooks.eventDropTransformers)Object.assign(te,H(y,o));o.emitter.trigger("eventDrop",Object.assign(Object.assign(Object.assign({},X),te),{el:a.subjectEl,delta:y.datesDelta,jsEvent:a.origEvent,view:p})),o.emitter.trigger("eventChange",X)}else if(g){let F={event:T,relatedEvents:Sc(D,o,E),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:D})}};o.emitter.trigger("eventLeave",Object.assign(Object.assign({},F),{draggedEl:a.subjectEl,view:p})),o.dispatch({type:"REMOVE_EVENTS",eventStore:D}),o.emitter.trigger("eventRemove",F);let X=N.defs[v.defId],te=N.instances[E.instanceId],H=new lr(g,X,te);g.dispatch({type:"MERGE_EVENTS",eventStore:N});let ke={event:H,relatedEvents:Sc(N,g,te),revert(){g.dispatch({type:"REMOVE_EVENTS",eventStore:N})}};g.emitter.trigger("eventAdd",ke),a.isTouch&&g.dispatch({type:"SELECT_EVENT",eventInstanceId:E.instanceId}),g.emitter.trigger("drop",Object.assign(Object.assign({},JD(B.dateSpan,g)),{draggedEl:a.subjectEl,jsEvent:a.origEvent,view:B.context.viewApi})),g.emitter.trigger("eventReceive",Object.assign(Object.assign({},ke),{draggedEl:a.subjectEl,view:B.context.viewApi}))}}else o.emitter.trigger("_noEventDrop")}this.cleanup()};let{component:n}=this,{options:r}=n.context,i=this.dragging=new pf(e.el);i.pointer.selector=mf.SELECTOR,i.touchScrollAllowed=!1,i.autoScroller.isEnabled=r.dragScroll;let s=this.hitDragging=new Zg(this.dragging,jx);s.useSubjectCenter=e.useEventCenter,s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("pointerup",this.handlePointerUp),s.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}displayDrag(e,n){let r=this.component.context,i=this.receivingContext;i&&i!==e&&(i===r?i.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:n.affectedEvents,mutatedEvents:ys(),isEvent:!0}}):i.dispatch({type:"UNSET_EVENT_DRAG"})),e&&e.dispatch({type:"SET_EVENT_DRAG",state:n})}clearDrag(){let e=this.component.context,{receivingContext:n}=this;n&&n.dispatch({type:"UNSET_EVENT_DRAG"}),e!==n&&e.dispatch({type:"UNSET_EVENT_DRAG"})}cleanup(){this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null}}mf.SELECTOR=".fc-event-draggable, .fc-event-resizable";function iee(t,e,n,r){let i=t.dateSpan,s=e.dateSpan,a=i.range.start,o=s.range.start,p={};i.allDay!==s.allDay&&(p.allDay=s.allDay,p.hasEnd=e.context.options.allDayMaintainDuration,s.allDay?a=er(n):a=n);let g=Zd(a,o,t.context.dateEnv,t.componentId===e.componentId?t.largeUnit:null);g.milliseconds&&(p.allDay=!1);let y={datesDelta:g,standardProps:p};for(let v of r)v(y,t,e);return y}function see(t){let{options:e}=t.context,n=e.eventLongPressDelay;return n==null&&(n=e.longPressDelay),n}class oee extends Jd{constructor(e){super(e),this.draggingSegEl=null,this.draggingSeg=null,this.eventRange=null,this.relevantEvents=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=s=>{let{component:a}=this,o=this.querySegEl(s),p=Kd(o),g=this.eventRange=p.eventRange;this.dragging.minDistance=a.context.options.eventDragMinDistance,this.dragging.setIgnoreMove(!this.component.isValidSegDownEl(s.origEvent.target)||s.isTouch&&this.component.props.eventSelection!==g.instance.instanceId)},this.handleDragStart=s=>{let{context:a}=this.component,o=this.eventRange;this.relevantEvents=Rx(a.getCurrentData().eventStore,this.eventRange.instance.instanceId);let p=this.querySegEl(s);this.draggingSegEl=p,this.draggingSeg=Kd(p),a.calendarApi.unselect(),a.emitter.trigger("eventResizeStart",{el:p,event:new lr(a,o.def,o.instance),jsEvent:s.origEvent,view:a.viewApi})},this.handleHitUpdate=(s,a,o)=>{let{context:p}=this.component,g=this.relevantEvents,y=this.hitDragging.initialHit,v=this.eventRange.instance,E=null,T=null,D=!1,N={affectedEvents:g,mutatedEvents:ys(),isEvent:!0};s&&(s.componentId===y.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(y,s)||(E=aee(y,s,o.subjectEl.classList.contains("fc-event-resizer-start"),v.range))),E&&(T=Bx(g,p.getCurrentData().eventUiBases,E,p),N.mutatedEvents=T,tD(N,s.dateProfile,p)||(D=!0,E=null,T=null,N.mutatedEvents=null)),T?p.dispatch({type:"SET_EVENT_RESIZE",state:N}):p.dispatch({type:"UNSET_EVENT_RESIZE"}),D?hx():fx(),a||(E&&Xg(y,s)&&(E=null),this.validMutation=E,this.mutatedRelevantEvents=T)},this.handleDragEnd=s=>{let{context:a}=this.component,o=this.eventRange.def,p=this.eventRange.instance,g=new lr(a,o,p),y=this.relevantEvents,v=this.mutatedRelevantEvents;if(a.emitter.trigger("eventResizeStop",{el:this.draggingSegEl,event:g,jsEvent:s.origEvent,view:a.viewApi}),this.validMutation){let E=new lr(a,v.defs[o.defId],p?v.instances[p.instanceId]:null);a.dispatch({type:"MERGE_EVENTS",eventStore:v});let T={oldEvent:g,event:E,relatedEvents:Sc(v,a,p),revert(){a.dispatch({type:"MERGE_EVENTS",eventStore:y})}};a.emitter.trigger("eventResize",Object.assign(Object.assign({},T),{el:this.draggingSegEl,startDelta:this.validMutation.startDelta||gn(0),endDelta:this.validMutation.endDelta||gn(0),jsEvent:s.origEvent,view:a.viewApi})),a.emitter.trigger("eventChange",T)}else a.emitter.trigger("_noEventResize");this.draggingSeg=null,this.relevantEvents=null,this.validMutation=null};let{component:n}=e,r=this.dragging=new pf(e.el);r.pointer.selector=".fc-event-resizer",r.touchScrollAllowed=!1,r.autoScroller.isEnabled=n.context.options.dragScroll;let i=this.hitDragging=new Zg(this.dragging,$x(e));i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}querySegEl(e){return gi(e.subjectEl,".fc-event")}}function aee(t,e,n,r){let i=t.context.dateEnv,s=t.dateSpan.range.start,a=e.dateSpan.range.start,o=Zd(s,a,i,t.largeUnit);if(n){if(i.add(r.start,o)<r.end)return{startDelta:o}}else if(i.add(r.end,o)>r.start)return{endDelta:o};return null}class lee{constructor(e){this.context=e,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=r=>{r.jsEvent&&(this.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=r=>{let i=this.context.options.unselectCancel,s=YA(r.origEvent);this.matchesCancel=!!gi(s,i),this.matchesEvent=!!gi(s,mf.SELECTOR)},this.onDocumentPointerUp=r=>{let{context:i}=this,{documentPointer:s}=this,a=i.getCurrentData();if(!s.wasTouchScroll){if(a.dateSelection&&!this.isRecentPointerDateSelect){let o=i.options.unselectAuto;o&&(!o||!this.matchesCancel)&&i.calendarApi.unselect(r)}a.eventSelection&&!this.matchesEvent&&i.dispatch({type:"UNSELECT_EVENT"})}this.isRecentPointerDateSelect=!1};let n=this.documentPointer=new GD(document);n.shouldIgnoreMove=!0,n.shouldWatchScroll=!1,n.emitter.on("pointerdown",this.onDocumentPointerDown),n.emitter.on("pointerup",this.onDocumentPointerUp),e.emitter.on("select",this.onSelect)}destroy(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()}}const cee={fixedMirrorParent:De},dee={dateClick:De,eventDragStart:De,eventDragStop:De,eventDrop:De,eventResizeStart:De,eventResizeStop:De,eventResize:De,drop:De,eventReceive:De,eventLeave:De};Qx.dataAttrPrefix="";var uee=Ro({name:"@fullcalendar/interaction",componentInteractions:[eee,tee,mf,oee],calendarInteractions:[lee],elementDraggingImpl:pf,optionRefiners:cee,listenerRefiners:dee});const hee={},fee={class:"bg-gray-100"},pee={class:"p-[0px] border-b"};function mee(t,e){const n=h.resolveComponent("VsCalendar");return h.openBlock(),h.createElementBlock("div",fee,[h.createElementVNode("div",pee,[h.createVNode(n,{class:"scale-[0.9]"})])])}const gee=Ve(hee,[["render",mee]]);var yee={code:"uk",week:{dow:1,doy:7},buttonText:{prev:"Попередній",next:"далі",today:"Сьогодні",year:"рік",month:"Місяць",week:"Тиждень",day:"День",list:"Порядок денний"},weekText:"Тиж",allDayText:"Увесь день",moreLinkText(t){return"+ще "+t+"..."},noEventsText:"Немає подій для відображення"};const bee={},_ee={class:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function xee(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",_ee,e[0]||(e[0]=[h.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),h.createElementVNode("path",{d:"M15 3v18"},null,-1),h.createElementVNode("path",{d:"m8 9 3 3-3 3"},null,-1)]))}const QD=Ve(bee,[["render",xee]]),vee={components:{FullCalendar:mJ,VsWidgetCalendarBar:gee,IconOpenCard:QD},data(){return{isVisible:!0,isVisibleBar:!0,calendarOptions:{plugins:[WJ,MQ,HQ,uee],initialView:"dayGridMonth",dateClick:this.handleDateClick,locale:yee,events:[{title:"event 1",date:"2025-01-23"},{title:"event 2",date:"2019-04-02"}]},currentView:"dayGridMonth",views:[{id:"timeGridDay",title:"День"},{id:"timeGridWeek",title:"Тиждень"},{id:"dayGridMonth",title:"Місяць"},{id:"listYear",title:"Рік"}]}},methods:{handleDateClick(t){alert("date click! "+t.dateStr)},changeView(t){this.isVisible=!1,this.currentView=t,this.calendarOptions={...this.calendarOptions,initialView:t},queueMicrotask(()=>this.isVisible=!0)}}},wee={class:"flex p-[10px] bg-gray-100"},kee={class:"flex-grow bg-white"},Eee={class:"p-[10px] flex justify-between"},See={class:"inline-flex justify-center space-x-1 bg-white border border-gray-200 rounded-md shadow-sm p- gap-x-1 dark:bg-neutral-800 dark:border-neutral-700"},Cee={class:"relative flex first:before:hidden before:absolute before:top-1/2 before:-start-1 before:w-px before:h-3 before:bg-gray-200 before:-translate-y-1/2 dark:before:bg-neutral-700"},Tee=["onClick"];function Aee(t,e,n,r,i,s){const a=h.resolveComponent("VsWidgetCalendarBar"),o=h.resolveComponent("IconOpenCard"),p=h.resolveComponent("FullCalendar");return h.openBlock(),h.createElementBlock("div",wee,[h.createVNode(h.Transition,{name:"slide-fade"},{default:h.withCtx(()=>[h.withDirectives(h.createVNode(a,null,null,512),[[h.vShow,i.isVisibleBar]])]),_:1}),h.createElementVNode("div",kee,[h.createElementVNode("div",Eee,[h.createElementVNode("button",{onClick:e[0]||(e[0]=g=>i.isVisibleBar=!i.isVisibleBar)},[h.createVNode(o)]),h.createElementVNode("div",See,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.views,g=>(h.openBlock(),h.createElementBlock("div",Cee,[h.createElementVNode("button",{class:h.normalizeClass(["inline-flex items-center px-2 py-1 text-xs text-gray-800 rounded gap-x-1 hover:text-gray-500 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:text-gray-500 dark:border-neutral-700 dark:text-neutral-300 dark:hover:text-neutral-400 dark:focus:text-neutral-400",[i.currentView===(g==null?void 0:g.id)?" bg-gray-100":""]]),onClick:y=>s.changeView(g==null?void 0:g.id)},h.toDisplayString(g==null?void 0:g.title),11,Tee)]))),256))]),e[1]||(e[1]=h.createElementVNode("div",null,null,-1))]),i.isVisible?(h.openBlock(),h.createBlock(p,{key:0,options:i.calendarOptions,style:{height:"calc(100vh - 90px)"},class:"px-[10px] py-[4px]"},null,8,["options"])):h.createCommentVNode("",!0)])])}const eI=Ve(vee,[["render",Aee]]),Mee={"vs-widget-map":lb,"vs-widget-gallery":q3,"vs-widget-comments":JT,"vs-widget-file":h2,"vs-widget-history":OW,"vs-widget-table":Mq,"vs-widget-calendar":eI,"admin-notifications":sA,"vs-widget-print":jW},Dee={"table-format-text":Lp,"table-format-select":ck,"table-format-badge":ak,"table-format-swetch":sd,"table-format-check":sd,"table-format-switch":sd,"table-format-yes/no":sd,"table-format-html":Lp,"table-format-tags":dk,"table-format-date":ab,"table-format-number":lE,"table-format-slot":cE},Iee={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},Pee={__name:"vs-dashboard",setup(t){return(e,n)=>(h.openBlock(),h.createElementBlock("div",Iee,n[0]||(n[0]=[h.createElementVNode("div",{class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[h.createElementVNode("div",{class:"mb-4 xl:mb-8"},[h.createElementVNode("h1",{class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"}," Members "),h.createElementVNode("p",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Manage members and users of your workspace and set their access level. ")]),h.createElementVNode("div",{class:"space-y-5"},[h.createElementVNode("div",{class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5"},[h.createElementVNode("div",{class:"relative w-full"},[h.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5"},[h.createElementVNode("svg",{class:"shrink-0 size-4 text-gray-500 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[h.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),h.createElementVNode("path",{d:"m21 21-4.3-4.3"})])]),h.createElementVNode("input",{type:"text",class:"py-2 ps-10 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Search by name or email"}),h.createElementVNode("div",{class:"hidden absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-1"},[h.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-6 rounded-full text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 dark:text-neutral-500 dark:hover:text-blue-500 dark:focus:text-blue-500","aria-label":"Close"},[h.createElementVNode("span",{class:"sr-only"},"Close"),h.createElementVNode("svg",{class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[h.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),h.createElementVNode("path",{d:"m15 9-6 6"}),h.createElementVNode("path",{d:"m9 9 6 6"})])])])]),h.createElementVNode("div",{class:"flex justify-end items-center gap-x-2"},[h.createElementVNode("button",{type:"button",class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createElementVNode("svg",{class:"shrink-0 sm:me-2 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[h.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),h.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),h.createElementVNode("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]),h.createElementVNode("span",{class:"hidden sm:block"}," Download CSV ")]),h.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-1 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500","data-hs-overlay":"#hs-pro-dshm"},[h.createElementVNode("span",{class:"hidden sm:block"},"Send"),h.createTextVNode("Invite ")])])]),h.createElementVNode("div",{class:"grid sm:grid-cols-2 lg:grid-cols-4 gap-2 xl:gap-4"},[h.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[h.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[h.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}),h.createElementVNode("div",{class:"flex items-center -space-x-2"},[h.createElementVNode("img",{class:"shrink-0 size-7 rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"})])]),h.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Admin")]),h.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[h.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[h.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 5 "),h.createElementVNode("div",{class:"flex items-center -space-x-2"},[h.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),h.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482634023-2c4fda99ac0c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O ")])]),h.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[h.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Members"),h.createElementVNode("div",{class:"hs-tooltip inline-block"},[h.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[h.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),h.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),h.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(689px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),h.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[h.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[h.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 2 "),h.createElementVNode("div",{class:"flex items-center -space-x-2"},[h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," 0 ")])]),h.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[h.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"}," Limited access members "),h.createElementVNode("div",{class:"hs-tooltip inline-block"},[h.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[h.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),h.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),h.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(1198px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),h.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[h.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[h.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 0 "),h.createElementVNode("div",{class:"flex items-center -space-x-2"})]),h.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Pending invites")])]),h.createElementVNode("div",{class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[h.createElementVNode("div",{class:"min-w-full inline-block align-middle"},[h.createElementVNode("table",{class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},[h.createElementVNode("thead",null,[h.createElementVNode("tr",null,[h.createElementVNode("th",{scope:"col",class:"min-w-[250px]"},[h.createElementVNode("div",{class:"pe-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Member ")]),h.createElementVNode("th",{scope:"col",class:"min-w-48"},[h.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Role ")]),h.createElementVNode("th",{scope:"col"},[h.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Email ")]),h.createElementVNode("th",{scope:"col",class:"min-w-36"},[h.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Last activity ")]),h.createElementVNode("th",{scope:"col"},[h.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Status ")])])]),h.createElementVNode("tbody",{class:"divide-y divide-gray-200 dark:divide-neutral-700"},[h.createElementVNode("tr",null,[h.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[h.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[h.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("div",{class:"grow"},[h.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Admin ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," james@site.com ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[h.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),h.createTextVNode(" Active ")])])]),h.createElementVNode("tr",null,[h.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[h.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),h.createElementVNode("div",{class:"grow"},[h.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," liza@site.com ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 2 days ago ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[h.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),h.createTextVNode(" Inactive ")])])]),h.createElementVNode("tr",null,[h.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[h.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[h.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1601935111741-ae98b2b230b0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("div",{class:"grow"},[h.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Daniel Hobbs ")])])]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," dhobbs@site.com ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[h.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),h.createTextVNode(" Inactive ")])])]),h.createElementVNode("tr",null,[h.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[h.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[h.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("div",{class:"grow"},[h.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Brian Warner ")])])]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," brian@site.com ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 1 months ago ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[h.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),h.createTextVNode(" Active ")])])]),h.createElementVNode("tr",null,[h.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[h.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O "),h.createElementVNode("div",{class:"grow"},[h.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Ols Shols ")])])]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," olsshols@site.com ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 6 days ago ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[h.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),h.createTextVNode(" Inactive ")])])])])])])])])],-1)])))}},Ree={methods:{notify(){this.$notify({type:"error",title:"Тестова нотифікація",text:"Нотифікація для показу функціонала"})}}};function Oee(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",{onClick:e[0]||(e[0]=(...a)=>s.notify&&s.notify(...a)),class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50"}," Custom component ")}const Nee=Ve(Ree,[["render",Oee]]),Bee={props:{item:{type:Object},actions:{type:Array}},data(){return{toggletMap:{}}},methods:{toggleHandler(t){this.toggletMap[t]=!this.toggletMap[t],this.$emit("on:toggled",{optionID:t,toggled:this.toggletMap[t]})}}},zee={class:"md:col-span-2"},Lee={class:"font-semibold text-gray-800 dark:text-neutral-200"},Vee={class:"md:block md:col-span-1 md:text-center"},Fee=["onClick"];function $ee(t,e,n,r,i,s){var a,o;return h.openBlock(),h.createElementBlock("ul",{class:h.normalizeClass(["grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700",`grid-cols-${((a=n.actions)==null?void 0:a.length)+2}`])},[h.createElementVNode("li",zee,[h.createElementVNode("h3",Lee,h.toDisplayString(n.item.ua),1)]),(o=n.item.menu)!=null&&o.length?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(n.actions,p=>(h.openBlock(),h.createElementBlock("li",Vee,[h.createElementVNode("button",{onClick:g=>s.toggleHandler(p),type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline focus:outline-none focus:underline dark:text-blue-400 dark:hover:text-blue-500"}," Toggle all ",8,Fee)]))),256)):h.createCommentVNode("",!0)],2)}const jee=Ve(Bee,[["render",$ee]]),Hee={props:{subitem:{type:Object,required:!0},toggled:{type:Boolean,default:!1},optionID:{type:Number},actions:{type:Array,default:()=>[]},routes:{type:Array,required:!0}},data(){return{checkedActions:[]}},watch:{routes:{handler(){this.initializeCheckedActions()},deep:!0,immediate:!0}},methods:{initializeCheckedActions(){const t=this.routes.find(e=>e.path===this.subitem.path);this.checkedActions=t?[...t.actions]:[]},inputHandler(t){var e;this.$emit("on:checked",{subitemPath:(e=this.subitem)==null?void 0:e.path,checkedActions:this.checkedActions})}},mounted(){this.initializeCheckedActions()}},Uee={class:"md:col-span-2"},Wee={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},qee={class:"text-sm text-gray-500 dark:text-neutral-500"},Gee={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Yee=["value","onChange"];function Zee(t,e,n,r,i,s){var a,o;return h.openBlock(),h.createElementBlock("ul",{class:h.normalizeClass(["grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3",`grid-cols-${n.actions.length+2}`])},[h.createElementVNode("li",Uee,[h.createElementVNode("p",Wee,h.toDisplayString(((a=n.subitem)==null?void 0:a.ua)||""),1),h.createElementVNode("p",qee,h.toDisplayString(((o=n.subitem)==null?void 0:o.path)||""),1)]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.actions,(p,g)=>(h.openBlock(),h.createElementBlock("li",{class:"col-span-1",key:p},[h.createElementVNode("div",Gee,[h.withDirectives(h.createElementVNode("input",{type:"checkbox",value:p,onChange:y=>s.inputHandler(p),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500 dark:bg-neutral-800 dark:border-neutral-600 dark:checked:bg-blue-500 dark:checked:border-blue-500","onUpdate:modelValue":e[0]||(e[0]=y=>i.checkedActions=y)},null,40,Yee),[[h.vModelCheckbox,i.checkedActions]])])]))),128))],2)}const Xee=Ve(Hee,[["render",Zee]]),bs=h.ref(null),pv=t=>{const e=[];return t.forEach(n=>{n.menu?e.push(...pv(n.menu)):e.push(n)}),e},Kee={props:{options:{type:String},token:{type:String},routes:{type:Array,default:[]}},components:{VsGrouptFirstLevel:jee,VsGroupSecondLevel:Xee,AdminNodata:tx},data(){return{list:bs.value,history:this.routes,toggledInputs:!1,searchValue:""}},computed:{getList(){var e,n;const t={ua:"Без категорії",menu:(e=this.list)==null?void 0:e.filter(r=>!(r!=null&&r.menu))};return this.filterMenu([t,...(n=this.list)==null?void 0:n.filter(r=>r==null?void 0:r.menu)],this.searchValue).filter(r=>{var i;return(i=r==null?void 0:r.menu)==null?void 0:i.length})}},methods:{async Save(){var t,e;try{const n=location.href.split("/").pop();await tt.post(`/api/access-group/${n}`,{routes:(t=this.history)==null?void 0:t.filter(r=>{var i;return(i=r==null?void 0:r.actions)==null?void 0:i.length}).map(({path:r,actions:i})=>({path:r,actions:[...new Set(i)]}))}),await this.$notify({type:"success",title:"Успішно!",message:"Данні успішно оновлені"}),await Rp()}catch(n){console.error(((e=n.response)==null?void 0:e.data)||n.message),this.$notify({type:"error",title:"Помилка!",message:"При спробі оновити данні виникла помилка"})}},resetAll(){debugger;this.history=this.history.map(t=>({...t,actions:[]}))},async getData(){var t,e;try{const n=location.href.split("/").pop(),i=(await tt.get(`/api/access-group/${n}`)).data;this.history=this.getUniqueByPath([...i.routes,...(t=pv(this.list))==null?void 0:t.map(s=>({path:s==null?void 0:s.path,actions:[]}))])}catch(n){console.error(((e=n.response)==null?void 0:e.data)||n.message)}},toggleCheck(t){var n,r;if(!((n=this.history)!=null&&n.length))return;const e=(r=this.history)==null?void 0:r.findIndex(i=>(i==null?void 0:i.path)===(t==null?void 0:t.subitemPath));this.history[e].actions=t==null?void 0:t.checkedActions},toggleAll(t,e){var r,i,s,a,o,p,g;const n=(s=(i=(r=this.getList)==null?void 0:r[e])==null?void 0:i.menu)==null?void 0:s.map(y=>y==null?void 0:y.path);t!=null&&t.toggled?(o=(a=this.history)==null?void 0:a.filter(y=>n==null?void 0:n.includes(y==null?void 0:y.path)))==null||o.forEach(y=>{var v;(v=y==null?void 0:y.actions)==null||v.push(t==null?void 0:t.optionID)}):(g=(p=this.history)==null?void 0:p.filter(y=>n==null?void 0:n.includes(y==null?void 0:y.path)))==null||g.forEach(y=>{var v;y.actions=(v=y==null?void 0:y.actions)==null?void 0:v.filter(E=>E!==(t==null?void 0:t.optionID))})},getUniqueByPath(t){return t.reduce((e,n)=>(e.some(i=>i.path===n.path)||e.push(n),e),[])},filterMenu(t,e){return t.map(n=>{var r,i;if(n.menu){const s=this.filterMenu(n.menu,e);if(s.length>0)return{...n,menu:s}}return(i=(r=n.ua)==null?void 0:r.toLowerCase())!=null&&i.includes(e==null?void 0:e.toLowerCase())?n:null}).filter(Boolean)}},async mounted(){await this.getData()}},Jee={class:"flex gap-[6px]"},Qee={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},ete={key:0,class:"space-y-8"},tte={class:"space-y-5"};function nte(t,e,n,r,i,s){var y;const a=h.resolveComponent("VsText"),o=h.resolveComponent("VsGrouptFirstLevel"),p=h.resolveComponent("VsGroupSecondLevel"),g=h.resolveComponent("AdminNodata");return h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("div",Jee,[h.createVNode(a,{placeholder:"Пошук",class:"flex-grow",modelValue:i.searchValue,"onUpdate:modelValue":e[0]||(e[0]=v=>i.searchValue=v)},null,8,["modelValue"]),h.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100",onClick:e[1]||(e[1]=(...v)=>s.resetAll&&s.resetAll(...v))}," Скинути всі "),h.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:e[2]||(e[2]=(...v)=>s.Save&&s.Save(...v))}," Зберегти ")]),h.createElementVNode("div",{class:h.normalizeClass(["grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5",`grid-cols-${n.options.length+2}`])},[e[3]||(e[3]=h.createElementVNode("div",{class:"self-center col-span-2"},[h.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.options,(v,E)=>(h.openBlock(),h.createElementBlock("div",{class:"col-span-1 text-center",key:E},[h.createElementVNode("h3",Qee,h.toDisplayString(v),1)]))),128))],2),(y=s.getList)!=null&&y.length?(h.openBlock(),h.createElementBlock("div",ete,[h.createElementVNode("div",tte,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.getList,(v,E)=>(h.openBlock(),h.createElementBlock("div",{key:E},[h.createVNode(o,{item:v,"onOn:toggled":T=>s.toggleAll(T,E),actions:n.options},null,8,["item","onOn:toggled","actions"]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(v.menu,T=>(h.openBlock(),h.createBlock(p,{toggled:(v==null?void 0:v.toggled)||!1,optionID:v==null?void 0:v.optionID,key:T==null?void 0:T.path,subitem:T,actions:n.options,"onOn:checked":D=>s.toggleCheck(D,E),routes:i.history},null,8,["toggled","optionID","subitem","actions","onOn:checked","routes"]))),128))]))),128))])])):(h.openBlock(),h.createBlock(g,{key:1}))])}const rte=Ve(Kee,[["render",nte]]),ite={__name:"vs-group-interface-page",setup(t){const e=["view","add","edit","del"];return(n,r)=>(h.openBlock(),h.createBlock(h.unref(rte),{options:e,routes:n.routes},null,8,["routes"]))}},ste={},ote={class:"shrink-0 size-4 text-gray-400 dark:text-white/60",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function ate(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",ote,e[0]||(e[0]=[h.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),h.createElementVNode("path",{d:"m21 21-4.3-4.3"},null,-1)]))}const mv=Ve(ste,[["render",ate]]),lte={components:{IconSearch:mv,IconPlus:Qh},data(){return{link:null,color:void 0,data:null,searchValue:"",isFormAdd:!1,formValues:{},scheme:{name:{type:"text",ua:"Назва",placeholder:"Назва",validators:["required"]}}}},mounted(){this.link="/admin.user-cls",this.getData()},computed:{rows(){var t,e;return((e=(t=this.data)==null?void 0:t.rows)==null?void 0:e.filter(n=>{var r;return(r=n==null?void 0:n.name)==null?void 0:r.includes(this.searchValue)}))||null}},methods:{async getData(){try{const{data:t}=await tt.get("/api/user-cls?type=json");this.data=t}catch{}},async createNewCls(){var t;try{await((t=this.$refs.form)==null?void 0:t.doValidation()),await tt.post("/api/user-cls",{...this.formValues}),this.isFormAdd=!1,this.formValues={},await this.getData(),this.$notify({type:"success",title:"Успішно!",message:"Новий об'єкт успішно створений"})}catch{this.$notify({type:"error",title:"Помилка",message:"При спробі створити новий об'єкт виникла помилка"})}}}},cte={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},dte={class:"relative px-[20px] py-[16px] flex gap-[8px] items-center"},ute={class:"flex flex-col w-[300px] gap-[4px] overflow-y-auto overflow-x-hidden p-[10px] [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{height:"calc(100vh - 130px)"}},hte=["data-index"],fte={class:"w-[calc(100%-30px)] overflow-hidden overflow-ellipsis"},pte={class:"ml-auto flex items-center gap-[12px]"},mte={class:"text-[10px] text-[#6B7280] border px-1 rounded-lg"},gte={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function yte(t,e,n,r,i,s){const a=h.resolveComponent("IconSearch"),o=h.resolveComponent("VsText"),p=h.resolveComponent("IconPlus"),g=h.resolveComponent("router-link"),y=h.resolveComponent("VsForm"),v=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",cte,[h.createElementVNode("div",dte,[h.createVNode(a,{height:"16",width:"16",class:"absolute top-[50%] translate-y-[-50%] left-[30px] text-gray-500 z-[1]"}),h.createVNode(o,{type:"text",modelValue:i.searchValue,"onUpdate:modelValue":e[0]||(e[0]=E=>i.searchValue=E),clearable:!0,placeholder:"Пошук по меню",class:"flex-grow shadow [&>input]:h-[38px] [&>input]:pl-[30px] [&>input]:placeholder-gray-400"},null,8,["modelValue"]),h.createElementVNode("button",{onClick:e[1]||(e[1]=E=>i.isFormAdd=!0),class:"bg-[#DBEAFE] h-[38px] w-[38px] text-blue-700 shrink-0 flex items-center justify-center rounded-lg hover:bg-blue-200"},[h.createVNode(p,{height:"16",width:"16"})])]),h.createElementVNode("ul",ute,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.rows,E=>{var T,D;return h.openBlock(),h.createElementBlock("li",{key:E==null?void 0:E.id,"data-index":t.index,class:"w-full"},[h.createVNode(g,{class:h.normalizeClass(["flex items-center cursor-pointer hover:bg-[#F3F4F6] px-[12px] py-1 rounded-lg text-sm",{"bg-gray-100":((D=(T=t.$route)==null?void 0:T.query)==null?void 0:D.name)===(E==null?void 0:E.name)}]),to:i.link+"?name="+((E==null?void 0:E.name)||(E==null?void 0:E.id))},{default:h.withCtx(()=>[h.createElementVNode("span",fte,h.toDisplayString((E==null?void 0:E.name)||(E==null?void 0:E.id)||"Не вказано"),1),h.createElementVNode("div",pte,[h.createElementVNode("div",mte,h.toDisplayString((E==null?void 0:E.children)||"0"),1)])]),_:2},1032,["to","class"])],8,hte)}),128))])]),h.createVNode(v,{visible:i.isFormAdd,"onUpdate:visible":e[5]||(e[5]=E=>i.isFormAdd=E),title:"Створити давідник",onOnClose:e[6]||(e[6]=E=>i.formValues={})},{footer:h.withCtx(()=>[h.createElementVNode("div",gte,[h.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[3]||(e[3]=E=>{i.isFormAdd=!1,i.formValues={}}),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),h.createElementVNode("button",{onClick:e[4]||(e[4]=(...E)=>s.createNewCls&&s.createNewCls(...E)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700"}," Зберегти ")])]),default:h.withCtx(()=>[h.createVNode(y,{scheme:i.scheme,ref:"form",modelValue:i.formValues,"onUpdate:modelValue":e[2]||(e[2]=E=>i.formValues=E),class:"p-[10px]"},null,8,["scheme","modelValue"])]),_:1},8,["visible"])],64)}const bte=Ve(lte,[["render",yte]]),_te={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},xte={class:"w-full"},vte={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},wte={class:"max-w-sm mx-auto mt-6"},kte={class:"font-medium text-gray-800 dark:text-neutral-200"},Ete={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function Ste(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",xte,[h.createElementVNode("div",vte,[e[0]||(e[0]=h.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),h.createElementVNode("div",wte,[h.createElementVNode("p",kte,h.toDisplayString(n.title),1),h.createElementVNode("p",Ete,h.toDisplayString(n.text),1)])])])}const tI=Ve(_te,[["render",Ste]]),Cte={props:{modelValue:{type:String,default:()=>"#172B4D"},colors:{type:Array,default:()=>["#172B4D","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{updateColor(t){this.$emit("update:modelValue",t),this.$refs.popover.togglePopover()}}},Tte={class:"flex w-[160px] flex-wrap gap-[4px]"},Ate=["onClick"];function Mte(t,e,n,r,i,s){const a=h.resolveComponent("VsPopover");return h.openBlock(),h.createBlock(a,{ref:"popover",placement:"bottom"},{reference:h.withCtx(()=>[h.createElementVNode("button",{class:"h-[37px] w-[37px] rounded-lg flex items-center justify-center",style:h.normalizeStyle({backgroundColor:n.modelValue})},null,4)]),default:h.withCtx(()=>[h.createElementVNode("div",null,[h.createElementVNode("ul",Tte,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.colors,o=>(h.openBlock(),h.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:h.normalizeStyle({backgroundColor:o}),onClick:p=>s.updateColor(o),key:o},null,12,Ate))),128))])])]),_:1},512)}const nI=Ve(Cte,[["render",Mte]]),Dte={components:{VsChoceColor:nI},props:{item:Object},data(){var t,e,n;return{color:((t=this.item)==null?void 0:t.color)||"#D1D5DB",text:((e=this.item)==null?void 0:e.text)||"",id:(n=this.item)==null?void 0:n.id}},watch:{color(t){this.$emit("update-item",{...this.item,color:t})},text(t){this.$emit("update-item",{...this.item,text:t})},id(t){this.$emit("update-item",{...this.item},t)}}},Ite={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},Pte={class:"flex flex-col"},Rte={class:"flex gap-[30px]"},Ote={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},Nte={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},Bte={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function zte(t,e,n,r,i,s){var p;const a=h.resolveComponent("VsChoceColor"),o=h.resolveComponent("VsInlineEdit");return h.openBlock(),h.createElementBlock("div",Ite,[h.createVNode(a,{modelValue:i.color,"onUpdate:modelValue":e[0]||(e[0]=g=>i.color=g)},null,8,["modelValue"]),h.createElementVNode("div",Pte,[h.createElementVNode("div",Rte,[h.createVNode(o,{modelValue:i.text,"onUpdate:modelValue":e[1]||(e[1]=g=>i.text=g),onUpdateValue:e[2]||(e[2]=g=>i.text=g)},{default:h.withCtx(()=>[h.createElementVNode("p",Ote,h.toDisplayString(i.text),1)]),_:1},8,["modelValue"]),h.createVNode(o,{modelValue:i.id,"onUpdate:modelValue":e[3]||(e[3]=g=>i.id=g),onUpdateValue:e[4]||(e[4]=g=>i.id=g)},{default:h.withCtx(()=>[h.createElementVNode("p",Nte,h.toDisplayString(i.id),1)]),_:1},8,["modelValue"])]),h.createElementVNode("p",Bte,h.toDisplayString((p=n.item)==null?void 0:p.parent),1)])])}const Lte={components:{VsReesterUsersItem:Ve(Dte,[["render",zte]])},props:{list:Array},data(){return{draggedItemIndex:null}},methods:{dragStart(t,e){this.draggedItemIndex=e,t.dataTransfer.effectAllowed="move"},dragOver(t){t.preventDefault()},drop(t,e){t.preventDefault();const n=this.draggedItemIndex;if(n!==e){const r=[...this.list],i=r[n];r.splice(n,1),r.splice(e,0,i),this.$emit("update-list",r)}this.draggedItemIndex=null},dragEnd(){this.draggedItemIndex=null},updateItem(t,e){var r;const n=(r=this.list)==null?void 0:r.findIndex(i=>(i==null?void 0:i.id)===(t==null?void 0:t.id));this.list[n]=t,e&&(this.list[n].id=e),this.$emit("update-list",this.list)}}},Vte={class:"flex flex w-full flex-col gap-[10px] p-[10px] pt-[40px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{width:"calc(100vw - 1000px)","max-height":"calc(100vh - 430px)"}},Fte=["onDragstart","onDrop"];function $te(t,e,n,r,i,s){const a=h.resolveComponent("VsReesterUsersItem");return h.openBlock(),h.createElementBlock("ul",Vte,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.list,(o,p)=>(h.openBlock(),h.createElementBlock("li",{key:o==null?void 0:o.id,draggable:!0,onDragstart:g=>s.dragStart(g,p),onDragover:e[0]||(e[0]=g=>s.dragOver(g)),onDrop:g=>s.drop(g,p),onDragend:e[1]||(e[1]=(...g)=>s.dragEnd&&s.dragEnd(...g))},[h.createVNode(a,{item:o,onUpdateItem:s.updateItem},null,8,["item","onUpdateItem"])],40,Fte))),128))])}const jte={components:{VsNoData:tI,VsChoceColor:nI,IconCheck:lk,VsReesterUsersList:Ve(Lte,[["render",$te],["__scopeId","data-v-87c0b333"]])},data(){return{scheme:{text:{type:"Text",ua:"Ім'я",validators:["required"]}},formVisible:!0,formValues:{},color:"#172B4D",data:null}},watch:{$route:{handler(t,e){var n,r;((n=t==null?void 0:t.query)==null?void 0:n.name)!==((r=e==null?void 0:e.query)==null?void 0:r.name)&&this.getData()}}},mounted(){this.getData()},methods:{async getData(){var t;this.data=null;try{const{data:e}=await tt.get(`/api/user-cls/${(t=this.$route.query)==null?void 0:t.name}`);this.data=e}catch{}},async addOneChild(){var t,e,n,r;try{const{form:i}=this.$refs;await i.doValidation(),await tt.post("/api/user-cls",{name:(t=this.$route.query)==null?void 0:t.name,children:[...((e=this.data)==null?void 0:e.children)||[],{...this.formValues,color:this.color,id:(((r=(n=this.data)==null?void 0:n.children)==null?void 0:r.length)||0)+1}]}),this.formVisible=!1,this.formValues={},setTimeout(()=>this.formVisible=!0),await this.getData()}catch(i){console.log(i)}},async updateChildren(t){var e,n;this.data.children=t;try{await tt.post("/api/user-cls",{name:(e=this.$route.query)==null?void 0:e.name,children:[...((n=this.data)==null?void 0:n.children)||[]]}),await this.getData()}catch(r){console.log(r)}}}},Hte={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},Ute={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},Wte={class:"flex items-end w-full gap-[4px]"};function qte(t,e,n,r,i,s){var v,E,T,D,N;const a=h.resolveComponent("VsForm"),o=h.resolveComponent("VsChoceColor"),p=h.resolveComponent("IconCheck"),g=h.resolveComponent("VsReesterUsersList"),y=h.resolveComponent("VsNoData");return h.openBlock(),h.createElementBlock("div",Hte,[(E=(v=t.$route)==null?void 0:v.query)!=null&&E.name?(h.openBlock(),h.createElementBlock("div",Ute,[e[3]||(e[3]=h.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),h.createElementVNode("div",Wte,[i.formVisible?(h.openBlock(),h.createBlock(a,{key:0,ref:"form",scheme:i.scheme,modelValue:i.formValues,"onUpdate:modelValue":e[0]||(e[0]=B=>i.formValues=B),class:"p-0 m-0 h-[65px] w-full"},null,8,["scheme","modelValue"])):h.createCommentVNode("",!0),h.createVNode(o,{modelValue:i.color,"onUpdate:modelValue":e[1]||(e[1]=B=>i.color=B)},null,8,["modelValue"]),h.createElementVNode("button",{onClick:e[2]||(e[2]=(...B)=>s.addOneChild&&s.addOneChild(...B)),class:"h-[37px] w-[37px] rounded-lg bg-blue-600 ml-[6px] flex items-center justify-center text-white hover:bg-blue-700 duration-300"},[h.createVNode(p,{height:"20",width:"20"})])]),(D=(T=i.data)==null?void 0:T.children)!=null&&D.length?(h.openBlock(),h.createBlock(g,{key:0,list:(N=i.data)==null?void 0:N.children,onUpdateList:s.updateChildren},null,8,["list","onUpdateList"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(y,{key:1,class:"mt-[100px]",text:"Оберіть один з пунктів меню для відображення"}))])}const Gte={components:{VsReesterNavList:bte,VsReesterContent:Ve(jte,[["render",qte]])}},Yte={class:"flex items-start gap-0"};function Zte(t,e,n,r,i,s){const a=h.resolveComponent("VsReesterNavList"),o=h.resolveComponent("VsReesterContent");return h.openBlock(),h.createElementBlock("div",Yte,[h.createVNode(a),h.createVNode(o)])}const Xte=Ve(Gte,[["render",Zte]]),Kte={class:"h-[76px] bg-white border rounded-xl flex items-center justify-start px-[20px] mb-[16px]"},Jte={class:"mr-[10px]"},Qte={class:"text-[20px] font-semibold"},ene={key:0,class:"text-[14px] font-medium text-[#676A6C]"},tne={class:""},nne={__name:"admin-card-header",props:{title:{type:String},tableName:{type:String},getRoute:{type:String,required:!0},slots:{type:Object},isHeaderEditButton:{type:Boolean,default:()=>!0}},setup(t){var v,E,T,D,N;const{asyncTemplateSlot:e}=(N=(D=(T=(E=(v=h.getCurrentInstance())==null?void 0:v.appContext)==null?void 0:E.app)==null?void 0:T.config)==null?void 0:D.globalProperties)==null?void 0:N.utils,n=t,r=qN(),i=GN(),s=h.ref(""),a=h.ref(""),o=()=>{r.back()},p=h.computed(()=>{var B;return`/edit?table=${n.getRoute}&id=${(B=i==null?void 0:i.params)==null?void 0:B.id}`}),g=()=>{var B,F,X,te;if(!((B=n.slots)!=null&&B.panelLeft))return"div";if((F=n.slots)!=null&&F.panelLeft.includes("<")){const H=e("PanelLeft",(X=n.slots)==null?void 0:X.panelLeft,["name"]);a.value=H}else a.value=(te=n.slots)==null?void 0:te.panelLeft},y=()=>{var B,F,X,te;if(!((B=n.slots)!=null&&B.panelRight))return"div";if((F=n.slots)!=null&&F.panelRight.includes("<")){const H=e("PanelRight",(X=n.slots)==null?void 0:X.panelRight,["name"]);s.value=H}else s.value=(te=n.slots)==null?void 0:te.panelRight};return g(),y(),(B,F)=>{const X=h.resolveComponent("router-link");return h.openBlock(),h.createElementBlock("div",Kte,[h.createElementVNode("div",Jte,[h.createElementVNode("h2",Qte,h.toDisplayString(t.title),1),t.tableName?(h.openBlock(),h.createElementBlock("div",ene,h.toDisplayString(t.tableName),1)):h.createCommentVNode("",!0)]),(h.openBlock(),h.createBlock(h.resolveDynamicComponent(a.value))),h.createElementVNode("div",{class:h.normalizeClass([{"gap-[6px]":t.isHeaderEditButton},"flex items-center ml-auto"])},[h.createElementVNode("button",{onClick:o,class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},F[0]||(F[0]=[h.createElementVNode("svg",{class:"transition duration-200 ease-in-out group-hover:stroke-white",width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[h.createElementVNode("path",{d:"M7.00008 11.5833L2.91675 7.49999L7.00008 3.41666",stroke:"#1f2937","stroke-linecap":"round","stroke-linejoin":"round"}),h.createElementVNode("path",{d:"M11.0834 7.5H2.91675",stroke:"#2563EB","stroke-linecap":"round","stroke-linejoin":"round"})],-1),h.createElementVNode("span",{class:"hidden sm:block ml-[8px]"},"Повернутися до реєстру",-1)])),h.createElementVNode("div",tne,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(s.value)))]),t.isHeaderEditButton?(h.openBlock(),h.createBlock(X,{key:0,to:p.value,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:h.withCtx(()=>F[1]||(F[1]=[h.createTextVNode(" Редагувати ")])),_:1},8,["to"])):h.createCommentVNode("",!0)],2)])}}},rne={__name:"admin-card-async-component",props:{slot:String,data:Object,objectData:Object},setup(t){var s,a,o,p,g;const{asyncTemplateSlot:e}=(g=(p=(o=(a=(s=h.getCurrentInstance())==null?void 0:s.appContext)==null?void 0:a.app)==null?void 0:o.config)==null?void 0:p.globalProperties)==null?void 0:g.utils,n=h.ref(""),r=t;return(()=>{const y=e("CustomComponent",r.slot,["data"]);n.value=y})(),(y,v)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.value),{data:t.objectData},null,8,["data"]))}},ine={},sne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function one(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",sne,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const gv=Ve(ine,[["render",one]]),ane={props:["table","id"],components:{AdminCardHeader:nne,AdminCardAsyncComponent:rne,IconChevron:gv},data(){return{objectData:null,showTabs:!1,component:""}},computed:{getRoute(){const t=this.flattenMenu(bs.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(n=>{var r,i;return(n==null?void 0:n.table)==((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.table)});return e||this.$router.replace("/404"),e==null?void 0:e.path},getTable(){const t=this.flattenMenu(bs.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(n=>{var r,i;return(n==null?void 0:n.table)==((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.table)});return e||this.$router.replace("/404"),e==null?void 0:e.ua},getTitle(){var t,e,n,r,i,s,a,o,p,g,y,v;return((i=(e=(t=this.objectData)==null?void 0:t.rows)==null?void 0:e[0])==null?void 0:i[(r=(n=this.objectData)==null?void 0:n.meta)==null?void 0:r.title])||((y=(a=(s=this.objectData)==null?void 0:s.rows)==null?void 0:a[0])==null?void 0:y[(g=(p=(o=this.objectData)==null?void 0:o.columns)==null?void 0:p.find(E=>(E==null?void 0:E.meta)==="title"))==null?void 0:g.name])||((v=this.objectData)==null?void 0:v.title)||this.getTable}},async mounted(){await this.getObjectData(),await this.checkActiveComponent(),addEventListener("reloadCardPage",this.getObjectData)},unmounted(){removeEventListener("reloadCardPage",this.getObjectData)},watch:{component(t){var e;this.showTabs=!1,this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,tab:t}})},$route:{async handler(t,e){var n,r,i,s;(((n=t==null?void 0:t.params)==null?void 0:n.table)!==((r=e==null?void 0:e.params)==null?void 0:r.table)||((i=t==null?void 0:t.params)==null?void 0:i.id)!==((s=e==null?void 0:e.params)==null?void 0:s.id))&&await this.getObjectData(),await this.checkActiveComponent()}}},methods:{async getObjectData(){var n,r;const t=this.table||((n=this.$route)==null?void 0:n.params.table),e=this.id||((r=this.$route)==null?void 0:r.params.id);(!t||!e)&&this.$router.replace("/404");try{const{data:i}=await tt.get(`/api/table-data/${t}/${e}`);this.objectData=i}catch(i){console.error(i)}},getColClass(t){return`lg:col-span-${t||12}`},getGridClass(){return"grid-cols-12"},checkActiveComponent(){var t,e,n,r,i,s,a,o,p;if((e=(t=this.$route)==null?void 0:t.query)!=null&&e.tab)this.component=(r=(n=this.$route)==null?void 0:n.query)==null?void 0:r.tab;else{const g=(s=(i=this.objectData)==null?void 0:i.panels)==null?void 0:s.find(y=>(y==null?void 0:y.type)==="tabs"||(y==null?void 0:y.type)==="vertical-tabs");(a=g==null?void 0:g.items)!=null&&a.length&&(this.component=((o=g.items[0])==null?void 0:o.component)||((p=g.items[0])==null?void 0:p.name))}},getProps(t){var n,r,i;const e={};for(const s in t)["name","component","title","token"].includes(s)||(e[s]=((i=(r=(n=this.objectData)==null?void 0:n.rows)==null?void 0:r[0])==null?void 0:i[t[s]])||t[s]);return e},flattenMenu(t){const e=[];return t==null||t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},lne={style:{height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},cne={key:0,class:"bg-white border rounded-xl"},dne={class:"p-[10px] pl-[20px] text-md font-[500]"},une=["innerHTML"],hne={key:1},fne={key:0,class:"p-[10px] pl-[20px] text-md font-[500]"},pne={key:2,class:"p-[20px] border-t"},mne=["innerHTML"],gne={class:"flex space-x-1 w-full bg-white border border-b-0 rounded-tr-xl rounded-tl-xl h-[60px] items-center pl-[20px]"},yne=["onClick"],bne={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},_ne={key:0,class:"p-[20px] border-t"},xne={key:1,class:"p-[20px] border-t"},vne=["innerHTML"],wne={key:3,class:"flex"},kne=["onClick"],Ene={class:"flex-grow w-[80%]"},Sne={key:0,class:"w-full h-full overflow-auto bg-white border rounded-xl [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Cne={key:0,class:"p-[20px]"},Tne={key:1,class:"p-[20px]"},Ane=["innerHTML"];function Mne(t,e,n,r,i,s){var g,y,v,E;const a=h.resolveComponent("AdminCardHeader"),o=h.resolveComponent("AdminCardAsyncComponent"),p=h.resolveComponent("IconChevron");return h.openBlock(),h.createElementBlock("div",lne,[i.objectData&&((g=i.objectData)==null?void 0:g.isHeader)!==!1?(h.openBlock(),h.createBlock(a,{key:0,title:s.getTitle,tableName:s.getTable,"get-route":s.getRoute,slots:(y=i.objectData)==null?void 0:y.slots,isHeaderEditButton:(v=i.objectData)==null?void 0:v.isHeaderEditButton},null,8,["title","tableName","get-route","slots","isHeaderEditButton"])):h.createCommentVNode("",!0),h.createElementVNode("div",{class:h.normalizeClass(["grid gap-[20px]",s.getGridClass()])},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((E=i.objectData)==null?void 0:E.panels,(T,D)=>{var N,B,F,X,te;return h.openBlock(),h.createElementBlock("div",{key:D,class:h.normalizeClass(["col-span-12",s.getColClass(T.col)])},[T!=null&&T.name?(h.openBlock(),h.createElementBlock("div",cne,[h.createElementVNode("h2",dne,h.toDisplayString((T==null?void 0:T.title)||"Панель"),1),(N=i.objectData)!=null&&N.html[T==null?void 0:T.name]?(h.openBlock(),h.createElementBlock("div",{key:0,class:"p-[20px] border-t",innerHTML:(B=i.objectData)==null?void 0:B.html[T==null?void 0:T.name]},null,8,une)):(h.openBlock(),h.createBlock(o,{key:1,slot:(F=i.objectData)==null?void 0:F.vue[T==null?void 0:T.name],data:(te=(X=i.objectData)==null?void 0:X.rows)==null?void 0:te[0],objectData:i.objectData},null,8,["slot","data","objectData"]))])):T.type==="container"?(h.openBlock(),h.createElementBlock("div",hne,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(T.items,(H,ke)=>{var ge,Se,Pe,Ne,at,Je,mt,nt,Ct,$t,jt,Ot,qt,wn;return h.openBlock(),h.createElementBlock("div",{key:ke,class:h.normalizeClass([{"mb-[20px]":T.items.length>1},"bg-white border rounded-xl"])},[H!=null&&H.title?(h.openBlock(),h.createElementBlock("h2",fne,h.toDisplayString((H==null?void 0:H.title)||"Панель"),1)):h.createCommentVNode("",!0),H!=null&&H.component?(h.openBlock(),h.createElementBlock("div",{key:1,class:h.normalizeClass(["p-[20px]",{"border-t":H==null?void 0:H.title}])},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(H.component),h.mergeProps({geometry:(Se=(ge=i.objectData)==null?void 0:ge.rows[0])==null?void 0:Se.geom,columns:H==null?void 0:H.columns,token:(Ne=(Pe=i.objectData)==null?void 0:Pe.tokens)==null?void 0:Ne[H==null?void 0:H.token],zoom:16,ref_for:!0},s.getProps(H),{data:i.objectData,id:(Je=(at=t.$route)==null?void 0:at.params)==null?void 0:Je.id}),null,16,["geometry","columns","token","data","id"]))],2)):h.createCommentVNode("",!0),H!=null&&H.name?(h.openBlock(),h.createElementBlock("div",pne,[(nt=(mt=i.objectData)==null?void 0:mt.html)!=null&&nt[H==null?void 0:H.name]?(h.openBlock(),h.createElementBlock("div",{key:0,innerHTML:($t=(Ct=i.objectData)==null?void 0:Ct.html)==null?void 0:$t[H==null?void 0:H.name]},null,8,mne)):(h.openBlock(),h.createBlock(o,{key:1,slot:(Ot=(jt=i.objectData)==null?void 0:jt.vue)==null?void 0:Ot[H==null?void 0:H.name],data:(wn=(qt=i.objectData)==null?void 0:qt.rows)==null?void 0:wn[0],objectData:i.objectData},null,8,["slot","data","objectData"]))])):h.createCommentVNode("",!0)],2)}),128))])):h.createCommentVNode("",!0),(T==null?void 0:T.type)==="tabs"?(h.openBlock(),h.createElementBlock(h.Fragment,{key:2},[h.createElementVNode("nav",gne,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(T==null?void 0:T.items,H=>(h.openBlock(),h.createElementBlock("button",{key:(H==null?void 0:H.name)||(H==null?void 0:H.component),onClick:ke=>i.component=(H==null?void 0:H.component)||(H==null?void 0:H.name),class:h.normalizeClass(["px-2.5 h-[30px] py-1.5 relative inline-flex items-center gap-x-2 text-gray-500 hover:bg-gray-100 focus:bg-gray-100 hover:text-gray-800 text-sm whitespace-nowrap rounded-lg focus:outline-none",{" font-semibold after:absolute after:bottom-[-14px] after:left-2.5 after:right-2.5 after:z-[1] after:h-0.5 after:bg-gray-800":i.component===(H==null?void 0:H.component)||i.component===(H==null?void 0:H.name),"":i.component!==(H==null?void 0:H.component)&&i.component!==(H==null?void 0:H.name)}])},h.toDisplayString(H==null?void 0:H.title),11,yne))),128))]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(T.items,(H,ke)=>{var ge,Se,Pe,Ne,at,Je,mt,nt,Ct,$t,jt,Ot;return h.openBlock(),h.createElementBlock(h.Fragment,{key:ke},[i.component===(H==null?void 0:H.component)||i.component===(H==null?void 0:H.name)?(h.openBlock(),h.createElementBlock("div",bne,[H!=null&&H.component?(h.openBlock(),h.createElementBlock("div",_ne,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(H.component),h.mergeProps({data:i.objectData,token:(Se=(ge=i.objectData)==null?void 0:ge.tokens)==null?void 0:Se[H==null?void 0:H.token],columns:H==null?void 0:H.columns,geometry:(Ne=(Pe=i.objectData)==null?void 0:Pe.rows[0])==null?void 0:Ne.geom,ref_for:!0},s.getProps(H),{zoom:16,id:(Je=(at=t.$route)==null?void 0:at.params)==null?void 0:Je.id}),null,16,["data","token","columns","geometry","id"]))])):h.createCommentVNode("",!0),H!=null&&H.name?(h.openBlock(),h.createElementBlock("div",xne,[(nt=(mt=i.objectData)==null?void 0:mt.html)!=null&&nt[H==null?void 0:H.name]?(h.openBlock(),h.createElementBlock("div",{key:0,innerHTML:(Ct=i.objectData)==null?void 0:Ct.html[H==null?void 0:H.name]},null,8,vne)):(h.openBlock(),h.createBlock(o,{key:1,slot:($t=i.objectData)==null?void 0:$t.vue[H==null?void 0:H.name],data:(Ot=(jt=i.objectData)==null?void 0:jt.rows)==null?void 0:Ot[0],objectData:i.objectData},null,8,["slot","data","objectData"]))])):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0)],64)}),128))],64)):h.createCommentVNode("",!0),(T==null?void 0:T.type)==="vertical-tabs"?(h.openBlock(),h.createElementBlock("div",wne,[h.createElementVNode("div",{class:h.normalizeClass(["p-[5px] bg-white absolute left-0 rounded-lg border rounded-tl-[0] rounded-bl-[0]",[{"left-[260px]":i.showTabs}]]),onClick:e[0]||(e[0]=H=>i.showTabs=!i.showTabs)},[h.createVNode(p,{height:"16",width:"16",class:"-rotate-90"})],2),h.createElementVNode("nav",{class:h.normalizeClass(["lg:relative lg:left-0 flex flex-col space-y-2 max-w-[260px] w-full border rounded-xl mr-4 items-start pl-[10px] z-[2] lg:z-0 bg-white py-[20px] absolute left-[-100%]",[{"left-0 rounded-tr-[0]":i.showTabs}]])},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(T==null?void 0:T.items,H=>(h.openBlock(),h.createElementBlock("button",{key:(H==null?void 0:H.name)||(H==null?void 0:H.component),onClick:ke=>i.component=(H==null?void 0:H.component)||(H==null?void 0:H.name),class:h.normalizeClass(["relative inline-flex items-center w-full py-1 text-sm text-left whitespace-pre-wrap border-transparent pe-4 gap-x-2 border-e-2 hover:text-blue-600 focus:outline-none focus:text-blue-600",{"font-semibold after:absolute after:top-[0] after:right-[-1px] after:h-full text-blue-600 after:w-[2px] after:bg-blue-600 ":i.component===(H==null?void 0:H.component)||i.component===(H==null?void 0:H.name),"text-gray-500":i.component!==(H==null?void 0:H.component)&&i.component!==(H==null?void 0:H.name)}])},h.toDisplayString(H==null?void 0:H.title),11,kne))),128))],2),h.createElementVNode("div",Ene,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(T.items,(H,ke)=>{var ge,Se,Pe,Ne,at,Je,mt,nt,Ct,$t,jt,Ot;return h.openBlock(),h.createElementBlock(h.Fragment,{key:ke},[i.component===(H==null?void 0:H.component)||i.component===(H==null?void 0:H.name)?(h.openBlock(),h.createElementBlock("div",Sne,[H!=null&&H.component?(h.openBlock(),h.createElementBlock("div",Cne,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(H.component),h.mergeProps({token:(Se=(ge=i.objectData)==null?void 0:ge.tokens)==null?void 0:Se[H==null?void 0:H.token],data:i.objectData,columns:H==null?void 0:H.columns,geometry:(Ne=(Pe=i.objectData)==null?void 0:Pe.rows[0])==null?void 0:Ne.geom,ref_for:!0},s.getProps(H),{zoom:16,id:(Je=(at=t.$route)==null?void 0:at.params)==null?void 0:Je.id}),null,16,["token","data","columns","geometry","id"]))])):h.createCommentVNode("",!0),H!=null&&H.name?(h.openBlock(),h.createElementBlock("div",Tne,[(nt=(mt=i.objectData)==null?void 0:mt.html)!=null&&nt[H==null?void 0:H.name]?(h.openBlock(),h.createElementBlock("div",{key:0,innerHTML:(Ct=i.objectData)==null?void 0:Ct.html[H==null?void 0:H.name]},null,8,Ane)):(h.openBlock(),h.createBlock(o,{key:1,slot:($t=i.objectData)==null?void 0:$t.vue[H==null?void 0:H.name],data:(Ot=(jt=i.objectData)==null?void 0:jt.rows)==null?void 0:Ot[0],objectData:i.objectData},null,8,["slot","data","objectData"]))])):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0)],64)}),128))])])):h.createCommentVNode("",!0)],2)}),128))],2)])}const yv=Ve(ane,[["render",Mne],["__scopeId","data-v-f3b4c92f"]]),Dne=Object.freeze(Object.defineProperty({__proto__:null,default:yv},Symbol.toStringTag,{value:"Module"})),Ine={"card-page":yv,"user-cls-page":Xte,"calendar-page":{__name:"vs-calendar-page",setup(t){return(e,n)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(eI)]))}}},Pne={},Rne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-info-circle"};function One(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Rne,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"},null,-1),h.createElementVNode("path",{d:"M12 9h.01"},null,-1),h.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1)]))}const Nne=Ve(Pne,[["render",One]]),Bne={},zne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-loader"};function Lne(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",zne,e[0]||(e[0]=[h.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 6l0 -3"></path><path d="M16.25 7.75l2.15 -2.15"></path><path d="M18 12l3 0"></path><path d="M16.25 16.25l2.15 2.15"></path><path d="M12 18l0 3"></path><path d="M7.75 16.25l-2.15 2.15"></path><path d="M6 12l-3 0"></path><path d="M7.75 7.75l-2.15 -2.15"></path>',9)]))}const Vne=Ve(Bne,[["render",Lne]]),Fne=async(t,e,n,r=10)=>{var N,B,F,X;if(!e||!n)return;await h.nextTick();const i=await(n==null?void 0:n.getBoundingClientRect()),s=await(e==null?void 0:e.getBoundingClientRect());if(!s||!i)return;const a=await parseInt((N=e==null?void 0:e.getBoundingClientRect())==null?void 0:N.height),o=await parseInt((B=e==null?void 0:e.getBoundingClientRect())==null?void 0:B.width),p=await parseInt((F=n==null?void 0:n.getBoundingClientRect())==null?void 0:F.height),g=await parseInt((X=n==null?void 0:n.getBoundingClientRect())==null?void 0:X.width),y=await window.innerHeight,v=await window.innerWidth;let E=0,T=0;const D=s.bottom+r+p;switch(t){case"top":s.top-i.height-r<0?E=s.top-i.height+r+p+a:E=s.top-i.height-r,v>g+s.right+30?T=s.left-i.width/2+s.width/2:T=v-30-g;break;case"bottom":y>D?E=s.bottom+r:E=s.bottom-r-p-a,T=s.left-i.width/2+s.width/2;break;case"left":E=s.top-i.height/2+s.height/2,s.left-i.width-r>0?T=s.left-i.width-r:T=10;break;case"right":E=s.top-i.height/2+s.height/2,v-o>g?T=s.right+r:T=v-30-g;break;case"top-right":s.top-i.height-r<0?E=s.top-i.height+(void 0).gap+p+a:E=s.top-i.height-r,v-o>g?T=s.right+r:T=v-30-g;break;case"top-left":s.top-i.height-r<0?E=s.top-i.height+r+p+a:E=s.top-i.height-r,s.left-i.width-r>0?T=s.left-i.width-r:T=10;break;case"bottom-right":y>D?E=s.bottom+r:E=s.bottom-r-p-a,v-o>g?T=s.left:T=v-30-g;break;case"bottom-left":y>D?E=s.bottom+r:E=s.bottom-r-p-a,s.left>0?T=s.right-g:T=10;break;case"bottom-start":y>D?E=s.bottom+r:E=s.bottom-(void 0).gap-p-a,s.left>0?T=s.left:T=10;break}E+p>y?E=y-p-r:E<0&&(E=r),T+g>v?T=v-g-r:T<0&&(T=r),n instanceof HTMLElement&&(n.style.top=`${E}px`,n.style.left=`${T}px`,n.style.position="fixed")},$ne={class:"flex items-center justify-between py-1 gap-x-4"},jne={class:"col-span-1"},Hne={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},Une={class:"col-span-2"},Wne={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},qne={key:1,class:"w-[300px] h-[300px] flex items-center justify-center"},rI={__name:"admin-info-popover",props:{table:{type:String,default:()=>""},id:{type:String,default:()=>""}},setup(t){var v,E;const e=(E=(v=h.getCurrentInstance())==null?void 0:v.appContext)==null?void 0:E.app;window.v3core.install(e),Object.entries(dE).forEach(([T,D])=>{e==null||e.component(T,D)});const n=t,r=h.ref(null),i=h.ref(!1),s=h.ref(null),a=h.ref(null);let o=null;const p=async()=>{try{const{data:T}=await tt.get(`/api/table-info/${n.table}/${n.id}`);r.value=T}catch{}},g=async()=>{clearTimeout(o),i.value=!0,r.value||await p(),await Fne("right",s.value,a.value,40)},y=()=>{o=setTimeout(()=>{i.value=!1},300)};return h.onBeforeUnmount(()=>{clearTimeout(o)}),(T,D)=>(h.openBlock(),h.createElementBlock("div",{class:"relative inline-flex h-[30px] w-[30px] flex items-center justify-center",onMouseenter:g,onMouseleave:y,ref_key:"infoPopover",ref:s},[h.createVNode(Nne,{height:"20",width:"20",class:"text-gray-700 cursor-pointer"}),(h.openBlock(),h.createBlock(h.Teleport,{to:"#modal"},[h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var N;return[h.withDirectives(h.createElementVNode("div",{onMouseenter:g,onMouseleave:y,ref_key:"infoPopoverContent",ref:a,class:"fixed p-[20px] border z-[10002] rounded-xl bg-white max-h-[400px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-thumb]:rounded-[100px] [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[r.value?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList((N=r.value)==null?void 0:N.columns,B=>{var F,X;return h.openBlock(),h.createElementBlock("dl",$ne,[h.createElementVNode("dt",jne,[h.createElementVNode("p",Hne,h.toDisplayString((B==null?void 0:B.ua)||(B==null?void 0:B.title))+": ",1)]),h.createElementVNode("dd",Une,[h.createElementVNode("p",Wne,[h.createVNode(ef,{row:(X=(F=r.value)==null?void 0:F.rows)==null?void 0:X[0],column:{...B,edit:!1}},null,8,["row","column"])])])])}),256)):(h.openBlock(),h.createElementBlock("div",qne,[h.createVNode(Vne,{height:"40",width:"40",class:"animate-spin"})]))],544),[[h.vShow,i.value]])]}),_:1})]))],544))}},bv={...Mee,...Dee,"vs-dashboard":Pee,"vs-custom-button":Nee,"vs-group-interface":ite,"vs-test-widget":{__name:"vs-test-widget",props:{data:Object,dataName:String,table:String,geom:null},setup(t){var s;const{$v3plugin:e,$confirm:n}=(s=h.getCurrentInstance())==null?void 0:s.appContext.app.config.globalProperties,r=h.ref(!1),i=()=>{n({title:"Are you sure?",message:"Are you sure you want to delete this message?"})};return(a,o)=>{var g,y,v,E;const p=h.resolveComponent("VsConfirm");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",null,[h.createVNode(rI,{table:(y=(g=a.$route)==null?void 0:g.params)==null?void 0:y.table,id:(E=(v=a.$route)==null?void 0:v.params)==null?void 0:E.id},null,8,["table","id"]),h.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:o[0]||(o[0]=T=>r.value=!0)}," Редагувати Tokens "),h.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:i}," Редагувати Tokens 1212 ")]),h.createVNode(p,{visible:r.value,"onUpdate:visible":o[1]||(o[1]=T=>r.value=T),title:"Are you sure?"},{footer:h.withCtx(()=>o[2]||(o[2]=[h.createElementVNode("div",{class:"flex gap-[4px] p-[16px]"},[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium duration-300 border rounded-lg shadow-sm gap-x-2 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50","data-hs-overlay":"#hs-pro-chhdl"}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-white duration-300 bg-red-500 rounded-lg gap-x-2 disabled:opacity-50 disabled:pointer-events-none"}," Видалити ")],-1)])),default:h.withCtx(()=>[o[3]||(o[3]=h.createElementVNode("p",{class:"mt-1 text-sm text-gray-600 dark:text-neutral-400"}," Are you sure you want to delete this message? ",-1)),o[4]||(o[4]=h.createElementVNode("div",{class:"flex items-center mt-5"},[h.createElementVNode("input",{type:"checkbox",class:"shrink-0 size-3.5 border-gray-300 rounded text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-600 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:"hs-pro-chhdlcch"}),h.createElementVNode("label",{for:"hs-pro-chhdlcch",class:"text-sm text-gray-600 ms-2 dark:text-neutral-400"}," Don't show me this again ")],-1))]),_:1},8,["visible"])],64)}}},"vs-card-list":yv,...Ine},Gne=t=>new Promise(e=>{const n=new CustomEvent("openFormPlugin");n.options=t,window.dispatchEvent(n);const r=({message:i})=>{window.removeEventListener("closeFormPlugin",r),e(i)};window.addEventListener("closeFormPlugin",r)});function Yne(t){const e=typeof t;return e==="object"?t:{title:"Підтвердити операцію",text:e==="string"?t:"Ви впевнені що хочете виконати операцію?",cancel:"Скасувати",confirm:"Виконати"}}const Zne=({api:t,confirm:e,method:n,isId:r,id:i})=>new Promise(s=>{var v,E,T,D;const{VsDialog:a}=(E=(v=window.app)==null?void 0:v._context)==null?void 0:E.components,{$notify:o}=(D=(T=window.app)==null?void 0:T.config)==null?void 0:D.globalProperties,p=document.querySelector("#modal");if(!p){console.error('Modal root element with id "#modal" not found!');return}const g=document.createElement("div");p.appendChild(g);const y=h.createApp({components:{VsDialog:a},data(){return{visible:!1,getConfirm:Yne(e)}},methods:{close(N){this.visible=!1,this.$el.remove(),y.unmount(),s(N||"Success")},async doRequest(){var N;try{const{data:B}=await tt({url:t+(r?`/${i}`:""),method:n||"POST"});this.close(B),await o({title:"Успішно!",type:"success",message:"Операція виконана успішно"}),await Rp()}catch(B){o({title:"Помилка!",type:"error",message:((N=B==null?void 0:B.response)==null?void 0:N.data)||"Сталася помилка"})}}},mounted(){e?this.visible=!0:this.doRequest()},template:`
|
741
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,p=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:g,dispatch:y})=>{if(y&&p&&a){const v=p.filter(E=>o.includes(E.type.name));g.ensureMarks(v)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),UH=js.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,kr(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>P_({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var hg=200,Hr=function(){};Hr.prototype.append=function(e){return e.length?(e=Hr.from(e),!this.length&&e||e.length<hg&&this.leafAppend(e)||this.length<hg&&e.leafPrepend(this)||this.appendInner(e)):this},Hr.prototype.prepend=function(e){return e.length?Hr.from(e).append(this):this},Hr.prototype.appendInner=function(e){return new WH(this,e)},Hr.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Hr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Hr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Hr.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Hr.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},n,r),i},Hr.from=function(e){return e instanceof Hr?e:e&&e.length?new jT(e):Hr.empty};var jT=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,o){for(var p=s;p<a;p++)if(i(this.values[p],o+p)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,o){for(var p=s-1;p>=a;p--)if(i(this.values[p],o+p)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=hg)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=hg)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Hr);Hr.empty=new jT([]);var WH=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,a){var o=this.left.length;if(i<o&&this.left.forEachInner(r,i,Math.min(s,o),a)===!1||s>o&&this.right.forEachInner(r,Math.max(i-o,0),Math.min(this.length,s)-o,a+o)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,a){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(r,i-o,Math.max(s,o)-o,a+o)===!1||s<o&&this.left.forEachInvertedInner(r,Math.min(i,o),s,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Hr);const qH=500;class ao{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=e.tr,o,p,g=[],y=[];return this.items.forEach((v,E)=>{if(!v.step){i||(i=this.remapping(r,E+1),s=i.maps.length),s--,y.push(v);return}if(i){y.push(new Do(v.map));let T=v.step.map(i.slice(s)),D;T&&a.maybeStep(T).doc&&(D=a.mapping.maps[a.mapping.maps.length-1],g.push(new Do(D,void 0,void 0,g.length+y.length))),s--,D&&i.appendMap(D,s)}else a.maybeStep(v.step);if(v.selection)return o=i?v.selection.map(i.slice(s)):v.selection,p=new ao(this.items.slice(0,r).append(y.reverse().concat(g)),this.eventCount-1),!1},this.items.length,0),{remaining:p,transform:a,selection:o}}addTransform(e,n,r,i){let s=[],a=this.eventCount,o=this.items,p=!i&&o.length?o.get(o.length-1):null;for(let y=0;y<e.steps.length;y++){let v=e.steps[y].invert(e.docs[y]),E=new Do(e.mapping.maps[y],v,n),T;(T=p&&p.merge(E))&&(E=T,y?s.pop():o=o.slice(0,o.length-1)),s.push(E),n&&(a++,n=void 0),i||(p=E)}let g=a-r.depth;return g>YH&&(o=GH(o,g),a-=g),new ao(o.append(s),a)}remapping(e,n){let r=new wd;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new ao(this.items.append(e.map(n=>new Do(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach(E=>{E.selection&&o--},i);let p=n;this.items.forEach(E=>{let T=s.getMirror(--p);if(T==null)return;a=Math.min(a,T);let D=s.maps[T];if(E.step){let N=e.steps[T].invert(e.docs[T]),B=E.selection&&E.selection.map(s.slice(p+1,T));B&&o++,r.push(new Do(D,N,B))}else r.push(new Do(D))},i);let g=[];for(let E=n;E<a;E++)g.push(new Do(s.maps[E]));let y=this.items.slice(0,i).append(g).append(r),v=new ao(y,o);return v.emptyItemCount()>qH&&(v=v.compress(this.items.length-r.length)),v}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((a,o)=>{if(o>=e)i.push(a),a.selection&&s++;else if(a.step){let p=a.step.map(n.slice(r)),g=p&&p.getMap();if(r--,g&&n.appendMap(g,r),p){let y=a.selection&&a.selection.map(n.slice(r));y&&s++;let v=new Do(g.invert(),p,y),E,T=i.length-1;(E=i.length&&i[T].merge(v))?i[T]=E:i.push(v)}}else a.map&&r--},this.items.length,0),new ao(Hr.from(i.reverse()),s)}}ao.empty=new ao(Hr.empty,0);function GH(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Do{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Do(n.getMap().invert(),n,this.selection)}}}class el{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const YH=20;function ZH(t,e,n,r){let i=n.getMeta(yc),s;if(i)return i.historyState;n.getMeta(JH)&&(t=new el(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(yc))return a.getMeta(yc).redo?new el(t.done.addTransform(n,void 0,r,fg(e)),t.undone,HT(n.mapping.maps),t.prevTime,t.prevComposition):new el(t.done,t.undone.addTransform(n,void 0,r,fg(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),p=t.prevTime==0||!a&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!XH(n,t.prevRanges)),g=a?K_(t.prevRanges,n.mapping):HT(n.mapping.maps);return new el(t.done.addTransform(n,p?e.selection.getBookmark():void 0,r,fg(e)),ao.empty,g,n.time,o??t.prevComposition)}else return(s=n.getMeta("rebased"))?new el(t.done.rebased(n,s),t.undone.rebased(n,s),K_(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new el(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),K_(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function XH(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function HT(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,a)=>e.push(s,a));return e}function K_(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function KH(t,e,n){let r=fg(e),i=yc.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),o=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),p=new el(n?o:s.remaining,n?s.remaining:o,null,0,-1);return s.transform.setSelection(a).setMeta(yc,{redo:n,historyState:p})}let J_=!1,UT=null;function fg(t){let e=t.plugins;if(UT!=e){J_=!1,UT=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){J_=!0;break}}return J_}const yc=new Zi("history"),JH=new Zi("closeHistory");function QH(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ei({key:yc,state:{init(){return new el(ao.empty,ao.empty,null,0,-1)},apply(e,n,r){return ZH(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?qT:r=="historyRedo"?GT:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function WT(t,e){return(n,r)=>{let i=yc.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=KH(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const qT=WT(!1,!0),GT=WT(!0,!0),eU=jr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>qT(t,e),redo:()=>({state:t,dispatch:e})=>GT(t,e)}},addProseMirrorPlugins(){return[QH(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),tU=js.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",kr(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):GC(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:a,dispatch:o})=>{var p;if(o){const{$to:g}=a.selection,y=g.end();if(g.nodeAfter)g.nodeAfter.isTextblock?a.setSelection(Gt.create(a.doc,g.pos+1)):g.nodeAfter.isBlock?a.setSelection(Lt.create(a.doc,g.pos)):a.setSelection(Gt.create(a.doc,g.pos));else{const v=(p=g.parent.type.contentMatch.defaultType)===null||p===void 0?void 0:p.create();v&&(a.insert(y,v),a.setSelection(Gt.create(a.doc,y+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[P8({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),nU=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,rU=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,iU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,sU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,oU=Co.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[zd({find:nU,type:this.type}),zd({find:iU,type:this.type})]},addPasteRules(){return[Ld({find:rU,type:this.type}),Ld({find:sU,type:this.type})]}}),aU=js.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",kr(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),lU="listItem",YT="textStyle",ZT=/^(\d+)\.\s$/,cU=js.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",kr(this.options.HTMLAttributes,n),0]:["ol",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(lU,this.editor.getAttributes(YT)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=jh({find:ZT,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=jh({find:ZT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(YT)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),dU=js.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),uU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,hU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,fU=Co.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[zd({find:uU,type:this.type})]},addPasteRules(){return[Ld({find:hU,type:this.type})]}}),XT=js.create({name:"text",group:"inline"}),pU=jr.create({name:"starterKit",addExtensions(){var t,e,n,r,i,s,a,o,p,g,y,v,E,T,D,N,B,F;const X=[];return this.options.bold!==!1&&X.push(kH.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&X.push(bH.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&X.push(SH.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&X.push(AH.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&X.push($T.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&X.push(IH.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&X.push(OH.configure((a=this.options)===null||a===void 0?void 0:a.dropcursor)),this.options.gapcursor!==!1&&X.push(jH.configure((o=this.options)===null||o===void 0?void 0:o.gapcursor)),this.options.hardBreak!==!1&&X.push(HH.configure((p=this.options)===null||p===void 0?void 0:p.hardBreak)),this.options.heading!==!1&&X.push(UH.configure((g=this.options)===null||g===void 0?void 0:g.heading)),this.options.history!==!1&&X.push(eU.configure((y=this.options)===null||y===void 0?void 0:y.history)),this.options.horizontalRule!==!1&&X.push(tU.configure((v=this.options)===null||v===void 0?void 0:v.horizontalRule)),this.options.italic!==!1&&X.push(oU.configure((E=this.options)===null||E===void 0?void 0:E.italic)),this.options.listItem!==!1&&X.push(aU.configure((T=this.options)===null||T===void 0?void 0:T.listItem)),this.options.orderedList!==!1&&X.push(cU.configure((D=this.options)===null||D===void 0?void 0:D.orderedList)),this.options.paragraph!==!1&&X.push(dU.configure((N=this.options)===null||N===void 0?void 0:N.paragraph)),this.options.strike!==!1&&X.push(fU.configure((B=this.options)===null||B===void 0?void 0:B.strike)),this.options.text!==!1&&X.push(XT.configure((F=this.options)===null||F===void 0?void 0:F.text)),X}}),mU=Co.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=C_(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),gU=jr.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});function yU(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:s,$position:a}=t,o=R8(n),p=new RegExp(`\\s${o}$`),g=s?"^":"",y=r?new RegExp(`${g}${o}.*?(?=\\s${o}|$)`,"gm"):new RegExp(`${g}(?:^)?${o}[^\\s${o}]*`,"gm"),v=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!v)return null;const E=a.pos-v.length,T=Array.from(v.matchAll(y)).pop();if(!T||T.input===void 0||T.index===void 0)return null;const D=T.input.slice(Math.max(0,T.index-1),T.index),N=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(D);if(i!==null&&!N)return null;const B=E+T.index;let F=B+T[0].length;return r&&p.test(v.slice(F-1,F+1))&&(T[0]+=" ",F+=1),B<a.pos&&F>=a.pos?{range:{from:B,to:F},query:T[0].slice(n.length),text:T[0]}:null}const bU=new Zi("suggestion");function _U({pluginKey:t=bU,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:o="suggestion",command:p=()=>null,items:g=()=>[],render:y=()=>({}),allow:v=()=>!0,findSuggestionMatch:E=yU}){let T;const D=y==null?void 0:y(),N=new ei({key:t,view(){return{update:async(B,F)=>{var X,te,H,ke,ge,Se,Pe;const Ne=(X=this.key)===null||X===void 0?void 0:X.getState(F),at=(te=this.key)===null||te===void 0?void 0:te.getState(B.state),Je=Ne.active&&at.active&&Ne.range.from!==at.range.from,mt=!Ne.active&&at.active,nt=Ne.active&&!at.active,Ct=!mt&&!nt&&Ne.query!==at.query,$t=mt||Je&&Ct,jt=Ct||Je,Ot=nt||Je&&Ct;if(!$t&&!jt&&!Ot)return;const qt=Ot&&!$t?Ne:at,wn=B.dom.querySelector(`[data-decoration-id="${qt.decorationId}"]`);T={editor:e,range:qt.range,query:qt.query,text:qt.text,items:[],command:yn=>p({editor:e,range:qt.range,props:yn}),decorationNode:wn,clientRect:wn?()=>{var yn;const{decorationId:An}=(yn=this.key)===null||yn===void 0?void 0:yn.getState(e.state),bn=B.dom.querySelector(`[data-decoration-id="${An}"]`);return(bn==null?void 0:bn.getBoundingClientRect())||null}:null},$t&&((H=D==null?void 0:D.onBeforeStart)===null||H===void 0||H.call(D,T)),jt&&((ke=D==null?void 0:D.onBeforeUpdate)===null||ke===void 0||ke.call(D,T)),(jt||$t)&&(T.items=await g({editor:e,query:qt.query})),Ot&&((ge=D==null?void 0:D.onExit)===null||ge===void 0||ge.call(D,T)),jt&&((Se=D==null?void 0:D.onUpdate)===null||Se===void 0||Se.call(D,T)),$t&&((Pe=D==null?void 0:D.onStart)===null||Pe===void 0||Pe.call(D,T))},destroy:()=>{var B;T&&((B=D==null?void 0:D.onExit)===null||B===void 0||B.call(D,T))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(B,F,X,te){const{isEditable:H}=e,{composing:ke}=e.view,{selection:ge}=B,{empty:Se,from:Pe}=ge,Ne={...F};if(Ne.composing=ke,H&&(Se||e.view.composing)){(Pe<F.range.from||Pe>F.range.to)&&!ke&&!F.composing&&(Ne.active=!1);const at=E({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:s,$position:ge.$from}),Je=`id_${Math.floor(Math.random()*4294967295)}`;at&&v({editor:e,state:te,range:at.range,isActive:F.active})?(Ne.active=!0,Ne.decorationId=F.decorationId?F.decorationId:Je,Ne.range=at.range,Ne.query=at.query,Ne.text=at.text):Ne.active=!1}else Ne.active=!1;return Ne.active||(Ne.decorationId=null,Ne.range={from:0,to:0},Ne.query=null,Ne.text=null),Ne}},props:{handleKeyDown(B,F){var X;const{active:te,range:H}=N.getState(B.state);return te&&((X=D==null?void 0:D.onKeyDown)===null||X===void 0?void 0:X.call(D,{view:B,event:F,range:H}))||!1},decorations(B){const{active:F,range:X,decorationId:te}=N.getState(B);return F?Tr.create(B.doc,[fs.inline(X.from,X.to,{nodeName:a,class:o,"data-decoration-id":te})]):null}}});return N}const xU=new Zi("mention"),vU=js.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",kr(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:xU,command:({editor:t,range:e,props:n})=>{var r,i,s;const a=t.view.state.selection.$to.nodeAfter;((r=a==null?void 0:a.text)===null||r===void 0?void 0:r.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(s=(i=t.view.dom.ownerDocument.defaultView)===null||i===void 0?void 0:i.getSelection())===null||s===void 0||s.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",kr({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=kr({"data-type":this.name},this.options.HTMLAttributes,e);const r=this.options.renderHTML({options:n,node:t});return typeof r=="string"?["span",kr({"data-type":this.name},this.options.HTMLAttributes,e),r]:r},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:i,anchor:s}=r;return i?(e.doc.nodesBetween(s-1,s,(a,o)=>{if(a.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",o,o+a.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[_U({editor:this.editor,...this.options.suggestion})]}}),wU=Co.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",kr(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),kU={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function EU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleBlockquote&&s.toggleBlockquote(...a)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[h.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const SU=Ve(kU,[["render",EU]]),CU={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function TU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleBulletList&&s.toggleBulletList(...a)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const AU=Ve(CU,[["render",TU]]),MU={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function DU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleOrderedList&&s.toggleOrderedList(...a)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const IU=Ve(MU,[["render",DU]]),PU={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function RU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleCodeBlock&&s.toggleCodeBlock(...a)),class:"p-1.5 text-gray-500 rounded hover:text-gray-900 dark:hover:text-white focus:outline-none"},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const OU=Ve(PU,[["render",RU]]),NU={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function BU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleBold&&s.toggleBold(...a)),class:h.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("bold")}])},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),h.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const zU=Ve(NU,[["render",BU]]),LU={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function VU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("button",{onClick:e[0]||(e[0]=(...a)=>s.toggleItalic&&s.toggleItalic(...a)),class:h.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("italic")}])},e[1]||(e[1]=[h.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),h.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const FU=Ve(LU,[["render",VU]]),$U={},jU={"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"};function HU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",jU,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"},null,-1)]))}const UU={components:{IconA:Ve($U,[["render",HU]])},props:{editor:Object},data(){return{color:"#000000",colors:["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{setColor(t){this.editor&&(this.editor.chain().focus().setColor(t).run(),this.$refs.popover.togglePopover(),this.color=t)}}},WU={class:"relative flex"},qU={class:"flex w-[160px] flex-wrap gap-[4px]"},GU=["onClick"];function YU(t,e,n,r,i,s){const a=h.resolveComponent("IconA"),o=h.resolveComponent("VsPopover");return h.openBlock(),h.createBlock(o,{ref:"popover",placement:"bottom"},{reference:h.withCtx(()=>[h.createElementVNode("button",WU,[h.createVNode(a,{height:"20",width:"20",class:"text-gray-500"}),h.createElementVNode("span",{class:"absolute h-[4px] w-[80%] bottom-[2px] left-[2px]",style:h.normalizeStyle({backgroundColor:i.color})},null,4)])]),default:h.withCtx(()=>[h.createElementVNode("div",null,[h.createElementVNode("ul",qU,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.colors,p=>(h.openBlock(),h.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:h.normalizeStyle({backgroundColor:p}),onClick:g=>s.setColor(p),key:p},null,12,GU))),128))])])]),_:1},512)}const ZU=Ve(UU,[["render",YU]]),XU={},KU={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"};function JU(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",KU,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),h.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),h.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const Q_=Ve(XU,[["render",JU]]),QU={components:{IconMore:Q_},props:{editor:Object},methods:{toggleUnderline(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleUnderline().run()},toggleStrike(){this.$refs.popover.togglePopover(),this.editor&&this.editor.chain().focus().toggleStrike().run()}}};function e9(t,e,n,r,i,s){const a=h.resolveComponent("IconMore"),o=h.resolveComponent("VsPopover");return h.openBlock(),h.createBlock(o,{ref:"popover",placement:"bottom"},{reference:h.withCtx(()=>[h.createElementVNode("button",{class:h.normalizeClass(["p-1.5 text-gray-500 rounded cursor-pointer hover:text-gray-900 hover:bg-gray-200",{"bg-gray-200 text-gray-900":n.editor.isActive("underline")||n.editor.isActive("strike")}])},[h.createVNode(a,{height:"18",width:"18",class:"rotate-90"})],2)]),default:h.withCtx(()=>[h.createElementVNode("div",null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=(...p)=>s.toggleUnderline&&s.toggleUnderline(...p)),class:h.normalizeClass(["p-[8px] block rounded-lg w-[140px] mb-[4px] text-start hover:bg-gray-100 !duration-300 underline underline-offset-1",{"bg-gray-100 text-gray-900":n.editor.isActive("underline")}])}," Підкресленний ",2),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...p)=>s.toggleStrike&&s.toggleStrike(...p)),class:h.normalizeClass(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300 line-through",{"bg-gray-100 text-gray-900":n.editor.isActive("strike")}])}," Перекресленний ",2)])]),_:1},512)}const t9={bold:zU,italic:FU,text_more:Ve(QU,[["render",e9]]),color:ZU,bullet_list:AU,ordered_list:IU,blockquote:SU,codeblock:OU},n9={components:{EditorContent:gH},props:{controls:{type:Array,default:()=>["bold","italic","color","blockquote","bullet_list","ordered_list","codeblock","text_more"]},options:{type:Array,default:()=>[]},modelValue:{type:String,default:()=>""}},data(){return{editor:null}},computed:{controlsList(){return Object.entries(t9).filter(([t])=>this.controls.includes(t)).map(([t,e])=>e)}},watch:{modelValue(t){this.editor&&this.editor.getHTML()!==t&&this.editor.commands.setContent(t)},editor(t){t&&this.editor.on("update",({editor:e})=>{const n=e.getHTML();n!==this.modelValue&&this.$emit("update:modelValue",n)})}},mounted(){this.editor&&this.editor.destroy(),this.initEditor()},beforeDestroy(){this.editor&&this.editor.destroy()},methods:{initEditor(){this.editor=new mH({content:this.modelValue,extensions:[pU,$T,mU,gU,wU,XT,vU.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:t})=>{var n;const e=(n=this.options)==null?void 0:n.filter(r=>{var i,s;return(s=(i=r==null?void 0:r.email)==null?void 0:i.toLowerCase())==null?void 0:s.includes(t==null?void 0:t.toLowerCase())}).slice(0,5);return e.length?e:[{id:null,text:"Данні відсутні",email:null}]},render:()=>{let t,e;return{onStart:n=>{var s;t=document.createElement("div"),t.className="mention-popup",(s=n.items)==null||s.forEach(a=>{const o=document.createElement("div");o.className="mention-option",a.id===null?(o.textContent=a.text,o.style.pointerEvents="none",o.style.color="#999"):(o.textContent=a.text,o.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(o)}),document.body.appendChild(t);const{from:r}=n.range,i=n.editor.view.coordsAtPos(r);t.style.position="absolute",t.style.left=`${i.left}px`,t.style.top=`${i.top-t.offsetHeight}px`,e=t},onUpdate:n=>{var s;for(;t.firstChild;)t.removeChild(t.firstChild);(s=n.items)==null||s.forEach(a=>{const o=document.createElement("div");o.className="mention-option",a.id===null?(o.textContent=a.text,o.style.pointerEvents="none",o.style.color="#999"):(o.textContent=a.text,o.addEventListener("click",()=>{n.command({id:a.id,label:a.email})})),t.appendChild(o)});const{from:r}=n.range,i=n.editor.view.coordsAtPos(r);t.style.left=`${i.left}px`,t.style.top=`${i.top-t.offsetHeight}px`},onExit:()=>{e&&e.remove()}}}}})]})},focusEditor(){this.editor&&!this.editor.isFocused&&this.editor.commands.focus()}}},r9={class:"w-full border border-gray-200 rounded-lg editor-container bg-gray-50 dark:bg-gray-700 dark:border-gray-600"},i9={key:0,class:"flex flex-wrap items-center w-full gap-2 px-3 py-2 border-b editor-toolbar dark:border-gray-600"};function s9(t,e,n,r,i,s){const a=h.resolveComponent("EditorContent");return h.openBlock(),h.createElementBlock("div",r9,[i.editor?(h.openBlock(),h.createElementBlock("div",i9,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.controlsList,(o,p)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(o),{key:p,editor:i.editor},null,8,["editor"]))),128))])):h.createCommentVNode("",!0),h.createElementVNode("div",{onClick:e[0]||(e[0]=(...o)=>s.focusEditor&&s.focusEditor(...o)),class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800"},[h.createVNode(a,{editor:i.editor,class:"relative w-full"},null,8,["editor"])])])}const KT=Ve(n9,[["render",s9]]),o9={components:{VsTextEditor:KT},props:{comment:{type:Object,default:()=>({})},user:{type:Object,default:()=>({})},id:{type:String,default:""},options:Array},data(){return{commentContent:this.comment.body,isCommentActionVisible:!1,isOpen:!1,hovered:!1,windowWidth:null,textareaValue:""}},computed:{isElementVisible(){return this.windowWidth>=600?this.hovered:!0},isUserAutor(){return this.user.uid===this.comment.uid},createDate(){try{return ft(this.comment.cdate,"YYYY-MM-DD HH:mm:ss").format("DD MMMM YYYY HH:mm")}catch{return""}}},mounted(){window.addEventListener("resize",this.updateWindowWidth)},beforeDestroy(){window.removeEventListener("resize",this.updateWindowWidth)},watch:{isOpen(t){t&&(this.textareaValue=this.comment.body)}},methods:{updateWindowWidth(){this.windowWidth=typeof window>"u"?null:window==null?void 0:window.innerWidth},confirnDeleteComment(){document.body.click(),this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей коментар?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteComment,updateListOnConfirm:!0})},async updateComment(){try{await tt.post(`/api/widget/comment/${this.id}/${this.comment.communication_id}`,{body:this.textareaValue}),this.$emit("list-update"),this.isOpen=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},openEditModal(){document.body.click(),this.isOpen=!0},async deleteComment(){try{await tt.delete(`/api/widget/comment/${this.id}/${this.comment.communication_id}`),this.$emit("list-update"),this.isCommentActionVisible=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},toggleCommentAction(){this.isCommentActionVisible=!this.isCommentActionVisible}}},a9={class:"relative group-last:after:hidden after:absolute after:top-7 after:bottom-1 after:start-3 after:w-px after:-translate-x-[0.5px] after:bg-gray-200 dark:after:bg-neutral-700"},l9={class:"relative flex items-center justify-center size-6 overflow-hidden rounded-full"},c9=["src"],d9={key:1,class:"flex shrink-0 justify-center items-center size-[38px] border border-gray-200 text-sm font-semibold uppercase text-gray-800 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-400"},u9={class:"pb-8 grow"},h9={class:"flex justify-between -mt-[5px]"},f9={class:"flex items-center"},p9={class:"text-sm font-semibold text-gray-800 dark:text-neutral-200"},m9={class:"text-xs text-gray-400 ms-1 dark:text-neutral-500"},g9={class:"min-h-[32px]"},y9={class:"p-0.5 inline-flex items-center gap-x-0.5 bg-white border border-gray-200 shadow-sm rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},b9=["innerHTML"],_9={class:"flex flex-col gap-[8px] p-[10px] text-sm font-medium text-gray-500"},x9={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function v9(t,e,n,r,i,s){var p,g;const a=h.resolveComponent("VsTextEditor"),o=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",{class:"group relative flex gap-x-3.5",onMouseenter:e[2]||(e[2]=y=>i.hovered=!0),onMouseleave:e[3]||(e[3]=y=>i.hovered=!1)},[h.createElementVNode("div",a9,[h.createElementVNode("div",l9,[n.comment.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"shrink-0 object-cover",src:n.comment.avatar,alt:"Avatar"},null,8,c9)):(h.openBlock(),h.createElementBlock("span",d9,h.toDisplayString((p=n.comment.username)==null?void 0:p.charAt(0)),1))])]),h.createElementVNode("div",u9,[h.createElementVNode("span",h9,[h.createElementVNode("div",f9,[h.createElementVNode("span",p9,h.toDisplayString((g=n.comment)==null?void 0:g.username),1),h.createElementVNode("span",m9,h.toDisplayString(s.createDate),1)]),h.createElementVNode("div",g9,[h.withDirectives(h.createElementVNode("div",y9,[h.createElementVNode("div",{class:"inline-block",onClick:e[0]||(e[0]=y=>s.openEditModal())},e[8]||(e[8]=[h.createStaticVNode('<button type="button" class="hs-tooltip-toggle size-[26px] inline-flex justify-center items-center gap-x-1 text-xs font-medium rounded-md border border-transparent bg-white text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:bg-neutral-800 dark:border-transparent dark:text-neutral-500 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"><svg class="shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg><span class="sr-only">Edit message</span></button>',1),h.createElementVNode("span",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded-lg whitespace-nowrap dark:bg-neutral-700",role:"tooltip"}," Edit message ",-1)])),h.createElementVNode("div",{class:"inline-block",onClick:e[1]||(e[1]=y=>s.confirnDeleteComment())},e[9]||(e[9]=[h.createStaticVNode('<button type="button" class="hs-tooltip-toggle size-[26px] inline-flex justify-center items-center gap-x-1 text-xs font-medium rounded-md border border-transparent bg-white text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:bg-neutral-800 dark:border-transparent dark:text-neutral-500 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"><svg class="shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg><span class="sr-only">Delete message</span></button>',1),h.createElementVNode("span",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded-lg whitespace-nowrap dark:bg-neutral-700",role:"tooltip"}," Delete message ",-1)]))],512),[[h.vShow,s.isElementVisible]])])]),h.createElementVNode("p",{class:"mt-1 text-sm text-gray-800 dark:text-neutral-200",innerHTML:n.comment.body},null,8,b9)])],32),h.createVNode(o,{visible:i.isOpen,"onUpdate:visible":e[7]||(e[7]=y=>i.isOpen=y),title:"Редагувати",size:"small"},{footer:h.withCtx(()=>[h.createElementVNode("div",x9,[h.createElementVNode("button",{onClick:e[5]||(e[5]=y=>i.isOpen=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),h.createElementVNode("button",{onClick:e[6]||(e[6]=(...y)=>s.updateComment&&s.updateComment(...y)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:h.withCtx(()=>[h.createElementVNode("div",_9,[h.createVNode(a,{modelValue:i.textareaValue,"onUpdate:modelValue":e[4]||(e[4]=y=>i.textareaValue=y),options:n.options},null,8,["modelValue","options"])])]),_:1},8,["visible"])],64)}const w9={components:{VsWidgetCommentsItem:Ve(o9,[["render",v9]])},inject:["activeAddFormEditor"],props:{id:{type:String,default:()=>""},prefilledData:{type:Object,default:null},options:Array},data(){return{isLoaded:!1,isLoadFailed:!1,comments:[],user:{},modal:{title:"",message:"",cancel:"",confirm:"",cancelButtonText:"",confirmButtonText:""},isModalVisible:!1}},async created(){await this.getComments()},methods:{async getComments(){if(this.prefilledData){this.comments=this.prefilledData.rows,this.isLoaded=!0;return}try{const{data:t}=await tt.get(`/api/widget/comment/${this.id}`);this.comments=t.rows,this.user=t.user}catch(t){this.isLoadFailed=!0,console.error(t)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(t){const e={...t};return t.cancel||(e.cancel=()=>{this.isModalVisible=!1}),t.updateListOnConfirm&&(e.confirm=async()=>{await t.confirm(),this.isModalVisible=!1}),e},handleOpenModal(t){this.modal=this.prepareModal(t),this.isModalVisible=!0}}},k9={class:"flex flex-col"},E9={key:0,class:"max-h-[300px] p-[10px] overflow-y-auto overflow-x-hidden [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},S9={key:1},C9={class:"p-4"},T9={class:"mt-1 text-gray-500 dark:text-neutral-500"},A9={class:"mt-4 flex justify-end gap-x-3"};function M9(t,e,n,r,i,s){var y;const a=h.resolveComponent("VsErrorOnLoading"),o=h.resolveComponent("VsWidgetCommentsItem"),p=h.resolveComponent("VsLoader"),g=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock("div",k9,[i.isLoaded?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[i.isLoadFailed?(h.openBlock(),h.createBlock(a,{key:0})):(h.openBlock(),h.createElementBlock(h.Fragment,{key:1},[(y=i.comments)!=null&&y.length?(h.openBlock(),h.createElementBlock("div",E9,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.comments,(v,E)=>(h.openBlock(),h.createBlock(o,{key:E,comment:v,user:i.user,options:n.options,index:E,id:n.id,onListUpdate:s.getComments,onOpenModal:e[0]||(e[0]=T=>s.handleOpenModal(T))},null,8,["comment","user","options","index","id","onListUpdate"]))),128))])):(h.openBlock(),h.createElementBlock("div",S9,e[4]||(e[4]=[h.createElementVNode("p",{class:"pl-3 text-sm font-medium text-gray-600"}," Коментарі відсутні ",-1)])))],64))],64)):(h.openBlock(),h.createBlock(p,{key:1,class:"justify-center",text:"Please wait..."})),h.createVNode(g,{title:i.modal.title,size:"small",visible:i.isModalVisible,"onUpdate:visible":e[3]||(e[3]=v=>i.isModalVisible=v)},{default:h.withCtx(()=>[h.createElementVNode("div",C9,[h.createElementVNode("p",T9,h.toDisplayString(i.modal.message),1),h.createElementVNode("div",A9,[h.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[1]||(e[1]=(...v)=>i.modal.cancel&&i.modal.cancel(...v))},h.toDisplayString(i.modal.cancelButtonText),1),h.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...v)=>i.modal.confirm&&i.modal.confirm(...v))},h.toDisplayString(i.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const D9=Ve(w9,[["render",M9]]),I9={components:{VsTextEditor:KT},props:{id:{type:String,default:()=>""},autofocus:{type:Boolean,default:()=>!0},options:Array},data(){return{isEditorOpen:!1,commentContent:""}},methods:{async addNewComment(){if(this.commentContent)try{await tt.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.closeEditor(),this.$emit("list-update")}catch(t){console.error(t)}},setNewContent(t){this.commentContent=t},closeEditor(){this.isEditorOpen=!1,this.commentContent=""}}},P9={class:"flex flex-col items-start w-full widget-comment-form"},R9={class:"w-full mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"},O9={key:0,class:"flex gap-[10px]"};function N9(t,e,n,r,i,s){const a=h.resolveComponent("VsTextEditor");return h.openBlock(),h.createElementBlock("div",P9,[h.createElementVNode("div",R9,[h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>[i.isEditorOpen?(h.openBlock(),h.createBlock(a,{key:0,modelValue:i.commentContent,"onUpdate:modelValue":e[0]||(e[0]=o=>i.commentContent=o),options:n.options},null,8,["modelValue","options"])):h.createCommentVNode("",!0)]),_:1}),i.isEditorOpen?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",{key:0,onClick:e[1]||(e[1]=o=>i.isEditorOpen=!0),class:"border flex items-center pl-[20px] border-gray-200 rounded-lg h-[40px] hover:bg-gray-50 text-gray-500 duration-300 hover:text-gray-900"}," Додати коментар... "))]),i.isEditorOpen?(h.openBlock(),h.createElementBlock("div",O9,[h.createElementVNode("button",{ref:"buttonAdd",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:e[2]||(e[2]=(...o)=>s.addNewComment&&s.addNewComment(...o))}," Відправити коментар ",512),h.createElementVNode("button",{onClick:e[3]||(e[3]=(...o)=>s.closeEditor&&s.closeEditor(...o)),ref:"buttonAdd",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-black duration-300 border rounded-lg gap-x-2 hover:bg-gray-100"}," Скасувати ",512)])):h.createCommentVNode("",!0)])}const B9={components:{VsWidgetCommentsList:D9,VsWidgetCommentsAddForm:Ve(I9,[["render",N9]])},props:{id:{type:String,default(){return""}},prefilledData:{type:Object,default:null}},data(){return{activeAddFormEditor:"",comments:[],totalComment:"0",options:[]}},mounted(){this.comments=this.$refs.commentListRef.comments,this.getUsersList()},watch:{comments(t){this.$emit("count-change",t.length)}},methods:{async getUsersList(){try{const{data:t}=await tt.get("/api/suggest/core.user_mentioned");this.options=t}catch(t){console.log(t)}},listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},z9={class:"w-full bg-white-200"};function L9(t,e,n,r,i,s){const a=h.resolveComponent("VsWidgetCommentsAddForm"),o=h.resolveComponent("VsWidgetCommentsList");return h.openBlock(),h.createElementBlock("div",z9,[e[2]||(e[2]=h.createElementVNode("div",{class:"flex items-center justify-between w-full mb-4 gap-x-2"},null,-1)),h.createVNode(a,{options:i.options,class:"mb-6",id:n.id,onListUpdate:e[0]||(e[0]=p=>s.listUpdate())},null,8,["options","id"]),h.createVNode(o,{options:i.options,id:n.id,onUpdateCommentCount:e[1]||(e[1]=p=>s.updateCommentCount()),"prefilled-data":n.prefilledData,ref:"commentListRef"},null,8,["options","id","prefilled-data"])])}const JT=Ve(B9,[["render",L9]]),QT=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"}),V9=t=>new Date(t).toLocaleDateString("uk-UK",{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}),F9={},$9={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-user"};function j9(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",$9,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0"},null,-1),h.createElementVNode("path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"},null,-1)]))}const eA=Ve(F9,[["render",j9]]),H9=t=>{const e=/(\b\S)?/g,n=t.match(e);return n?n.join("").toUpperCase():""},U9=h.defineComponent({props:{username:{type:String,default:()=>""}},components:{IconUserOutline:eA},computed:{inItials(){return H9(this.username)}}}),W9={class:"flex shrink-0 bg-white justify-center items-center size-[38px] border border-gray-200 text-sm font-semibold uppercase text-gray-800 rounded-full"},q9={key:0};function G9(t,e,n,r,i,s){const a=h.resolveComponent("IconUserOutline");return h.openBlock(),h.createElementBlock("div",W9,[t.inItials?(h.openBlock(),h.createElementBlock("span",q9,h.toDisplayString(t.inItials),1)):(h.openBlock(),h.createBlock(a,{key:1,class:"w-[16px] h-[16px]"}))])}const Y9=Ve(U9,[["render",G9]]),ex={load(){try{const t=Array.from(arguments);window.headLoadedFiles||(window.headLoadedFiles=[]);const e=typeof arguments[arguments.length-1]=="function"?arguments[arguments.length-1]:null,n=t.filter(r=>typeof r!="function").reduce((r,i)=>r.concat(i),[]).filter(r=>r&&!window.headLoadedFiles[r.url||r.split("?")[0]]);Promise.all(n.map(r=>this.loadFile1(r))).then(()=>{e&&e()})}catch(t){console.log(t)}},promise(t){return new Promise((e,n)=>{ex.load(t,()=>{e()})})},loadFile1(t){let e=!1;typeof t=="object"&&(e=t.type,t=t.url);const n=t.split("?")[0];return new Promise((r,i)=>{function s(o){delete window.headLoadedFiles[`_${n}`],window.headLoadedFiles[n]=o.type,r(o.type)}let a;window.headLoadedFiles[`_${n}`]?a=window.headLoadedFiles[`_${n}`]:(n.includes(".css")?(a=document.createElement("link"),a.href=t,a.type="text/css",a.rel="stylesheet"):(a=document.createElement("script"),a.type="text/javascript",a.src=t,e&&(a.type=e)),window.headLoadedFiles[`_${n}`]=a,document.head.appendChild(a)),a.addEventListener("load",s),a.addEventListener("error",s)})}},Z9={props:{point:{type:String,default:()=>""}},data(){return{zoom:18}},computed:{parsedPoint(){return JSON.parse(this.point)},tooltipText(){return this.parsedPoint.coordinates.join(", ")},coordinates(){return[...this.parsedPoint.coordinates].reverse()}},async mounted(){typeof window>"u"||(window!=null&&window.L||(await ex.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"),await ex.promise("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js")),this.initMap())},methods:{initMap(){const t=window.L.map("map",{center:this.coordinates,zoom:this.zoom});window.L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(t),window.L.circle(this.coordinates,{color:"red",fillColor:"red",fillOpacity:.2,radius:10}).addTo(t).bindTooltip(this.tooltipText)}}},X9={id:"map",style:{height:"9rem",width:"24rem"}};function K9(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",X9)}const J9=Ve(Z9,[["render",K9]]),Q9=h.defineComponent({components:{VsWidgetHistoryItemAvatar:Y9,VsWidgetHistoryItemMap:J9,IconFile:a2},props:{item:{type:Object,default:()=>{}}},methods:{getTitle(t){return t.title||t.attr},getOldValue(t){return t.old||"Не вказано"},getNewValue(t){return t.new||"Не вказано"},getDate(t){return V9(t.cdate)}}}),eW={class:"relative"},tW={class:"w-full flex gap-x-5"},nW={class:"grow"},rW={class:"text-sm font-semibold text-gray-800 dark:text-neutral-300"},iW={key:0,class:"text-sm text-gray-500 dark:text-neutral-500"},sW={key:1,class:"text-sm text-gray-500 dark:text-neutral-500"},oW={key:2,class:"text-sm text-gray-500 dark:text-neutral-500"},aW={key:1,class:"text-sm text-gray-500 dark:text-neutral-500"},lW={key:2,class:"text-sm text-gray-500 dark:text-neutral-500"},cW={key:3,class:"text-sm text-gray-500 dark:text-neutral-500"},dW={key:4,class:"mt-2"},uW={class:"grid grid-cols-2 gap-2"},hW={class:"bg-white border border-gray-200 rounded-lg p-2 dark:bg-neutral-800 dark:border-neutral-700"},fW={class:"flex gap-x-2"},pW={class:"grow truncate"},mW={class:"block truncate text-xs text-gray-800 dark:text-neutral-300"},gW={class:"block text-xs text-gray-400 dark:text-neutral-500"},yW={class:"mt-2 text-[11px] uppercase text-gray-400 dark:text-neutral-500"};function bW(t,e,n,r,i,s){var p,g,y,v,E,T,D,N,B,F,X,te,H,ke;const a=h.resolveComponent("VsWidgetHistoryItemAvatar"),o=h.resolveComponent("IconFile");return h.openBlock(),h.createElementBlock("div",eW,[h.createElementVNode("div",tW,[h.createVNode(a,{username:t.item.username},null,8,["username"]),h.createElementVNode("div",nW,[h.createElementVNode("h4",rW,h.toDisplayString(t.item.username||"User User"),1),t.item.entity_type!=="crm.files"?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(t.item.changes,ge=>(h.openBlock(),h.createElementBlock("li",null,[ge.value_old&&ge.value_new?(h.openBlock(),h.createElementBlock("p",iW," Дані "+h.toDisplayString(ge.entity_key)+" змінились з "+h.toDisplayString(ge.value_old)+" на "+h.toDisplayString(ge.value_new),1)):h.createCommentVNode("",!0),!ge.value_old&&ge.value_new?(h.openBlock(),h.createElementBlock("p",sW," Дані "+h.toDisplayString(ge.entity_key)+" внесено до БД: "+h.toDisplayString(ge.value_new),1)):h.createCommentVNode("",!0),ge.value_old&&!ge.value_new?(h.openBlock(),h.createElementBlock("p",oW," Дані "+h.toDisplayString(ge.entity_key)+" очищено ",1)):h.createCommentVNode("",!0)]))),256)):h.createCommentVNode("",!0),t.item.entity_type==="crm.files"&&t.item.change_type==="INSERT"&&((g=(p=t.item.changes)==null?void 0:p[0])==null?void 0:g.entity_key)==="uploaded_name"?(h.openBlock(),h.createElementBlock("p",aW," Завантажено файл "+h.toDisplayString((v=(y=t.item.changes)==null?void 0:y[0])==null?void 0:v.value_new)+" ("+h.toDisplayString((D=(T=(E=t.item)==null?void 0:E.changes)==null?void 0:T[0])==null?void 0:D.entity_key)+") ",1)):h.createCommentVNode("",!0),t.item.entity_type==="crm.files"&&t.item.change_type==="DELETE"?(h.openBlock(),h.createElementBlock("p",lW," Видалено файл "+h.toDisplayString((F=(B=(N=t.item)==null?void 0:N.changes)==null?void 0:B[0])==null?void 0:F.value_old)+" ("+h.toDisplayString((H=(te=(X=t.item)==null?void 0:X.changes)==null?void 0:te[0])==null?void 0:H.entity_key)+") ",1)):h.createCommentVNode("",!0),t.item.change_type!=="DELETE"&&!((ke=t.item.changes)!=null&&ke.length)?(h.openBlock(),h.createElementBlock("p",cW," Зміни відсутні ")):h.createCommentVNode("",!0),t.item.change_type==="addFile"?(h.openBlock(),h.createElementBlock("div",dW,[h.createElementVNode("div",uW,[h.createElementVNode("div",hW,[h.createElementVNode("div",fW,[h.createVNode(o,{class:"w-[24px] h-[24px] text-gray-800"}),h.createElementVNode("div",pW,[h.createElementVNode("p",mW,h.toDisplayString(t.item.file_name||"example file_name"),1),h.createElementVNode("small",gW,h.toDisplayString(t.item.file_weight||"example file_weight kb"),1)])])])])])):h.createCommentVNode("",!0),h.createElementVNode("p",yW,h.toDisplayString(t.getDate(t.item)),1)])])])}const _W=Ve(Q9,[["render",bW]]),xW={},vW={class:"shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function wW(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",vW,e[0]||(e[0]=[h.createElementVNode("path",{d:"m7 15 5 5 5-5"},null,-1),h.createElementVNode("path",{d:"m7 9 5-5 5 5"},null,-1)]))}const kW=Ve(xW,[["render",wW]]),EW=h.defineComponent({components:{VsWidgetHistoryItem:_W,VsEmptyWidget:d2,IconUpDown:kW},props:{id:{type:String,default:""},prefilledData:{type:Object,default:null}},data:()=>({history:{},showAll:!1,limitVisible:5}),computed:{createdDate(){var t,e,n;return(t=this.history)!=null&&t.data?QT((n=(e=this.history)==null?void 0:e.data)==null?void 0:n.cdate):""},lastEditDate(){var t,e,n;return(t=this.history)!=null&&t.data?QT((n=(e=this.history)==null?void 0:e.data)==null?void 0:n.edate):""},authorName(){var t;return(t=this.history)!=null&&t.data?this.history.data.author:""},displayedRows(){var t,e,n;return this.showAll?(t=this.history)==null?void 0:t.rows:(n=(e=this.history)==null?void 0:e.rows)==null?void 0:n.slice(0,this.limitVisible)}},methods:{async getHistoryData(){if(this.prefilledData){this.history=this.prefilledData;return}try{const{data:t}=await tt.get(`/api/widget/history/${this.id}`);this.history=t}catch(t){console.error(t)}},showMore(){this.showAll=!0}},async mounted(){await this.getHistoryData()},watch:{"history.rows":function(t){this.$emit("count-change",t.length)}}}),SW={class:"bg-white"},CW={key:0,class:""},TW={key:0,class:"relative last:pb-0 pb-8 last:after:hidden after:absolute after:top-[38px] after:bottom-0 after:start-[19px] after:w-px after:bg-gray-200 dark:after:bg-neutral-700"},AW={class:"w-[38px]"},MW={class:"flex shrink-0 justify-center items-center w-6 h-7 border border-gray-200 text-sm font-semibold text-gray-800 rounded-md mx-auto dark:border-neutral-700 dark:text-neutral-400"},DW={class:"grow"},IW={class:"text-sm font-semibold text-gray-800 group-focus:text-blue-600 dark:text-neutral-300 dark:group-focus:text-blue-500"},PW={key:1,class:"w-full h-[330px] flex items-center justify-center"};function RW(t,e,n,r,i,s){var p,g,y,v,E,T;const a=h.resolveComponent("VsWidgetHistoryItem"),o=h.resolveComponent("IconUpDown");return h.openBlock(),h.createElementBlock("div",SW,[e[1]||(e[1]=h.createElementVNode("div",{class:"flex items-center justify-between mb-4 gap-x-2"},null,-1)),(g=(p=t.history)==null?void 0:p.rows)!=null&&g.length?(h.openBlock(),h.createElementBlock("ul",CW,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.displayedRows,(D,N)=>{var B,F;return h.openBlock(),h.createElementBlock("li",{class:"list-none mr-[10px]",key:D.uid},[h.createVNode(a,{item:D,class:h.normalizeClass(N===((F=(B=t.history)==null?void 0:B.rows)==null?void 0:F.length)-1?"pb-0 after:hidden":"pb-8 after:absolute after:top-[38px] after:bottom-0 after:start-[19px] after:w-px after:bg-gray-200 dark:after:bg-neutral-700")},null,8,["item","class"])])}),128)),((v=(y=t.history)==null?void 0:y.rows)==null?void 0:v.length)>4&&!t.showAll?(h.openBlock(),h.createElementBlock("div",TW,[h.createElementVNode("button",{type:"button",onClick:e[0]||(e[0]=(...D)=>t.showMore&&t.showMore(...D)),class:"hs-collapse-toggle hs-collapse-open:hidden group w-full text-start flex items-center gap-x-5 focus:outline-none",id:"hs-pro-dnao","aria-expanded":"false","aria-controls":"hs-pro-dnao-button","data-hs-collapse":"#hs-pro-dnao-button"},[h.createElementVNode("span",AW,[h.createElementVNode("span",MW,[h.createVNode(o)])]),h.createElementVNode("span",DW,[h.createElementVNode("span",IW," Показати ще "+h.toDisplayString(((T=(E=t.history)==null?void 0:E.rows)==null?void 0:T.length)-t.limitVisible),1)])])])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createElementBlock("div",PW," Історія відсутні "))])}const OW=Ve(EW,[["render",RW]]),NW={props:{id:{type:String,default:""},data:{type:Object,default:null}},data(){return{mode:"base"}},methods:{getPdfUrl(){const t=`/api/print-template/crm.accounts.doc/${this.id}`;return this.mode==="demo"?t+"?demo=1&format=pdf":this.mode==="preview"?t+"?preview=1&format=pdf":t},setMode(t){this.mode=t},downloadPdf(){const t=document.createElement("a");t.href=`/api/print-template/crm.accounts.doc/${this.id}`,t.download=`document_${this.id}.pdf`,t.click()},downloadWord(){const t=document.createElement("a");t.href=`/api/print-template/crm.accounts.doc/${this.id}?format=word`,t.download=`document_${this.id}.docx`,t.click()}}},BW={class:"flex flex-col h-[calc(100vh-300px)] text-sm"},zW={class:"flex justify-between"},LW={class:"flex gap-4 mb-4"},VW={class:"flex mb-4 border rounded overflow-hidden"},FW=["src"];function $W(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",BW,[h.createElementVNode("div",zW,[h.createElementVNode("div",LW,[h.createElementVNode("button",{onClick:e[0]||(e[0]=(...a)=>s.downloadPdf&&s.downloadPdf(...a)),class:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"}," Завантажити PDF "),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...a)=>s.downloadWord&&s.downloadWord(...a)),class:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600"}," Завантажити Word ")]),h.createElementVNode("div",VW,[h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="base","bg-white":i.mode!=="base"},"px-4 py-2 border-r text-black"]),onClick:e[2]||(e[2]=a=>s.setMode("base"))}," Базовий ",2),h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="demo","bg-white":i.mode!=="demo"},"px-4 py-2 border-r text-black"]),onClick:e[3]||(e[3]=a=>s.setMode("demo"))}," Демо ",2),h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":i.mode==="preview","bg-white":i.mode!=="preview"},"px-4 py-2 text-black"]),onClick:e[4]||(e[4]=a=>s.setMode("preview"))}," Перегляд шаблону ",2)])]),h.createElementVNode("iframe",{src:s.getPdfUrl(),type:"application/pdf",class:"flex-grow w-full border-0 rounded-lg shadow-lg"},null,8,FW)])}const jW=Ve(NW,[["render",$W]]),HW={},UW={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function WW(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",UW,e[0]||(e[0]=[h.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const tA=Ve(HW,[["render",WW]]),qW={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},GW={style:{display:"none"}},YW=["height","width","fill"];function ZW(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock(h.Fragment,null,[(h.openBlock(),h.createElementBlock("svg",GW,e[0]||(e[0]=[h.createElementVNode("symbol",{id:"icon-pencil",viewBox:"0 0 32 32"},[h.createElementVNode("path",{d:"M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z"})],-1)]))),(h.openBlock(),h.createElementBlock("svg",{height:n.height,width:n.width,fill:n.color},e[1]||(e[1]=[h.createElementVNode("use",{"xlink:href":"#icon-pencil"},null,-1)]),8,YW))],64)}const nA=Ve(qW,[["render",ZW]]),XW={class:"hs-dropdown [--placement:bottom-right] inline-flex"},KW={class:"inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},JW={class:"flex flex-col items-start"},QW={key:0,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},eq={class:"p-4"},tq={class:"flex justify-end mt-4 gap-x-3"},nq={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},rq={__name:"vs-widget-table-controls",props:{table:{type:String,default:()=>""},id:{type:String,default:()=>""},form:{type:String,default:()=>""}},emits:["update-table"],setup(t,{emit:e}){const n=t,r=e,i=h.ref(!1),s=h.ref(!1),a=h.ref({}),o=h.ref(null),p=()=>{i.value=!0,document.body.click()},g=async()=>{var E;try{const T=await tt.get(`/api/table/${n.table}/${n.id}`);a.value=T==null?void 0:T.data;const{data:D}=await tt.get(`/api/form/${n.form}`);o.value=((E=D==null?void 0:D.form)==null?void 0:E.schema)||(D==null?void 0:D.form),document.body.click(),s.value=!0}catch{}},y=async()=>{try{await tt.delete(`/api/table/${n.table}/${n.id}`),await r("update-table")}catch(E){console.log(E)}},v=async()=>{try{await tt.put(`/api/table/${n.table}/${n.id}`,a.value),s.value=!1,await r("update-table")}catch{}};return h.onMounted(()=>{n.isForm&&g()}),(E,T)=>{const D=h.resolveComponent("VsPopover"),N=h.resolveComponent("VsConfirm"),B=h.resolveComponent("VsForm"),F=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",XW,[h.createVNode(D,{trigger:"click",placement:"bottom-left"},{reference:h.withCtx(()=>[h.createElementVNode("button",KW,[h.createVNode(Q_,{height:"16",width:"16"})])]),default:h.withCtx(()=>[h.createElementVNode("div",JW,[h.createElementVNode("button",{onClick:g,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(nA,{color:"#000"}),T[5]||(T[5]=h.createTextVNode(" Редагувати "))]),E.isForm?(h.openBlock(),h.createElementBlock("div",QW)):h.createCommentVNode("",!0),h.createElementVNode("button",{onClick:h.withModifiers(p,["stop"]),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(tA),T[6]||(T[6]=h.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])])]),_:1})]),h.createVNode(N,{visible:i.value,"onUpdate:visible":T[1]||(T[1]=X=>i.value=X),size:"small",title:"Ви впевнені?"},{default:h.withCtx(()=>[h.createElementVNode("div",eq,[T[7]||(T[7]=h.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),h.createElementVNode("div",tq,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:T[0]||(T[0]=X=>i.value=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:y}," Так, я впевнена/ий ")])])]),_:1},8,["visible"]),h.createVNode(F,{visible:s.value,"onUpdate:visible":T[4]||(T[4]=X=>s.value=X),title:"Редагувати об'єкт"},{footer:h.withCtx(()=>[h.createElementVNode("div",nq,[h.createElementVNode("button",{onClick:T[3]||(T[3]=X=>s.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),h.createElementVNode("button",{onClick:v,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:h.withCtx(()=>[h.createVNode(B,{scheme:o.value,modelValue:a.value,"onUpdate:modelValue":T[2]||(T[2]=X=>a.value=X),ref:"form"},null,8,["scheme","modelValue"])]),_:1},8,["visible"])],64)}}},iq={},sq={class:"hidden sm:block shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"};function oq(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",sq,e[0]||(e[0]=[h.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"},null,-1)]))}const Qh=Ve(iq,[["render",oq]]),aq={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},lq={__name:"vs-widget-table-add-form",props:{token:{type:String,default:()=>""},form:{type:String,default:()=>""}},setup(t){const e=t,n=h.ref(!1),r=h.ref(null),i=h.ref({}),s=h.ref(),a=async()=>{var p;try{const{data:g}=await tt.get(`/api/form/${e.form}`);r.value=((p=g==null?void 0:g.form)==null?void 0:p.schema)||(g==null?void 0:g.form),n.value=!0}catch{}},o=async()=>{var p;try{await((p=s.value)==null?void 0:p.doValidation()),await tt.post(`/api/table/${e.token}`,i.value)}catch(g){console.log(g)}};return(p,g)=>{const y=h.resolveComponent("VsForm"),v=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:a,class:"h-[34px] w-[34px] shadow bg-blue-500 rounded-lg flex items-center justify-center text-white duration-300 hover:bg-blue-700"},[h.createVNode(Qh)]),h.createVNode(v,{visible:n.value,"onUpdate:visible":g[2]||(g[2]=E=>n.value=E),title:"Створити об'єкт"},{footer:h.withCtx(()=>[h.createElementVNode("div",aq,[h.createElementVNode("button",{onClick:g[1]||(g[1]=E=>n.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),h.createElementVNode("button",{onClick:o,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:h.withCtx(()=>[h.createVNode(y,{scheme:r.value,modelValue:i.value,"onUpdate:modelValue":g[0]||(g[0]=E=>i.value=E),ref_key:"form",ref:s},null,8,["scheme","modelValue"])]),_:1},8,["visible"])],64)}}},cq={props:{row:Object,column:Object,table:String}};function dq(t,e,n,r,i,s){var a,o,p,g,y,v,E,T;return h.openBlock(),h.createBlock(h.resolveDynamicComponent(((a=n.column)==null?void 0:a.format)==="custom"?(o=n.column)==null?void 0:o.component:`table-format-${((g=(p=n.column)==null?void 0:p.format)==null?void 0:g.toLowerCase())||"text"}`),{onUpdateTable:e[0]||(e[0]=D=>t.$emit("update-table")),name:(y=n.column)==null?void 0:y.name,data:n.row,value:(E=n.row)==null?void 0:E[(v=n.column)==null?void 0:v.name],table:n.table,column:n.column,edit:(T=n.column)==null?void 0:T.edit},null,40,["name","data","value","table","column","edit"])}const ef=Ve(cq,[["render",dq]]),uq={},hq={class:"h21yx vs0hq",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function fq(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",hq,e[0]||(e[0]=[h.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)]))}const rA=Ve(uq,[["render",fq]]),pq={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number},table:{type:String},filter:{type:Array},data:{type:Object}},components:{IconFilter:rA},mounted(){setTimeout(()=>{var t,e;typeof this.filter=="string"?(e=this.$refs.filter)==null||e.setFilter(this.filter,(t=this.data)==null?void 0:t[this.filter]):typeof this.filter=="object"&&this.filter.forEach(n=>{var r,i;(i=this.$refs.filter)==null||i.setFilter(n,(r=this.data)==null?void 0:r[n])})})},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},mq={key:0,class:"py-[1px] px-[6px] text-white text-[10px] rounded-full bg-blue-500"},gq={class:"filter-content h-screen bg-white w-[400px] overflow-x-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function yq(t,e,n,r,i,s){const a=h.resolveComponent("IconFilter"),o=h.resolveComponent("VsFilter");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=p=>i.isFilters=!i.isFilters),class:"py-2 px-2.5 max-h-[34px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none"},[h.createVNode(a,{height:"16",width:"16"}),e[4]||(e[4]=h.createTextVNode(" Фільтри ")),n.onFilters?(h.openBlock(),h.createElementBlock("span",mq,h.toDisplayString(n.onFilters),1)):h.createCommentVNode("",!0)]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var p;return[h.withDirectives(h.createElementVNode("div",{onClick:e[3]||(e[3]=(...g)=>s.closeFilter&&s.closeFilter(...g)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.2)]"},[h.createElementVNode("div",gq,[(p=n.scheme)!=null&&p.length?(h.openBlock(),h.createBlock(o,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",token:n.table,name:"filter",footer:!0,background:!0,onFilterChange:e[1]||(e[1]=g=>t.$emit("filterChange",g)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=g=>i.isFilters=!1)},null,8,["scheme","token"])):h.createCommentVNode("",!0)])],512),[[h.vShow,i.isFilters]])]}),_:1})],64)}const bq=Ve(pq,[["render",yq]]),_q={class:"h-full"},xq={class:"flex justify-between mb-[4px]"},vq={class:"flex gap-[4px]"},wq={class:"inline-block w-full align-middle"},kq={class:"relative min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},Eq={class:"dark:bg-neutral-700 sticky top-[-1px] bg-white"},Sq={key:0,class:"w-[70px] bg-white text-center sticky right-[-1px]"},Cq={class:"divide-y divide-gray-200 dark:divide-neutral-700"},Tq={key:0,class:"w-[70px] bg-white text-center sticky right-[-1px] px-[10px]"},Aq={key:0,class:"h-[60px] flex items-center justify-center"},Mq={__name:"vs-widget-table",props:{data:Object,columns:Array,token:String,table:{type:String,default:()=>""},id:{type:String,default:()=>""},api:{type:String,default:()=>""},data:{type:Object,default:()=>null},filter:{type:Array,default:()=>[]}},setup(t){const e=t,n=h.ref(null),r=h.ref([]),i=h.ref(1),s=h.ref(""),a=h.ref(null),o=h.ref(null),p=h.ref(0),g=async()=>{var E;try{const T=await tt.get(`/api/table-filter/${e.table}`);a.value=(E=T==null?void 0:T.data)==null?void 0:E.list;const{data:D}=await tt.get((e!=null&&e.api?e.api:"/api/table-data")+(e.token?`/${e.token}`:e.table&&e.id?`/${e.table}`:""),{params:{page:i.value,limit:10,search:s.value,filter:o.value}});n.value=D,r.value=(D==null?void 0:D.columns)||(e==null?void 0:e.columns)}catch(T){console.error("Ошибка при загрузке данных таблицы:",T)}},y=E=>{i.value=E,g()},v=async({url:E,state:T})=>{var D;o.value=E!=="no-url"?E:null,p.value=(D=Object.entries(T))==null?void 0:D.length,i.value=1,await g()};return h.watch(s,g),h.onMounted(()=>{g()}),(E,T)=>{var B,F,X,te,H,ke,ge,Se,Pe,Ne,at,Je;const D=h.resolveComponent("VsText"),N=h.resolveComponent("VsPagination");return h.openBlock(),h.createElementBlock("div",_q,[h.createElementVNode("div",xq,[h.createVNode(D,{modelValue:s.value,"onUpdate:modelValue":T[0]||(T[0]=mt=>s.value=mt),class:"h-[40px] w-[300px]",placeholder:"Пошук..."},null,8,["modelValue"]),h.createElementVNode("div",vq,[a.value?(h.openBlock(),h.createBlock(bq,{key:0,scheme:a.value,table:t.table,onFilterChange:v,onFilters:p.value,filter:t.filter,data:(F=(B=t.data)==null?void 0:B.rows)==null?void 0:F[0]},null,8,["scheme","table","onFilters","filter","data"])):h.createCommentVNode("",!0),h.createVNode(lq,{token:(X=n.value)==null?void 0:X.addToken,form:(te=n.value)==null?void 0:te.form},null,8,["token","form"])])]),h.createElementVNode("div",{class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:h.normalizeStyle({height:((ke=(H=n.value)==null?void 0:H.rows)==null?void 0:ke.length)>E.limit?"calc(100% - 60px)":"100%"})},[h.createElementVNode("div",wq,[h.createElementVNode("table",kq,[(ge=r.value)!=null&&ge.length?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[h.createElementVNode("thead",Eq,[h.createElementVNode("tr",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.value,(mt,nt)=>(h.openBlock(),h.createElementBlock("th",{key:nt,scope:"col",class:"px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase dark:text-neutral-400 min-w-[200px]"},h.toDisplayString((mt==null?void 0:mt.title)||(mt==null?void 0:mt.description)||(mt==null?void 0:mt.ua)),1))),128)),(Pe=(Se=n.value)==null?void 0:Se.actions)!=null&&Pe.length?(h.openBlock(),h.createElementBlock("th",Sq)):h.createCommentVNode("",!0)])]),h.createElementVNode("tbody",Cq,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((Ne=n.value)==null?void 0:Ne.rows,(mt,nt)=>{var Ct,$t,jt;return h.openBlock(),h.createElementBlock("tr",{key:nt},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.value,(Ot,qt)=>(h.openBlock(),h.createElementBlock("td",{key:qt,class:"px-6 py-4 text-sm text-gray-800 dark:text-neutral-200"},[h.createVNode(ef,{row:mt,column:Ot,table:t.table},null,8,["row","column","table"])]))),128)),($t=(Ct=n.value)==null?void 0:Ct.actions)!=null&&$t.length?(h.openBlock(),h.createElementBlock("td",Tq,[h.createVNode(rq,{id:mt==null?void 0:mt.id,table:t.table,token:mt==null?void 0:mt.token,form:(jt=n.value)==null?void 0:jt.form,onUpdateTable:g},null,8,["id","table","token","form"])])):h.createCommentVNode("",!0)])}),128))])],64)):h.createCommentVNode("",!0)])])],4),((at=n.value)==null?void 0:at.filtered)>20?(h.openBlock(),h.createElementBlock("div",Aq,[h.createVNode(N,{goTo:!1,"default-page":i.value,total:(Je=n.value)==null?void 0:Je.filtered,class:"w-fit",pageSize:10,onPageChange:y,backgroundColor:"#F3F4F6"},null,8,["default-page","total"])])):h.createCommentVNode("",!0)])}}},Dq={},Iq={class:"shrink-0",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Pq(t,e){return h.openBlock(),h.createElementBlock("svg",Iq,e[0]||(e[0]=[h.createElementVNode("path",{d:"M18 6 7 17l-5-5"},null,-1),h.createElementVNode("path",{d:"m22 10-7.5 7.5L13 16"},null,-1)]))}const Rq=Ve(Dq,[["render",Pq]]),Oq={},Nq={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-user"};function Bq(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Nq,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M12 2a5 5 0 1 1 -5 5l.005 -.217a5 5 0 0 1 4.995 -4.783z"},null,-1),h.createElementVNode("path",{d:"M14 14a5 5 0 0 1 5 5v1a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-1a5 5 0 0 1 5 -5h4z"},null,-1)]))}const iA=Ve(Oq,[["render",Bq]]),zq={},Lq={class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Vq(t,e){return h.openBlock(),h.createElementBlock("svg",Lq,e[0]||(e[0]=[h.createElementVNode("polyline",{points:"9 11 12 14 22 4"},null,-1),h.createElementVNode("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"},null,-1)]))}const Fq=Ve(zq,[["render",Vq]]),$q={class:"relative shrink-0"},jq=["src"],Hq={key:1,class:"h-[38px] w-[38px] bg-gray-200 rounded-full flex items-center justify-center"},Uq={key:2,class:"absolute top-4 -start-3 size-2 bg-blue-600 rounded-full dark:bg-blue-500"},Wq={class:"grow"},qq={class:"text-xs text-gray-500 dark:text-neutral-500"},Gq={class:"block text-sm font-medium text-gray-800 dark:text-neutral-300"},Yq={class:"text-sm text-gray-500 dark:text-neutral-500"},Zq={key:0,class:"sm:group-hover:opacity-100 sm:opacity-0 sm:absolute sm:top-5 sm:end-5 inline-block p-0.5 bg-white border border-gray-200 rounded-lg shadow-sm transition ease-out"},Xq={__name:"admin-notification-item",props:{item:Object},emits:["update-notification"],setup(t,{emit:e}){const n=e,r=h.ref(!1),i=()=>r.value=!0,s=()=>r.value=!1,a=async()=>{var o;try{await tt.get(`/api/notification-read/${(o=t.item)==null?void 0:o.id}`),await n("update-notification")}catch{}};return(o,p)=>{var y,v,E,T,D,N;const g=h.resolveComponent("VsPopover");return h.openBlock(),h.createElementBlock("li",{class:h.normalizeClass(["relative group w-full flex gap-x-5 text-start p-5 border-b",[(y=t.item)!=null&&y.read?"bg-gray-100":"bg-white"]]),onMouseenter:i,onMouseleave:s},[h.createElementVNode("div",$q,[(v=t.item)!=null&&v.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"shrink-0 size-[38px] rounded-full",src:(E=t.item)==null?void 0:E.avatar,alt:"Avatar"},null,8,jq)):(h.openBlock(),h.createElementBlock("div",Hq,[h.createVNode(iA)])),(T=t.item)!=null&&T.read?(h.openBlock(),h.createElementBlock("span",Uq)):h.createCommentVNode("",!0)]),h.createElementVNode("div",Wq,[h.createElementVNode("p",qq,[h.createVNode(ab,{name:"cdate",data:t.item},null,8,["data"])]),h.createElementVNode("span",Gq,h.toDisplayString((D=t.item)==null?void 0:D.author),1),h.createElementVNode("p",Yq,h.toDisplayString((N=t.item)==null?void 0:N.subject),1)]),r.value?(h.openBlock(),h.createElementBlock("div",Zq,[h.createVNode(g,{trigger:"hover",placement:"left"},{reference:h.withCtx(()=>[h.createElementVNode("button",{onClick:a,type:"button",class:"hs-tooltip-toggle hs-tooltip relative inline-block size-7 flex shrink-0 justify-center items-center text-gray-500 hover:bg-gray-100 hover:text-gray-800 rounded"},[h.createVNode(Fq)])]),default:h.withCtx(()=>[p[0]||(p[0]=h.createTextVNode(" Прочитати "))]),_:1})])):h.createCommentVNode("",!0)],34)}}},Kq={},Jq={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Qq(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Jq,e[0]||(e[0]=[h.createElementVNode("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"},null,-1),h.createElementVNode("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"},null,-1)]))}const eG=Ve(Kq,[["render",Qq]]),tG={},nG={class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function rG(t,e){return h.openBlock(),h.createElementBlock("svg",nG,e[0]||(e[0]=[h.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1),h.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)]))}const iG=Ve(tG,[["render",rG]]),sG={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},oG={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},aG={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},lG={class:"max-w-sm mx-auto mt-6"},cG={class:"font-medium text-gray-800 dark:text-neutral-200"},dG={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function uG(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",oG,[h.createElementVNode("div",null,[h.createElementVNode("div",aG,[e[0]||(e[0]=h.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),h.createElementVNode("div",lG,[h.createElementVNode("p",cG,h.toDisplayString(n.title),1),h.createElementVNode("p",dG,h.toDisplayString(n.text),1)])])])])}const tx=Ve(sG,[["render",uG]]),hG={key:0,class:"flex absolute top-0 end-0 -mt-1.5 -me-1.5"},fG={class:"relative min-w-[18px] min-h-[18px] inline-flex justify-center items-center text-[10px] bg-red-500 text-white rounded-full px-1"},pG={key:0,class:"w-96 h-[100px] z-[11] absolute top-[40px] right-0"},mG={class:"h-[50px] px-[20px] border-b w-full flex items-center justify-between rounded-t-lg bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)]"},gG={class:"h-[30px] w-[30px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100"},yG={class:"max-h-[400px] bg-white overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300"},bG={key:0},_G={key:1},sA={__name:"admin-notification",setup(t){const e=h.ref(0),n=h.ref([]),r=h.ref(!1),i=h.ref(null),{$notify:s}=h.getCurrentInstance().proxy,a=g=>{i.value&&!i.value.contains(g.target)&&(r.value=!1)};h.watch(r,g=>{g?window.addEventListener("click",a):window.removeEventListener("click",a)}),h.onBeforeUnmount(()=>{window.removeEventListener("click",a)});const o=async()=>{try{const{data:g}=await tt.get("/api/notification");n.value=(g==null?void 0:g.rows)||[]}catch{s({type:"error",message:"При спробі завантаження нотифікацій виникла помилка",title:"Помилка!"})}};o();const p=async()=>{try{await tt.get("/api/notification-read"),await o()}catch{s({type:"error",message:"Виникла помилка",title:"Помилка!"})}};return(g,y)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"notificationRef",ref:i,class:"hs-tooltip [--placement:bottom] inline-block show relative"},[h.createElementVNode("button",{onClick:y[0]||(y[0]=v=>r.value=!r.value),class:"hs-tooltip-toggle relative size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"},[h.createVNode(eG,{height:"24",width:"24"}),e.value?(h.openBlock(),h.createElementBlock("span",hG,[y[1]||(y[1]=h.createElementVNode("span",{class:"absolute inline-flex bg-red-400 rounded-full opacity-75 animate-ping size-full dark:bg-red-600"},null,-1)),h.createElementVNode("span",fG,h.toDisplayString(e.value),1)])):h.createCommentVNode("",!0)]),h.createVNode(h.Transition,null,{default:h.withCtx(()=>{var v;return[r.value?(h.openBlock(),h.createElementBlock("div",pG,[h.createElementVNode("div",mG,[y[2]||(y[2]=h.createElementVNode("nav",{class:"flex"},[h.createElementVNode("button",{type:"button",class:"px-2 py-1.5 relative inline-flex justify-center items-center gap-x-2 text-nowrap hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg focus:outline-none focus:bg-gray-100 after:absolute after:bottom-[-9px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800"}," Всі ")],-1)),h.createElementVNode("button",gG,[h.createVNode(iG)])]),h.createElementVNode("div",yG,[(v=n.value)!=null&&v.length?(h.openBlock(),h.createElementBlock("ul",bG,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.value,E=>(h.openBlock(),h.createBlock(Xq,{key:E==null?void 0:E.id,item:E,onUpdateNotification:o},null,8,["item"]))),128))])):(h.openBlock(),h.createElementBlock("div",_G,[h.createVNode(tx,{class:"[&>div>div]:min-h-[300px]",text:""})]))]),h.createElementVNode("button",{onClick:p,class:"h-[50px] border-t w-full rounded-b-lg bg-white shadow p-4 flex justify-center items-center gap-x-2 text-sm text-gray-500 font-medium sm:rounded-b-lg hover:text-blue-600 focus:outline-none"},[h.createVNode(Rq,{height:"16",width:"16"}),y[3]||(y[3]=h.createTextVNode(" Прочитати усі "))])])):h.createCommentVNode("",!0)]}),_:1})],512))}};var pg,Vt,oA,aA,qd,bc,lA,cA,dA,mg={},uA=[],xG=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function tl(t,e){for(var n in e)t[n]=e[n];return t}function hA(t){var e=t.parentNode;e&&e.removeChild(t)}function ce(t,e,n){var r,i,s,a={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?pg.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)a[s]===void 0&&(a[s]=t.defaultProps[s]);return gg(t,a,r,i,null)}function gg(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++oA};return i==null&&Vt.vnode!=null&&Vt.vnode(s),s}function Mi(){return{current:null}}function Qn(t){return t.children}function vG(t,e,n,r,i){var s;for(s in n)s==="children"||s==="key"||s in e||yg(t,s,null,n[s],r);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||n[s]===e[s]||yg(t,s,e[s],n[s],r)}function fA(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||xG.test(e)?n:n+"px"}function yg(t,e,n,r,i){var s;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||fA(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||fA(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r||t.addEventListener(e,s?mA:pA,s):t.removeEventListener(e,s?mA:pA,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e.indexOf("-")==-1?t.removeAttribute(e):t.setAttribute(e,n))}}function pA(t){qd=!0;try{return this.l[t.type+!1](Vt.event?Vt.event(t):t)}finally{qd=!1}}function mA(t){qd=!0;try{return this.l[t.type+!0](Vt.event?Vt.event(t):t)}finally{qd=!1}}function gs(t,e){this.props=t,this.context=e}function tf(t,e){if(e==null)return t.__?tf(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?tf(t):null}function gA(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return gA(t)}}function wG(t){qd?setTimeout(t):cA(t)}function nx(t){(!t.__d&&(t.__d=!0)&&bc.push(t)&&!bg.__r++||lA!==Vt.debounceRendering)&&((lA=Vt.debounceRendering)||wG)(bg)}function bg(){var t,e,n,r,i,s,a,o;for(bc.sort(function(p,g){return p.__v.__b-g.__v.__b});t=bc.shift();)t.__d&&(e=bc.length,r=void 0,i=void 0,a=(s=(n=t).__v).__e,(o=n.__P)&&(r=[],(i=tl({},s)).__v=s.__v+1,rx(o,s,i,n.__n,o.ownerSVGElement!==void 0,s.__h!=null?[a]:null,r,a??tf(s),s.__h),vA(r,s),s.__e!=a&&gA(s)),bc.length>e&&bc.sort(function(p,g){return p.__v.__b-g.__v.__b}));bg.__r=0}function yA(t,e,n,r,i,s,a,o,p,g){var y,v,E,T,D,N,B,F=r&&r.__k||uA,X=F.length;for(n.__k=[],y=0;y<e.length;y++)if((T=n.__k[y]=(T=e[y])==null||typeof T=="boolean"?null:typeof T=="string"||typeof T=="number"||typeof T=="bigint"?gg(null,T,null,null,T):Array.isArray(T)?gg(Qn,{children:T},null,null,null):T.__b>0?gg(T.type,T.props,T.key,T.ref?T.ref:null,T.__v):T)!=null){if(T.__=n,T.__b=n.__b+1,(E=F[y])===null||E&&T.key==E.key&&T.type===E.type)F[y]=void 0;else for(v=0;v<X;v++){if((E=F[v])&&T.key==E.key&&T.type===E.type){F[v]=void 0;break}E=null}rx(t,T,E=E||mg,i,s,a,o,p,g),D=T.__e,(v=T.ref)&&E.ref!=v&&(B||(B=[]),E.ref&&B.push(E.ref,null,T),B.push(v,T.__c||D,T)),D!=null?(N==null&&(N=D),typeof T.type=="function"&&T.__k===E.__k?T.__d=p=bA(T,p,t):p=_A(t,T,E,F,D,p),typeof n.type=="function"&&(n.__d=p)):p&&E.__e==p&&p.parentNode!=t&&(p=tf(E))}for(n.__e=N,y=X;y--;)F[y]!=null&&(typeof n.type=="function"&&F[y].__e!=null&&F[y].__e==n.__d&&(n.__d=xA(r).nextSibling),kA(F[y],F[y]));if(B)for(y=0;y<B.length;y++)wA(B[y],B[++y],B[++y])}function bA(t,e,n){for(var r,i=t.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=t,e=typeof r.type=="function"?bA(r,e,n):_A(n,r,r,i,r.__e,e));return e}function _g(t,e){return e=e||[],t==null||typeof t=="boolean"||(Array.isArray(t)?t.some(function(n){_g(n,e)}):e.push(t)),e}function _A(t,e,n,r,i,s){var a,o,p;if(e.__d!==void 0)a=e.__d,e.__d=void 0;else if(n==null||i!=s||i.parentNode==null)e:if(s==null||s.parentNode!==t)t.appendChild(i),a=null;else{for(o=s,p=0;(o=o.nextSibling)&&p<r.length;p+=1)if(o==i)break e;t.insertBefore(i,s),a=s}return a!==void 0?a:i.nextSibling}function xA(t){var e,n,r;if(t.type==null||typeof t.type=="string")return t.__e;if(t.__k){for(e=t.__k.length-1;e>=0;e--)if((n=t.__k[e])&&(r=xA(n)))return r}return null}function rx(t,e,n,r,i,s,a,o,p){var g,y,v,E,T,D,N,B,F,X,te,H,ke,ge,Se,Pe=e.type;if(e.constructor!==void 0)return null;n.__h!=null&&(p=n.__h,o=e.__e=n.__e,e.__h=null,s=[o]),(g=Vt.__b)&&g(e);try{e:if(typeof Pe=="function"){if(B=e.props,F=(g=Pe.contextType)&&r[g.__c],X=g?F?F.props.value:g.__:r,n.__c?N=(y=e.__c=n.__c).__=y.__E:("prototype"in Pe&&Pe.prototype.render?e.__c=y=new Pe(B,X):(e.__c=y=new gs(B,X),y.constructor=Pe,y.render=EG),F&&F.sub(y),y.props=B,y.state||(y.state={}),y.context=X,y.__n=r,v=y.__d=!0,y.__h=[],y._sb=[]),y.__s==null&&(y.__s=y.state),Pe.getDerivedStateFromProps!=null&&(y.__s==y.state&&(y.__s=tl({},y.__s)),tl(y.__s,Pe.getDerivedStateFromProps(B,y.__s))),E=y.props,T=y.state,y.__v=e,v)Pe.getDerivedStateFromProps==null&&y.componentWillMount!=null&&y.componentWillMount(),y.componentDidMount!=null&&y.__h.push(y.componentDidMount);else{if(Pe.getDerivedStateFromProps==null&&B!==E&&y.componentWillReceiveProps!=null&&y.componentWillReceiveProps(B,X),!y.__e&&y.shouldComponentUpdate!=null&&y.shouldComponentUpdate(B,y.__s,X)===!1||e.__v===n.__v){for(e.__v!==n.__v&&(y.props=B,y.state=y.__s,y.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(Ne){Ne&&(Ne.__=e)}),te=0;te<y._sb.length;te++)y.__h.push(y._sb[te]);y._sb=[],y.__h.length&&a.push(y);break e}y.componentWillUpdate!=null&&y.componentWillUpdate(B,y.__s,X),y.componentDidUpdate!=null&&y.__h.push(function(){y.componentDidUpdate(E,T,D)})}if(y.context=X,y.props=B,y.__P=t,H=Vt.__r,ke=0,"prototype"in Pe&&Pe.prototype.render){for(y.state=y.__s,y.__d=!1,H&&H(e),g=y.render(y.props,y.state,y.context),ge=0;ge<y._sb.length;ge++)y.__h.push(y._sb[ge]);y._sb=[]}else do y.__d=!1,H&&H(e),g=y.render(y.props,y.state,y.context),y.state=y.__s;while(y.__d&&++ke<25);y.state=y.__s,y.getChildContext!=null&&(r=tl(tl({},r),y.getChildContext())),v||y.getSnapshotBeforeUpdate==null||(D=y.getSnapshotBeforeUpdate(E,T)),Se=g!=null&&g.type===Qn&&g.key==null?g.props.children:g,yA(t,Array.isArray(Se)?Se:[Se],e,n,r,i,s,a,o,p),y.base=e.__e,e.__h=null,y.__h.length&&a.push(y),N&&(y.__E=y.__=null),y.__e=!1}else s==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=kG(n.__e,e,n,r,i,s,a,p);(g=Vt.diffed)&&g(e)}catch(Ne){e.__v=null,(p||s!=null)&&(e.__e=o,e.__h=!!p,s[s.indexOf(o)]=null),Vt.__e(Ne,e,n)}}function vA(t,e){Vt.__c&&Vt.__c(e,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(r){r.call(n)})}catch(r){Vt.__e(r,n.__v)}})}function kG(t,e,n,r,i,s,a,o){var p,g,y,v=n.props,E=e.props,T=e.type,D=0;if(T==="svg"&&(i=!0),s!=null){for(;D<s.length;D++)if((p=s[D])&&"setAttribute"in p==!!T&&(T?p.localName===T:p.nodeType===3)){t=p,s[D]=null;break}}if(t==null){if(T===null)return document.createTextNode(E);t=i?document.createElementNS("http://www.w3.org/2000/svg",T):document.createElement(T,E.is&&E),s=null,o=!1}if(T===null)v===E||o&&t.data===E||(t.data=E);else{if(s=s&&pg.call(t.childNodes),g=(v=n.props||mg).dangerouslySetInnerHTML,y=E.dangerouslySetInnerHTML,!o){if(s!=null)for(v={},D=0;D<t.attributes.length;D++)v[t.attributes[D].name]=t.attributes[D].value;(y||g)&&(y&&(g&&y.__html==g.__html||y.__html===t.innerHTML)||(t.innerHTML=y&&y.__html||""))}if(vG(t,E,v,i,o),y)e.__k=[];else if(D=e.props.children,yA(t,Array.isArray(D)?D:[D],e,n,r,i&&T!=="foreignObject",s,a,s?s[0]:n.__k&&tf(n,0),o),s!=null)for(D=s.length;D--;)s[D]!=null&&hA(s[D]);o||("value"in E&&(D=E.value)!==void 0&&(D!==t.value||T==="progress"&&!D||T==="option"&&D!==v.value)&&yg(t,"value",D,v.value,!1),"checked"in E&&(D=E.checked)!==void 0&&D!==t.checked&&yg(t,"checked",D,v.checked,!1))}return t}function wA(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(r){Vt.__e(r,n)}}function kA(t,e,n){var r,i;if(Vt.unmount&&Vt.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||wA(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){Vt.__e(s,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&kA(r[i],e,n||typeof t.type!="function");n||t.__e==null||hA(t.__e),t.__=t.__e=t.__d=void 0}function EG(t,e,n){return this.constructor(t,n)}function nf(t,e,n){var r,i,s;Vt.__&&Vt.__(t,e),i=(r=typeof n=="function")?null:e.__k,s=[],rx(e,t=(!r&&n||e).__k=ce(Qn,null,[t]),i||mg,mg,e.ownerSVGElement!==void 0,!r&&n?[n]:i?null:e.firstChild?pg.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r),vA(s,t)}function SG(t,e){var n={__c:e="__cC"+dA++,__:t,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(o){o.__e=!0,nx(o)})},this.sub=function(a){i.push(a);var o=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),o&&o.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}pg=uA.slice,Vt={__e:function(t,e,n,r){for(var i,s,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(o){t=o}throw t}},oA=0,aA=function(t){return t!=null&&t.constructor===void 0},qd=!1,gs.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=tl({},this.state),typeof t=="function"&&(t=t(tl({},n),this.props)),t&&tl(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),nx(this))},gs.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),nx(this))},gs.prototype.render=Qn,bc=[],cA=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,bg.__r=0,dA=0;var Io,ix,EA,SA=[],sx=[],CA=Vt.__b,TA=Vt.__r,AA=Vt.diffed,MA=Vt.__c,DA=Vt.unmount;function CG(){for(var t;t=SA.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(xg),t.__H.__h.forEach(ox),t.__H.__h=[]}catch(e){t.__H.__h=[],Vt.__e(e,t.__v)}}Vt.__b=function(t){Io=null,CA&&CA(t)},Vt.__r=function(t){TA&&TA(t);var e=(Io=t.__c).__H;e&&(ix===Io?(e.__h=[],Io.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=sx,n.__N=n.i=void 0})):(e.__h.forEach(xg),e.__h.forEach(ox),e.__h=[])),ix=Io},Vt.diffed=function(t){AA&&AA(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(SA.push(e)!==1&&EA===Vt.requestAnimationFrame||((EA=Vt.requestAnimationFrame)||TG)(CG)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==sx&&(n.__=n.__V),n.i=void 0,n.__V=sx})),ix=Io=null},Vt.__c=function(t,e){e.some(function(n){try{n.__h.forEach(xg),n.__h=n.__h.filter(function(r){return!r.__||ox(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Vt.__e(r,n.__v)}}),MA&&MA(t,e)},Vt.unmount=function(t){DA&&DA(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{xg(r)}catch(i){e=i}}),n.__H=void 0,e&&Vt.__e(e,n.__v))};var IA=typeof requestAnimationFrame=="function";function TG(t){var e,n=function(){clearTimeout(r),IA&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);IA&&(e=requestAnimationFrame(n))}function xg(t){var e=Io,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Io=e}function ox(t){var e=Io;t.__c=t.__(),Io=e}function AG(t,e){for(var n in e)t[n]=e[n];return t}function PA(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function RA(t){this.props=t}(RA.prototype=new gs).isPureReactComponent=!0,RA.prototype.shouldComponentUpdate=function(t,e){return PA(this.props,t)||PA(this.state,e)};var OA=Vt.__b;Vt.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),OA&&OA(t)};var MG=Vt.__e;Vt.__e=function(t,e,n,r){if(t.then){for(var i,s=e;s=s.__;)if((i=s.__c)&&i.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e)}MG(t,e,n,r)};var NA=Vt.unmount;function BA(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=AG({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return BA(r,e,n)})),t}function zA(t,e,n){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return zA(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=n)),t}function ax(){this.__u=0,this.t=null,this.__b=null}function LA(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function vg(){this.u=null,this.o=null}Vt.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&t.__h===!0&&(t.type=null),NA&&NA(t)},(ax.prototype=new gs).__c=function(t,e){var n=e.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var i=LA(r.__v),s=!1,a=function(){s||(s=!0,n.__R=null,i?i(o):o())};n.__R=a;var o=function(){if(!--r.__u){if(r.state.__a){var g=r.state.__a;r.__v.__k[0]=zA(g,g.__c.__P,g.__c.__O)}var y;for(r.setState({__a:r.__b=null});y=r.t.pop();)y.forceUpdate()}},p=e.__h===!0;r.__u++||p||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},ax.prototype.componentWillUnmount=function(){this.t=[]},ax.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=BA(this.__b,n,r.__O=r.__P)}this.__b=null}var i=e.__a&&ce(Qn,null,t.fallback);return i&&(i.__h=null),[ce(Qn,null,e.__a?null:t.children),i]};var VA=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function DG(t){return this.getChildContext=function(){return t.context},t.children}function IG(t){var e=this,n=t.i;e.componentWillUnmount=function(){nf(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),e.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),e.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.i.removeChild(r)}}),nf(ce(DG,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}function PG(t,e){var n=ce(IG,{__v:t,i:e});return n.containerInfo=e,n}(vg.prototype=new gs).__a=function(t){var e=this,n=LA(e.__v),r=e.o.get(t);return r[0]++,function(i){var s=function(){e.props.revealOrder?(r.push(i),VA(e,t,r)):i()};n?n(s):s()}},vg.prototype.render=function(t){this.u=null,this.o=new Map;var e=_g(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},vg.prototype.componentDidUpdate=vg.prototype.componentDidMount=function(){var t=this;this.o.forEach(function(e,n){VA(t,n,e)})};var RG=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,OG=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,NG=typeof document<"u",BG=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(t)};gs.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(gs.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var FA=Vt.event;function zG(){}function LG(){return this.cancelBubble}function VG(){return this.defaultPrevented}Vt.event=function(t){return FA&&(t=FA(t)),t.persist=zG,t.isPropagationStopped=LG,t.isDefaultPrevented=VG,t.nativeEvent=t};var $A={configurable:!0,get:function(){return this.class}},jA=Vt.vnode;Vt.vnode=function(t){var e=t.type,n=t.props,r=n;if(typeof e=="string"){var i=e.indexOf("-")===-1;for(var s in r={},n){var a=n[s];NG&&s==="children"&&e==="noscript"||s==="value"&&"defaultValue"in n&&a==null||(s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&a===!0?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+e)&&!BG(n.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():i&&OG.test(s)?s=s.replace(/[A-Z0-9]/g,"-$&").toLowerCase():a===null&&(a=void 0),/^oninput$/i.test(s)&&(s=s.toLowerCase(),r[s]&&(s="oninputCapture")),r[s]=a)}e=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=_g(n.children).forEach(function(o){o.props.selected=r.value.indexOf(o.props.value)!=-1})),e=="select"&&r.defaultValue!=null&&(r.value=_g(n.children).forEach(function(o){o.props.selected=r.multiple?r.defaultValue.indexOf(o.props.value)!=-1:r.defaultValue==o.props.value})),t.props=r,n.class!=n.className&&($A.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",$A))}t.$$typeof=RG,jA&&jA(t)};var HA=Vt.__r;Vt.__r=function(t){HA&&HA(t),t.__c};const UA=[],lx=new Map;function wg(t){UA.push(t),lx.forEach(e=>{qA(e,t)})}function FG(t){t.isConnected&&t.getRootNode&&WA(t.getRootNode())}function WA(t){let e=lx.get(t);if(!e||!e.isConnected){if(e=t.querySelector("style[data-fullcalendar]"),!e){e=document.createElement("style"),e.setAttribute("data-fullcalendar","");const n=jG();n&&(e.nonce=n);const r=t===document?document.head:t,i=t===document?r.querySelector("script,link[rel=stylesheet],link[as=style],style"):r.firstChild;r.insertBefore(e,i)}lx.set(t,e),$G(e)}}function $G(t){for(const e of UA)qA(t,e)}function qA(t,e){const{sheet:n}=t,r=n.cssRules.length;e.split("}").forEach((i,s)=>{i=i.trim(),i&&n.insertRule(i+"}",r+s)})}let cx;function jG(){return cx===void 0&&(cx=HG()),cx}function HG(){const t=document.querySelector('meta[name="csp-nonce"]');if(t&&t.hasAttribute("content"))return t.getAttribute("content");const e=document.querySelector("script[nonce]");return e&&e.nonce||""}typeof document<"u"&&WA(document);var UG=':root{--fc-small-font-size:.85em;--fc-page-bg-color:#fff;--fc-neutral-bg-color:hsla(0,0%,82%,.3);--fc-neutral-text-color:grey;--fc-border-color:#ddd;--fc-button-text-color:#fff;--fc-button-bg-color:#2c3e50;--fc-button-border-color:#2c3e50;--fc-button-hover-bg-color:#1e2b37;--fc-button-hover-border-color:#1a252f;--fc-button-active-bg-color:#1a252f;--fc-button-active-border-color:#151e27;--fc-event-bg-color:#3788d8;--fc-event-border-color:#3788d8;--fc-event-text-color:#fff;--fc-event-selected-overlay-color:rgba(0,0,0,.25);--fc-more-link-bg-color:#d0d0d0;--fc-more-link-text-color:inherit;--fc-event-resizer-thickness:8px;--fc-event-resizer-dot-total-width:8px;--fc-event-resizer-dot-border-width:1px;--fc-non-business-color:hsla(0,0%,84%,.3);--fc-bg-event-color:#8fdf82;--fc-bg-event-opacity:0.3;--fc-highlight-color:rgba(188,232,241,.3);--fc-today-bg-color:rgba(255,220,40,.15);--fc-now-indicator-color:red}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc{display:flex;flex-direction:column;font-size:1em}.fc,.fc *,.fc :after,.fc :before{box-sizing:border-box}.fc table{border-collapse:collapse;border-spacing:0;font-size:1em}.fc th{text-align:center}.fc td,.fc th{padding:0;vertical-align:top}.fc a[data-navlink]{cursor:pointer}.fc a[data-navlink]:hover{text-decoration:underline}.fc-direction-ltr{direction:ltr;text-align:left}.fc-direction-rtl{direction:rtl;text-align:right}.fc-theme-standard td,.fc-theme-standard th{border:1px solid var(--fc-border-color)}.fc-liquid-hack td,.fc-liquid-hack th{position:relative}@font-face{font-family:fcicons;font-style:normal;font-weight:400;src:url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBfAAAAC8AAAAYGNtYXAXVtKNAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZgYydxIAAAF4AAAFNGhlYWQUJ7cIAAAGrAAAADZoaGVhB20DzAAABuQAAAAkaG10eCIABhQAAAcIAAAALGxvY2ED4AU6AAAHNAAAABhtYXhwAA8AjAAAB0wAAAAgbmFtZXsr690AAAdsAAABhnBvc3QAAwAAAAAI9AAAACAAAwPAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpBgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6Qb//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAWIAjQKeAskAEwAAJSc3NjQnJiIHAQYUFwEWMjc2NCcCnuLiDQ0MJAz/AA0NAQAMJAwNDcni4gwjDQwM/wANIwz/AA0NDCMNAAAAAQFiAI0CngLJABMAACUBNjQnASYiBwYUHwEHBhQXFjI3AZ4BAA0N/wAMJAwNDeLiDQ0MJAyNAQAMIw0BAAwMDSMM4uINIwwNDQAAAAIA4gC3Ax4CngATACcAACUnNzY0JyYiDwEGFB8BFjI3NjQnISc3NjQnJiIPAQYUHwEWMjc2NCcB87e3DQ0MIw3VDQ3VDSMMDQ0BK7e3DQ0MJAzVDQ3VDCQMDQ3zuLcMJAwNDdUNIwzWDAwNIwy4twwkDA0N1Q0jDNYMDA0jDAAAAgDiALcDHgKeABMAJwAAJTc2NC8BJiIHBhQfAQcGFBcWMjchNzY0LwEmIgcGFB8BBwYUFxYyNwJJ1Q0N1Q0jDA0Nt7cNDQwjDf7V1Q0N1QwkDA0Nt7cNDQwkDLfWDCMN1Q0NDCQMt7gMIw0MDNYMIw3VDQ0MJAy3uAwjDQwMAAADAFUAAAOrA1UAMwBoAHcAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMhMjY1NCYjISIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAAVYRGRkR/qoRGRkRA1UFBAUOCQkVDAsZDf2rDRkLDBUJCA4FBQUFBQUOCQgVDAsZDQJVDRkLDBUJCQ4FBAVVAgECBQMCBwQECAX9qwQJAwQHAwMFAQICAgIBBQMDBwQDCQQCVQUIBAQHAgMFAgEC/oAZEhEZGRESGQAAAAADAFUAAAOrA1UAMwBoAIkAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMzFRQWMzI2PQEzMjY1NCYrATU0JiMiBh0BIyIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAgBkSEhmAERkZEYAZEhIZgBEZGREDVQUEBQ4JCRUMCxkN/asNGQsMFQkIDgUFBQUFBQ4JCBUMCxkNAlUNGQsMFQkJDgUEBVUCAQIFAwIHBAQIBf2rBAkDBAcDAwUBAgICAgEFAwMHBAMJBAJVBQgEBAcCAwUCAQL+gIASGRkSgBkSERmAEhkZEoAZERIZAAABAOIAjQMeAskAIAAAExcHBhQXFjI/ARcWMjc2NC8BNzY0JyYiDwEnJiIHBhQX4uLiDQ0MJAzi4gwkDA0N4uINDQwkDOLiDCQMDQ0CjeLiDSMMDQ3h4Q0NDCMN4uIMIw0MDOLiDAwNIwwAAAABAAAAAQAAa5n0y18PPPUACwQAAAAAANivOVsAAAAA2K85WwAAAAADqwNVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAOrAAEAAAAAAAAAAAAAAAAAAAALBAAAAAAAAAAAAAAAAgAAAAQAAWIEAAFiBAAA4gQAAOIEAABVBAAAVQQAAOIAAAAAAAoAFAAeAEQAagCqAOoBngJkApoAAQAAAAsAigADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGZjaWNvbnMAZgBjAGkAYwBvAG4Ac1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGZjaWNvbnMAZgBjAGkAYwBvAG4Ac2ZjaWNvbnMAZgBjAGkAYwBvAG4Ac1JlZ3VsYXIAUgBlAGcAdQBsAGEAcmZjaWNvbnMAZgBjAGkAYwBvAG4Ac0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") format("truetype")}.fc-icon{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:fcicons!important;font-style:normal;font-variant:normal;font-weight:400;height:1em;line-height:1;text-align:center;text-transform:none;-moz-user-select:none;user-select:none;width:1em}.fc-icon-chevron-left:before{content:"\\e900"}.fc-icon-chevron-right:before{content:"\\e901"}.fc-icon-chevrons-left:before{content:"\\e902"}.fc-icon-chevrons-right:before{content:"\\e903"}.fc-icon-minus-square:before{content:"\\e904"}.fc-icon-plus-square:before{content:"\\e905"}.fc-icon-x:before{content:"\\e906"}.fc .fc-button{border-radius:0;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none}.fc .fc-button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.fc .fc-button{-webkit-appearance:button}.fc .fc-button:not(:disabled){cursor:pointer}.fc .fc-button{background-color:transparent;border:1px solid transparent;border-radius:.25em;display:inline-block;font-size:1em;font-weight:400;line-height:1.5;padding:.4em .65em;text-align:center;-moz-user-select:none;user-select:none;vertical-align:middle}.fc .fc-button:hover{text-decoration:none}.fc .fc-button:focus{box-shadow:0 0 0 .2rem rgba(44,62,80,.25);outline:0}.fc .fc-button:disabled{opacity:.65}.fc .fc-button-primary{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:hover{background-color:var(--fc-button-hover-bg-color);border-color:var(--fc-button-hover-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:disabled{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button-primary:not(:disabled).fc-button-active,.fc .fc-button-primary:not(:disabled):active{background-color:var(--fc-button-active-bg-color);border-color:var(--fc-button-active-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:not(:disabled).fc-button-active:focus,.fc .fc-button-primary:not(:disabled):active:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button .fc-icon{font-size:1.5em;vertical-align:middle}.fc .fc-button-group{display:inline-flex;position:relative;vertical-align:middle}.fc .fc-button-group>.fc-button{flex:1 1 auto;position:relative}.fc .fc-button-group>.fc-button.fc-button-active,.fc .fc-button-group>.fc-button:active,.fc .fc-button-group>.fc-button:focus,.fc .fc-button-group>.fc-button:hover{z-index:1}.fc-direction-ltr .fc-button-group>.fc-button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.fc-direction-ltr .fc-button-group>.fc-button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.fc-direction-rtl .fc-button-group>.fc-button:not(:first-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.fc-direction-rtl .fc-button-group>.fc-button:not(:last-child){border-bottom-left-radius:0;border-top-left-radius:0}.fc .fc-toolbar{align-items:center;display:flex;justify-content:space-between}.fc .fc-toolbar.fc-header-toolbar{margin-bottom:1.5em}.fc .fc-toolbar.fc-footer-toolbar{margin-top:1.5em}.fc .fc-toolbar-title{font-size:1.75em;margin:0}.fc-direction-ltr .fc-toolbar>*>:not(:first-child){margin-left:.75em}.fc-direction-rtl .fc-toolbar>*>:not(:first-child){margin-right:.75em}.fc-direction-rtl .fc-toolbar-ltr{flex-direction:row-reverse}.fc .fc-scroller{-webkit-overflow-scrolling:touch;position:relative}.fc .fc-scroller-liquid{height:100%}.fc .fc-scroller-liquid-absolute{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-scroller-harness{direction:ltr;overflow:hidden;position:relative}.fc .fc-scroller-harness-liquid{height:100%}.fc-direction-rtl .fc-scroller-harness>.fc-scroller{direction:rtl}.fc-theme-standard .fc-scrollgrid{border:1px solid var(--fc-border-color)}.fc .fc-scrollgrid,.fc .fc-scrollgrid table{table-layout:fixed;width:100%}.fc .fc-scrollgrid table{border-left-style:hidden;border-right-style:hidden;border-top-style:hidden}.fc .fc-scrollgrid{border-bottom-width:0;border-collapse:separate;border-right-width:0}.fc .fc-scrollgrid-liquid{height:100%}.fc .fc-scrollgrid-section,.fc .fc-scrollgrid-section table,.fc .fc-scrollgrid-section>td{height:1px}.fc .fc-scrollgrid-section-liquid>td{height:100%}.fc .fc-scrollgrid-section>*{border-left-width:0;border-top-width:0}.fc .fc-scrollgrid-section-footer>*,.fc .fc-scrollgrid-section-header>*{border-bottom-width:0}.fc .fc-scrollgrid-section-body table,.fc .fc-scrollgrid-section-footer table{border-bottom-style:hidden}.fc .fc-scrollgrid-section-sticky>*{background:var(--fc-page-bg-color);position:sticky;z-index:3}.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>*{top:0}.fc .fc-scrollgrid-section-footer.fc-scrollgrid-section-sticky>*{bottom:0}.fc .fc-scrollgrid-sticky-shim{height:1px;margin-bottom:-1px}.fc-sticky{position:sticky}.fc .fc-view-harness{flex-grow:1;position:relative}.fc .fc-view-harness-active>.fc-view{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-col-header-cell-cushion{display:inline-block;padding:2px 4px}.fc .fc-bg-event,.fc .fc-highlight,.fc .fc-non-business{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-non-business{background:var(--fc-non-business-color)}.fc .fc-bg-event{background:var(--fc-bg-event-color);opacity:var(--fc-bg-event-opacity)}.fc .fc-bg-event .fc-event-title{font-size:var(--fc-small-font-size);font-style:italic;margin:.5em}.fc .fc-highlight{background:var(--fc-highlight-color)}.fc .fc-cell-shaded,.fc .fc-day-disabled{background:var(--fc-neutral-bg-color)}a.fc-event,a.fc-event:hover{text-decoration:none}.fc-event.fc-event-draggable,.fc-event[href]{cursor:pointer}.fc-event .fc-event-main{position:relative;z-index:2}.fc-event-dragging:not(.fc-event-selected){opacity:.75}.fc-event-dragging.fc-event-selected{box-shadow:0 2px 7px rgba(0,0,0,.3)}.fc-event .fc-event-resizer{display:none;position:absolute;z-index:4}.fc-event-selected .fc-event-resizer,.fc-event:hover .fc-event-resizer{display:block}.fc-event-selected .fc-event-resizer{background:var(--fc-page-bg-color);border-color:inherit;border-radius:calc(var(--fc-event-resizer-dot-total-width)/2);border-style:solid;border-width:var(--fc-event-resizer-dot-border-width);height:var(--fc-event-resizer-dot-total-width);width:var(--fc-event-resizer-dot-total-width)}.fc-event-selected .fc-event-resizer:before{bottom:-20px;content:"";left:-20px;position:absolute;right:-20px;top:-20px}.fc-event-selected,.fc-event:focus{box-shadow:0 2px 5px rgba(0,0,0,.2)}.fc-event-selected:before,.fc-event:focus:before{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:3}.fc-event-selected:after,.fc-event:focus:after{background:var(--fc-event-selected-overlay-color);bottom:-1px;content:"";left:-1px;position:absolute;right:-1px;top:-1px;z-index:1}.fc-h-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-h-event .fc-event-main{color:var(--fc-event-text-color)}.fc-h-event .fc-event-main-frame{display:flex}.fc-h-event .fc-event-time{max-width:100%;overflow:hidden}.fc-h-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-width:0}.fc-h-event .fc-event-title{display:inline-block;left:0;max-width:100%;overflow:hidden;right:0;vertical-align:top}.fc-h-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-bottom-left-radius:0;border-left-width:0;border-top-left-radius:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.fc-h-event:not(.fc-event-selected) .fc-event-resizer{bottom:0;top:0;width:var(--fc-event-resizer-thickness)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end{cursor:w-resize;left:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start{cursor:e-resize;right:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-h-event.fc-event-selected .fc-event-resizer{margin-top:calc(var(--fc-event-resizer-dot-total-width)*-.5);top:50%}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-start,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-end{left:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-end,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-start{right:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc .fc-popover{box-shadow:0 2px 6px rgba(0,0,0,.15);position:absolute;z-index:9999}.fc .fc-popover-header{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:3px 4px}.fc .fc-popover-title{margin:0 2px}.fc .fc-popover-close{cursor:pointer;font-size:1.1em;opacity:.65}.fc-theme-standard .fc-popover{background:var(--fc-page-bg-color);border:1px solid var(--fc-border-color)}.fc-theme-standard .fc-popover-header{background:var(--fc-neutral-bg-color)}';wg(UG);class dx{constructor(e){this.drainedOption=e,this.isRunning=!1,this.isDirty=!1,this.pauseDepths={},this.timeoutId=0}request(e){this.isDirty=!0,this.isPaused()||(this.clearTimeout(),e==null?this.tryDrain():this.timeoutId=setTimeout(this.tryDrain.bind(this),e))}pause(e=""){let{pauseDepths:n}=this;n[e]=(n[e]||0)+1,this.clearTimeout()}resume(e="",n){let{pauseDepths:r}=this;e in r&&(n?delete r[e]:(r[e]-=1,r[e]<=0&&delete r[e]),this.tryDrain())}isPaused(){return Object.keys(this.pauseDepths).length}tryDrain(){if(!this.isRunning&&!this.isPaused()){for(this.isRunning=!0;this.isDirty;)this.isDirty=!1,this.drained();this.isRunning=!1}}clear(){this.clearTimeout(),this.isDirty=!1,this.pauseDepths={}}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=0)}drained(){this.drainedOption&&this.drainedOption()}}function ux(t){t.parentNode&&t.parentNode.removeChild(t)}function gi(t,e){if(t.closest)return t.closest(e);if(!document.documentElement.contains(t))return null;do{if(WG(t,e))return t;t=t.parentElement||t.parentNode}while(t!==null&&t.nodeType===1);return null}function WG(t,e){return(t.matches||t.matchesSelector||t.msMatchesSelector).call(t,e)}function qG(t,e){let n=t instanceof HTMLElement?[t]:t,r=[];for(let i=0;i<n.length;i+=1){let s=n[i].querySelectorAll(e);for(let a=0;a<s.length;a+=1)r.push(s[a])}return r}const GG=/(top|left|right|bottom|width|height)$/i;function rf(t,e){for(let n in e)GA(t,n,e[n])}function GA(t,e,n){n==null?t.style[e]="":typeof n=="number"&&GG.test(e)?t.style[e]=`${n}px`:t.style[e]=n}function YA(t){var e,n;return(n=(e=t.composedPath)===null||e===void 0?void 0:e.call(t)[0])!==null&&n!==void 0?n:t.target}let ZA=0;function nl(){return ZA+=1,"fc-dom-"+ZA}function kg(t){t.preventDefault()}function YG(t,e){return n=>{let r=gi(n.target,t);r&&e.call(r,n,r)}}function XA(t,e,n,r){let i=YG(n,r);return t.addEventListener(e,i),()=>{t.removeEventListener(e,i)}}function ZG(t,e,n,r){let i;return XA(t,"mouseover",e,(s,a)=>{if(a!==i){i=a,n(s,a);let o=p=>{i=null,r(p,a),a.removeEventListener("mouseleave",o)};a.addEventListener("mouseleave",o)}})}const KA=["webkitTransitionEnd","otransitionend","oTransitionEnd","msTransitionEnd","transitionend"];function XG(t,e){let n=r=>{e(r),KA.forEach(i=>{t.removeEventListener(i,n)})};KA.forEach(r=>{t.addEventListener(r,n)})}function JA(t){return Object.assign({onClick:t},QA(t))}function QA(t){return{tabIndex:0,onKeyDown(e){(e.key==="Enter"||e.key===" ")&&(t(e),e.preventDefault())}}}let eM=0;function _c(){return eM+=1,String(eM)}function hx(){document.body.classList.add("fc-not-allowed")}function fx(){document.body.classList.remove("fc-not-allowed")}function KG(t){t.style.userSelect="none",t.style.webkitUserSelect="none",t.addEventListener("selectstart",kg)}function JG(t){t.style.userSelect="",t.style.webkitUserSelect="",t.removeEventListener("selectstart",kg)}function QG(t){t.addEventListener("contextmenu",kg)}function eY(t){t.removeEventListener("contextmenu",kg)}function tY(t){let e=[],n=[],r,i;for(typeof t=="string"?n=t.split(/\s*,\s*/):typeof t=="function"?n=[t]:Array.isArray(t)&&(n=t),r=0;r<n.length;r+=1)i=n[r],typeof i=="string"?e.push(i.charAt(0)==="-"?{field:i.substring(1),order:-1}:{field:i,order:1}):typeof i=="function"&&e.push({func:i});return e}function nY(t,e,n){let r,i;for(r=0;r<n.length;r+=1)if(i=rY(t,e,n[r]),i)return i;return 0}function rY(t,e,n){return n.func?n.func(t,e):iY(t[n.field],e[n.field])*(n.order||1)}function iY(t,e){return!t&&!e?0:e==null?-1:t==null?1:typeof t=="string"||typeof e=="string"?String(t).localeCompare(String(e)):t-e}function Gd(t,e){let n=String(t);return"000".substr(0,e-n.length)+n}function sf(t,e,n){return typeof t=="function"?t(...e):typeof t=="string"?e.reduce((r,i,s)=>r.replace("$"+s,i||""),t):n}function sY(t,e){return t-e}function Eg(t){return t%1===0}function oY(t){let e=t.querySelector(".fc-scrollgrid-shrink-frame"),n=t.querySelector(".fc-scrollgrid-shrink-cushion");if(!e)throw new Error("needs fc-scrollgrid-shrink-frame className");if(!n)throw new Error("needs fc-scrollgrid-shrink-cushion className");return t.getBoundingClientRect().width-e.getBoundingClientRect().width+n.getBoundingClientRect().width}const tM=["years","months","days","milliseconds"],aY=/^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/;function gn(t,e){return typeof t=="string"?lY(t):typeof t=="object"&&t?nM(t):typeof t=="number"?nM({[e||"milliseconds"]:t}):null}function lY(t){let e=aY.exec(t);if(e){let n=e[1]?-1:1;return{years:0,months:0,days:n*(e[2]?parseInt(e[2],10):0),milliseconds:n*((e[3]?parseInt(e[3],10):0)*60*60*1e3+(e[4]?parseInt(e[4],10):0)*60*1e3+(e[5]?parseInt(e[5],10):0)*1e3+(e[6]?parseInt(e[6],10):0))}}return null}function nM(t){let e={years:t.years||t.year||0,months:t.months||t.month||0,days:t.days||t.day||0,milliseconds:(t.hours||t.hour||0)*60*60*1e3+(t.minutes||t.minute||0)*60*1e3+(t.seconds||t.second||0)*1e3+(t.milliseconds||t.millisecond||t.ms||0)},n=t.weeks||t.week;return n&&(e.days+=n*7,e.specifiedWeeks=!0),e}function cY(t,e){return t.years===e.years&&t.months===e.months&&t.days===e.days&&t.milliseconds===e.milliseconds}function px(t,e){return{years:t.years+e.years,months:t.months+e.months,days:t.days+e.days,milliseconds:t.milliseconds+e.milliseconds}}function dY(t,e){return{years:t.years-e.years,months:t.months-e.months,days:t.days-e.days,milliseconds:t.milliseconds-e.milliseconds}}function uY(t,e){return{years:t.years*e,months:t.months*e,days:t.days*e,milliseconds:t.milliseconds*e}}function hY(t){return Yd(t)/365}function fY(t){return Yd(t)/30}function Yd(t){return lo(t)/864e5}function lo(t){return t.years*(365*864e5)+t.months*(30*864e5)+t.days*864e5+t.milliseconds}function mx(t,e){let n=null;for(let r=0;r<tM.length;r+=1){let i=tM[r];if(e[i]){let s=t[i]/e[i];if(!Eg(s)||n!==null&&n!==s)return null;n=s}else if(t[i])return null}return n}function gx(t){let e=t.milliseconds;if(e){if(e%1e3!==0)return{unit:"millisecond",value:e};if(e%(1e3*60)!==0)return{unit:"second",value:e/1e3};if(e%(1e3*60*60)!==0)return{unit:"minute",value:e/(1e3*60)};if(e)return{unit:"hour",value:e/(1e3*60*60)}}return t.days?t.specifiedWeeks&&t.days%7===0?{unit:"week",value:t.days/7}:{unit:"day",value:t.days}:t.months?{unit:"month",value:t.months}:t.years?{unit:"year",value:t.years}:{unit:"millisecond",value:0}}function rl(t,e,n){if(t===e)return!0;let r=t.length,i;if(r!==e.length)return!1;for(i=0;i<r;i+=1)if(!(n?n(t[i],e[i]):t[i]===e[i]))return!1;return!0}const pY=["sun","mon","tue","wed","thu","fri","sat"];function rM(t,e){let n=ol(t);return n[2]+=e*7,Qi(n)}function Ur(t,e){let n=ol(t);return n[2]+=e,Qi(n)}function il(t,e){let n=ol(t);return n[6]+=e,Qi(n)}function mY(t,e){return sl(t,e)/7}function sl(t,e){return(e.valueOf()-t.valueOf())/(1e3*60*60*24)}function gY(t,e){return(e.valueOf()-t.valueOf())/(1e3*60*60)}function yY(t,e){return(e.valueOf()-t.valueOf())/(1e3*60)}function bY(t,e){return(e.valueOf()-t.valueOf())/1e3}function _Y(t,e){let n=er(t),r=er(e);return{years:0,months:0,days:Math.round(sl(n,r)),milliseconds:e.valueOf()-r.valueOf()-(t.valueOf()-n.valueOf())}}function xY(t,e){let n=Sg(t,e);return n!==null&&n%7===0?n/7:null}function Sg(t,e){return al(t)===al(e)?Math.round(sl(t,e)):null}function er(t){return Qi([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()])}function vY(t){return Qi([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()])}function wY(t){return Qi([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes()])}function kY(t){return Qi([t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()])}function EY(t,e,n){let r=t.getUTCFullYear(),i=yx(t,r,e,n);if(i<1)return yx(t,r-1,e,n);let s=yx(t,r+1,e,n);return s>=1?Math.min(i,s):i}function yx(t,e,n,r){let i=Qi([e,0,1+SY(e,n,r)]),s=er(t),a=Math.round(sl(i,s));return Math.floor(a/7)+1}function SY(t,e,n){let r=7+e-n;return-((7+Qi([t,0,r]).getUTCDay()-e)%7)+r-1}function iM(t){return[t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()]}function sM(t){return new Date(t[0],t[1]||0,t[2]==null?1:t[2],t[3]||0,t[4]||0,t[5]||0)}function ol(t){return[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()]}function Qi(t){return t.length===1&&(t=t.concat([0])),new Date(Date.UTC(...t))}function oM(t){return!isNaN(t.valueOf())}function al(t){return t.getUTCHours()*1e3*60*60+t.getUTCMinutes()*1e3*60+t.getUTCSeconds()*1e3+t.getUTCMilliseconds()}function aM(t,e,n=!1){let r=t.toISOString();return r=r.replace(".000",""),n&&(r=r.replace("T00:00:00Z","")),r.length>10&&(e==null?r=r.replace("Z",""):e!==0&&(r=r.replace("Z",bx(e,!0)))),r}function of(t){return t.toISOString().replace(/T.*$/,"")}function CY(t){return t.toISOString().match(/^\d{4}-\d{2}/)[0]}function TY(t){return Gd(t.getUTCHours(),2)+":"+Gd(t.getUTCMinutes(),2)+":"+Gd(t.getUTCSeconds(),2)}function bx(t,e=!1){let n=t<0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),s=Math.round(r%60);return e?`${n+Gd(i,2)}:${Gd(s,2)}`:`GMT${n}${i}${s?`:${Gd(s,2)}`:""}`}function Ft(t,e,n){let r,i;return function(...s){if(!r)i=t.apply(this,s);else if(!rl(r,s)){let a=t.apply(this,s);(!e||!e(a,i))&&(i=a)}return r=s,i}}function Cg(t,e,n){let r,i;return s=>(r?Po(r,s)||(i=t.call(this,s)):i=t.call(this,s),r=s,i)}const lM={week:3,separator:0,omitZeroMinute:0,meridiem:0,omitCommas:0},Tg={timeZoneName:7,era:6,year:5,month:4,day:2,weekday:2,hour:1,minute:1,second:1},Ag=/\s*([ap])\.?m\.?/i,AY=/,/g,MY=/\s+/g,DY=/\u200e/g,IY=/UTC|GMT/;class PY{constructor(e){let n={},r={},i=0;for(let s in e)s in lM?(r[s]=e[s],i=Math.max(lM[s],i)):(n[s]=e[s],s in Tg&&(i=Math.max(Tg[s],i)));this.standardDateProps=n,this.extendedSettings=r,this.severity=i,this.buildFormattingFunc=Ft(cM)}format(e,n){return this.buildFormattingFunc(this.standardDateProps,this.extendedSettings,n)(e)}formatRange(e,n,r,i){let{standardDateProps:s,extendedSettings:a}=this,o=LY(e.marker,n.marker,r.calendarSystem);if(!o)return this.format(e,r);let p=o;p>1&&(s.year==="numeric"||s.year==="2-digit")&&(s.month==="numeric"||s.month==="2-digit")&&(s.day==="numeric"||s.day==="2-digit")&&(p=1);let g=this.format(e,r),y=this.format(n,r);if(g===y)return g;let v=VY(s,p),E=cM(v,a,r),T=E(e),D=E(n),N=FY(g,T,y,D),B=a.separator||i||r.defaultSeparator||"";return N?N.before+T+B+D+N.after:g+B+y}getLargestUnit(){switch(this.severity){case 7:case 6:case 5:return"year";case 4:return"month";case 3:return"week";case 2:return"day";default:return"time"}}}function cM(t,e,n){let r=Object.keys(t).length;return r===1&&t.timeZoneName==="short"?i=>bx(i.timeZoneOffset):r===0&&e.week?i=>zY(n.computeWeekNumber(i.marker),n.weekText,n.weekTextLong,n.locale,e.week):RY(t,e,n)}function RY(t,e,n){t=Object.assign({},t),e=Object.assign({},e),OY(t,e),t.timeZone="UTC";let r=new Intl.DateTimeFormat(n.locale.codes,t),i;if(e.omitZeroMinute){let s=Object.assign({},t);delete s.minute,i=new Intl.DateTimeFormat(n.locale.codes,s)}return s=>{let{marker:a}=s,o;i&&!a.getUTCMinutes()?o=i:o=r;let p=o.format(a);return NY(p,s,t,e,n)}}function OY(t,e){t.timeZoneName&&(t.hour||(t.hour="2-digit"),t.minute||(t.minute="2-digit")),t.timeZoneName==="long"&&(t.timeZoneName="short"),e.omitZeroMinute&&(t.second||t.millisecond)&&delete e.omitZeroMinute}function NY(t,e,n,r,i){return t=t.replace(DY,""),n.timeZoneName==="short"&&(t=BY(t,i.timeZone==="UTC"||e.timeZoneOffset==null?"UTC":bx(e.timeZoneOffset))),r.omitCommas&&(t=t.replace(AY,"").trim()),r.omitZeroMinute&&(t=t.replace(":00","")),r.meridiem===!1?t=t.replace(Ag,"").trim():r.meridiem==="narrow"?t=t.replace(Ag,(s,a)=>a.toLocaleLowerCase()):r.meridiem==="short"?t=t.replace(Ag,(s,a)=>`${a.toLocaleLowerCase()}m`):r.meridiem==="lowercase"&&(t=t.replace(Ag,s=>s.toLocaleLowerCase())),t=t.replace(MY," "),t=t.trim(),t}function BY(t,e){let n=!1;return t=t.replace(IY,()=>(n=!0,e)),n||(t+=` ${e}`),t}function zY(t,e,n,r,i){let s=[];return i==="long"?s.push(n):(i==="short"||i==="narrow")&&s.push(e),(i==="long"||i==="short")&&s.push(" "),s.push(r.simpleNumberFormat.format(t)),r.options.direction==="rtl"&&s.reverse(),s.join("")}function LY(t,e,n){return n.getMarkerYear(t)!==n.getMarkerYear(e)?5:n.getMarkerMonth(t)!==n.getMarkerMonth(e)?4:n.getMarkerDay(t)!==n.getMarkerDay(e)?2:al(t)!==al(e)?1:0}function VY(t,e){let n={};for(let r in t)(!(r in Tg)||Tg[r]<=e)&&(n[r]=t[r]);return n}function FY(t,e,n,r){let i=0;for(;i<t.length;){let s=t.indexOf(e,i);if(s===-1)break;let a=t.substr(0,s);i=s+e.length;let o=t.substr(i),p=0;for(;p<n.length;){let g=n.indexOf(r,p);if(g===-1)break;let y=n.substr(0,g);p=g+r.length;let v=n.substr(p);if(a===y&&o===v)return{before:a,after:o}}}return null}function dM(t,e){let n=e.markerToArray(t.marker);return{marker:t.marker,timeZoneOffset:t.timeZoneOffset,array:n,year:n[0],month:n[1],day:n[2],hour:n[3],minute:n[4],second:n[5],millisecond:n[6]}}function Mg(t,e,n,r){let i=dM(t,n.calendarSystem),s=e?dM(e,n.calendarSystem):null;return{date:i,start:i,end:s,timeZone:n.timeZone,localeCodes:n.locale.codes,defaultSeparator:r||n.defaultSeparator}}class $Y{constructor(e){this.cmdStr=e}format(e,n,r){return n.cmdFormatter(this.cmdStr,Mg(e,null,n,r))}formatRange(e,n,r,i){return r.cmdFormatter(this.cmdStr,Mg(e,n,r,i))}}class jY{constructor(e){this.func=e}format(e,n,r){return this.func(Mg(e,null,n,r))}formatRange(e,n,r,i){return this.func(Mg(e,n,r,i))}}function ir(t){return typeof t=="object"&&t?new PY(t):typeof t=="string"?new $Y(t):typeof t=="function"?new jY(t):null}const uM={navLinkDayClick:De,navLinkWeekClick:De,duration:gn,bootstrapFontAwesome:De,buttonIcons:De,customButtons:De,defaultAllDayEventDuration:gn,defaultTimedEventDuration:gn,nextDayThreshold:gn,scrollTime:gn,scrollTimeReset:Boolean,slotMinTime:gn,slotMaxTime:gn,dayPopoverFormat:ir,slotDuration:gn,snapDuration:gn,headerToolbar:De,footerToolbar:De,defaultRangeSeparator:String,titleRangeSeparator:String,forceEventDuration:Boolean,dayHeaders:Boolean,dayHeaderFormat:ir,dayHeaderClassNames:De,dayHeaderContent:De,dayHeaderDidMount:De,dayHeaderWillUnmount:De,dayCellClassNames:De,dayCellContent:De,dayCellDidMount:De,dayCellWillUnmount:De,initialView:String,aspectRatio:Number,weekends:Boolean,weekNumberCalculation:De,weekNumbers:Boolean,weekNumberClassNames:De,weekNumberContent:De,weekNumberDidMount:De,weekNumberWillUnmount:De,editable:Boolean,viewClassNames:De,viewDidMount:De,viewWillUnmount:De,nowIndicator:Boolean,nowIndicatorClassNames:De,nowIndicatorContent:De,nowIndicatorDidMount:De,nowIndicatorWillUnmount:De,showNonCurrentDates:Boolean,lazyFetching:Boolean,startParam:String,endParam:String,timeZoneParam:String,timeZone:String,locales:De,locale:De,themeSystem:String,dragRevertDuration:Number,dragScroll:Boolean,allDayMaintainDuration:Boolean,unselectAuto:Boolean,dropAccept:De,eventOrder:tY,eventOrderStrict:Boolean,handleWindowResize:Boolean,windowResizeDelay:Number,longPressDelay:Number,eventDragMinDistance:Number,expandRows:Boolean,height:De,contentHeight:De,direction:String,weekNumberFormat:ir,eventResizableFromStart:Boolean,displayEventTime:Boolean,displayEventEnd:Boolean,weekText:String,weekTextLong:String,progressiveEventRendering:Boolean,businessHours:De,initialDate:De,now:De,eventDataTransform:De,stickyHeaderDates:De,stickyFooterScrollbar:De,viewHeight:De,defaultAllDay:Boolean,eventSourceFailure:De,eventSourceSuccess:De,eventDisplay:String,eventStartEditable:Boolean,eventDurationEditable:Boolean,eventOverlap:De,eventConstraint:De,eventAllow:De,eventBackgroundColor:String,eventBorderColor:String,eventTextColor:String,eventColor:String,eventClassNames:De,eventContent:De,eventDidMount:De,eventWillUnmount:De,selectConstraint:De,selectOverlap:De,selectAllow:De,droppable:Boolean,unselectCancel:String,slotLabelFormat:De,slotLaneClassNames:De,slotLaneContent:De,slotLaneDidMount:De,slotLaneWillUnmount:De,slotLabelClassNames:De,slotLabelContent:De,slotLabelDidMount:De,slotLabelWillUnmount:De,dayMaxEvents:De,dayMaxEventRows:De,dayMinWidth:Number,slotLabelInterval:gn,allDayText:String,allDayClassNames:De,allDayContent:De,allDayDidMount:De,allDayWillUnmount:De,slotMinWidth:Number,navLinks:Boolean,eventTimeFormat:ir,rerenderDelay:Number,moreLinkText:De,moreLinkHint:De,selectMinDistance:Number,selectable:Boolean,selectLongPressDelay:Number,eventLongPressDelay:Number,selectMirror:Boolean,eventMaxStack:Number,eventMinHeight:Number,eventMinWidth:Number,eventShortHeight:Number,slotEventOverlap:Boolean,plugins:De,firstDay:Number,dayCount:Number,dateAlignment:String,dateIncrement:gn,hiddenDays:De,fixedWeekCount:Boolean,validRange:De,visibleRange:De,titleFormat:De,eventInteractive:Boolean,noEventsText:String,viewHint:De,navLinkHint:De,closeHint:String,timeHint:String,eventHint:String,moreLinkClick:De,moreLinkClassNames:De,moreLinkContent:De,moreLinkDidMount:De,moreLinkWillUnmount:De,monthStartFormat:ir,handleCustomRendering:De,customRenderingMetaMap:De,customRenderingReplaces:Boolean},af={eventDisplay:"auto",defaultRangeSeparator:" - ",titleRangeSeparator:" – ",defaultTimedEventDuration:"01:00:00",defaultAllDayEventDuration:{day:1},forceEventDuration:!1,nextDayThreshold:"00:00:00",dayHeaders:!0,initialView:"",aspectRatio:1.35,headerToolbar:{start:"title",center:"",end:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"local",editable:!1,nowIndicator:!1,scrollTime:"06:00:00",scrollTimeReset:!0,slotMinTime:"00:00:00",slotMaxTime:"24:00:00",showNonCurrentDates:!0,lazyFetching:!0,startParam:"start",endParam:"end",timeZoneParam:"timeZone",timeZone:"local",locales:[],locale:"",themeSystem:"standard",dragRevertDuration:500,dragScroll:!0,allDayMaintainDuration:!1,unselectAuto:!0,dropAccept:"*",eventOrder:"start,-duration,allDay,title",dayPopoverFormat:{month:"long",day:"numeric",year:"numeric"},handleWindowResize:!0,windowResizeDelay:100,longPressDelay:1e3,eventDragMinDistance:5,expandRows:!1,navLinks:!1,selectable:!1,eventMinHeight:15,eventMinWidth:30,eventShortHeight:30,monthStartFormat:{month:"long",day:"numeric"}},hM={datesSet:De,eventsSet:De,eventAdd:De,eventChange:De,eventRemove:De,windowResize:De,eventClick:De,eventMouseEnter:De,eventMouseLeave:De,select:De,unselect:De,loading:De,_unmount:De,_beforeprint:De,_afterprint:De,_noEventDrop:De,_noEventResize:De,_resize:De,_scrollRequest:De},fM={buttonText:De,buttonHints:De,views:De,plugins:De,initialEvents:De,events:De,eventSources:De},xc={headerToolbar:vc,footerToolbar:vc,buttonText:vc,buttonHints:vc,buttonIcons:vc,dateIncrement:vc,plugins:Dg,events:Dg,eventSources:Dg,resources:Dg};function vc(t,e){return typeof t=="object"&&typeof e=="object"&&t&&e?Po(t,e):t===e}function Dg(t,e){return Array.isArray(t)&&Array.isArray(e)?rl(t,e):t===e}const HY={type:String,component:De,buttonText:String,buttonTextKey:String,dateProfileGeneratorClass:De,usesMinMaxTime:Boolean,classNames:De,content:De,didMount:De,willUnmount:De};function _x(t){return vx(t,xc)}function xx(t,e){let n={},r={};for(let i in e)i in t&&(n[i]=e[i](t[i]));for(let i in t)i in e||(r[i]=t[i]);return{refined:n,extra:r}}function De(t){return t}const{hasOwnProperty:Ig}=Object.prototype;function vx(t,e){let n={};if(e){for(let r in e)if(e[r]===vc){let i=[];for(let s=t.length-1;s>=0;s-=1){let a=t[s][r];if(typeof a=="object"&&a)i.unshift(a);else if(a!==void 0){n[r]=a;break}}i.length&&(n[r]=vx(i))}}for(let r=t.length-1;r>=0;r-=1){let i=t[r];for(let s in i)s in n||(n[s]=i[s])}return n}function wc(t,e){let n={};for(let r in t)e(t[r],r)&&(n[r]=t[r]);return n}function la(t,e){let n={};for(let r in t)n[r]=e(t[r],r);return n}function pM(t){let e={};for(let n of t)e[n]=!0;return e}function wx(t){let e=[];for(let n in t)e.push(t[n]);return e}function Po(t,e){if(t===e)return!0;for(let n in t)if(Ig.call(t,n)&&!(n in e))return!1;for(let n in e)if(Ig.call(e,n)&&t[n]!==e[n])return!1;return!0}const UY=/^on[A-Z]/;function WY(t,e){const n=kx(t,e);for(let r of n)if(!UY.test(r))return!1;return!0}function kx(t,e){let n=[];for(let r in t)Ig.call(t,r)&&(r in e||n.push(r));for(let r in e)Ig.call(e,r)&&t[r]!==e[r]&&n.push(r);return n}function Ex(t,e,n={}){if(t===e)return!0;for(let r in e)if(!(r in t&&qY(t[r],e[r],n[r])))return!1;for(let r in t)if(!(r in e))return!1;return!0}function qY(t,e,n){return t===e||n===!0?!0:n?n(t,e):!1}function GY(t,e=0,n,r=1){let i=[];n==null&&(n=Object.keys(t).length);for(let s=e;s<n;s+=r){let a=t[s];a!==void 0&&i.push(a)}return i}let mM={};function YY(t,e){mM[t]=e}function ZY(t){return new mM[t]}class XY{getMarkerYear(e){return e.getUTCFullYear()}getMarkerMonth(e){return e.getUTCMonth()}getMarkerDay(e){return e.getUTCDate()}arrayToMarker(e){return Qi(e)}markerToArray(e){return ol(e)}}YY("gregory",XY);const KY=/^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/;function JY(t){let e=KY.exec(t);if(e){let n=new Date(Date.UTC(Number(e[1]),e[3]?Number(e[3])-1:0,Number(e[5]||1),Number(e[7]||0),Number(e[8]||0),Number(e[10]||0),e[12]?+`0.${e[12]}`*1e3:0));if(oM(n)){let r=null;return e[13]&&(r=(e[15]==="-"?-1:1)*(Number(e[16]||0)*60+Number(e[18]||0))),{marker:n,isTimeUnspecified:!e[6],timeZoneOffset:r}}}return null}class QY{constructor(e){let n=this.timeZone=e.timeZone,r=n!=="local"&&n!=="UTC";e.namedTimeZoneImpl&&r&&(this.namedTimeZoneImpl=new e.namedTimeZoneImpl(n)),this.canComputeOffset=!!(!r||this.namedTimeZoneImpl),this.calendarSystem=ZY(e.calendarSystem),this.locale=e.locale,this.weekDow=e.locale.week.dow,this.weekDoy=e.locale.week.doy,e.weekNumberCalculation==="ISO"&&(this.weekDow=1,this.weekDoy=4),typeof e.firstDay=="number"&&(this.weekDow=e.firstDay),typeof e.weekNumberCalculation=="function"&&(this.weekNumberFunc=e.weekNumberCalculation),this.weekText=e.weekText!=null?e.weekText:e.locale.options.weekText,this.weekTextLong=(e.weekTextLong!=null?e.weekTextLong:e.locale.options.weekTextLong)||this.weekText,this.cmdFormatter=e.cmdFormatter,this.defaultSeparator=e.defaultSeparator}createMarker(e){let n=this.createMarkerMeta(e);return n===null?null:n.marker}createNowMarker(){return this.canComputeOffset?this.timestampToMarker(new Date().valueOf()):Qi(iM(new Date))}createMarkerMeta(e){if(typeof e=="string")return this.parse(e);let n=null;return typeof e=="number"?n=this.timestampToMarker(e):e instanceof Date?(e=e.valueOf(),isNaN(e)||(n=this.timestampToMarker(e))):Array.isArray(e)&&(n=Qi(e)),n===null||!oM(n)?null:{marker:n,isTimeUnspecified:!1,forcedTzo:null}}parse(e){let n=JY(e);if(n===null)return null;let{marker:r}=n,i=null;return n.timeZoneOffset!==null&&(this.canComputeOffset?r=this.timestampToMarker(r.valueOf()-n.timeZoneOffset*60*1e3):i=n.timeZoneOffset),{marker:r,isTimeUnspecified:n.isTimeUnspecified,forcedTzo:i}}getYear(e){return this.calendarSystem.getMarkerYear(e)}getMonth(e){return this.calendarSystem.getMarkerMonth(e)}getDay(e){return this.calendarSystem.getMarkerDay(e)}add(e,n){let r=this.calendarSystem.markerToArray(e);return r[0]+=n.years,r[1]+=n.months,r[2]+=n.days,r[6]+=n.milliseconds,this.calendarSystem.arrayToMarker(r)}subtract(e,n){let r=this.calendarSystem.markerToArray(e);return r[0]-=n.years,r[1]-=n.months,r[2]-=n.days,r[6]-=n.milliseconds,this.calendarSystem.arrayToMarker(r)}addYears(e,n){let r=this.calendarSystem.markerToArray(e);return r[0]+=n,this.calendarSystem.arrayToMarker(r)}addMonths(e,n){let r=this.calendarSystem.markerToArray(e);return r[1]+=n,this.calendarSystem.arrayToMarker(r)}diffWholeYears(e,n){let{calendarSystem:r}=this;return al(e)===al(n)&&r.getMarkerDay(e)===r.getMarkerDay(n)&&r.getMarkerMonth(e)===r.getMarkerMonth(n)?r.getMarkerYear(n)-r.getMarkerYear(e):null}diffWholeMonths(e,n){let{calendarSystem:r}=this;return al(e)===al(n)&&r.getMarkerDay(e)===r.getMarkerDay(n)?r.getMarkerMonth(n)-r.getMarkerMonth(e)+(r.getMarkerYear(n)-r.getMarkerYear(e))*12:null}greatestWholeUnit(e,n){let r=this.diffWholeYears(e,n);return r!==null?{unit:"year",value:r}:(r=this.diffWholeMonths(e,n),r!==null?{unit:"month",value:r}:(r=xY(e,n),r!==null?{unit:"week",value:r}:(r=Sg(e,n),r!==null?{unit:"day",value:r}:(r=gY(e,n),Eg(r)?{unit:"hour",value:r}:(r=yY(e,n),Eg(r)?{unit:"minute",value:r}:(r=bY(e,n),Eg(r)?{unit:"second",value:r}:{unit:"millisecond",value:n.valueOf()-e.valueOf()}))))))}countDurationsBetween(e,n,r){let i;return r.years&&(i=this.diffWholeYears(e,n),i!==null)?i/hY(r):r.months&&(i=this.diffWholeMonths(e,n),i!==null)?i/fY(r):r.days&&(i=Sg(e,n),i!==null)?i/Yd(r):(n.valueOf()-e.valueOf())/lo(r)}startOf(e,n){return n==="year"?this.startOfYear(e):n==="month"?this.startOfMonth(e):n==="week"?this.startOfWeek(e):n==="day"?er(e):n==="hour"?vY(e):n==="minute"?wY(e):n==="second"?kY(e):null}startOfYear(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e)])}startOfMonth(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e)])}startOfWeek(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e),e.getUTCDate()-(e.getUTCDay()-this.weekDow+7)%7])}computeWeekNumber(e){return this.weekNumberFunc?this.weekNumberFunc(this.toDate(e)):EY(e,this.weekDow,this.weekDoy)}format(e,n,r={}){return n.format({marker:e,timeZoneOffset:r.forcedTzo!=null?r.forcedTzo:this.offsetForMarker(e)},this)}formatRange(e,n,r,i={}){return i.isEndExclusive&&(n=il(n,-1)),r.formatRange({marker:e,timeZoneOffset:i.forcedStartTzo!=null?i.forcedStartTzo:this.offsetForMarker(e)},{marker:n,timeZoneOffset:i.forcedEndTzo!=null?i.forcedEndTzo:this.offsetForMarker(n)},this,i.defaultSeparator)}formatIso(e,n={}){let r=null;return n.omitTimeZoneOffset||(n.forcedTzo!=null?r=n.forcedTzo:r=this.offsetForMarker(e)),aM(e,r,n.omitTime)}timestampToMarker(e){return this.timeZone==="local"?Qi(iM(new Date(e))):this.timeZone==="UTC"||!this.namedTimeZoneImpl?new Date(e):Qi(this.namedTimeZoneImpl.timestampToArray(e))}offsetForMarker(e){return this.timeZone==="local"?-sM(ol(e)).getTimezoneOffset():this.timeZone==="UTC"?0:this.namedTimeZoneImpl?this.namedTimeZoneImpl.offsetForArray(ol(e)):null}toDate(e,n){return this.timeZone==="local"?sM(ol(e)):this.timeZone==="UTC"?new Date(e.valueOf()):this.namedTimeZoneImpl?new Date(e.valueOf()-this.namedTimeZoneImpl.offsetForArray(ol(e))*1e3*60):new Date(e.valueOf()-(n||0))}}class lf{constructor(e){this.iconOverrideOption&&this.setIconOverride(e[this.iconOverrideOption])}setIconOverride(e){let n,r;if(typeof e=="object"&&e){n=Object.assign({},this.iconClasses);for(r in e)n[r]=this.applyIconOverridePrefix(e[r]);this.iconClasses=n}else e===!1&&(this.iconClasses={})}applyIconOverridePrefix(e){let n=this.iconOverridePrefix;return n&&e.indexOf(n)!==0&&(e=n+e),e}getClass(e){return this.classes[e]||""}getIconClass(e,n){let r;return n&&this.rtlIconClasses?r=this.rtlIconClasses[e]||this.iconClasses[e]:r=this.iconClasses[e],r?`${this.baseIconClass} ${r}`:""}getCustomButtonIconClass(e){let n;return this.iconOverrideCustomButtonOption&&(n=e[this.iconOverrideCustomButtonOption],n)?`${this.baseIconClass} ${this.applyIconOverridePrefix(n)}`:""}}lf.prototype.classes={},lf.prototype.iconClasses={},lf.prototype.baseIconClass="",lf.prototype.iconOverridePrefix="";function Pg(t){t();let e=Vt.debounceRendering,n=[];function r(i){n.push(i)}for(Vt.debounceRendering=r,nf(ce(eZ,{}),document.createElement("div"));n.length;)n.shift()();Vt.debounceRendering=e}class eZ extends gs{render(){return ce("div",{})}componentDidMount(){this.setState({})}}function gM(t){let e=SG(t),n=e.Provider;return e.Provider=function(){let r=!this.getChildContext,i=n.apply(this,arguments);if(r){let s=[];this.shouldComponentUpdate=a=>{this.props.value!==a.value&&s.forEach(o=>{o.context=a.value,o.forceUpdate()})},this.sub=a=>{s.push(a);let o=a.componentWillUnmount;a.componentWillUnmount=()=>{s.splice(s.indexOf(a),1),o&&o.call(a)}}}return i},e}class tZ{constructor(e,n,r,i){this.execFunc=e,this.emitter=n,this.scrollTime=r,this.scrollTimeReset=i,this.handleScrollRequest=s=>{this.queuedRequest=Object.assign({},this.queuedRequest||{},s),this.drain()},n.on("_scrollRequest",this.handleScrollRequest),this.fireInitialScroll()}detach(){this.emitter.off("_scrollRequest",this.handleScrollRequest)}update(e){e&&this.scrollTimeReset?this.fireInitialScroll():this.drain()}fireInitialScroll(){this.handleScrollRequest({time:this.scrollTime})}drain(){this.queuedRequest&&this.execFunc(this.queuedRequest)&&(this.queuedRequest=null)}}const ca=gM({});function nZ(t,e,n,r,i,s,a,o,p,g,y,v,E){return{dateEnv:i,options:n,pluginHooks:a,emitter:g,dispatch:o,getCurrentData:p,calendarApi:y,viewSpec:t,viewApi:e,dateProfileGenerator:r,theme:s,isRtl:n.direction==="rtl",addResizeHandler(T){g.on("_resize",T)},removeResizeHandler(T){g.off("_resize",T)},createScrollResponder(T){return new tZ(T,g,gn(n.scrollTime),n.scrollTimeReset)},registerInteractiveComponent:v,unregisterInteractiveComponent:E}}class kc extends gs{shouldComponentUpdate(e,n){return this.debug&&console.log(kx(e,this.props),kx(n,this.state)),!Ex(this.props,e,this.propEquality)||!Ex(this.state,n,this.stateEquality)}safeSetState(e){Ex(this.state,Object.assign(Object.assign({},this.state),e),this.stateEquality)||this.setState(e)}}kc.addPropsEquality=rZ,kc.addStateEquality=iZ,kc.contextType=ca,kc.prototype.propEquality={},kc.prototype.stateEquality={};class Tn extends kc{}Tn.contextType=ca;function rZ(t){let e=Object.create(this.prototype.propEquality);Object.assign(e,t),this.prototype.propEquality=e}function iZ(t){let e=Object.create(this.prototype.stateEquality);Object.assign(e,t),this.prototype.stateEquality=e}function da(t,e){typeof t=="function"?t(e):t&&(t.current=e)}class Sx extends Tn{constructor(){super(...arguments),this.id=_c(),this.queuedDomNodes=[],this.currentDomNodes=[],this.handleEl=e=>{const{options:n}=this.context,{generatorName:r}=this.props;(!n.customRenderingReplaces||!Cx(r,n))&&this.updateElRef(e)},this.updateElRef=e=>{this.props.elRef&&da(this.props.elRef,e)}}render(){const{props:e,context:n}=this,{options:r}=n,{customGenerator:i,defaultGenerator:s,renderProps:a}=e,o=yM(e,[],this.handleEl);let p=!1,g,y=[],v;if(i!=null){const E=typeof i=="function"?i(a,ce):i;if(E===!0)p=!0;else{const T=E&&typeof E=="object";T&&"html"in E?o.dangerouslySetInnerHTML={__html:E.html}:T&&"domNodes"in E?y=Array.prototype.slice.call(E.domNodes):(T?aA(E):typeof E!="function")?g=E:v=E}}else p=!Cx(e.generatorName,r);return p&&s&&(g=s(a)),this.queuedDomNodes=y,this.currentGeneratorMeta=v,ce(e.elTag,o,g)}componentDidMount(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentDidUpdate(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentWillUnmount(){this.triggerCustomRendering(!1)}triggerCustomRendering(e){var n;const{props:r,context:i}=this,{handleCustomRendering:s,customRenderingMetaMap:a}=i.options;if(s){const o=(n=this.currentGeneratorMeta)!==null&&n!==void 0?n:a==null?void 0:a[r.generatorName];o&&s(Object.assign(Object.assign({id:this.id,isActive:e,containerEl:this.base,reportNewContainerEl:this.updateElRef,generatorMeta:o},r),{elClasses:(r.elClasses||[]).filter(sZ)}))}}applyQueueudDomNodes(){const{queuedDomNodes:e,currentDomNodes:n}=this,r=this.base;if(!rl(e,n)){n.forEach(ux);for(let i of e)r.appendChild(i);this.currentDomNodes=e}}}Sx.addPropsEquality({elClasses:rl,elStyle:Po,elAttrs:WY,renderProps:Po});function Cx(t,e){var n;return!!(e.handleCustomRendering&&t&&(!((n=e.customRenderingMetaMap)===null||n===void 0)&&n[t]))}function yM(t,e,n){const r=Object.assign(Object.assign({},t.elAttrs),{ref:n});return(t.elClasses||e)&&(r.className=(t.elClasses||[]).concat(e||[]).concat(r.className||[]).filter(Boolean).join(" ")),t.elStyle&&(r.style=t.elStyle),r}function sZ(t){return!!t}const bM=gM(0);class yi extends gs{constructor(){super(...arguments),this.InnerContent=oZ.bind(void 0,this),this.handleEl=e=>{this.el=e,this.props.elRef&&(da(this.props.elRef,e),e&&this.didMountMisfire&&this.componentDidMount())}}render(){const{props:e}=this,n=aZ(e.classNameGenerator,e.renderProps);if(e.children){const r=yM(e,n,this.handleEl),i=e.children(this.InnerContent,e.renderProps,r);return e.elTag?ce(e.elTag,r,i):i}else return ce(Sx,Object.assign(Object.assign({},e),{elRef:this.handleEl,elTag:e.elTag||"div",elClasses:(e.elClasses||[]).concat(n),renderId:this.context}))}componentDidMount(){var e,n;this.el?(n=(e=this.props).didMount)===null||n===void 0||n.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el})):this.didMountMisfire=!0}componentWillUnmount(){var e,n;(n=(e=this.props).willUnmount)===null||n===void 0||n.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el}))}}yi.contextType=bM;function oZ(t,e){const n=t.props;return ce(Sx,Object.assign({renderProps:n.renderProps,generatorName:n.generatorName,customGenerator:n.customGenerator,defaultGenerator:n.defaultGenerator,renderId:t.context},e))}function aZ(t,e){const n=typeof t=="function"?t(e):t||[];return typeof n=="string"?[n]:n}class cf extends Tn{render(){let{props:e,context:n}=this,{options:r}=n,i={view:n.viewApi};return ce(yi,Object.assign({},e,{elTag:e.elTag||"div",elClasses:[..._M(e.viewSpec),...e.elClasses||[]],renderProps:i,classNameGenerator:r.viewClassNames,generatorName:void 0,didMount:r.viewDidMount,willUnmount:r.viewWillUnmount}),()=>e.children)}}function _M(t){return[`fc-${t.type}-view`,"fc-view"]}function lZ(t,e){let n=null,r=null;return t.start&&(n=e.createMarker(t.start)),t.end&&(r=e.createMarker(t.end)),!n&&!r||n&&r&&r<n?null:{start:n,end:r}}function xM(t,e){let n=[],{start:r}=e,i,s;for(t.sort(cZ),i=0;i<t.length;i+=1)s=t[i],s.start>r&&n.push({start:r,end:s.start}),s.end>r&&(r=s.end);return r<e.end&&n.push({start:r,end:e.end}),n}function cZ(t,e){return t.start.valueOf()-e.start.valueOf()}function ll(t,e){let{start:n,end:r}=t,i=null;return e.start!==null&&(n===null?n=e.start:n=new Date(Math.max(n.valueOf(),e.start.valueOf()))),e.end!=null&&(r===null?r=e.end:r=new Date(Math.min(r.valueOf(),e.end.valueOf()))),(n===null||r===null||n<r)&&(i={start:n,end:r}),i}function dZ(t,e){return(t.start===null?null:t.start.valueOf())===(e.start===null?null:e.start.valueOf())&&(t.end===null?null:t.end.valueOf())===(e.end===null?null:e.end.valueOf())}function Tx(t,e){return(t.end===null||e.start===null||t.end>e.start)&&(t.start===null||e.end===null||t.start<e.end)}function Rg(t,e){return(t.start===null||e.start!==null&&e.start>=t.start)&&(t.end===null||e.end!==null&&e.end<=t.end)}function ua(t,e){return(t.start===null||e>=t.start)&&(t.end===null||e<t.end)}function uZ(t,e){return e.start!=null&&t<e.start?e.start:e.end!=null&&t>=e.end?new Date(e.end.valueOf()-1):t}function vM(t){let e=Math.floor(sl(t.start,t.end))||1,n=er(t.start),r=Ur(n,e);return{start:n,end:r}}function Ax(t,e=gn(0)){let n=null,r=null;if(t.end){r=er(t.end);let i=t.end.valueOf()-r.valueOf();i&&i>=lo(e)&&(r=Ur(r,1))}return t.start&&(n=er(t.start),r&&r<=n&&(r=Ur(n,1))),{start:n,end:r}}function hZ(t){let e=Ax(t);return sl(e.start,e.end)>1}function Zd(t,e,n,r){return r==="year"?gn(n.diffWholeYears(t,e),"year"):r==="month"?gn(n.diffWholeMonths(t,e),"month"):_Y(t,e)}function fZ(t,e){switch(e.type){case"CHANGE_DATE":return e.dateMarker;default:return t}}function pZ(t,e){let n=t.initialDate;return n!=null?e.createMarker(n):df(t.now,e)}function df(t,e){return typeof t=="function"&&(t=t()),t==null?e.createNowMarker():e.createMarker(t)}class wM{constructor(e){this.props=e,this.nowDate=df(e.nowInput,e.dateEnv),this.initHiddenDays()}buildPrev(e,n,r){let{dateEnv:i}=this.props,s=i.subtract(i.startOf(n,e.currentRangeUnit),e.dateIncrement);return this.build(s,-1,r)}buildNext(e,n,r){let{dateEnv:i}=this.props,s=i.add(i.startOf(n,e.currentRangeUnit),e.dateIncrement);return this.build(s,1,r)}build(e,n,r=!0){let{props:i}=this,s,a,o,p,g,y;return s=this.buildValidRange(),s=this.trimHiddenDays(s),r&&(e=uZ(e,s)),a=this.buildCurrentRangeInfo(e,n),o=/^(year|month|week|day)$/.test(a.unit),p=this.buildRenderRange(this.trimHiddenDays(a.range),a.unit,o),p=this.trimHiddenDays(p),g=p,i.showNonCurrentDates||(g=ll(g,a.range)),g=this.adjustActiveRange(g),g=ll(g,s),y=Tx(a.range,s),ua(p,e)||(e=p.start),{currentDate:e,validRange:s,currentRange:a.range,currentRangeUnit:a.unit,isRangeAllDay:o,activeRange:g,renderRange:p,slotMinTime:i.slotMinTime,slotMaxTime:i.slotMaxTime,isValid:y,dateIncrement:this.buildDateIncrement(a.duration)}}buildValidRange(){let e=this.props.validRangeInput,n=typeof e=="function"?e.call(this.props.calendarApi,this.nowDate):e;return this.refineRange(n)||{start:null,end:null}}buildCurrentRangeInfo(e,n){let{props:r}=this,i=null,s=null,a=null,o;return r.duration?(i=r.duration,s=r.durationUnit,a=this.buildRangeFromDuration(e,n,i,s)):(o=this.props.dayCount)?(s="day",a=this.buildRangeFromDayCount(e,n,o)):(a=this.buildCustomVisibleRange(e))?s=r.dateEnv.greatestWholeUnit(a.start,a.end).unit:(i=this.getFallbackDuration(),s=gx(i).unit,a=this.buildRangeFromDuration(e,n,i,s)),{duration:i,unit:s,range:a}}getFallbackDuration(){return gn({day:1})}adjustActiveRange(e){let{dateEnv:n,usesMinMaxTime:r,slotMinTime:i,slotMaxTime:s}=this.props,{start:a,end:o}=e;return r&&(Yd(i)<0&&(a=er(a),a=n.add(a,i)),Yd(s)>1&&(o=er(o),o=Ur(o,-1),o=n.add(o,s))),{start:a,end:o}}buildRangeFromDuration(e,n,r,i){let{dateEnv:s,dateAlignment:a}=this.props,o,p,g;if(!a){let{dateIncrement:v}=this.props;v&&lo(v)<lo(r)?a=gx(v).unit:a=i}Yd(r)<=1&&this.isHiddenDay(o)&&(o=this.skipHiddenDays(o,n),o=er(o));function y(){o=s.startOf(e,a),p=s.add(o,r),g={start:o,end:p}}return y(),this.trimHiddenDays(g)||(e=this.skipHiddenDays(e,n),y()),g}buildRangeFromDayCount(e,n,r){let{dateEnv:i,dateAlignment:s}=this.props,a=0,o=e,p;s&&(o=i.startOf(o,s)),o=er(o),o=this.skipHiddenDays(o,n),p=o;do p=Ur(p,1),this.isHiddenDay(p)||(a+=1);while(a<r);return{start:o,end:p}}buildCustomVisibleRange(e){let{props:n}=this,r=n.visibleRangeInput,i=typeof r=="function"?r.call(n.calendarApi,n.dateEnv.toDate(e)):r,s=this.refineRange(i);return s&&(s.start==null||s.end==null)?null:s}buildRenderRange(e,n,r){return e}buildDateIncrement(e){let{dateIncrement:n}=this.props,r;return n||((r=this.props.dateAlignment)?gn(1,r):e||gn({days:1}))}refineRange(e){if(e){let n=lZ(e,this.props.dateEnv);return n&&(n=Ax(n)),n}return null}initHiddenDays(){let e=this.props.hiddenDays||[],n=[],r=0,i;for(this.props.weekends===!1&&e.push(0,6),i=0;i<7;i+=1)(n[i]=e.indexOf(i)!==-1)||(r+=1);if(!r)throw new Error("invalid hiddenDays");this.isHiddenDayHash=n}trimHiddenDays(e){let{start:n,end:r}=e;return n&&(n=this.skipHiddenDays(n)),r&&(r=this.skipHiddenDays(r,-1,!0)),n==null||r==null||n<r?{start:n,end:r}:null}isHiddenDay(e){return e instanceof Date&&(e=e.getUTCDay()),this.isHiddenDayHash[e]}skipHiddenDays(e,n=1,r=!1){for(;this.isHiddenDayHash[(e.getUTCDay()+(r?n:0)+7)%7];)e=Ur(e,n);return e}}function Mx(t,e,n,r){return{instanceId:_c(),defId:t,range:e,forcedStartTzo:n??null,forcedEndTzo:r??null}}function mZ(t,e,n,r){for(let i=0;i<r.length;i+=1){let s=r[i].parse(t,n);if(s){let{allDay:a}=t;return a==null&&(a=e,a==null&&(a=s.allDayGuess,a==null&&(a=!1))),{allDay:a,duration:s.duration,typeData:s.typeData,typeId:i}}}return null}function Ec(t,e,n){let{dateEnv:r,pluginHooks:i,options:s}=n,{defs:a,instances:o}=t;o=wc(o,p=>!a[p.defId].recurringDef);for(let p in a){let g=a[p];if(g.recurringDef){let{duration:y}=g.recurringDef;y||(y=g.allDay?s.defaultAllDayEventDuration:s.defaultTimedEventDuration);let v=gZ(g,y,e,r,i.recurringTypes);for(let E of v){let T=Mx(p,{start:E,end:r.add(E,y)});o[T.instanceId]=T}}}return{defs:a,instances:o}}function gZ(t,e,n,r,i){let a=i[t.recurringDef.typeId].expand(t.recurringDef.typeData,{start:r.subtract(n.start,e),end:n.end},r);return t.allDay&&(a=a.map(er)),a}const Og={id:String,groupId:String,title:String,url:String,interactive:Boolean},kM={start:De,end:De,date:De,allDay:Boolean},yZ=Object.assign(Object.assign(Object.assign({},Og),kM),{extendedProps:De});function EM(t,e,n,r,i=Dx(n),s,a){let{refined:o,extra:p}=SM(t,n,i),g=_Z(e,n),y=mZ(o,g,n.dateEnv,n.pluginHooks.recurringTypes);if(y){let E=Ix(o,p,e?e.sourceId:"",y.allDay,!!y.duration,n,s);return E.recurringDef={typeId:y.typeId,typeData:y.typeData,duration:y.duration},{def:E,instance:null}}let v=bZ(o,g,n,r);if(v){let E=Ix(o,p,e?e.sourceId:"",v.allDay,v.hasEnd,n,s),T=Mx(E.defId,v.range,v.forcedStartTzo,v.forcedEndTzo);return a&&E.publicId&&a[E.publicId]&&(T.instanceId=a[E.publicId]),{def:E,instance:T}}return null}function SM(t,e,n=Dx(e)){return xx(t,n)}function Dx(t){return Object.assign(Object.assign(Object.assign({},Bg),yZ),t.pluginHooks.eventRefiners)}function Ix(t,e,n,r,i,s,a){let o={title:t.title||"",groupId:t.groupId||"",publicId:t.id||"",url:t.url||"",recurringDef:null,defId:(a&&t.id?a[t.id]:"")||_c(),sourceId:n,allDay:r,hasEnd:i,interactive:t.interactive,ui:zg(t,s),extendedProps:Object.assign(Object.assign({},t.extendedProps||{}),e)};for(let p of s.pluginHooks.eventDefMemberAdders)Object.assign(o,p(t));return Object.freeze(o.ui.classNames),Object.freeze(o.extendedProps),o}function bZ(t,e,n,r){let{allDay:i}=t,s,a=null,o=!1,p,g=null,y=t.start!=null?t.start:t.date;if(s=n.dateEnv.createMarkerMeta(y),s)a=s.marker;else if(!r)return null;return t.end!=null&&(p=n.dateEnv.createMarkerMeta(t.end)),i==null&&(e!=null?i=e:i=(!s||s.isTimeUnspecified)&&(!p||p.isTimeUnspecified)),i&&a&&(a=er(a)),p&&(g=p.marker,i&&(g=er(g)),a&&g<=a&&(g=null)),g?o=!0:r||(o=n.options.forceEventDuration||!1,g=n.dateEnv.add(a,i?n.options.defaultAllDayEventDuration:n.options.defaultTimedEventDuration)),{allDay:i,hasEnd:o,range:{start:a,end:g},forcedStartTzo:s?s.forcedTzo:null,forcedEndTzo:p?p.forcedTzo:null}}function _Z(t,e){let n=null;return t&&(n=t.defaultAllDay),n==null&&(n=e.options.defaultAllDay),n}function uf(t,e,n,r,i,s){let a=ys(),o=Dx(n);for(let p of t){let g=EM(p,e,n,r,o,i,s);g&&Px(g,a)}return a}function Px(t,e=ys()){return e.defs[t.def.defId]=t.def,t.instance&&(e.instances[t.instance.instanceId]=t.instance),e}function Rx(t,e){let n=t.instances[e];if(n){let r=t.defs[n.defId],i=Ng(t,s=>xZ(r,s));return i.defs[r.defId]=r,i.instances[n.instanceId]=n,i}return ys()}function xZ(t,e){return!!(t.groupId&&t.groupId===e.groupId)}function ys(){return{defs:{},instances:{}}}function Ox(t,e){return{defs:Object.assign(Object.assign({},t.defs),e.defs),instances:Object.assign(Object.assign({},t.instances),e.instances)}}function Ng(t,e){let n=wc(t.defs,e),r=wc(t.instances,i=>n[i.defId]);return{defs:n,instances:r}}function vZ(t,e){let{defs:n,instances:r}=t,i={},s={};for(let a in n)e.defs[a]||(i[a]=n[a]);for(let a in r)!e.instances[a]&&i[r[a].defId]&&(s[a]=r[a]);return{defs:i,instances:s}}function wZ(t,e){return Array.isArray(t)?uf(t,null,e,!0):typeof t=="object"&&t?uf([t],null,e,!0):t!=null?String(t):null}function CM(t){return Array.isArray(t)?t:typeof t=="string"?t.split(/\s+/):[]}const Bg={display:String,editable:Boolean,startEditable:Boolean,durationEditable:Boolean,constraint:De,overlap:De,allow:De,className:CM,classNames:CM,color:String,backgroundColor:String,borderColor:String,textColor:String},kZ={display:null,startEditable:null,durationEditable:null,constraints:[],overlap:null,allows:[],backgroundColor:"",borderColor:"",textColor:"",classNames:[]};function zg(t,e){let n=wZ(t.constraint,e);return{display:t.display||null,startEditable:t.startEditable!=null?t.startEditable:t.editable,durationEditable:t.durationEditable!=null?t.durationEditable:t.editable,constraints:n!=null?[n]:[],overlap:t.overlap!=null?t.overlap:null,allows:t.allow!=null?[t.allow]:[],backgroundColor:t.backgroundColor||t.color||"",borderColor:t.borderColor||t.color||"",textColor:t.textColor||"",classNames:(t.className||[]).concat(t.classNames||[])}}function TM(t){return t.reduce(EZ,kZ)}function EZ(t,e){return{display:e.display!=null?e.display:t.display,startEditable:e.startEditable!=null?e.startEditable:t.startEditable,durationEditable:e.durationEditable!=null?e.durationEditable:t.durationEditable,constraints:t.constraints.concat(e.constraints),overlap:typeof e.overlap=="boolean"?e.overlap:t.overlap,allows:t.allows.concat(e.allows),backgroundColor:e.backgroundColor||t.backgroundColor,borderColor:e.borderColor||t.borderColor,textColor:e.textColor||t.textColor,classNames:t.classNames.concat(e.classNames)}}const SZ={id:String,defaultAllDay:Boolean,url:String,format:String,events:De,eventDataTransform:De,success:De,failure:De};function AM(t,e,n=MM(e)){let r;if(typeof t=="string"?r={url:t}:typeof t=="function"||Array.isArray(t)?r={events:t}:typeof t=="object"&&t&&(r=t),r){let{refined:i,extra:s}=xx(r,n),a=CZ(i,e);if(a)return{_raw:t,isFetching:!1,latestFetchId:"",fetchRange:null,defaultAllDay:i.defaultAllDay,eventDataTransform:i.eventDataTransform,success:i.success,failure:i.failure,publicId:i.id||"",sourceId:_c(),sourceDefId:a.sourceDefId,meta:a.meta,ui:zg(i,e),extendedProps:s}}return null}function MM(t){return Object.assign(Object.assign(Object.assign({},Bg),SZ),t.pluginHooks.eventSourceRefiners)}function CZ(t,e){let n=e.pluginHooks.eventSourceDefs;for(let r=n.length-1;r>=0;r-=1){let s=n[r].parseMeta(t);if(s)return{sourceDefId:r,meta:s}}return null}function TZ(t,e,n,r,i){switch(e.type){case"RECEIVE_EVENTS":return AZ(t,n[e.sourceId],e.fetchId,e.fetchRange,e.rawEvents,i);case"RESET_RAW_EVENTS":return MZ(t,n[e.sourceId],e.rawEvents,r.activeRange,i);case"ADD_EVENTS":return DZ(t,e.eventStore,r?r.activeRange:null,i);case"RESET_EVENTS":return e.eventStore;case"MERGE_EVENTS":return Ox(t,e.eventStore);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return r?Ec(t,r.activeRange,i):t;case"REMOVE_EVENTS":return vZ(t,e.eventStore);case"REMOVE_EVENT_SOURCE":return RM(t,e.sourceId);case"REMOVE_ALL_EVENT_SOURCES":return Ng(t,s=>!s.sourceId);case"REMOVE_ALL_EVENTS":return ys();default:return t}}function AZ(t,e,n,r,i,s){if(e&&n===e.latestFetchId){let a=uf(DM(i,e,s),e,s);return r&&(a=Ec(a,r,s)),Ox(RM(t,e.sourceId),a)}return t}function MZ(t,e,n,r,i){const{defIdMap:s,instanceIdMap:a}=PZ(t);let o=uf(DM(n,e,i),e,i,!1,s,a);return Ec(o,r,i)}function DM(t,e,n){let r=n.options.eventDataTransform,i=e?e.eventDataTransform:null;return i&&(t=IM(t,i)),r&&(t=IM(t,r)),t}function IM(t,e){let n;if(!e)n=t;else{n=[];for(let r of t){let i=e(r);i?n.push(i):i==null&&n.push(r)}}return n}function DZ(t,e,n,r){return n&&(e=Ec(e,n,r)),Ox(t,e)}function PM(t,e,n){let{defs:r}=t,i=la(t.instances,s=>r[s.defId].allDay?s:Object.assign(Object.assign({},s),{range:{start:n.createMarker(e.toDate(s.range.start,s.forcedStartTzo)),end:n.createMarker(e.toDate(s.range.end,s.forcedEndTzo))},forcedStartTzo:n.canComputeOffset?null:s.forcedStartTzo,forcedEndTzo:n.canComputeOffset?null:s.forcedEndTzo}));return{defs:r,instances:i}}function RM(t,e){return Ng(t,n=>n.sourceId!==e)}function IZ(t,e){return{defs:t.defs,instances:wc(t.instances,n=>!e[n.instanceId])}}function PZ(t){const{defs:e,instances:n}=t,r={},i={};for(let s in e){const a=e[s],{publicId:o}=a;o&&(r[o]=s)}for(let s in n){const a=n[s],o=e[a.defId],{publicId:p}=o;p&&(i[p]=s)}return{defIdMap:r,instanceIdMap:i}}class Lg{constructor(){this.handlers={},this.thisContext=null}setThisContext(e){this.thisContext=e}setOptions(e){this.options=e}on(e,n){RZ(this.handlers,e,n)}off(e,n){OZ(this.handlers,e,n)}trigger(e,...n){let r=this.handlers[e]||[],i=this.options&&this.options[e],s=[].concat(i||[],r);for(let a of s)a.apply(this.thisContext,n)}hasHandlers(e){return!!(this.handlers[e]&&this.handlers[e].length||this.options&&this.options[e])}}function RZ(t,e,n){(t[e]||(t[e]=[])).push(n)}function OZ(t,e,n){n?t[e]&&(t[e]=t[e].filter(r=>r!==n)):delete t[e]}const NZ={startTime:"09:00",endTime:"17:00",daysOfWeek:[1,2,3,4,5],display:"inverse-background",classNames:"fc-non-business",groupId:"_businessHours"};function BZ(t,e){return uf(zZ(t),null,e)}function zZ(t){let e;return t===!0?e=[{}]:Array.isArray(t)?e=t.filter(n=>n.daysOfWeek):typeof t=="object"&&t?e=[t]:e=[],e=e.map(n=>Object.assign(Object.assign({},NZ),n)),e}function OM(t,e,n){n.emitter.trigger("select",Object.assign(Object.assign({},Nx(t,n)),{jsEvent:e?e.origEvent:null,view:n.viewApi||n.calendarApi.view}))}function LZ(t,e){e.emitter.trigger("unselect",{jsEvent:t?t.origEvent:null,view:e.viewApi||e.calendarApi.view})}function Nx(t,e){let n={};for(let r of e.pluginHooks.dateSpanTransforms)Object.assign(n,r(t,e));return Object.assign(n,JZ(t,e.dateEnv)),n}function NM(t,e,n){let{dateEnv:r,options:i}=n,s=e;return t?(s=er(s),s=r.add(s,i.defaultAllDayEventDuration)):s=r.add(s,i.defaultTimedEventDuration),s}function Bx(t,e,n,r){let i=Vg(t.defs,e),s=ys();for(let a in t.defs){let o=t.defs[a];s.defs[a]=VZ(o,i[a],n,r)}for(let a in t.instances){let o=t.instances[a],p=s.defs[o.defId];s.instances[a]=FZ(o,p,i[o.defId],n,r)}return s}function VZ(t,e,n,r){let i=n.standardProps||{};i.hasEnd==null&&e.durationEditable&&(n.startDelta||n.endDelta)&&(i.hasEnd=!0);let s=Object.assign(Object.assign(Object.assign({},t),i),{ui:Object.assign(Object.assign({},t.ui),i.ui)});n.extendedProps&&(s.extendedProps=Object.assign(Object.assign({},s.extendedProps),n.extendedProps));for(let a of r.pluginHooks.eventDefMutationAppliers)a(s,n,r);return!s.hasEnd&&r.options.forceEventDuration&&(s.hasEnd=!0),s}function FZ(t,e,n,r,i){let{dateEnv:s}=i,a=r.standardProps&&r.standardProps.allDay===!0,o=r.standardProps&&r.standardProps.hasEnd===!1,p=Object.assign({},t);return a&&(p.range=vM(p.range)),r.datesDelta&&n.startEditable&&(p.range={start:s.add(p.range.start,r.datesDelta),end:s.add(p.range.end,r.datesDelta)}),r.startDelta&&n.durationEditable&&(p.range={start:s.add(p.range.start,r.startDelta),end:p.range.end}),r.endDelta&&n.durationEditable&&(p.range={start:p.range.start,end:s.add(p.range.end,r.endDelta)}),o&&(p.range={start:p.range.start,end:NM(e.allDay,p.range.start,i)}),e.allDay&&(p.range={start:er(p.range.start),end:er(p.range.end)}),p.range.end<p.range.start&&(p.range.end=NM(e.allDay,p.range.start,i)),p}class Xd{constructor(e,n){this.context=e,this.internalEventSource=n}remove(){this.context.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:this.internalEventSource.sourceId})}refetch(){this.context.dispatch({type:"FETCH_EVENT_SOURCES",sourceIds:[this.internalEventSource.sourceId],isRefetch:!0})}get id(){return this.internalEventSource.publicId}get url(){return this.internalEventSource.meta.url}get format(){return this.internalEventSource.meta.format}}class lr{constructor(e,n,r){this._context=e,this._def=n,this._instance=r||null}setProp(e,n){if(e in kM)console.warn("Could not set date-related prop 'name'. Use one of the date-related methods instead.");else if(e==="id")n=Og[e](n),this.mutate({standardProps:{publicId:n}});else if(e in Og)n=Og[e](n),this.mutate({standardProps:{[e]:n}});else if(e in Bg){let r=Bg[e](n);e==="color"?r={backgroundColor:n,borderColor:n}:e==="editable"?r={startEditable:n,durationEditable:n}:r={[e]:n},this.mutate({standardProps:{ui:r}})}else console.warn(`Could not set prop '${e}'. Use setExtendedProp instead.`)}setExtendedProp(e,n){this.mutate({extendedProps:{[e]:n}})}setStart(e,n={}){let{dateEnv:r}=this._context,i=r.createMarker(e);if(i&&this._instance){let s=this._instance.range,a=Zd(s.start,i,r,n.granularity);n.maintainDuration?this.mutate({datesDelta:a}):this.mutate({startDelta:a})}}setEnd(e,n={}){let{dateEnv:r}=this._context,i;if(!(e!=null&&(i=r.createMarker(e),!i))&&this._instance)if(i){let s=Zd(this._instance.range.end,i,r,n.granularity);this.mutate({endDelta:s})}else this.mutate({standardProps:{hasEnd:!1}})}setDates(e,n,r={}){let{dateEnv:i}=this._context,s={allDay:r.allDay},a=i.createMarker(e),o;if(a&&!(n!=null&&(o=i.createMarker(n),!o))&&this._instance){let p=this._instance.range;r.allDay===!0&&(p=vM(p));let g=Zd(p.start,a,i,r.granularity);if(o){let y=Zd(p.end,o,i,r.granularity);cY(g,y)?this.mutate({datesDelta:g,standardProps:s}):this.mutate({startDelta:g,endDelta:y,standardProps:s})}else s.hasEnd=!1,this.mutate({datesDelta:g,standardProps:s})}}moveStart(e){let n=gn(e);n&&this.mutate({startDelta:n})}moveEnd(e){let n=gn(e);n&&this.mutate({endDelta:n})}moveDates(e){let n=gn(e);n&&this.mutate({datesDelta:n})}setAllDay(e,n={}){let r={allDay:e},{maintainDuration:i}=n;i==null&&(i=this._context.options.allDayMaintainDuration),this._def.allDay!==e&&(r.hasEnd=i),this.mutate({standardProps:r})}formatRange(e){let{dateEnv:n}=this._context,r=this._instance,i=ir(e);return this._def.hasEnd?n.formatRange(r.range.start,r.range.end,i,{forcedStartTzo:r.forcedStartTzo,forcedEndTzo:r.forcedEndTzo}):n.format(r.range.start,i,{forcedTzo:r.forcedStartTzo})}mutate(e){let n=this._instance;if(n){let r=this._def,i=this._context,{eventStore:s}=i.getCurrentData(),a=Rx(s,n.instanceId);a=Bx(a,{"":{display:"",startEditable:!0,durationEditable:!0,constraints:[],overlap:null,allows:[],backgroundColor:"",borderColor:"",textColor:"",classNames:[]}},e,i);let p=new lr(i,r,n);this._def=a.defs[r.defId],this._instance=a.instances[n.instanceId],i.dispatch({type:"MERGE_EVENTS",eventStore:a}),i.emitter.trigger("eventChange",{oldEvent:p,event:this,relatedEvents:Sc(a,i,n),revert(){i.dispatch({type:"RESET_EVENTS",eventStore:s})}})}}remove(){let e=this._context,n=BM(this);e.dispatch({type:"REMOVE_EVENTS",eventStore:n}),e.emitter.trigger("eventRemove",{event:this,relatedEvents:[],revert(){e.dispatch({type:"MERGE_EVENTS",eventStore:n})}})}get source(){let{sourceId:e}=this._def;return e?new Xd(this._context,this._context.getCurrentData().eventSources[e]):null}get start(){return this._instance?this._context.dateEnv.toDate(this._instance.range.start):null}get end(){return this._instance&&this._def.hasEnd?this._context.dateEnv.toDate(this._instance.range.end):null}get startStr(){let e=this._instance;return e?this._context.dateEnv.formatIso(e.range.start,{omitTime:this._def.allDay,forcedTzo:e.forcedStartTzo}):""}get endStr(){let e=this._instance;return e&&this._def.hasEnd?this._context.dateEnv.formatIso(e.range.end,{omitTime:this._def.allDay,forcedTzo:e.forcedEndTzo}):""}get id(){return this._def.publicId}get groupId(){return this._def.groupId}get allDay(){return this._def.allDay}get title(){return this._def.title}get url(){return this._def.url}get display(){return this._def.ui.display||"auto"}get startEditable(){return this._def.ui.startEditable}get durationEditable(){return this._def.ui.durationEditable}get constraint(){return this._def.ui.constraints[0]||null}get overlap(){return this._def.ui.overlap}get allow(){return this._def.ui.allows[0]||null}get backgroundColor(){return this._def.ui.backgroundColor}get borderColor(){return this._def.ui.borderColor}get textColor(){return this._def.ui.textColor}get classNames(){return this._def.ui.classNames}get extendedProps(){return this._def.extendedProps}toPlainObject(e={}){let n=this._def,{ui:r}=n,{startStr:i,endStr:s}=this,a={allDay:n.allDay};return n.title&&(a.title=n.title),i&&(a.start=i),s&&(a.end=s),n.publicId&&(a.id=n.publicId),n.groupId&&(a.groupId=n.groupId),n.url&&(a.url=n.url),r.display&&r.display!=="auto"&&(a.display=r.display),e.collapseColor&&r.backgroundColor&&r.backgroundColor===r.borderColor?a.color=r.backgroundColor:(r.backgroundColor&&(a.backgroundColor=r.backgroundColor),r.borderColor&&(a.borderColor=r.borderColor)),r.textColor&&(a.textColor=r.textColor),r.classNames.length&&(a.classNames=r.classNames),Object.keys(n.extendedProps).length&&(e.collapseExtendedProps?Object.assign(a,n.extendedProps):a.extendedProps=n.extendedProps),a}toJSON(){return this.toPlainObject()}}function BM(t){let e=t._def,n=t._instance;return{defs:{[e.defId]:e},instances:n?{[n.instanceId]:n}:{}}}function Sc(t,e,n){let{defs:r,instances:i}=t,s=[],a=n?n.instanceId:"";for(let o in i){let p=i[o],g=r[p.defId];p.instanceId!==a&&s.push(new lr(e,g,p))}return s}function zx(t,e,n,r){let i={},s={},a={},o=[],p=[],g=Vg(t.defs,e);for(let y in t.defs){let v=t.defs[y];g[v.defId].display==="inverse-background"&&(v.groupId?(i[v.groupId]=[],a[v.groupId]||(a[v.groupId]=v)):s[y]=[])}for(let y in t.instances){let v=t.instances[y],E=t.defs[v.defId],T=g[E.defId],D=v.range,N=!E.allDay&&r?Ax(D,r):D,B=ll(N,n);B&&(T.display==="inverse-background"?E.groupId?i[E.groupId].push(B):s[v.defId].push(B):T.display!=="none"&&(T.display==="background"?o:p).push({def:E,ui:T,instance:v,range:B,isStart:N.start&&N.start.valueOf()===B.start.valueOf(),isEnd:N.end&&N.end.valueOf()===B.end.valueOf()}))}for(let y in i){let v=i[y],E=xM(v,n);for(let T of E){let D=a[y],N=g[D.defId];o.push({def:D,ui:N,instance:null,range:T,isStart:!1,isEnd:!1})}}for(let y in s){let v=s[y],E=xM(v,n);for(let T of E)o.push({def:t.defs[y],ui:g[y],instance:null,range:T,isStart:!1,isEnd:!1})}return{bg:o,fg:p}}function $Z(t){return t.ui.display==="background"||t.ui.display==="inverse-background"}function zM(t,e){t.fcSeg=e}function Kd(t){return t.fcSeg||t.parentNode.fcSeg||null}function Vg(t,e){return la(t,n=>LM(n,e))}function LM(t,e){let n=[];return e[""]&&n.push(e[""]),e[t.defId]&&n.push(e[t.defId]),n.push(t.ui),TM(n)}function Lx(t,e){let n=t.map(jZ);return n.sort((r,i)=>nY(r,i,e)),n.map(r=>r._seg)}function jZ(t){let{eventRange:e}=t,n=e.def,r=e.instance?e.instance.range:e.range,i=r.start?r.start.valueOf():0,s=r.end?r.end.valueOf():0;return Object.assign(Object.assign(Object.assign({},n.extendedProps),n),{id:n.publicId,start:i,end:s,duration:s-i,allDay:Number(n.allDay),_seg:t})}function HZ(t,e){let{pluginHooks:n}=e,r=n.isDraggableTransformers,{def:i,ui:s}=t.eventRange,a=s.startEditable;for(let o of r)a=o(a,i,s,e);return a}function UZ(t,e){return t.isStart&&t.eventRange.ui.durationEditable&&e.options.eventResizableFromStart}function WZ(t,e){return t.isEnd&&t.eventRange.ui.durationEditable}function hf(t,e,n,r,i,s,a){let{dateEnv:o,options:p}=n,{displayEventTime:g,displayEventEnd:y}=p,v=t.eventRange.def,E=t.eventRange.instance;g==null&&(g=r!==!1),y==null&&(y=i!==!1);let T=E.range.start,D=E.range.end,N=s||t.start||t.eventRange.range.start,B=a||t.end||t.eventRange.range.end,F=er(T).valueOf()===er(N).valueOf(),X=er(il(D,-1)).valueOf()===er(il(B,-1)).valueOf();return g&&!v.allDay&&(F||X)?(N=F?T:N,B=X?D:B,y&&v.hasEnd?o.formatRange(N,B,e,{forcedStartTzo:s?null:E.forcedStartTzo,forcedEndTzo:a?null:E.forcedEndTzo}):o.format(N,e,{forcedTzo:s?null:E.forcedStartTzo})):""}function ha(t,e,n){let r=t.eventRange.range;return{isPast:r.end<=(n||e.start),isFuture:r.start>=(n||e.end),isToday:e&&ua(e,r.start)}}function qZ(t){let e=["fc-event"];return t.isMirror&&e.push("fc-event-mirror"),t.isDraggable&&e.push("fc-event-draggable"),(t.isStartResizable||t.isEndResizable)&&e.push("fc-event-resizable"),t.isDragging&&e.push("fc-event-dragging"),t.isResizing&&e.push("fc-event-resizing"),t.isSelected&&e.push("fc-event-selected"),t.isStart&&e.push("fc-event-start"),t.isEnd&&e.push("fc-event-end"),t.isPast&&e.push("fc-event-past"),t.isToday&&e.push("fc-event-today"),t.isFuture&&e.push("fc-event-future"),e}function VM(t){return t.instance?t.instance.instanceId:`${t.def.defId}:${t.range.start.toISOString()}`}function Vx(t,e){let{def:n,instance:r}=t.eventRange,{url:i}=n;if(i)return{href:i};let{emitter:s,options:a}=e,{eventInteractive:o}=a;return o==null&&(o=n.interactive,o==null&&(o=!!s.hasHandlers("eventClick"))),o?QA(p=>{s.trigger("eventClick",{el:p.target,event:new lr(e,n,r),jsEvent:p,view:e.viewApi})}):{}}const GZ={start:De,end:De,allDay:Boolean};function YZ(t,e,n){let r=ZZ(t,e),{range:i}=r;if(!i.start)return null;if(!i.end){if(n==null)return null;i.end=e.add(i.start,n)}return r}function ZZ(t,e){let{refined:n,extra:r}=xx(t,GZ),i=n.start?e.createMarkerMeta(n.start):null,s=n.end?e.createMarkerMeta(n.end):null,{allDay:a}=n;return a==null&&(a=i&&i.isTimeUnspecified&&(!s||s.isTimeUnspecified)),Object.assign({range:{start:i?i.marker:null,end:s?s.marker:null},allDay:a},r)}function XZ(t,e){return dZ(t.range,e.range)&&t.allDay===e.allDay&&KZ(t,e)}function KZ(t,e){for(let n in e)if(n!=="range"&&n!=="allDay"&&t[n]!==e[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}function JZ(t,e){return Object.assign(Object.assign({},$M(t.range,e,t.allDay)),{allDay:t.allDay})}function FM(t,e,n){return Object.assign(Object.assign({},$M(t,e,n)),{timeZone:e.timeZone})}function $M(t,e,n){return{start:e.toDate(t.start),end:e.toDate(t.end),startStr:e.formatIso(t.start,{omitTime:n}),endStr:e.formatIso(t.end,{omitTime:n})}}function QZ(t,e,n){let r=SM({editable:!1},n),i=Ix(r.refined,r.extra,"",t.allDay,!0,n);return{def:i,ui:LM(i,e),instance:Mx(i.defId,t.range),range:t.range,isStart:!0,isEnd:!0}}function eX(t,e,n){let r=!1,i=function(o){r||(r=!0,e(o))},s=function(o){r||(r=!0,n(o))},a=t(i,s);a&&typeof a.then=="function"&&a.then(i,s)}class jM extends Error{constructor(e,n){super(e),this.response=n}}function tX(t,e,n){t=t.toUpperCase();const r={method:t};return t==="GET"?e+=(e.indexOf("?")===-1?"?":"&")+new URLSearchParams(n):(r.body=new URLSearchParams(n),r.headers={"Content-Type":"application/x-www-form-urlencoded"}),fetch(e,r).then(i=>{if(i.ok)return i.json().then(s=>[s,i],()=>{throw new jM("Failure parsing JSON",i)});throw new jM("Request failed",i)})}let Fx;function HM(){return Fx==null&&(Fx=nX()),Fx}function nX(){if(typeof document>"u")return!0;let t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.innerHTML="<table><tr><td><div></div></td></tr></table>",t.querySelector("table").style.height="100px",t.querySelector("div").style.height="100%",document.body.appendChild(t);let n=t.querySelector("div").offsetHeight>0;return document.body.removeChild(t),n}class rX extends Tn{constructor(){super(...arguments),this.state={forPrint:!1},this.handleBeforePrint=()=>{Pg(()=>{this.setState({forPrint:!0})})},this.handleAfterPrint=()=>{Pg(()=>{this.setState({forPrint:!1})})}}render(){let{props:e}=this,{options:n}=e,{forPrint:r}=this.state,i=r||n.height==="auto"||n.contentHeight==="auto",s=!i&&n.height!=null?n.height:"",a=["fc",r?"fc-media-print":"fc-media-screen",`fc-direction-${n.direction}`,e.theme.getClass("root")];return HM()||a.push("fc-liquid-hack"),e.children(a,s,i,r)}componentDidMount(){let{emitter:e}=this.props;e.on("_beforeprint",this.handleBeforePrint),e.on("_afterprint",this.handleAfterPrint)}componentWillUnmount(){let{emitter:e}=this.props;e.off("_beforeprint",this.handleBeforePrint),e.off("_afterprint",this.handleAfterPrint)}}class Jd{constructor(e){this.component=e.component,this.isHitComboAllowed=e.isHitComboAllowed||null}destroy(){}}function iX(t,e){return{component:t,el:e.el,useEventCenter:e.useEventCenter!=null?e.useEventCenter:!0,isHitComboAllowed:e.isHitComboAllowed||null}}function $x(t){return{[t.component.uid]:t}}const jx={};class sX{getCurrentData(){return this.currentDataManager.getCurrentData()}dispatch(e){this.currentDataManager.dispatch(e)}get view(){return this.getCurrentData().viewApi}batchRendering(e){e()}updateSize(){this.trigger("_resize",!0)}setOption(e,n){this.dispatch({type:"SET_OPTION",optionName:e,rawOptionValue:n})}getOption(e){return this.currentDataManager.currentCalendarOptionsInput[e]}getAvailableLocaleCodes(){return Object.keys(this.getCurrentData().availableRawLocales)}on(e,n){let{currentDataManager:r}=this;r.currentCalendarOptionsRefiners[e]?r.emitter.on(e,n):console.warn(`Unknown listener name '${e}'`)}off(e,n){this.currentDataManager.emitter.off(e,n)}trigger(e,...n){this.currentDataManager.emitter.trigger(e,...n)}changeView(e,n){this.batchRendering(()=>{if(this.unselect(),n)if(n.start&&n.end)this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e}),this.dispatch({type:"SET_OPTION",optionName:"visibleRange",rawOptionValue:n});else{let{dateEnv:r}=this.getCurrentData();this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e,dateMarker:r.createMarker(n)})}else this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e})})}zoomTo(e,n){let r=this.getCurrentData(),i;n=n||"day",i=r.viewSpecs[n]||this.getUnitViewSpec(n),this.unselect(),i?this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:i.type,dateMarker:e}):this.dispatch({type:"CHANGE_DATE",dateMarker:e})}getUnitViewSpec(e){let{viewSpecs:n,toolbarConfig:r}=this.getCurrentData(),i=[].concat(r.header?r.header.viewsWithButtons:[],r.footer?r.footer.viewsWithButtons:[]),s,a;for(let o in n)i.push(o);for(s=0;s<i.length;s+=1)if(a=n[i[s]],a&&a.singleUnit===e)return a;return null}prev(){this.unselect(),this.dispatch({type:"PREV"})}next(){this.unselect(),this.dispatch({type:"NEXT"})}prevYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,-1)})}nextYear(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:e.dateEnv.addYears(e.currentDate,1)})}today(){let e=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:df(e.calendarOptions.now,e.dateEnv)})}gotoDate(e){let n=this.getCurrentData();this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:n.dateEnv.createMarker(e)})}incrementDate(e){let n=this.getCurrentData(),r=gn(e);r&&(this.unselect(),this.dispatch({type:"CHANGE_DATE",dateMarker:n.dateEnv.add(n.currentDate,r)}))}getDate(){let e=this.getCurrentData();return e.dateEnv.toDate(e.currentDate)}formatDate(e,n){let{dateEnv:r}=this.getCurrentData();return r.format(r.createMarker(e),ir(n))}formatRange(e,n,r){let{dateEnv:i}=this.getCurrentData();return i.formatRange(i.createMarker(e),i.createMarker(n),ir(r),r)}formatIso(e,n){let{dateEnv:r}=this.getCurrentData();return r.formatIso(r.createMarker(e),{omitTime:n})}select(e,n){let r;n==null?e.start!=null?r=e:r={start:e,end:null}:r={start:e,end:n};let i=this.getCurrentData(),s=YZ(r,i.dateEnv,gn({days:1}));s&&(this.dispatch({type:"SELECT_DATES",selection:s}),OM(s,null,i))}unselect(e){let n=this.getCurrentData();n.dateSelection&&(this.dispatch({type:"UNSELECT_DATES"}),LZ(e,n))}addEvent(e,n){if(e instanceof lr){let a=e._def,o=e._instance;return this.getCurrentData().eventStore.defs[a.defId]||(this.dispatch({type:"ADD_EVENTS",eventStore:Px({def:a,instance:o})}),this.triggerEventAdd(e)),e}let r=this.getCurrentData(),i;if(n instanceof Xd)i=n.internalEventSource;else if(typeof n=="boolean")n&&([i]=wx(r.eventSources));else if(n!=null){let a=this.getEventSourceById(n);if(!a)return console.warn(`Could not find an event source with ID "${n}"`),null;i=a.internalEventSource}let s=EM(e,i,r,!1);if(s){let a=new lr(r,s.def,s.def.recurringDef?null:s.instance);return this.dispatch({type:"ADD_EVENTS",eventStore:Px(s)}),this.triggerEventAdd(a),a}return null}triggerEventAdd(e){let{emitter:n}=this.getCurrentData();n.trigger("eventAdd",{event:e,relatedEvents:[],revert:()=>{this.dispatch({type:"REMOVE_EVENTS",eventStore:BM(e)})}})}getEventById(e){let n=this.getCurrentData(),{defs:r,instances:i}=n.eventStore;e=String(e);for(let s in r){let a=r[s];if(a.publicId===e){if(a.recurringDef)return new lr(n,a,null);for(let o in i){let p=i[o];if(p.defId===a.defId)return new lr(n,a,p)}}}return null}getEvents(){let e=this.getCurrentData();return Sc(e.eventStore,e)}removeAllEvents(){this.dispatch({type:"REMOVE_ALL_EVENTS"})}getEventSources(){let e=this.getCurrentData(),n=e.eventSources,r=[];for(let i in n)r.push(new Xd(e,n[i]));return r}getEventSourceById(e){let n=this.getCurrentData(),r=n.eventSources;e=String(e);for(let i in r)if(r[i].publicId===e)return new Xd(n,r[i]);return null}addEventSource(e){let n=this.getCurrentData();if(e instanceof Xd)return n.eventSources[e.internalEventSource.sourceId]||this.dispatch({type:"ADD_EVENT_SOURCES",sources:[e.internalEventSource]}),e;let r=AM(e,n);return r?(this.dispatch({type:"ADD_EVENT_SOURCES",sources:[r]}),new Xd(n,r)):null}removeAllEventSources(){this.dispatch({type:"REMOVE_ALL_EVENT_SOURCES"})}refetchEvents(){this.dispatch({type:"FETCH_EVENT_SOURCES",isRefetch:!0})}scrollToTime(e){let n=gn(e);n&&this.trigger("_scrollRequest",{time:n})}}function oX(t,e){return t.left>=e.left&&t.left<e.right&&t.top>=e.top&&t.top<e.bottom}function UM(t,e){let n={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)};return n.left<n.right&&n.top<n.bottom?n:!1}function aX(t,e){return{left:Math.min(Math.max(t.left,e.left),e.right),top:Math.min(Math.max(t.top,e.top),e.bottom)}}function lX(t){return{left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}}function cX(t,e){return{left:t.left-e.left,top:t.top-e.top}}const Hx=ys();class dX{constructor(){this.getKeysForEventDefs=Ft(this._getKeysForEventDefs),this.splitDateSelection=Ft(this._splitDateSpan),this.splitEventStore=Ft(this._splitEventStore),this.splitIndividualUi=Ft(this._splitIndividualUi),this.splitEventDrag=Ft(this._splitInteraction),this.splitEventResize=Ft(this._splitInteraction),this.eventUiBuilders={}}splitProps(e){let n=this.getKeyInfo(e),r=this.getKeysForEventDefs(e.eventStore),i=this.splitDateSelection(e.dateSelection),s=this.splitIndividualUi(e.eventUiBases,r),a=this.splitEventStore(e.eventStore,r),o=this.splitEventDrag(e.eventDrag),p=this.splitEventResize(e.eventResize),g={};this.eventUiBuilders=la(n,(y,v)=>this.eventUiBuilders[v]||Ft(uX));for(let y in n){let v=n[y],E=a[y]||Hx,T=this.eventUiBuilders[y];g[y]={businessHours:v.businessHours||e.businessHours,dateSelection:i[y]||null,eventStore:E,eventUiBases:T(e.eventUiBases[""],v.ui,s[y]),eventSelection:E.instances[e.eventSelection]?e.eventSelection:"",eventDrag:o[y]||null,eventResize:p[y]||null}}return g}_splitDateSpan(e){let n={};if(e){let r=this.getKeysForDateSpan(e);for(let i of r)n[i]=e}return n}_getKeysForEventDefs(e){return la(e.defs,n=>this.getKeysForEventDef(n))}_splitEventStore(e,n){let{defs:r,instances:i}=e,s={};for(let a in r)for(let o of n[a])s[o]||(s[o]=ys()),s[o].defs[a]=r[a];for(let a in i){let o=i[a];for(let p of n[o.defId])s[p]&&(s[p].instances[a]=o)}return s}_splitIndividualUi(e,n){let r={};for(let i in e)if(i)for(let s of n[i])r[s]||(r[s]={}),r[s][i]=e[i];return r}_splitInteraction(e){let n={};if(e){let r=this._splitEventStore(e.affectedEvents,this._getKeysForEventDefs(e.affectedEvents)),i=this._getKeysForEventDefs(e.mutatedEvents),s=this._splitEventStore(e.mutatedEvents,i),a=o=>{n[o]||(n[o]={affectedEvents:r[o]||Hx,mutatedEvents:s[o]||Hx,isEvent:e.isEvent})};for(let o in r)a(o);for(let o in s)a(o)}return n}}function uX(t,e,n){let r=[];t&&r.push(t),e&&r.push(e);let i={"":TM(r)};return n&&Object.assign(i,n),i}function Ux(t,e,n,r){return{dow:t.getUTCDay(),isDisabled:!!(r&&!ua(r.activeRange,t)),isOther:!!(r&&!ua(r.currentRange,t)),isToday:!!(e&&ua(e,t)),isPast:!!(n?t<n:e&&t<e.start),isFuture:!!(n?t>n:e&&t>=e.end)}}function Fg(t,e){let n=["fc-day",`fc-day-${pY[t.dow]}`];return t.isDisabled?n.push("fc-day-disabled"):(t.isToday&&(n.push("fc-day-today"),n.push(e.getClass("today"))),t.isPast&&n.push("fc-day-past"),t.isFuture&&n.push("fc-day-future"),t.isOther&&n.push("fc-day-other")),n}const hX=ir({year:"numeric",month:"long",day:"numeric"}),fX=ir({week:"long"});function Qd(t,e,n="day",r=!0){const{dateEnv:i,options:s,calendarApi:a}=t;let o=i.format(e,n==="week"?fX:hX);if(s.navLinks){let p=i.toDate(e);const g=y=>{let v=n==="day"?s.navLinkDayClick:n==="week"?s.navLinkWeekClick:null;typeof v=="function"?v.call(a,i.toDate(e),y):(typeof v=="string"&&(n=v),a.zoomTo(e,n))};return Object.assign({title:sf(s.navLinkHint,[o,p],o),"data-navlink":""},r?JA(g):{onClick:g})}return{"aria-label":o}}let Wx=null;function pX(){return Wx===null&&(Wx=mX()),Wx}function mX(){let t=document.createElement("div");rf(t,{position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}),t.innerHTML="<div></div>",document.body.appendChild(t);let n=t.firstChild.getBoundingClientRect().left>t.getBoundingClientRect().left;return ux(t),n}let qx;function gX(){return qx||(qx=yX()),qx}function yX(){let t=document.createElement("div");t.style.overflow="scroll",t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",document.body.appendChild(t);let e=WM(t);return document.body.removeChild(t),e}function WM(t){return{x:t.offsetHeight-t.clientHeight,y:t.offsetWidth-t.clientWidth}}function bX(t,e=!1){let n=window.getComputedStyle(t),r=parseInt(n.borderLeftWidth,10)||0,i=parseInt(n.borderRightWidth,10)||0,s=parseInt(n.borderTopWidth,10)||0,a=parseInt(n.borderBottomWidth,10)||0,o=WM(t),p=o.y-r-i,g=o.x-s-a,y={borderLeft:r,borderRight:i,borderTop:s,borderBottom:a,scrollbarBottom:g,scrollbarLeft:0,scrollbarRight:0};return pX()&&n.direction==="rtl"?y.scrollbarLeft=p:y.scrollbarRight=p,e&&(y.paddingLeft=parseInt(n.paddingLeft,10)||0,y.paddingRight=parseInt(n.paddingRight,10)||0,y.paddingTop=parseInt(n.paddingTop,10)||0,y.paddingBottom=parseInt(n.paddingBottom,10)||0),y}function _X(t,e=!1,n){let r=Gx(t),i=bX(t,e),s={left:r.left+i.borderLeft+i.scrollbarLeft,right:r.right-i.borderRight-i.scrollbarRight,top:r.top+i.borderTop,bottom:r.bottom-i.borderBottom-i.scrollbarBottom};return e&&(s.left+=i.paddingLeft,s.right-=i.paddingRight,s.top+=i.paddingTop,s.bottom-=i.paddingBottom),s}function Gx(t){let e=t.getBoundingClientRect();return{left:e.left+window.scrollX,top:e.top+window.scrollY,right:e.right+window.scrollX,bottom:e.bottom+window.scrollY}}function xX(t){let e=qM(t),n=t.getBoundingClientRect();for(let r of e){let i=UM(n,r.getBoundingClientRect());if(i)n=i;else return null}return n}function qM(t){let e=[];for(;t instanceof HTMLElement;){let n=window.getComputedStyle(t);if(n.position==="fixed")break;/(auto|scroll)/.test(n.overflow+n.overflowY+n.overflowX)&&e.push(t),t=t.parentNode}return e}class eu{constructor(e,n,r,i){this.els=n;let s=this.originClientRect=e.getBoundingClientRect();r&&this.buildElHorizontals(s.left),i&&this.buildElVerticals(s.top)}buildElHorizontals(e){let n=[],r=[];for(let i of this.els){let s=i.getBoundingClientRect();n.push(s.left-e),r.push(s.right-e)}this.lefts=n,this.rights=r}buildElVerticals(e){let n=[],r=[];for(let i of this.els){let s=i.getBoundingClientRect();n.push(s.top-e),r.push(s.bottom-e)}this.tops=n,this.bottoms=r}leftToIndex(e){let{lefts:n,rights:r}=this,i=n.length,s;for(s=0;s<i;s+=1)if(e>=n[s]&&e<r[s])return s}topToIndex(e){let{tops:n,bottoms:r}=this,i=n.length,s;for(s=0;s<i;s+=1)if(e>=n[s]&&e<r[s])return s}getWidth(e){return this.rights[e]-this.lefts[e]}getHeight(e){return this.bottoms[e]-this.tops[e]}similarTo(e){return $g(this.tops||[],e.tops||[])&&$g(this.bottoms||[],e.bottoms||[])&&$g(this.lefts||[],e.lefts||[])&&$g(this.rights||[],e.rights||[])}}function $g(t,e){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(Math.round(t[r])!==Math.round(e[r]))return!1;return!0}class Yx{getMaxScrollTop(){return this.getScrollHeight()-this.getClientHeight()}getMaxScrollLeft(){return this.getScrollWidth()-this.getClientWidth()}canScrollVertically(){return this.getMaxScrollTop()>0}canScrollHorizontally(){return this.getMaxScrollLeft()>0}canScrollUp(){return this.getScrollTop()>0}canScrollDown(){return this.getScrollTop()<this.getMaxScrollTop()}canScrollLeft(){return this.getScrollLeft()>0}canScrollRight(){return this.getScrollLeft()<this.getMaxScrollLeft()}}class vX extends Yx{constructor(e){super(),this.el=e}getScrollTop(){return this.el.scrollTop}getScrollLeft(){return this.el.scrollLeft}setScrollTop(e){this.el.scrollTop=e}setScrollLeft(e){this.el.scrollLeft=e}getScrollWidth(){return this.el.scrollWidth}getScrollHeight(){return this.el.scrollHeight}getClientHeight(){return this.el.clientHeight}getClientWidth(){return this.el.clientWidth}}class wX extends Yx{getScrollTop(){return window.scrollY}getScrollLeft(){return window.scrollX}setScrollTop(e){window.scroll(window.scrollX,e)}setScrollLeft(e){window.scroll(e,window.scrollY)}getScrollWidth(){return document.documentElement.scrollWidth}getScrollHeight(){return document.documentElement.scrollHeight}getClientHeight(){return document.documentElement.clientHeight}getClientWidth(){return document.documentElement.clientWidth}}class co extends Tn{constructor(){super(...arguments),this.uid=_c()}prepareHits(){}queryHit(e,n,r,i){return null}isValidSegDownEl(e){return!this.props.eventDrag&&!this.props.eventResize&&!gi(e,".fc-event-mirror")}isValidDateDownEl(e){return!gi(e,".fc-event:not(.fc-bg-event)")&&!gi(e,".fc-more-link")&&!gi(e,"a[data-navlink]")&&!gi(e,".fc-popover")}}class GM{constructor(e=n=>n.thickness||1){this.getEntryThickness=e,this.strictOrder=!1,this.allowReslicing=!1,this.maxCoord=-1,this.maxStackCnt=-1,this.levelCoords=[],this.entriesByLevel=[],this.stackCnts={}}addSegs(e){let n=[];for(let r of e)this.insertEntry(r,n);return n}insertEntry(e,n){let r=this.findInsertion(e);this.isInsertionValid(r,e)?this.insertEntryAt(e,r):this.handleInvalidInsertion(r,e,n)}isInsertionValid(e,n){return(this.maxCoord===-1||e.levelCoord+this.getEntryThickness(n)<=this.maxCoord)&&(this.maxStackCnt===-1||e.stackCnt<this.maxStackCnt)}handleInvalidInsertion(e,n,r){if(this.allowReslicing&&e.touchingEntry){const i=Object.assign(Object.assign({},n),{span:Xx(n.span,e.touchingEntry.span)});r.push(i),this.splitEntry(n,e.touchingEntry,r)}else r.push(n)}splitEntry(e,n,r){let i=e.span,s=n.span;i.start<s.start&&this.insertEntry({index:e.index,thickness:e.thickness,span:{start:i.start,end:s.start}},r),i.end>s.end&&this.insertEntry({index:e.index,thickness:e.thickness,span:{start:s.end,end:i.end}},r)}insertEntryAt(e,n){let{entriesByLevel:r,levelCoords:i}=this;n.lateral===-1?(Kx(i,n.level,n.levelCoord),Kx(r,n.level,[e])):Kx(r[n.level],n.lateral,e),this.stackCnts[Cc(e)]=n.stackCnt}findInsertion(e){let{levelCoords:n,entriesByLevel:r,strictOrder:i,stackCnts:s}=this,a=n.length,o=0,p=-1,g=-1,y=null,v=0;for(let D=0;D<a;D+=1){const N=n[D];if(!i&&N>=o+this.getEntryThickness(e))break;let B=r[D],F,X=Jx(B,e.span.start,Zx),te=X[0]+X[1];for(;(F=B[te])&&F.span.start<e.span.end;){let H=N+this.getEntryThickness(F);H>o&&(o=H,y=F,p=D,g=te),H===o&&(v=Math.max(v,s[Cc(F)]+1)),te+=1}}let E=0;if(y)for(E=p+1;E<a&&n[E]<o;)E+=1;let T=-1;return E<a&&n[E]===o&&(T=Jx(r[E],e.span.end,Zx)[0]),{touchingLevel:p,touchingLateral:g,touchingEntry:y,stackCnt:v,levelCoord:o,level:E,lateral:T}}toRects(){let{entriesByLevel:e,levelCoords:n}=this,r=e.length,i=[];for(let s=0;s<r;s+=1){let a=e[s],o=n[s];for(let p of a)i.push(Object.assign(Object.assign({},p),{thickness:this.getEntryThickness(p),levelCoord:o}))}return i}}function Zx(t){return t.span.end}function Cc(t){return t.index+":"+t.span.start}function kX(t){let e=[];for(let n of t){let r=[],i={span:n.span,entries:[n]};for(let s of e)Xx(s.span,i.span)?i={entries:s.entries.concat(i.entries),span:EX(s.span,i.span)}:r.push(s);r.push(i),e=r}return e}function EX(t,e){return{start:Math.min(t.start,e.start),end:Math.max(t.end,e.end)}}function Xx(t,e){let n=Math.max(t.start,e.start),r=Math.min(t.end,e.end);return n<r?{start:n,end:r}:null}function Kx(t,e,n){t.splice(e,0,n)}function Jx(t,e,n){let r=0,i=t.length;if(!i||e<n(t[r]))return[0,0];if(e>n(t[i-1]))return[i,0];for(;r<i;){let s=Math.floor(r+(i-r)/2),a=n(t[s]);if(e<a)i=s;else if(e>a)r=s+1;else return[s,1]}return[r,0]}class SX{constructor(e,n){this.emitter=new Lg}destroy(){}setMirrorIsVisible(e){}setMirrorNeedsRevert(e){}setAutoScrollEnabled(e){}}const Qx={};function CX(t,e){return!t||e>10?ir({weekday:"short"}):e>1?ir({weekday:"short",month:"numeric",day:"numeric",omitCommas:!0}):ir({weekday:"long"})}const YM="fc-col-header-cell";function ZM(t){return t.text}class TX extends Tn{render(){let{dateEnv:e,options:n,theme:r,viewApi:i}=this.context,{props:s}=this,{date:a,dateProfile:o}=s,p=Ux(a,s.todayRange,null,o),g=[YM].concat(Fg(p,r)),y=e.format(a,s.dayHeaderFormat),v=!p.isDisabled&&s.colCnt>1?Qd(this.context,a):{},E=Object.assign(Object.assign(Object.assign({date:e.toDate(a),view:i},s.extraRenderProps),{text:y}),p);return ce(yi,{elTag:"th",elClasses:g,elAttrs:Object.assign({role:"columnheader",colSpan:s.colSpan,"data-date":p.isDisabled?void 0:of(a)},s.extraDataAttrs),renderProps:E,generatorName:"dayHeaderContent",customGenerator:n.dayHeaderContent,defaultGenerator:ZM,classNameGenerator:n.dayHeaderClassNames,didMount:n.dayHeaderDidMount,willUnmount:n.dayHeaderWillUnmount},T=>ce("div",{className:"fc-scrollgrid-sync-inner"},!p.isDisabled&&ce(T,{elTag:"a",elAttrs:v,elClasses:["fc-col-header-cell-cushion",s.isSticky&&"fc-sticky"]})))}}const AX=ir({weekday:"long"});class MX extends Tn{render(){let{props:e}=this,{dateEnv:n,theme:r,viewApi:i,options:s}=this.context,a=Ur(new Date(2592e5),e.dow),o={dow:e.dow,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},p=n.format(a,e.dayHeaderFormat),g=Object.assign(Object.assign(Object.assign(Object.assign({date:a},o),{view:i}),e.extraRenderProps),{text:p});return ce(yi,{elTag:"th",elClasses:[YM,...Fg(o,r),...e.extraClassNames||[]],elAttrs:Object.assign({role:"columnheader",colSpan:e.colSpan},e.extraDataAttrs),renderProps:g,generatorName:"dayHeaderContent",customGenerator:s.dayHeaderContent,defaultGenerator:ZM,classNameGenerator:s.dayHeaderClassNames,didMount:s.dayHeaderDidMount,willUnmount:s.dayHeaderWillUnmount},y=>ce("div",{className:"fc-scrollgrid-sync-inner"},ce(y,{elTag:"a",elClasses:["fc-col-header-cell-cushion",e.isSticky&&"fc-sticky"],elAttrs:{"aria-label":n.format(a,AX)}})))}}class tu extends gs{constructor(e,n){super(e,n),this.initialNowDate=df(n.options.now,n.dateEnv),this.initialNowQueriedMs=new Date().valueOf(),this.state=this.computeTiming().currentState}render(){let{props:e,state:n}=this;return e.children(n.nowDate,n.todayRange)}componentDidMount(){this.setTimeout()}componentDidUpdate(e){e.unit!==this.props.unit&&(this.clearTimeout(),this.setTimeout())}componentWillUnmount(){this.clearTimeout()}computeTiming(){let{props:e,context:n}=this,r=il(this.initialNowDate,new Date().valueOf()-this.initialNowQueriedMs),i=n.dateEnv.startOf(r,e.unit),s=n.dateEnv.add(i,gn(1,e.unit)),a=s.valueOf()-r.valueOf();return a=Math.min(1e3*60*60*24,a),{currentState:{nowDate:i,todayRange:XM(i)},nextState:{nowDate:s,todayRange:XM(s)},waitMs:a}}setTimeout(){let{nextState:e,waitMs:n}=this.computeTiming();this.timeoutId=setTimeout(()=>{this.setState(e,()=>{this.setTimeout()})},n)}clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}}tu.contextType=ca;function XM(t){let e=er(t),n=Ur(e,1);return{start:e,end:n}}class KM extends Tn{constructor(){super(...arguments),this.createDayHeaderFormatter=Ft(DX)}render(){let{context:e}=this,{dates:n,dateProfile:r,datesRepDistinctDays:i,renderIntro:s}=this.props,a=this.createDayHeaderFormatter(e.options.dayHeaderFormat,i,n.length);return ce(tu,{unit:"day"},(o,p)=>ce("tr",{role:"row"},s&&s("day"),n.map(g=>i?ce(TX,{key:g.toISOString(),date:g,dateProfile:r,todayRange:p,colCnt:n.length,dayHeaderFormat:a}):ce(MX,{key:g.getUTCDay(),dow:g.getUTCDay(),dayHeaderFormat:a}))))}}function DX(t,e,n){return t||CX(e,n)}class JM{constructor(e,n){let r=e.start,{end:i}=e,s=[],a=[],o=-1;for(;r<i;)n.isHiddenDay(r)?s.push(o+.5):(o+=1,s.push(o),a.push(r)),r=Ur(r,1);this.dates=a,this.indices=s,this.cnt=a.length}sliceRange(e){let n=this.getDateDayIndex(e.start),r=this.getDateDayIndex(Ur(e.end,-1)),i=Math.max(0,n),s=Math.min(this.cnt-1,r);return i=Math.ceil(i),s=Math.floor(s),i<=s?{firstIndex:i,lastIndex:s,isStart:n===i,isEnd:r===s}:null}getDateDayIndex(e){let{indices:n}=this,r=Math.floor(sl(this.dates[0],e));return r<0?n[0]-1:r>=n.length?n[n.length-1]+1:n[r]}}class QM{constructor(e,n){let{dates:r}=e,i,s,a;if(n){for(s=r[0].getUTCDay(),i=1;i<r.length&&r[i].getUTCDay()!==s;i+=1);a=Math.ceil(r.length/i)}else a=1,i=r.length;this.rowCnt=a,this.colCnt=i,this.daySeries=e,this.cells=this.buildCells(),this.headerDates=this.buildHeaderDates()}buildCells(){let e=[];for(let n=0;n<this.rowCnt;n+=1){let r=[];for(let i=0;i<this.colCnt;i+=1)r.push(this.buildCell(n,i));e.push(r)}return e}buildCell(e,n){let r=this.daySeries.dates[e*this.colCnt+n];return{key:r.toISOString(),date:r}}buildHeaderDates(){let e=[];for(let n=0;n<this.colCnt;n+=1)e.push(this.cells[0][n].date);return e}sliceRange(e){let{colCnt:n}=this,r=this.daySeries.sliceRange(e),i=[];if(r){let{firstIndex:s,lastIndex:a}=r,o=s;for(;o<=a;){let p=Math.floor(o/n),g=Math.min((p+1)*n,a+1);i.push({row:p,firstCol:o%n,lastCol:(g-1)%n,isStart:r.isStart&&o===s,isEnd:r.isEnd&&g-1===a}),o=g}}return i}}class eD{constructor(){this.sliceBusinessHours=Ft(this._sliceBusinessHours),this.sliceDateSelection=Ft(this._sliceDateSpan),this.sliceEventStore=Ft(this._sliceEventStore),this.sliceEventDrag=Ft(this._sliceInteraction),this.sliceEventResize=Ft(this._sliceInteraction),this.forceDayIfListItem=!1}sliceProps(e,n,r,i,...s){let{eventUiBases:a}=e,o=this.sliceEventStore(e.eventStore,a,n,r,...s);return{dateSelectionSegs:this.sliceDateSelection(e.dateSelection,n,r,a,i,...s),businessHourSegs:this.sliceBusinessHours(e.businessHours,n,r,i,...s),fgEventSegs:o.fg,bgEventSegs:o.bg,eventDrag:this.sliceEventDrag(e.eventDrag,a,n,r,...s),eventResize:this.sliceEventResize(e.eventResize,a,n,r,...s),eventSelection:e.eventSelection}}sliceNowDate(e,n,r,i,...s){return this._sliceDateSpan({range:{start:e,end:il(e,1)},allDay:!1},n,r,{},i,...s)}_sliceBusinessHours(e,n,r,i,...s){return e?this._sliceEventStore(Ec(e,jg(n,!!r),i),{},n,r,...s).bg:[]}_sliceEventStore(e,n,r,i,...s){if(e){let a=zx(e,n,jg(r,!!i),i);return{bg:this.sliceEventRanges(a.bg,s),fg:this.sliceEventRanges(a.fg,s)}}return{bg:[],fg:[]}}_sliceInteraction(e,n,r,i,...s){if(!e)return null;let a=zx(e.mutatedEvents,n,jg(r,!!i),i);return{segs:this.sliceEventRanges(a.fg,s),affectedInstances:e.affectedEvents.instances,isEvent:e.isEvent}}_sliceDateSpan(e,n,r,i,s,...a){if(!e)return[];let o=jg(n,!!r),p=ll(e.range,o);if(p){e=Object.assign(Object.assign({},e),{range:p});let g=QZ(e,i,s),y=this.sliceRange(e.range,...a);for(let v of y)v.eventRange=g;return y}return[]}sliceEventRanges(e,n){let r=[];for(let i of e)r.push(...this.sliceEventRange(i,n));return r}sliceEventRange(e,n){let r=e.range;this.forceDayIfListItem&&e.ui.display==="list-item"&&(r={start:r.start,end:Ur(r.start,1)});let i=this.sliceRange(r,...n);for(let s of i)s.eventRange=e,s.isStart=e.isStart&&s.isStart,s.isEnd=e.isEnd&&s.isEnd;return i}}function jg(t,e){let n=t.activeRange;return e?n:{start:il(n.start,t.slotMinTime.milliseconds),end:il(n.end,t.slotMaxTime.milliseconds-864e5)}}function tD(t,e,n){let{instances:r}=t.mutatedEvents;for(let i in r)if(!Rg(e.validRange,r[i].range))return!1;return nD({eventDrag:t},n)}function IX(t,e,n){return Rg(e.validRange,t.range)?nD({dateSelection:t},n):!1}function nD(t,e){let n=e.getCurrentData(),r=Object.assign({businessHours:n.businessHours,dateSelection:"",eventStore:n.eventStore,eventUiBases:n.eventUiBases,eventSelection:"",eventDrag:null,eventResize:null},t);return(e.pluginHooks.isPropsValid||PX)(r,e)}function PX(t,e,n={},r){return!(t.eventDrag&&!RX(t,e,n,r)||t.dateSelection&&!OX(t,e,n,r))}function RX(t,e,n,r){let i=e.getCurrentData(),s=t.eventDrag,a=s.mutatedEvents,o=a.defs,p=a.instances,g=Vg(o,s.isEvent?t.eventUiBases:{"":i.selectionConfig});r&&(g=la(g,r));let y=IZ(t.eventStore,s.affectedEvents.instances),v=y.defs,E=y.instances,T=Vg(v,t.eventUiBases);for(let D in p){let N=p[D],B=N.range,F=g[N.defId],X=o[N.defId];if(!rD(F.constraints,B,y,t.businessHours,e))return!1;let{eventOverlap:te}=e.options,H=typeof te=="function"?te:null;for(let ge in E){let Se=E[ge];if(Tx(B,Se.range)&&(T[Se.defId].overlap===!1&&s.isEvent||F.overlap===!1||H&&!H(new lr(e,v[Se.defId],Se),new lr(e,X,N))))return!1}let ke=i.eventStore;for(let ge of F.allows){let Se=Object.assign(Object.assign({},n),{range:N.range,allDay:X.allDay}),Pe=ke.defs[X.defId],Ne=ke.instances[D],at;if(Pe?at=new lr(e,Pe,Ne):at=new lr(e,X),!ge(Nx(Se,e),at))return!1}}return!0}function OX(t,e,n,r){let i=t.eventStore,s=i.defs,a=i.instances,o=t.dateSelection,p=o.range,{selectionConfig:g}=e.getCurrentData();if(r&&(g=r(g)),!rD(g.constraints,p,i,t.businessHours,e))return!1;let{selectOverlap:y}=e.options,v=typeof y=="function"?y:null;for(let E in a){let T=a[E];if(Tx(p,T.range)&&(g.overlap===!1||v&&!v(new lr(e,s[T.defId],T),null)))return!1}for(let E of g.allows){let T=Object.assign(Object.assign({},n),o);if(!E(Nx(T,e),null))return!1}return!0}function rD(t,e,n,r,i){for(let s of t)if(!BX(NX(s,e,n,r,i),e))return!1;return!0}function NX(t,e,n,r,i){return t==="businessHours"?ev(Ec(r,e,i)):typeof t=="string"?ev(Ng(n,s=>s.groupId===t)):typeof t=="object"&&t?ev(Ec(t,e,i)):[]}function ev(t){let{instances:e}=t,n=[];for(let r in e)n.push(e[r].range);return n}function BX(t,e){for(let n of t)if(Rg(n,e))return!0;return!1}const Hg=/^(visible|hidden)$/;class iD extends Tn{constructor(){super(...arguments),this.handleEl=e=>{this.el=e,da(this.props.elRef,e)}}render(){let{props:e}=this,{liquid:n,liquidIsAbsolute:r}=e,i=n&&r,s=["fc-scroller"];return n&&(r?s.push("fc-scroller-liquid-absolute"):s.push("fc-scroller-liquid")),ce("div",{ref:this.handleEl,className:s.join(" "),style:{overflowX:e.overflowX,overflowY:e.overflowY,left:i&&-(e.overcomeLeft||0)||"",right:i&&-(e.overcomeRight||0)||"",bottom:i&&-(e.overcomeBottom||0)||"",marginLeft:!i&&-(e.overcomeLeft||0)||"",marginRight:!i&&-(e.overcomeRight||0)||"",marginBottom:!i&&-(e.overcomeBottom||0)||"",maxHeight:e.maxHeight||""}},e.children)}needsXScrolling(){if(Hg.test(this.props.overflowX))return!1;let{el:e}=this,n=this.el.getBoundingClientRect().width-this.getYScrollbarWidth(),{children:r}=e;for(let i=0;i<r.length;i+=1)if(r[i].getBoundingClientRect().width>n)return!0;return!1}needsYScrolling(){if(Hg.test(this.props.overflowY))return!1;let{el:e}=this,n=this.el.getBoundingClientRect().height-this.getXScrollbarWidth(),{children:r}=e;for(let i=0;i<r.length;i+=1)if(r[i].getBoundingClientRect().height>n)return!0;return!1}getXScrollbarWidth(){return Hg.test(this.props.overflowX)?0:this.el.offsetHeight-this.el.clientHeight}getYScrollbarWidth(){return Hg.test(this.props.overflowY)?0:this.el.offsetWidth-this.el.clientWidth}}class fa{constructor(e){this.masterCallback=e,this.currentMap={},this.depths={},this.callbackMap={},this.handleValue=(n,r)=>{let{depths:i,currentMap:s}=this,a=!1,o=!1;n!==null?(a=r in s,s[r]=n,i[r]=(i[r]||0)+1,o=!0):(i[r]-=1,i[r]||(delete s[r],delete this.callbackMap[r],a=!0)),this.masterCallback&&(a&&this.masterCallback(null,String(r)),o&&this.masterCallback(n,String(r)))}}createRef(e){let n=this.callbackMap[e];return n||(n=this.callbackMap[e]=r=>{this.handleValue(r,String(e))}),n}collect(e,n,r){return GY(this.currentMap,e,n,r)}getAll(){return wx(this.currentMap)}}function zX(t){let e=qG(t,".fc-scrollgrid-shrink"),n=0;for(let r of e)n=Math.max(n,oY(r));return Math.ceil(n)}function sD(t,e){return t.liquid&&e.liquid}function LX(t,e){return e.maxHeight!=null||sD(t,e)}function VX(t,e,n,r){let{expandRows:i}=n;return typeof e.content=="function"?e.content(n):ce("table",{role:"presentation",className:[e.tableClassName,t.syncRowHeights?"fc-scrollgrid-sync-table":""].join(" "),style:{minWidth:n.tableMinWidth,width:n.clientWidth,height:i?n.clientHeight:""}},n.tableColGroupNode,ce(r?"thead":"tbody",{role:"presentation"},typeof e.rowContent=="function"?e.rowContent(n):e.rowContent))}function FX(t,e){return rl(t,e,Po)}function $X(t,e){let n=[];for(let r of t){let i=r.span||1;for(let s=0;s<i;s+=1)n.push(ce("col",{style:{width:r.width==="shrink"?jX(e):r.width||"",minWidth:r.minWidth||""}}))}return ce("colgroup",{},...n)}function jX(t){return t??4}function HX(t){for(let e of t)if(e.width==="shrink")return!0;return!1}function UX(t,e){let n=["fc-scrollgrid",e.theme.getClass("table")];return t&&n.push("fc-scrollgrid-liquid"),n}function WX(t,e){let n=["fc-scrollgrid-section",`fc-scrollgrid-section-${t.type}`,t.className];return e&&t.liquid&&t.maxHeight==null&&n.push("fc-scrollgrid-section-liquid"),t.isSticky&&n.push("fc-scrollgrid-section-sticky"),n}function tv(t){return ce("div",{className:"fc-scrollgrid-sticky-shim",style:{width:t.clientWidth,minWidth:t.tableMinWidth}})}function Ug(t){let{stickyHeaderDates:e}=t;return(e==null||e==="auto")&&(e=t.height==="auto"||t.viewHeight==="auto"),e}function oD(t){let{stickyFooterScrollbar:e}=t;return(e==null||e==="auto")&&(e=t.height==="auto"||t.viewHeight==="auto"),e}class nv extends Tn{constructor(){super(...arguments),this.processCols=Ft(e=>e,FX),this.renderMicroColGroup=Ft($X),this.scrollerRefs=new fa,this.scrollerElRefs=new fa(this._handleScrollerEl.bind(this)),this.state={shrinkWidth:null,forceYScrollbars:!1,scrollerClientWidths:{},scrollerClientHeights:{}},this.handleSizing=()=>{this.safeSetState(Object.assign({shrinkWidth:this.computeShrinkWidth()},this.computeScrollerDims()))}}render(){let{props:e,state:n,context:r}=this,i=e.sections||[],s=this.processCols(e.cols),a=this.renderMicroColGroup(s,n.shrinkWidth),o=UX(e.liquid,r);e.collapsibleWidth&&o.push("fc-scrollgrid-collapsible");let p=i.length,g=0,y,v=[],E=[],T=[];for(;g<p&&(y=i[g]).type==="header";)v.push(this.renderSection(y,a,!0)),g+=1;for(;g<p&&(y=i[g]).type==="body";)E.push(this.renderSection(y,a,!1)),g+=1;for(;g<p&&(y=i[g]).type==="footer";)T.push(this.renderSection(y,a,!0)),g+=1;let D=!HM();const N={role:"rowgroup"};return ce("table",{role:"grid",className:o.join(" "),style:{height:e.height}},!!(!D&&v.length)&&ce("thead",N,...v),!!(!D&&E.length)&&ce("tbody",N,...E),!!(!D&&T.length)&&ce("tfoot",N,...T),D&&ce("tbody",N,...v,...E,...T))}renderSection(e,n,r){return"outerContent"in e?ce(Qn,{key:e.key},e.outerContent):ce("tr",{key:e.key,role:"presentation",className:WX(e,this.props.liquid).join(" ")},this.renderChunkTd(e,n,e.chunk,r))}renderChunkTd(e,n,r,i){if("outerContent"in r)return r.outerContent;let{props:s}=this,{forceYScrollbars:a,scrollerClientWidths:o,scrollerClientHeights:p}=this.state,g=LX(s,e),y=sD(s,e),v=s.liquid?a?"scroll":g?"auto":"hidden":"visible",E=e.key,T=VX(e,r,{tableColGroupNode:n,tableMinWidth:"",clientWidth:!s.collapsibleWidth&&o[E]!==void 0?o[E]:null,clientHeight:p[E]!==void 0?p[E]:null,expandRows:e.expandRows,syncRowHeights:!1,rowSyncHeights:[],reportRowHeightChange:()=>{}},i);return ce(i?"th":"td",{ref:r.elRef,role:"presentation"},ce("div",{className:`fc-scroller-harness${y?" fc-scroller-harness-liquid":""}`},ce(iD,{ref:this.scrollerRefs.createRef(E),elRef:this.scrollerElRefs.createRef(E),overflowY:v,overflowX:s.liquid?"hidden":"visible",maxHeight:e.maxHeight,liquid:y,liquidIsAbsolute:!0},T)))}_handleScrollerEl(e,n){let r=qX(this.props.sections,n);r&&da(r.chunk.scrollerElRef,e)}componentDidMount(){this.handleSizing(),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(){this.handleSizing()}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing)}computeShrinkWidth(){return HX(this.props.cols)?zX(this.scrollerElRefs.getAll()):0}computeScrollerDims(){let e=gX(),{scrollerRefs:n,scrollerElRefs:r}=this,i=!1,s={},a={};for(let o in n.currentMap){let p=n.currentMap[o];if(p&&p.needsYScrolling()){i=!0;break}}for(let o of this.props.sections){let p=o.key,g=r.currentMap[p];if(g){let y=g.parentNode;s[p]=Math.floor(y.getBoundingClientRect().width-(i?e.y:0)),a[p]=Math.floor(y.getBoundingClientRect().height)}}return{forceYScrollbars:i,scrollerClientWidths:s,scrollerClientHeights:a}}}nv.addStateEquality({scrollerClientWidths:Po,scrollerClientHeights:Po});function qX(t,e){for(let n of t)if(n.key===e)return n;return null}class Wg extends Tn{constructor(){super(...arguments),this.handleEl=e=>{this.el=e,e&&zM(e,this.props.seg)}}render(){const{props:e,context:n}=this,{options:r}=n,{seg:i}=e,{eventRange:s}=i,{ui:a}=s,o={event:new lr(n,s.def,s.instance),view:n.viewApi,timeText:e.timeText,textColor:a.textColor,backgroundColor:a.backgroundColor,borderColor:a.borderColor,isDraggable:!e.disableDragging&&HZ(i,n),isStartResizable:!e.disableResizing&&UZ(i,n),isEndResizable:!e.disableResizing&&WZ(i),isMirror:!!(e.isDragging||e.isResizing||e.isDateSelecting),isStart:!!i.isStart,isEnd:!!i.isEnd,isPast:!!e.isPast,isFuture:!!e.isFuture,isToday:!!e.isToday,isSelected:!!e.isSelected,isDragging:!!e.isDragging,isResizing:!!e.isResizing};return ce(yi,Object.assign({},e,{elRef:this.handleEl,elClasses:[...qZ(o),...i.eventRange.ui.classNames,...e.elClasses||[]],renderProps:o,generatorName:"eventContent",customGenerator:r.eventContent,defaultGenerator:e.defaultGenerator,classNameGenerator:r.eventClassNames,didMount:r.eventDidMount,willUnmount:r.eventWillUnmount}))}componentDidUpdate(e){this.el&&this.props.seg!==e.seg&&zM(this.el,this.props.seg)}}class aD extends Tn{render(){let{props:e,context:n}=this,{options:r}=n,{seg:i}=e,{ui:s}=i.eventRange,a=r.eventTimeFormat||e.defaultTimeFormat,o=hf(i,a,n,e.defaultDisplayEventTime,e.defaultDisplayEventEnd);return ce(Wg,Object.assign({},e,{elTag:"a",elStyle:{borderColor:s.borderColor,backgroundColor:s.backgroundColor},elAttrs:Vx(i,n),defaultGenerator:GX,timeText:o}),(p,g)=>ce(Qn,null,ce(p,{elTag:"div",elClasses:["fc-event-main"],elStyle:{color:g.textColor}}),!!g.isStartResizable&&ce("div",{className:"fc-event-resizer fc-event-resizer-start"}),!!g.isEndResizable&&ce("div",{className:"fc-event-resizer fc-event-resizer-end"})))}}function GX(t){return ce("div",{className:"fc-event-main-frame"},t.timeText&&ce("div",{className:"fc-event-time"},t.timeText),ce("div",{className:"fc-event-title-container"},ce("div",{className:"fc-event-title fc-sticky"},t.event.title||ce(Qn,null," "))))}const rv=t=>ce(ca.Consumer,null,e=>{let{options:n}=e,r={isAxis:t.isAxis,date:e.dateEnv.toDate(t.date),view:e.viewApi};return ce(yi,Object.assign({},t,{elTag:t.elTag||"div",renderProps:r,generatorName:"nowIndicatorContent",customGenerator:n.nowIndicatorContent,classNameGenerator:n.nowIndicatorClassNames,didMount:n.nowIndicatorDidMount,willUnmount:n.nowIndicatorWillUnmount}))}),YX=ir({day:"numeric"});class iv extends Tn{constructor(){super(...arguments),this.refineRenderProps=Cg(ZX)}render(){let{props:e,context:n}=this,{options:r}=n,i=this.refineRenderProps({date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,isMonthStart:e.isMonthStart||!1,showDayNumber:e.showDayNumber,extraRenderProps:e.extraRenderProps,viewApi:n.viewApi,dateEnv:n.dateEnv,monthStartFormat:r.monthStartFormat});return ce(yi,Object.assign({},e,{elClasses:[...Fg(i,n.theme),...e.elClasses||[]],elAttrs:Object.assign(Object.assign({},e.elAttrs),i.isDisabled?{}:{"data-date":of(e.date)}),renderProps:i,generatorName:"dayCellContent",customGenerator:r.dayCellContent,defaultGenerator:e.defaultGenerator,classNameGenerator:i.isDisabled?void 0:r.dayCellClassNames,didMount:r.dayCellDidMount,willUnmount:r.dayCellWillUnmount}))}}function sv(t){return!!(t.dayCellContent||Cx("dayCellContent",t))}function ZX(t){let{date:e,dateEnv:n,dateProfile:r,isMonthStart:i}=t,s=Ux(e,t.todayRange,null,r),a=t.showDayNumber?n.format(e,i?t.monthStartFormat:YX):"";return Object.assign(Object.assign(Object.assign({date:n.toDate(e),view:t.viewApi},s),{isMonthStart:i,dayNumberText:a}),t.extraRenderProps)}class lD extends Tn{render(){let{props:e}=this,{seg:n}=e;return ce(Wg,{elTag:"div",elClasses:["fc-bg-event"],elStyle:{backgroundColor:n.eventRange.ui.backgroundColor},defaultGenerator:XX,seg:n,timeText:"",isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,disableDragging:!0,disableResizing:!0})}}function XX(t){let{title:e}=t.event;return e&&ce("div",{className:"fc-event-title"},t.event.title)}function cD(t){return ce("div",{className:`fc-${t}`})}const dD=t=>ce(ca.Consumer,null,e=>{let{dateEnv:n,options:r}=e,{date:i}=t,s=r.weekNumberFormat||t.defaultFormat,a=n.computeWeekNumber(i),o=n.format(i,s);return ce(yi,Object.assign({},t,{renderProps:{num:a,text:o,date:i},generatorName:"weekNumberContent",customGenerator:r.weekNumberContent,defaultGenerator:KX,classNameGenerator:r.weekNumberClassNames,didMount:r.weekNumberDidMount,willUnmount:r.weekNumberWillUnmount}))});function KX(t){return t.text}const ov=10;class JX extends Tn{constructor(){super(...arguments),this.state={titleId:nl()},this.handleRootEl=e=>{this.rootEl=e,this.props.elRef&&da(this.props.elRef,e)},this.handleDocumentMouseDown=e=>{const n=YA(e);this.rootEl.contains(n)||this.handleCloseClick()},this.handleDocumentKeyDown=e=>{e.key==="Escape"&&this.handleCloseClick()},this.handleCloseClick=()=>{let{onClose:e}=this.props;e&&e()}}render(){let{theme:e,options:n}=this.context,{props:r,state:i}=this,s=["fc-popover",e.getClass("popover")].concat(r.extraClassNames||[]);return PG(ce("div",Object.assign({},r.extraAttrs,{id:r.id,className:s.join(" "),"aria-labelledby":i.titleId,ref:this.handleRootEl}),ce("div",{className:"fc-popover-header "+e.getClass("popoverHeader")},ce("span",{className:"fc-popover-title",id:i.titleId},r.title),ce("span",{className:"fc-popover-close "+e.getIconClass("close"),title:n.closeHint,onClick:this.handleCloseClick})),ce("div",{className:"fc-popover-body "+e.getClass("popoverContent")},r.children)),r.parentEl)}componentDidMount(){document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown),this.updateSize()}componentWillUnmount(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown)}updateSize(){let{isRtl:e}=this.context,{alignmentEl:n,alignGridTop:r}=this.props,{rootEl:i}=this,s=xX(n);if(s){let a=i.getBoundingClientRect(),o=r?gi(n,".fc-scrollgrid").getBoundingClientRect().top:s.top,p=e?s.right-a.width:s.left;o=Math.max(o,ov),p=Math.min(p,document.documentElement.clientWidth-ov-a.width),p=Math.max(p,ov);let g=i.offsetParent.getBoundingClientRect();rf(i,{top:o-g.top,left:p-g.left})}}}class QX extends co{constructor(){super(...arguments),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,useEventCenter:!1}):this.context.unregisterInteractiveComponent(this)}}render(){let{options:e,dateEnv:n}=this.context,{props:r}=this,{startDate:i,todayRange:s,dateProfile:a}=r,o=n.format(i,e.dayPopoverFormat);return ce(iv,{elRef:this.handleRootEl,date:i,dateProfile:a,todayRange:s},(p,g,y)=>ce(JX,{elRef:y.ref,id:r.id,title:o,extraClassNames:["fc-more-popover"].concat(y.className||[]),extraAttrs:y,parentEl:r.parentEl,alignmentEl:r.alignmentEl,alignGridTop:r.alignGridTop,onClose:r.onClose},sv(e)&&ce(p,{elTag:"div",elClasses:["fc-more-popover-misc"]}),r.children))}queryHit(e,n,r,i){let{rootEl:s,props:a}=this;return e>=0&&e<r&&n>=0&&n<i?{dateProfile:a.dateProfile,dateSpan:Object.assign({allDay:!a.forceTimed,range:{start:a.startDate,end:a.endDate}},a.extraDateSpan),dayEl:s,rect:{left:0,top:0,right:r,bottom:i},layer:1}:null}}class uD extends Tn{constructor(){super(...arguments),this.state={isPopoverOpen:!1,popoverId:nl()},this.handleLinkEl=e=>{this.linkEl=e,this.props.elRef&&da(this.props.elRef,e)},this.handleClick=e=>{let{props:n,context:r}=this,{moreLinkClick:i}=r.options,s=hD(n).start;function a(o){let{def:p,instance:g,range:y}=o.eventRange;return{event:new lr(r,p,g),start:r.dateEnv.toDate(y.start),end:r.dateEnv.toDate(y.end),isStart:o.isStart,isEnd:o.isEnd}}typeof i=="function"&&(i=i({date:s,allDay:!!n.allDayDate,allSegs:n.allSegs.map(a),hiddenSegs:n.hiddenSegs.map(a),jsEvent:e,view:r.viewApi})),!i||i==="popover"?this.setState({isPopoverOpen:!0}):typeof i=="string"&&r.calendarApi.zoomTo(s,i)},this.handlePopoverClose=()=>{this.setState({isPopoverOpen:!1})}}render(){let{props:e,state:n}=this;return ce(ca.Consumer,null,r=>{let{viewApi:i,options:s,calendarApi:a}=r,{moreLinkText:o}=s,{moreCnt:p}=e,g=hD(e),y=typeof o=="function"?o.call(a,p):`+${p} ${o}`,v=sf(s.moreLinkHint,[p],y),E={num:p,shortText:`+${p}`,text:y,view:i};return ce(Qn,null,!!e.moreCnt&&ce(yi,{elTag:e.elTag||"a",elRef:this.handleLinkEl,elClasses:[...e.elClasses||[],"fc-more-link"],elStyle:e.elStyle,elAttrs:Object.assign(Object.assign(Object.assign({},e.elAttrs),JA(this.handleClick)),{title:v,"aria-expanded":n.isPopoverOpen,"aria-controls":n.isPopoverOpen?n.popoverId:""}),renderProps:E,generatorName:"moreLinkContent",customGenerator:s.moreLinkContent,defaultGenerator:e.defaultGenerator||eK,classNameGenerator:s.moreLinkClassNames,didMount:s.moreLinkDidMount,willUnmount:s.moreLinkWillUnmount},e.children),n.isPopoverOpen&&ce(QX,{id:n.popoverId,startDate:g.start,endDate:g.end,dateProfile:e.dateProfile,todayRange:e.todayRange,extraDateSpan:e.extraDateSpan,parentEl:this.parentEl,alignmentEl:e.alignmentElRef?e.alignmentElRef.current:this.linkEl,alignGridTop:e.alignGridTop,forceTimed:e.forceTimed,onClose:this.handlePopoverClose},e.popoverContent()))})}componentDidMount(){this.updateParentEl()}componentDidUpdate(){this.updateParentEl()}updateParentEl(){this.linkEl&&(this.parentEl=gi(this.linkEl,".fc-view-harness"))}}function eK(t){return t.text}function hD(t){if(t.allDayDate)return{start:t.allDayDate,end:Ur(t.allDayDate,1)};let{hiddenSegs:e}=t;return{start:fD(e),end:nK(e)}}function fD(t){return t.reduce(tK).eventRange.range.start}function tK(t,e){return t.eventRange.range.start<e.eventRange.range.start?t:e}function nK(t){return t.reduce(rK).eventRange.range.end}function rK(t,e){return t.eventRange.range.end>e.eventRange.range.end?t:e}class iK{constructor(){this.handlers=[]}set(e){this.currentValue=e;for(let n of this.handlers)n(e)}subscribe(e){this.handlers.push(e),this.currentValue!==void 0&&e(this.currentValue)}}class sK extends iK{constructor(){super(...arguments),this.map=new Map}handle(e){const{map:n}=this;let r=!1;e.isActive?(n.set(e.id,e),r=!0):n.has(e.id)&&(n.delete(e.id),r=!0),r&&this.set(n)}}const oK=[],pD={code:"en",week:{dow:0,doy:4},direction:"ltr",buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day",list:"list"},weekText:"W",weekTextLong:"Week",closeHint:"Close",timeHint:"Time",eventHint:"Event",allDayText:"all-day",moreLinkText:"more",noEventsText:"No events to display"},mD=Object.assign(Object.assign({},pD),{buttonHints:{prev:"Previous $0",next:"Next $0",today(t,e){return e==="day"?"Today":`This ${t}`}},viewHint:"$0 view",navLinkHint:"Go to $0",moreLinkHint(t){return`Show ${t} more event${t===1?"":"s"}`}});function aK(t){let e=t.length>0?t[0].code:"en",n=oK.concat(t),r={en:mD};for(let i of n)r[i.code]=i;return{map:r,defaultCode:e}}function gD(t,e){return typeof t=="object"&&!Array.isArray(t)?yD(t.code,[t.code],t):lK(t,e)}function lK(t,e){let n=[].concat(t||[]),r=cK(n,e)||mD;return yD(t,n,r)}function cK(t,e){for(let n=0;n<t.length;n+=1){let r=t[n].toLocaleLowerCase().split("-");for(let i=r.length;i>0;i-=1){let s=r.slice(0,i).join("-");if(e[s])return e[s]}}return null}function yD(t,e,n){let r=vx([pD,n],["buttonText"]);delete r.code;let{week:i}=r;return delete r.week,{codeArg:t,codes:e,week:i,simpleNumberFormat:new Intl.NumberFormat(t),options:r}}function Ro(t){return{id:_c(),name:t.name,premiumReleaseDate:t.premiumReleaseDate?new Date(t.premiumReleaseDate):void 0,deps:t.deps||[],reducers:t.reducers||[],isLoadingFuncs:t.isLoadingFuncs||[],contextInit:[].concat(t.contextInit||[]),eventRefiners:t.eventRefiners||{},eventDefMemberAdders:t.eventDefMemberAdders||[],eventSourceRefiners:t.eventSourceRefiners||{},isDraggableTransformers:t.isDraggableTransformers||[],eventDragMutationMassagers:t.eventDragMutationMassagers||[],eventDefMutationAppliers:t.eventDefMutationAppliers||[],dateSelectionTransformers:t.dateSelectionTransformers||[],datePointTransforms:t.datePointTransforms||[],dateSpanTransforms:t.dateSpanTransforms||[],views:t.views||{},viewPropsTransformers:t.viewPropsTransformers||[],isPropsValid:t.isPropsValid||null,externalDefTransforms:t.externalDefTransforms||[],viewContainerAppends:t.viewContainerAppends||[],eventDropTransformers:t.eventDropTransformers||[],componentInteractions:t.componentInteractions||[],calendarInteractions:t.calendarInteractions||[],themeClasses:t.themeClasses||{},eventSourceDefs:t.eventSourceDefs||[],cmdFormatter:t.cmdFormatter,recurringTypes:t.recurringTypes||[],namedTimeZonedImpl:t.namedTimeZonedImpl,initialView:t.initialView||"",elementDraggingImpl:t.elementDraggingImpl,optionChangeHandlers:t.optionChangeHandlers||{},scrollGridImpl:t.scrollGridImpl||null,listenerRefiners:t.listenerRefiners||{},optionRefiners:t.optionRefiners||{},propSetHandlers:t.propSetHandlers||{}}}function dK(t,e){let n={},r={premiumReleaseDate:void 0,reducers:[],isLoadingFuncs:[],contextInit:[],eventRefiners:{},eventDefMemberAdders:[],eventSourceRefiners:{},isDraggableTransformers:[],eventDragMutationMassagers:[],eventDefMutationAppliers:[],dateSelectionTransformers:[],datePointTransforms:[],dateSpanTransforms:[],views:{},viewPropsTransformers:[],isPropsValid:null,externalDefTransforms:[],viewContainerAppends:[],eventDropTransformers:[],componentInteractions:[],calendarInteractions:[],themeClasses:{},eventSourceDefs:[],cmdFormatter:null,recurringTypes:[],namedTimeZonedImpl:null,initialView:"",elementDraggingImpl:null,optionChangeHandlers:{},scrollGridImpl:null,listenerRefiners:{},optionRefiners:{},propSetHandlers:{}};function i(s){for(let a of s){const o=a.name,p=n[o];p===void 0?(n[o]=a.id,i(a.deps),r=hK(r,a)):p!==a.id&&console.warn(`Duplicate plugin '${o}'`)}}return t&&i(t),i(e),r}function uK(){let t=[],e=[],n;return(r,i)=>((!n||!rl(r,t)||!rl(i,e))&&(n=dK(r,i)),t=r,e=i,n)}function hK(t,e){return{premiumReleaseDate:fK(t.premiumReleaseDate,e.premiumReleaseDate),reducers:t.reducers.concat(e.reducers),isLoadingFuncs:t.isLoadingFuncs.concat(e.isLoadingFuncs),contextInit:t.contextInit.concat(e.contextInit),eventRefiners:Object.assign(Object.assign({},t.eventRefiners),e.eventRefiners),eventDefMemberAdders:t.eventDefMemberAdders.concat(e.eventDefMemberAdders),eventSourceRefiners:Object.assign(Object.assign({},t.eventSourceRefiners),e.eventSourceRefiners),isDraggableTransformers:t.isDraggableTransformers.concat(e.isDraggableTransformers),eventDragMutationMassagers:t.eventDragMutationMassagers.concat(e.eventDragMutationMassagers),eventDefMutationAppliers:t.eventDefMutationAppliers.concat(e.eventDefMutationAppliers),dateSelectionTransformers:t.dateSelectionTransformers.concat(e.dateSelectionTransformers),datePointTransforms:t.datePointTransforms.concat(e.datePointTransforms),dateSpanTransforms:t.dateSpanTransforms.concat(e.dateSpanTransforms),views:Object.assign(Object.assign({},t.views),e.views),viewPropsTransformers:t.viewPropsTransformers.concat(e.viewPropsTransformers),isPropsValid:e.isPropsValid||t.isPropsValid,externalDefTransforms:t.externalDefTransforms.concat(e.externalDefTransforms),viewContainerAppends:t.viewContainerAppends.concat(e.viewContainerAppends),eventDropTransformers:t.eventDropTransformers.concat(e.eventDropTransformers),calendarInteractions:t.calendarInteractions.concat(e.calendarInteractions),componentInteractions:t.componentInteractions.concat(e.componentInteractions),themeClasses:Object.assign(Object.assign({},t.themeClasses),e.themeClasses),eventSourceDefs:t.eventSourceDefs.concat(e.eventSourceDefs),cmdFormatter:e.cmdFormatter||t.cmdFormatter,recurringTypes:t.recurringTypes.concat(e.recurringTypes),namedTimeZonedImpl:e.namedTimeZonedImpl||t.namedTimeZonedImpl,initialView:t.initialView||e.initialView,elementDraggingImpl:t.elementDraggingImpl||e.elementDraggingImpl,optionChangeHandlers:Object.assign(Object.assign({},t.optionChangeHandlers),e.optionChangeHandlers),scrollGridImpl:e.scrollGridImpl||t.scrollGridImpl,listenerRefiners:Object.assign(Object.assign({},t.listenerRefiners),e.listenerRefiners),optionRefiners:Object.assign(Object.assign({},t.optionRefiners),e.optionRefiners),propSetHandlers:Object.assign(Object.assign({},t.propSetHandlers),e.propSetHandlers)}}function fK(t,e){return t===void 0?e:e===void 0?t:new Date(Math.max(t.valueOf(),e.valueOf()))}class cl extends lf{}cl.prototype.classes={root:"fc-theme-standard",tableCellShaded:"fc-cell-shaded",buttonGroup:"fc-button-group",button:"fc-button fc-button-primary",buttonActive:"fc-button-active"},cl.prototype.baseIconClass="fc-icon",cl.prototype.iconClasses={close:"fc-icon-x",prev:"fc-icon-chevron-left",next:"fc-icon-chevron-right",prevYear:"fc-icon-chevrons-left",nextYear:"fc-icon-chevrons-right"},cl.prototype.rtlIconClasses={prev:"fc-icon-chevron-right",next:"fc-icon-chevron-left",prevYear:"fc-icon-chevrons-right",nextYear:"fc-icon-chevrons-left"},cl.prototype.iconOverrideOption="buttonIcons",cl.prototype.iconOverrideCustomButtonOption="icon",cl.prototype.iconOverridePrefix="fc-icon-";function pK(t,e){let n={},r;for(r in t)av(r,n,t,e);for(r in e)av(r,n,t,e);return n}function av(t,e,n,r){if(e[t])return e[t];let i=mK(t,e,n,r);return i&&(e[t]=i),i}function mK(t,e,n,r){let i=n[t],s=r[t],a=y=>i&&i[y]!==null?i[y]:s&&s[y]!==null?s[y]:null,o=a("component"),p=a("superType"),g=null;if(p){if(p===t)throw new Error("Can't have a custom view type that references itself");g=av(p,e,n,r)}return!o&&g&&(o=g.component),o?{type:t,component:o,defaults:Object.assign(Object.assign({},g?g.defaults:{}),i?i.rawOptions:{}),overrides:Object.assign(Object.assign({},g?g.overrides:{}),s?s.rawOptions:{})}:null}function bD(t){return la(t,gK)}function gK(t){let e=typeof t=="function"?{component:t}:t,{component:n}=e;return e.content?n=_D(e):n&&!(n.prototype instanceof Tn)&&(n=_D(Object.assign(Object.assign({},e),{content:n}))),{superType:e.type,component:n,rawOptions:e}}function _D(t){return e=>ce(ca.Consumer,null,n=>ce(yi,{elTag:"div",elClasses:_M(n.viewSpec),renderProps:Object.assign(Object.assign({},e),{nextDayThreshold:n.options.nextDayThreshold}),generatorName:void 0,customGenerator:t.content,classNameGenerator:t.classNames,didMount:t.didMount,willUnmount:t.willUnmount}))}function yK(t,e,n,r){let i=bD(t),s=bD(e.views),a=pK(i,s);return la(a,o=>bK(o,s,e,n,r))}function bK(t,e,n,r,i){let s=t.overrides.duration||t.defaults.duration||r.duration||n.duration,a=null,o="",p="",g={};if(s&&(a=_K(s),a)){let E=gx(a);o=E.unit,E.value===1&&(p=o,g=e[o]?e[o].rawOptions:{})}let y=E=>{let T=E.buttonText||{},D=t.defaults.buttonTextKey;return D!=null&&T[D]!=null?T[D]:T[t.type]!=null?T[t.type]:T[p]!=null?T[p]:null},v=E=>{let T=E.buttonHints||{},D=t.defaults.buttonTextKey;return D!=null&&T[D]!=null?T[D]:T[t.type]!=null?T[t.type]:T[p]!=null?T[p]:null};return{type:t.type,component:t.component,duration:a,durationUnit:o,singleUnit:p,optionDefaults:t.defaults,optionOverrides:Object.assign(Object.assign({},g),t.overrides),buttonTextOverride:y(r)||y(n)||t.overrides.buttonText,buttonTextDefault:y(i)||t.defaults.buttonText||y(af)||t.type,buttonTitleOverride:v(r)||v(n)||t.overrides.buttonHint,buttonTitleDefault:v(i)||t.defaults.buttonHint||v(af)}}let xD={};function _K(t){let e=JSON.stringify(t),n=xD[e];return n===void 0&&(n=gn(t),xD[e]=n),n}function xK(t,e){switch(e.type){case"CHANGE_VIEW_TYPE":t=e.viewType}return t}function vK(t,e){switch(e.type){case"SET_OPTION":return Object.assign(Object.assign({},t),{[e.optionName]:e.rawOptionValue});default:return t}}function wK(t,e,n,r){let i;switch(e.type){case"CHANGE_VIEW_TYPE":return r.build(e.dateMarker||n);case"CHANGE_DATE":return r.build(e.dateMarker);case"PREV":if(i=r.buildPrev(t,n),i.isValid)return i;break;case"NEXT":if(i=r.buildNext(t,n),i.isValid)return i;break}return t}function kK(t,e,n){let r=e?e.activeRange:null;return wD({},DK(t,n),r,n)}function EK(t,e,n,r){let i=n?n.activeRange:null;switch(e.type){case"ADD_EVENT_SOURCES":return wD(t,e.sources,i,r);case"REMOVE_EVENT_SOURCE":return CK(t,e.sourceId);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return n?kD(t,i,r):t;case"FETCH_EVENT_SOURCES":return lv(t,e.sourceIds?pM(e.sourceIds):ED(t,r),i,e.isRefetch||!1,r);case"RECEIVE_EVENTS":case"RECEIVE_EVENT_ERROR":return MK(t,e.sourceId,e.fetchId,e.fetchRange);case"REMOVE_ALL_EVENT_SOURCES":return{};default:return t}}function SK(t,e,n){let r=e?e.activeRange:null;return lv(t,ED(t,n),r,!0,n)}function vD(t){for(let e in t)if(t[e].isFetching)return!0;return!1}function wD(t,e,n,r){let i={};for(let s of e)i[s.sourceId]=s;return n&&(i=kD(i,n,r)),Object.assign(Object.assign({},t),i)}function CK(t,e){return wc(t,n=>n.sourceId!==e)}function kD(t,e,n){return lv(t,wc(t,r=>TK(r,e,n)),e,!1,n)}function TK(t,e,n){return SD(t,n)?!n.options.lazyFetching||!t.fetchRange||t.isFetching||e.start<t.fetchRange.start||e.end>t.fetchRange.end:!t.latestFetchId}function lv(t,e,n,r,i){let s={};for(let a in t){let o=t[a];e[a]?s[a]=AK(o,n,r,i):s[a]=o}return s}function AK(t,e,n,r){let{options:i,calendarApi:s}=r,a=r.pluginHooks.eventSourceDefs[t.sourceDefId],o=_c();return a.fetch({eventSource:t,range:e,isRefetch:n,context:r},p=>{let{rawEvents:g}=p;i.eventSourceSuccess&&(g=i.eventSourceSuccess.call(s,g,p.response)||g),t.success&&(g=t.success.call(s,g,p.response)||g),r.dispatch({type:"RECEIVE_EVENTS",sourceId:t.sourceId,fetchId:o,fetchRange:e,rawEvents:g})},p=>{let g=!1;i.eventSourceFailure&&(i.eventSourceFailure.call(s,p),g=!0),t.failure&&(t.failure(p),g=!0),g||console.warn(p.message,p),r.dispatch({type:"RECEIVE_EVENT_ERROR",sourceId:t.sourceId,fetchId:o,fetchRange:e,error:p})}),Object.assign(Object.assign({},t),{isFetching:!0,latestFetchId:o})}function MK(t,e,n,r){let i=t[e];return i&&n===i.latestFetchId?Object.assign(Object.assign({},t),{[e]:Object.assign(Object.assign({},i),{isFetching:!1,fetchRange:r})}):t}function ED(t,e){return wc(t,n=>SD(n,e))}function DK(t,e){let n=MM(e),r=[].concat(t.eventSources||[]),i=[];t.initialEvents&&r.unshift(t.initialEvents),t.events&&r.unshift(t.events);for(let s of r){let a=AM(s,e,n);a&&i.push(a)}return i}function SD(t,e){return!e.pluginHooks.eventSourceDefs[t.sourceDefId].ignoreRange}function IK(t,e){switch(e.type){case"UNSELECT_DATES":return null;case"SELECT_DATES":return e.selection;default:return t}}function PK(t,e){switch(e.type){case"UNSELECT_EVENT":return"";case"SELECT_EVENT":return e.eventInstanceId;default:return t}}function RK(t,e){let n;switch(e.type){case"UNSET_EVENT_DRAG":return null;case"SET_EVENT_DRAG":return n=e.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return t}}function OK(t,e){let n;switch(e.type){case"UNSET_EVENT_RESIZE":return null;case"SET_EVENT_RESIZE":return n=e.state,{affectedEvents:n.affectedEvents,mutatedEvents:n.mutatedEvents,isEvent:n.isEvent};default:return t}}function NK(t,e,n,r,i){let s=t.headerToolbar?CD(t.headerToolbar,t,e,n,r,i):null,a=t.footerToolbar?CD(t.footerToolbar,t,e,n,r,i):null;return{header:s,footer:a}}function CD(t,e,n,r,i,s){let a={},o=[],p=!1;for(let g in t){let y=t[g],v=BK(y,e,n,r,i,s);a[g]=v.widgets,o.push(...v.viewsWithButtons),p=p||v.hasTitle}return{sectionWidgets:a,viewsWithButtons:o,hasTitle:p}}function BK(t,e,n,r,i,s){let a=e.direction==="rtl",o=e.customButtons||{},p=n.buttonText||{},g=e.buttonText||{},y=n.buttonHints||{},v=e.buttonHints||{},E=t?t.split(" "):[],T=[],D=!1;return{widgets:E.map(B=>B.split(",").map(F=>{if(F==="title")return D=!0,{buttonName:F};let X,te,H,ke,ge,Se;if(X=o[F])H=Pe=>{X.click&&X.click.call(Pe.target,Pe,Pe.target)},(ke=r.getCustomButtonIconClass(X))||(ke=r.getIconClass(F,a))||(ge=X.text),Se=X.hint||X.text;else if(te=i[F]){T.push(F),H=()=>{s.changeView(F)},(ge=te.buttonTextOverride)||(ke=r.getIconClass(F,a))||(ge=te.buttonTextDefault);let Pe=te.buttonTextOverride||te.buttonTextDefault;Se=sf(te.buttonTitleOverride||te.buttonTitleDefault||e.viewHint,[Pe,F],Pe)}else if(s[F])if(H=()=>{s[F]()},(ge=p[F])||(ke=r.getIconClass(F,a))||(ge=g[F]),F==="prevYear"||F==="nextYear"){let Pe=F==="prevYear"?"prev":"next";Se=sf(y[Pe]||v[Pe],[g.year||"year","year"],g[F])}else Se=Pe=>sf(y[F]||v[F],[g[Pe]||Pe,Pe],g[F]);return{buttonName:F,buttonClick:H,buttonIcon:ke,buttonText:ge,buttonHint:Se}})),viewsWithButtons:T,hasTitle:D}}class zK{constructor(e,n,r){this.type=e,this.getCurrentData=n,this.dateEnv=r}get calendar(){return this.getCurrentData().calendarApi}get title(){return this.getCurrentData().viewTitle}get activeStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start)}get activeEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end)}get currentStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start)}get currentEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end)}getOption(e){return this.getCurrentData().options[e]}}const LK=Ro({name:"array-event-source",eventSourceDefs:[{ignoreRange:!0,parseMeta(t){return Array.isArray(t.events)?t.events:null},fetch(t,e){e({rawEvents:t.eventSource.meta})}}]}),VK=Ro({name:"func-event-source",eventSourceDefs:[{parseMeta(t){return typeof t.events=="function"?t.events:null},fetch(t,e,n){const{dateEnv:r}=t.context,i=t.eventSource.meta;eX(i.bind(null,FM(t.range,r)),s=>e({rawEvents:s}),n)}}]}),FK=Ro({name:"json-event-source",eventSourceRefiners:{method:String,extraParams:De,startParam:String,endParam:String,timeZoneParam:String},eventSourceDefs:[{parseMeta(t){return t.url&&(t.format==="json"||!t.format)?{url:t.url,format:"json",method:(t.method||"GET").toUpperCase(),extraParams:t.extraParams,startParam:t.startParam,endParam:t.endParam,timeZoneParam:t.timeZoneParam}:null},fetch(t,e,n){const{meta:r}=t.eventSource,i=$K(r,t.range,t.context);tX(r.method,r.url,i).then(([s,a])=>{e({rawEvents:s,response:a})},n)}}]});function $K(t,e,n){let{dateEnv:r,options:i}=n,s,a,o,p,g={};return s=t.startParam,s==null&&(s=i.startParam),a=t.endParam,a==null&&(a=i.endParam),o=t.timeZoneParam,o==null&&(o=i.timeZoneParam),typeof t.extraParams=="function"?p=t.extraParams():p=t.extraParams||{},Object.assign(g,p),g[s]=r.formatIso(e.start),g[a]=r.formatIso(e.end),r.timeZone!=="local"&&(g[o]=r.timeZone),g}const jK=Ro({name:"simple-recurring-event",recurringTypes:[{parse(t,e){if(t.daysOfWeek||t.startTime||t.endTime||t.startRecur||t.endRecur){let n={daysOfWeek:t.daysOfWeek||null,startTime:t.startTime||null,endTime:t.endTime||null,startRecur:t.startRecur?e.createMarker(t.startRecur):null,endRecur:t.endRecur?e.createMarker(t.endRecur):null},r;return t.duration&&(r=t.duration),!r&&t.startTime&&t.endTime&&(r=dY(t.endTime,t.startTime)),{allDayGuess:!t.startTime&&!t.endTime,duration:r,typeData:n}}return null},expand(t,e,n){let r=ll(e,{start:t.startRecur,end:t.endRecur});return r?HK(t.daysOfWeek,t.startTime,r,n):[]}}],eventRefiners:{daysOfWeek:De,startTime:gn,endTime:gn,duration:gn,startRecur:De,endRecur:De}});function HK(t,e,n,r){let i=t?pM(t):null,s=er(n.start),a=n.end,o=[];for(;s<a;){let p;(!i||i[s.getUTCDay()])&&(e?p=r.add(s,e):p=s,o.push(p)),s=Ur(s,1)}return o}const UK=Ro({name:"change-handler",optionChangeHandlers:{events(t,e){TD([t],e)},eventSources:TD}});function TD(t,e){let n=wx(e.getCurrentData().eventSources);if(n.length===1&&t.length===1&&Array.isArray(n[0]._raw)&&Array.isArray(t[0])){e.dispatch({type:"RESET_RAW_EVENTS",sourceId:n[0].sourceId,rawEvents:t[0]});return}let r=[];for(let i of t){let s=!1;for(let a=0;a<n.length;a+=1)if(n[a]._raw===i){n.splice(a,1),s=!0;break}s||r.push(i)}for(let i of n)e.dispatch({type:"REMOVE_EVENT_SOURCE",sourceId:i.sourceId});for(let i of r)e.calendarApi.addEventSource(i)}function WK(t,e){e.emitter.trigger("datesSet",Object.assign(Object.assign({},FM(t.activeRange,e.dateEnv)),{view:e.viewApi}))}function qK(t,e){let{emitter:n}=e;n.hasHandlers("eventsSet")&&n.trigger("eventsSet",Sc(t,e))}const GK=[LK,VK,FK,jK,UK,Ro({name:"misc",isLoadingFuncs:[t=>vD(t.eventSources)],propSetHandlers:{dateProfile:WK,eventStore:qK}})];class YK{constructor(e,n){this.runTaskOption=e,this.drainedOption=n,this.queue=[],this.delayedRunner=new dx(this.drain.bind(this))}request(e,n){this.queue.push(e),this.delayedRunner.request(n)}pause(e){this.delayedRunner.pause(e)}resume(e,n){this.delayedRunner.resume(e,n)}drain(){let{queue:e}=this;for(;e.length;){let n=[],r;for(;r=e.shift();)this.runTask(r),n.push(r);this.drained(n)}}runTask(e){this.runTaskOption&&this.runTaskOption(e)}drained(e){this.drainedOption&&this.drainedOption(e)}}function ZK(t,e,n){let r;return/^(year|month)$/.test(t.currentRangeUnit)?r=t.currentRange:r=t.activeRange,n.formatRange(r.start,r.end,ir(e.titleFormat||XK(t)),{isEndExclusive:t.isRangeAllDay,defaultSeparator:e.titleRangeSeparator})}function XK(t){let{currentRangeUnit:e}=t;if(e==="year")return{year:"numeric"};if(e==="month")return{year:"numeric",month:"long"};let n=Sg(t.currentRange.start,t.currentRange.end);return n!==null&&n>1?{year:"numeric",month:"short",day:"numeric"}:{year:"numeric",month:"long",day:"numeric"}}class KK{constructor(e){this.computeCurrentViewData=Ft(this._computeCurrentViewData),this.organizeRawLocales=Ft(aK),this.buildLocale=Ft(gD),this.buildPluginHooks=uK(),this.buildDateEnv=Ft(JK),this.buildTheme=Ft(QK),this.parseToolbars=Ft(NK),this.buildViewSpecs=Ft(yK),this.buildDateProfileGenerator=Cg(eJ),this.buildViewApi=Ft(tJ),this.buildViewUiProps=Cg(iJ),this.buildEventUiBySource=Ft(nJ,Po),this.buildEventUiBases=Ft(rJ),this.parseContextBusinessHours=Cg(sJ),this.buildTitle=Ft(ZK),this.emitter=new Lg,this.actionRunner=new YK(this._handleAction.bind(this),this.updateData.bind(this)),this.currentCalendarOptionsInput={},this.currentCalendarOptionsRefined={},this.currentViewOptionsInput={},this.currentViewOptionsRefined={},this.currentCalendarOptionsRefiners={},this.optionsForRefining=[],this.optionsForHandling=[],this.getCurrentData=()=>this.data,this.dispatch=E=>{this.actionRunner.request(E)},this.props=e,this.actionRunner.pause();let n={},r=this.computeOptionsData(e.optionOverrides,n,e.calendarApi),i=r.calendarOptions.initialView||r.pluginHooks.initialView,s=this.computeCurrentViewData(i,r,e.optionOverrides,n);e.calendarApi.currentDataManager=this,this.emitter.setThisContext(e.calendarApi),this.emitter.setOptions(s.options);let a=pZ(r.calendarOptions,r.dateEnv),o=s.dateProfileGenerator.build(a);ua(o.activeRange,a)||(a=o.currentRange.start);let p={dateEnv:r.dateEnv,options:r.calendarOptions,pluginHooks:r.pluginHooks,calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData};for(let E of r.pluginHooks.contextInit)E(p);let g=kK(r.calendarOptions,o,p),y={dynamicOptionOverrides:n,currentViewType:i,currentDate:a,dateProfile:o,businessHours:this.parseContextBusinessHours(p),eventSources:g,eventUiBases:{},eventStore:ys(),renderableEventStore:ys(),dateSelection:null,eventSelection:"",eventDrag:null,eventResize:null,selectionConfig:this.buildViewUiProps(p).selectionConfig},v=Object.assign(Object.assign({},p),y);for(let E of r.pluginHooks.reducers)Object.assign(y,E(null,null,v));cv(y,p)&&this.emitter.trigger("loading",!0),this.state=y,this.updateData(),this.actionRunner.resume()}resetOptions(e,n){let{props:r}=this;n===void 0?r.optionOverrides=e:(r.optionOverrides=Object.assign(Object.assign({},r.optionOverrides||{}),e),this.optionsForRefining.push(...n)),(n===void 0||n.length)&&this.actionRunner.request({type:"NOTHING"})}_handleAction(e){let{props:n,state:r,emitter:i}=this,s=vK(r.dynamicOptionOverrides,e),a=this.computeOptionsData(n.optionOverrides,s,n.calendarApi),o=xK(r.currentViewType,e),p=this.computeCurrentViewData(o,a,n.optionOverrides,s);n.calendarApi.currentDataManager=this,i.setThisContext(n.calendarApi),i.setOptions(p.options);let g={dateEnv:a.dateEnv,options:a.calendarOptions,pluginHooks:a.pluginHooks,calendarApi:n.calendarApi,dispatch:this.dispatch,emitter:i,getCurrentData:this.getCurrentData},{currentDate:y,dateProfile:v}=r;this.data&&this.data.dateProfileGenerator!==p.dateProfileGenerator&&(v=p.dateProfileGenerator.build(y)),y=fZ(y,e),v=wK(v,e,y,p.dateProfileGenerator),(e.type==="PREV"||e.type==="NEXT"||!ua(v.currentRange,y))&&(y=v.currentRange.start);let E=EK(r.eventSources,e,v,g),T=TZ(r.eventStore,e,E,v,g),N=vD(E)&&!p.options.progressiveEventRendering&&r.renderableEventStore||T,{eventUiSingleBase:B,selectionConfig:F}=this.buildViewUiProps(g),X=this.buildEventUiBySource(E),te=this.buildEventUiBases(N.defs,B,X),H={dynamicOptionOverrides:s,currentViewType:o,currentDate:y,dateProfile:v,eventSources:E,eventStore:T,renderableEventStore:N,selectionConfig:F,eventUiBases:te,businessHours:this.parseContextBusinessHours(g),dateSelection:IK(r.dateSelection,e),eventSelection:PK(r.eventSelection,e),eventDrag:RK(r.eventDrag,e),eventResize:OK(r.eventResize,e)},ke=Object.assign(Object.assign({},g),H);for(let Pe of a.pluginHooks.reducers)Object.assign(H,Pe(r,e,ke));let ge=cv(r,g),Se=cv(H,g);!ge&&Se?i.trigger("loading",!0):ge&&!Se&&i.trigger("loading",!1),this.state=H,n.onAction&&n.onAction(e)}updateData(){let{props:e,state:n}=this,r=this.data,i=this.computeOptionsData(e.optionOverrides,n.dynamicOptionOverrides,e.calendarApi),s=this.computeCurrentViewData(n.currentViewType,i,e.optionOverrides,n.dynamicOptionOverrides),a=this.data=Object.assign(Object.assign(Object.assign({viewTitle:this.buildTitle(n.dateProfile,s.options,i.dateEnv),calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},i),s),n),o=i.pluginHooks.optionChangeHandlers,p=r&&r.calendarOptions,g=i.calendarOptions;if(p&&p!==g){p.timeZone!==g.timeZone&&(n.eventSources=a.eventSources=SK(a.eventSources,n.dateProfile,a),n.eventStore=a.eventStore=PM(a.eventStore,r.dateEnv,a.dateEnv),n.renderableEventStore=a.renderableEventStore=PM(a.renderableEventStore,r.dateEnv,a.dateEnv));for(let y in o)(this.optionsForHandling.indexOf(y)!==-1||p[y]!==g[y])&&o[y](g[y],a)}this.optionsForHandling=[],e.onData&&e.onData(a)}computeOptionsData(e,n,r){if(!this.optionsForRefining.length&&e===this.stableOptionOverrides&&n===this.stableDynamicOptionOverrides)return this.stableCalendarOptionsData;let{refinedOptions:i,pluginHooks:s,localeDefaults:a,availableLocaleData:o,extra:p}=this.processRawCalendarOptions(e,n);AD(p);let g=this.buildDateEnv(i.timeZone,i.locale,i.weekNumberCalculation,i.firstDay,i.weekText,s,o,i.defaultRangeSeparator),y=this.buildViewSpecs(s.views,this.stableOptionOverrides,this.stableDynamicOptionOverrides,a),v=this.buildTheme(i,s),E=this.parseToolbars(i,this.stableOptionOverrides,v,y,r);return this.stableCalendarOptionsData={calendarOptions:i,pluginHooks:s,dateEnv:g,viewSpecs:y,theme:v,toolbarConfig:E,localeDefaults:a,availableRawLocales:o.map}}processRawCalendarOptions(e,n){let{locales:r,locale:i}=_x([af,e,n]),s=this.organizeRawLocales(r),a=s.map,o=this.buildLocale(i||s.defaultCode,a).options,p=this.buildPluginHooks(e.plugins||[],GK),g=this.currentCalendarOptionsRefiners=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},uM),hM),fM),p.listenerRefiners),p.optionRefiners),y={},v=_x([af,o,e,n]),E={},T=this.currentCalendarOptionsInput,D=this.currentCalendarOptionsRefined,N=!1;for(let B in v)this.optionsForRefining.indexOf(B)===-1&&(v[B]===T[B]||xc[B]&&B in T&&xc[B](T[B],v[B]))?E[B]=D[B]:g[B]?(E[B]=g[B](v[B]),N=!0):y[B]=T[B];return N&&(this.currentCalendarOptionsInput=v,this.currentCalendarOptionsRefined=E,this.stableOptionOverrides=e,this.stableDynamicOptionOverrides=n),this.optionsForHandling.push(...this.optionsForRefining),this.optionsForRefining=[],{rawOptions:this.currentCalendarOptionsInput,refinedOptions:this.currentCalendarOptionsRefined,pluginHooks:p,availableLocaleData:s,localeDefaults:o,extra:y}}_computeCurrentViewData(e,n,r,i){let s=n.viewSpecs[e];if(!s)throw new Error(`viewType "${e}" is not available. Please make sure you've loaded all neccessary plugins`);let{refinedOptions:a,extra:o}=this.processRawViewOptions(s,n.pluginHooks,n.localeDefaults,r,i);AD(o);let p=this.buildDateProfileGenerator({dateProfileGeneratorClass:s.optionDefaults.dateProfileGeneratorClass,duration:s.duration,durationUnit:s.durationUnit,usesMinMaxTime:s.optionDefaults.usesMinMaxTime,dateEnv:n.dateEnv,calendarApi:this.props.calendarApi,slotMinTime:a.slotMinTime,slotMaxTime:a.slotMaxTime,showNonCurrentDates:a.showNonCurrentDates,dayCount:a.dayCount,dateAlignment:a.dateAlignment,dateIncrement:a.dateIncrement,hiddenDays:a.hiddenDays,weekends:a.weekends,nowInput:a.now,validRangeInput:a.validRange,visibleRangeInput:a.visibleRange,fixedWeekCount:a.fixedWeekCount}),g=this.buildViewApi(e,this.getCurrentData,n.dateEnv);return{viewSpec:s,options:a,dateProfileGenerator:p,viewApi:g}}processRawViewOptions(e,n,r,i,s){let a=_x([af,e.optionDefaults,r,i,e.optionOverrides,s]),o=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},uM),hM),fM),HY),n.listenerRefiners),n.optionRefiners),p={},g=this.currentViewOptionsInput,y=this.currentViewOptionsRefined,v=!1,E={};for(let T in a)a[T]===g[T]||xc[T]&&xc[T](a[T],g[T])?p[T]=y[T]:(a[T]===this.currentCalendarOptionsInput[T]||xc[T]&&xc[T](a[T],this.currentCalendarOptionsInput[T])?T in this.currentCalendarOptionsRefined&&(p[T]=this.currentCalendarOptionsRefined[T]):o[T]?p[T]=o[T](a[T]):E[T]=a[T],v=!0);return v&&(this.currentViewOptionsInput=a,this.currentViewOptionsRefined=p),{rawOptions:this.currentViewOptionsInput,refinedOptions:this.currentViewOptionsRefined,extra:E}}}function JK(t,e,n,r,i,s,a,o){let p=gD(e||a.defaultCode,a.map);return new QY({calendarSystem:"gregory",timeZone:t,namedTimeZoneImpl:s.namedTimeZonedImpl,locale:p,weekNumberCalculation:n,firstDay:r,weekText:i,cmdFormatter:s.cmdFormatter,defaultSeparator:o})}function QK(t,e){let n=e.themeClasses[t.themeSystem]||cl;return new n(t)}function eJ(t){let e=t.dateProfileGeneratorClass||wM;return new e(t)}function tJ(t,e,n){return new zK(t,e,n)}function nJ(t){return la(t,e=>e.ui)}function rJ(t,e,n){let r={"":e};for(let i in t){let s=t[i];s.sourceId&&n[s.sourceId]&&(r[i]=n[s.sourceId])}return r}function iJ(t){let{options:e}=t;return{eventUiSingleBase:zg({display:e.eventDisplay,editable:e.editable,startEditable:e.eventStartEditable,durationEditable:e.eventDurationEditable,constraint:e.eventConstraint,overlap:typeof e.eventOverlap=="boolean"?e.eventOverlap:void 0,allow:e.eventAllow,backgroundColor:e.eventBackgroundColor,borderColor:e.eventBorderColor,textColor:e.eventTextColor,color:e.eventColor},t),selectionConfig:zg({constraint:e.selectConstraint,overlap:typeof e.selectOverlap=="boolean"?e.selectOverlap:void 0,allow:e.selectAllow},t)}}function cv(t,e){for(let n of e.pluginHooks.isLoadingFuncs)if(n(t))return!0;return!1}function sJ(t){return BZ(t.options.businessHours,t)}function AD(t,e){for(let n in t)console.warn(`Unknown option '${n}'`)}class oJ extends Tn{render(){let e=this.props.widgetGroups.map(n=>this.renderWidgetGroup(n));return ce("div",{className:"fc-toolbar-chunk"},...e)}renderWidgetGroup(e){let{props:n}=this,{theme:r}=this.context,i=[],s=!0;for(let a of e){let{buttonName:o,buttonClick:p,buttonText:g,buttonIcon:y,buttonHint:v}=a;if(o==="title")s=!1,i.push(ce("h2",{className:"fc-toolbar-title",id:n.titleId},n.title));else{let E=o===n.activeButton,T=!n.isTodayEnabled&&o==="today"||!n.isPrevEnabled&&o==="prev"||!n.isNextEnabled&&o==="next",D=[`fc-${o}-button`,r.getClass("button")];E&&D.push(r.getClass("buttonActive")),i.push(ce("button",{type:"button",title:typeof v=="function"?v(n.navUnit):v,disabled:T,"aria-pressed":E,className:D.join(" "),onClick:p},g||(y?ce("span",{className:y,role:"img"}):"")))}}if(i.length>1){let a=s&&r.getClass("buttonGroup")||"";return ce("div",{className:a},...i)}return i[0]}}class MD extends Tn{render(){let{model:e,extraClassName:n}=this.props,r=!1,i,s,a=e.sectionWidgets,o=a.center;return a.left?(r=!0,i=a.left):i=a.start,a.right?(r=!0,s=a.right):s=a.end,ce("div",{className:[n||"","fc-toolbar",r?"fc-toolbar-ltr":""].join(" ")},this.renderSection("start",i||[]),this.renderSection("center",o||[]),this.renderSection("end",s||[]))}renderSection(e,n){let{props:r}=this;return ce(oJ,{key:e,widgetGroups:n,title:r.title,navUnit:r.navUnit,activeButton:r.activeButton,isTodayEnabled:r.isTodayEnabled,isPrevEnabled:r.isPrevEnabled,isNextEnabled:r.isNextEnabled,titleId:r.titleId})}}class aJ extends Tn{constructor(){super(...arguments),this.state={availableWidth:null},this.handleEl=e=>{this.el=e,da(this.props.elRef,e),this.updateAvailableWidth()},this.handleResize=()=>{this.updateAvailableWidth()}}render(){let{props:e,state:n}=this,{aspectRatio:r}=e,i=["fc-view-harness",r||e.liquid||e.height?"fc-view-harness-active":"fc-view-harness-passive"],s="",a="";return r?n.availableWidth!==null?s=n.availableWidth/r:a=`${1/r*100}%`:s=e.height||"",ce("div",{"aria-labelledby":e.labeledById,ref:this.handleEl,className:i.join(" "),style:{height:s,paddingBottom:a}},e.children)}componentDidMount(){this.context.addResizeHandler(this.handleResize)}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}updateAvailableWidth(){this.el&&this.props.aspectRatio&&this.setState({availableWidth:this.el.offsetWidth})}}class lJ extends Jd{constructor(e){super(e),this.handleSegClick=(n,r)=>{let{component:i}=this,{context:s}=i,a=Kd(r);if(a&&i.isValidSegDownEl(n.target)){let o=gi(n.target,".fc-event-forced-url"),p=o?o.querySelector("a[href]").href:"";s.emitter.trigger("eventClick",{el:r,event:new lr(i.context,a.eventRange.def,a.eventRange.instance),jsEvent:n,view:s.viewApi}),p&&!n.defaultPrevented&&(window.location.href=p)}},this.destroy=XA(e.el,"click",".fc-event",this.handleSegClick)}}class cJ extends Jd{constructor(e){super(e),this.handleEventElRemove=n=>{n===this.currentSegEl&&this.handleSegLeave(null,this.currentSegEl)},this.handleSegEnter=(n,r)=>{Kd(r)&&(this.currentSegEl=r,this.triggerEvent("eventMouseEnter",n,r))},this.handleSegLeave=(n,r)=>{this.currentSegEl&&(this.currentSegEl=null,this.triggerEvent("eventMouseLeave",n,r))},this.removeHoverListeners=ZG(e.el,".fc-event",this.handleSegEnter,this.handleSegLeave)}destroy(){this.removeHoverListeners()}triggerEvent(e,n,r){let{component:i}=this,{context:s}=i,a=Kd(r);(!n||i.isValidSegDownEl(n.target))&&s.emitter.trigger(e,{el:r,event:new lr(s,a.eventRange.def,a.eventRange.instance),jsEvent:n,view:s.viewApi})}}class dJ extends kc{constructor(){super(...arguments),this.buildViewContext=Ft(nZ),this.buildViewPropTransformers=Ft(hJ),this.buildToolbarProps=Ft(uJ),this.headerRef=Mi(),this.footerRef=Mi(),this.interactionsStore={},this.state={viewLabelId:nl()},this.registerInteractiveComponent=(e,n)=>{let r=iX(e,n),a=[lJ,cJ].concat(this.props.pluginHooks.componentInteractions).map(o=>new o(r));this.interactionsStore[e.uid]=a,jx[e.uid]=r},this.unregisterInteractiveComponent=e=>{let n=this.interactionsStore[e.uid];if(n){for(let r of n)r.destroy();delete this.interactionsStore[e.uid]}delete jx[e.uid]},this.resizeRunner=new dx(()=>{this.props.emitter.trigger("_resize",!0),this.props.emitter.trigger("windowResize",{view:this.props.viewApi})}),this.handleWindowResize=e=>{let{options:n}=this.props;n.handleWindowResize&&e.target===window&&this.resizeRunner.request(n.windowResizeDelay)}}render(){let{props:e}=this,{toolbarConfig:n,options:r}=e,i=this.buildToolbarProps(e.viewSpec,e.dateProfile,e.dateProfileGenerator,e.currentDate,df(e.options.now,e.dateEnv),e.viewTitle),s=!1,a="",o;e.isHeightAuto||e.forPrint?a="":r.height!=null?s=!0:r.contentHeight!=null?a=r.contentHeight:o=Math.max(r.aspectRatio,.5);let p=this.buildViewContext(e.viewSpec,e.viewApi,e.options,e.dateProfileGenerator,e.dateEnv,e.theme,e.pluginHooks,e.dispatch,e.getCurrentData,e.emitter,e.calendarApi,this.registerInteractiveComponent,this.unregisterInteractiveComponent),g=n.header&&n.header.hasTitle?this.state.viewLabelId:void 0;return ce(ca.Provider,{value:p},n.header&&ce(MD,Object.assign({ref:this.headerRef,extraClassName:"fc-header-toolbar",model:n.header,titleId:g},i)),ce(aJ,{liquid:s,height:a,aspectRatio:o,labeledById:g},this.renderView(e),this.buildAppendContent()),n.footer&&ce(MD,Object.assign({ref:this.footerRef,extraClassName:"fc-footer-toolbar",model:n.footer,titleId:""},i)))}componentDidMount(){let{props:e}=this;this.calendarInteractions=e.pluginHooks.calendarInteractions.map(r=>new r(e)),window.addEventListener("resize",this.handleWindowResize);let{propSetHandlers:n}=e.pluginHooks;for(let r in n)n[r](e[r],e)}componentDidUpdate(e){let{props:n}=this,{propSetHandlers:r}=n.pluginHooks;for(let i in r)n[i]!==e[i]&&r[i](n[i],n)}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize),this.resizeRunner.clear();for(let e of this.calendarInteractions)e.destroy();this.props.emitter.trigger("_unmount")}buildAppendContent(){let{props:e}=this,n=e.pluginHooks.viewContainerAppends.map(r=>r(e));return ce(Qn,{},...n)}renderView(e){let{pluginHooks:n}=e,{viewSpec:r}=e,i={dateProfile:e.dateProfile,businessHours:e.businessHours,eventStore:e.renderableEventStore,eventUiBases:e.eventUiBases,dateSelection:e.dateSelection,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,isHeightAuto:e.isHeightAuto,forPrint:e.forPrint},s=this.buildViewPropTransformers(n.viewPropsTransformers);for(let o of s)Object.assign(i,o.transform(i,e));let a=r.component;return ce(a,Object.assign({},i))}}function uJ(t,e,n,r,i,s){let a=n.build(i,void 0,!1),o=n.buildPrev(e,r,!1),p=n.buildNext(e,r,!1);return{title:s,activeButton:t.type,navUnit:t.singleUnit,isTodayEnabled:a.isValid&&!ua(e.currentRange,i),isPrevEnabled:o.isValid,isNextEnabled:p.isValid}}function hJ(t){return t.map(e=>new e)}class fJ extends sX{constructor(e,n={}){super(),this.isRendering=!1,this.isRendered=!1,this.currentClassNames=[],this.customContentRenderId=0,this.handleAction=r=>{switch(r.type){case"SET_EVENT_DRAG":case"SET_EVENT_RESIZE":this.renderRunner.tryDrain()}},this.handleData=r=>{this.currentData=r,this.renderRunner.request(r.calendarOptions.rerenderDelay)},this.handleRenderRequest=()=>{if(this.isRendering){this.isRendered=!0;let{currentData:r}=this;Pg(()=>{nf(ce(rX,{options:r.calendarOptions,theme:r.theme,emitter:r.emitter},(i,s,a,o)=>(this.setClassNames(i),this.setHeight(s),ce(bM.Provider,{value:this.customContentRenderId},ce(dJ,Object.assign({isHeightAuto:a,forPrint:o},r))))),this.el)})}else this.isRendered&&(this.isRendered=!1,nf(null,this.el),this.setClassNames([]),this.setHeight(""))},FG(e),this.el=e,this.renderRunner=new dx(this.handleRenderRequest),new KK({optionOverrides:n,calendarApi:this,onAction:this.handleAction,onData:this.handleData})}render(){let e=this.isRendering;e?this.customContentRenderId+=1:this.isRendering=!0,this.renderRunner.request(),e&&this.updateSize()}destroy(){this.isRendering&&(this.isRendering=!1,this.renderRunner.request())}updateSize(){Pg(()=>{super.updateSize()})}batchRendering(e){this.renderRunner.pause("batchRendering"),e(),this.renderRunner.resume("batchRendering")}pauseRendering(){this.renderRunner.pause("pauseRendering")}resumeRendering(){this.renderRunner.resume("pauseRendering",!0)}resetOptions(e,n){this.currentDataManager.resetOptions(e,n)}setClassNames(e){if(!rl(e,this.currentClassNames)){let{classList:n}=this.el;for(let r of this.currentClassNames)n.remove(r);for(let r of e)n.add(r);this.currentClassNames=e}}setHeight(e){GA(this.el,"height",e)}}const pJ={headerToolbar:!0,footerToolbar:!0,events:!0,eventSources:!0,resources:!0},mJ=h.defineComponent({props:{options:Object},data(){return{renderId:0,customRenderingMap:new Map}},methods:{getApi(){return this.calendar},buildOptions(t){return{...t,customRenderingMetaMap:bJ(this.$slots),handleCustomRendering:this.handleCustomRendering}}},render(){const t=[];for(const e of this.customRenderingMap.values())t.push(h.h(gJ,{key:e.id,customRendering:e}));return h.h("div",{attrs:{"data-fc-render-id":this.renderId}},h.h(h.Fragment,t))},mounted(){const t=new sK;this.handleCustomRendering=t.handle.bind(t);const e=this.buildOptions(this.options),n=new fJ(this.$el,e);this.calendar=n,n.render(),t.subscribe(r=>{this.customRenderingMap=r,this.renderId++,this.needCustomRenderingResize=!0})},beforeUpdate(){this.getApi().resumeRendering()},updated(){this.needCustomRenderingResize&&(this.needCustomRenderingResize=!1,this.getApi().updateSize())},beforeUnmount(){this.getApi().destroy()},watch:yJ()}),gJ=h.defineComponent({props:{customRendering:Object},render(){const t=this.customRendering,e=typeof t.generatorMeta=="function"?t.generatorMeta(t.renderProps):t.generatorMeta;return h.h(h.Teleport,{to:t.containerEl},e)}});function Nce(t){return t}function yJ(){let t={options:{deep:!0,handler(e){let n=this.getApi();n.pauseRendering();let r=this.buildOptions(e);n.resetOptions(r),this.renderId++}}};for(let e in pJ)t[`options.${e}`]={deep:!0,handler(n){if(n!==void 0){let r=this.getApi();r.pauseRendering(),r.resetOptions({[e]:n},[e]),this.renderId++}}};return t}function bJ(t){const e={};for(const n in t)e[_J(n)]=t[n];return e}function _J(t){return t.split("-").map((e,n)=>n?xJ(e):e).join("")}function xJ(t){return t.charAt(0).toUpperCase()+t.slice(1)}class vJ extends co{constructor(){super(...arguments),this.headerElRef=Mi()}renderSimpleLayout(e,n){let{props:r,context:i}=this,s=[],a=Ug(i.options);return e&&s.push({type:"header",key:"header",isSticky:a,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),s.push({type:"body",key:"body",liquid:!0,chunk:{content:n}}),ce(cf,{elClasses:["fc-daygrid"],viewSpec:i.viewSpec},ce(nv,{liquid:!r.isHeightAuto&&!r.forPrint,collapsibleWidth:r.forPrint,cols:[],sections:s}))}renderHScrollLayout(e,n,r,i){let s=this.context.pluginHooks.scrollGridImpl;if(!s)throw new Error("No ScrollGrid implementation");let{props:a,context:o}=this,p=!a.forPrint&&Ug(o.options),g=!a.forPrint&&oD(o.options),y=[];return e&&y.push({type:"header",key:"header",isSticky:p,chunks:[{key:"main",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),y.push({type:"body",key:"body",liquid:!0,chunks:[{key:"main",content:n}]}),g&&y.push({type:"footer",key:"footer",isSticky:!0,chunks:[{key:"main",content:tv}]}),ce(cf,{elClasses:["fc-daygrid"],viewSpec:o.viewSpec},ce(s,{liquid:!a.isHeightAuto&&!a.forPrint,forPrint:a.forPrint,collapsibleWidth:a.forPrint,colGroups:[{cols:[{span:r,minWidth:i}]}],sections:y}))}}function qg(t,e){let n=[];for(let r=0;r<e;r+=1)n[r]=[];for(let r of t)n[r.row].push(r);return n}function Gg(t,e){let n=[];for(let r=0;r<e;r+=1)n[r]=[];for(let r of t)n[r.firstCol].push(r);return n}function DD(t,e){let n=[];if(t){for(let r=0;r<e;r+=1)n[r]={affectedInstances:t.affectedInstances,isEvent:t.isEvent,segs:[]};for(let r of t.segs)n[r.row].segs.push(r)}else for(let r=0;r<e;r+=1)n[r]=null;return n}const ID=ir({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});function PD(t){let{display:e}=t.eventRange.ui;return e==="list-item"||e==="auto"&&!t.eventRange.def.allDay&&t.firstCol===t.lastCol&&t.isStart&&t.isEnd}class RD extends Tn{render(){let{props:e}=this;return ce(aD,Object.assign({},e,{elClasses:["fc-daygrid-event","fc-daygrid-block-event","fc-h-event"],defaultTimeFormat:ID,defaultDisplayEventEnd:e.defaultDisplayEventEnd,disableResizing:!e.seg.eventRange.def.allDay}))}}class OD extends Tn{render(){let{props:e,context:n}=this,{options:r}=n,{seg:i}=e,s=r.eventTimeFormat||ID,a=hf(i,s,n,!0,e.defaultDisplayEventEnd);return ce(Wg,Object.assign({},e,{elTag:"a",elClasses:["fc-daygrid-event","fc-daygrid-dot-event"],elAttrs:Vx(e.seg,n),defaultGenerator:wJ,timeText:a,isResizing:!1,isDateSelecting:!1}))}}function wJ(t){return ce(Qn,null,ce("div",{className:"fc-daygrid-event-dot",style:{borderColor:t.borderColor||t.backgroundColor}}),t.timeText&&ce("div",{className:"fc-event-time"},t.timeText),ce("div",{className:"fc-event-title"},t.event.title||ce(Qn,null," ")))}class kJ extends Tn{constructor(){super(...arguments),this.compileSegs=Ft(EJ)}render(){let{props:e}=this,{allSegs:n,invisibleSegs:r}=this.compileSegs(e.singlePlacements);return ce(uD,{elClasses:["fc-daygrid-more-link"],dateProfile:e.dateProfile,todayRange:e.todayRange,allDayDate:e.allDayDate,moreCnt:e.moreCnt,allSegs:n,hiddenSegs:r,alignmentElRef:e.alignmentElRef,alignGridTop:e.alignGridTop,extraDateSpan:e.extraDateSpan,popoverContent:()=>{let i=(e.eventDrag?e.eventDrag.affectedInstances:null)||(e.eventResize?e.eventResize.affectedInstances:null)||{};return ce(Qn,null,n.map(s=>{let a=s.eventRange.instance.instanceId;return ce("div",{className:"fc-daygrid-event-harness",key:a,style:{visibility:i[a]?"hidden":""}},PD(s)?ce(OD,Object.assign({seg:s,isDragging:!1,isSelected:a===e.eventSelection,defaultDisplayEventEnd:!1},ha(s,e.todayRange))):ce(RD,Object.assign({seg:s,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:a===e.eventSelection,defaultDisplayEventEnd:!1},ha(s,e.todayRange))))}))}})}}function EJ(t){let e=[],n=[];for(let r of t)e.push(r.seg),r.isVisible||n.push(r.seg);return{allSegs:e,invisibleSegs:n}}const SJ=ir({week:"narrow"});class CJ extends co{constructor(){super(...arguments),this.rootElRef=Mi(),this.state={dayNumberId:nl()},this.handleRootEl=e=>{da(this.rootElRef,e),da(this.props.elRef,e)}}render(){let{context:e,props:n,state:r,rootElRef:i}=this,{options:s,dateEnv:a}=e,{date:o,dateProfile:p}=n;const g=n.showDayNumber&&AJ(o,p.currentRange,a);return ce(iv,{elTag:"td",elRef:this.handleRootEl,elClasses:["fc-daygrid-day",...n.extraClassNames||[]],elAttrs:Object.assign(Object.assign(Object.assign({},n.extraDataAttrs),n.showDayNumber?{"aria-labelledby":r.dayNumberId}:{}),{role:"gridcell"}),defaultGenerator:TJ,date:o,dateProfile:p,todayRange:n.todayRange,showDayNumber:n.showDayNumber,isMonthStart:g,extraRenderProps:n.extraRenderProps},(y,v)=>ce("div",{ref:n.innerElRef,className:"fc-daygrid-day-frame fc-scrollgrid-sync-inner",style:{minHeight:n.minHeight}},n.showWeekNumber&&ce(dD,{elTag:"a",elClasses:["fc-daygrid-week-number"],elAttrs:Qd(e,o,"week"),date:o,defaultFormat:SJ}),!v.isDisabled&&(n.showDayNumber||sv(s)||n.forceDayTop)?ce("div",{className:"fc-daygrid-day-top"},ce(y,{elTag:"a",elClasses:["fc-daygrid-day-number",g&&"fc-daygrid-month-start"],elAttrs:Object.assign(Object.assign({},Qd(e,o)),{id:r.dayNumberId})})):n.showDayNumber?ce("div",{className:"fc-daygrid-day-top",style:{visibility:"hidden"}},ce("a",{className:"fc-daygrid-day-number"}," ")):void 0,ce("div",{className:"fc-daygrid-day-events",ref:n.fgContentElRef},n.fgContent,ce("div",{className:"fc-daygrid-day-bottom",style:{marginTop:n.moreMarginTop}},ce(kJ,{allDayDate:o,singlePlacements:n.singlePlacements,moreCnt:n.moreCnt,alignmentElRef:i,alignGridTop:!n.showDayNumber,extraDateSpan:n.extraDateSpan,dateProfile:n.dateProfile,eventSelection:n.eventSelection,eventDrag:n.eventDrag,eventResize:n.eventResize,todayRange:n.todayRange}))),ce("div",{className:"fc-daygrid-day-bg"},n.bgContent)))}}function TJ(t){return t.dayNumberText||ce(Qn,null," ")}function AJ(t,e,n){const{start:r,end:i}=e,s=il(i,-1),a=n.getYear(r),o=n.getMonth(r),p=n.getYear(s),g=n.getMonth(s);return!(a===p&&o===g)&&(t.valueOf()===r.valueOf()||n.getDay(t)===1&&t.valueOf()<i.valueOf())}function ND(t){return t.eventRange.instance.instanceId+":"+t.firstCol}function BD(t){return ND(t)+":"+t.lastCol}function MJ(t,e,n,r,i,s,a){let o=new PJ(F=>{let X=t[F.index].eventRange.instance.instanceId+":"+F.span.start+":"+(F.span.end-1);return i[X]||1});o.allowReslicing=!0,o.strictOrder=r,e===!0||n===!0?(o.maxCoord=s,o.hiddenConsumes=!0):typeof e=="number"?o.maxStackCnt=e:typeof n=="number"&&(o.maxStackCnt=n,o.hiddenConsumes=!0);let p=[],g=[];for(let F=0;F<t.length;F+=1){let X=t[F],te=BD(X);i[te]!=null?p.push({index:F,span:{start:X.firstCol,end:X.lastCol+1}}):g.push(X)}let y=o.addSegs(p),v=o.toRects(),{singleColPlacements:E,multiColPlacements:T,leftoverMargins:D}=DJ(v,t,a),N=[],B=[];for(let F of g){T[F.firstCol].push({seg:F,isVisible:!1,isAbsolute:!0,absoluteTop:0,marginTop:0});for(let X=F.firstCol;X<=F.lastCol;X+=1)E[X].push({seg:nu(F,X,X+1,a),isVisible:!1,isAbsolute:!1,absoluteTop:0,marginTop:0})}for(let F=0;F<a.length;F+=1)N.push(0);for(let F of y){let X=t[F.index],te=F.span;T[te.start].push({seg:nu(X,te.start,te.end,a),isVisible:!1,isAbsolute:!0,absoluteTop:0,marginTop:0});for(let H=te.start;H<te.end;H+=1)N[H]+=1,E[H].push({seg:nu(X,H,H+1,a),isVisible:!1,isAbsolute:!1,absoluteTop:0,marginTop:0})}for(let F=0;F<a.length;F+=1)B.push(D[F]);return{singleColPlacements:E,multiColPlacements:T,moreCnts:N,moreMarginTops:B}}function DJ(t,e,n){let r=IJ(t,n.length),i=[],s=[],a=[];for(let o=0;o<n.length;o+=1){let p=r[o],g=[],y=0,v=0;for(let T of p){let D=e[T.index];g.push({seg:nu(D,o,o+1,n),isVisible:!0,isAbsolute:!1,absoluteTop:T.levelCoord,marginTop:T.levelCoord-y}),y=T.levelCoord+T.thickness}let E=[];y=0,v=0;for(let T of p){let D=e[T.index],N=T.span.end-T.span.start>1,B=T.span.start===o;v+=T.levelCoord-y,y=T.levelCoord+T.thickness,N?(v+=T.thickness,B&&E.push({seg:nu(D,T.span.start,T.span.end,n),isVisible:!0,isAbsolute:!0,absoluteTop:T.levelCoord,marginTop:0})):B&&(E.push({seg:nu(D,T.span.start,T.span.end,n),isVisible:!0,isAbsolute:!1,absoluteTop:T.levelCoord,marginTop:v}),v=0)}i.push(g),s.push(E),a.push(v)}return{singleColPlacements:i,multiColPlacements:s,leftoverMargins:a}}function IJ(t,e){let n=[];for(let r=0;r<e;r+=1)n.push([]);for(let r of t)for(let i=r.span.start;i<r.span.end;i+=1)n[i].push(r);return n}function nu(t,e,n,r){if(t.firstCol===e&&t.lastCol===n-1)return t;let i=t.eventRange,s=i.range,a=ll(s,{start:r[e].date,end:Ur(r[n-1].date,1)});return Object.assign(Object.assign({},t),{firstCol:e,lastCol:n-1,eventRange:{def:i.def,ui:Object.assign(Object.assign({},i.ui),{durationEditable:!1}),instance:i.instance,range:a},isStart:t.isStart&&a.start.valueOf()===s.start.valueOf(),isEnd:t.isEnd&&a.end.valueOf()===s.end.valueOf()})}class PJ extends GM{constructor(){super(...arguments),this.hiddenConsumes=!1,this.forceHidden={}}addSegs(e){const n=super.addSegs(e),{entriesByLevel:r}=this,i=s=>!this.forceHidden[Cc(s)];for(let s=0;s<r.length;s+=1)r[s]=r[s].filter(i);return n}handleInvalidInsertion(e,n,r){const{entriesByLevel:i,forceHidden:s}=this,{touchingEntry:a,touchingLevel:o,touchingLateral:p}=e;if(this.hiddenConsumes&&a){const g=Cc(a);if(!s[g])if(this.allowReslicing){const y=Object.assign(Object.assign({},a),{span:Xx(a.span,n.span)}),v=Cc(y);s[v]=!0,i[o][p]=y,r.push(y),this.splitEntry(a,n,r)}else s[g]=!0,r.push(a)}super.handleInvalidInsertion(e,n,r)}}class zD extends co{constructor(){super(...arguments),this.cellElRefs=new fa,this.frameElRefs=new fa,this.fgElRefs=new fa,this.segHarnessRefs=new fa,this.rootElRef=Mi(),this.state={framePositions:null,maxContentHeight:null,segHeights:{}},this.handleResize=e=>{e&&this.updateSizing(!0)}}render(){let{props:e,state:n,context:r}=this,{options:i}=r,s=e.cells.length,a=Gg(e.businessHourSegs,s),o=Gg(e.bgEventSegs,s),p=Gg(this.getHighlightSegs(),s),g=Gg(this.getMirrorSegs(),s),{singleColPlacements:y,multiColPlacements:v,moreCnts:E,moreMarginTops:T}=MJ(Lx(e.fgEventSegs,i.eventOrder),e.dayMaxEvents,e.dayMaxEventRows,i.eventOrderStrict,n.segHeights,n.maxContentHeight,e.cells),D=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{};return ce("tr",{ref:this.rootElRef,role:"row"},e.renderIntro&&e.renderIntro(),e.cells.map((N,B)=>{let F=this.renderFgSegs(B,e.forPrint?y[B]:v[B],e.todayRange,D),X=this.renderFgSegs(B,RJ(g[B],v),e.todayRange,{},!!e.eventDrag,!!e.eventResize,!1);return ce(CJ,{key:N.key,elRef:this.cellElRefs.createRef(N.key),innerElRef:this.frameElRefs.createRef(N.key),dateProfile:e.dateProfile,date:N.date,showDayNumber:e.showDayNumbers,showWeekNumber:e.showWeekNumbers&&B===0,forceDayTop:e.showWeekNumbers,todayRange:e.todayRange,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,extraRenderProps:N.extraRenderProps,extraDataAttrs:N.extraDataAttrs,extraClassNames:N.extraClassNames,extraDateSpan:N.extraDateSpan,moreCnt:E[B],moreMarginTop:T[B],singlePlacements:y[B],fgContentElRef:this.fgElRefs.createRef(N.key),fgContent:ce(Qn,null,ce(Qn,null,F),ce(Qn,null,X)),bgContent:ce(Qn,null,this.renderFillSegs(p[B],"highlight"),this.renderFillSegs(a[B],"non-business"),this.renderFillSegs(o[B],"bg-event")),minHeight:e.cellMinHeight})}))}componentDidMount(){this.updateSizing(!0),this.context.addResizeHandler(this.handleResize)}componentDidUpdate(e,n){let r=this.props;this.updateSizing(!Po(e,r))}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}getHighlightSegs(){let{props:e}=this;return e.eventDrag&&e.eventDrag.segs.length?e.eventDrag.segs:e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:e.dateSelectionSegs}getMirrorSegs(){let{props:e}=this;return e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:[]}renderFgSegs(e,n,r,i,s,a,o){let{context:p}=this,{eventSelection:g}=this.props,{framePositions:y}=this.state,v=this.props.cells.length===1,E=s||a||o,T=[];if(y)for(let D of n){let{seg:N}=D,{instanceId:B}=N.eventRange.instance,F=D.isVisible&&!i[B],X=D.isAbsolute,te="",H="";X&&(p.isRtl?(H=0,te=y.lefts[N.lastCol]-y.lefts[N.firstCol]):(te=0,H=y.rights[N.firstCol]-y.rights[N.lastCol])),T.push(ce("div",{className:"fc-daygrid-event-harness"+(X?" fc-daygrid-event-harness-abs":""),key:ND(N),ref:E?null:this.segHarnessRefs.createRef(BD(N)),style:{visibility:F?"":"hidden",marginTop:X?"":D.marginTop,top:X?D.absoluteTop:"",left:te,right:H}},PD(N)?ce(OD,Object.assign({seg:N,isDragging:s,isSelected:B===g,defaultDisplayEventEnd:v},ha(N,r))):ce(RD,Object.assign({seg:N,isDragging:s,isResizing:a,isDateSelecting:o,isSelected:B===g,defaultDisplayEventEnd:v},ha(N,r)))))}return T}renderFillSegs(e,n){let{isRtl:r}=this.context,{todayRange:i}=this.props,{framePositions:s}=this.state,a=[];if(s)for(let o of e){let p=r?{right:0,left:s.lefts[o.lastCol]-s.lefts[o.firstCol]}:{left:0,right:s.rights[o.firstCol]-s.rights[o.lastCol]};a.push(ce("div",{key:VM(o.eventRange),className:"fc-daygrid-bg-harness",style:p},n==="bg-event"?ce(lD,Object.assign({seg:o},ha(o,i))):cD(n)))}return ce(Qn,{},...a)}updateSizing(e){let{props:n,state:r,frameElRefs:i}=this;if(!n.forPrint&&n.clientWidth!==null){if(e){let p=n.cells.map(g=>i.currentMap[g.key]);if(p.length){let g=this.rootElRef.current,y=new eu(g,p,!0,!1);(!r.framePositions||!r.framePositions.similarTo(y))&&this.setState({framePositions:new eu(g,p,!0,!1)})}}const s=this.state.segHeights,a=this.querySegHeights(),o=n.dayMaxEvents===!0||n.dayMaxEventRows===!0;this.safeSetState({segHeights:Object.assign(Object.assign({},s),a),maxContentHeight:o?this.computeMaxContentHeight():null})}}querySegHeights(){let e=this.segHarnessRefs.currentMap,n={};for(let r in e){let i=Math.round(e[r].getBoundingClientRect().height);n[r]=Math.max(n[r]||0,i)}return n}computeMaxContentHeight(){let e=this.props.cells[0].key,n=this.cellElRefs.currentMap[e],r=this.fgElRefs.currentMap[e];return n.getBoundingClientRect().bottom-r.getBoundingClientRect().top}getCellEls(){let e=this.cellElRefs.currentMap;return this.props.cells.map(n=>e[n.key])}}zD.addStateEquality({segHeights:Po});function RJ(t,e){if(!t.length)return[];let n=OJ(e);return t.map(r=>({seg:r,isVisible:!0,isAbsolute:!0,absoluteTop:n[r.eventRange.instance.instanceId],marginTop:0}))}function OJ(t){let e={};for(let n of t)for(let r of n)e[r.seg.eventRange.instance.instanceId]=r.absoluteTop;return e}class NJ extends co{constructor(){super(...arguments),this.splitBusinessHourSegs=Ft(qg),this.splitBgEventSegs=Ft(qg),this.splitFgEventSegs=Ft(qg),this.splitDateSelectionSegs=Ft(qg),this.splitEventDrag=Ft(DD),this.splitEventResize=Ft(DD),this.rowRefs=new fa}render(){let{props:e,context:n}=this,r=e.cells.length,i=this.splitBusinessHourSegs(e.businessHourSegs,r),s=this.splitBgEventSegs(e.bgEventSegs,r),a=this.splitFgEventSegs(e.fgEventSegs,r),o=this.splitDateSelectionSegs(e.dateSelectionSegs,r),p=this.splitEventDrag(e.eventDrag,r),g=this.splitEventResize(e.eventResize,r),y=r>=7&&e.clientWidth?e.clientWidth/n.options.aspectRatio/6:null;return ce(tu,{unit:"day"},(v,E)=>ce(Qn,null,e.cells.map((T,D)=>ce(zD,{ref:this.rowRefs.createRef(D),key:T.length?T[0].date.toISOString():D,showDayNumbers:r>1,showWeekNumbers:e.showWeekNumbers,todayRange:E,dateProfile:e.dateProfile,cells:T,renderIntro:e.renderRowIntro,businessHourSegs:i[D],eventSelection:e.eventSelection,bgEventSegs:s[D].filter(BJ),fgEventSegs:a[D],dateSelectionSegs:o[D],eventDrag:p[D],eventResize:g[D],dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,clientWidth:e.clientWidth,clientHeight:e.clientHeight,cellMinHeight:y,forPrint:e.forPrint}))))}componentDidMount(){this.registerInteractiveComponent()}componentDidUpdate(){this.registerInteractiveComponent()}registerInteractiveComponent(){if(!this.rootEl){const e=this.rowRefs.currentMap[0].getCellEls()[0],n=e?e.closest(".fc-daygrid-body"):null;n&&(this.rootEl=n,this.context.registerInteractiveComponent(this,{el:n,isHitComboAllowed:this.props.isHitComboAllowed}))}}componentWillUnmount(){this.rootEl&&(this.context.unregisterInteractiveComponent(this),this.rootEl=null)}prepareHits(){this.rowPositions=new eu(this.rootEl,this.rowRefs.collect().map(e=>e.getCellEls()[0]),!1,!0),this.colPositions=new eu(this.rootEl,this.rowRefs.currentMap[0].getCellEls(),!0,!1)}queryHit(e,n){let{colPositions:r,rowPositions:i}=this,s=r.leftToIndex(e),a=i.topToIndex(n);if(a!=null&&s!=null){let o=this.props.cells[a][s];return{dateProfile:this.props.dateProfile,dateSpan:Object.assign({range:this.getCellRange(a,s),allDay:!0},o.extraDateSpan),dayEl:this.getCellEl(a,s),rect:{left:r.lefts[s],right:r.rights[s],top:i.tops[a],bottom:i.bottoms[a]},layer:0}}return null}getCellEl(e,n){return this.rowRefs.currentMap[e].getCellEls()[n]}getCellRange(e,n){let r=this.props.cells[e][n].date,i=Ur(r,1);return{start:r,end:i}}}function BJ(t){return t.eventRange.def.allDay}class zJ extends co{constructor(){super(...arguments),this.elRef=Mi(),this.needsScrollReset=!1}render(){let{props:e}=this,{dayMaxEventRows:n,dayMaxEvents:r,expandRows:i}=e,s=r===!0||n===!0;s&&!i&&(s=!1,n=null,r=null);let a=["fc-daygrid-body",s?"fc-daygrid-body-balanced":"fc-daygrid-body-unbalanced",i?"":"fc-daygrid-body-natural"];return ce("div",{ref:this.elRef,className:a.join(" "),style:{width:e.clientWidth,minWidth:e.tableMinWidth}},ce("table",{role:"presentation",className:"fc-scrollgrid-sync-table",style:{width:e.clientWidth,minWidth:e.tableMinWidth,height:i?e.clientHeight:""}},e.colGroupNode,ce("tbody",{role:"presentation"},ce(NJ,{dateProfile:e.dateProfile,cells:e.cells,renderRowIntro:e.renderRowIntro,showWeekNumbers:e.showWeekNumbers,clientWidth:e.clientWidth,clientHeight:e.clientHeight,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,dayMaxEvents:r,dayMaxEventRows:n,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed}))))}componentDidMount(){this.requestScrollReset()}componentDidUpdate(e){e.dateProfile!==this.props.dateProfile?this.requestScrollReset():this.flushScrollReset()}requestScrollReset(){this.needsScrollReset=!0,this.flushScrollReset()}flushScrollReset(){if(this.needsScrollReset&&this.props.clientWidth){const e=LJ(this.elRef.current,this.props.dateProfile);if(e){const n=e.closest(".fc-daygrid-body"),r=n.closest(".fc-scroller"),i=e.getBoundingClientRect().top-n.getBoundingClientRect().top;r.scrollTop=i?i+1:0}this.needsScrollReset=!1}}}function LJ(t,e){let n;return e.currentRangeUnit.match(/year|month/)&&(n=t.querySelector(`[data-date="${CY(e.currentDate)}-01"]`)),n||(n=t.querySelector(`[data-date="${of(e.currentDate)}"]`)),n}class VJ extends eD{constructor(){super(...arguments),this.forceDayIfListItem=!0}sliceRange(e,n){return n.sliceRange(e)}}class LD extends co{constructor(){super(...arguments),this.slicer=new VJ,this.tableRef=Mi()}render(){let{props:e,context:n}=this;return ce(zJ,Object.assign({ref:this.tableRef},this.slicer.sliceProps(e,e.dateProfile,e.nextDayThreshold,n,e.dayTableModel),{dateProfile:e.dateProfile,cells:e.dayTableModel.cells,colGroupNode:e.colGroupNode,tableMinWidth:e.tableMinWidth,renderRowIntro:e.renderRowIntro,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.showWeekNumbers,expandRows:e.expandRows,headerAlignElRef:e.headerAlignElRef,clientWidth:e.clientWidth,clientHeight:e.clientHeight,forPrint:e.forPrint}))}}class FJ extends vJ{constructor(){super(...arguments),this.buildDayTableModel=Ft($J),this.headerRef=Mi(),this.tableRef=Mi()}render(){let{options:e,dateProfileGenerator:n}=this.context,{props:r}=this,i=this.buildDayTableModel(r.dateProfile,n),s=e.dayHeaders&&ce(KM,{ref:this.headerRef,dateProfile:r.dateProfile,dates:i.headerDates,datesRepDistinctDays:i.rowCnt===1}),a=o=>ce(LD,{ref:this.tableRef,dateProfile:r.dateProfile,dayTableModel:i,businessHours:r.businessHours,dateSelection:r.dateSelection,eventStore:r.eventStore,eventUiBases:r.eventUiBases,eventSelection:r.eventSelection,eventDrag:r.eventDrag,eventResize:r.eventResize,nextDayThreshold:e.nextDayThreshold,colGroupNode:o.tableColGroupNode,tableMinWidth:o.tableMinWidth,dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,showWeekNumbers:e.weekNumbers,expandRows:!r.isHeightAuto,headerAlignElRef:this.headerElRef,clientWidth:o.clientWidth,clientHeight:o.clientHeight,forPrint:r.forPrint});return e.dayMinWidth?this.renderHScrollLayout(s,a,i.colCnt,e.dayMinWidth):this.renderSimpleLayout(s,a)}}function $J(t,e){let n=new JM(t.renderRange,e);return new QM(n,/year|month|week/.test(t.currentRangeUnit))}class jJ extends wM{buildRenderRange(e,n,r){let i=super.buildRenderRange(e,n,r),{props:s}=this;return HJ({currentRange:i,snapToWeek:/^(year|month)$/.test(n),fixedWeekCount:s.fixedWeekCount,dateEnv:s.dateEnv})}}function HJ(t){let{dateEnv:e,currentRange:n}=t,{start:r,end:i}=n,s;if(t.snapToWeek&&(r=e.startOfWeek(r),s=e.startOfWeek(i),s.valueOf()!==i.valueOf()&&(i=rM(s,1))),t.fixedWeekCount){let a=e.startOfWeek(e.startOfMonth(Ur(n.end,-1))),o=Math.ceil(mY(a,i));i=rM(i,6-o)}return{start:r,end:i}}var UJ=':root{--fc-daygrid-event-dot-width:8px}.fc-daygrid-day-events:after,.fc-daygrid-day-events:before,.fc-daygrid-day-frame:after,.fc-daygrid-day-frame:before,.fc-daygrid-event-harness:after,.fc-daygrid-event-harness:before{clear:both;content:"";display:table}.fc .fc-daygrid-body{position:relative;z-index:1}.fc .fc-daygrid-day.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-daygrid-day-frame{min-height:100%;position:relative}.fc .fc-daygrid-day-top{display:flex;flex-direction:row-reverse}.fc .fc-day-other .fc-daygrid-day-top{opacity:.3}.fc .fc-daygrid-day-number{padding:4px;position:relative;z-index:4}.fc .fc-daygrid-month-start{font-size:1.1em;font-weight:700}.fc .fc-daygrid-day-events{margin-top:1px}.fc .fc-daygrid-body-balanced .fc-daygrid-day-events{left:0;position:absolute;right:0}.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events{min-height:2em;position:relative}.fc .fc-daygrid-body-natural .fc-daygrid-day-events{margin-bottom:1em}.fc .fc-daygrid-event-harness{position:relative}.fc .fc-daygrid-event-harness-abs{left:0;position:absolute;right:0;top:0}.fc .fc-daygrid-bg-harness{bottom:0;position:absolute;top:0}.fc .fc-daygrid-day-bg .fc-non-business{z-index:1}.fc .fc-daygrid-day-bg .fc-bg-event{z-index:2}.fc .fc-daygrid-day-bg .fc-highlight{z-index:3}.fc .fc-daygrid-event{margin-top:1px;z-index:6}.fc .fc-daygrid-event.fc-event-mirror{z-index:7}.fc .fc-daygrid-day-bottom{font-size:.85em;margin:0 2px}.fc .fc-daygrid-day-bottom:after,.fc .fc-daygrid-day-bottom:before{clear:both;content:"";display:table}.fc .fc-daygrid-more-link{border-radius:3px;cursor:pointer;line-height:1;margin-top:1px;max-width:100%;overflow:hidden;padding:2px;position:relative;white-space:nowrap;z-index:4}.fc .fc-daygrid-more-link:hover{background-color:rgba(0,0,0,.1)}.fc .fc-daygrid-week-number{background-color:var(--fc-neutral-bg-color);color:var(--fc-neutral-text-color);min-width:1.5em;padding:2px;position:absolute;text-align:center;top:0;z-index:5}.fc .fc-more-popover .fc-popover-body{min-width:220px;padding:10px}.fc-direction-ltr .fc-daygrid-event.fc-event-start,.fc-direction-rtl .fc-daygrid-event.fc-event-end{margin-left:2px}.fc-direction-ltr .fc-daygrid-event.fc-event-end,.fc-direction-rtl .fc-daygrid-event.fc-event-start{margin-right:2px}.fc-direction-ltr .fc-daygrid-more-link{float:left}.fc-direction-ltr .fc-daygrid-week-number{border-radius:0 0 3px 0;left:0}.fc-direction-rtl .fc-daygrid-more-link{float:right}.fc-direction-rtl .fc-daygrid-week-number{border-radius:0 0 0 3px;right:0}.fc-liquid-hack .fc-daygrid-day-frame{position:static}.fc-daygrid-event{border-radius:3px;font-size:var(--fc-small-font-size);position:relative;white-space:nowrap}.fc-daygrid-block-event .fc-event-time{font-weight:700}.fc-daygrid-block-event .fc-event-time,.fc-daygrid-block-event .fc-event-title{padding:1px}.fc-daygrid-dot-event{align-items:center;display:flex;padding:2px 0}.fc-daygrid-dot-event .fc-event-title{flex-grow:1;flex-shrink:1;font-weight:700;min-width:0;overflow:hidden}.fc-daygrid-dot-event.fc-event-mirror,.fc-daygrid-dot-event:hover{background:rgba(0,0,0,.1)}.fc-daygrid-dot-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-daygrid-event-dot{border:calc(var(--fc-daygrid-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-daygrid-event-dot-width)/2);box-sizing:content-box;height:0;margin:0 4px;width:0}.fc-direction-ltr .fc-daygrid-event .fc-event-time{margin-right:3px}.fc-direction-rtl .fc-daygrid-event .fc-event-time{margin-left:3px}';wg(UJ);var WJ=Ro({name:"@fullcalendar/daygrid",initialView:"dayGridMonth",views:{dayGrid:{component:FJ,dateProfileGeneratorClass:jJ},dayGridDay:{type:"dayGrid",duration:{days:1}},dayGridWeek:{type:"dayGrid",duration:{weeks:1}},dayGridMonth:{type:"dayGrid",duration:{months:1},fixedWeekCount:!0},dayGridYear:{type:"dayGrid",duration:{years:1}}}});class qJ extends dX{getKeyInfo(){return{allDay:{},timed:{}}}getKeysForDateSpan(e){return e.allDay?["allDay"]:["timed"]}getKeysForEventDef(e){return e.allDay?$Z(e)?["timed","allDay"]:["allDay"]:["timed"]}}const GJ=ir({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"});function VD(t){let e=["fc-timegrid-slot","fc-timegrid-slot-label",t.isLabeled?"fc-scrollgrid-shrink":"fc-timegrid-slot-minor"];return ce(ca.Consumer,null,n=>{if(!t.isLabeled)return ce("td",{className:e.join(" "),"data-time":t.isoTimeStr});let{dateEnv:r,options:i,viewApi:s}=n,a=i.slotLabelFormat==null?GJ:Array.isArray(i.slotLabelFormat)?ir(i.slotLabelFormat[0]):ir(i.slotLabelFormat),o={level:0,time:t.time,date:r.toDate(t.date),view:s,text:r.format(t.date,a)};return ce(yi,{elTag:"td",elClasses:e,elAttrs:{"data-time":t.isoTimeStr},renderProps:o,generatorName:"slotLabelContent",customGenerator:i.slotLabelContent,defaultGenerator:YJ,classNameGenerator:i.slotLabelClassNames,didMount:i.slotLabelDidMount,willUnmount:i.slotLabelWillUnmount},p=>ce("div",{className:"fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame"},ce(p,{elTag:"div",elClasses:["fc-timegrid-slot-label-cushion","fc-scrollgrid-shrink-cushion"]})))})}function YJ(t){return t.text}class ZJ extends Tn{render(){return this.props.slatMetas.map(e=>ce("tr",{key:e.key},ce(VD,Object.assign({},e))))}}const XJ=ir({week:"short"}),KJ=5;class JJ extends co{constructor(){super(...arguments),this.allDaySplitter=new qJ,this.headerElRef=Mi(),this.rootElRef=Mi(),this.scrollerElRef=Mi(),this.state={slatCoords:null},this.handleScrollTopRequest=e=>{let n=this.scrollerElRef.current;n&&(n.scrollTop=e)},this.renderHeadAxis=(e,n="")=>{let{options:r}=this.context,{dateProfile:i}=this.props,s=i.renderRange,o=sl(s.start,s.end)===1?Qd(this.context,s.start,"week"):{};return r.weekNumbers&&e==="day"?ce(dD,{elTag:"th",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},date:s.start,defaultFormat:XJ},p=>ce("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame","fc-timegrid-axis-frame-liquid"].join(" "),style:{height:n}},ce(p,{elTag:"a",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"],elAttrs:o}))):ce("th",{"aria-hidden":!0,className:"fc-timegrid-axis"},ce("div",{className:"fc-timegrid-axis-frame",style:{height:n}}))},this.renderTableRowAxis=e=>{let{options:n,viewApi:r}=this.context,i={text:n.allDayText,view:r};return ce(yi,{elTag:"td",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},renderProps:i,generatorName:"allDayContent",customGenerator:n.allDayContent,defaultGenerator:QJ,classNameGenerator:n.allDayClassNames,didMount:n.allDayDidMount,willUnmount:n.allDayWillUnmount},s=>ce("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame",e==null?" fc-timegrid-axis-frame-liquid":""].join(" "),style:{height:e}},ce(s,{elTag:"span",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"]})))},this.handleSlatCoords=e=>{this.setState({slatCoords:e})}}renderSimpleLayout(e,n,r){let{context:i,props:s}=this,a=[],o=Ug(i.options);return e&&a.push({type:"header",key:"header",isSticky:o,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),n&&(a.push({type:"body",key:"all-day",chunk:{content:n}}),a.push({type:"body",key:"all-day-divider",outerContent:ce("tr",{role:"presentation",className:"fc-scrollgrid-section"},ce("td",{className:"fc-timegrid-divider "+i.theme.getClass("tableCellShaded")}))})),a.push({type:"body",key:"body",liquid:!0,expandRows:!!i.options.expandRows,chunk:{scrollerElRef:this.scrollerElRef,content:r}}),ce(cf,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:i.viewSpec},ce(nv,{liquid:!s.isHeightAuto&&!s.forPrint,collapsibleWidth:s.forPrint,cols:[{width:"shrink"}],sections:a}))}renderHScrollLayout(e,n,r,i,s,a,o){let p=this.context.pluginHooks.scrollGridImpl;if(!p)throw new Error("No ScrollGrid implementation");let{context:g,props:y}=this,v=!y.forPrint&&Ug(g.options),E=!y.forPrint&&oD(g.options),T=[];e&&T.push({type:"header",key:"header",isSticky:v,syncRowHeights:!0,chunks:[{key:"axis",rowContent:N=>ce("tr",{role:"presentation"},this.renderHeadAxis("day",N.rowSyncHeights[0]))},{key:"cols",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),n&&(T.push({type:"body",key:"all-day",syncRowHeights:!0,chunks:[{key:"axis",rowContent:N=>ce("tr",{role:"presentation"},this.renderTableRowAxis(N.rowSyncHeights[0]))},{key:"cols",content:n}]}),T.push({key:"all-day-divider",type:"body",outerContent:ce("tr",{role:"presentation",className:"fc-scrollgrid-section"},ce("td",{colSpan:2,className:"fc-timegrid-divider "+g.theme.getClass("tableCellShaded")}))}));let D=g.options.nowIndicator;return T.push({type:"body",key:"body",liquid:!0,expandRows:!!g.options.expandRows,chunks:[{key:"axis",content:N=>ce("div",{className:"fc-timegrid-axis-chunk"},ce("table",{"aria-hidden":!0,style:{height:N.expandRows?N.clientHeight:""}},N.tableColGroupNode,ce("tbody",null,ce(ZJ,{slatMetas:a}))),ce("div",{className:"fc-timegrid-now-indicator-container"},ce(tu,{unit:D?"minute":"day"},B=>{let F=D&&o&&o.safeComputeTop(B);return typeof F=="number"?ce(rv,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:F},isAxis:!0,date:B}):null})))},{key:"cols",scrollerElRef:this.scrollerElRef,content:r}]}),E&&T.push({key:"footer",type:"footer",isSticky:!0,chunks:[{key:"axis",content:tv},{key:"cols",content:tv}]}),ce(cf,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:g.viewSpec},ce(p,{liquid:!y.isHeightAuto&&!y.forPrint,forPrint:y.forPrint,collapsibleWidth:!1,colGroups:[{width:"shrink",cols:[{width:"shrink"}]},{cols:[{span:i,minWidth:s}]}],sections:T}))}getAllDayMaxEventProps(){let{dayMaxEvents:e,dayMaxEventRows:n}=this.context.options;return(e===!0||n===!0)&&(e=void 0,n=KJ),{dayMaxEvents:e,dayMaxEventRows:n}}}function QJ(t){return t.text}class eQ{constructor(e,n,r){this.positions=e,this.dateProfile=n,this.slotDuration=r}safeComputeTop(e){let{dateProfile:n}=this;if(ua(n.currentRange,e)){let r=er(e),i=e.valueOf()-r.valueOf();if(i>=lo(n.slotMinTime)&&i<lo(n.slotMaxTime))return this.computeTimeTop(gn(i))}return null}computeDateTop(e,n){return n||(n=er(e)),this.computeTimeTop(gn(e.valueOf()-n.valueOf()))}computeTimeTop(e){let{positions:n,dateProfile:r}=this,i=n.els.length,s=(e.milliseconds-lo(r.slotMinTime))/lo(this.slotDuration),a,o;return s=Math.max(0,s),s=Math.min(i,s),a=Math.floor(s),a=Math.min(a,i-1),o=s-a,n.tops[a]+n.getHeight(a)*o}}class tQ extends Tn{render(){let{props:e,context:n}=this,{options:r}=n,{slatElRefs:i}=e;return ce("tbody",null,e.slatMetas.map((s,a)=>{let o={time:s.time,date:n.dateEnv.toDate(s.date),view:n.viewApi};return ce("tr",{key:s.key,ref:i.createRef(s.key)},e.axis&&ce(VD,Object.assign({},s)),ce(yi,{elTag:"td",elClasses:["fc-timegrid-slot","fc-timegrid-slot-lane",!s.isLabeled&&"fc-timegrid-slot-minor"],elAttrs:{"data-time":s.isoTimeStr},renderProps:o,generatorName:"slotLaneContent",customGenerator:r.slotLaneContent,classNameGenerator:r.slotLaneClassNames,didMount:r.slotLaneDidMount,willUnmount:r.slotLaneWillUnmount}))}))}}class nQ extends Tn{constructor(){super(...arguments),this.rootElRef=Mi(),this.slatElRefs=new fa}render(){let{props:e,context:n}=this;return ce("div",{ref:this.rootElRef,className:"fc-timegrid-slots"},ce("table",{"aria-hidden":!0,className:n.theme.getClass("table"),style:{minWidth:e.tableMinWidth,width:e.clientWidth,height:e.minHeight}},e.tableColGroupNode,ce(tQ,{slatElRefs:this.slatElRefs,axis:e.axis,slatMetas:e.slatMetas})))}componentDidMount(){this.updateSizing()}componentDidUpdate(){this.updateSizing()}componentWillUnmount(){this.props.onCoords&&this.props.onCoords(null)}updateSizing(){let{context:e,props:n}=this;n.onCoords&&n.clientWidth!==null&&this.rootElRef.current.offsetHeight&&n.onCoords(new eQ(new eu(this.rootElRef.current,rQ(this.slatElRefs.currentMap,n.slatMetas),!1,!0),this.props.dateProfile,e.options.slotDuration))}}function rQ(t,e){return e.map(n=>t[n.key])}function ff(t,e){let n=[],r;for(r=0;r<e;r+=1)n.push([]);if(t)for(r=0;r<t.length;r+=1)n[t[r].col].push(t[r]);return n}function FD(t,e){let n=[];if(t){for(let r=0;r<e;r+=1)n[r]={affectedInstances:t.affectedInstances,isEvent:t.isEvent,segs:[]};for(let r of t.segs)n[r.col].segs.push(r)}else for(let r=0;r<e;r+=1)n[r]=null;return n}class iQ extends Tn{render(){let{props:e}=this;return ce(uD,{elClasses:["fc-timegrid-more-link"],elStyle:{top:e.top,bottom:e.bottom},allDayDate:null,moreCnt:e.hiddenSegs.length,allSegs:e.hiddenSegs,hiddenSegs:e.hiddenSegs,extraDateSpan:e.extraDateSpan,dateProfile:e.dateProfile,todayRange:e.todayRange,popoverContent:()=>UD(e.hiddenSegs,e),defaultGenerator:sQ,forceTimed:!0},n=>ce(n,{elTag:"div",elClasses:["fc-timegrid-more-link-inner","fc-sticky"]}))}}function sQ(t){return t.shortText}function oQ(t,e,n){let r=new GM;e!=null&&(r.strictOrder=e),n!=null&&(r.maxStackCnt=n);let i=r.addSegs(t),s=kX(i),a=aQ(r);return a=uQ(a,1),{segRects:hQ(a),hiddenGroups:s}}function aQ(t){const{entriesByLevel:e}=t,n=dv((r,i)=>r+":"+i,(r,i)=>{let s=dQ(t,r,i),a=$D(s,n),o=e[r][i];return[Object.assign(Object.assign({},o),{nextLevelNodes:a[0]}),o.thickness+a[1]]});return $D(e.length?{level:0,lateralStart:0,lateralEnd:e[0].length}:null,n)[0]}function $D(t,e){if(!t)return[[],0];let{level:n,lateralStart:r,lateralEnd:i}=t,s=r,a=[];for(;s<i;)a.push(e(n,s)),s+=1;return a.sort(lQ),[a.map(cQ),a[0][1]]}function lQ(t,e){return e[1]-t[1]}function cQ(t){return t[0]}function dQ(t,e,n){let{levelCoords:r,entriesByLevel:i}=t,s=i[e][n],a=r[e]+s.thickness,o=r.length,p=e;for(;p<o&&r[p]<a;p+=1);for(;p<o;p+=1){let g=i[p],y,v=Jx(g,s.span.start,Zx),E=v[0]+v[1],T=E;for(;(y=g[T])&&y.span.start<s.span.end;)T+=1;if(E<T)return{level:p,lateralStart:E,lateralEnd:T}}return null}function uQ(t,e){const n=dv((r,i,s)=>Cc(r),(r,i,s)=>{let{nextLevelNodes:a,thickness:o}=r,p=o+s,g=o/p,y,v=[];if(!a.length)y=e;else for(let T of a)if(y===void 0){let D=n(T,i,p);y=D[0],v.push(D[1])}else{let D=n(T,y,0);v.push(D[1])}let E=(y-i)*g;return[y-E,Object.assign(Object.assign({},r),{thickness:E,nextLevelNodes:v})]});return t.map(r=>n(r,0,0)[1])}function hQ(t){let e=[];const n=dv((i,s,a)=>Cc(i),(i,s,a)=>{let o=Object.assign(Object.assign({},i),{levelCoord:s,stackDepth:a,stackForward:0});return e.push(o),o.stackForward=r(i.nextLevelNodes,s+i.thickness,a+1)+1});function r(i,s,a){let o=0;for(let p of i)o=Math.max(n(p,s,a),o);return o}return r(t,0,0),e}function dv(t,e){const n={};return(...r)=>{let i=t(...r);return i in n?n[i]:n[i]=e(...r)}}function jD(t,e,n=null,r=0){let i=[];if(n)for(let s=0;s<t.length;s+=1){let a=t[s],o=n.computeDateTop(a.start,e),p=Math.max(o+(r||0),n.computeDateTop(a.end,e));i.push({start:Math.round(o),end:Math.round(p)})}return i}function fQ(t,e,n,r){let i=[],s=[];for(let g=0;g<t.length;g+=1){let y=e[g];y?i.push({index:g,thickness:1,span:y}):s.push(t[g])}let{segRects:a,hiddenGroups:o}=oQ(i,n,r),p=[];for(let g of a)p.push({seg:t[g.index],rect:g});for(let g of s)p.push({seg:g,rect:null});return{segPlacements:p,hiddenGroups:o}}const pQ=ir({hour:"numeric",minute:"2-digit",meridiem:!1});class HD extends Tn{render(){return ce(aD,Object.assign({},this.props,{elClasses:["fc-timegrid-event","fc-v-event",this.props.isShort&&"fc-timegrid-event-short"],defaultTimeFormat:pQ}))}}class mQ extends Tn{constructor(){super(...arguments),this.sortEventSegs=Ft(Lx)}render(){let{props:e,context:n}=this,{options:r}=n,i=r.selectMirror,s=e.eventDrag&&e.eventDrag.segs||e.eventResize&&e.eventResize.segs||i&&e.dateSelectionSegs||[],a=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{},o=this.sortEventSegs(e.fgEventSegs,r.eventOrder);return ce(iv,{elTag:"td",elRef:e.elRef,elClasses:["fc-timegrid-col",...e.extraClassNames||[]],elAttrs:Object.assign({role:"gridcell"},e.extraDataAttrs),date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,extraRenderProps:e.extraRenderProps},p=>ce("div",{className:"fc-timegrid-col-frame"},ce("div",{className:"fc-timegrid-col-bg"},this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(e.dateSelectionSegs,"highlight")),ce("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(o,a,!1,!1,!1)),ce("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(s,{},!!e.eventDrag,!!e.eventResize,!!i,"mirror")),ce("div",{className:"fc-timegrid-now-indicator-container"},this.renderNowIndicator(e.nowIndicatorSegs)),sv(r)&&ce(p,{elTag:"div",elClasses:["fc-timegrid-col-misc"]})))}renderFgSegs(e,n,r,i,s,a){let{props:o}=this;return o.forPrint?UD(e,o):this.renderPositionedFgSegs(e,n,r,i,s,a)}renderPositionedFgSegs(e,n,r,i,s,a){let{eventMaxStack:o,eventShortHeight:p,eventOrderStrict:g,eventMinHeight:y}=this.context.options,{date:v,slatCoords:E,eventSelection:T,todayRange:D,nowDate:N}=this.props,B=r||i||s,F=jD(e,v,E,y),{segPlacements:X,hiddenGroups:te}=fQ(e,F,g,o);return ce(Qn,null,this.renderHiddenGroups(te,e),X.map(H=>{let{seg:ke,rect:ge}=H,Se=ke.eventRange.instance.instanceId,Pe=B||!!(!n[Se]&&ge),Ne=uv(ge&&ge.span),at=!B&&ge?this.computeSegHStyle(ge):{left:0,right:0},Je=!!ge&&ge.stackForward>0,mt=!!ge&&ge.span.end-ge.span.start<p;return ce("div",{className:"fc-timegrid-event-harness"+(Je?" fc-timegrid-event-harness-inset":""),key:a||Se,style:Object.assign(Object.assign({visibility:Pe?"":"hidden"},Ne),at)},ce(HD,Object.assign({seg:ke,isDragging:r,isResizing:i,isDateSelecting:s,isSelected:Se===T,isShort:mt},ha(ke,D,N))))}))}renderHiddenGroups(e,n){let{extraDateSpan:r,dateProfile:i,todayRange:s,nowDate:a,eventSelection:o,eventDrag:p,eventResize:g}=this.props;return ce(Qn,null,e.map(y=>{let v=uv(y.span),E=gQ(y.entries,n);return ce(iQ,{key:aM(fD(E)),hiddenSegs:E,top:v.top,bottom:v.bottom,extraDateSpan:r,dateProfile:i,todayRange:s,nowDate:a,eventSelection:o,eventDrag:p,eventResize:g})}))}renderFillSegs(e,n){let{props:r,context:i}=this,a=jD(e,r.date,r.slatCoords,i.options.eventMinHeight).map((o,p)=>{let g=e[p];return ce("div",{key:VM(g.eventRange),className:"fc-timegrid-bg-harness",style:uv(o)},n==="bg-event"?ce(lD,Object.assign({seg:g},ha(g,r.todayRange,r.nowDate))):cD(n))});return ce(Qn,null,a)}renderNowIndicator(e){let{slatCoords:n,date:r}=this.props;return n?e.map((i,s)=>ce(rv,{key:s,elClasses:["fc-timegrid-now-indicator-line"],elStyle:{top:n.computeDateTop(i.start,r)},isAxis:!1,date:r})):null}computeSegHStyle(e){let{isRtl:n,options:r}=this.context,i=r.slotEventOverlap,s=e.levelCoord,a=e.levelCoord+e.thickness,o,p;i&&(a=Math.min(1,s+(a-s)*2)),n?(o=1-a,p=s):(o=s,p=1-a);let g={zIndex:e.stackDepth+1,left:o*100+"%",right:p*100+"%"};return i&&!e.stackForward&&(g[n?"marginLeft":"marginRight"]=10*2),g}}function UD(t,{todayRange:e,nowDate:n,eventSelection:r,eventDrag:i,eventResize:s}){let a=(i?i.affectedInstances:null)||(s?s.affectedInstances:null)||{};return ce(Qn,null,t.map(o=>{let p=o.eventRange.instance.instanceId;return ce("div",{key:p,style:{visibility:a[p]?"hidden":""}},ce(HD,Object.assign({seg:o,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:p===r,isShort:!1},ha(o,e,n))))}))}function uv(t){return t?{top:t.start,bottom:-t.end}:{top:"",bottom:""}}function gQ(t,e){return t.map(n=>e[n.index])}class yQ extends Tn{constructor(){super(...arguments),this.splitFgEventSegs=Ft(ff),this.splitBgEventSegs=Ft(ff),this.splitBusinessHourSegs=Ft(ff),this.splitNowIndicatorSegs=Ft(ff),this.splitDateSelectionSegs=Ft(ff),this.splitEventDrag=Ft(FD),this.splitEventResize=Ft(FD),this.rootElRef=Mi(),this.cellElRefs=new fa}render(){let{props:e,context:n}=this,r=n.options.nowIndicator&&e.slatCoords&&e.slatCoords.safeComputeTop(e.nowDate),i=e.cells.length,s=this.splitFgEventSegs(e.fgEventSegs,i),a=this.splitBgEventSegs(e.bgEventSegs,i),o=this.splitBusinessHourSegs(e.businessHourSegs,i),p=this.splitNowIndicatorSegs(e.nowIndicatorSegs,i),g=this.splitDateSelectionSegs(e.dateSelectionSegs,i),y=this.splitEventDrag(e.eventDrag,i),v=this.splitEventResize(e.eventResize,i);return ce("div",{className:"fc-timegrid-cols",ref:this.rootElRef},ce("table",{role:"presentation",style:{minWidth:e.tableMinWidth,width:e.clientWidth}},e.tableColGroupNode,ce("tbody",{role:"presentation"},ce("tr",{role:"row"},e.axis&&ce("td",{"aria-hidden":!0,className:"fc-timegrid-col fc-timegrid-axis"},ce("div",{className:"fc-timegrid-col-frame"},ce("div",{className:"fc-timegrid-now-indicator-container"},typeof r=="number"&&ce(rv,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:r},isAxis:!0,date:e.nowDate})))),e.cells.map((E,T)=>ce(mQ,{key:E.key,elRef:this.cellElRefs.createRef(E.key),dateProfile:e.dateProfile,date:E.date,nowDate:e.nowDate,todayRange:e.todayRange,extraRenderProps:E.extraRenderProps,extraDataAttrs:E.extraDataAttrs,extraClassNames:E.extraClassNames,extraDateSpan:E.extraDateSpan,fgEventSegs:s[T],bgEventSegs:a[T],businessHourSegs:o[T],nowIndicatorSegs:p[T],dateSelectionSegs:g[T],eventDrag:y[T],eventResize:v[T],slatCoords:e.slatCoords,eventSelection:e.eventSelection,forPrint:e.forPrint}))))))}componentDidMount(){this.updateCoords()}componentDidUpdate(){this.updateCoords()}updateCoords(){let{props:e}=this;e.onColCoords&&e.clientWidth!==null&&e.onColCoords(new eu(this.rootElRef.current,bQ(this.cellElRefs.currentMap,e.cells),!0,!1))}}function bQ(t,e){return e.map(n=>t[n.key])}class _Q extends co{constructor(){super(...arguments),this.processSlotOptions=Ft(xQ),this.state={slatCoords:null},this.handleRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)},this.handleScrollRequest=e=>{let{onScrollTopRequest:n}=this.props,{slatCoords:r}=this.state;if(n&&r){if(e.time){let i=r.computeTimeTop(e.time);i=Math.ceil(i),i&&(i+=1),n(i)}return!0}return!1},this.handleColCoords=e=>{this.colCoords=e},this.handleSlatCoords=e=>{this.setState({slatCoords:e}),this.props.onSlatCoords&&this.props.onSlatCoords(e)}}render(){let{props:e,state:n}=this;return ce("div",{className:"fc-timegrid-body",ref:this.handleRootEl,style:{width:e.clientWidth,minWidth:e.tableMinWidth}},ce(nQ,{axis:e.axis,dateProfile:e.dateProfile,slatMetas:e.slatMetas,clientWidth:e.clientWidth,minHeight:e.expandRows?e.clientHeight:"",tableMinWidth:e.tableMinWidth,tableColGroupNode:e.axis?e.tableColGroupNode:null,onCoords:this.handleSlatCoords}),ce(yQ,{cells:e.cells,axis:e.axis,dateProfile:e.dateProfile,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange,nowDate:e.nowDate,nowIndicatorSegs:e.nowIndicatorSegs,clientWidth:e.clientWidth,tableMinWidth:e.tableMinWidth,tableColGroupNode:e.tableColGroupNode,slatCoords:n.slatCoords,onColCoords:this.handleColCoords,forPrint:e.forPrint}))}componentDidMount(){this.scrollResponder=this.context.createScrollResponder(this.handleScrollRequest)}componentDidUpdate(e){this.scrollResponder.update(e.dateProfile!==this.props.dateProfile)}componentWillUnmount(){this.scrollResponder.detach()}queryHit(e,n){let{dateEnv:r,options:i}=this.context,{colCoords:s}=this,{dateProfile:a}=this.props,{slatCoords:o}=this.state,{snapDuration:p,snapsPerSlot:g}=this.processSlotOptions(this.props.slotDuration,i.snapDuration),y=s.leftToIndex(e),v=o.positions.topToIndex(n);if(y!=null&&v!=null){let E=this.props.cells[y],T=o.positions.tops[v],D=o.positions.getHeight(v),N=(n-T)/D,B=Math.floor(N*g),F=v*g+B,X=this.props.cells[y].date,te=px(a.slotMinTime,uY(p,F)),H=r.add(X,te),ke=r.add(H,p);return{dateProfile:a,dateSpan:Object.assign({range:{start:H,end:ke},allDay:!1},E.extraDateSpan),dayEl:s.els[y],rect:{left:s.lefts[y],right:s.rights[y],top:T,bottom:T+D},layer:0}}return null}}function xQ(t,e){let n=e||t,r=mx(t,n);return r===null&&(n=t,r=1),{snapDuration:n,snapsPerSlot:r}}class vQ extends eD{sliceRange(e,n){let r=[];for(let i=0;i<n.length;i+=1){let s=ll(e,n[i]);s&&r.push({start:s.start,end:s.end,isStart:s.start.valueOf()===e.start.valueOf(),isEnd:s.end.valueOf()===e.end.valueOf(),col:i})}return r}}class wQ extends co{constructor(){super(...arguments),this.buildDayRanges=Ft(kQ),this.slicer=new vQ,this.timeColsRef=Mi()}render(){let{props:e,context:n}=this,{dateProfile:r,dayTableModel:i}=e,{nowIndicator:s,nextDayThreshold:a}=n.options,o=this.buildDayRanges(i,r,n.dateEnv);return ce(tu,{unit:s?"minute":"day"},(p,g)=>ce(_Q,Object.assign({ref:this.timeColsRef},this.slicer.sliceProps(e,r,null,n,o),{forPrint:e.forPrint,axis:e.axis,dateProfile:r,slatMetas:e.slatMetas,slotDuration:e.slotDuration,cells:i.cells[0],tableColGroupNode:e.tableColGroupNode,tableMinWidth:e.tableMinWidth,clientWidth:e.clientWidth,clientHeight:e.clientHeight,expandRows:e.expandRows,nowDate:p,nowIndicatorSegs:s&&this.slicer.sliceNowDate(p,r,a,n,o),todayRange:g,onScrollTopRequest:e.onScrollTopRequest,onSlatCoords:e.onSlatCoords})))}}function kQ(t,e,n){let r=[];for(let i of t.headerDates)r.push({start:n.add(i,e.slotMinTime),end:n.add(i,e.slotMaxTime)});return r}const WD=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];function EQ(t,e,n,r,i){let s=new Date(0),a=t,o=gn(0),p=n||SQ(r),g=[];for(;lo(a)<lo(e);){let y=i.add(s,a),v=mx(o,p)!==null;g.push({date:y,time:a,key:y.toISOString(),isoTimeStr:TY(y),isLabeled:v}),a=px(a,r),o=px(o,r)}return g}function SQ(t){let e,n,r;for(e=WD.length-1;e>=0;e-=1)if(n=gn(WD[e]),r=mx(n,t),r!==null&&r>1)return n;return t}class CQ extends JJ{constructor(){super(...arguments),this.buildTimeColsModel=Ft(TQ),this.buildSlatMetas=Ft(EQ)}render(){let{options:e,dateEnv:n,dateProfileGenerator:r}=this.context,{props:i}=this,{dateProfile:s}=i,a=this.buildTimeColsModel(s,r),o=this.allDaySplitter.splitProps(i),p=this.buildSlatMetas(s.slotMinTime,s.slotMaxTime,e.slotLabelInterval,e.slotDuration,n),{dayMinWidth:g}=e,y=!g,v=g,E=e.dayHeaders&&ce(KM,{dates:a.headerDates,dateProfile:s,datesRepDistinctDays:!0,renderIntro:y?this.renderHeadAxis:null}),T=e.allDaySlot!==!1&&(N=>ce(LD,Object.assign({},o.allDay,{dateProfile:s,dayTableModel:a,nextDayThreshold:e.nextDayThreshold,tableMinWidth:N.tableMinWidth,colGroupNode:N.tableColGroupNode,renderRowIntro:y?this.renderTableRowAxis:null,showWeekNumbers:!1,expandRows:!1,headerAlignElRef:this.headerElRef,clientWidth:N.clientWidth,clientHeight:N.clientHeight,forPrint:i.forPrint},this.getAllDayMaxEventProps()))),D=N=>ce(wQ,Object.assign({},o.timed,{dayTableModel:a,dateProfile:s,axis:y,slotDuration:e.slotDuration,slatMetas:p,forPrint:i.forPrint,tableColGroupNode:N.tableColGroupNode,tableMinWidth:N.tableMinWidth,clientWidth:N.clientWidth,clientHeight:N.clientHeight,onSlatCoords:this.handleSlatCoords,expandRows:N.expandRows,onScrollTopRequest:this.handleScrollTopRequest}));return v?this.renderHScrollLayout(E,T,D,a.colCnt,g,p,this.state.slatCoords):this.renderSimpleLayout(E,T,D)}}function TQ(t,e){let n=new JM(t.renderRange,e);return new QM(n,!1)}var AQ='.fc-v-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-v-event .fc-event-main{color:var(--fc-event-text-color);height:100%}.fc-v-event .fc-event-main-frame{display:flex;flex-direction:column;height:100%}.fc-v-event .fc-event-time{flex-grow:0;flex-shrink:0;max-height:100%;overflow:hidden}.fc-v-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-height:0}.fc-v-event .fc-event-title{bottom:0;max-height:100%;overflow:hidden;top:0}.fc-v-event:not(.fc-event-start){border-top-left-radius:0;border-top-right-radius:0;border-top-width:0}.fc-v-event:not(.fc-event-end){border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-width:0}.fc-v-event.fc-event-selected:before{left:-10px;right:-10px}.fc-v-event .fc-event-resizer-start{cursor:n-resize}.fc-v-event .fc-event-resizer-end{cursor:s-resize}.fc-v-event:not(.fc-event-selected) .fc-event-resizer{height:var(--fc-event-resizer-thickness);left:0;right:0}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start{top:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer{left:50%;margin-left:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-start{top:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc .fc-timegrid .fc-daygrid-body{z-index:2}.fc .fc-timegrid-divider{padding:0 0 2px}.fc .fc-timegrid-body{min-height:100%;position:relative;z-index:1}.fc .fc-timegrid-axis-chunk{position:relative}.fc .fc-timegrid-axis-chunk>table,.fc .fc-timegrid-slots{position:relative;z-index:1}.fc .fc-timegrid-slot{border-bottom:0;height:1.5em}.fc .fc-timegrid-slot:empty:before{content:"\\00a0"}.fc .fc-timegrid-slot-minor{border-top-style:dotted}.fc .fc-timegrid-slot-label-cushion{display:inline-block;white-space:nowrap}.fc .fc-timegrid-slot-label{vertical-align:middle}.fc .fc-timegrid-axis-cushion,.fc .fc-timegrid-slot-label-cushion{padding:0 4px}.fc .fc-timegrid-axis-frame-liquid{height:100%}.fc .fc-timegrid-axis-frame{align-items:center;display:flex;justify-content:flex-end;overflow:hidden}.fc .fc-timegrid-axis-cushion{flex-shrink:0;max-width:60px}.fc-direction-ltr .fc-timegrid-slot-label-frame{text-align:right}.fc-direction-rtl .fc-timegrid-slot-label-frame{text-align:left}.fc-liquid-hack .fc-timegrid-axis-frame-liquid{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-timegrid-col-frame{min-height:100%;position:relative}.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols{bottom:0;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols>table{height:100%}.fc-media-screen .fc-timegrid-col-bg,.fc-media-screen .fc-timegrid-col-events,.fc-media-screen .fc-timegrid-now-indicator-container{left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col-bg{z-index:2}.fc .fc-timegrid-col-bg .fc-non-business{z-index:1}.fc .fc-timegrid-col-bg .fc-bg-event{z-index:2}.fc .fc-timegrid-col-bg .fc-highlight{z-index:3}.fc .fc-timegrid-bg-harness{left:0;position:absolute;right:0}.fc .fc-timegrid-col-events{z-index:3}.fc .fc-timegrid-now-indicator-container{bottom:0;overflow:hidden}.fc-direction-ltr .fc-timegrid-col-events{margin:0 2.5% 0 2px}.fc-direction-rtl .fc-timegrid-col-events{margin:0 2px 0 2.5%}.fc-timegrid-event-harness{position:absolute}.fc-timegrid-event-harness>.fc-timegrid-event{bottom:0;left:0;position:absolute;right:0;top:0}.fc-timegrid-event-harness-inset .fc-timegrid-event,.fc-timegrid-event.fc-event-mirror,.fc-timegrid-more-link{box-shadow:0 0 0 1px var(--fc-page-bg-color)}.fc-timegrid-event,.fc-timegrid-more-link{border-radius:3px;font-size:var(--fc-small-font-size)}.fc-timegrid-event{margin-bottom:1px}.fc-timegrid-event .fc-event-main{padding:1px 1px 0}.fc-timegrid-event .fc-event-time{font-size:var(--fc-small-font-size);margin-bottom:1px;white-space:nowrap}.fc-timegrid-event-short .fc-event-main-frame{flex-direction:row;overflow:hidden}.fc-timegrid-event-short .fc-event-time:after{content:"\\00a0-\\00a0"}.fc-timegrid-event-short .fc-event-title{font-size:var(--fc-small-font-size)}.fc-timegrid-more-link{background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;margin-bottom:1px;position:absolute;z-index:9999}.fc-timegrid-more-link-inner{padding:3px 2px;top:0}.fc-direction-ltr .fc-timegrid-more-link{right:0}.fc-direction-rtl .fc-timegrid-more-link{left:0}.fc .fc-timegrid-now-indicator-arrow,.fc .fc-timegrid-now-indicator-line{pointer-events:none}.fc .fc-timegrid-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;border-width:1px 0 0;left:0;position:absolute;right:0;z-index:4}.fc .fc-timegrid-now-indicator-arrow{border-color:var(--fc-now-indicator-color);border-style:solid;margin-top:-5px;position:absolute;z-index:4}.fc-direction-ltr .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 0 5px 6px;left:0}.fc-direction-rtl .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 6px 5px 0;right:0}';wg(AQ);var MQ=Ro({name:"@fullcalendar/timegrid",initialView:"timeGridWeek",optionRefiners:{allDaySlot:Boolean},views:{timeGrid:{component:CQ,usesMinMaxTime:!0,allDaySlot:!0,slotDuration:"00:30:00",slotEventOverlap:!0},timeGridDay:{type:"timeGrid",duration:{days:1}},timeGridWeek:{type:"timeGrid",duration:{weeks:1}}}});class DQ extends Tn{constructor(){super(...arguments),this.state={textId:nl()}}render(){let{theme:e,dateEnv:n,options:r,viewApi:i}=this.context,{cellId:s,dayDate:a,todayRange:o}=this.props,{textId:p}=this.state,g=Ux(a,o),y=r.listDayFormat?n.format(a,r.listDayFormat):"",v=r.listDaySideFormat?n.format(a,r.listDaySideFormat):"",E=Object.assign({date:n.toDate(a),view:i,textId:p,text:y,sideText:v,navLinkAttrs:Qd(this.context,a),sideNavLinkAttrs:Qd(this.context,a,"day",!1)},g);return ce(yi,{elTag:"tr",elClasses:["fc-list-day",...Fg(g,e)],elAttrs:{"data-date":of(a)},renderProps:E,generatorName:"dayHeaderContent",customGenerator:r.dayHeaderContent,defaultGenerator:IQ,classNameGenerator:r.dayHeaderClassNames,didMount:r.dayHeaderDidMount,willUnmount:r.dayHeaderWillUnmount},T=>ce("th",{scope:"colgroup",colSpan:3,id:s,"aria-labelledby":p},ce(T,{elTag:"div",elClasses:["fc-list-day-cushion",e.getClass("tableCellShaded")]})))}}function IQ(t){return ce(Qn,null,t.text&&ce("a",Object.assign({id:t.textId,className:"fc-list-day-text"},t.navLinkAttrs),t.text),t.sideText&&ce("a",Object.assign({"aria-hidden":!0,className:"fc-list-day-side-text"},t.sideNavLinkAttrs),t.sideText))}const PQ=ir({hour:"numeric",minute:"2-digit",meridiem:"short"});class RQ extends Tn{render(){let{props:e,context:n}=this,{options:r}=n,{seg:i,timeHeaderId:s,eventHeaderId:a,dateHeaderId:o}=e,p=r.eventTimeFormat||PQ;return ce(Wg,Object.assign({},e,{elTag:"tr",elClasses:["fc-list-event",i.eventRange.def.url&&"fc-event-forced-url"],defaultGenerator:()=>OQ(i,n),seg:i,timeText:"",disableDragging:!0,disableResizing:!0}),(g,y)=>ce(Qn,null,NQ(i,p,n,s,o),ce("td",{"aria-hidden":!0,className:"fc-list-event-graphic"},ce("span",{className:"fc-list-event-dot",style:{borderColor:y.borderColor||y.backgroundColor}})),ce(g,{elTag:"td",elClasses:["fc-list-event-title"],elAttrs:{headers:`${a} ${o}`}})))}}function OQ(t,e){let n=Vx(t,e);return ce("a",Object.assign({},n),t.eventRange.def.title)}function NQ(t,e,n,r,i){let{options:s}=n;if(s.displayEventTime!==!1){let a=t.eventRange.def,o=t.eventRange.instance,p=!1,g;if(a.allDay?p=!0:hZ(t.eventRange.range)?t.isStart?g=hf(t,e,n,null,null,o.range.start,t.end):t.isEnd?g=hf(t,e,n,null,null,t.start,o.range.end):p=!0:g=hf(t,e,n),p){let y={text:n.options.allDayText,view:n.viewApi};return ce(yi,{elTag:"td",elClasses:["fc-list-event-time"],elAttrs:{headers:`${r} ${i}`},renderProps:y,generatorName:"allDayContent",customGenerator:s.allDayContent,defaultGenerator:BQ,classNameGenerator:s.allDayClassNames,didMount:s.allDayDidMount,willUnmount:s.allDayWillUnmount})}return ce("td",{className:"fc-list-event-time"},g)}return null}function BQ(t){return t.text}class zQ extends co{constructor(){super(...arguments),this.computeDateVars=Ft(VQ),this.eventStoreToSegs=Ft(this._eventStoreToSegs),this.state={timeHeaderId:nl(),eventHeaderId:nl(),dateHeaderIdRoot:nl()},this.setRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:n}=this,{dayDates:r,dayRanges:i}=this.computeDateVars(e.dateProfile),s=this.eventStoreToSegs(e.eventStore,e.eventUiBases,i);return ce(cf,{elRef:this.setRootEl,elClasses:["fc-list",n.theme.getClass("table"),n.options.stickyHeaderDates!==!1?"fc-list-sticky":""],viewSpec:n.viewSpec},ce(iD,{liquid:!e.isHeightAuto,overflowX:e.isHeightAuto?"visible":"hidden",overflowY:e.isHeightAuto?"visible":"auto"},s.length>0?this.renderSegList(s,r):this.renderEmptyMessage()))}renderEmptyMessage(){let{options:e,viewApi:n}=this.context,r={text:e.noEventsText,view:n};return ce(yi,{elTag:"div",elClasses:["fc-list-empty"],renderProps:r,generatorName:"noEventsContent",customGenerator:e.noEventsContent,defaultGenerator:LQ,classNameGenerator:e.noEventsClassNames,didMount:e.noEventsDidMount,willUnmount:e.noEventsWillUnmount},i=>ce(i,{elTag:"div",elClasses:["fc-list-empty-cushion"]}))}renderSegList(e,n){let{theme:r,options:i}=this.context,{timeHeaderId:s,eventHeaderId:a,dateHeaderIdRoot:o}=this.state,p=FQ(e);return ce(tu,{unit:"day"},(g,y)=>{let v=[];for(let E=0;E<p.length;E+=1){let T=p[E];if(T){let D=of(n[E]),N=o+"-"+D;v.push(ce(DQ,{key:D,cellId:N,dayDate:n[E],todayRange:y})),T=Lx(T,i.eventOrder);for(let B of T)v.push(ce(RQ,Object.assign({key:D+":"+B.eventRange.instance.instanceId,seg:B,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,timeHeaderId:s,eventHeaderId:a,dateHeaderId:N},ha(B,y,g))))}}return ce("table",{className:"fc-list-table "+r.getClass("table")},ce("thead",null,ce("tr",null,ce("th",{scope:"col",id:s},i.timeHint),ce("th",{scope:"col","aria-hidden":!0}),ce("th",{scope:"col",id:a},i.eventHint))),ce("tbody",null,v))})}_eventStoreToSegs(e,n,r){return this.eventRangesToSegs(zx(e,n,this.props.dateProfile.activeRange,this.context.options.nextDayThreshold).fg,r)}eventRangesToSegs(e,n){let r=[];for(let i of e)r.push(...this.eventRangeToSegs(i,n));return r}eventRangeToSegs(e,n){let{dateEnv:r}=this.context,{nextDayThreshold:i}=this.context.options,s=e.range,a=e.def.allDay,o,p,g,y=[];for(o=0;o<n.length;o+=1)if(p=ll(s,n[o]),p&&(g={component:this,eventRange:e,start:p.start,end:p.end,isStart:e.isStart&&p.start.valueOf()===s.start.valueOf(),isEnd:e.isEnd&&p.end.valueOf()===s.end.valueOf(),dayIndex:o},y.push(g),!g.isEnd&&!a&&o+1<n.length&&s.end<r.add(n[o+1].start,i))){g.end=s.end,g.isEnd=!0;break}return y}}function LQ(t){return t.text}function VQ(t){let e=er(t.renderRange.start),n=t.renderRange.end,r=[],i=[];for(;e<n;)r.push(e),i.push({start:e,end:Ur(e,1)}),e=Ur(e,1);return{dayDates:r,dayRanges:i}}function FQ(t){let e=[],n,r;for(n=0;n<t.length;n+=1)r=t[n],(e[r.dayIndex]||(e[r.dayIndex]=[])).push(r);return e}var $Q=':root{--fc-list-event-dot-width:10px;--fc-list-event-hover-bg-color:#f5f5f5}.fc-theme-standard .fc-list{border:1px solid var(--fc-border-color)}.fc .fc-list-empty{align-items:center;background-color:var(--fc-neutral-bg-color);display:flex;height:100%;justify-content:center}.fc .fc-list-empty-cushion{margin:5em 0}.fc .fc-list-table{border-style:hidden;width:100%}.fc .fc-list-table tr>*{border-left:0;border-right:0}.fc .fc-list-sticky .fc-list-day>*{background:var(--fc-page-bg-color);position:sticky;top:0}.fc .fc-list-table thead{left:-10000px;position:absolute}.fc .fc-list-table tbody>tr:first-child th{border-top:0}.fc .fc-list-table th{padding:0}.fc .fc-list-day-cushion,.fc .fc-list-table td{padding:8px 14px}.fc .fc-list-day-cushion:after{clear:both;content:"";display:table}.fc-theme-standard .fc-list-day-cushion{background-color:var(--fc-neutral-bg-color)}.fc-direction-ltr .fc-list-day-text,.fc-direction-rtl .fc-list-day-side-text{float:left}.fc-direction-ltr .fc-list-day-side-text,.fc-direction-rtl .fc-list-day-text{float:right}.fc-direction-ltr .fc-list-table .fc-list-event-graphic{padding-right:0}.fc-direction-rtl .fc-list-table .fc-list-event-graphic{padding-left:0}.fc .fc-list-event.fc-event-forced-url{cursor:pointer}.fc .fc-list-event:hover td{background-color:var(--fc-list-event-hover-bg-color)}.fc .fc-list-event-graphic,.fc .fc-list-event-time{white-space:nowrap;width:1px}.fc .fc-list-event-dot{border:calc(var(--fc-list-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-list-event-dot-width)/2);box-sizing:content-box;display:inline-block;height:0;width:0}.fc .fc-list-event-title a{color:inherit;text-decoration:none}.fc .fc-list-event.fc-event-forced-url:hover a{text-decoration:underline}';wg($Q);const jQ={listDayFormat:qD,listDaySideFormat:qD,noEventsClassNames:De,noEventsContent:De,noEventsDidMount:De,noEventsWillUnmount:De};function qD(t){return t===!1?null:ir(t)}var HQ=Ro({name:"@fullcalendar/list",optionRefiners:jQ,views:{list:{component:zQ,buttonTextKey:"list",listDayFormat:{month:"long",day:"numeric",year:"numeric"}},listDay:{type:"list",duration:{days:1},listDayFormat:{weekday:"long"}},listWeek:{type:"list",duration:{weeks:1},listDayFormat:{weekday:"long"},listDaySideFormat:{month:"long",day:"numeric",year:"numeric"}},listMonth:{type:"list",duration:{month:1},listDaySideFormat:{weekday:"long"}},listYear:{type:"list",duration:{year:1},listDaySideFormat:{weekday:"long"}}}});Qx.touchMouseIgnoreWait=500;let hv=0,Yg=0,fv=!1;class GD{constructor(e){this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=n=>{if(!this.shouldIgnoreMouse()&&UQ(n)&&this.tryStart(n)){let r=this.createEventFromMouse(n,!0);this.emitter.trigger("pointerdown",r),this.initScrollWatch(r),this.shouldIgnoreMove||document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}},this.handleMouseMove=n=>{let r=this.createEventFromMouse(n);this.recordCoords(r),this.emitter.trigger("pointermove",r)},this.handleMouseUp=n=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.emitter.trigger("pointerup",this.createEventFromMouse(n)),this.cleanup()},this.handleTouchStart=n=>{if(this.tryStart(n)){this.isTouchDragging=!0;let r=this.createEventFromTouch(n,!0);this.emitter.trigger("pointerdown",r),this.initScrollWatch(r);let i=n.target;this.shouldIgnoreMove||i.addEventListener("touchmove",this.handleTouchMove),i.addEventListener("touchend",this.handleTouchEnd),i.addEventListener("touchcancel",this.handleTouchEnd),window.addEventListener("scroll",this.handleTouchScroll,!0)}},this.handleTouchMove=n=>{let r=this.createEventFromTouch(n);this.recordCoords(r),this.emitter.trigger("pointermove",r)},this.handleTouchEnd=n=>{if(this.isDragging){let r=n.target;r.removeEventListener("touchmove",this.handleTouchMove),r.removeEventListener("touchend",this.handleTouchEnd),r.removeEventListener("touchcancel",this.handleTouchEnd),window.removeEventListener("scroll",this.handleTouchScroll,!0),this.emitter.trigger("pointerup",this.createEventFromTouch(n)),this.cleanup(),this.isTouchDragging=!1,WQ()}},this.handleTouchScroll=()=>{this.wasTouchScroll=!0},this.handleScroll=n=>{if(!this.shouldIgnoreMove){let r=window.scrollX-this.prevScrollX+this.prevPageX,i=window.scrollY-this.prevScrollY+this.prevPageY;this.emitter.trigger("pointermove",{origEvent:n,isTouch:this.isTouchDragging,subjectEl:this.subjectEl,pageX:r,pageY:i,deltaX:r-this.origPageX,deltaY:i-this.origPageY})}},this.containerEl=e,this.emitter=new Lg,e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),qQ()}destroy(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),GQ()}tryStart(e){let n=this.querySubjectEl(e),r=e.target;return n&&(!this.handleSelector||gi(r,this.handleSelector))?(this.subjectEl=n,this.isDragging=!0,this.wasTouchScroll=!1,!0):!1}cleanup(){fv=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()}querySubjectEl(e){return this.selector?gi(e.target,this.selector):this.containerEl}shouldIgnoreMouse(){return hv||this.isTouchDragging}cancelTouchScroll(){this.isDragging&&(fv=!0)}initScrollWatch(e){this.shouldWatchScroll&&(this.recordCoords(e),window.addEventListener("scroll",this.handleScroll,!0))}recordCoords(e){this.shouldWatchScroll&&(this.prevPageX=e.pageX,this.prevPageY=e.pageY,this.prevScrollX=window.scrollX,this.prevScrollY=window.scrollY)}destroyScrollWatch(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)}createEventFromMouse(e,n){let r=0,i=0;return n?(this.origPageX=e.pageX,this.origPageY=e.pageY):(r=e.pageX-this.origPageX,i=e.pageY-this.origPageY),{origEvent:e,isTouch:!1,subjectEl:this.subjectEl,pageX:e.pageX,pageY:e.pageY,deltaX:r,deltaY:i}}createEventFromTouch(e,n){let r=e.touches,i,s,a=0,o=0;return r&&r.length?(i=r[0].pageX,s=r[0].pageY):(i=e.pageX,s=e.pageY),n?(this.origPageX=i,this.origPageY=s):(a=i-this.origPageX,o=s-this.origPageY),{origEvent:e,isTouch:!0,subjectEl:this.subjectEl,pageX:i,pageY:s,deltaX:a,deltaY:o}}}function UQ(t){return t.button===0&&!t.ctrlKey}function WQ(){hv+=1,setTimeout(()=>{hv-=1},Qx.touchMouseIgnoreWait)}function qQ(){Yg+=1,Yg===1&&window.addEventListener("touchmove",YD,{passive:!1})}function GQ(){Yg-=1,Yg||window.removeEventListener("touchmove",YD,{passive:!1})}function YD(t){fv&&t.preventDefault()}class YQ{constructor(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0}start(e,n,r){this.sourceEl=e,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=n-window.scrollX,this.origScreenY=r-window.scrollY,this.deltaX=0,this.deltaY=0,this.updateElPosition()}handleMove(e,n){this.deltaX=e-window.scrollX-this.origScreenX,this.deltaY=n-window.scrollY-this.origScreenY,this.updateElPosition()}setIsVisible(e){e?this.isVisible||(this.mirrorEl&&(this.mirrorEl.style.display=""),this.isVisible=e,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&(this.mirrorEl.style.display="none"),this.isVisible=e)}stop(e,n){let r=()=>{this.cleanup(),n()};e&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(r,this.revertDuration):setTimeout(r,0)}doRevertAnimation(e,n){let r=this.mirrorEl,i=this.sourceEl.getBoundingClientRect();r.style.transition="top "+n+"ms,left "+n+"ms",rf(r,{left:i.left,top:i.top}),XG(r,()=>{r.style.transition="",e()})}cleanup(){this.mirrorEl&&(ux(this.mirrorEl),this.mirrorEl=null),this.sourceEl=null}updateElPosition(){this.sourceEl&&this.isVisible&&rf(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})}getMirrorEl(){let e=this.sourceElRect,n=this.mirrorEl;return n||(n=this.mirrorEl=this.sourceEl.cloneNode(!0),n.style.userSelect="none",n.style.webkitUserSelect="none",n.style.pointerEvents="none",n.classList.add("fc-event-dragging"),rf(n,{position:"fixed",zIndex:this.zIndex,visibility:"",boxSizing:"border-box",width:e.right-e.left,height:e.bottom-e.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(n)),n}}class ZD extends Yx{constructor(e,n){super(),this.handleScroll=()=>{this.scrollTop=this.scrollController.getScrollTop(),this.scrollLeft=this.scrollController.getScrollLeft(),this.handleScrollChange()},this.scrollController=e,this.doesListening=n,this.scrollTop=this.origScrollTop=e.getScrollTop(),this.scrollLeft=this.origScrollLeft=e.getScrollLeft(),this.scrollWidth=e.getScrollWidth(),this.scrollHeight=e.getScrollHeight(),this.clientWidth=e.getClientWidth(),this.clientHeight=e.getClientHeight(),this.clientRect=this.computeClientRect(),this.doesListening&&this.getEventTarget().addEventListener("scroll",this.handleScroll)}destroy(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)}getScrollTop(){return this.scrollTop}getScrollLeft(){return this.scrollLeft}setScrollTop(e){this.scrollController.setScrollTop(e),this.doesListening||(this.scrollTop=Math.max(Math.min(e,this.getMaxScrollTop()),0),this.handleScrollChange())}setScrollLeft(e){this.scrollController.setScrollLeft(e),this.doesListening||(this.scrollLeft=Math.max(Math.min(e,this.getMaxScrollLeft()),0),this.handleScrollChange())}getClientWidth(){return this.clientWidth}getClientHeight(){return this.clientHeight}getScrollWidth(){return this.scrollWidth}getScrollHeight(){return this.scrollHeight}handleScrollChange(){}}class XD extends ZD{constructor(e,n){super(new vX(e),n)}getEventTarget(){return this.scrollController.el}computeClientRect(){return _X(this.scrollController.el)}}class ZQ extends ZD{constructor(e){super(new wX,e)}getEventTarget(){return window}computeClientRect(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}}handleScrollChange(){this.clientRect=this.computeClientRect()}}const KD=typeof performance=="function"?performance.now:Date.now;class XQ{constructor(){this.isEnabled=!0,this.scrollQuery=[window,".fc-scroller"],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=()=>{if(this.isAnimating){let e=this.computeBestEdge(this.pointerScreenX+window.scrollX,this.pointerScreenY+window.scrollY);if(e){let n=KD();this.handleSide(e,(n-this.msSinceRequest)/1e3),this.requestAnimation(n)}else this.isAnimating=!1}}}start(e,n,r){this.isEnabled&&(this.scrollCaches=this.buildCaches(r),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(e,n))}handleMove(e,n){if(this.isEnabled){let r=e-window.scrollX,i=n-window.scrollY,s=this.pointerScreenY===null?0:i-this.pointerScreenY,a=this.pointerScreenX===null?0:r-this.pointerScreenX;s<0?this.everMovedUp=!0:s>0&&(this.everMovedDown=!0),a<0?this.everMovedLeft=!0:a>0&&(this.everMovedRight=!0),this.pointerScreenX=r,this.pointerScreenY=i,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(KD()))}}stop(){if(this.isEnabled){this.isAnimating=!1;for(let e of this.scrollCaches)e.destroy();this.scrollCaches=null}}requestAnimation(e){this.msSinceRequest=e,requestAnimationFrame(this.animate)}handleSide(e,n){let{scrollCache:r}=e,{edgeThreshold:i}=this,s=i-e.distance,a=s*s/(i*i)*this.maxVelocity*n,o=1;switch(e.name){case"left":o=-1;case"right":r.setScrollLeft(r.getScrollLeft()+a*o);break;case"top":o=-1;case"bottom":r.setScrollTop(r.getScrollTop()+a*o);break}}computeBestEdge(e,n){let{edgeThreshold:r}=this,i=null,s=this.scrollCaches||[];for(let a of s){let o=a.clientRect,p=e-o.left,g=o.right-e,y=n-o.top,v=o.bottom-n;p>=0&&g>=0&&y>=0&&v>=0&&(y<=r&&this.everMovedUp&&a.canScrollUp()&&(!i||i.distance>y)&&(i={scrollCache:a,name:"top",distance:y}),v<=r&&this.everMovedDown&&a.canScrollDown()&&(!i||i.distance>v)&&(i={scrollCache:a,name:"bottom",distance:v}),p<=r&&this.everMovedLeft&&a.canScrollLeft()&&(!i||i.distance>p)&&(i={scrollCache:a,name:"left",distance:p}),g<=r&&this.everMovedRight&&a.canScrollRight()&&(!i||i.distance>g)&&(i={scrollCache:a,name:"right",distance:g}))}return i}buildCaches(e){return this.queryScrollEls(e).map(n=>n===window?new ZQ(!1):new XD(n,!1))}queryScrollEls(e){let n=[];for(let r of this.scrollQuery)typeof r=="object"?n.push(r):n.push(...Array.prototype.slice.call(e.getRootNode().querySelectorAll(r)));return n}}class pf extends SX{constructor(e,n){super(e),this.containerEl=e,this.delay=null,this.minDistance=0,this.touchScrollAllowed=!0,this.mirrorNeedsRevert=!1,this.isInteracting=!1,this.isDragging=!1,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.delayTimeoutId=null,this.onPointerDown=i=>{this.isDragging||(this.isInteracting=!0,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,KG(document.body),QG(document.body),i.isTouch||i.origEvent.preventDefault(),this.emitter.trigger("pointerdown",i),this.isInteracting&&!this.pointer.shouldIgnoreMove&&(this.mirror.setIsVisible(!1),this.mirror.start(i.subjectEl,i.pageX,i.pageY),this.startDelay(i),this.minDistance||this.handleDistanceSurpassed(i)))},this.onPointerMove=i=>{if(this.isInteracting){if(this.emitter.trigger("pointermove",i),!this.isDistanceSurpassed){let s=this.minDistance,a,{deltaX:o,deltaY:p}=i;a=o*o+p*p,a>=s*s&&this.handleDistanceSurpassed(i)}this.isDragging&&(i.origEvent.type!=="scroll"&&(this.mirror.handleMove(i.pageX,i.pageY),this.autoScroller.handleMove(i.pageX,i.pageY)),this.emitter.trigger("dragmove",i))}},this.onPointerUp=i=>{this.isInteracting&&(this.isInteracting=!1,JG(document.body),eY(document.body),this.emitter.trigger("pointerup",i),this.isDragging&&(this.autoScroller.stop(),this.tryStopDrag(i)),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null))};let r=this.pointer=new GD(e);r.emitter.on("pointerdown",this.onPointerDown),r.emitter.on("pointermove",this.onPointerMove),r.emitter.on("pointerup",this.onPointerUp),n&&(r.selector=n),this.mirror=new YQ,this.autoScroller=new XQ}destroy(){this.pointer.destroy(),this.onPointerUp({})}startDelay(e){typeof this.delay=="number"?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=null,this.handleDelayEnd(e)},this.delay):this.handleDelayEnd(e)}handleDelayEnd(e){this.isDelayEnded=!0,this.tryStartDrag(e)}handleDistanceSurpassed(e){this.isDistanceSurpassed=!0,this.tryStartDrag(e)}tryStartDrag(e){this.isDelayEnded&&this.isDistanceSurpassed&&(!this.pointer.wasTouchScroll||this.touchScrollAllowed)&&(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(e.pageX,e.pageY,this.containerEl),this.emitter.trigger("dragstart",e),this.touchScrollAllowed===!1&&this.pointer.cancelTouchScroll())}tryStopDrag(e){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,e))}stopDrag(e){this.isDragging=!1,this.emitter.trigger("dragend",e)}setIgnoreMove(e){this.pointer.shouldIgnoreMove=e}setMirrorIsVisible(e){this.mirror.setIsVisible(e)}setMirrorNeedsRevert(e){this.mirrorNeedsRevert=e}setAutoScrollEnabled(e){this.autoScroller.isEnabled=e}}class KQ{constructor(e){this.el=e,this.origRect=Gx(e),this.scrollCaches=qM(e).map(n=>new XD(n,!0))}destroy(){for(let e of this.scrollCaches)e.destroy()}computeLeft(){let e=this.origRect.left;for(let n of this.scrollCaches)e+=n.origScrollLeft-n.getScrollLeft();return e}computeTop(){let e=this.origRect.top;for(let n of this.scrollCaches)e+=n.origScrollTop-n.getScrollTop();return e}isWithinClipping(e,n){let r={left:e,top:n};for(let i of this.scrollCaches)if(!JQ(i.getEventTarget())&&!oX(r,i.clientRect))return!1;return!0}}function JQ(t){let e=t.tagName;return e==="HTML"||e==="BODY"}class Zg{constructor(e,n){this.useSubjectCenter=!1,this.requireInitial=!0,this.disablePointCheck=!1,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=r=>{let{dragging:i}=this;this.initialHit=null,this.movingHit=null,this.finalHit=null,this.prepareHits(),this.processFirstCoord(r),this.initialHit||!this.requireInitial?(i.setIgnoreMove(!1),this.emitter.trigger("pointerdown",r)):i.setIgnoreMove(!0)},this.handleDragStart=r=>{this.emitter.trigger("dragstart",r),this.handleMove(r,!0)},this.handleDragMove=r=>{this.emitter.trigger("dragmove",r),this.handleMove(r)},this.handlePointerUp=r=>{this.releaseHits(),this.emitter.trigger("pointerup",r)},this.handleDragEnd=r=>{this.movingHit&&this.emitter.trigger("hitupdate",null,!0,r),this.finalHit=this.movingHit,this.movingHit=null,this.emitter.trigger("dragend",r)},this.droppableStore=n,e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("dragstart",this.handleDragStart),e.emitter.on("dragmove",this.handleDragMove),e.emitter.on("pointerup",this.handlePointerUp),e.emitter.on("dragend",this.handleDragEnd),this.dragging=e,this.emitter=new Lg}processFirstCoord(e){let n={left:e.pageX,top:e.pageY},r=n,i=e.subjectEl,s;i instanceof HTMLElement&&(s=Gx(i),r=aX(r,s));let a=this.initialHit=this.queryHitForOffset(r.left,r.top);if(a){if(this.useSubjectCenter&&s){let o=UM(s,a.rect);o&&(r=lX(o))}this.coordAdjust=cX(r,n)}else this.coordAdjust={left:0,top:0}}handleMove(e,n){let r=this.queryHitForOffset(e.pageX+this.coordAdjust.left,e.pageY+this.coordAdjust.top);(n||!Xg(this.movingHit,r))&&(this.movingHit=r,this.emitter.trigger("hitupdate",r,!1,e))}prepareHits(){this.offsetTrackers=la(this.droppableStore,e=>(e.component.prepareHits(),new KQ(e.el)))}releaseHits(){let{offsetTrackers:e}=this;for(let n in e)e[n].destroy();this.offsetTrackers={}}queryHitForOffset(e,n){let{droppableStore:r,offsetTrackers:i}=this,s=null;for(let a in r){let o=r[a].component,p=i[a];if(p&&p.isWithinClipping(e,n)){let g=p.computeLeft(),y=p.computeTop(),v=e-g,E=n-y,{origRect:T}=p,D=T.right-T.left,N=T.bottom-T.top;if(v>=0&&v<D&&E>=0&&E<N){let B=o.queryHit(v,E,D,N);B&&Rg(B.dateProfile.activeRange,B.dateSpan.range)&&(this.disablePointCheck||p.el.contains(p.el.getRootNode().elementFromPoint(v+g-window.scrollX,E+y-window.scrollY)))&&(!s||B.layer>s.layer)&&(B.componentId=a,B.context=o.context,B.rect.left+=g,B.rect.right+=g,B.rect.top+=y,B.rect.bottom+=y,s=B)}}}return s}}function Xg(t,e){return!t&&!e?!0:!!t!=!!e?!1:XZ(t.dateSpan,e.dateSpan)}function JD(t,e){let n={};for(let r of e.pluginHooks.datePointTransforms)Object.assign(n,r(t,e));return Object.assign(n,QQ(t,e.dateEnv)),n}function QQ(t,e){return{date:e.toDate(t.range.start),dateStr:e.formatIso(t.range.start,{omitTime:t.allDay}),allDay:t.allDay}}class eee extends Jd{constructor(e){super(e),this.handlePointerDown=r=>{let{dragging:i}=this,s=r.origEvent.target;i.setIgnoreMove(!this.component.isValidDateDownEl(s))},this.handleDragEnd=r=>{let{component:i}=this,{pointer:s}=this.dragging;if(!s.wasTouchScroll){let{initialHit:a,finalHit:o}=this.hitDragging;if(a&&o&&Xg(a,o)){let{context:p}=i,g=Object.assign(Object.assign({},JD(a.dateSpan,p)),{dayEl:a.dayEl,jsEvent:r.origEvent,view:p.viewApi||p.calendarApi.view});p.emitter.trigger("dateClick",g)}}},this.dragging=new pf(e.el),this.dragging.autoScroller.isEnabled=!1;let n=this.hitDragging=new Zg(this.dragging,$x(e));n.emitter.on("pointerdown",this.handlePointerDown),n.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}}class tee extends Jd{constructor(e){super(e),this.dragSelection=null,this.handlePointerDown=a=>{let{component:o,dragging:p}=this,{options:g}=o.context,y=g.selectable&&o.isValidDateDownEl(a.origEvent.target);p.setIgnoreMove(!y),p.delay=a.isTouch?nee(o):null},this.handleDragStart=a=>{this.component.context.calendarApi.unselect(a)},this.handleHitUpdate=(a,o)=>{let{context:p}=this.component,g=null,y=!1;if(a){let v=this.hitDragging.initialHit;a.componentId===v.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(v,a)||(g=ree(v,a,p.pluginHooks.dateSelectionTransformers)),(!g||!IX(g,a.dateProfile,p))&&(y=!0,g=null)}g?p.dispatch({type:"SELECT_DATES",selection:g}):o||p.dispatch({type:"UNSELECT_DATES"}),y?hx():fx(),o||(this.dragSelection=g)},this.handlePointerUp=a=>{this.dragSelection&&(OM(this.dragSelection,a,this.component.context),this.dragSelection=null)};let{component:n}=e,{options:r}=n.context,i=this.dragging=new pf(e.el);i.touchScrollAllowed=!1,i.minDistance=r.selectMinDistance||0,i.autoScroller.isEnabled=r.dragScroll;let s=this.hitDragging=new Zg(this.dragging,$x(e));s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.dragging.destroy()}}function nee(t){let{options:e}=t.context,n=e.selectLongPressDelay;return n==null&&(n=e.longPressDelay),n}function ree(t,e,n){let r=t.dateSpan,i=e.dateSpan,s=[r.range.start,r.range.end,i.range.start,i.range.end];s.sort(sY);let a={};for(let o of n){let p=o(t,e);if(p===!1)return null;p&&Object.assign(a,p)}return a.range={start:s[0],end:s[3]},a.allDay=r.allDay,a}class mf extends Jd{constructor(e){super(e),this.subjectEl=null,this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=a=>{let o=a.origEvent.target,{component:p,dragging:g}=this,{mirror:y}=g,{options:v}=p.context,E=p.context;this.subjectEl=a.subjectEl;let T=this.subjectSeg=Kd(a.subjectEl),N=(this.eventRange=T.eventRange).instance.instanceId;this.relevantEvents=Rx(E.getCurrentData().eventStore,N),g.minDistance=a.isTouch?0:v.eventDragMinDistance,g.delay=a.isTouch&&N!==p.props.eventSelection?see(p):null,v.fixedMirrorParent?y.parentNode=v.fixedMirrorParent:y.parentNode=gi(o,".fc"),y.revertDuration=v.dragRevertDuration;let B=p.isValidSegDownEl(o)&&!gi(o,".fc-event-resizer");g.setIgnoreMove(!B),this.isDragging=B&&a.subjectEl.classList.contains("fc-event-draggable")},this.handleDragStart=a=>{let o=this.component.context,p=this.eventRange,g=p.instance.instanceId;a.isTouch?g!==this.component.props.eventSelection&&o.dispatch({type:"SELECT_EVENT",eventInstanceId:g}):o.dispatch({type:"UNSELECT_EVENT"}),this.isDragging&&(o.calendarApi.unselect(a),o.emitter.trigger("eventDragStart",{el:this.subjectEl,event:new lr(o,p.def,p.instance),jsEvent:a.origEvent,view:o.viewApi}))},this.handleHitUpdate=(a,o)=>{if(!this.isDragging)return;let p=this.relevantEvents,g=this.hitDragging.initialHit,y=this.component.context,v=null,E=null,T=null,D=!1,N={affectedEvents:p,mutatedEvents:ys(),isEvent:!0};if(a){v=a.context;let B=v.options;y===v||B.editable&&B.droppable?(E=iee(g,a,this.eventRange.instance.range.start,v.getCurrentData().pluginHooks.eventDragMutationMassagers),E&&(T=Bx(p,v.getCurrentData().eventUiBases,E,v),N.mutatedEvents=T,tD(N,a.dateProfile,v)||(D=!0,E=null,T=null,N.mutatedEvents=ys()))):v=null}this.displayDrag(v,N),D?hx():fx(),o||(y===v&&Xg(g,a)&&(E=null),this.dragging.setMirrorNeedsRevert(!E),this.dragging.setMirrorIsVisible(!a||!this.subjectEl.getRootNode().querySelector(".fc-event-mirror")),this.receivingContext=v,this.validMutation=E,this.mutatedRelevantEvents=T)},this.handlePointerUp=()=>{this.isDragging||this.cleanup()},this.handleDragEnd=a=>{if(this.isDragging){let o=this.component.context,p=o.viewApi,{receivingContext:g,validMutation:y}=this,v=this.eventRange.def,E=this.eventRange.instance,T=new lr(o,v,E),D=this.relevantEvents,N=this.mutatedRelevantEvents,{finalHit:B}=this.hitDragging;if(this.clearDrag(),o.emitter.trigger("eventDragStop",{el:this.subjectEl,event:T,jsEvent:a.origEvent,view:p}),y){if(g===o){let F=new lr(o,N.defs[v.defId],E?N.instances[E.instanceId]:null);o.dispatch({type:"MERGE_EVENTS",eventStore:N});let X={oldEvent:T,event:F,relatedEvents:Sc(N,o,E),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:D})}},te={};for(let H of o.getCurrentData().pluginHooks.eventDropTransformers)Object.assign(te,H(y,o));o.emitter.trigger("eventDrop",Object.assign(Object.assign(Object.assign({},X),te),{el:a.subjectEl,delta:y.datesDelta,jsEvent:a.origEvent,view:p})),o.emitter.trigger("eventChange",X)}else if(g){let F={event:T,relatedEvents:Sc(D,o,E),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:D})}};o.emitter.trigger("eventLeave",Object.assign(Object.assign({},F),{draggedEl:a.subjectEl,view:p})),o.dispatch({type:"REMOVE_EVENTS",eventStore:D}),o.emitter.trigger("eventRemove",F);let X=N.defs[v.defId],te=N.instances[E.instanceId],H=new lr(g,X,te);g.dispatch({type:"MERGE_EVENTS",eventStore:N});let ke={event:H,relatedEvents:Sc(N,g,te),revert(){g.dispatch({type:"REMOVE_EVENTS",eventStore:N})}};g.emitter.trigger("eventAdd",ke),a.isTouch&&g.dispatch({type:"SELECT_EVENT",eventInstanceId:E.instanceId}),g.emitter.trigger("drop",Object.assign(Object.assign({},JD(B.dateSpan,g)),{draggedEl:a.subjectEl,jsEvent:a.origEvent,view:B.context.viewApi})),g.emitter.trigger("eventReceive",Object.assign(Object.assign({},ke),{draggedEl:a.subjectEl,view:B.context.viewApi}))}}else o.emitter.trigger("_noEventDrop")}this.cleanup()};let{component:n}=this,{options:r}=n.context,i=this.dragging=new pf(e.el);i.pointer.selector=mf.SELECTOR,i.touchScrollAllowed=!1,i.autoScroller.isEnabled=r.dragScroll;let s=this.hitDragging=new Zg(this.dragging,jx);s.useSubjectCenter=e.useEventCenter,s.emitter.on("pointerdown",this.handlePointerDown),s.emitter.on("dragstart",this.handleDragStart),s.emitter.on("hitupdate",this.handleHitUpdate),s.emitter.on("pointerup",this.handlePointerUp),s.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}displayDrag(e,n){let r=this.component.context,i=this.receivingContext;i&&i!==e&&(i===r?i.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:n.affectedEvents,mutatedEvents:ys(),isEvent:!0}}):i.dispatch({type:"UNSET_EVENT_DRAG"})),e&&e.dispatch({type:"SET_EVENT_DRAG",state:n})}clearDrag(){let e=this.component.context,{receivingContext:n}=this;n&&n.dispatch({type:"UNSET_EVENT_DRAG"}),e!==n&&e.dispatch({type:"UNSET_EVENT_DRAG"})}cleanup(){this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null}}mf.SELECTOR=".fc-event-draggable, .fc-event-resizable";function iee(t,e,n,r){let i=t.dateSpan,s=e.dateSpan,a=i.range.start,o=s.range.start,p={};i.allDay!==s.allDay&&(p.allDay=s.allDay,p.hasEnd=e.context.options.allDayMaintainDuration,s.allDay?a=er(n):a=n);let g=Zd(a,o,t.context.dateEnv,t.componentId===e.componentId?t.largeUnit:null);g.milliseconds&&(p.allDay=!1);let y={datesDelta:g,standardProps:p};for(let v of r)v(y,t,e);return y}function see(t){let{options:e}=t.context,n=e.eventLongPressDelay;return n==null&&(n=e.longPressDelay),n}class oee extends Jd{constructor(e){super(e),this.draggingSegEl=null,this.draggingSeg=null,this.eventRange=null,this.relevantEvents=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=s=>{let{component:a}=this,o=this.querySegEl(s),p=Kd(o),g=this.eventRange=p.eventRange;this.dragging.minDistance=a.context.options.eventDragMinDistance,this.dragging.setIgnoreMove(!this.component.isValidSegDownEl(s.origEvent.target)||s.isTouch&&this.component.props.eventSelection!==g.instance.instanceId)},this.handleDragStart=s=>{let{context:a}=this.component,o=this.eventRange;this.relevantEvents=Rx(a.getCurrentData().eventStore,this.eventRange.instance.instanceId);let p=this.querySegEl(s);this.draggingSegEl=p,this.draggingSeg=Kd(p),a.calendarApi.unselect(),a.emitter.trigger("eventResizeStart",{el:p,event:new lr(a,o.def,o.instance),jsEvent:s.origEvent,view:a.viewApi})},this.handleHitUpdate=(s,a,o)=>{let{context:p}=this.component,g=this.relevantEvents,y=this.hitDragging.initialHit,v=this.eventRange.instance,E=null,T=null,D=!1,N={affectedEvents:g,mutatedEvents:ys(),isEvent:!0};s&&(s.componentId===y.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(y,s)||(E=aee(y,s,o.subjectEl.classList.contains("fc-event-resizer-start"),v.range))),E&&(T=Bx(g,p.getCurrentData().eventUiBases,E,p),N.mutatedEvents=T,tD(N,s.dateProfile,p)||(D=!0,E=null,T=null,N.mutatedEvents=null)),T?p.dispatch({type:"SET_EVENT_RESIZE",state:N}):p.dispatch({type:"UNSET_EVENT_RESIZE"}),D?hx():fx(),a||(E&&Xg(y,s)&&(E=null),this.validMutation=E,this.mutatedRelevantEvents=T)},this.handleDragEnd=s=>{let{context:a}=this.component,o=this.eventRange.def,p=this.eventRange.instance,g=new lr(a,o,p),y=this.relevantEvents,v=this.mutatedRelevantEvents;if(a.emitter.trigger("eventResizeStop",{el:this.draggingSegEl,event:g,jsEvent:s.origEvent,view:a.viewApi}),this.validMutation){let E=new lr(a,v.defs[o.defId],p?v.instances[p.instanceId]:null);a.dispatch({type:"MERGE_EVENTS",eventStore:v});let T={oldEvent:g,event:E,relatedEvents:Sc(v,a,p),revert(){a.dispatch({type:"MERGE_EVENTS",eventStore:y})}};a.emitter.trigger("eventResize",Object.assign(Object.assign({},T),{el:this.draggingSegEl,startDelta:this.validMutation.startDelta||gn(0),endDelta:this.validMutation.endDelta||gn(0),jsEvent:s.origEvent,view:a.viewApi})),a.emitter.trigger("eventChange",T)}else a.emitter.trigger("_noEventResize");this.draggingSeg=null,this.relevantEvents=null,this.validMutation=null};let{component:n}=e,r=this.dragging=new pf(e.el);r.pointer.selector=".fc-event-resizer",r.touchScrollAllowed=!1,r.autoScroller.isEnabled=n.context.options.dragScroll;let i=this.hitDragging=new Zg(this.dragging,$x(e));i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}querySegEl(e){return gi(e.subjectEl,".fc-event")}}function aee(t,e,n,r){let i=t.context.dateEnv,s=t.dateSpan.range.start,a=e.dateSpan.range.start,o=Zd(s,a,i,t.largeUnit);if(n){if(i.add(r.start,o)<r.end)return{startDelta:o}}else if(i.add(r.end,o)>r.start)return{endDelta:o};return null}class lee{constructor(e){this.context=e,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=r=>{r.jsEvent&&(this.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=r=>{let i=this.context.options.unselectCancel,s=YA(r.origEvent);this.matchesCancel=!!gi(s,i),this.matchesEvent=!!gi(s,mf.SELECTOR)},this.onDocumentPointerUp=r=>{let{context:i}=this,{documentPointer:s}=this,a=i.getCurrentData();if(!s.wasTouchScroll){if(a.dateSelection&&!this.isRecentPointerDateSelect){let o=i.options.unselectAuto;o&&(!o||!this.matchesCancel)&&i.calendarApi.unselect(r)}a.eventSelection&&!this.matchesEvent&&i.dispatch({type:"UNSELECT_EVENT"})}this.isRecentPointerDateSelect=!1};let n=this.documentPointer=new GD(document);n.shouldIgnoreMove=!0,n.shouldWatchScroll=!1,n.emitter.on("pointerdown",this.onDocumentPointerDown),n.emitter.on("pointerup",this.onDocumentPointerUp),e.emitter.on("select",this.onSelect)}destroy(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()}}const cee={fixedMirrorParent:De},dee={dateClick:De,eventDragStart:De,eventDragStop:De,eventDrop:De,eventResizeStart:De,eventResizeStop:De,eventResize:De,drop:De,eventReceive:De,eventLeave:De};Qx.dataAttrPrefix="";var uee=Ro({name:"@fullcalendar/interaction",componentInteractions:[eee,tee,mf,oee],calendarInteractions:[lee],elementDraggingImpl:pf,optionRefiners:cee,listenerRefiners:dee});const hee={},fee={class:"bg-gray-100"},pee={class:"p-[0px] border-b"};function mee(t,e){const n=h.resolveComponent("VsCalendar");return h.openBlock(),h.createElementBlock("div",fee,[h.createElementVNode("div",pee,[h.createVNode(n,{class:"scale-[0.9]"})])])}const gee=Ve(hee,[["render",mee]]);var yee={code:"uk",week:{dow:1,doy:7},buttonText:{prev:"Попередній",next:"далі",today:"Сьогодні",year:"рік",month:"Місяць",week:"Тиждень",day:"День",list:"Порядок денний"},weekText:"Тиж",allDayText:"Увесь день",moreLinkText(t){return"+ще "+t+"..."},noEventsText:"Немає подій для відображення"};const bee={},_ee={class:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function xee(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",_ee,e[0]||(e[0]=[h.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),h.createElementVNode("path",{d:"M15 3v18"},null,-1),h.createElementVNode("path",{d:"m8 9 3 3-3 3"},null,-1)]))}const QD=Ve(bee,[["render",xee]]),vee={components:{FullCalendar:mJ,VsWidgetCalendarBar:gee,IconOpenCard:QD},data(){return{isVisible:!0,isVisibleBar:!0,calendarOptions:{plugins:[WJ,MQ,HQ,uee],initialView:"dayGridMonth",dateClick:this.handleDateClick,locale:yee,events:[{title:"event 1",date:"2025-01-23"},{title:"event 2",date:"2019-04-02"}]},currentView:"dayGridMonth",views:[{id:"timeGridDay",title:"День"},{id:"timeGridWeek",title:"Тиждень"},{id:"dayGridMonth",title:"Місяць"},{id:"listYear",title:"Рік"}]}},methods:{handleDateClick(t){alert("date click! "+t.dateStr)},changeView(t){this.isVisible=!1,this.currentView=t,this.calendarOptions={...this.calendarOptions,initialView:t},queueMicrotask(()=>this.isVisible=!0)}}},wee={class:"flex p-[10px] bg-gray-100"},kee={class:"flex-grow bg-white"},Eee={class:"p-[10px] flex justify-between"},See={class:"inline-flex justify-center space-x-1 bg-white border border-gray-200 rounded-md shadow-sm p- gap-x-1 dark:bg-neutral-800 dark:border-neutral-700"},Cee={class:"relative flex first:before:hidden before:absolute before:top-1/2 before:-start-1 before:w-px before:h-3 before:bg-gray-200 before:-translate-y-1/2 dark:before:bg-neutral-700"},Tee=["onClick"];function Aee(t,e,n,r,i,s){const a=h.resolveComponent("VsWidgetCalendarBar"),o=h.resolveComponent("IconOpenCard"),p=h.resolveComponent("FullCalendar");return h.openBlock(),h.createElementBlock("div",wee,[h.createVNode(h.Transition,{name:"slide-fade"},{default:h.withCtx(()=>[h.withDirectives(h.createVNode(a,null,null,512),[[h.vShow,i.isVisibleBar]])]),_:1}),h.createElementVNode("div",kee,[h.createElementVNode("div",Eee,[h.createElementVNode("button",{onClick:e[0]||(e[0]=g=>i.isVisibleBar=!i.isVisibleBar)},[h.createVNode(o)]),h.createElementVNode("div",See,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.views,g=>(h.openBlock(),h.createElementBlock("div",Cee,[h.createElementVNode("button",{class:h.normalizeClass(["inline-flex items-center px-2 py-1 text-xs text-gray-800 rounded gap-x-1 hover:text-gray-500 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:text-gray-500 dark:border-neutral-700 dark:text-neutral-300 dark:hover:text-neutral-400 dark:focus:text-neutral-400",[i.currentView===(g==null?void 0:g.id)?" bg-gray-100":""]]),onClick:y=>s.changeView(g==null?void 0:g.id)},h.toDisplayString(g==null?void 0:g.title),11,Tee)]))),256))]),e[1]||(e[1]=h.createElementVNode("div",null,null,-1))]),i.isVisible?(h.openBlock(),h.createBlock(p,{key:0,options:i.calendarOptions,style:{height:"calc(100vh - 90px)"},class:"px-[10px] py-[4px]"},null,8,["options"])):h.createCommentVNode("",!0)])])}const eI=Ve(vee,[["render",Aee]]),Mee={"vs-widget-map":lb,"vs-widget-gallery":q3,"vs-widget-comments":JT,"vs-widget-file":h2,"vs-widget-history":OW,"vs-widget-table":Mq,"vs-widget-calendar":eI,"admin-notifications":sA,"vs-widget-print":jW},Dee={"table-format-text":Lp,"table-format-select":ck,"table-format-badge":ak,"table-format-swetch":sd,"table-format-check":sd,"table-format-switch":sd,"table-format-yes/no":sd,"table-format-html":Lp,"table-format-tags":dk,"table-format-date":ab,"table-format-number":lE,"table-format-slot":cE},Iee={style:{width:"calc(100vw - 300px)",height:"calc(100vh - 60px)"},class:"bg-gray-50 flex items-center justify-center"},Pee={__name:"vs-dashboard",setup(t){return(e,n)=>(h.openBlock(),h.createElementBlock("div",Iee,n[0]||(n[0]=[h.createElementVNode("div",{class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[h.createElementVNode("div",{class:"mb-4 xl:mb-8"},[h.createElementVNode("h1",{class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"}," Members "),h.createElementVNode("p",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Manage members and users of your workspace and set their access level. ")]),h.createElementVNode("div",{class:"space-y-5"},[h.createElementVNode("div",{class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5"},[h.createElementVNode("div",{class:"relative w-full"},[h.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5"},[h.createElementVNode("svg",{class:"shrink-0 size-4 text-gray-500 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[h.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),h.createElementVNode("path",{d:"m21 21-4.3-4.3"})])]),h.createElementVNode("input",{type:"text",class:"py-2 ps-10 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Search by name or email"}),h.createElementVNode("div",{class:"hidden absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-1"},[h.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-6 rounded-full text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 dark:text-neutral-500 dark:hover:text-blue-500 dark:focus:text-blue-500","aria-label":"Close"},[h.createElementVNode("span",{class:"sr-only"},"Close"),h.createElementVNode("svg",{class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[h.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),h.createElementVNode("path",{d:"m15 9-6 6"}),h.createElementVNode("path",{d:"m9 9 6 6"})])])])]),h.createElementVNode("div",{class:"flex justify-end items-center gap-x-2"},[h.createElementVNode("button",{type:"button",class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createElementVNode("svg",{class:"shrink-0 sm:me-2 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[h.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),h.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),h.createElementVNode("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]),h.createElementVNode("span",{class:"hidden sm:block"}," Download CSV ")]),h.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-1 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500","data-hs-overlay":"#hs-pro-dshm"},[h.createElementVNode("span",{class:"hidden sm:block"},"Send"),h.createTextVNode("Invite ")])])]),h.createElementVNode("div",{class:"grid sm:grid-cols-2 lg:grid-cols-4 gap-2 xl:gap-4"},[h.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[h.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[h.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}),h.createElementVNode("div",{class:"flex items-center -space-x-2"},[h.createElementVNode("img",{class:"shrink-0 size-7 rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"})])]),h.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Admin")]),h.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[h.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[h.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 5 "),h.createElementVNode("div",{class:"flex items-center -space-x-2"},[h.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),h.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482634023-2c4fda99ac0c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O ")])]),h.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[h.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Members"),h.createElementVNode("div",{class:"hs-tooltip inline-block"},[h.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[h.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),h.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),h.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(689px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),h.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[h.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[h.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 2 "),h.createElementVNode("div",{class:"flex items-center -space-x-2"},[h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," 0 ")])]),h.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[h.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"}," Limited access members "),h.createElementVNode("div",{class:"hs-tooltip inline-block"},[h.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[h.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),h.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),h.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(1198px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),h.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[h.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[h.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 0 "),h.createElementVNode("div",{class:"flex items-center -space-x-2"})]),h.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Pending invites")])]),h.createElementVNode("div",{class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[h.createElementVNode("div",{class:"min-w-full inline-block align-middle"},[h.createElementVNode("table",{class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},[h.createElementVNode("thead",null,[h.createElementVNode("tr",null,[h.createElementVNode("th",{scope:"col",class:"min-w-[250px]"},[h.createElementVNode("div",{class:"pe-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Member ")]),h.createElementVNode("th",{scope:"col",class:"min-w-48"},[h.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Role ")]),h.createElementVNode("th",{scope:"col"},[h.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Email ")]),h.createElementVNode("th",{scope:"col",class:"min-w-36"},[h.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Last activity ")]),h.createElementVNode("th",{scope:"col"},[h.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Status ")])])]),h.createElementVNode("tbody",{class:"divide-y divide-gray-200 dark:divide-neutral-700"},[h.createElementVNode("tr",null,[h.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[h.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[h.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("div",{class:"grow"},[h.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Admin ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," james@site.com ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[h.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),h.createTextVNode(" Active ")])])]),h.createElementVNode("tr",null,[h.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[h.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),h.createElementVNode("div",{class:"grow"},[h.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," liza@site.com ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 2 days ago ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[h.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),h.createTextVNode(" Inactive ")])])]),h.createElementVNode("tr",null,[h.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[h.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[h.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1601935111741-ae98b2b230b0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("div",{class:"grow"},[h.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Daniel Hobbs ")])])]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," dhobbs@site.com ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[h.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),h.createTextVNode(" Inactive ")])])]),h.createElementVNode("tr",null,[h.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[h.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[h.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),h.createElementVNode("div",{class:"grow"},[h.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Brian Warner ")])])]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," brian@site.com ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 1 months ago ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[h.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),h.createTextVNode(" Active ")])])]),h.createElementVNode("tr",null,[h.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[h.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[h.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O "),h.createElementVNode("div",{class:"grow"},[h.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Ols Shols ")])])]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," olsshols@site.com ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 6 days ago ")]),h.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[h.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[h.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),h.createTextVNode(" Inactive ")])])])])])])])])],-1)])))}},Ree={methods:{notify(){this.$notify({type:"error",title:"Тестова нотифікація",text:"Нотифікація для показу функціонала"})}}};function Oee(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",{onClick:e[0]||(e[0]=(...a)=>s.notify&&s.notify(...a)),class:"py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50"}," Custom component ")}const Nee=Ve(Ree,[["render",Oee]]),Bee={props:{item:{type:Object},actions:{type:Array}},data(){return{toggletMap:{}}},methods:{toggleHandler(t){this.toggletMap[t]=!this.toggletMap[t],this.$emit("on:toggled",{optionID:t,toggled:this.toggletMap[t]})}}},zee={class:"md:col-span-2"},Lee={class:"font-semibold text-gray-800 dark:text-neutral-200"},Vee={class:"md:block md:col-span-1 md:text-center"},Fee=["onClick"];function $ee(t,e,n,r,i,s){var a,o;return h.openBlock(),h.createElementBlock("ul",{class:h.normalizeClass(["grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700",`grid-cols-${((a=n.actions)==null?void 0:a.length)+2}`])},[h.createElementVNode("li",zee,[h.createElementVNode("h3",Lee,h.toDisplayString(n.item.ua),1)]),(o=n.item.menu)!=null&&o.length?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(n.actions,p=>(h.openBlock(),h.createElementBlock("li",Vee,[h.createElementVNode("button",{onClick:g=>s.toggleHandler(p),type:"button",class:"text-xs font-medium text-blue-600 decoration-2 hover:underline focus:outline-none focus:underline dark:text-blue-400 dark:hover:text-blue-500"}," Toggle all ",8,Fee)]))),256)):h.createCommentVNode("",!0)],2)}const jee=Ve(Bee,[["render",$ee]]),Hee={props:{subitem:{type:Object,required:!0},toggled:{type:Boolean,default:!1},optionID:{type:Number},actions:{type:Array,default:()=>[]},routes:{type:Array,required:!0}},data(){return{checkedActions:[]}},watch:{routes:{handler(){this.initializeCheckedActions()},deep:!0,immediate:!0}},methods:{initializeCheckedActions(){const t=this.routes.find(e=>e.path===this.subitem.path);this.checkedActions=t?[...t.actions]:[]},inputHandler(t){var e;this.$emit("on:checked",{subitemPath:(e=this.subitem)==null?void 0:e.path,checkedActions:this.checkedActions})}},mounted(){this.initializeCheckedActions()}},Uee={class:"md:col-span-2"},Wee={class:"text-sm font-medium text-gray-800 dark:text-neutral-200"},qee={class:"text-sm text-gray-500 dark:text-neutral-500"},Gee={class:"grid items-center grid-cols-2 md:block text-end md:text-center"},Yee=["value","onChange"];function Zee(t,e,n,r,i,s){var a,o;return h.openBlock(),h.createElementBlock("ul",{class:h.normalizeClass(["grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3",`grid-cols-${n.actions.length+2}`])},[h.createElementVNode("li",Uee,[h.createElementVNode("p",Wee,h.toDisplayString(((a=n.subitem)==null?void 0:a.ua)||""),1),h.createElementVNode("p",qee,h.toDisplayString(((o=n.subitem)==null?void 0:o.path)||""),1)]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.actions,(p,g)=>(h.openBlock(),h.createElementBlock("li",{class:"col-span-1",key:p},[h.createElementVNode("div",Gee,[h.withDirectives(h.createElementVNode("input",{type:"checkbox",value:p,onChange:y=>s.inputHandler(p),class:"text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500 dark:bg-neutral-800 dark:border-neutral-600 dark:checked:bg-blue-500 dark:checked:border-blue-500","onUpdate:modelValue":e[0]||(e[0]=y=>i.checkedActions=y)},null,40,Yee),[[h.vModelCheckbox,i.checkedActions]])])]))),128))],2)}const Xee=Ve(Hee,[["render",Zee]]),bs=h.ref(null),pv=t=>{const e=[];return t.forEach(n=>{n.menu?e.push(...pv(n.menu)):e.push(n)}),e},Kee={props:{options:{type:String},token:{type:String},routes:{type:Array,default:[]}},components:{VsGrouptFirstLevel:jee,VsGroupSecondLevel:Xee,AdminNodata:tx},data(){return{list:bs.value,history:this.routes,toggledInputs:!1,searchValue:""}},computed:{getList(){var e,n;const t={ua:"Без категорії",menu:(e=this.list)==null?void 0:e.filter(r=>!(r!=null&&r.menu))};return this.filterMenu([t,...(n=this.list)==null?void 0:n.filter(r=>r==null?void 0:r.menu)],this.searchValue).filter(r=>{var i;return(i=r==null?void 0:r.menu)==null?void 0:i.length})}},methods:{async Save(){var t,e;try{const n=location.href.split("/").pop();await tt.post(`/api/access-group/${n}`,{routes:(t=this.history)==null?void 0:t.filter(r=>{var i;return(i=r==null?void 0:r.actions)==null?void 0:i.length}).map(({path:r,actions:i})=>({path:r,actions:[...new Set(i)]}))}),await this.$notify({type:"success",title:"Успішно!",message:"Данні успішно оновлені"}),await Rp()}catch(n){console.error(((e=n.response)==null?void 0:e.data)||n.message),this.$notify({type:"error",title:"Помилка!",message:"При спробі оновити данні виникла помилка"})}},resetAll(){debugger;this.history=this.history.map(t=>({...t,actions:[]}))},async getData(){var t,e;try{const n=location.href.split("/").pop(),i=(await tt.get(`/api/access-group/${n}`)).data;this.history=this.getUniqueByPath([...i.routes,...(t=pv(this.list))==null?void 0:t.map(s=>({path:s==null?void 0:s.path,actions:[]}))])}catch(n){console.error(((e=n.response)==null?void 0:e.data)||n.message)}},toggleCheck(t){var n,r;if(!((n=this.history)!=null&&n.length))return;const e=(r=this.history)==null?void 0:r.findIndex(i=>(i==null?void 0:i.path)===(t==null?void 0:t.subitemPath));this.history[e].actions=t==null?void 0:t.checkedActions},toggleAll(t,e){var r,i,s,a,o,p,g;const n=(s=(i=(r=this.getList)==null?void 0:r[e])==null?void 0:i.menu)==null?void 0:s.map(y=>y==null?void 0:y.path);t!=null&&t.toggled?(o=(a=this.history)==null?void 0:a.filter(y=>n==null?void 0:n.includes(y==null?void 0:y.path)))==null||o.forEach(y=>{var v;(v=y==null?void 0:y.actions)==null||v.push(t==null?void 0:t.optionID)}):(g=(p=this.history)==null?void 0:p.filter(y=>n==null?void 0:n.includes(y==null?void 0:y.path)))==null||g.forEach(y=>{var v;y.actions=(v=y==null?void 0:y.actions)==null?void 0:v.filter(E=>E!==(t==null?void 0:t.optionID))})},getUniqueByPath(t){return t.reduce((e,n)=>(e.some(i=>i.path===n.path)||e.push(n),e),[])},filterMenu(t,e){return t.map(n=>{var r,i;if(n.menu){const s=this.filterMenu(n.menu,e);if(s.length>0)return{...n,menu:s}}return(i=(r=n.ua)==null?void 0:r.toLowerCase())!=null&&i.includes(e==null?void 0:e.toLowerCase())?n:null}).filter(Boolean)}},async mounted(){await this.getData()}},Jee={class:"flex gap-[6px]"},Qee={class:"mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200"},ete={key:0,class:"space-y-8"},tte={class:"space-y-5"};function nte(t,e,n,r,i,s){var y;const a=h.resolveComponent("VsText"),o=h.resolveComponent("VsGrouptFirstLevel"),p=h.resolveComponent("VsGroupSecondLevel"),g=h.resolveComponent("AdminNodata");return h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("div",Jee,[h.createVNode(a,{placeholder:"Пошук",class:"flex-grow",modelValue:i.searchValue,"onUpdate:modelValue":e[0]||(e[0]=v=>i.searchValue=v)},null,8,["modelValue"]),h.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100",onClick:e[1]||(e[1]=(...v)=>s.resetAll&&s.resetAll(...v))}," Скинути всі "),h.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:e[2]||(e[2]=(...v)=>s.Save&&s.Save(...v))}," Зберегти ")]),h.createElementVNode("div",{class:h.normalizeClass(["grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5",`grid-cols-${n.options.length+2}`])},[e[3]||(e[3]=h.createElementVNode("div",{class:"self-center col-span-2"},[h.createElementVNode("h2",{class:"font-semibold text-gray-800 dark:text-neutral-200"},"Групи")],-1)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.options,(v,E)=>(h.openBlock(),h.createElementBlock("div",{class:"col-span-1 text-center",key:E},[h.createElementVNode("h3",Qee,h.toDisplayString(v),1)]))),128))],2),(y=s.getList)!=null&&y.length?(h.openBlock(),h.createElementBlock("div",ete,[h.createElementVNode("div",tte,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.getList,(v,E)=>(h.openBlock(),h.createElementBlock("div",{key:E},[h.createVNode(o,{item:v,"onOn:toggled":T=>s.toggleAll(T,E),actions:n.options},null,8,["item","onOn:toggled","actions"]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(v.menu,T=>(h.openBlock(),h.createBlock(p,{toggled:(v==null?void 0:v.toggled)||!1,optionID:v==null?void 0:v.optionID,key:T==null?void 0:T.path,subitem:T,actions:n.options,"onOn:checked":D=>s.toggleCheck(D,E),routes:i.history},null,8,["toggled","optionID","subitem","actions","onOn:checked","routes"]))),128))]))),128))])])):(h.openBlock(),h.createBlock(g,{key:1}))])}const rte=Ve(Kee,[["render",nte]]),ite={__name:"vs-group-interface-page",setup(t){const e=["view","add","edit","del"];return(n,r)=>(h.openBlock(),h.createBlock(h.unref(rte),{options:e,routes:n.routes},null,8,["routes"]))}},ste={},ote={class:"shrink-0 size-4 text-gray-400 dark:text-white/60",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function ate(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",ote,e[0]||(e[0]=[h.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),h.createElementVNode("path",{d:"m21 21-4.3-4.3"},null,-1)]))}const mv=Ve(ste,[["render",ate]]),lte={components:{IconSearch:mv,IconPlus:Qh},data(){return{link:null,color:void 0,data:null,searchValue:"",isFormAdd:!1,formValues:{},scheme:{name:{type:"text",ua:"Назва",placeholder:"Назва",validators:["required"]}}}},mounted(){this.link="/admin.user-cls",this.getData()},computed:{rows(){var t,e;return((e=(t=this.data)==null?void 0:t.rows)==null?void 0:e.filter(n=>{var r;return(r=n==null?void 0:n.name)==null?void 0:r.includes(this.searchValue)}))||null}},methods:{async getData(){try{const{data:t}=await tt.get("/api/user-cls?type=json");this.data=t}catch{}},async createNewCls(){var t;try{await((t=this.$refs.form)==null?void 0:t.doValidation()),await tt.post("/api/user-cls",{...this.formValues}),this.isFormAdd=!1,this.formValues={},await this.getData(),this.$notify({type:"success",title:"Успішно!",message:"Новий об'єкт успішно створений"})}catch{this.$notify({type:"error",title:"Помилка",message:"При спробі створити новий об'єкт виникла помилка"})}}}},cte={class:"w-[300px] border-r",style:{height:"calc(100vh - 60px)"}},dte={class:"relative px-[20px] py-[16px] flex gap-[8px] items-center"},ute={class:"flex flex-col w-[300px] gap-[4px] overflow-y-auto overflow-x-hidden p-[10px] [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{height:"calc(100vh - 130px)"}},hte=["data-index"],fte={class:"w-[calc(100%-30px)] overflow-hidden overflow-ellipsis"},pte={class:"ml-auto flex items-center gap-[12px]"},mte={class:"text-[10px] text-[#6B7280] border px-1 rounded-lg"},gte={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function yte(t,e,n,r,i,s){const a=h.resolveComponent("IconSearch"),o=h.resolveComponent("VsText"),p=h.resolveComponent("IconPlus"),g=h.resolveComponent("router-link"),y=h.resolveComponent("VsForm"),v=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",cte,[h.createElementVNode("div",dte,[h.createVNode(a,{height:"16",width:"16",class:"absolute top-[50%] translate-y-[-50%] left-[30px] text-gray-500 z-[1]"}),h.createVNode(o,{type:"text",modelValue:i.searchValue,"onUpdate:modelValue":e[0]||(e[0]=E=>i.searchValue=E),clearable:!0,placeholder:"Пошук по меню",class:"flex-grow shadow [&>input]:h-[38px] [&>input]:pl-[30px] [&>input]:placeholder-gray-400"},null,8,["modelValue"]),h.createElementVNode("button",{onClick:e[1]||(e[1]=E=>i.isFormAdd=!0),class:"bg-[#DBEAFE] h-[38px] w-[38px] text-blue-700 shrink-0 flex items-center justify-center rounded-lg hover:bg-blue-200"},[h.createVNode(p,{height:"16",width:"16"})])]),h.createElementVNode("ul",ute,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.rows,E=>{var T,D;return h.openBlock(),h.createElementBlock("li",{key:E==null?void 0:E.id,"data-index":t.index,class:"w-full"},[h.createVNode(g,{class:h.normalizeClass(["flex items-center cursor-pointer hover:bg-[#F3F4F6] px-[12px] py-1 rounded-lg text-sm",{"bg-gray-100":((D=(T=t.$route)==null?void 0:T.query)==null?void 0:D.name)===(E==null?void 0:E.name)}]),to:i.link+"?name="+((E==null?void 0:E.name)||(E==null?void 0:E.id))},{default:h.withCtx(()=>[h.createElementVNode("span",fte,h.toDisplayString((E==null?void 0:E.name)||(E==null?void 0:E.id)||"Не вказано"),1),h.createElementVNode("div",pte,[h.createElementVNode("div",mte,h.toDisplayString((E==null?void 0:E.children)||"0"),1)])]),_:2},1032,["to","class"])],8,hte)}),128))])]),h.createVNode(v,{visible:i.isFormAdd,"onUpdate:visible":e[5]||(e[5]=E=>i.isFormAdd=E),title:"Створити давідник",onOnClose:e[6]||(e[6]=E=>i.formValues={})},{footer:h.withCtx(()=>[h.createElementVNode("div",gte,[h.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[3]||(e[3]=E=>{i.isFormAdd=!1,i.formValues={}}),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),h.createElementVNode("button",{onClick:e[4]||(e[4]=(...E)=>s.createNewCls&&s.createNewCls(...E)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700"}," Зберегти ")])]),default:h.withCtx(()=>[h.createVNode(y,{scheme:i.scheme,ref:"form",modelValue:i.formValues,"onUpdate:modelValue":e[2]||(e[2]=E=>i.formValues=E),class:"p-[10px]"},null,8,["scheme","modelValue"])]),_:1},8,["visible"])],64)}const bte=Ve(lte,[["render",yte]]),_te={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},xte={class:"w-full"},vte={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},wte={class:"max-w-sm mx-auto mt-6"},kte={class:"font-medium text-gray-800 dark:text-neutral-200"},Ete={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function Ste(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("div",xte,[h.createElementVNode("div",vte,[e[0]||(e[0]=h.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),h.createElementVNode("div",wte,[h.createElementVNode("p",kte,h.toDisplayString(n.title),1),h.createElementVNode("p",Ete,h.toDisplayString(n.text),1)])])])}const tI=Ve(_te,[["render",Ste]]),Cte={props:{modelValue:{type:String,default:()=>"#172B4D"},colors:{type:Array,default:()=>["#172B4D","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]}},methods:{updateColor(t){this.$emit("update:modelValue",t),this.$refs.popover.togglePopover()}}},Tte={class:"flex w-[160px] flex-wrap gap-[4px]"},Ate=["onClick"];function Mte(t,e,n,r,i,s){const a=h.resolveComponent("VsPopover");return h.openBlock(),h.createBlock(a,{ref:"popover",placement:"bottom"},{reference:h.withCtx(()=>[h.createElementVNode("button",{class:"h-[37px] w-[37px] rounded-lg flex items-center justify-center",style:h.normalizeStyle({backgroundColor:n.modelValue})},null,4)]),default:h.withCtx(()=>[h.createElementVNode("div",null,[h.createElementVNode("ul",Tte,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.colors,o=>(h.openBlock(),h.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:h.normalizeStyle({backgroundColor:o}),onClick:p=>s.updateColor(o),key:o},null,12,Ate))),128))])])]),_:1},512)}const nI=Ve(Cte,[["render",Mte]]),Dte={components:{VsChoceColor:nI},props:{item:Object},data(){var t,e,n;return{color:((t=this.item)==null?void 0:t.color)||"#D1D5DB",text:((e=this.item)==null?void 0:e.text)||"",id:(n=this.item)==null?void 0:n.id}},watch:{color(t){this.$emit("update-item",{...this.item,color:t})},text(t){this.$emit("update-item",{...this.item,text:t})},id(t){this.$emit("update-item",{...this.item},t)}}},Ite={class:"relative flex items-center p-3 bg-white border border-gray-200 group gap-x-3 rounded-xl"},Pte={class:"flex flex-col"},Rte={class:"flex gap-[30px]"},Ote={class:"block text-sm font-semibold text-gray-800 text-start z-[10] cursor-pointer"},Nte={class:"block text-sm font-semibold text-gray-400 text-start z-[10] cursor-pointer"},Bte={class:"block text-xs text-gray-500 truncate dark:text-neutral-500"};function zte(t,e,n,r,i,s){var p;const a=h.resolveComponent("VsChoceColor"),o=h.resolveComponent("VsInlineEdit");return h.openBlock(),h.createElementBlock("div",Ite,[h.createVNode(a,{modelValue:i.color,"onUpdate:modelValue":e[0]||(e[0]=g=>i.color=g)},null,8,["modelValue"]),h.createElementVNode("div",Pte,[h.createElementVNode("div",Rte,[h.createVNode(o,{modelValue:i.text,"onUpdate:modelValue":e[1]||(e[1]=g=>i.text=g),onUpdateValue:e[2]||(e[2]=g=>i.text=g)},{default:h.withCtx(()=>[h.createElementVNode("p",Ote,h.toDisplayString(i.text),1)]),_:1},8,["modelValue"]),h.createVNode(o,{modelValue:i.id,"onUpdate:modelValue":e[3]||(e[3]=g=>i.id=g),onUpdateValue:e[4]||(e[4]=g=>i.id=g)},{default:h.withCtx(()=>[h.createElementVNode("p",Nte,h.toDisplayString(i.id),1)]),_:1},8,["modelValue"])]),h.createElementVNode("p",Bte,h.toDisplayString((p=n.item)==null?void 0:p.parent),1)])])}const Lte={components:{VsReesterUsersItem:Ve(Dte,[["render",zte]])},props:{list:Array},data(){return{draggedItemIndex:null}},methods:{dragStart(t,e){this.draggedItemIndex=e,t.dataTransfer.effectAllowed="move"},dragOver(t){t.preventDefault()},drop(t,e){t.preventDefault();const n=this.draggedItemIndex;if(n!==e){const r=[...this.list],i=r[n];r.splice(n,1),r.splice(e,0,i),this.$emit("update-list",r)}this.draggedItemIndex=null},dragEnd(){this.draggedItemIndex=null},updateItem(t,e){var r;const n=(r=this.list)==null?void 0:r.findIndex(i=>(i==null?void 0:i.id)===(t==null?void 0:t.id));this.list[n]=t,e&&(this.list[n].id=e),this.$emit("update-list",this.list)}}},Vte={class:"flex flex w-full flex-col gap-[10px] p-[10px] pt-[40px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300",style:{width:"calc(100vw - 1000px)","max-height":"calc(100vh - 430px)"}},Fte=["onDragstart","onDrop"];function $te(t,e,n,r,i,s){const a=h.resolveComponent("VsReesterUsersItem");return h.openBlock(),h.createElementBlock("ul",Vte,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.list,(o,p)=>(h.openBlock(),h.createElementBlock("li",{key:o==null?void 0:o.id,draggable:!0,onDragstart:g=>s.dragStart(g,p),onDragover:e[0]||(e[0]=g=>s.dragOver(g)),onDrop:g=>s.drop(g,p),onDragend:e[1]||(e[1]=(...g)=>s.dragEnd&&s.dragEnd(...g))},[h.createVNode(a,{item:o,onUpdateItem:s.updateItem},null,8,["item","onUpdateItem"])],40,Fte))),128))])}const jte={components:{VsNoData:tI,VsChoceColor:nI,IconCheck:lk,VsReesterUsersList:Ve(Lte,[["render",$te],["__scopeId","data-v-87c0b333"]])},data(){return{scheme:{text:{type:"Text",ua:"Ім'я",validators:["required"]}},formVisible:!0,formValues:{},color:"#172B4D",data:null}},watch:{$route:{handler(t,e){var n,r;((n=t==null?void 0:t.query)==null?void 0:n.name)!==((r=e==null?void 0:e.query)==null?void 0:r.name)&&this.getData()}}},mounted(){this.getData()},methods:{async getData(){var t;this.data=null;try{const{data:e}=await tt.get(`/api/user-cls/${(t=this.$route.query)==null?void 0:t.name}`);this.data=e}catch{}},async addOneChild(){var t,e,n,r;try{const{form:i}=this.$refs;await i.doValidation(),await tt.post("/api/user-cls",{name:(t=this.$route.query)==null?void 0:t.name,children:[...((e=this.data)==null?void 0:e.children)||[],{...this.formValues,color:this.color,id:(((r=(n=this.data)==null?void 0:n.children)==null?void 0:r.length)||0)+1}]}),this.formVisible=!1,this.formValues={},setTimeout(()=>this.formVisible=!0),await this.getData()}catch(i){console.log(i)}},async updateChildren(t){var e,n;this.data.children=t;try{await tt.post("/api/user-cls",{name:(e=this.$route.query)==null?void 0:e.name,children:[...((n=this.data)==null?void 0:n.children)||[]]}),await this.getData()}catch(r){console.log(r)}}}},Hte={class:"flex justify-center bg-gray-50",style:{height:"calc(100vh - 60px)",width:"calc(100vw - 560px)"}},Ute={key:0,class:"mt-[100px] p-[10px]",style:{"max-height":"calc(100vh - 300px)",width:"calc(100vw - 1000px)"}},Wte={class:"flex items-end w-full gap-[4px]"};function qte(t,e,n,r,i,s){var v,E,T,D,N;const a=h.resolveComponent("VsForm"),o=h.resolveComponent("VsChoceColor"),p=h.resolveComponent("IconCheck"),g=h.resolveComponent("VsReesterUsersList"),y=h.resolveComponent("VsNoData");return h.openBlock(),h.createElementBlock("div",Hte,[(E=(v=t.$route)==null?void 0:v.query)!=null&&E.name?(h.openBlock(),h.createElementBlock("div",Ute,[e[3]||(e[3]=h.createElementVNode("h2",{class:"font-bold mb-[10px]"},"Створити",-1)),h.createElementVNode("div",Wte,[i.formVisible?(h.openBlock(),h.createBlock(a,{key:0,ref:"form",scheme:i.scheme,modelValue:i.formValues,"onUpdate:modelValue":e[0]||(e[0]=B=>i.formValues=B),class:"p-0 m-0 h-[65px] w-full"},null,8,["scheme","modelValue"])):h.createCommentVNode("",!0),h.createVNode(o,{modelValue:i.color,"onUpdate:modelValue":e[1]||(e[1]=B=>i.color=B)},null,8,["modelValue"]),h.createElementVNode("button",{onClick:e[2]||(e[2]=(...B)=>s.addOneChild&&s.addOneChild(...B)),class:"h-[37px] w-[37px] rounded-lg bg-blue-600 ml-[6px] flex items-center justify-center text-white hover:bg-blue-700 duration-300"},[h.createVNode(p,{height:"20",width:"20"})])]),(D=(T=i.data)==null?void 0:T.children)!=null&&D.length?(h.openBlock(),h.createBlock(g,{key:0,list:(N=i.data)==null?void 0:N.children,onUpdateList:s.updateChildren},null,8,["list","onUpdateList"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(y,{key:1,class:"mt-[100px]",text:"Оберіть один з пунктів меню для відображення"}))])}const Gte={components:{VsReesterNavList:bte,VsReesterContent:Ve(jte,[["render",qte]])}},Yte={class:"flex items-start gap-0"};function Zte(t,e,n,r,i,s){const a=h.resolveComponent("VsReesterNavList"),o=h.resolveComponent("VsReesterContent");return h.openBlock(),h.createElementBlock("div",Yte,[h.createVNode(a),h.createVNode(o)])}const Xte=Ve(Gte,[["render",Zte]]),Kte={class:"h-[76px] bg-white border rounded-xl flex items-center justify-start px-[20px] mb-[16px]"},Jte={class:"mr-[10px]"},Qte={class:"text-[20px] font-semibold"},ene={key:0,class:"text-[14px] font-medium text-[#676A6C]"},tne={class:""},nne={__name:"admin-card-header",props:{title:{type:String},tableName:{type:String},getRoute:{type:String,required:!0},slots:{type:Object},isHeaderEditButton:{type:Boolean,default:()=>!0}},setup(t){var v,E,T,D,N;const{asyncTemplateSlot:e}=(N=(D=(T=(E=(v=h.getCurrentInstance())==null?void 0:v.appContext)==null?void 0:E.app)==null?void 0:T.config)==null?void 0:D.globalProperties)==null?void 0:N.utils,n=t,r=qN(),i=GN(),s=h.ref(""),a=h.ref(""),o=()=>{r.back()},p=h.computed(()=>{var B;return`/edit?table=${n.getRoute}&id=${(B=i==null?void 0:i.params)==null?void 0:B.id}`}),g=()=>{var B,F,X,te;if(!((B=n.slots)!=null&&B.panelLeft))return"div";if((F=n.slots)!=null&&F.panelLeft.includes("<")){const H=e("PanelLeft",(X=n.slots)==null?void 0:X.panelLeft,["name"]);a.value=H}else a.value=(te=n.slots)==null?void 0:te.panelLeft},y=()=>{var B,F,X,te;if(!((B=n.slots)!=null&&B.panelRight))return"div";if((F=n.slots)!=null&&F.panelRight.includes("<")){const H=e("PanelRight",(X=n.slots)==null?void 0:X.panelRight,["name"]);s.value=H}else s.value=(te=n.slots)==null?void 0:te.panelRight};return g(),y(),(B,F)=>{const X=h.resolveComponent("router-link");return h.openBlock(),h.createElementBlock("div",Kte,[h.createElementVNode("div",Jte,[h.createElementVNode("h2",Qte,h.toDisplayString(t.title),1),t.tableName?(h.openBlock(),h.createElementBlock("div",ene,h.toDisplayString(t.tableName),1)):h.createCommentVNode("",!0)]),(h.openBlock(),h.createBlock(h.resolveDynamicComponent(a.value))),h.createElementVNode("div",{class:h.normalizeClass([{"gap-[6px]":t.isHeaderEditButton},"flex items-center ml-auto"])},[h.createElementVNode("button",{onClick:o,class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},F[0]||(F[0]=[h.createElementVNode("svg",{class:"transition duration-200 ease-in-out group-hover:stroke-white",width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[h.createElementVNode("path",{d:"M7.00008 11.5833L2.91675 7.49999L7.00008 3.41666",stroke:"#1f2937","stroke-linecap":"round","stroke-linejoin":"round"}),h.createElementVNode("path",{d:"M11.0834 7.5H2.91675",stroke:"#2563EB","stroke-linecap":"round","stroke-linejoin":"round"})],-1),h.createElementVNode("span",{class:"hidden sm:block ml-[8px]"},"Повернутися до реєстру",-1)])),h.createElementVNode("div",tne,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(s.value)))]),t.isHeaderEditButton?(h.openBlock(),h.createBlock(X,{key:0,to:p.value,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:h.withCtx(()=>F[1]||(F[1]=[h.createTextVNode(" Редагувати ")])),_:1},8,["to"])):h.createCommentVNode("",!0)],2)])}}},rne={__name:"admin-card-async-component",props:{slot:String,data:Object,objectData:Object},setup(t){var s,a,o,p,g;const{asyncTemplateSlot:e}=(g=(p=(o=(a=(s=h.getCurrentInstance())==null?void 0:s.appContext)==null?void 0:a.app)==null?void 0:o.config)==null?void 0:p.globalProperties)==null?void 0:g.utils,n=h.ref(""),r=t;return(()=>{const y=e("CustomComponent",r.slot,["data"]);n.value=y})(),(y,v)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.value),{data:t.objectData},null,8,["data"]))}},ine={},sne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function one(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",sne,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const gv=Ve(ine,[["render",one]]),ane={props:["table","id"],components:{AdminCardHeader:nne,AdminCardAsyncComponent:rne,IconChevron:gv},data(){return{objectData:null,showTabs:!1,component:""}},computed:{getRoute(){const t=this.flattenMenu(bs.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(n=>{var r,i;return(n==null?void 0:n.table)==((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.table)});return e||this.$router.replace("/404"),e==null?void 0:e.path},getTable(){const t=this.flattenMenu(bs.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(n=>{var r,i;return(n==null?void 0:n.table)==((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.table)});return e||this.$router.replace("/404"),e==null?void 0:e.ua},getTitle(){var t,e,n,r,i,s,a,o,p,g,y,v;return((i=(e=(t=this.objectData)==null?void 0:t.rows)==null?void 0:e[0])==null?void 0:i[(r=(n=this.objectData)==null?void 0:n.meta)==null?void 0:r.title])||((y=(a=(s=this.objectData)==null?void 0:s.rows)==null?void 0:a[0])==null?void 0:y[(g=(p=(o=this.objectData)==null?void 0:o.columns)==null?void 0:p.find(E=>(E==null?void 0:E.meta)==="title"))==null?void 0:g.name])||((v=this.objectData)==null?void 0:v.title)||this.getTable}},async mounted(){await this.getObjectData(),await this.checkActiveComponent(),addEventListener("reloadCardPage",this.getObjectData)},unmounted(){removeEventListener("reloadCardPage",this.getObjectData)},watch:{component(t){var e;this.showTabs=!1,this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,tab:t}})},$route:{async handler(t,e){var n,r,i,s;(((n=t==null?void 0:t.params)==null?void 0:n.table)!==((r=e==null?void 0:e.params)==null?void 0:r.table)||((i=t==null?void 0:t.params)==null?void 0:i.id)!==((s=e==null?void 0:e.params)==null?void 0:s.id))&&await this.getObjectData(),await this.checkActiveComponent()}}},methods:{async getObjectData(){var n,r;const t=this.table||((n=this.$route)==null?void 0:n.params.table),e=this.id||((r=this.$route)==null?void 0:r.params.id);(!t||!e)&&this.$router.replace("/404");try{const{data:i}=await tt.get(`/api/table-data/${t}/${e}`);this.objectData=i}catch(i){console.error(i)}},getColClass(t){return`lg:col-span-${t||12}`},getGridClass(){return"grid-cols-12"},checkActiveComponent(){var t,e,n,r,i,s,a,o,p;if((e=(t=this.$route)==null?void 0:t.query)!=null&&e.tab)this.component=(r=(n=this.$route)==null?void 0:n.query)==null?void 0:r.tab;else{const g=(s=(i=this.objectData)==null?void 0:i.panels)==null?void 0:s.find(y=>(y==null?void 0:y.type)==="tabs"||(y==null?void 0:y.type)==="vertical-tabs");(a=g==null?void 0:g.items)!=null&&a.length&&(this.component=((o=g.items[0])==null?void 0:o.component)||((p=g.items[0])==null?void 0:p.name))}},getProps(t){var n,r,i;const e={};for(const s in t)["name","component","title","token"].includes(s)||(e[s]=((i=(r=(n=this.objectData)==null?void 0:n.rows)==null?void 0:r[0])==null?void 0:i[t[s]])||t[s]);return e},flattenMenu(t){const e=[];return t==null||t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e}}},lne={style:{height:"calc(100vh - 60px)"},class:"p-4 overflow-y-auto bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},cne={key:0,class:"bg-white border rounded-xl"},dne={class:"p-[10px] pl-[20px] text-md font-[500]"},une=["innerHTML"],hne={key:1},fne={key:0,class:"p-[10px] pl-[20px] text-md font-[500]"},pne={key:2,class:"p-[20px] border-t"},mne=["innerHTML"],gne={class:"flex space-x-1 w-full bg-white border border-b-0 rounded-tr-xl rounded-tl-xl h-[60px] items-center pl-[20px]"},yne=["onClick"],bne={key:0,class:"bg-white border border-t-0 rounded-bl-xl rounded-br-xl"},_ne={key:0,class:"p-[20px] border-t"},xne={key:1,class:"p-[20px] border-t"},vne=["innerHTML"],wne={key:3,class:"flex"},kne=["onClick"],Ene={class:"flex-grow w-[80%]"},Sne={key:0,class:"w-full h-full overflow-auto bg-white border rounded-xl [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Cne={key:0,class:"p-[20px]"},Tne={key:1,class:"p-[20px]"},Ane=["innerHTML"];function Mne(t,e,n,r,i,s){var g,y,v,E;const a=h.resolveComponent("AdminCardHeader"),o=h.resolveComponent("AdminCardAsyncComponent"),p=h.resolveComponent("IconChevron");return h.openBlock(),h.createElementBlock("div",lne,[i.objectData&&((g=i.objectData)==null?void 0:g.isHeader)!==!1?(h.openBlock(),h.createBlock(a,{key:0,title:s.getTitle,tableName:s.getTable,"get-route":s.getRoute,slots:(y=i.objectData)==null?void 0:y.slots,isHeaderEditButton:(v=i.objectData)==null?void 0:v.isHeaderEditButton},null,8,["title","tableName","get-route","slots","isHeaderEditButton"])):h.createCommentVNode("",!0),h.createElementVNode("div",{class:h.normalizeClass(["grid gap-[20px]",s.getGridClass()])},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((E=i.objectData)==null?void 0:E.panels,(T,D)=>{var N,B,F,X,te;return h.openBlock(),h.createElementBlock("div",{key:D,class:h.normalizeClass(["col-span-12",s.getColClass(T.col)])},[T!=null&&T.name?(h.openBlock(),h.createElementBlock("div",cne,[h.createElementVNode("h2",dne,h.toDisplayString((T==null?void 0:T.title)||"Панель"),1),(N=i.objectData)!=null&&N.html[T==null?void 0:T.name]?(h.openBlock(),h.createElementBlock("div",{key:0,class:"p-[20px] border-t",innerHTML:(B=i.objectData)==null?void 0:B.html[T==null?void 0:T.name]},null,8,une)):(h.openBlock(),h.createBlock(o,{key:1,slot:(F=i.objectData)==null?void 0:F.vue[T==null?void 0:T.name],data:(te=(X=i.objectData)==null?void 0:X.rows)==null?void 0:te[0],objectData:i.objectData},null,8,["slot","data","objectData"]))])):T.type==="container"?(h.openBlock(),h.createElementBlock("div",hne,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(T.items,(H,ke)=>{var ge,Se,Pe,Ne,at,Je,mt,nt,Ct,$t,jt,Ot,qt,wn;return h.openBlock(),h.createElementBlock("div",{key:ke,class:h.normalizeClass([{"mb-[20px]":T.items.length>1},"bg-white border rounded-xl"])},[H!=null&&H.title?(h.openBlock(),h.createElementBlock("h2",fne,h.toDisplayString((H==null?void 0:H.title)||"Панель"),1)):h.createCommentVNode("",!0),H!=null&&H.component?(h.openBlock(),h.createElementBlock("div",{key:1,class:h.normalizeClass(["p-[20px]",{"border-t":H==null?void 0:H.title}])},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(H.component),h.mergeProps({geometry:(Se=(ge=i.objectData)==null?void 0:ge.rows[0])==null?void 0:Se.geom,columns:H==null?void 0:H.columns,token:(Ne=(Pe=i.objectData)==null?void 0:Pe.tokens)==null?void 0:Ne[H==null?void 0:H.token],zoom:16,ref_for:!0},s.getProps(H),{data:i.objectData,id:(Je=(at=t.$route)==null?void 0:at.params)==null?void 0:Je.id}),null,16,["geometry","columns","token","data","id"]))],2)):h.createCommentVNode("",!0),H!=null&&H.name?(h.openBlock(),h.createElementBlock("div",pne,[(nt=(mt=i.objectData)==null?void 0:mt.html)!=null&&nt[H==null?void 0:H.name]?(h.openBlock(),h.createElementBlock("div",{key:0,innerHTML:($t=(Ct=i.objectData)==null?void 0:Ct.html)==null?void 0:$t[H==null?void 0:H.name]},null,8,mne)):(h.openBlock(),h.createBlock(o,{key:1,slot:(Ot=(jt=i.objectData)==null?void 0:jt.vue)==null?void 0:Ot[H==null?void 0:H.name],data:(wn=(qt=i.objectData)==null?void 0:qt.rows)==null?void 0:wn[0],objectData:i.objectData},null,8,["slot","data","objectData"]))])):h.createCommentVNode("",!0)],2)}),128))])):h.createCommentVNode("",!0),(T==null?void 0:T.type)==="tabs"?(h.openBlock(),h.createElementBlock(h.Fragment,{key:2},[h.createElementVNode("nav",gne,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(T==null?void 0:T.items,H=>(h.openBlock(),h.createElementBlock("button",{key:(H==null?void 0:H.name)||(H==null?void 0:H.component),onClick:ke=>i.component=(H==null?void 0:H.component)||(H==null?void 0:H.name),class:h.normalizeClass(["px-2.5 h-[30px] py-1.5 relative inline-flex items-center gap-x-2 text-gray-500 hover:bg-gray-100 focus:bg-gray-100 hover:text-gray-800 text-sm whitespace-nowrap rounded-lg focus:outline-none",{" font-semibold after:absolute after:bottom-[-14px] after:left-2.5 after:right-2.5 after:z-[1] after:h-0.5 after:bg-gray-800":i.component===(H==null?void 0:H.component)||i.component===(H==null?void 0:H.name),"":i.component!==(H==null?void 0:H.component)&&i.component!==(H==null?void 0:H.name)}])},h.toDisplayString(H==null?void 0:H.title),11,yne))),128))]),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(T.items,(H,ke)=>{var ge,Se,Pe,Ne,at,Je,mt,nt,Ct,$t,jt,Ot;return h.openBlock(),h.createElementBlock(h.Fragment,{key:ke},[i.component===(H==null?void 0:H.component)||i.component===(H==null?void 0:H.name)?(h.openBlock(),h.createElementBlock("div",bne,[H!=null&&H.component?(h.openBlock(),h.createElementBlock("div",_ne,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(H.component),h.mergeProps({data:i.objectData,token:(Se=(ge=i.objectData)==null?void 0:ge.tokens)==null?void 0:Se[H==null?void 0:H.token],columns:H==null?void 0:H.columns,geometry:(Ne=(Pe=i.objectData)==null?void 0:Pe.rows[0])==null?void 0:Ne.geom,ref_for:!0},s.getProps(H),{zoom:16,id:(Je=(at=t.$route)==null?void 0:at.params)==null?void 0:Je.id}),null,16,["data","token","columns","geometry","id"]))])):h.createCommentVNode("",!0),H!=null&&H.name?(h.openBlock(),h.createElementBlock("div",xne,[(nt=(mt=i.objectData)==null?void 0:mt.html)!=null&&nt[H==null?void 0:H.name]?(h.openBlock(),h.createElementBlock("div",{key:0,innerHTML:(Ct=i.objectData)==null?void 0:Ct.html[H==null?void 0:H.name]},null,8,vne)):(h.openBlock(),h.createBlock(o,{key:1,slot:($t=i.objectData)==null?void 0:$t.vue[H==null?void 0:H.name],data:(Ot=(jt=i.objectData)==null?void 0:jt.rows)==null?void 0:Ot[0],objectData:i.objectData},null,8,["slot","data","objectData"]))])):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0)],64)}),128))],64)):h.createCommentVNode("",!0),(T==null?void 0:T.type)==="vertical-tabs"?(h.openBlock(),h.createElementBlock("div",wne,[h.createElementVNode("div",{class:h.normalizeClass(["p-[5px] bg-white absolute left-0 rounded-lg border rounded-tl-[0] rounded-bl-[0]",[{"left-[260px]":i.showTabs}]]),onClick:e[0]||(e[0]=H=>i.showTabs=!i.showTabs)},[h.createVNode(p,{height:"16",width:"16",class:"-rotate-90"})],2),h.createElementVNode("nav",{class:h.normalizeClass(["lg:relative lg:left-0 flex flex-col space-y-2 max-w-[260px] w-full border rounded-xl mr-4 items-start pl-[10px] z-[2] lg:z-0 bg-white py-[20px] absolute left-[-100%]",[{"left-0 rounded-tr-[0]":i.showTabs}]])},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(T==null?void 0:T.items,H=>(h.openBlock(),h.createElementBlock("button",{key:(H==null?void 0:H.name)||(H==null?void 0:H.component),onClick:ke=>i.component=(H==null?void 0:H.component)||(H==null?void 0:H.name),class:h.normalizeClass(["relative inline-flex items-center w-full py-1 text-sm text-left whitespace-pre-wrap border-transparent pe-4 gap-x-2 border-e-2 hover:text-blue-600 focus:outline-none focus:text-blue-600",{"font-semibold after:absolute after:top-[0] after:right-[-1px] after:h-full text-blue-600 after:w-[2px] after:bg-blue-600 ":i.component===(H==null?void 0:H.component)||i.component===(H==null?void 0:H.name),"text-gray-500":i.component!==(H==null?void 0:H.component)&&i.component!==(H==null?void 0:H.name)}])},h.toDisplayString(H==null?void 0:H.title),11,kne))),128))],2),h.createElementVNode("div",Ene,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(T.items,(H,ke)=>{var ge,Se,Pe,Ne,at,Je,mt,nt,Ct,$t,jt,Ot;return h.openBlock(),h.createElementBlock(h.Fragment,{key:ke},[i.component===(H==null?void 0:H.component)||i.component===(H==null?void 0:H.name)?(h.openBlock(),h.createElementBlock("div",Sne,[H!=null&&H.component?(h.openBlock(),h.createElementBlock("div",Cne,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(H.component),h.mergeProps({token:(Se=(ge=i.objectData)==null?void 0:ge.tokens)==null?void 0:Se[H==null?void 0:H.token],data:i.objectData,columns:H==null?void 0:H.columns,geometry:(Ne=(Pe=i.objectData)==null?void 0:Pe.rows[0])==null?void 0:Ne.geom,ref_for:!0},s.getProps(H),{zoom:16,id:(Je=(at=t.$route)==null?void 0:at.params)==null?void 0:Je.id}),null,16,["token","data","columns","geometry","id"]))])):h.createCommentVNode("",!0),H!=null&&H.name?(h.openBlock(),h.createElementBlock("div",Tne,[(nt=(mt=i.objectData)==null?void 0:mt.html)!=null&&nt[H==null?void 0:H.name]?(h.openBlock(),h.createElementBlock("div",{key:0,innerHTML:(Ct=i.objectData)==null?void 0:Ct.html[H==null?void 0:H.name]},null,8,Ane)):(h.openBlock(),h.createBlock(o,{key:1,slot:($t=i.objectData)==null?void 0:$t.vue[H==null?void 0:H.name],data:(Ot=(jt=i.objectData)==null?void 0:jt.rows)==null?void 0:Ot[0],objectData:i.objectData},null,8,["slot","data","objectData"]))])):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0)],64)}),128))])])):h.createCommentVNode("",!0)],2)}),128))],2)])}const yv=Ve(ane,[["render",Mne],["__scopeId","data-v-f3b4c92f"]]),Dne=Object.freeze(Object.defineProperty({__proto__:null,default:yv},Symbol.toStringTag,{value:"Module"})),Ine={"card-page":yv,"user-cls-page":Xte,"calendar-page":{__name:"vs-calendar-page",setup(t){return(e,n)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(eI)]))}}},Pne={},Rne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-info-circle"};function One(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Rne,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"},null,-1),h.createElementVNode("path",{d:"M12 9h.01"},null,-1),h.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1)]))}const Nne=Ve(Pne,[["render",One]]),Bne={},zne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-loader"};function Lne(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",zne,e[0]||(e[0]=[h.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 6l0 -3"></path><path d="M16.25 7.75l2.15 -2.15"></path><path d="M18 12l3 0"></path><path d="M16.25 16.25l2.15 2.15"></path><path d="M12 18l0 3"></path><path d="M7.75 16.25l-2.15 2.15"></path><path d="M6 12l-3 0"></path><path d="M7.75 7.75l-2.15 -2.15"></path>',9)]))}const Vne=Ve(Bne,[["render",Lne]]),Fne=async(t,e,n,r=10)=>{var N,B,F,X;if(!e||!n)return;await h.nextTick();const i=await(n==null?void 0:n.getBoundingClientRect()),s=await(e==null?void 0:e.getBoundingClientRect());if(!s||!i)return;const a=await parseInt((N=e==null?void 0:e.getBoundingClientRect())==null?void 0:N.height),o=await parseInt((B=e==null?void 0:e.getBoundingClientRect())==null?void 0:B.width),p=await parseInt((F=n==null?void 0:n.getBoundingClientRect())==null?void 0:F.height),g=await parseInt((X=n==null?void 0:n.getBoundingClientRect())==null?void 0:X.width),y=await window.innerHeight,v=await window.innerWidth;let E=0,T=0;const D=s.bottom+r+p;switch(t){case"top":s.top-i.height-r<0?E=s.top-i.height+r+p+a:E=s.top-i.height-r,v>g+s.right+30?T=s.left-i.width/2+s.width/2:T=v-30-g;break;case"bottom":y>D?E=s.bottom+r:E=s.bottom-r-p-a,T=s.left-i.width/2+s.width/2;break;case"left":E=s.top-i.height/2+s.height/2,s.left-i.width-r>0?T=s.left-i.width-r:T=10;break;case"right":E=s.top-i.height/2+s.height/2,v-o>g?T=s.right+r:T=v-30-g;break;case"top-right":s.top-i.height-r<0?E=s.top-i.height+(void 0).gap+p+a:E=s.top-i.height-r,v-o>g?T=s.right+r:T=v-30-g;break;case"top-left":s.top-i.height-r<0?E=s.top-i.height+r+p+a:E=s.top-i.height-r,s.left-i.width-r>0?T=s.left-i.width-r:T=10;break;case"bottom-right":y>D?E=s.bottom+r:E=s.bottom-r-p-a,v-o>g?T=s.left:T=v-30-g;break;case"bottom-left":y>D?E=s.bottom+r:E=s.bottom-r-p-a,s.left>0?T=s.right-g:T=10;break;case"bottom-start":y>D?E=s.bottom+r:E=s.bottom-(void 0).gap-p-a,s.left>0?T=s.left:T=10;break}E+p>y?E=y-p-r:E<0&&(E=r),T+g>v?T=v-g-r:T<0&&(T=r),n instanceof HTMLElement&&(n.style.top=`${E}px`,n.style.left=`${T}px`,n.style.position="fixed")},$ne={class:"flex items-center justify-between py-1 gap-x-4"},jne={class:"col-span-1"},Hne={class:"inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500"},Une={class:"col-span-2"},Wne={class:"font-medium text-[13px] text-gray-800 dark:text-neutral-200"},qne={key:1,class:"w-[300px] h-[300px] flex items-center justify-center"},rI={__name:"admin-info-popover",props:{table:{type:String,default:()=>""},id:{type:String,default:()=>""}},setup(t){var v,E;const e=(E=(v=h.getCurrentInstance())==null?void 0:v.appContext)==null?void 0:E.app;window.v3core.install(e),Object.entries(dE).forEach(([T,D])=>{e==null||e.component(T,D)});const n=t,r=h.ref(null),i=h.ref(!1),s=h.ref(null),a=h.ref(null);let o=null;const p=async()=>{try{const{data:T}=await tt.get(`/api/table-info/${n.table}/${n.id}`);r.value=T}catch{}},g=async()=>{clearTimeout(o),i.value=!0,r.value||await p(),await Fne("right",s.value,a.value,40)},y=()=>{o=setTimeout(()=>{i.value=!1},300)};return h.onBeforeUnmount(()=>{clearTimeout(o)}),(T,D)=>(h.openBlock(),h.createElementBlock("div",{class:"relative inline-flex h-[30px] w-[30px] flex items-center justify-center",onMouseenter:g,onMouseleave:y,ref_key:"infoPopover",ref:s},[h.createVNode(Nne,{height:"20",width:"20",class:"text-gray-700 cursor-pointer"}),(h.openBlock(),h.createBlock(h.Teleport,{to:"#modal"},[h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var N;return[h.withDirectives(h.createElementVNode("div",{onMouseenter:g,onMouseleave:y,ref_key:"infoPopoverContent",ref:a,class:"fixed p-[20px] border z-[10002] rounded-xl bg-white max-h-[400px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-thumb]:rounded-[100px] [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[r.value?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList((N=r.value)==null?void 0:N.columns,B=>{var F,X;return h.openBlock(),h.createElementBlock("dl",$ne,[h.createElementVNode("dt",jne,[h.createElementVNode("p",Hne,h.toDisplayString((B==null?void 0:B.ua)||(B==null?void 0:B.title))+": ",1)]),h.createElementVNode("dd",Une,[h.createElementVNode("p",Wne,[h.createVNode(ef,{row:(X=(F=r.value)==null?void 0:F.rows)==null?void 0:X[0],column:{...B,edit:!1}},null,8,["row","column"])])])])}),256)):(h.openBlock(),h.createElementBlock("div",qne,[h.createVNode(Vne,{height:"40",width:"40",class:"animate-spin"})]))],544),[[h.vShow,i.value]])]}),_:1})]))],544))}},bv={...Mee,...Dee,"vs-dashboard":Pee,"vs-custom-button":Nee,"vs-group-interface":ite,"vs-test-widget":{__name:"vs-test-widget",props:{data:Object,dataName:String,table:String,geom:null},setup(t){var s;const{$v3plugin:e,$confirm:n}=(s=h.getCurrentInstance())==null?void 0:s.appContext.app.config.globalProperties,r=h.ref(!1),i=()=>{n({title:"Are you sure?",message:"Are you sure you want to delete this message?"})};return(a,o)=>{var g,y,v,E;const p=h.resolveComponent("VsConfirm");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",null,[h.createVNode(rI,{table:(y=(g=a.$route)==null?void 0:g.params)==null?void 0:y.table,id:(E=(v=a.$route)==null?void 0:v.params)==null?void 0:E.id},null,8,["table","id"]),h.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:o[0]||(o[0]=T=>r.value=!0)}," Редагувати Tokens "),h.createElementVNode("button",{class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white",onClick:i}," Редагувати Tokens 1212 ")]),h.createVNode(p,{visible:r.value,"onUpdate:visible":o[1]||(o[1]=T=>r.value=T),title:"Are you sure?"},{footer:h.withCtx(()=>o[2]||(o[2]=[h.createElementVNode("div",{class:"flex gap-[4px] p-[16px]"},[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium duration-300 border rounded-lg shadow-sm gap-x-2 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50","data-hs-overlay":"#hs-pro-chhdl"}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-white duration-300 bg-red-500 rounded-lg gap-x-2 disabled:opacity-50 disabled:pointer-events-none"}," Видалити ")],-1)])),default:h.withCtx(()=>[o[3]||(o[3]=h.createElementVNode("p",{class:"mt-1 text-sm text-gray-600 dark:text-neutral-400"}," Are you sure you want to delete this message? ",-1)),o[4]||(o[4]=h.createElementVNode("div",{class:"flex items-center mt-5"},[h.createElementVNode("input",{type:"checkbox",class:"shrink-0 size-3.5 border-gray-300 rounded text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-600 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:"hs-pro-chhdlcch"}),h.createElementVNode("label",{for:"hs-pro-chhdlcch",class:"text-sm text-gray-600 ms-2 dark:text-neutral-400"}," Don't show me this again ")],-1))]),_:1},8,["visible"])],64)}}},"vs-card-list":yv,...Ine},Gne=t=>new Promise(e=>{const n=new CustomEvent("openFormPlugin");n.options=t,window.dispatchEvent(n);const r=({message:i})=>{window.removeEventListener("closeFormPlugin",r),e(i)};window.addEventListener("closeFormPlugin",r)});function Yne(t){const e=typeof t;return e==="object"?t:{title:"Підтвердити операцію",text:e==="string"?t:"Ви впевнені що хочете виконати операцію?",cancel:"Скасувати",confirm:"Виконати"}}const Zne=({api:t,confirm:e,method:n,isId:r,id:i})=>new Promise(s=>{var v,E,T,D;const{VsDialog:a}=(E=(v=window.app)==null?void 0:v._context)==null?void 0:E.components,{$notify:o}=(D=(T=window.app)==null?void 0:T.config)==null?void 0:D.globalProperties,p=document.querySelector("#modal");if(!p){console.error('Modal root element with id "#modal" not found!');return}const g=document.createElement("div");p.appendChild(g);const y=h.createApp({components:{VsDialog:a},data(){return{visible:!1,getConfirm:Yne(e)}},methods:{close(N){this.visible=!1,this.$el.remove(),y.unmount(),s(N||"Success")},async doRequest(){var N;try{const{data:B}=await tt({url:t+(r?`/${i}`:""),method:n||"POST"});this.close(B),await o({title:"Успішно!",type:"success",message:"Операція виконана успішно"}),await Rp()}catch(B){o({title:"Помилка!",type:"error",message:((N=B==null?void 0:B.response)==null?void 0:N.data)||"Сталася помилка"})}}},mounted(){e?this.visible=!0:this.doRequest()},template:`
|
742
742
|
<div style="position: relative; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;">
|
743
743
|
<VsDialog v-model:visible="visible" size="small" :title="getConfirm?.title">
|
744
744
|
<div class="p-4">
|
@@ -773,4 +773,4 @@ img.ProseMirror-separator {
|
|
773
773
|
</div>
|
774
774
|
`}).mount(a)},{Fancybox:Kne}=vm,_v={$form:Gne,$api:Zne,$map:Xne,$preview:({media:t})=>{const e=document.querySelector("#app");if(!e){console.error('Modal root element with id "#app" not found!');return}const n=document.createElement("div");e.appendChild(n),h.createApp({data(){return{items:Array.isArray(t)?t:[t]}},mounted(){this.$nextTick(()=>{Kne.show(this.items.map(i=>{const s=typeof i=="string"&&i.endsWith(".pdf");return{src:i,type:s?"iframe":"image"}}),{groupAll:!0,Thumbs:{autoStart:!0}})})},template:`
|
775
775
|
<div style="display: none;"></div> <!-- Keeps container hidden -->
|
776
|
-
`}).mount(n)}};window.addEventListener("click",t=>{var n,r,i;const e=(n=t==null?void 0:t.target)==null?void 0:n.closest("[_href]");if(e&&(e==null?void 0:e.tagName)==="A"){const s=e==null?void 0:e.getAttribute("_href");(i=(r=window==null?void 0:window.app)==null?void 0:r.router)==null||i.push(s),t==null||t.preventDefault()}});const Jne=h.defineCustomElement(rI);customElements.define("admin-info",Jne);const Qne=async()=>{try{const{data:t}=await tt.get("/api/user-menu");return bs.value=t,pv(t)}catch(t){return console.error(t),[]}},ere=(t,e)=>{Object.entries(e).forEach(([n,r])=>{t.component(n,r)})},tre={async install(t,{componentsApp:e={},settings:n,routes:r=[]}){Vn.value={...Vn,...n};try{const s=(await Qne()).filter(o=>o==null?void 0:o.component).map(o=>({...o,component:{...bv,...e}[o==null?void 0:o.component]}));ere(t,{...bv,...e}),t.component("admin",_O);const{router:a}=await eB(s.concat(r));window.app={...t,router:a},window.v3plugin={...t.config.globalProperties,..._v},t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...dE,componentsApp:e},$router:a,$v3plugin:_v,$utils:{reloadCardPage:Rp}},t.use(a)}catch(i){console.error(i)}},components:bv,plugins:_v},nre={data(){return{formValues:{},scheme:null,table:"",token:"",style:null}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,i;const t=this.flattenMenu(bs.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.query)==null?void 0:o.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:s}}=await tt.get(`/api/template/table/${n}`),{data:a}=await tt.get(`/api/table/${this.table}/${(i=(r=this.$route)==null?void 0:r.query)==null?void 0:i.id}`);this.token=(a==null?void 0:a.token)||"",this.formValues=a||{};const{data:o}=await tt.get(`/api/template/form/${s}`);this.scheme=(o==null?void 0:o.schema)||o,this.style=(o==null?void 0:o.style)||null}catch{}},async onlyEditObject(){var e,n,r,i,s,a,o,p,g;const t=this.$refs.form;try{await t.doValidation(),await tt.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(p=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:p[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}},async editObjectAndRedirect(){var e,n,r,i,s,a,o,p,g;const t=this.$refs.form;try{await t.doValidation(),await tt.put(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(p=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:p[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}}}},rre={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},ire={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},sre={class:"flex items-center gap-[6px]"},ore={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},are={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function lre(t,e,n,r,i,s){var o;const a=h.resolveComponent("VsForm");return h.openBlock(),h.createElementBlock("div",rre,[h.createElementVNode("div",ire,[e[3]||(e[3]=h.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),h.createElementVNode("div",sre,[h.createElementVNode("button",{onClick:e[0]||(e[0]=p=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...p)=>s.editObjectAndRedirect&&s.editObjectAndRedirect(...p)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")])]),h.createElementVNode("div",ore,[h.createElementVNode("div",are,[i.scheme?(h.openBlock(),h.createBlock(a,{key:0,ref:"form",scheme:i.scheme,columns:(o=i.style)==null?void 0:o.columns,style:h.normalizeStyle(i.style),modelValue:i.formValues,"onUpdate:modelValue":e[2]||(e[2]=p=>i.formValues=p),class:"p-0 mt-[20px]"},null,8,["scheme","columns","style","modelValue"])):h.createCommentVNode("",!0)])])])}const cre=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(nre,[["render",lre]])},Symbol.toStringTag,{value:"Module"})),dre={data(){return{formValues:{},scheme:null,table:"",token:"",api:"",style:null}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,i;const t=this.flattenMenu(bs.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.query)==null?void 0:o.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const s=await tt.get(`/api/table-data/${n}`),{data:a}=await tt.get(`/api/template/form/${(r=s==null?void 0:s.data)==null?void 0:r.form}`);this.scheme=(a==null?void 0:a.schema)||a,this.style=(a==null?void 0:a.style)||null,this.api=(a==null?void 0:a.api)||"",this.token=(i=s==null?void 0:s.data)==null?void 0:i.addToken}catch{}},async createObject(){var e,n,r,i,s,a,o,p,g;const t=this.$refs.form;try{await t.doValidation(),await tt.post(this.api||`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(p=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:p[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}}}},ure={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},hre={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},fre={class:"flex items-center gap-[6px]"},pre={style:{height:"calc(100vh - 165px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},mre={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function gre(t,e,n,r,i,s){const a=h.resolveComponent("VsForm");return h.openBlock(),h.createElementBlock("div",ure,[h.createElementVNode("div",hre,[e[3]||(e[3]=h.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),h.createElementVNode("div",fre,[h.createElementVNode("button",{onClick:e[0]||(e[0]=o=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...o)=>s.createObject&&s.createObject(...o)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")])]),h.createElementVNode("div",pre,[h.createElementVNode("div",mre,[i.scheme?(h.openBlock(),h.createBlock(a,{key:0,ref:"form",scheme:i.scheme,style:h.normalizeStyle(i.style),modelValue:i.formValues,"onUpdate:modelValue":e[2]||(e[2]=o=>i.formValues=o),class:"p-0 mt-[20px]"},null,8,["scheme","style","modelValue"])):h.createCommentVNode("",!0)])])])}const yre=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(dre,[["render",gre]])},Symbol.toStringTag,{value:"Module"})),bre={};function _re(t,e,n,r,i,s){const a=h.resolveComponent("router-view");return h.openBlock(),h.createBlock(a)}const iI=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(bre,[["render",_re]])},Symbol.toStringTag,{value:"Module"})),xre={},vre={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-logout"};function wre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",vre,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),h.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),h.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const sI=Ve(xre,[["render",wre]]),kre={},Ere={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Sre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Ere,e[0]||(e[0]=[h.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const Cre=Ve(kre,[["render",Sre]]),Tre={components:{IconChevronDown:gv},props:{route:Object,searchable:String},mounted(){var t,e;(e=(t=this.route)==null?void 0:t.menu)!=null&&e.some(n=>{var r,i;return(n==null?void 0:n.path)===this.$route.path.replace("/","")||((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.table)===(n==null?void 0:n.table)&&(n==null?void 0:n.table)})&&(this.isOpen=!0)},watch:{route:{immediate:!0,handler(t){t!=null&&t.open&&(this.isOpen=!0)}}},data(){return{isOpen:!1,arr:[]}},computed:{darkMode(){var t;return(t=Vn==null?void 0:Vn.value)==null?void 0:t.sidebarDark}},methods:{highLight(t){if(!this.searchable)return t;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${e})(\\s*)`,"gi");return t.replace(n,(r,i,s)=>`<span style="color:#1989fa;">${i}</span>${s}`)}}},Are={key:0,class:""},Mre={key:0,class:"py-0.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full dark:bg-blue-500/10 dark:text-blue-500"},Dre={key:1},Ire=["innerHTML"];function Pre(t,e,n,r,i,s){var p,g,y,v,E,T,D,N,B,F,X,te,H,ke,ge;const a=h.resolveComponent("IconChevronDown"),o=h.resolveComponent("router-link");return(p=n.route)!=null&&p.menu?(h.openBlock(),h.createElementBlock("div",Are,[h.createElementVNode("button",{onClick:e[0]||(e[0]=Se=>i.isOpen=!i.isOpen),class:h.normalizeClass(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-100",[((y=(g=n.route)==null?void 0:g.menu)==null?void 0:y.some(Se=>{var Pe,Ne;return(Se==null?void 0:Se.path)===t.$route.path.replace("/","")||(Se==null?void 0:Se.table)===((Ne=(Pe=t.$route)==null?void 0:Pe.params)==null?void 0:Ne.table)&&(Se==null?void 0:Se.table)}))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!s.darkMode}]])},[h.createTextVNode(h.toDisplayString((v=n.route)==null?void 0:v.ua)+" ",1),(E=n.route)!=null&&E.new?(h.openBlock(),h.createElementBlock("span",Mre,"Нове")):h.createCommentVNode("",!0),h.createVNode(a,{class:h.normalizeClass([[i.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var Se;return[h.withDirectives(h.createElementVNode("ul",{class:h.normalizeClass(["ml-[28px] pt-[6px] before:block before:absolute relative w-[calc(100%-28px)] flex-col gap-y-1.5 inline-flex before:w-[2px] before:h-[100%] before:left-[-10px] cursor-pointer",s.darkMode?"before:bg-white/10":"before:bg-gray-100"])},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((Se=n.route)==null?void 0:Se.menu,(Pe,Ne)=>{var at,Je;return h.openBlock(),h.createElementBlock("li",{key:Ne,class:"w-full"},[h.createVNode(o,{innerHTML:s.highLight(Pe==null?void 0:Pe.ua),to:"/"+(Pe==null?void 0:Pe.path),class:h.normalizeClass([[((Pe==null?void 0:Pe.path)===t.$route.path.replace("/","")||((Je=(at=t.$route)==null?void 0:at.params)==null?void 0:Je.table)===(Pe==null?void 0:Pe.table)&&(Pe==null?void 0:Pe.table))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!s.darkMode}],"block px-3 py-2 text-sm rounded-lg focus:outline-none focus:bg-gray-100"])},null,8,["innerHTML","to","class"])])}),128))],2),[[h.vShow,i.isOpen]])]}),_:1})])):(T=n.route)!=null&&T.hidden?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",Dre,[h.createVNode(o,{to:((N=(D=n.route)==null?void 0:D.path)==null?void 0:N[0])==="/"?(B=n.route)==null?void 0:B.path:"/"+((F=n.route)==null?void 0:F.path),class:h.normalizeClass([[(((X=n.route)==null?void 0:X.path.replace("/",""))===t.$route.path.replace("/","")||((H=(te=t.$route)==null?void 0:te.params)==null?void 0:H.table)===((ke=n.route)==null?void 0:ke.table)&&((ge=n.route)==null?void 0:ge.table))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10 ":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100 ":!s.darkMode}],"flex items-center w-full px-3 py-2 text-sm text-gray-800 duration-300 rounded-lg gap-x-3"])},{default:h.withCtx(()=>{var Se;return[h.createElementVNode("span",{innerHTML:s.highLight((Se=n.route)==null?void 0:Se.ua)},null,8,Ire)]}),_:1},8,["to","class"])]))}const Rre=Ve(Tre,[["render",Pre]]),Ore={},Nre={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Bre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Nre,e[0]||(e[0]=[h.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),h.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),h.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const oI=Ve(Ore,[["render",Bre]]),zre={},Lre={class:"shrink-0 size-4 rounded-full",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function Vre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Lre,e[0]||(e[0]=[h.createStaticVNode('<g fill-rule="evenodd"><g stroke-width="1pt"><path fill="#bd3d44" d="M0 0h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M0 10h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path></g><path fill="#192f5d" d="M0 0h98.8v70H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M8.2 3l1 2.8H12L9.7 7.5l.9 2.7-2.4-1.7L6 10.2l.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7L74 8.5l-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 7.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 24.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 21.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 38.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 35.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 52.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 49.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 66.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 63.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9z" transform="scale(3.9385)"></path></g>',1)]))}const Fre=Ve(zre,[["render",Vre]]),$re={},jre={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"256",height:"256",viewBox:"0 0 256 256","xml:space":"preserve"};function Hre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",jre,e[0]||(e[0]=[h.createElementVNode("defs",null,null,-1),h.createElementVNode("g",{style:{stroke:"none","stroke-width":"0","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"none","fill-rule":"nonzero",opacity:"1"},transform:"translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)"},[h.createElementVNode("path",{d:"M 45 90 C 20.147 90 0 69.853 0 45 h 90 C 90 69.853 69.853 90 45 90 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(255,213,0)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"}),h.createElementVNode("path",{d:"M 45 0 C 20.147 0 0 20.147 0 45 h 90 C 90 20.147 69.853 0 45 0 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(0,91,187)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"})],-1)]))}const Ure=Ve($re,[["render",Hre]]),Wre={},qre={class:"shrink-0 size-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Gre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",qre,e[0]||(e[0]=[h.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)]))}const Yre={components:{IconQuestion:oI,IconUSA:Fre,IconUkraine:Ure,IconTick:Ve(Wre,[["render",Gre]])},props:["docs","languages"],data(){return{currentLang:"ukraine",languagesOptions:[{titleEN:"English",titleUA:"Англійська",id:"english",icon:"IconUSA"},{titleEN:"Ukraine",titleUA:"Українська",id:"ukraine",icon:"IconUkraine"}]}},computed:{selectedLang(){return this.languagesOptions.find(t=>t.id===this.currentLang)},darkMode(){var t;return(t=Vn==null?void 0:Vn.value)==null?void 0:t.sidebarDark}},methods:{changeLang(t){this.$refs.langPopover.togglePopover(),this.currentLang=t}}},Zre={class:"flex justify-center items-center gap-x-2"},Xre=["onClick"],Kre={class:"text-gray-800"},Jre={class:"ms-auto"},Qre={class:"truncate"};function eie(t,e,n,r,i,s){const a=h.resolveComponent("IconTick"),o=h.resolveComponent("VsPopover");return n.docs||n.languages?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["py-2 px-5 border-t dark:border-neutral-700",s.darkMode?"border-white/10 ":"border-gray-200"])},[h.createElementVNode("div",Zre,[h.createVNode(o,{trigger:"click",placement:"top",ref:"langPopover"},{reference:h.withCtx(()=>{var p,g,y;return[h.createElementVNode("button",{type:"button","aria-expanded":"false",class:h.normalizeClass(["relative py-2 px-3 flex items-center gap-x-2 text-nowrap w-full cursor-pointer border rounded-full text-start text-sm text-gray-800 focus:outline-none",s.darkMode?"border-white/10 bg-transparent text-white/80 hover:bg-white/10 focus:bg-white/10":"border-gray-200 bg-white hover:bg-gray-100 focus:bg-gray-100"])},[h.createElementVNode("div",null,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent((p=s.selectedLang)==null?void 0:p.icon),{class:"w-[16px] h-[16px] rounded-full"}))]),h.createElementVNode("span",Qre,h.toDisplayString(i.currentLang==="ukraine"?(g=s.selectedLang)==null?void 0:g.titleUA:(y=s.selectedLang)==null?void 0:y.titleEN),1)],2)]}),default:h.withCtx(()=>[h.createElementVNode("div",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.languagesOptions,p=>(h.openBlock(),h.createElementBlock("button",{key:p.id,type:"button",onClick:g=>s.changeLang(p.id),class:h.normalizeClass(["flex items-center gap-x-2 cursor-pointer dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 selected",(p==null?void 0:p.id)===i.currentLang?"bg-gray-100":""])},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(p==null?void 0:p.icon),{class:"w-[16px] h-[16px] rounded-full"})),h.createElementVNode("div",Kre,h.toDisplayString(i.currentLang==="ukraine"?p==null?void 0:p.titleUA:p==null?void 0:p.titleEN),1),h.createElementVNode("span",Jre,[(p==null?void 0:p.id)===i.currentLang?(h.openBlock(),h.createBlock(a,{key:0})):h.createCommentVNode("",!0)])],10,Xre))),128))])]),_:1},512)])],2)):h.createCommentVNode("",!0)}const tie={components:{IconLogout:sI,NavbarItem:Rre,IconLogo:Cre,IconSearch:mv,NavbarFooter:Ve(Yre,[["render",eie]])},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t;return(t=this.searchValue)!=null&&t.trim()?this.filterMenu(bs.value,this.searchValue):bs.value},logo(){var t;return((t=Vn.value)==null?void 0:t.logo)||"/assets/logo.svg"},docs(){var t;return(t=Vn==null?void 0:Vn.value)==null?void 0:t.docs},languages(){var t;return(t=Vn==null?void 0:Vn.value)==null?void 0:t.languages},darkMode(){var t;return(t=Vn==null?void 0:Vn.value)==null?void 0:t.sidebarDark},darkColor(){var t,e;return((t=Vn==null?void 0:Vn.value)==null?void 0:t.sidebarColor)||((e=Vn==null?void 0:Vn.value)==null?void 0:e.color)||"blue"}},watch:{"$route.path"(){this.$parent.showMenu=!1}},methods:{filterMenu(t,e){return t.map(n=>{var r,i;if(n.menu){const s=this.filterMenu(n.menu,e);if(s.length>0)return{...n,menu:s,open:!0}}else if((i=(r=n.ua)==null?void 0:r.toLowerCase())!=null&&i.includes(e.toLowerCase()))return n;return null}).filter(Boolean)}}},nie={class:"h-[46px] w-full px-5 lg:px-8 mb-[10px]"},rie={href:"/"},iie=["src"],sie={class:"px-2 lg:px-5"},oie={class:"px-2 lg:px-5 flex flex-col flex-wrap w-full pb-3"},aie={key:0,class:"flex flex-col gap-y-1"};function lie(t,e,n,r,i,s){var g;const a=h.resolveComponent("VsText"),o=h.resolveComponent("NavbarItem"),p=h.resolveComponent("NavbarFooter");return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] pt-3 border-r w-[260px] top-0 bottom-0 shrink-0 absolute transition left-[-100%] z-[11]",{"left-0":t.$parent.showMenu,["bg-"+s.darkColor+"-950"]:s.darkMode,"bg-white":!s.darkMode}])},[h.createElementVNode("div",nie,[h.createElementVNode("a",rie,[h.createElementVNode("img",{src:s.logo,class:"object-contain w-full h-full"},null,8,iie)])]),h.createElementVNode("div",sie,[h.createVNode(a,{type:"text",modelValue:i.searchValue,"onUpdate:modelValue":e[0]||(e[0]=y=>i.searchValue=y),clearable:!0,icon:"search","icon-position":"left",placeholder:"Пошук по меню",class:h.normalizeClass(["[&>input]:h-[38px]",{"[&>input]:bg-[#172554] [&>input]:text-white/80 [&>input]:placeholder:text-white/40 [&>input]:border [&>input]:border-white/50":s.darkMode,["[&>input]:bg-"+s.darkColor+"-950"]:s.darkMode,["focus:[&>input]:border-"+s.darkColor+"-500"]:s.darkMode}])},null,8,["modelValue","class"])]),h.createElementVNode("div",{class:h.normalizeClass(["py-[10px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",s.languages||s.docs?"h-[calc(100vh-161px)]":"h-[calc(100vh-110px)]"])},[h.createElementVNode("nav",oie,[(g=s.data)!=null&&g.length?(h.openBlock(),h.createElementBlock("ul",aie,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.data,(y,v)=>(h.openBlock(),h.createElementBlock("li",{key:v,class:"flex flex-col gap-[6px]"},[h.createVNode(o,{route:y,searchable:i.searchValue},null,8,["route","searchable"])]))),128))])):(h.openBlock(),h.createElementBlock("div",{key:1,class:h.normalizeClass(["text-lg mt-[20px]",{"text-white/80":s.darkMode,"text-gray-800":!s.darkMode}])}," Не знайдено ",2))])],2),s.docs||s.languages?(h.openBlock(),h.createBlock(p,{key:0,docs:s.docs,languages:s.languages},null,8,["docs","languages"])):h.createCommentVNode("",!0)],2)}const cie=Ve(tie,[["render",lie],["__scopeId","data-v-ebe4c2ff"]]),die={components:{IconQuestion:oI,IconUser:iA,AdminNotification:sA,IconUserOutline:eA,IconLogout:sI},mounted(){this.getUserData()},data(){return{userData:null,isVisible:!1}},watch:{isVisible(t){t?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},methods:{async getUserData(){try{const{data:t}=await tt.get("/user");this.userData=t}catch{}},async logout(){try{await tt.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},uie={class:"h-[58px] border-b flex lg:justify-end justify-between items-center px-[20px]"},hie={class:"flex items-center gap-[6px]"},fie={href:"/docs-user",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},pie={class:"relative"},mie=["src"],gie={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},yie=["src"],bie={key:1,class:"flex items-center justify-center bg-gray-200 rounded-full size-10"},_ie={class:"grow"},xie={class:"block text-sm font-medium text-gray-800 dark:text-neutral-200"},vie={class:"text-xs text-gray-500 dark:text-neutral-500"},wie={class:"flex flex-col space-y-0.5"};function kie(t,e,n,r,i,s){var E,T,D,N;const a=h.resolveComponent("IconQuestion"),o=h.resolveComponent("AdminNotification"),p=h.resolveComponent("IconUser"),g=h.resolveComponent("router-link"),y=h.resolveComponent("IconUserOutline"),v=h.resolveComponent("IconLogout");return h.openBlock(),h.createElementBlock("div",uie,[h.createElementVNode("div",{class:"flex lg:hidden",onClick:e[0]||(e[0]=B=>t.$parent.showMenu=!0)},e[4]||(e[4]=[h.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l16 0"></path><path d="M4 12l16 0"></path><path d="M4 18l16 0"></path></svg>',1)])),h.createElementVNode("div",hie,[h.createElementVNode("a",fie,[h.createVNode(a,{height:"24",width:"24"})]),h.createVNode(o),e[9]||(e[9]=h.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),h.createElementVNode("div",pie,[h.createElementVNode("div",{onClick:e[1]||(e[1]=B=>i.isVisible=!0),class:"cursor-pointer"},[(T=(E=i.userData)==null?void 0:E.user)!=null&&T.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(N=(D=i.userData)==null?void 0:D.user)==null?void 0:N.avatar,alt:"Image Description"},null,8,mie)):(h.openBlock(),h.createElementBlock("div",gie,[h.createVNode(p)]))]),i.isVisible?(h.openBlock(),h.createElementBlock("div",{key:0,onClick:e[3]||(e[3]=h.withModifiers(()=>{},["stop"])),class:"fixed p-2 bg-white w-[240px] top-[55px] right-[20px] rounded-xl z-[1] shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:shadow-[0_10px_40px_10px_rgba(0,0,0,0.2)] dark:bg-neutral-900 block"},[h.createVNode(g,{to:"profile",disabled:!0,class:"py-2 px-2.5 flex items-center gap-3 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800"},{default:h.withCtx(()=>{var B,F,X,te,H,ke,ge,Se;return[(F=(B=i.userData)==null?void 0:B.user)!=null&&F.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"rounded-full shrink-0 size-10",src:(te=(X=i.userData)==null?void 0:X.user)==null?void 0:te.avatar,alt:"Image Description"},null,8,yie)):(h.openBlock(),h.createElementBlock("div",bie,[h.createVNode(p,{class:"w-[16px]"})])),h.createElementVNode("div",_ie,[h.createElementVNode("span",xie,h.toDisplayString(((ke=(H=i.userData)==null?void 0:H.user)==null?void 0:ke.username)||"User User"),1),h.createElementVNode("p",vie,h.toDisplayString(((Se=(ge=i.userData)==null?void 0:ge.user)==null?void 0:Se.email)||"email не вказано"),1)])]}),_:1}),e[7]||(e[7]=h.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),h.createElementVNode("ul",wie,[h.createElementVNode("li",null,[h.createVNode(g,{to:"profile",class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",disabled:"true"},{default:h.withCtx(()=>[h.createVNode(y,{class:"size-4"}),e[5]||(e[5]=h.createTextVNode(" Профіль "))]),_:1})])]),e[8]||(e[8]=h.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),h.createElementVNode("p",null,[h.createElementVNode("button",{type:"button",onClick:e[2]||(e[2]=(...B)=>s.logout&&s.logout(...B)),class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 hover:text-red-500 focus:outline-none focus:bg-gray-100 focus:text-red-500 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 dark:hover:text-red-500 dark:focus:text-red-500"},[h.createVNode(v,{class:"size-4"}),e[6]||(e[6]=h.createTextVNode(" Вийти "))])])])):h.createCommentVNode("",!0)])])])}const Eie={components:{navbar:cie,AdminHeader:Ve(die,[["render",kie]])},data(){return{showMenu:!1}},computed:{isMenu(){return bs.value||null},header(){var t;return((t=Vn.value)==null?void 0:t.header)||"admin-header"}}},Sie={class:"admin-wrapper"},Cie={class:"flex flex-col w-full"};function Tie(t,e,n,r,i,s){const a=h.resolveComponent("navbar"),o=h.resolveComponent("router-view");return h.openBlock(),h.createElementBlock("div",Sie,[h.createVNode(a),i.showMenu?(h.openBlock(),h.createElementBlock("div",{key:0,onClick:e[0]||(e[0]=p=>i.showMenu=!1),class:"z-[10] lg:hidden transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900"})):h.createCommentVNode("",!0),h.createElementVNode("div",Cie,[s.isMenu?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(s.header))),h.createVNode(o)],64)):h.createCommentVNode("",!0)])])}const Aie=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(Eie,[["render",Tie],["__scopeId","data-v-34da2042"]])},Symbol.toStringTag,{value:"Module"})),Mie={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},computed:{label(){var t,e;return((t=this.data)==null?void 0:t.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var t,e;return(e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(t){t!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(t){switch(t){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(t){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(t);const e=this.$route.query,{sort:n,...r}=e,i=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...r,...i&&{sort:i}}})},isValueEqualToSelected(t){return`${this.data.name}-${t}`===this.selectedSortParam}}},Die={scope:"col",class:"pe-2 py-1 text-start"},Iie={class:"w-[24px]"},Pie={key:1,class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200"};function Rie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("th",Die,[s.getVisibleIcon?(h.openBlock(),h.createElementBlock("button",{key:0,type:"button",class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200",onClick:e[0]||(e[0]=a=>s.handleClickSortBtn(i.currentSort))},[h.createTextVNode(h.toDisplayString(s.label)+" ",1),h.createElementVNode("span",Iie,[i.currentSort?(h.openBlock(),h.createElementBlock("svg",{key:0,class:h.normalizeClass(["shrink-0 size-3.5",{"rotate-180":i.currentSort==="asc"}]),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},e[1]||(e[1]=[h.createElementVNode("path",{d:"m5 12 7-7 7 7"},null,-1),h.createElementVNode("path",{d:"M12 19V5"},null,-1)]),2)):h.createCommentVNode("",!0)])])):(h.openBlock(),h.createElementBlock("p",Pie,h.toDisplayString(s.label),1))])}const Oie=Ve(Mie,[["render",Rie]]),Nie={components:{IconMore:Q_,IconDelete:tA,IconEdit:nA},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},computed:{getCustomActions(){return this.actions.filter(t=>typeof t=="object")}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var t;try{const{data:e}=await tt.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var t,e;try{const{data:n}=await tt.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);await tt.delete(`/api/table/${n==null?void 0:n.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch(n){this.$notify({title:"Помилка!",message:(e=n==null?void 0:n.response)==null?void 0:e.data,type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(t){var e,n;document.querySelector("body").click(),t!=null&&t.form?(await this.$v3plugin.$form({form:t==null?void 0:t.form,id:(e=this.item)==null?void 0:e.id,api:t==null?void 0:t.api,title:t==null?void 0:t.title}),await this.$emit("update-table")):await this.$v3plugin.$api({confirm:t==null?void 0:t.confirm,api:t==null?void 0:t.api,method:t==null?void 0:t.method,id:(n=this.item)==null?void 0:n.id,isId:(t==null?void 0:t.isId)||!1})}}},Bie={class:"inline-flex"},zie={class:"inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},Lie={class:"flex flex-col items-start"},Vie=["onClick"],Fie={class:"text-gray-800"},$ie={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},jie={class:"flex justify-end p-[16px] pr-0 gap-x-3"};function Hie(t,e,n,r,i,s){const a=h.resolveComponent("IconMore"),o=h.resolveComponent("IconEdit"),p=h.resolveComponent("router-link"),g=h.resolveComponent("IconDelete"),y=h.resolveComponent("VsPopover"),v=h.resolveComponent("VsConfirm");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",Bie,[h.createVNode(y,{trigger:"click",placement:"bottom-left"},{reference:h.withCtx(()=>[h.createElementVNode("button",zie,[h.createVNode(a,{height:"16",width:"16"})])]),default:h.withCtx(()=>{var E,T,D,N,B;return[h.createElementVNode("div",Lie,[(E=n.actions)!=null&&E.includes("edit")&&n.isForm?(h.openBlock(),h.createBlock(p,{key:0,to:`/edit?table=${(D=(T=t.$route)==null?void 0:T.params)==null?void 0:D.catchAll}&id=${(N=n.item)==null?void 0:N.id}`,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},{default:h.withCtx(()=>[h.createVNode(o,{color:"#000"}),e[4]||(e[4]=h.createTextVNode(" Редагувати "))]),_:1},8,["to"])):h.createCommentVNode("",!0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.getCustomActions,(F,X)=>(h.openBlock(),h.createElementBlock("button",{key:X,onClick:te=>s.customButtonAction(F),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(g,{class:"opacity-0"}),h.createElementVNode("span",Fie,h.toDisplayString(F==null?void 0:F.label),1)],8,Vie))),128)),n.isForm?(h.openBlock(),h.createElementBlock("div",$ie)):h.createCommentVNode("",!0),(B=n.actions)!=null&&B.includes("del")?(h.openBlock(),h.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=h.withModifiers((...F)=>s.openConfirm&&s.openConfirm(...F),["stop"])),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(g),e[5]||(e[5]=h.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):h.createCommentVNode("",!0)])]}),_:1})]),h.createVNode(v,{visible:i.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=E=>i.isDeleteConfirm=E),size:"small",title:"Ви впевнені?"},{default:h.withCtx(()=>[e[6]||(e[6]=h.createElementVNode("p",{class:"mt-1 text-sm text-gray-600 dark:text-neutral-400"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),h.createElementVNode("div",jie,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium duration-300 border rounded-lg shadow-sm hover:bg-gray-100 gap-x-2 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[1]||(e[1]=E=>i.isDeleteConfirm=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-white duration-300 bg-red-500 rounded-lg gap-x-2 hover:bg-red-700 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...E)=>s.deleteElement&&s.deleteElement(...E))}," Так, я впевнена(ий) ")])]),_:1},8,["visible"])],64)}const Uie=Ve(Nie,[["render",Hie]]),Wie={},qie={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Gie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",qie,e[0]||(e[0]=[h.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),h.createElementVNode("path",{d:"M7 20V4"},null,-1),h.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),h.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const Yie=Ve(Wie,[["render",Gie]]),Zie={},Xie={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-rosette-discount-check"};function Kie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Xie,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1"},null,-1),h.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const Jie={components:{IconExport:Yie,IconChevronDown:gv,IconSuccess:Ve(Zie,[["render",Kie]])},props:{table:String,columns:Array,page:[String,Number],filterCustom:String,filterState:String,filters:String},data(){return{isOpen:!1,tableFormats:["json","csv","xlsx"],format:"",cols:[],activeAction:"",isSuccessTemplate:!1,actions:[{name:"choceAll",function:this.choceAll,label:"Вибрати усі"},{name:"choceVisible",function:this.choceVisible,label:"Вибрати поточні"},{name:"clearAll",function:this.clearAll,label:"Жодного"}]}},watch:{isOpen(t){t||(this.format="",this.cols=[],this.activeAction="",this.isSuccessTemplate=!1)}},methods:{async exportTable(){var t;if(!((t=this.cols)!=null&&t.length)){this.$notify({type:"error",title:"Помилка",message:"Оберіть колонки для експорту!"});return}if(!this.format){this.$notify({type:"error",title:"Помилка",message:"Оберіть формат!"});return}try{const e=await tt.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||null,state:this.filterState||null,custom:this.filterCustom||null},responseType:"blob"}),n=await e.data.text(),r=n!=null&&n.includes(";")?null:JSON==null?void 0:JSON.parse(n),i=new Blob([e.data],{type:"application/octet-stream"}),s=window.URL.createObjectURL(i),a=document.createElement("a");if(a.href=s,a.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(a),typeof r=="string"){this.exportTable();return}a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(s),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"}),this.isSuccessTemplate=!0}catch(e){console.log(e),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(t){this.format=t},choceAll(){var t;this.cols=(t=this.columns)==null?void 0:t.map(e=>e==null?void 0:e.name),this.activeAction="choceAll"},clearAll(){this.cols=[],this.activeAction="clearAll"},choceVisible(){var t,e;this.cols=(e=(t=this.columns)==null?void 0:t.filter(n=>(n==null?void 0:n.hidden)!==!0))==null?void 0:e.map(n=>n==null?void 0:n.name),this.activeAction="choceVisible"}}},Qie={key:0,class:"flex flex-col items-center"},ese={key:1,class:"p-4"},tse={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},nse={class:"flex items-center gap-[10px] -ml-[10px] my-[10px]"},rse=["onClick"],ise={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},sse={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},ose={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},ase={class:"mt-2 space-y-2"},lse=["id","onChange"],cse=["for"],dse={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},use={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function hse(t,e,n,r,i,s){const a=h.resolveComponent("IconExport"),o=h.resolveComponent("IconSuccess"),p=h.resolveComponent("VsCheckbox"),g=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=y=>i.isOpen=!0),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(a,{height:"16",width:"16"}),e[7]||(e[7]=h.createTextVNode(" Експорт "))]),h.createVNode(g,{visible:i.isOpen,"onUpdate:visible":e[6]||(e[6]=y=>i.isOpen=y),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:h.withCtx(()=>[i.isSuccessTemplate?(h.openBlock(),h.createElementBlock("div",dse,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[2]||(e[2]=y=>i.isOpen=!1)}," Закрити "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[3]||(e[3]=y=>i.isSuccessTemplate=!1)}," Вигрузити ще ")])):(h.openBlock(),h.createElementBlock("div",use,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=y=>i.isOpen=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[5]||(e[5]=(...y)=>s.exportTable&&s.exportTable(...y))}," Завантажити таблицю ")]))]),default:h.withCtx(()=>[i.isSuccessTemplate?(h.openBlock(),h.createElementBlock("div",Qie,[h.createVNode(o,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=h.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(h.openBlock(),h.createElementBlock("div",ese,[h.createElementVNode("div",tse,[e[9]||(e[9]=h.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),h.createElementVNode("div",nse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.actions,y=>(h.openBlock(),h.createElementBlock("button",{key:y==null?void 0:y.name,onClick:y==null?void 0:y.function,class:"inline-flex items-center gap-[8px] justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border-gray-200 text-nowrap text-start"},[h.createElementVNode("span",{class:h.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(y==null?void 0:y.name)===i.activeAction}])},[(y==null?void 0:y.name)===i.activeAction?(h.openBlock(),h.createElementBlock("span",ise)):h.createCommentVNode("",!0)],2),h.createTextVNode(" "+h.toDisplayString(y==null?void 0:y.label),1)],8,rse))),128))]),h.createElementVNode("div",sse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.columns,(y,v)=>(h.openBlock(),h.createElementBlock("div",{class:"flex items-center",key:v,style:{width:"calc((100% - 10px) / 2)"}},[h.createVNode(p,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:i.cols,"onUpdate:modelValue":e[1]||(e[1]=E=>i.cols=E),value:y==null?void 0:y.name,label:y==null?void 0:y.ua},null,8,["modelValue","value","label"])]))),128))])]),h.createElementVNode("div",ose,[e[10]||(e[10]=h.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"},"Виберіть формат таблиці:",-1)),h.createElementVNode("div",ase,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.tableFormats,(y,v)=>(h.openBlock(),h.createElementBlock("div",{class:"flex items-center",key:v},[h.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"text-blue-600 border-gray-300 rounded-full shrink-0 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:y,onChange:E=>s.selectFormat(y)},null,40,lse),h.createElementVNode("label",{for:y,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+h.toDisplayString(y),9,cse)]))),128))])])]))]),_:1},8,["visible"])],64)}const fse=Ve(Jie,[["render",hse]]),pse={},mse={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-columns"};function gse(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",mse,e[0]||(e[0]=[h.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const yse=Ve(pse,[["render",gse]]),bse={props:{column:Object},emits:["update-column"],components:{IconCheck2:T0},data(){return{value:!1}},watch:{value(t){this.$emit("update-column",{...this.column,hidden:!t})}},mounted(){var t;((t=this.column)==null?void 0:t.hidden)!==!0&&(this.value=!0)}},_se={class:"flex justify-between items-center py-1.5 px-3 cursor-pointer rounded-lg hover:bg-gray-100 has-[:disabled]:opacity-50 has-[:disabled]:pointer-events-none dark:hover:bg-neutral-800"},xse={class:"flex justify-between flex-1 items-center gap-x-2.5 cursor-pointer text-[13px] text-gray-800 dark:text-neutral-300"};function vse(t,e,n,r,i,s){var o,p;const a=h.resolveComponent("IconCheck2");return h.openBlock(),h.createElementBlock("div",_se,[h.createElementVNode("label",xse,[h.createTextVNode(h.toDisplayString(((o=n.column)==null?void 0:o.ua)||((p=n.column)==null?void 0:p.title))+" ",1),h.withDirectives(h.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=g=>i.value=g),class:"hidden"},null,512),[[h.vModelCheckbox,i.value]]),h.createElementVNode("span",{class:h.normalizeClass(["flex items-center justify-center text-white border border-gray-300 rounded shrink-0 size-4 focus:ring-blue-500",[i.value?"bg-blue-600 border-0":"bg-white"]])},[h.createVNode(a,{height:"12",width:"12"})],2)])])}const wse={components:{IconColumns:yse,AdminTableColumnsHiddenItem:Ve(bse,[["render",vse]])},emits:["update-columns"],props:{columns:Array},data(){return{searchValue:"",visible:!1}},computed:{filteredColumn(){var t;return(t=this.columns)==null?void 0:t.filter(e=>{var n,r,i,s,a,o;return((i=(n=e==null?void 0:e.ua)==null?void 0:n.toLowerCase())==null?void 0:i.includes((r=this.searchValue)==null?void 0:r.toLowerCase()))||((o=(s=e==null?void 0:e.title)==null?void 0:s.toLowerCase())==null?void 0:o.includes((a=this.searchValue)==null?void 0:a.toLowerCase()))})}},methods:{toggleVisible(){this.visible=!this.visible,this.visible?document.addEventListener("click",this.handleClickOutside):document.removeEventListener("click",this.handleClickOutside)},handleClickOutside(t){const e=this.$refs.wrapper;e&&!e.contains(t.target)&&(this.visible=!1,document.removeEventListener("click",this.handleClickOutside))},updateColumn(t){const e=this.columns.findIndex(r=>(r==null?void 0:r.name)===(t==null?void 0:t.name)),n=this.columns;n[e]=t,this.$emit("update-columns",[...n])}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},kse={class:"relative",ref:"wrapper"},Ese={key:0,class:"absolute left-[50%] top-[110%] translate-x-[-50%] z-10 w-64 transition-[opacity,margin] duration bg-white rounded-xl shadow-lg dark:bg-neutral-900"},Sse={class:"relative p-1 border-gray-200 border-y dark:border-neutral-800"},Cse={class:"p-1 pt-3 max-h-80 overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Tse={key:0,class:"block px-3 mb-2 text-xs text-gray-500 dark:text-neutral-500"},Ase={class:"space-y-1"},Mse={key:1,class:"flex items-center px-3 text-[13px] py-1.5 px-3 rounded-md cursor-pointer group"};function Dse(t,e,n,r,i,s){const a=h.resolveComponent("IconColumns"),o=h.resolveComponent("AdminTableColumnsHiddenItem");return h.openBlock(),h.createElementBlock("div",kse,[h.createElementVNode("button",{onClick:e[0]||(e[0]=(...p)=>s.toggleVisible&&s.toggleVisible(...p)),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(a,{height:"20",width:"16"})]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var p,g;return[i.visible?(h.openBlock(),h.createElementBlock("div",Ese,[e[2]||(e[2]=h.createElementVNode("div",{class:"flex items-center justify-between h-[48px] px-4 py-2 gap-x-2 text-sm font-medium text-gray-800"}," Колонки ",-1)),h.createElementVNode("div",Sse,[h.withDirectives(h.createElementVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=y=>i.searchValue=y),type:"text",class:"py-1.5 px-3 block w-full border-transparent rounded-lg sm:text-sm text-base placeholder:text-gray-500 hover:bg-gray-100 focus:outline-none focus:border-transparent focus:ring-0 focus:bg-gray-100 disabled:opacity-100 disabled:pointer-events-none dark:bg-transparent dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:ring-neutral-600 dark:focus:bg-neutral-800",placeholder:"Search",autofocus:""},null,512),[[h.vModelText,i.searchValue]])]),h.createElementVNode("div",Cse,[(p=s.filteredColumn)!=null&&p.length?(h.openBlock(),h.createElementBlock("span",Tse," Оберіть колонки для відображення ")):h.createCommentVNode("",!0),h.createElementVNode("div",Ase,[(g=s.filteredColumn)!=null&&g.length?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(s.filteredColumn,(y,v)=>(h.openBlock(),h.createBlock(o,{key:v,column:y,onUpdateColumn:s.updateColumn},null,8,["column","onUpdateColumn"]))),128)):(h.openBlock(),h.createElementBlock("div",Mse," Нічого не знайдено "))])])])):h.createCommentVNode("",!0)]}),_:1})],512)}const Ise=Ve(wse,[["render",Dse]]),Pse={},Rse={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus"};function Ose(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Rse,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const Nse={components:{IconPlus:Qh,IconMinus:Ve(Pse,[["render",Ose]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},Bse={class:"hs-accordion"},zse={class:"py-0.5 flex items-center gap-x-0.5 w-full"},Lse={class:"text-sm font-medium"},Vse={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function Fse(t,e,n,r,i,s){const a=h.resolveComponent("IconPlus"),o=h.resolveComponent("IconMinus");return h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("div",null,[h.createElementVNode("div",Bse,[h.createElementVNode("div",zse,[h.createElementVNode("div",{onClick:e[0]||(e[0]=p=>i.expanded=!i.expanded),class:"rounded-md cursor-pointer grow"},[h.createElementVNode("span",Lse,h.toDisplayString(n.title),1)]),h.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=p=>i.expanded=!i.expanded)},[i.expanded?(h.openBlock(),h.createBlock(o,{key:1,width:"14"})):(h.openBlock(),h.createBlock(a,{key:0}))])]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",Vse,[h.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[h.vShow,i.expanded]])]),_:3})])])])}const $se={components:{AdminComponentIs:ef,AdminTree:Ve(Nse,[["render",Fse],["__scopeId","data-v-c6318482"]]),VsNoData:tI,VsWidgetComments:JT,VsWidgetMap:lb,VsWidgetFileList:h2},props:{table:String,columns:Array,row:Object}},jse={class:"hs-accordion border-gray-100 w-[360px] shrink-0 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:{height:"calc(100vh - 310px)"}},Hse={class:"border-l",style:{height:"calc(100vh - 360px)"}},Use={class:"flow-root mt-[10px]"},Wse={class:"-my-3 text-sm divide-y divide-gray-100"},qse={class:"flex py-3 sm:grid-cols-3 sm:gap-4"},Gse={class:"font-medium text-black w-[50%]"},Yse={class:"text-gray-700 sm:col-span-2 w-[50%]"},Zse={class:"table-info-card"},Xse={class:"table-info-card"};function Kse(t,e,n,r,i,s){var E,T,D;const a=h.resolveComponent("AdminComponentIs"),o=h.resolveComponent("AdminTree"),p=h.resolveComponent("VsWidgetMap"),g=h.resolveComponent("VsNoData"),y=h.resolveComponent("VsWidgetComments"),v=h.resolveComponent("VsWidgetFileList");return h.openBlock(),h.createElementBlock("div",jse,[e[0]||(e[0]=h.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[h.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),h.createElementVNode("div",Hse,[(T=(E=t.$route)==null?void 0:E.query)!=null&&T.card?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[n.row?(h.openBlock(),h.createBlock(o,{key:0,defaultValue:!0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>[h.createElementVNode("div",Use,[h.createElementVNode("dl",Wse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.columns,N=>(h.openBlock(),h.createElementBlock("div",qse,[h.createElementVNode("dt",Gse,h.toDisplayString((N==null?void 0:N.ua)||(N==null?void 0:N.title)),1),h.createElementVNode("dd",Yse,[h.createVNode(a,{row:n.row,column:N,table:n.table},null,8,["row","column","table"])])]))),256))])])]),_:1})):h.createCommentVNode("",!0),(D=n.row)!=null&&D.geom?(h.openBlock(),h.createBlock(o,{key:1,title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N,B;return[(N=n.row)!=null&&N.geom?(h.openBlock(),h.createBlock(p,{key:0,geometry:(B=n.row)==null?void 0:B.geom,zoom:14},null,8,["geometry"])):(h.openBlock(),h.createBlock(g,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1})):h.createCommentVNode("",!0),h.createVNode(o,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N;return[h.createElementVNode("div",Zse,[h.createVNode(y,{id:(N=n.row)==null?void 0:N.id},null,8,["id"])])]}),_:1}),h.createVNode(o,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N,B;return[h.createElementVNode("div",Xse,[(h.openBlock(),h.createBlock(v,{key:(N=n.row)==null?void 0:N.id,id:(B=n.row)==null?void 0:B.id},null,8,["id"]))])]}),_:1})],64)):(h.openBlock(),h.createBlock(g,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const Jse=Ve($se,[["render",Kse]]),Qse={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number},table:{type:String}},components:{IconFilter:rA},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},eoe={key:0,class:"px-[7px] text-[10px] py-[1px] font-[700] text-white bg-blue-500 rounded-full"},toe={class:"filter-content h-screen bg-white w-[400px] overflow-x-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function noe(t,e,n,r,i,s){const a=h.resolveComponent("IconFilter"),o=h.resolveComponent("VsFilter");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=p=>i.isFilters=!i.isFilters),class:"py-2 px-2.5 max-h-[34px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none"},[h.createVNode(a,{height:"16",width:"16"}),e[4]||(e[4]=h.createTextVNode(" Фільтри ")),n.onFilters?(h.openBlock(),h.createElementBlock("span",eoe,h.toDisplayString(n.onFilters),1)):h.createCommentVNode("",!0)]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var p;return[(h.openBlock(),h.createBlock(h.Teleport,{to:"#modal"},[h.withDirectives(h.createElementVNode("div",{onClick:e[3]||(e[3]=(...g)=>s.closeFilter&&s.closeFilter(...g)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[12] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.2)]"},[h.createElementVNode("div",toe,[(p=n.scheme)!=null&&p.length?(h.openBlock(),h.createBlock(o,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",token:n.table,name:"filter",footer:!0,background:!0,onFilterChange:e[1]||(e[1]=g=>t.$emit("filterChange",g)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=g=>i.isFilters=!1)},null,8,["scheme","token"])):h.createCommentVNode("",!0)])],512),[[h.vShow,i.isFilters]])]))]}),_:1})],64)}const roe=Ve(Qse,[["render",noe]]),ioe={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},soe={class:"relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700","aria-label":"Tabs",role:"tablist","aria-orientation":"horizontal"},ooe=["onClick"];function aoe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("nav",soe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.tabsList,a=>(h.openBlock(),h.createElementBlock("button",{onClick:o=>t.$emit("update:filterState",a==null?void 0:a.name),class:h.normalizeClass(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active",{" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":(a==null?void 0:a.name)===n.filterState}])},h.toDisplayString(a==null?void 0:a.label),11,ooe))),256))])}const loe=Ve(ioe,[["render",aoe]]),coe={},doe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-filter"};function uoe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",doe,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const hoe={components:{IconFilter2:Ve(coe,[["render",uoe]]),IconCheck2:T0},props:{filterCustom:String,customList:Array}},foe={class:"py-2 max-h-[34px] px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},poe={class:"flex flex-col p-[2px] gap-[2px] w-[170px]"},moe=["onClick"],goe={class:"text-sm text-gray-800"};function yoe(t,e,n,r,i,s){const a=h.resolveComponent("IconFilter2"),o=h.resolveComponent("IconCheck2"),p=h.resolveComponent("VsPopover");return h.openBlock(),h.createBlock(p,{ref:"popover",placement:"bottom"},{reference:h.withCtx(()=>[h.createElementVNode("button",foe,[h.createVNode(a,{height:"20",width:"20"})])]),default:h.withCtx(()=>[h.createElementVNode("div",poe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.customList,(g,y)=>(h.openBlock(),h.createElementBlock("button",{onClick:v=>{var E;t.$emit("update:filterCustom",g==null?void 0:g.name),(E=t.$refs)==null||E.popover.togglePopover()},key:y,class:h.normalizeClass(["flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",{"bg-gray-100":n.filterCustom===(g==null?void 0:g.name)}])},[h.createElementVNode("span",goe,h.toDisplayString(g==null?void 0:g.label),1),n.filterCustom===(g==null?void 0:g.name)?(h.openBlock(),h.createBlock(o,{key:0,class:"ml-auto size-3 shrink-0"})):h.createCommentVNode("",!0)],10,moe))),128)),h.createElementVNode("button",{class:"flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",onClick:e[0]||(e[0]=g=>{var y;t.$emit("update:filterCustom",void 0),(y=t.$refs)==null||y.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const boe=Ve(hoe,[["render",yoe]]),_oe={class:"flex items-center gap-x-2"},xoe={__name:"admin-table-custom-buttons",props:{slots:Object},setup(t){var o,p,g,y,v;const{asyncTemplateSlot:e}=(v=(y=(g=(p=(o=h.getCurrentInstance())==null?void 0:o.appContext)==null?void 0:p.app)==null?void 0:g.config)==null?void 0:y.globalProperties)==null?void 0:v.utils,n=h.ref(""),r=h.ref(""),i=t,s=()=>{var E,T,D,N,B;if((E=i.slots)!=null&&E.panelLeft||(r.value="div"),(D=(T=i.slots)==null?void 0:T.panelLeft)!=null&&D.includes("<")){const F=e("PanelLeft",(N=i.slots)==null?void 0:N.panelLeft,["name"]);r.value=F}else r.value=(B=i.slots)==null?void 0:B.panelLeft},a=()=>{var E,T,D,N,B;if((E=i.slots)!=null&&E.panelRight||(n.value="div"),(D=(T=i.slots)==null?void 0:T.panelRight)!=null&&D.includes("<")){const F=e("PanelRight",(N=i.slots)==null?void 0:N.panelRight,["name"]);n.value=F}else n.value=(B=i.slots)==null?void 0:B.panelRight};return s(),a(),(E,T)=>(h.openBlock(),h.createElementBlock("div",_oe,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(r.value))),(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.value)))]))}},voe=(t,e=300)=>{let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}},woe={__name:"admin-custom-button-add",props:{slots:Object},setup(t){var s,a,o,p,g;const{asyncTemplateSlot:e}=(g=(p=(o=(a=(s=h.getCurrentInstance())==null?void 0:s.appContext)==null?void 0:a.app)==null?void 0:o.config)==null?void 0:p.globalProperties)==null?void 0:g.utils,n=h.ref(""),r=t;return(()=>{var y,v,E,T,D;if((y=r.slots)!=null&&y.addButton||(n.value="div"),(E=(v=r.slots)==null?void 0:v.addButton)!=null&&E.includes("<")){const N=e("addButton",(T=r.slots)==null?void 0:T.addButton,["IconPlus"]);n.value=N}else n.value=(D=r.slots)==null?void 0:D.addButton})(),(y,v)=>n.value?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.value),{key:0,IconPlus:Qh})):h.createCommentVNode("",!0)}},koe={key:0,class:"px-1 py-3 text-gray-800 font-[500]"},Eoe={key:1,class:"px-1 py-3 text-gray-800 font-[700]"},Soe={__name:"admin-table-totals-list",props:{columns:{type:Array,default:()=>[]},agg:{type:Object,default:()=>{}}},setup(t){return(e,n)=>(h.openBlock(),h.createElementBlock("tr",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.columns,r=>{var i;return h.openBlock(),h.createElementBlock(h.Fragment,{key:r==null?void 0:r.name},[(i=t.agg)!=null&&i[r==null?void 0:r.name]?(h.openBlock(),h.createElementBlock("td",koe,[h.createVNode(ef,{column:r,row:t.agg},null,8,["column","row"])])):(h.openBlock(),h.createElementBlock("td",Eoe))],64)}),128))]))}},Coe={},Toe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function Aoe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Toe,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Moe=Ve(Coe,[["render",Aoe]]),Doe={},Ioe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function Poe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Ioe,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Roe=Ve(Doe,[["render",Poe]]),Ooe=h.defineComponent({components:{IconChevronDown:Moe,IconCheck:Roe},props:{total:{type:Number,default:()=>0},pageSize:{type:Number,default:()=>20},maxPages:{type:Number,default:()=>10},defaultPage:{type:Number,default:()=>1},pageSizes:{type:Array,default:[]}},data(){return{page:1,pages:[],isDropdownOpen:!1,pageSizeLocal:null}},mounted(){this.pageSizeLocal=this.pageSize},watch:{total:{immediate:!0,handler(){this.initPages()}},defaultPage:{immediate:!0,handler(t){this.page=t,this.updatePages(t)}},pageSizeLocal(t,e){e&&(this.isDropdownOpen=!1,this.setCurrentPage(1))}},computed:{pagesCount(){return Math.ceil(this.total/this.pageSizeLocal)},disableNextClick(){return this.page>=this.pagesCount},disablePrevClick(){return this.page<=1}},methods:{initPages(){if(this.total<=0){this.pages=[1];return}this.updatePages(this.page)},handleSetPage(t){const e=t.replace(/\D/g,"");if(e>this.pagesCount){this.$refs.currentPage.innerText=this.page;return}else this.$refs.currentPage.innerText=e;this.setCurrentPage(e)},updatePages(t){const e=Math.floor(this.maxPages/2);let n=Math.max(t-e,1),r=n+this.maxPages-1;r>this.pagesCount&&(r=this.pagesCount,n=Math.max(r-this.maxPages+1,1)),this.pages=Array.from({length:r-n+1},(i,s)=>n+s)},handleClickPrev(){this.disablePrevClick||(this.setCurrentPage(this.page-1),this.updatePages(this.page),this.$emit("prevClick"))},handleClickNext(){this.disableNextClick||(this.setCurrentPage(parseInt(this.page)+1),this.updatePages(this.page),this.$emit("nextClick"))},setCurrentPage(t){t<1||t>this.pagesCount||this.page===t||(this.page=t,this.$emit("pageChange",this.page,this.pageSizeLocal),this.updatePages(t))}}}),Noe={class:"flex items-center w-full"},Boe={class:"flex items-center mx-[8px]"},zoe={class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},Loe={key:0,class:"flex items-center justify-center ml-3 gap-x-5"},Voe={class:"relative"},Foe={class:"z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 dark:divide-neutral-700 absolute bottom-[100%]"},$oe=["onClick"];function joe(t,e,n,r,i,s){const a=h.resolveComponent("IconChevronDown"),o=h.resolveComponent("IconCheck");return h.openBlock(),h.createElementBlock("nav",Noe,[h.createElementVNode("button",{type:"button",onClick:e[0]||(e[0]=(...p)=>t.handleClickPrev&&t.handleClickPrev(...p)),class:h.normalizeClass(["min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",{"opacity-50 pointer-events-none":t.disablePrevClick}])},[h.createVNode(a,{height:"16",width:"16",class:"rotate-90"})],2),h.createElementVNode("div",Boe,[h.createElementVNode("span",{ref:"currentPage",contenteditable:"true",onBlur:e[1]||(e[1]=p=>t.handleSetPage(p.target.innerText)),class:"min-h-[38px] max-h-[38px] overflow-hidden min-w-[38px] flex justify-center items-center bg-stone-100 text-stone-800 py-2 px-3 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:text-white"},h.toDisplayString(t.page),545),e[4]||(e[4]=h.createElementVNode("span",{class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},"з",-1)),h.createElementVNode("span",zoe,h.toDisplayString(t.pagesCount),1)]),h.createElementVNode("button",{type:"button",onClick:e[2]||(e[2]=(...p)=>t.handleClickNext&&t.handleClickNext(...p)),class:h.normalizeClass([{"opacity-50 pointer-events-none":t.disableNextClick},"min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"])},[h.createVNode(a,{height:"16",width:"16",class:"-rotate-90"})],2),t.pageSizes.length?(h.openBlock(),h.createElementBlock("div",Loe,[h.createElementVNode("div",Voe,[h.withDirectives(h.createElementVNode("div",Foe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.pageSizes,p=>(h.openBlock(),h.createElementBlock("button",{type:"button",class:"w-full flex items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm",onClick:g=>t.pageSizeLocal=p},[h.createTextVNode(h.toDisplayString(p)+" ",1),p===t.pageSizeLocal?(h.openBlock(),h.createBlock(o,{key:0,width:"14",height:"14",class:"text-blue-600"})):h.createCommentVNode("",!0)],8,$oe))),256))],512),[[h.vShow,t.isDropdownOpen]]),t.pageSizes.length?(h.openBlock(),h.createElementBlock("button",{key:0,type:"button",class:"text-sm h-[32px] min-w-8 py-3 px-3.5 inline-flex items-center gap-x-1 rounded-lg border border-gray-200 text-gray-800 shadow-sm hover:bg-gray-50 focus:outline-none focus:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[3]||(e[3]=p=>t.isDropdownOpen=!t.isDropdownOpen)},[h.createTextVNode(h.toDisplayString(t.pageSizeLocal)+" ",1),h.createVNode(a,{height:"16",width:"16"})])):h.createCommentVNode("",!0)])])):h.createCommentVNode("",!0)])}const Hoe={props:{table:String,title:String},components:{AdminTableControl:Uie,AdminTableExport:fse,AdminTableColumnsHidden:Ise,AdminTableColumn:Oie,AdminNodata:tx,IconPlus:Qh,IconSearch:mv,AdminTableCardInfo:Jse,IconOpenCard:QD,AdminComponentIs:ef,AdminTableFilters:roe,AdminTableTabs:loe,AdminTableCustomFilters:boe,AdminTableCustomButtons:xoe,AdminCustomButtonAdd:woe,AdminTableTotalsList:Soe,AdminTablePagination:Ve(Ooe,[["render",joe]])},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null,visibleColumns:[],initialHiddenColumns:""}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters(),window.addEventListener("reloadTablePage",this.getTableData)},unmounted(){window.removeEventListener("reloadTablePage",this.getTableData)},computed:{defaultPage(){var t,e;return((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1},columns(){var t,e;return(e=(t=this.tableData)==null?void 0:t.columns)==null?void 0:e.filter(n=>(n==null?void 0:n.hidden)!==!0)},isForm(){var t,e,n;return((t=this.tableData)==null?void 0:t.form)&&((n=(e=this.tableData)==null?void 0:e.actions)==null?void 0:n.includes("add"))},isNoData(){var t,e;return!((t=this.tableData)!=null&&t.rows)||!((e=this.columns)!=null&&e.length)},activeCardRow(){var t,e;return((e=(t=this.tableData)==null?void 0:t.rows)==null?void 0:e.find(n=>{var r,i;return(n==null?void 0:n.id)===((i=(r=this.$route)==null?void 0:r.query)==null?void 0:i.card)}))||{}},getActions(){var t;return(t=this.tableData)==null?void 0:t.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue:{handler:voe(async function(t){var e;await this.getTableData(),this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,search:t||void 0}})},500)},$route:{handler(t,e){var n,r;((n=t==null?void 0:t.params)==null?void 0:n.catchAll)!==((r=e==null?void 0:e.params)==null?void 0:r.catchAll)&&(this.visibleColumns=[],this.unmountedData(),this.getFilters())},deep:!0},limit(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,limit:t}})},filterState(t){var e;t&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterState:t}}),this.getTableData())},filterCustom(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,custom:t}}),this.getTableData()},columns(t){var e,n,r,i;this.visibleColumns=t==null?void 0:t.map(s=>s==null?void 0:s.name),this.initialHiddenColumns===((e=this.visibleColumns)==null?void 0:e.join(","))&&(this.visibleColumns=[]),this.$router.replace({...this.$route,query:{...(n=this.$route)==null?void 0:n.query,columns:(r=this.visibleColumns)!=null&&r.length?(i=this.visibleColumns)==null?void 0:i.join(","):void 0}})}},methods:{async checkUrlMounted(){var t,e,n,r,i,s,a,o,p,g,y,v,E,T,D,N,B,F,X;this.page=((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1,this.limit=((r=(n=this.$route)==null?void 0:n.query)==null?void 0:r.limit)||20,this.filters=((a=decodeURI((s=(i=this.$route)==null?void 0:i.query)==null?void 0:s.filter))==null?void 0:a.replaceAll("+"," "))||null,this.filters&&(this.onFilters=((p=(o=this.filters)==null?void 0:o.split("="))==null?void 0:p.length)-1),this.filterState=((y=(g=this.$route)==null?void 0:g.query)==null?void 0:y.filterState)||null,this.filterCustom=((E=(v=this.$route)==null?void 0:v.query)==null?void 0:E.custom)||null,this.searchValue=((D=(T=this.$route)==null?void 0:T.query)==null?void 0:D.search)||"",this.visibleColumns=((F=(B=(N=this.$route)==null?void 0:N.query)==null?void 0:B.columns)==null?void 0:F.split(","))||[],(X=this.$route)!=null&&X.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(t){var n,r;const e=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.find(i=>i.name===t);if(e){const i=e==null?void 0:e.width;return typeof i=="number"?`${i}px`:i!=null&&i.includes("px")?i:`${i}px`}},unmountedData(){this.page=1,this.visibleColumns=[],this.filterCustom=null,this.filterState=null,this.isVisibleCardInfo=!1,this.filterScheme=null,this.filters=null,this.onFilters=0,this.searchValue=""},async getTableData(){var t,e,n,r,i,s,a,o,p,g,y;try{const{data:v}=await tt.get(`/api/template/table/${this.table}`),E=await tt.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...v,...(E==null?void 0:E.data)||{}},this.initialHiddenColumns=(s=(i=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.filter(T=>(T==null?void 0:T.hidden)!==!0))==null?void 0:i.map(T=>T==null?void 0:T.name))==null?void 0:s.join(","),(a=this.visibleColumns)!=null&&a.length?(o=this.tableData)==null||o.columns.forEach(T=>{var D;(D=this.visibleColumns)!=null&&D.includes(T==null?void 0:T.name)?T.hidden=!1:T.hidden=!0}):this.visibleColumns=(y=(g=(p=this.tableData)==null?void 0:p.columns)==null?void 0:g.filter(T=>(T==null?void 0:T.hidden)!==!0))==null?void 0:y.map(T=>T==null?void 0:T.name)}catch{}},async getFilters(){var t;try{const{data:e}=await tt.get(`/api/table-filter/${this.table}`);this.filterScheme=(t=e==null?void 0:e.list)==null?void 0:t.map(n=>({...n,label:(n==null?void 0:n.label)||(n==null?void 0:n.ua)}))}catch{}},async handlePageChange(t,e){const n=this.$route.query;this.page=t,await this.$router.replace({query:{...n,page:t,limit:e}}),await this.getTableData()},async filterChange({url:t,state:e}){var n;this.filters=t!=="no-url"?t:null,this.onFilters=(n=Object.entries(e))==null?void 0:n.length,this.page=1,await this.getTableData()},changeActiveColumn(t){this.activeColumn=t,this.getTableData()},pushToCard(t){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${t}`)},pushToLinkCard(t,e){t!=null&&t.link&&this.$router.push(`/card/${t==null?void 0:t.link}/${e==null?void 0:e[t==null?void 0:t.name]}`)},changeActiveCardInfo(t){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:t}})},toggleCardInfo(){var t;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,card:void 0}})},getCustomStyles(t){return[t!=null&&t.link?" text-blue-600 hover:underline decoration-2":"",t!=null&&t.align?` text-${(t==null?void 0:t.align)||"left"}`:"",`text-${(t==null?void 0:t.wrap)||"wrap"}`]}}},Uoe={class:"w-[calc(100vw - 320px)] bg-gray-50"},Woe={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},qoe={class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"},Goe={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"},Yoe={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},Zoe={class:"flex"},Xoe={class:"flex gap-[6px] ml-auto"},Koe={class:"inline-block w-full align-middle"},Joe={key:0,class:"relative min-w-full text-[13px] divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"},Qoe={class:"sticky top-[-1px] z-[2] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},eae={class:"right-0"},tae={key:0,class:"w-[70px] sticky right-0 top-0"},nae={class:"divide-y divide-gray-200 z-[1] relative"},rae=["onClick"],iae=["onClick"],sae={class:"p-[10px] flex justify-start items-center w-full"},oae={class:"w-[200px] md:inline-flex hidden"},aae={class:"text-sm text-gray-600 dark:text-neutral-400"},lae={class:"font-semibold text-gray-800 dark:text-neutral-200"},cae={key:0},dae={key:0,class:"font-semibold text-gray-800 dark:text-neutral-200"};function uae(t,e,n,r,i,s){var Ne,at,Je,mt,nt,Ct,$t,jt,Ot,qt,wn,yn,An,bn,fr,Hn,zn,Un,Ae,Ue,Xe,ct,Ht,rn,Pt,It,cn;const a=h.resolveComponent("AdminCustomButtonAdd"),o=h.resolveComponent("IconPlus"),p=h.resolveComponent("router-link"),g=h.resolveComponent("AdminTableTabs"),y=h.resolveComponent("IconSearch"),v=h.resolveComponent("VsText"),E=h.resolveComponent("AdminTableCustomButtons"),T=h.resolveComponent("AdminTableCustomFilters"),D=h.resolveComponent("AdminTableColumnsHidden"),N=h.resolveComponent("AdminTableExport"),B=h.resolveComponent("AdminTableFilters"),F=h.resolveComponent("IconOpenCard"),X=h.resolveComponent("AdminTableColumn"),te=h.resolveComponent("AdminComponentIs"),H=h.resolveComponent("AdminTableControl"),ke=h.resolveComponent("AdminTableTotalsList"),ge=h.resolveComponent("AdminNodata"),Se=h.resolveComponent("AdminTablePagination"),Pe=h.resolveComponent("AdminTableCardInfo");return h.openBlock(),h.createElementBlock("div",Uoe,[h.createElementVNode("div",Woe,[h.createElementVNode("h2",qoe,h.toDisplayString(n.title),1),s.isForm?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(at=(Ne=i.tableData)==null?void 0:Ne.slots)!=null&&at.addButton?(h.openBlock(),h.createBlock(a,{key:0,slots:(Je=i.tableData)==null?void 0:Je.slots},null,8,["slots"])):(h.openBlock(),h.createBlock(p,{key:1,to:`/add?table=${(nt=(mt=t.$route)==null?void 0:mt.params)==null?void 0:nt.catchAll}`,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:h.withCtx(()=>[h.createVNode(o,{height:"16",width:"16"}),e[5]||(e[5]=h.createTextVNode(" Додати "))]),_:1},8,["to"]))],64)):h.createCommentVNode("",!0)]),h.createElementVNode("div",Goe,[h.createElementVNode("div",Yoe,[($t=(Ct=i.tableData)==null?void 0:Ct.filterState)!=null&&$t.length?(h.openBlock(),h.createBlock(g,{key:0,tabsList:(jt=i.tableData)==null?void 0:jt.filterState,filterState:i.filterState,"onUpdate:filterState":e[0]||(e[0]=me=>i.filterState=me)},null,8,["tabsList","filterState"])):h.createCommentVNode("",!0),h.createElementVNode("div",Zoe,[h.createElementVNode("div",{class:h.normalizeClass([i.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[h.createElementVNode("div",{class:h.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!i.isVisibleCardInfo}])},[h.createVNode(y,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),h.createVNode(v,{modelValue:i.searchValue,"onUpdate:modelValue":e[1]||(e[1]=me=>i.searchValue=me),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>input]:max-h-[36px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"},null,8,["modelValue"]),h.createElementVNode("div",Xoe,[(Ot=i.tableData)!=null&&Ot.slots?(h.openBlock(),h.createBlock(E,{key:0,slots:(qt=i.tableData)==null?void 0:qt.slots},null,8,["slots"])):h.createCommentVNode("",!0),(yn=(wn=i.tableData)==null?void 0:wn.filterCustom)!=null&&yn.length?(h.openBlock(),h.createBlock(T,{key:1,customList:(An=i.tableData)==null?void 0:An.filterCustom,filterCustom:i.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=me=>i.filterCustom=me)},null,8,["customList","filterCustom"])):h.createCommentVNode("",!0),h.createVNode(D,{columns:(bn=i.tableData)==null?void 0:bn.columns,onUpdateColumns:e[3]||(e[3]=me=>i.tableData.columns=me)},null,8,["columns"]),((fr=i.tableData)==null?void 0:fr.export)!==!1?(h.openBlock(),h.createBlock(N,{key:2,table:n.table,columns:(Hn=i.tableData)==null?void 0:Hn.columns,page:i.page,"filter-state":i.filterState,"filter-custom":i.filterCustom,filters:i.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"])):h.createCommentVNode("",!0),(zn=i.filterScheme)!=null&&zn.length?(h.openBlock(),h.createBlock(B,{key:3,scheme:i.filterScheme,onFilters:i.onFilters,table:n.table,onFilterChange:s.filterChange},null,8,["scheme","onFilters","table","onFilterChange"])):h.createCommentVNode("",!0),h.createElementVNode("button",{onClick:e[4]||(e[4]=(...me)=>s.toggleCardInfo&&s.toggleCardInfo(...me)),class:"py-2 px-2.5 max-h-[34px] md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(F,{class:h.normalizeClass({"rotate-180 duration-300":!i.isVisibleCardInfo})},null,8,["class"])])])],2),h.createElementVNode("div",{class:h.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!i.isVisibleCardInfo}])},[h.createElementVNode("div",{style:h.normalizeStyle({height:(Ae=(Un=i.tableData)==null?void 0:Un.filterState)!=null&&Ae.length?"calc(100vh - 370px)":"calc(100vh - 330px)"}),class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[h.createElementVNode("div",Koe,[s.isNoData?(h.openBlock(),h.createBlock(ge,{key:1})):(h.openBlock(),h.createElementBlock("table",Joe,[h.createElementVNode("thead",Qoe,[h.createElementVNode("tr",eae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.columns,me=>(h.openBlock(),h.createBlock(X,{key:me.name,style:h.normalizeStyle({width:s.rowWidth(me==null?void 0:me.name),textAlign:me==null?void 0:me.align,wordBreak:me==null?void 0:me.wrap}),data:me,activeColumn:i.activeColumn,onChangeActive:s.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),(Xe=(Ue=s.getActions)==null?void 0:Ue.filter(me=>me!=="add"&&me!=="view"))!=null&&Xe.length?(h.openBlock(),h.createElementBlock("th",tae)):h.createCommentVNode("",!0)])]),h.createElementVNode("tbody",nae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((ct=i.tableData)==null?void 0:ct.rows,(me,En)=>{var Di,Zt,dn,Rr,Or,yr,ri,br,Ii,Pi,$e,ii;return h.openBlock(),h.createElementBlock("tr",{key:(me==null?void 0:me.id)||En,class:h.normalizeClass({"bg-gray-50":((Zt=(Di=t.$route)==null?void 0:Di.query)==null?void 0:Zt.card)===(me==null?void 0:me.id)})},[h.createElementVNode("td",{class:h.normalizeClass(["px-1 py-3 text-gray-600 pe-4",[(dn=s.columns[0])!=null&&dn.align?`text-${((Rr=s.columns[0])==null?void 0:Rr.align)||"left"}`:""]])},[h.createElementVNode("button",{onClick:Wn=>{s.pushToCard(me==null?void 0:me.id),s.pushToLinkCard(s.columns[0],me)},class:h.normalizeClass(["font-medium",[...s.getCustomStyles(s.columns[0]),((Or=this.tableData)==null?void 0:Or.card)===!1?"":" text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[h.createVNode(te,{row:me,column:s.columns[0],table:n.table,onUpdateTable:s.getTableData},null,8,["row","column","table","onUpdateTable"])],10,rae)],2),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((yr=s.columns)==null?void 0:yr.slice(1),Wn=>(h.openBlock(),h.createElementBlock("td",{onClick:Ri=>{s.changeActiveCardInfo(me==null?void 0:me.id),s.pushToLinkCard(Wn,me)},class:h.normalizeClass(["px-1 py-3 text-gray-600 pe-3",s.getCustomStyles(Wn)]),key:Wn.name},[h.createVNode(te,{row:me,column:Wn,table:n.table,onUpdateTable:s.getTableData},null,8,["row","column","table","onUpdateTable"])],10,iae))),128)),(br=(ri=s.getActions)==null?void 0:ri.filter(Wn=>Wn!=="add"&&Wn!=="view"))!=null&&br.length?(h.openBlock(),h.createElementBlock("td",{key:0,class:h.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((Pi=(Ii=t.$route)==null?void 0:Ii.query)==null?void 0:Pi.card)===(me==null?void 0:me.id),"bg-white":((ii=($e=t.$route)==null?void 0:$e.query)==null?void 0:ii.card)!==(me==null?void 0:me.id)}])},[h.createVNode(H,{actions:s.getActions,isForm:s.isForm,item:me,table:n.table,onUpdateTable:s.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):h.createCommentVNode("",!0)],2)}),128))]),h.createVNode(ke,{columns:s.columns,agg:(Ht=i.tableData)==null?void 0:Ht.agg},null,8,["columns","agg"])]))])],4)],2),h.createElementVNode("div",sae,[h.createElementVNode("div",oae,[h.createElementVNode("p",aae,[h.createElementVNode("span",lae,[h.createTextVNode(h.toDisplayString(i.filters||i.searchValue?"Відображено":"Об'єктів")+" "+h.toDisplayString(((rn=i.tableData)==null?void 0:rn.count)||"0 ")+" ",1),i.filters||i.searchValue?(h.openBlock(),h.createElementBlock("span",cae," з")):h.createCommentVNode("",!0)]),i.filters||i.searchValue?(h.openBlock(),h.createElementBlock("span",dae,h.toDisplayString(" "+((Pt=i.tableData)==null?void 0:Pt.filtered)||0),1)):h.createCommentVNode("",!0)])]),Math.ceil(((It=i.tableData)==null?void 0:It.filtered)/i.limit)>1?(h.openBlock(),h.createBlock(Se,{key:0,class:"justify-end","default-page":parseInt(s.defaultPage),total:((cn=i.tableData)==null?void 0:cn.filtered)||0,onPageChange:s.handlePageChange,pageSize:parseInt(i.limit),pageSizes:[10,16,20]},null,8,["default-page","total","onPageChange","pageSize"])):h.createCommentVNode("",!0)])],2),h.createVNode(h.Transition,{name:"slide-fade"},{default:h.withCtx(()=>{var me;return[i.isVisibleCardInfo?(h.openBlock(),h.createBlock(Pe,{key:0,table:n.table,columns:(me=i.tableData)==null?void 0:me.columns,row:s.activeCardRow},null,8,["table","columns","row"])):h.createCommentVNode("",!0)]}),_:1})])])])])}const hae={components:{AdminTable:Ve(Hoe,[["render",uae],["__scopeId","data-v-3f8cf3d4"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){bs!=null&&bs.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){var e;t&&(document.title=(((e=Vn.value)==null?void 0:e.titlePrefix)||"")+t)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async checkPageType(){var r,i;const t=this.flattenMenu(bs.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.params)==null?void 0:o.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.catchAll);const n=e==null?void 0:e.table;this.table=n||!1,!n&&this.getInterface()},async getInterface(){var t,e;try{const{data:n}=await tt.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},fae=["innerHTML"];function pae(t,e,n,r,i,s){const a=h.resolveComponent("AdminTable");return i.table?(h.openBlock(),h.createBlock(a,{key:0,table:i.table,title:i.title},null,8,["table","title"])):(h.openBlock(),h.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:i.interface},null,8,fae))}const mae=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(hae,[["render",pae]])},Symbol.toStringTag,{value:"Module"}));return tre});
|
776
|
+
`}).mount(n)}};window.addEventListener("click",t=>{var n,r,i;const e=(n=t==null?void 0:t.target)==null?void 0:n.closest("[_href]");if(e&&(e==null?void 0:e.tagName)==="A"){const s=e==null?void 0:e.getAttribute("_href");(i=(r=window==null?void 0:window.app)==null?void 0:r.router)==null||i.push(s),t==null||t.preventDefault()}});const Jne=h.defineCustomElement(rI);customElements.define("admin-info",Jne);const Qne=async()=>{try{const{data:t}=await tt.get("/api/user-menu");return bs.value=t,pv(t)}catch(t){return console.error(t),[]}},ere=(t,e)=>{Object.entries(e).forEach(([n,r])=>{t.component(n,r)})},tre={async install(t,{componentsApp:e={},settings:n,routes:r=[]}){Vn.value={...Vn,...n};try{const s=(await Qne()).filter(o=>o==null?void 0:o.component).map(o=>({...o,component:{...bv,...e}[o==null?void 0:o.component]}));ere(t,{...bv,...e}),t.component("admin",_O);const{router:a}=await eB(s.concat(r));window.app={...t,router:a},window.v3plugin={...t.config.globalProperties,..._v},t.config.globalProperties={...t.config.globalProperties,$componentsConfig:{...dE,componentsApp:e},$router:a,$v3plugin:_v,$utils:{reloadCardPage:Rp}},t.use(a)}catch(i){console.error(i)}},components:bv,plugins:_v},nre={data(){return{formValues:{},scheme:null,table:"",token:"",style:null}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,i;const t=this.flattenMenu(bs.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.query)==null?void 0:o.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const{data:{form:s}}=await tt.get(`/api/template/table/${n}`),{data:a}=await tt.get(`/api/table/${this.table}/${(i=(r=this.$route)==null?void 0:r.query)==null?void 0:i.id}`);this.token=(a==null?void 0:a.token)||"",this.formValues=a||{};const{data:o}=await tt.get(`/api/template/form/${s}`);this.scheme=(o==null?void 0:o.schema)||o,this.style=(o==null?void 0:o.style)||null}catch{}},async onlyEditObject(){var e,n,r,i,s,a,o,p,g;const t=this.$refs.form;try{await t.doValidation(),await tt.put(`/api/table/${this.token}`,this.formValues),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(p=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:p[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}},async editObjectAndRedirect(){var e,n,r,i,s,a,o,p,g;const t=this.$refs.form;try{await t.doValidation(),await tt.put(`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(p=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:p[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}}}},rre={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},ire={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},sre={class:"flex items-center gap-[6px]"},ore={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},are={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function lre(t,e,n,r,i,s){var o;const a=h.resolveComponent("VsForm");return h.openBlock(),h.createElementBlock("div",rre,[h.createElementVNode("div",ire,[e[3]||(e[3]=h.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),h.createElementVNode("div",sre,[h.createElementVNode("button",{onClick:e[0]||(e[0]=p=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...p)=>s.editObjectAndRedirect&&s.editObjectAndRedirect(...p)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")])]),h.createElementVNode("div",ore,[h.createElementVNode("div",are,[i.scheme?(h.openBlock(),h.createBlock(a,{key:0,ref:"form",scheme:i.scheme,columns:(o=i.style)==null?void 0:o.columns,style:h.normalizeStyle(i.style),modelValue:i.formValues,"onUpdate:modelValue":e[2]||(e[2]=p=>i.formValues=p),class:"p-0 mt-[20px]"},null,8,["scheme","columns","style","modelValue"])):h.createCommentVNode("",!0)])])])}const cre=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(nre,[["render",lre]])},Symbol.toStringTag,{value:"Module"})),dre={data(){return{formValues:{},scheme:null,table:"",token:"",api:"",style:null}},mounted(){this.getFormScheme()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async getFormScheme(){var r,i;const t=this.flattenMenu(bs.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.query)==null?void 0:o.table)});e||this.$router.replace("/404");const n=e==null?void 0:e.table;this.table=n;try{const s=await tt.get(`/api/table-data/${n}`),{data:a}=await tt.get(`/api/template/form/${(r=s==null?void 0:s.data)==null?void 0:r.form}`);this.scheme=(a==null?void 0:a.schema)||a,this.style=(a==null?void 0:a.style)||null,this.api=(a==null?void 0:a.api)||"",this.token=(i=s==null?void 0:s.data)==null?void 0:i.addToken}catch{}},async createObject(){var e,n,r,i,s,a,o,p,g;const t=this.$refs.form;try{await t.doValidation(),await tt.post(this.api||`/api/table/${this.token}`,this.formValues),await this.$router.back(),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch(y){const v=((e=y==null?void 0:y.response)==null?void 0:e.data)||"";let E=((s=(i=(r=(n=Object.entries(t==null?void 0:t.formErrors))==null?void 0:n[0])==null?void 0:r[1])==null?void 0:i[0])==null?void 0:s.message)==="Це поле обов'язкове"?"Заповніть обов'язкові поля":(g=(p=(o=(a=Object.entries(t==null?void 0:t.formErrors))==null?void 0:a[0])==null?void 0:o[1])==null?void 0:p[0])==null?void 0:g.message;this.$notify({title:"Помилка!",message:v||E||"Сталася помилка валідаціі",type:"error"})}}}},ure={class:"bg-gray-50 lg:w-[calc(100vw-260px)] w-[100vw]"},hre={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},fre={class:"flex items-center gap-[6px]"},pre={style:{height:"calc(100vh - 165px)"},class:"bg-gray-50 p-[20px] flex lg:w-[calc(100vw-260px)] w-[100vw]"},mre={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function gre(t,e,n,r,i,s){const a=h.resolveComponent("VsForm");return h.openBlock(),h.createElementBlock("div",ure,[h.createElementVNode("div",hre,[e[3]||(e[3]=h.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),h.createElementVNode("div",fre,[h.createElementVNode("button",{onClick:e[0]||(e[0]=o=>t.$router.back()),class:"flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"}," Скасувати "),h.createElementVNode("button",{onClick:e[1]||(e[1]=(...o)=>s.createObject&&s.createObject(...o)),class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"}," Зберегти ")])]),h.createElementVNode("div",pre,[h.createElementVNode("div",mre,[i.scheme?(h.openBlock(),h.createBlock(a,{key:0,ref:"form",scheme:i.scheme,style:h.normalizeStyle(i.style),modelValue:i.formValues,"onUpdate:modelValue":e[2]||(e[2]=o=>i.formValues=o),class:"p-0 mt-[20px]"},null,8,["scheme","style","modelValue"])):h.createCommentVNode("",!0)])])])}const yre=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(dre,[["render",gre]])},Symbol.toStringTag,{value:"Module"})),bre={};function _re(t,e,n,r,i,s){const a=h.resolveComponent("router-view");return h.openBlock(),h.createBlock(a)}const iI=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(bre,[["render",_re]])},Symbol.toStringTag,{value:"Module"})),xre={},vre={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-logout"};function wre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",vre,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),h.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),h.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const sI=Ve(xre,[["render",wre]]),kre={},Ere={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Sre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Ere,e[0]||(e[0]=[h.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const Cre=Ve(kre,[["render",Sre]]),Tre={components:{IconChevronDown:gv},props:{route:Object,searchable:String},mounted(){var t,e;(e=(t=this.route)==null?void 0:t.menu)!=null&&e.some(n=>{var r,i;return(n==null?void 0:n.path)===this.$route.path.replace("/","")||((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.table)===(n==null?void 0:n.table)&&(n==null?void 0:n.table)})&&(this.isOpen=!0)},watch:{route:{immediate:!0,handler(t){t!=null&&t.open&&(this.isOpen=!0)}}},data(){return{isOpen:!1,arr:[]}},computed:{darkMode(){var t;return(t=Vn==null?void 0:Vn.value)==null?void 0:t.sidebarDark}},methods:{highLight(t){if(!this.searchable)return t;const e=this.searchable.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${e})(\\s*)`,"gi");return t.replace(n,(r,i,s)=>`<span style="color:#1989fa;">${i}</span>${s}`)}}},Are={key:0,class:""},Mre={key:0,class:"py-0.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full dark:bg-blue-500/10 dark:text-blue-500"},Dre={key:1},Ire=["innerHTML"];function Pre(t,e,n,r,i,s){var p,g,y,v,E,T,D,N,B,F,X,te,H,ke,ge;const a=h.resolveComponent("IconChevronDown"),o=h.resolveComponent("router-link");return(p=n.route)!=null&&p.menu?(h.openBlock(),h.createElementBlock("div",Are,[h.createElementVNode("button",{onClick:e[0]||(e[0]=Se=>i.isOpen=!i.isOpen),class:h.normalizeClass(["flex items-center justify-start w-full px-3 py-2 text-sm text-left text-gray-800 duration-300 border-none rounded-lg cursor-pointer gap-x-3 focus:outline-none hover:bg-gray-100",[((y=(g=n.route)==null?void 0:g.menu)==null?void 0:y.some(Se=>{var Pe,Ne;return(Se==null?void 0:Se.path)===t.$route.path.replace("/","")||(Se==null?void 0:Se.table)===((Ne=(Pe=t.$route)==null?void 0:Pe.params)==null?void 0:Ne.table)&&(Se==null?void 0:Se.table)}))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!s.darkMode}]])},[h.createTextVNode(h.toDisplayString((v=n.route)==null?void 0:v.ua)+" ",1),(E=n.route)!=null&&E.new?(h.openBlock(),h.createElementBlock("span",Mre,"Нове")):h.createCommentVNode("",!0),h.createVNode(a,{class:h.normalizeClass([[i.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"14",height:"14"},null,8,["class"])],2),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var Se;return[h.withDirectives(h.createElementVNode("ul",{class:h.normalizeClass(["ml-[28px] pt-[6px] before:block before:absolute relative w-[calc(100%-28px)] flex-col gap-y-1.5 inline-flex before:w-[2px] before:h-[100%] before:left-[-10px] cursor-pointer",s.darkMode?"before:bg-white/10":"before:bg-gray-100"])},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((Se=n.route)==null?void 0:Se.menu,(Pe,Ne)=>{var at,Je;return h.openBlock(),h.createElementBlock("li",{key:Ne,class:"w-full"},[h.createVNode(o,{innerHTML:s.highLight(Pe==null?void 0:Pe.ua),to:"/"+(Pe==null?void 0:Pe.path),class:h.normalizeClass([[((Pe==null?void 0:Pe.path)===t.$route.path.replace("/","")||((Je=(at=t.$route)==null?void 0:at.params)==null?void 0:Je.table)===(Pe==null?void 0:Pe.table)&&(Pe==null?void 0:Pe.table))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100":!s.darkMode}],"block px-3 py-2 text-sm rounded-lg focus:outline-none focus:bg-gray-100"])},null,8,["innerHTML","to","class"])])}),128))],2),[[h.vShow,i.isOpen]])]}),_:1})])):(T=n.route)!=null&&T.hidden?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",Dre,[h.createVNode(o,{to:((N=(D=n.route)==null?void 0:D.path)==null?void 0:N[0])==="/"?(B=n.route)==null?void 0:B.path:"/"+((F=n.route)==null?void 0:F.path),class:h.normalizeClass([[(((X=n.route)==null?void 0:X.path.replace("/",""))===t.$route.path.replace("/","")||((H=(te=t.$route)==null?void 0:te.params)==null?void 0:H.table)===((ke=n.route)==null?void 0:ke.table)&&((ge=n.route)==null?void 0:ge.table))&&(s.darkMode?"bg-white/10":"bg-gray-100"),{"text-white/80 hover:bg-white/10 hover:text-white/80 focus:bg-white/10 ":s.darkMode,"text-gray-800 hover:bg-gray-100 hover:text-gray-800 focus:bg-gray-100 ":!s.darkMode}],"flex items-center w-full px-3 py-2 text-sm text-gray-800 duration-300 rounded-lg gap-x-3"])},{default:h.withCtx(()=>{var Se;return[h.createElementVNode("span",{innerHTML:s.highLight((Se=n.route)==null?void 0:Se.ua)},null,8,Ire)]}),_:1},8,["to","class"])]))}const Rre=Ve(Tre,[["render",Pre]]),Ore={},Nre={class:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Bre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Nre,e[0]||(e[0]=[h.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),h.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},null,-1),h.createElementVNode("path",{d:"M12 17h.01"},null,-1)]))}const oI=Ve(Ore,[["render",Bre]]),zre={},Lre={class:"shrink-0 size-4 rounded-full",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function Vre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Lre,e[0]||(e[0]=[h.createStaticVNode('<g fill-rule="evenodd"><g stroke-width="1pt"><path fill="#bd3d44" d="M0 0h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M0 10h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0zm0 20h247v10H0z" transform="scale(3.9385)"></path></g><path fill="#192f5d" d="M0 0h98.8v70H0z" transform="scale(3.9385)"></path><path fill="#fff" d="M8.2 3l1 2.8H12L9.7 7.5l.9 2.7-2.4-1.7L6 10.2l.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7L74 8.5l-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 7.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 24.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 21.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 38.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 35.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 52.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 49.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm-74.1 7l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7H65zm16.4 0l1 2.8H86l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm-74 7l.8 2.8h3l-2.4 1.7.9 2.7-2.4-1.7L6 66.2l.9-2.7-2.4-1.7h3zm16.4 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8H45l-2.4 1.7 1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9zm16.4 0l1 2.8h2.8l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h3zm16.5 0l.9 2.8h2.9l-2.3 1.7.9 2.7-2.4-1.7-2.3 1.7.9-2.7-2.4-1.7h2.9zm16.5 0l.9 2.8h2.9L92 63.5l1 2.7-2.4-1.7-2.4 1.7 1-2.7-2.4-1.7h2.9z" transform="scale(3.9385)"></path></g>',1)]))}const Fre=Ve(zre,[["render",Vre]]),$re={},jre={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"256",height:"256",viewBox:"0 0 256 256","xml:space":"preserve"};function Hre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",jre,e[0]||(e[0]=[h.createElementVNode("defs",null,null,-1),h.createElementVNode("g",{style:{stroke:"none","stroke-width":"0","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"none","fill-rule":"nonzero",opacity:"1"},transform:"translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)"},[h.createElementVNode("path",{d:"M 45 90 C 20.147 90 0 69.853 0 45 h 90 C 90 69.853 69.853 90 45 90 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(255,213,0)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"}),h.createElementVNode("path",{d:"M 45 0 C 20.147 0 0 20.147 0 45 h 90 C 90 20.147 69.853 0 45 0 z",style:{stroke:"none","stroke-width":"1","stroke-dasharray":"none","stroke-linecap":"butt","stroke-linejoin":"miter","stroke-miterlimit":"10",fill:"rgb(0,91,187)","fill-rule":"nonzero",opacity:"1"},transform:" matrix(1 0 0 1 0 0) ","stroke-linecap":"round"})],-1)]))}const Ure=Ve($re,[["render",Hre]]),Wre={},qre={class:"shrink-0 size-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Gre(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",qre,e[0]||(e[0]=[h.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)]))}const Yre={components:{IconQuestion:oI,IconUSA:Fre,IconUkraine:Ure,IconTick:Ve(Wre,[["render",Gre]])},props:["docs","languages"],data(){return{currentLang:"ukraine",languagesOptions:[{titleEN:"English",titleUA:"Англійська",id:"english",icon:"IconUSA"},{titleEN:"Ukraine",titleUA:"Українська",id:"ukraine",icon:"IconUkraine"}]}},computed:{selectedLang(){return this.languagesOptions.find(t=>t.id===this.currentLang)},darkMode(){var t;return(t=Vn==null?void 0:Vn.value)==null?void 0:t.sidebarDark}},methods:{changeLang(t){this.$refs.langPopover.togglePopover(),this.currentLang=t}}},Zre={class:"flex justify-center items-center gap-x-2"},Xre=["onClick"],Kre={class:"text-gray-800"},Jre={class:"ms-auto"},Qre={class:"truncate"};function eie(t,e,n,r,i,s){const a=h.resolveComponent("IconTick"),o=h.resolveComponent("VsPopover");return n.docs||n.languages?(h.openBlock(),h.createElementBlock("div",{key:0,class:h.normalizeClass(["py-2 px-5 border-t dark:border-neutral-700",s.darkMode?"border-white/10 ":"border-gray-200"])},[h.createElementVNode("div",Zre,[h.createVNode(o,{trigger:"click",placement:"top",ref:"langPopover"},{reference:h.withCtx(()=>{var p,g,y;return[h.createElementVNode("button",{type:"button","aria-expanded":"false",class:h.normalizeClass(["relative py-2 px-3 flex items-center gap-x-2 text-nowrap w-full cursor-pointer border rounded-full text-start text-sm text-gray-800 focus:outline-none",s.darkMode?"border-white/10 bg-transparent text-white/80 hover:bg-white/10 focus:bg-white/10":"border-gray-200 bg-white hover:bg-gray-100 focus:bg-gray-100"])},[h.createElementVNode("div",null,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent((p=s.selectedLang)==null?void 0:p.icon),{class:"w-[16px] h-[16px] rounded-full"}))]),h.createElementVNode("span",Qre,h.toDisplayString(i.currentLang==="ukraine"?(g=s.selectedLang)==null?void 0:g.titleUA:(y=s.selectedLang)==null?void 0:y.titleEN),1)],2)]}),default:h.withCtx(()=>[h.createElementVNode("div",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.languagesOptions,p=>(h.openBlock(),h.createElementBlock("button",{key:p.id,type:"button",onClick:g=>s.changeLang(p.id),class:h.normalizeClass(["flex items-center gap-x-2 cursor-pointer dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 selected",(p==null?void 0:p.id)===i.currentLang?"bg-gray-100":""])},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(p==null?void 0:p.icon),{class:"w-[16px] h-[16px] rounded-full"})),h.createElementVNode("div",Kre,h.toDisplayString(i.currentLang==="ukraine"?p==null?void 0:p.titleUA:p==null?void 0:p.titleEN),1),h.createElementVNode("span",Jre,[(p==null?void 0:p.id)===i.currentLang?(h.openBlock(),h.createBlock(a,{key:0})):h.createCommentVNode("",!0)])],10,Xre))),128))])]),_:1},512)])],2)):h.createCommentVNode("",!0)}const tie={components:{IconLogout:sI,NavbarItem:Rre,IconLogo:Cre,IconSearch:mv,NavbarFooter:Ve(Yre,[["render",eie]])},data(){return{activeIndex:null,searchValue:""}},computed:{data(){var t;return(t=this.searchValue)!=null&&t.trim()?this.filterMenu(bs.value,this.searchValue):bs.value},logo(){var t;return((t=Vn.value)==null?void 0:t.logo)||"/assets/logo.svg"},docs(){var t;return(t=Vn==null?void 0:Vn.value)==null?void 0:t.docs},languages(){var t;return(t=Vn==null?void 0:Vn.value)==null?void 0:t.languages},darkMode(){var t;return(t=Vn==null?void 0:Vn.value)==null?void 0:t.sidebarDark},darkColor(){var t,e;return((t=Vn==null?void 0:Vn.value)==null?void 0:t.sidebarColor)||((e=Vn==null?void 0:Vn.value)==null?void 0:e.color)||"blue"}},watch:{"$route.path"(){this.$parent.showMenu=!1}},methods:{filterMenu(t,e){return t.map(n=>{var r,i;if(n.menu){const s=this.filterMenu(n.menu,e);if(s.length>0)return{...n,menu:s,open:!0}}else if((i=(r=n.ua)==null?void 0:r.toLowerCase())!=null&&i.includes(e.toLowerCase()))return n;return null}).filter(Boolean)}}},nie={class:"h-[46px] w-full px-5 lg:px-8 mb-[10px]"},rie={href:"/"},iie=["src"],sie={class:"px-2 lg:px-5"},oie={class:"px-2 lg:px-5 flex flex-col flex-wrap w-full pb-3"},aie={key:0,class:"flex flex-col gap-y-1"};function lie(t,e,n,r,i,s){var g;const a=h.resolveComponent("VsText"),o=h.resolveComponent("NavbarItem"),p=h.resolveComponent("NavbarFooter");return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["lg:flex lg:relative lg:left-0 flex-col h-[100vh] pt-3 border-r w-[260px] top-0 bottom-0 shrink-0 absolute transition left-[-100%] z-[11]",{"left-0":t.$parent.showMenu,["bg-"+s.darkColor+"-950"]:s.darkMode,"bg-white":!s.darkMode}])},[h.createElementVNode("div",nie,[h.createElementVNode("a",rie,[h.createElementVNode("img",{src:s.logo,class:"object-contain w-full h-full"},null,8,iie)])]),h.createElementVNode("div",sie,[h.createVNode(a,{type:"text",modelValue:i.searchValue,"onUpdate:modelValue":e[0]||(e[0]=y=>i.searchValue=y),clearable:!0,icon:"search","icon-position":"left",placeholder:"Пошук по меню",class:h.normalizeClass(["[&>input]:h-[38px]",{"[&>input]:bg-[#172554] [&>input]:text-white/80 [&>input]:placeholder:text-white/40 [&>input]:border [&>input]:border-white/50":s.darkMode,["[&>input]:bg-"+s.darkColor+"-950"]:s.darkMode,["focus:[&>input]:border-"+s.darkColor+"-500"]:s.darkMode}])},null,8,["modelValue","class"])]),h.createElementVNode("div",{class:h.normalizeClass(["py-[10px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",s.languages||s.docs?"h-[calc(100vh-161px)]":"h-[calc(100vh-110px)]"])},[h.createElementVNode("nav",oie,[(g=s.data)!=null&&g.length?(h.openBlock(),h.createElementBlock("ul",aie,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.data,(y,v)=>(h.openBlock(),h.createElementBlock("li",{key:v,class:"flex flex-col gap-[6px]"},[h.createVNode(o,{route:y,searchable:i.searchValue},null,8,["route","searchable"])]))),128))])):(h.openBlock(),h.createElementBlock("div",{key:1,class:h.normalizeClass(["text-lg mt-[20px]",{"text-white/80":s.darkMode,"text-gray-800":!s.darkMode}])}," Не знайдено ",2))])],2),s.docs||s.languages?(h.openBlock(),h.createBlock(p,{key:0,docs:s.docs,languages:s.languages},null,8,["docs","languages"])):h.createCommentVNode("",!0)],2)}const cie=Ve(tie,[["render",lie],["__scopeId","data-v-ebe4c2ff"]]),die={components:{IconQuestion:oI,IconUser:iA,AdminNotification:sA,IconUserOutline:eA,IconLogout:sI},mounted(){this.getUserData()},data(){return{userData:null,isVisible:!1}},watch:{isVisible(t){t?setTimeout(()=>window.addEventListener("click",this.closeOnOutsideClick),0):window.removeEventListener("click",this.closeOnOutsideClick)}},methods:{async getUserData(){try{const{data:t}=await tt.get("/user");this.userData=t}catch{}},async logout(){try{await tt.get("/logout"),await window.history.pushState({},"","/login"),await location.reload(),localStorage.removeItem("user")}catch{}},closeOnOutsideClick(){this.isVisible=!1}},beforeUnmount(){window.removeEventListener("click",this.closeOnOutsideClick)}},uie={class:"h-[58px] border-b flex lg:justify-end justify-between items-center px-[20px]"},hie={class:"flex items-center gap-[6px]"},fie={href:"/docs-user",class:"size-[38px] inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},pie={class:"relative"},mie=["src"],gie={key:1,class:"size-[40px] rounded-full bg-gray-200 flex items-center justify-center"},yie=["src"],bie={key:1,class:"flex items-center justify-center bg-gray-200 rounded-full size-10"},_ie={class:"grow"},xie={class:"block text-sm font-medium text-gray-800 dark:text-neutral-200"},vie={class:"text-xs text-gray-500 dark:text-neutral-500"},wie={class:"flex flex-col space-y-0.5"};function kie(t,e,n,r,i,s){var E,T,D,N;const a=h.resolveComponent("IconQuestion"),o=h.resolveComponent("AdminNotification"),p=h.resolveComponent("IconUser"),g=h.resolveComponent("router-link"),y=h.resolveComponent("IconUserOutline"),v=h.resolveComponent("IconLogout");return h.openBlock(),h.createElementBlock("div",uie,[h.createElementVNode("div",{class:"flex lg:hidden",onClick:e[0]||(e[0]=B=>t.$parent.showMenu=!0)},e[4]||(e[4]=[h.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l16 0"></path><path d="M4 12l16 0"></path><path d="M4 18l16 0"></path></svg>',1)])),h.createElementVNode("div",hie,[h.createElementVNode("a",fie,[h.createVNode(a,{height:"24",width:"24"})]),h.createVNode(o),e[9]||(e[9]=h.createElementVNode("div",{class:"h-[30px] w-[1px] bg-gray-200 ml-[10px] mr-[10px]"},null,-1)),h.createElementVNode("div",pie,[h.createElementVNode("div",{onClick:e[1]||(e[1]=B=>i.isVisible=!0),class:"cursor-pointer"},[(T=(E=i.userData)==null?void 0:E.user)!=null&&T.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"flex-shrink-0 size-[30px] rounded-full",src:(N=(D=i.userData)==null?void 0:D.user)==null?void 0:N.avatar,alt:"Image Description"},null,8,mie)):(h.openBlock(),h.createElementBlock("div",gie,[h.createVNode(p)]))]),i.isVisible?(h.openBlock(),h.createElementBlock("div",{key:0,onClick:e[3]||(e[3]=h.withModifiers(()=>{},["stop"])),class:"fixed p-2 bg-white w-[240px] top-[55px] right-[20px] rounded-xl z-[1] shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:shadow-[0_10px_40px_10px_rgba(0,0,0,0.2)] dark:bg-neutral-900 block"},[h.createVNode(g,{to:"profile",disabled:!0,class:"py-2 px-2.5 flex items-center gap-3 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800"},{default:h.withCtx(()=>{var B,F,X,te,H,ke,ge,Se;return[(F=(B=i.userData)==null?void 0:B.user)!=null&&F.avatar?(h.openBlock(),h.createElementBlock("img",{key:0,class:"rounded-full shrink-0 size-10",src:(te=(X=i.userData)==null?void 0:X.user)==null?void 0:te.avatar,alt:"Image Description"},null,8,yie)):(h.openBlock(),h.createElementBlock("div",bie,[h.createVNode(p,{class:"w-[16px]"})])),h.createElementVNode("div",_ie,[h.createElementVNode("span",xie,h.toDisplayString(((ke=(H=i.userData)==null?void 0:H.user)==null?void 0:ke.username)||"User User"),1),h.createElementVNode("p",vie,h.toDisplayString(((Se=(ge=i.userData)==null?void 0:ge.user)==null?void 0:Se.email)||"email не вказано"),1)])]}),_:1}),e[7]||(e[7]=h.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),h.createElementVNode("ul",wie,[h.createElementVNode("li",null,[h.createVNode(g,{to:"profile",class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",disabled:"true"},{default:h.withCtx(()=>[h.createVNode(y,{class:"size-4"}),e[5]||(e[5]=h.createTextVNode(" Профіль "))]),_:1})])]),e[8]||(e[8]=h.createElementVNode("div",{class:"my-2 mx-2.5 h-px bg-gray-200 dark:bg-neutral-700"},null,-1)),h.createElementVNode("p",null,[h.createElementVNode("button",{type:"button",onClick:e[2]||(e[2]=(...B)=>s.logout&&s.logout(...B)),class:"w-full flex items-center gap-x-3.5 py-2 px-2.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 hover:text-red-500 focus:outline-none focus:bg-gray-100 focus:text-red-500 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 dark:hover:text-red-500 dark:focus:text-red-500"},[h.createVNode(v,{class:"size-4"}),e[6]||(e[6]=h.createTextVNode(" Вийти "))])])])):h.createCommentVNode("",!0)])])])}const Eie={components:{navbar:cie,AdminHeader:Ve(die,[["render",kie]])},data(){return{showMenu:!1}},computed:{isMenu(){return bs.value||null},header(){var t;return((t=Vn.value)==null?void 0:t.header)||"admin-header"}}},Sie={class:"admin-wrapper"},Cie={class:"flex flex-col w-full"};function Tie(t,e,n,r,i,s){const a=h.resolveComponent("navbar"),o=h.resolveComponent("router-view");return h.openBlock(),h.createElementBlock("div",Sie,[h.createVNode(a),i.showMenu?(h.openBlock(),h.createElementBlock("div",{key:0,onClick:e[0]||(e[0]=p=>i.showMenu=!1),class:"z-[10] lg:hidden transition duration fixed inset-0 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 dark:bg-neutral-900"})):h.createCommentVNode("",!0),h.createElementVNode("div",Cie,[s.isMenu?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(s.header))),h.createVNode(o)],64)):h.createCommentVNode("",!0)])])}const Aie=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(Eie,[["render",Tie],["__scopeId","data-v-34da2042"]])},Symbol.toStringTag,{value:"Module"})),Mie={data(){return{currentSort:""}},props:{data:{type:Object,default:()=>null},activeColumn:{type:String}},computed:{label(){var t,e;return((t=this.data)==null?void 0:t.ua)||((e=this.data)==null?void 0:e.label)||this.data.title||"null"},selectedSortParam(){var t,e;return(e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort},getVisibleIcon(){return this.data.format!=="image"&&this.data.format!=="verify"}},watch:{activeColumn(t){t!==this.data.name&&(this.currentSort="")}},methods:{changeCurrentSort(t){switch(t){case"":return"asc";case"asc":return"desc";case"desc":return"";default:return""}},handleClickSortBtn(t){this.$emit("change-active",this.data.name),this.currentSort=this.changeCurrentSort(t);const e=this.$route.query,{sort:n,...r}=e,i=this.currentSort?`${this.data.name}-${this.currentSort}`:"";this.$router.replace({query:{...r,...i&&{sort:i}}})},isValueEqualToSelected(t){return`${this.data.name}-${t}`===this.selectedSortParam}}},Die={scope:"col",class:"pe-2 py-1 text-start"},Iie={class:"w-[24px]"},Pie={key:1,class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200"};function Rie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("th",Die,[s.getVisibleIcon?(h.openBlock(),h.createElementBlock("button",{key:0,type:"button",class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200",onClick:e[0]||(e[0]=a=>s.handleClickSortBtn(i.currentSort))},[h.createTextVNode(h.toDisplayString(s.label)+" ",1),h.createElementVNode("span",Iie,[i.currentSort?(h.openBlock(),h.createElementBlock("svg",{key:0,class:h.normalizeClass(["shrink-0 size-3.5",{"rotate-180":i.currentSort==="asc"}]),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},e[1]||(e[1]=[h.createElementVNode("path",{d:"m5 12 7-7 7 7"},null,-1),h.createElementVNode("path",{d:"M12 19V5"},null,-1)]),2)):h.createCommentVNode("",!0)])])):(h.openBlock(),h.createElementBlock("p",Pie,h.toDisplayString(s.label),1))])}const Oie=Ve(Mie,[["render",Rie]]),Nie={components:{IconMore:Q_,IconDelete:tA,IconEdit:nA},emits:["updateTable"],props:{item:Object,table:String,isForm:null,actions:Array,default:()=>[]},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},computed:{getCustomActions(){return this.actions.filter(t=>typeof t=="object")}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var t;try{const{data:e}=await tt.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);this.formValue=e}catch(e){console.error(e)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var t,e;try{const{data:n}=await tt.get(`/api/table/${this.table}/${(t=this.item)==null?void 0:t.id}`);await tt.delete(`/api/table/${n==null?void 0:n.token}`),await this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table")}catch(n){this.$notify({title:"Помилка!",message:(e=n==null?void 0:n.response)==null?void 0:e.data,type:"error"})}finally{this.isDeleteConfirm=!1}},async customButtonAction(t){var e,n;document.querySelector("body").click(),t!=null&&t.form?(await this.$v3plugin.$form({form:t==null?void 0:t.form,id:(e=this.item)==null?void 0:e.id,api:t==null?void 0:t.api,title:t==null?void 0:t.title}),await this.$emit("update-table")):await this.$v3plugin.$api({confirm:t==null?void 0:t.confirm,api:t==null?void 0:t.api,method:t==null?void 0:t.method,id:(n=this.item)==null?void 0:n.id,isId:(t==null?void 0:t.isId)||!1})}}},Bie={class:"inline-flex"},zie={class:"inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50"},Lie={class:"flex flex-col items-start"},Vie=["onClick"],Fie={class:"text-gray-800"},$ie={key:1,class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"},jie={class:"flex justify-end p-[16px] pr-0 gap-x-3"};function Hie(t,e,n,r,i,s){const a=h.resolveComponent("IconMore"),o=h.resolveComponent("IconEdit"),p=h.resolveComponent("router-link"),g=h.resolveComponent("IconDelete"),y=h.resolveComponent("VsPopover"),v=h.resolveComponent("VsConfirm");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("div",Bie,[h.createVNode(y,{trigger:"click",placement:"bottom-left"},{reference:h.withCtx(()=>[h.createElementVNode("button",zie,[h.createVNode(a,{height:"16",width:"16"})])]),default:h.withCtx(()=>{var E,T,D,N,B;return[h.createElementVNode("div",Lie,[(E=n.actions)!=null&&E.includes("edit")&&n.isForm?(h.openBlock(),h.createBlock(p,{key:0,to:`/edit?table=${(D=(T=t.$route)==null?void 0:T.params)==null?void 0:D.catchAll}&id=${(N=n.item)==null?void 0:N.id}`,class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},{default:h.withCtx(()=>[h.createVNode(o,{color:"#000"}),e[4]||(e[4]=h.createTextVNode(" Редагувати "))]),_:1},8,["to"])):h.createCommentVNode("",!0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.getCustomActions,(F,X)=>(h.openBlock(),h.createElementBlock("button",{key:X,onClick:te=>s.customButtonAction(F),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(g,{class:"opacity-0"}),h.createElementVNode("span",Fie,h.toDisplayString(F==null?void 0:F.label),1)],8,Vie))),128)),n.isForm?(h.openBlock(),h.createElementBlock("div",$ie)):h.createCommentVNode("",!0),(B=n.actions)!=null&&B.includes("del")?(h.openBlock(),h.createElementBlock("button",{key:2,onClick:e[0]||(e[0]=h.withModifiers((...F)=>s.openConfirm&&s.openConfirm(...F),["stop"])),class:"w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"},[h.createVNode(g),e[5]||(e[5]=h.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])):h.createCommentVNode("",!0)])]}),_:1})]),h.createVNode(v,{visible:i.isDeleteConfirm,"onUpdate:visible":e[3]||(e[3]=E=>i.isDeleteConfirm=E),size:"small",title:"Ви впевнені?"},{default:h.withCtx(()=>[e[6]||(e[6]=h.createElementVNode("p",{class:"mt-1 text-sm text-gray-600 dark:text-neutral-400"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),h.createElementVNode("div",jie,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium duration-300 border rounded-lg shadow-sm hover:bg-gray-100 gap-x-2 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[1]||(e[1]=E=>i.isDeleteConfirm=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-white duration-300 bg-red-500 rounded-lg gap-x-2 hover:bg-red-700 disabled:opacity-50 disabled:pointer-events-none",onClick:e[2]||(e[2]=(...E)=>s.deleteElement&&s.deleteElement(...E))}," Так, я впевнена(ий) ")])]),_:1},8,["visible"])],64)}const Uie=Ve(Nie,[["render",Hie]]),Wie={},qie={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Gie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",qie,e[0]||(e[0]=[h.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),h.createElementVNode("path",{d:"M7 20V4"},null,-1),h.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),h.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const Yie=Ve(Wie,[["render",Gie]]),Zie={},Xie={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-rosette-discount-check"};function Kie(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Xie,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1"},null,-1),h.createElementVNode("path",{d:"M9 12l2 2l4 -4"},null,-1)]))}const Jie={components:{IconExport:Yie,IconChevronDown:gv,IconSuccess:Ve(Zie,[["render",Kie]])},props:{table:String,columns:Array,page:[String,Number],filterCustom:String,filterState:String,filters:String},data(){return{isOpen:!1,tableFormats:["json","csv","xlsx"],format:"",cols:[],activeAction:"",isSuccessTemplate:!1,actions:[{name:"choceAll",function:this.choceAll,label:"Вибрати усі"},{name:"choceVisible",function:this.choceVisible,label:"Вибрати поточні"},{name:"clearAll",function:this.clearAll,label:"Жодного"}]}},watch:{isOpen(t){t||(this.format="",this.cols=[],this.activeAction="",this.isSuccessTemplate=!1)}},methods:{async exportTable(){var t;if(!((t=this.cols)!=null&&t.length)){this.$notify({type:"error",title:"Помилка",message:"Оберіть колонки для експорту!"});return}if(!this.format){this.$notify({type:"error",title:"Помилка",message:"Оберіть формат!"});return}try{const e=await tt.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(","),page:this.page,filter:this.filters||null,state:this.filterState||null,custom:this.filterCustom||null},responseType:"blob"}),n=await e.data.text(),r=n!=null&&n.includes(";")?null:JSON==null?void 0:JSON.parse(n),i=new Blob([e.data],{type:"application/octet-stream"}),s=window.URL.createObjectURL(i),a=document.createElement("a");if(a.href=s,a.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(a),typeof r=="string"){this.exportTable();return}a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(s),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"}),this.isSuccessTemplate=!0}catch(e){console.log(e),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(t){this.format=t},choceAll(){var t;this.cols=(t=this.columns)==null?void 0:t.map(e=>e==null?void 0:e.name),this.activeAction="choceAll"},clearAll(){this.cols=[],this.activeAction="clearAll"},choceVisible(){var t,e;this.cols=(e=(t=this.columns)==null?void 0:t.filter(n=>(n==null?void 0:n.hidden)!==!0))==null?void 0:e.map(n=>n==null?void 0:n.name),this.activeAction="choceVisible"}}},Qie={key:0,class:"flex flex-col items-center"},ese={key:1,class:"p-4"},tse={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},nse={class:"flex items-center gap-[10px] -ml-[10px] my-[10px]"},rse=["onClick"],ise={key:0,class:"block h-[8px] w-[8px] rounded-full bg-blue-500"},sse={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},ose={class:"pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700"},ase={class:"mt-2 space-y-2"},lse=["id","onChange"],cse=["for"],dse={key:0,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"},use={key:1,class:"flex w-full justify-end p-[20px] gap-[6px] border-t"};function hse(t,e,n,r,i,s){const a=h.resolveComponent("IconExport"),o=h.resolveComponent("IconSuccess"),p=h.resolveComponent("VsCheckbox"),g=h.resolveComponent("VsDialog");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=y=>i.isOpen=!0),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(a,{height:"16",width:"16"}),e[7]||(e[7]=h.createTextVNode(" Експорт "))]),h.createVNode(g,{visible:i.isOpen,"onUpdate:visible":e[6]||(e[6]=y=>i.isOpen=y),title:"Експорт таблиці",size:"small",closeClickBack:!0},{footer:h.withCtx(()=>[i.isSuccessTemplate?(h.openBlock(),h.createElementBlock("div",dse,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[2]||(e[2]=y=>i.isOpen=!1)}," Закрити "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[3]||(e[3]=y=>i.isSuccessTemplate=!1)}," Вигрузити ще ")])):(h.openBlock(),h.createElementBlock("div",use,[h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=y=>i.isOpen=!1)}," Скасувати "),h.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",onClick:e[5]||(e[5]=(...y)=>s.exportTable&&s.exportTable(...y))}," Завантажити таблицю ")]))]),default:h.withCtx(()=>[i.isSuccessTemplate?(h.openBlock(),h.createElementBlock("div",Qie,[h.createVNode(o,{height:"100",width:"100",class:"text-green-200 mb-[20px]"}),e[8]||(e[8]=h.createElementVNode("h2",null,"Звіт сформовано і збережено",-1))])):(h.openBlock(),h.createElementBlock("div",ese,[h.createElementVNode("div",tse,[e[9]||(e[9]=h.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"}," Виберіть стовпці таблиці для експорту: ",-1)),h.createElementVNode("div",nse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.actions,y=>(h.openBlock(),h.createElementBlock("button",{key:y==null?void 0:y.name,onClick:y==null?void 0:y.function,class:"inline-flex items-center gap-[8px] justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border-gray-200 text-nowrap text-start"},[h.createElementVNode("span",{class:h.normalizeClass(["h-[14px] w-[14px] border rounded-full flex items-center justify-center",{"border-blue-500":(y==null?void 0:y.name)===i.activeAction}])},[(y==null?void 0:y.name)===i.activeAction?(h.openBlock(),h.createElementBlock("span",ise)):h.createCommentVNode("",!0)],2),h.createTextVNode(" "+h.toDisplayString(y==null?void 0:y.label),1)],8,rse))),128))]),h.createElementVNode("div",sse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.columns,(y,v)=>(h.openBlock(),h.createElementBlock("div",{class:"flex items-center",key:v,style:{width:"calc((100% - 10px) / 2)"}},[h.createVNode(p,{class:"[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",modelValue:i.cols,"onUpdate:modelValue":e[1]||(e[1]=E=>i.cols=E),value:y==null?void 0:y.name,label:y==null?void 0:y.ua},null,8,["modelValue","value","label"])]))),128))])]),h.createElementVNode("div",ose,[e[10]||(e[10]=h.createElementVNode("h2",{class:"text-sm font-[600] text-gray-500"},"Виберіть формат таблиці:",-1)),h.createElementVNode("div",ase,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.tableFormats,(y,v)=>(h.openBlock(),h.createElementBlock("div",{class:"flex items-center",key:v},[h.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"text-blue-600 border-gray-300 rounded-full shrink-0 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:y,onChange:E=>s.selectFormat(y)},null,40,lse),h.createElementVNode("label",{for:y,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+h.toDisplayString(y),9,cse)]))),128))])])]))]),_:1},8,["visible"])],64)}const fse=Ve(Jie,[["render",hse]]),pse={},mse={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-columns"};function gse(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",mse,e[0]||(e[0]=[h.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const yse=Ve(pse,[["render",gse]]),bse={props:{column:Object},emits:["update-column"],components:{IconCheck2:T0},data(){return{value:!1}},watch:{value(t){this.$emit("update-column",{...this.column,hidden:!t})}},mounted(){var t;((t=this.column)==null?void 0:t.hidden)!==!0&&(this.value=!0)}},_se={class:"flex justify-between items-center py-1.5 px-3 cursor-pointer rounded-lg hover:bg-gray-100 has-[:disabled]:opacity-50 has-[:disabled]:pointer-events-none dark:hover:bg-neutral-800"},xse={class:"flex justify-between flex-1 items-center gap-x-2.5 cursor-pointer text-[13px] text-gray-800 dark:text-neutral-300"};function vse(t,e,n,r,i,s){var o,p;const a=h.resolveComponent("IconCheck2");return h.openBlock(),h.createElementBlock("div",_se,[h.createElementVNode("label",xse,[h.createTextVNode(h.toDisplayString(((o=n.column)==null?void 0:o.ua)||((p=n.column)==null?void 0:p.title))+" ",1),h.withDirectives(h.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=g=>i.value=g),class:"hidden"},null,512),[[h.vModelCheckbox,i.value]]),h.createElementVNode("span",{class:h.normalizeClass(["flex items-center justify-center text-white border border-gray-300 rounded shrink-0 size-4 focus:ring-blue-500",[i.value?"bg-blue-600 border-0":"bg-white"]])},[h.createVNode(a,{height:"12",width:"12"})],2)])])}const wse={components:{IconColumns:yse,AdminTableColumnsHiddenItem:Ve(bse,[["render",vse]])},emits:["update-columns"],props:{columns:Array},data(){return{searchValue:"",visible:!1}},computed:{filteredColumn(){var t;return(t=this.columns)==null?void 0:t.filter(e=>{var n,r,i,s,a,o;return((i=(n=e==null?void 0:e.ua)==null?void 0:n.toLowerCase())==null?void 0:i.includes((r=this.searchValue)==null?void 0:r.toLowerCase()))||((o=(s=e==null?void 0:e.title)==null?void 0:s.toLowerCase())==null?void 0:o.includes((a=this.searchValue)==null?void 0:a.toLowerCase()))})}},methods:{toggleVisible(){this.visible=!this.visible,this.visible?document.addEventListener("click",this.handleClickOutside):document.removeEventListener("click",this.handleClickOutside)},handleClickOutside(t){const e=this.$refs.wrapper;e&&!e.contains(t.target)&&(this.visible=!1,document.removeEventListener("click",this.handleClickOutside))},updateColumn(t){const e=this.columns.findIndex(r=>(r==null?void 0:r.name)===(t==null?void 0:t.name)),n=this.columns;n[e]=t,this.$emit("update-columns",[...n])}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},kse={class:"relative",ref:"wrapper"},Ese={key:0,class:"absolute left-[50%] top-[110%] translate-x-[-50%] z-10 w-64 transition-[opacity,margin] duration bg-white rounded-xl shadow-lg dark:bg-neutral-900"},Sse={class:"relative p-1 border-gray-200 border-y dark:border-neutral-800"},Cse={class:"p-1 pt-3 max-h-80 overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Tse={key:0,class:"block px-3 mb-2 text-xs text-gray-500 dark:text-neutral-500"},Ase={class:"space-y-1"},Mse={key:1,class:"flex items-center px-3 text-[13px] py-1.5 px-3 rounded-md cursor-pointer group"};function Dse(t,e,n,r,i,s){const a=h.resolveComponent("IconColumns"),o=h.resolveComponent("AdminTableColumnsHiddenItem");return h.openBlock(),h.createElementBlock("div",kse,[h.createElementVNode("button",{onClick:e[0]||(e[0]=(...p)=>s.toggleVisible&&s.toggleVisible(...p)),class:"py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(a,{height:"20",width:"16"})]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var p,g;return[i.visible?(h.openBlock(),h.createElementBlock("div",Ese,[e[2]||(e[2]=h.createElementVNode("div",{class:"flex items-center justify-between h-[48px] px-4 py-2 gap-x-2 text-sm font-medium text-gray-800"}," Колонки ",-1)),h.createElementVNode("div",Sse,[h.withDirectives(h.createElementVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=y=>i.searchValue=y),type:"text",class:"py-1.5 px-3 block w-full border-transparent rounded-lg sm:text-sm text-base placeholder:text-gray-500 hover:bg-gray-100 focus:outline-none focus:border-transparent focus:ring-0 focus:bg-gray-100 disabled:opacity-100 disabled:pointer-events-none dark:bg-transparent dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:ring-neutral-600 dark:focus:bg-neutral-800",placeholder:"Search",autofocus:""},null,512),[[h.vModelText,i.searchValue]])]),h.createElementVNode("div",Cse,[(p=s.filteredColumn)!=null&&p.length?(h.openBlock(),h.createElementBlock("span",Tse," Оберіть колонки для відображення ")):h.createCommentVNode("",!0),h.createElementVNode("div",Ase,[(g=s.filteredColumn)!=null&&g.length?(h.openBlock(!0),h.createElementBlock(h.Fragment,{key:0},h.renderList(s.filteredColumn,(y,v)=>(h.openBlock(),h.createBlock(o,{key:v,column:y,onUpdateColumn:s.updateColumn},null,8,["column","onUpdateColumn"]))),128)):(h.openBlock(),h.createElementBlock("div",Mse," Нічого не знайдено "))])])])):h.createCommentVNode("",!0)]}),_:1})],512)}const Ise=Ve(wse,[["render",Dse]]),Pse={},Rse={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus"};function Ose(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Rse,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const Nse={components:{IconPlus:Qh,IconMinus:Ve(Pse,[["render",Ose]])},props:{title:String,defaultValue:{type:Boolean,default:()=>!1}},data(){return{expanded:this.defaultValue}}},Bse={class:"hs-accordion"},zse={class:"py-0.5 flex items-center gap-x-0.5 w-full"},Lse={class:"text-sm font-medium"},Vse={class:"relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b"};function Fse(t,e,n,r,i,s){const a=h.resolveComponent("IconPlus"),o=h.resolveComponent("IconMinus");return h.openBlock(),h.createElementBlock("div",null,[h.createElementVNode("div",null,[h.createElementVNode("div",Bse,[h.createElementVNode("div",zse,[h.createElementVNode("div",{onClick:e[0]||(e[0]=p=>i.expanded=!i.expanded),class:"rounded-md cursor-pointer grow"},[h.createElementVNode("span",Lse,h.toDisplayString(n.title),1)]),h.createElementVNode("button",{class:"flex items-center justify-center rounded-md size-6 hover:bg-gray-100",onClick:e[1]||(e[1]=p=>i.expanded=!i.expanded)},[i.expanded?(h.openBlock(),h.createBlock(o,{key:1,width:"14"})):(h.openBlock(),h.createBlock(a,{key:0}))])]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",Vse,[h.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[h.vShow,i.expanded]])]),_:3})])])])}const $se={components:{AdminComponentIs:ef,AdminTree:Ve(Nse,[["render",Fse],["__scopeId","data-v-c6318482"]]),VsNoData:tI,VsWidgetComments:JT,VsWidgetMap:lb,VsWidgetFileList:h2},props:{table:String,columns:Array,row:Object}},jse={class:"hs-accordion border-gray-100 w-[360px] shrink-0 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",style:{height:"calc(100vh - 310px)"}},Hse={class:"border-l",style:{height:"calc(100vh - 360px)"}},Use={class:"flow-root mt-[10px]"},Wse={class:"-my-3 text-sm divide-y divide-gray-100"},qse={class:"flex py-3 sm:grid-cols-3 sm:gap-4"},Gse={class:"font-medium text-black w-[50%]"},Yse={class:"text-gray-700 sm:col-span-2 w-[50%]"},Zse={class:"table-info-card"},Xse={class:"table-info-card"};function Kse(t,e,n,r,i,s){var E,T,D;const a=h.resolveComponent("AdminComponentIs"),o=h.resolveComponent("AdminTree"),p=h.resolveComponent("VsWidgetMap"),g=h.resolveComponent("VsNoData"),y=h.resolveComponent("VsWidgetComments"),v=h.resolveComponent("VsWidgetFileList");return h.openBlock(),h.createElementBlock("div",jse,[e[0]||(e[0]=h.createElementVNode("div",{class:"p-[10px] pl-[18px] pb-[18px] border-b"},[h.createElementVNode("h2",{class:"text-sm font-medium"},"Інформація про об'єкт")],-1)),h.createElementVNode("div",Hse,[(T=(E=t.$route)==null?void 0:E.query)!=null&&T.card?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[n.row?(h.openBlock(),h.createBlock(o,{key:0,defaultValue:!0,title:"Основна інформація",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>[h.createElementVNode("div",Use,[h.createElementVNode("dl",Wse,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.columns,N=>(h.openBlock(),h.createElementBlock("div",qse,[h.createElementVNode("dt",Gse,h.toDisplayString((N==null?void 0:N.ua)||(N==null?void 0:N.title)),1),h.createElementVNode("dd",Yse,[h.createVNode(a,{row:n.row,column:N,table:n.table},null,8,["row","column","table"])])]))),256))])])]),_:1})):h.createCommentVNode("",!0),(D=n.row)!=null&&D.geom?(h.openBlock(),h.createBlock(o,{key:1,title:"Карта",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N,B;return[(N=n.row)!=null&&N.geom?(h.openBlock(),h.createBlock(p,{key:0,geometry:(B=n.row)==null?void 0:B.geom,zoom:14},null,8,["geometry"])):(h.openBlock(),h.createBlock(g,{key:1,title:"У об'єкта відсутня геометрія",text:"",class:"[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"}))]}),_:1})):h.createCommentVNode("",!0),h.createVNode(o,{title:"Коментарі",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N;return[h.createElementVNode("div",Zse,[h.createVNode(y,{id:(N=n.row)==null?void 0:N.id},null,8,["id"])])]}),_:1}),h.createVNode(o,{title:"Файли",class:"border-b p-[10px] py-[16px]"},{default:h.withCtx(()=>{var N,B;return[h.createElementVNode("div",Xse,[(h.openBlock(),h.createBlock(v,{key:(N=n.row)==null?void 0:N.id,id:(B=n.row)==null?void 0:B.id},null,8,["id"]))])]}),_:1})],64)):(h.openBlock(),h.createBlock(g,{key:1,text:"Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"}))])])}const Jse=Ve($se,[["render",Kse]]),Qse={emits:["filterChange"],props:{scheme:{type:Object},onFilters:{type:Number},table:{type:String}},components:{IconFilter:rA},data(){return{isFilters:!1}},methods:{closeFilter({target:t}){this.isFilters&&t.classList.contains("filter-container")&&(this.isFilters=!1)}}},eoe={key:0,class:"px-[7px] text-[10px] py-[1px] font-[700] text-white bg-blue-500 rounded-full"},toe={class:"filter-content h-screen bg-white w-[400px] overflow-x-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function noe(t,e,n,r,i,s){const a=h.resolveComponent("IconFilter"),o=h.resolveComponent("VsFilter");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createElementVNode("button",{onClick:e[0]||(e[0]=p=>i.isFilters=!i.isFilters),class:"py-2 px-2.5 max-h-[34px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none"},[h.createVNode(a,{height:"16",width:"16"}),e[4]||(e[4]=h.createTextVNode(" Фільтри ")),n.onFilters?(h.openBlock(),h.createElementBlock("span",eoe,h.toDisplayString(n.onFilters),1)):h.createCommentVNode("",!0)]),h.createVNode(h.Transition,{name:"fade"},{default:h.withCtx(()=>{var p;return[(h.openBlock(),h.createBlock(h.Teleport,{to:"#modal"},[h.withDirectives(h.createElementVNode("div",{onClick:e[3]||(e[3]=(...g)=>s.closeFilter&&s.closeFilter(...g)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[12] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.2)]"},[h.createElementVNode("div",toe,[(p=n.scheme)!=null&&p.length?(h.openBlock(),h.createBlock(o,{key:0,ref:"filter",scheme:n.scheme,layout:"default","apply-vue-router":"",history:"",token:n.table,name:"filter",footer:!0,background:!0,onFilterChange:e[1]||(e[1]=g=>t.$emit("filterChange",g)),closeFilterBtn:!0,onFilterClose:e[2]||(e[2]=g=>i.isFilters=!1)},null,8,["scheme","token"])):h.createCommentVNode("",!0)])],512),[[h.vShow,i.isFilters]])]))]}),_:1})],64)}const roe=Ve(Qse,[["render",noe]]),ioe={props:{tabsList:{type:Array,default:()=>[]},filterState:String}},soe={class:"relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700","aria-label":"Tabs",role:"tablist","aria-orientation":"horizontal"},ooe=["onClick"];function aoe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("nav",soe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.tabsList,a=>(h.openBlock(),h.createElementBlock("button",{onClick:o=>t.$emit("update:filterState",a==null?void 0:a.name),class:h.normalizeClass(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active",{" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800":(a==null?void 0:a.name)===n.filterState}])},h.toDisplayString(a==null?void 0:a.label),11,ooe))),256))])}const loe=Ve(ioe,[["render",aoe]]),coe={},doe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-filter"};function uoe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",doe,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const hoe={components:{IconFilter2:Ve(coe,[["render",uoe]]),IconCheck2:T0},props:{filterCustom:String,customList:Array}},foe={class:"py-2 max-h-[34px] px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},poe={class:"flex flex-col p-[2px] gap-[2px] w-[170px]"},moe=["onClick"],goe={class:"text-sm text-gray-800"};function yoe(t,e,n,r,i,s){const a=h.resolveComponent("IconFilter2"),o=h.resolveComponent("IconCheck2"),p=h.resolveComponent("VsPopover");return h.openBlock(),h.createBlock(p,{ref:"popover",placement:"bottom"},{reference:h.withCtx(()=>[h.createElementVNode("button",foe,[h.createVNode(a,{height:"20",width:"20"})])]),default:h.withCtx(()=>[h.createElementVNode("div",poe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.customList,(g,y)=>(h.openBlock(),h.createElementBlock("button",{onClick:v=>{var E;t.$emit("update:filterCustom",g==null?void 0:g.name),(E=t.$refs)==null||E.popover.togglePopover()},key:y,class:h.normalizeClass(["flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",{"bg-gray-100":n.filterCustom===(g==null?void 0:g.name)}])},[h.createElementVNode("span",goe,h.toDisplayString(g==null?void 0:g.label),1),n.filterCustom===(g==null?void 0:g.name)?(h.openBlock(),h.createBlock(o,{key:0,class:"ml-auto size-3 shrink-0"})):h.createCommentVNode("",!0)],10,moe))),128)),h.createElementVNode("button",{class:"flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",onClick:e[0]||(e[0]=g=>{var y;t.$emit("update:filterCustom",void 0),(y=t.$refs)==null||y.popover.togglePopover()})}," Скинути фільтри ")])]),_:1},512)}const boe=Ve(hoe,[["render",yoe]]),_oe={class:"flex items-center gap-x-2"},xoe={__name:"admin-table-custom-buttons",props:{slots:Object},setup(t){var o,p,g,y,v;const{asyncTemplateSlot:e}=(v=(y=(g=(p=(o=h.getCurrentInstance())==null?void 0:o.appContext)==null?void 0:p.app)==null?void 0:g.config)==null?void 0:y.globalProperties)==null?void 0:v.utils,n=h.ref(""),r=h.ref(""),i=t,s=()=>{var E,T,D,N,B;if((E=i.slots)!=null&&E.panelLeft||(r.value="div"),(D=(T=i.slots)==null?void 0:T.panelLeft)!=null&&D.includes("<")){const F=e("PanelLeft",(N=i.slots)==null?void 0:N.panelLeft,["name"]);r.value=F}else r.value=(B=i.slots)==null?void 0:B.panelLeft},a=()=>{var E,T,D,N,B;if((E=i.slots)!=null&&E.panelRight||(n.value="div"),(D=(T=i.slots)==null?void 0:T.panelRight)!=null&&D.includes("<")){const F=e("PanelRight",(N=i.slots)==null?void 0:N.panelRight,["name"]);n.value=F}else n.value=(B=i.slots)==null?void 0:B.panelRight};return s(),a(),(E,T)=>(h.openBlock(),h.createElementBlock("div",_oe,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(r.value))),(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.value)))]))}},voe=(t,e=300)=>{let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}},woe={__name:"admin-custom-button-add",props:{slots:Object},setup(t){var s,a,o,p,g;const{asyncTemplateSlot:e}=(g=(p=(o=(a=(s=h.getCurrentInstance())==null?void 0:s.appContext)==null?void 0:a.app)==null?void 0:o.config)==null?void 0:p.globalProperties)==null?void 0:g.utils,n=h.ref(""),r=t;return(()=>{var y,v,E,T,D;if((y=r.slots)!=null&&y.addButton||(n.value="div"),(E=(v=r.slots)==null?void 0:v.addButton)!=null&&E.includes("<")){const N=e("addButton",(T=r.slots)==null?void 0:T.addButton,["IconPlus"]);n.value=N}else n.value=(D=r.slots)==null?void 0:D.addButton})(),(y,v)=>n.value?(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.value),{key:0,IconPlus:Qh})):h.createCommentVNode("",!0)}},koe={key:0,class:"px-1 py-3 text-gray-800 font-[500]"},Eoe={key:1,class:"px-1 py-3 text-gray-800 font-[700]"},Soe={__name:"admin-table-totals-list",props:{columns:{type:Array,default:()=>[]},agg:{type:Object,default:()=>{}}},setup(t){return(e,n)=>(h.openBlock(),h.createElementBlock("tr",null,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.columns,r=>{var i;return h.openBlock(),h.createElementBlock(h.Fragment,{key:r==null?void 0:r.name},[(i=t.agg)!=null&&i[r==null?void 0:r.name]?(h.openBlock(),h.createElementBlock("td",koe,[h.createVNode(ef,{column:r,row:t.agg},null,8,["column","row"])])):(h.openBlock(),h.createElementBlock("td",Eoe))],64)}),128))]))}},Coe={},Toe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function Aoe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Toe,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Moe=Ve(Coe,[["render",Aoe]]),Doe={},Ioe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function Poe(t,e,n,r,i,s){return h.openBlock(),h.createElementBlock("svg",Ioe,e[0]||(e[0]=[h.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),h.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const Roe=Ve(Doe,[["render",Poe]]),Ooe=h.defineComponent({components:{IconChevronDown:Moe,IconCheck:Roe},props:{total:{type:Number,default:()=>0},pageSize:{type:Number,default:()=>20},maxPages:{type:Number,default:()=>10},defaultPage:{type:Number,default:()=>1},pageSizes:{type:Array,default:[]}},data(){return{page:1,pages:[],isDropdownOpen:!1,pageSizeLocal:null}},mounted(){this.pageSizeLocal=this.pageSize},watch:{total:{immediate:!0,handler(){this.initPages()}},defaultPage:{immediate:!0,handler(t){this.page=t,this.updatePages(t)}},pageSizeLocal(t,e){e&&(this.isDropdownOpen=!1,this.setCurrentPage(1))}},computed:{pagesCount(){return Math.ceil(this.total/this.pageSizeLocal)},disableNextClick(){return this.page>=this.pagesCount},disablePrevClick(){return this.page<=1}},methods:{initPages(){if(this.total<=0){this.pages=[1];return}this.updatePages(this.page)},handleSetPage(t){const e=t.replace(/\D/g,"");if(e>this.pagesCount){this.$refs.currentPage.innerText=this.page;return}else this.$refs.currentPage.innerText=e;this.setCurrentPage(e)},updatePages(t){const e=Math.floor(this.maxPages/2);let n=Math.max(t-e,1),r=n+this.maxPages-1;r>this.pagesCount&&(r=this.pagesCount,n=Math.max(r-this.maxPages+1,1)),this.pages=Array.from({length:r-n+1},(i,s)=>n+s)},handleClickPrev(){this.disablePrevClick||(this.setCurrentPage(this.page-1),this.updatePages(this.page),this.$emit("prevClick"))},handleClickNext(){this.disableNextClick||(this.setCurrentPage(parseInt(this.page)+1),this.updatePages(this.page),this.$emit("nextClick"))},setCurrentPage(t){t<1||t>this.pagesCount||this.page===t||(this.page=t,this.$emit("pageChange",this.page,this.pageSizeLocal),this.updatePages(t))}}}),Noe={class:"flex items-center w-full"},Boe={class:"flex items-center mx-[8px]"},zoe={class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},Loe={key:0,class:"flex items-center justify-center ml-3 gap-x-5"},Voe={class:"relative"},Foe={class:"z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 dark:divide-neutral-700 absolute bottom-[100%]"},$oe=["onClick"];function joe(t,e,n,r,i,s){const a=h.resolveComponent("IconChevronDown"),o=h.resolveComponent("IconCheck");return h.openBlock(),h.createElementBlock("nav",Noe,[h.createElementVNode("button",{type:"button",onClick:e[0]||(e[0]=(...p)=>t.handleClickPrev&&t.handleClickPrev(...p)),class:h.normalizeClass(["min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",{"opacity-50 pointer-events-none":t.disablePrevClick}])},[h.createVNode(a,{height:"16",width:"16",class:"rotate-90"})],2),h.createElementVNode("div",Boe,[h.createElementVNode("span",{ref:"currentPage",contenteditable:"true",onBlur:e[1]||(e[1]=p=>t.handleSetPage(p.target.innerText)),class:"min-h-[38px] max-h-[38px] overflow-hidden min-w-[38px] flex justify-center items-center bg-stone-100 text-stone-800 py-2 px-3 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:text-white"},h.toDisplayString(t.page),545),e[4]||(e[4]=h.createElementVNode("span",{class:"min-h-[38px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},"з",-1)),h.createElementVNode("span",zoe,h.toDisplayString(t.pagesCount),1)]),h.createElementVNode("button",{type:"button",onClick:e[2]||(e[2]=(...p)=>t.handleClickNext&&t.handleClickNext(...p)),class:h.normalizeClass([{"opacity-50 pointer-events-none":t.disableNextClick},"min-h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"])},[h.createVNode(a,{height:"16",width:"16",class:"-rotate-90"})],2),t.pageSizes.length?(h.openBlock(),h.createElementBlock("div",Loe,[h.createElementVNode("div",Voe,[h.withDirectives(h.createElementVNode("div",Foe,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.pageSizes,p=>(h.openBlock(),h.createElementBlock("button",{type:"button",class:"w-full flex items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm",onClick:g=>t.pageSizeLocal=p},[h.createTextVNode(h.toDisplayString(p)+" ",1),p===t.pageSizeLocal?(h.openBlock(),h.createBlock(o,{key:0,width:"14",height:"14",class:"text-blue-600"})):h.createCommentVNode("",!0)],8,$oe))),256))],512),[[h.vShow,t.isDropdownOpen]]),t.pageSizes.length?(h.openBlock(),h.createElementBlock("button",{key:0,type:"button",class:"text-sm h-[32px] min-w-8 py-3 px-3.5 inline-flex items-center gap-x-1 rounded-lg border border-gray-200 text-gray-800 shadow-sm hover:bg-gray-50 focus:outline-none focus:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[3]||(e[3]=p=>t.isDropdownOpen=!t.isDropdownOpen)},[h.createTextVNode(h.toDisplayString(t.pageSizeLocal)+" ",1),h.createVNode(a,{height:"16",width:"16"})])):h.createCommentVNode("",!0)])])):h.createCommentVNode("",!0)])}const Hoe={props:{table:String,title:String},components:{AdminTableControl:Uie,AdminTableExport:fse,AdminTableColumnsHidden:Ise,AdminTableColumn:Oie,AdminNodata:tx,IconPlus:Qh,IconSearch:mv,AdminTableCardInfo:Jse,IconOpenCard:QD,AdminComponentIs:ef,AdminTableFilters:roe,AdminTableTabs:loe,AdminTableCustomFilters:boe,AdminTableCustomButtons:xoe,AdminCustomButtonAdd:woe,AdminTableTotalsList:Soe,AdminTablePagination:Ve(Ooe,[["render",joe]])},data(){return{tableData:{},filterScheme:[],page:1,searchValue:"",limit:0,filters:null,activeColumn:"",isVisibleCardInfo:!1,onFilters:0,filterState:null,filterCustom:null,visibleColumns:[],initialHiddenColumns:""}},async mounted(){await this.checkUrlMounted(),await this.getTableData(),await this.getFilters(),window.addEventListener("reloadTablePage",this.getTableData)},unmounted(){window.removeEventListener("reloadTablePage",this.getTableData)},computed:{defaultPage(){var t,e;return((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1},columns(){var t,e;return(e=(t=this.tableData)==null?void 0:t.columns)==null?void 0:e.filter(n=>(n==null?void 0:n.hidden)!==!0)},isForm(){var t,e,n;return((t=this.tableData)==null?void 0:t.form)&&((n=(e=this.tableData)==null?void 0:e.actions)==null?void 0:n.includes("add"))},isNoData(){var t,e;return!((t=this.tableData)!=null&&t.rows)||!((e=this.columns)!=null&&e.length)},activeCardRow(){var t,e;return((e=(t=this.tableData)==null?void 0:t.rows)==null?void 0:e.find(n=>{var r,i;return(n==null?void 0:n.id)===((i=(r=this.$route)==null?void 0:r.query)==null?void 0:i.card)}))||{}},getActions(){var t;return(t=this.tableData)==null?void 0:t.actions}},watch:{async table(){this.tableData=null,await this.getTableData()},searchValue:{handler:voe(async function(t){var e;await this.getTableData(),this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,search:t||void 0}})},500)},$route:{handler(t,e){var n,r;((n=t==null?void 0:t.params)==null?void 0:n.catchAll)!==((r=e==null?void 0:e.params)==null?void 0:r.catchAll)&&(this.visibleColumns=[],this.unmountedData(),this.getFilters())},deep:!0},limit(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,limit:t}})},filterState(t){var e;t&&(this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,filterState:t}}),this.getTableData())},filterCustom(t){var e;this.$router.replace({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,custom:t}}),this.getTableData()},columns(t){var e,n,r,i;this.visibleColumns=t==null?void 0:t.map(s=>s==null?void 0:s.name),this.initialHiddenColumns===((e=this.visibleColumns)==null?void 0:e.join(","))&&(this.visibleColumns=[]),this.$router.replace({...this.$route,query:{...(n=this.$route)==null?void 0:n.query,columns:(r=this.visibleColumns)!=null&&r.length?(i=this.visibleColumns)==null?void 0:i.join(","):void 0}})}},methods:{async checkUrlMounted(){var t,e,n,r,i,s,a,o,p,g,y,v,E,T,D,N,B,F,X;this.page=((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.page)||1,this.limit=((r=(n=this.$route)==null?void 0:n.query)==null?void 0:r.limit)||20,this.filters=((a=decodeURI((s=(i=this.$route)==null?void 0:i.query)==null?void 0:s.filter))==null?void 0:a.replaceAll("+"," "))||null,this.filters&&(this.onFilters=((p=(o=this.filters)==null?void 0:o.split("="))==null?void 0:p.length)-1),this.filterState=((y=(g=this.$route)==null?void 0:g.query)==null?void 0:y.filterState)||null,this.filterCustom=((E=(v=this.$route)==null?void 0:v.query)==null?void 0:E.custom)||null,this.searchValue=((D=(T=this.$route)==null?void 0:T.query)==null?void 0:D.search)||"",this.visibleColumns=((F=(B=(N=this.$route)==null?void 0:N.query)==null?void 0:B.columns)==null?void 0:F.split(","))||[],(X=this.$route)!=null&&X.query.card&&(this.isVisibleCardInfo=!0)},rowWidth(t){var n,r;const e=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.find(i=>i.name===t);if(e){const i=e==null?void 0:e.width;return typeof i=="number"?`${i}px`:i!=null&&i.includes("px")?i:`${i}px`}},unmountedData(){this.page=1,this.visibleColumns=[],this.filterCustom=null,this.filterState=null,this.isVisibleCardInfo=!1,this.filterScheme=null,this.filters=null,this.onFilters=0,this.searchValue=""},async getTableData(){var t,e,n,r,i,s,a,o,p,g,y;try{const{data:v}=await tt.get(`/api/template/table/${this.table}`),E=await tt.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null,order:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.sort)||null,state:this.filterState||null,custom:this.filterCustom||null}});this.tableData={...v,...(E==null?void 0:E.data)||{}},this.initialHiddenColumns=(s=(i=(r=(n=this.tableData)==null?void 0:n.columns)==null?void 0:r.filter(T=>(T==null?void 0:T.hidden)!==!0))==null?void 0:i.map(T=>T==null?void 0:T.name))==null?void 0:s.join(","),(a=this.visibleColumns)!=null&&a.length?(o=this.tableData)==null||o.columns.forEach(T=>{var D;(D=this.visibleColumns)!=null&&D.includes(T==null?void 0:T.name)?T.hidden=!1:T.hidden=!0}):this.visibleColumns=(y=(g=(p=this.tableData)==null?void 0:p.columns)==null?void 0:g.filter(T=>(T==null?void 0:T.hidden)!==!0))==null?void 0:y.map(T=>T==null?void 0:T.name)}catch{}},async getFilters(){var t;try{const{data:e}=await tt.get(`/api/table-filter/${this.table}`);this.filterScheme=(t=e==null?void 0:e.list)==null?void 0:t.map(n=>({...n,label:(n==null?void 0:n.label)||(n==null?void 0:n.ua)}))}catch{}},async handlePageChange(t,e){const n=this.$route.query;this.page=t,await this.$router.replace({query:{...n,page:t,limit:e}}),await this.getTableData()},async filterChange({url:t,state:e}){var n;this.filters=t!=="no-url"?t:null,this.onFilters=(n=Object.entries(e))==null?void 0:n.length,this.page=1,await this.getTableData()},changeActiveColumn(t){this.activeColumn=t,this.getTableData()},pushToCard(t){var e;((e=this.tableData)==null?void 0:e.card)===!1||this.$router.push(`/card/${this.table}/${t}`)},pushToLinkCard(t,e){t!=null&&t.link&&this.$router.push(`/card/${t==null?void 0:t.link}/${e==null?void 0:e[t==null?void 0:t.name]}`)},changeActiveCardInfo(t){var e;this.isVisibleCardInfo&&this.$router.push({...this.$route,query:{...(e=this.$route)==null?void 0:e.query,card:t}})},toggleCardInfo(){var t;this.isVisibleCardInfo=!this.isVisibleCardInfo,this.isVisibleCardInfo||this.$router.push({...this.$route,query:{...(t=this.$route)==null?void 0:t.query,card:void 0}})},getCustomStyles(t){return[t!=null&&t.link?" text-blue-600 hover:underline decoration-2":"",t!=null&&t.align?` text-${(t==null?void 0:t.align)||"left"}`:"",`text-${(t==null?void 0:t.wrap)||"wrap"}`]}}},Uoe={class:"w-[calc(100vw - 320px)] bg-gray-50"},Woe={class:"h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl"},qoe={class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"},Goe={style:{height:"calc(100vh - 155px)"},class:"bg-gray-50 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"},Yoe={class:"bg-white w-full rounded-xl border p-[20px] pr-0"},Zoe={class:"flex"},Xoe={class:"flex gap-[6px] ml-auto"},Koe={class:"inline-block w-full align-middle"},Joe={key:0,class:"relative min-w-full text-[13px] divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"},Qoe={class:"sticky top-[-1px] z-[2] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},eae={class:"right-0"},tae={key:0,class:"w-[70px] sticky right-0 top-0"},nae={class:"divide-y divide-gray-200 z-[1] relative"},rae=["onClick"],iae=["onClick"],sae={class:"p-[10px] flex justify-start items-center w-full"},oae={class:"w-[200px] md:inline-flex hidden"},aae={class:"text-sm text-gray-600 dark:text-neutral-400"},lae={class:"font-semibold text-gray-800 dark:text-neutral-200"},cae={key:0},dae={key:0,class:"font-semibold text-gray-800 dark:text-neutral-200"};function uae(t,e,n,r,i,s){var Ne,at,Je,mt,nt,Ct,$t,jt,Ot,qt,wn,yn,An,bn,fr,Hn,zn,Un,Ae,Ue,Xe,ct,Ht,rn,Pt,It,cn;const a=h.resolveComponent("AdminCustomButtonAdd"),o=h.resolveComponent("IconPlus"),p=h.resolveComponent("router-link"),g=h.resolveComponent("AdminTableTabs"),y=h.resolveComponent("IconSearch"),v=h.resolveComponent("VsText"),E=h.resolveComponent("AdminTableCustomButtons"),T=h.resolveComponent("AdminTableCustomFilters"),D=h.resolveComponent("AdminTableColumnsHidden"),N=h.resolveComponent("AdminTableExport"),B=h.resolveComponent("AdminTableFilters"),F=h.resolveComponent("IconOpenCard"),X=h.resolveComponent("AdminTableColumn"),te=h.resolveComponent("AdminComponentIs"),H=h.resolveComponent("AdminTableControl"),ke=h.resolveComponent("AdminTableTotalsList"),ge=h.resolveComponent("AdminNodata"),Se=h.resolveComponent("AdminTablePagination"),Pe=h.resolveComponent("AdminTableCardInfo");return h.openBlock(),h.createElementBlock("div",Uoe,[h.createElementVNode("div",Woe,[h.createElementVNode("h2",qoe,h.toDisplayString(n.title),1),s.isForm?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(at=(Ne=i.tableData)==null?void 0:Ne.slots)!=null&&at.addButton?(h.openBlock(),h.createBlock(a,{key:0,slots:(Je=i.tableData)==null?void 0:Je.slots},null,8,["slots"])):(h.openBlock(),h.createBlock(p,{key:1,to:`/add?table=${(nt=(mt=t.$route)==null?void 0:mt.params)==null?void 0:nt.catchAll}`,class:"inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"},{default:h.withCtx(()=>[h.createVNode(o,{height:"16",width:"16"}),e[5]||(e[5]=h.createTextVNode(" Додати "))]),_:1},8,["to"]))],64)):h.createCommentVNode("",!0)]),h.createElementVNode("div",Goe,[h.createElementVNode("div",Yoe,[($t=(Ct=i.tableData)==null?void 0:Ct.filterState)!=null&&$t.length?(h.openBlock(),h.createBlock(g,{key:0,tabsList:(jt=i.tableData)==null?void 0:jt.filterState,filterState:i.filterState,"onUpdate:filterState":e[0]||(e[0]=me=>i.filterState=me)},null,8,["tabsList","filterState"])):h.createCommentVNode("",!0),h.createElementVNode("div",Zoe,[h.createElementVNode("div",{class:h.normalizeClass([i.isVisibleCardInfo?"w-[calc(100%-360px)]":"w-full"])},[h.createElementVNode("div",{class:h.normalizeClass(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative",{"pr-[20px]":!i.isVisibleCardInfo}])},[h.createVNode(y,{height:"14",width:"14",class:"absolute top-[10px] left-[14px] text-gray-500 z-[1]"}),h.createVNode(v,{modelValue:i.searchValue,"onUpdate:modelValue":e[1]||(e[1]=me=>i.searchValue=me),placeholder:"Пошук...",clearable:!0,class:"[&>input]:py-[7px] [&>input]:max-h-[36px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"},null,8,["modelValue"]),h.createElementVNode("div",Xoe,[(Ot=i.tableData)!=null&&Ot.slots?(h.openBlock(),h.createBlock(E,{key:0,slots:(qt=i.tableData)==null?void 0:qt.slots},null,8,["slots"])):h.createCommentVNode("",!0),(yn=(wn=i.tableData)==null?void 0:wn.filterCustom)!=null&&yn.length?(h.openBlock(),h.createBlock(T,{key:1,customList:(An=i.tableData)==null?void 0:An.filterCustom,filterCustom:i.filterCustom,"onUpdate:filterCustom":e[2]||(e[2]=me=>i.filterCustom=me)},null,8,["customList","filterCustom"])):h.createCommentVNode("",!0),h.createVNode(D,{columns:(bn=i.tableData)==null?void 0:bn.columns,onUpdateColumns:e[3]||(e[3]=me=>i.tableData.columns=me)},null,8,["columns"]),((fr=i.tableData)==null?void 0:fr.export)!==!1?(h.openBlock(),h.createBlock(N,{key:2,table:n.table,columns:(Hn=i.tableData)==null?void 0:Hn.columns,page:i.page,"filter-state":i.filterState,"filter-custom":i.filterCustom,filters:i.filters},null,8,["table","columns","page","filter-state","filter-custom","filters"])):h.createCommentVNode("",!0),(zn=i.filterScheme)!=null&&zn.length?(h.openBlock(),h.createBlock(B,{key:3,scheme:i.filterScheme,onFilters:i.onFilters,table:n.table,onFilterChange:s.filterChange},null,8,["scheme","onFilters","table","onFilterChange"])):h.createCommentVNode("",!0),h.createElementVNode("button",{onClick:e[4]||(e[4]=(...me)=>s.toggleCardInfo&&s.toggleCardInfo(...me)),class:"py-2 px-2.5 max-h-[34px] md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},[h.createVNode(F,{class:h.normalizeClass({"rotate-180 duration-300":!i.isVisibleCardInfo})},null,8,["class"])])])],2),h.createElementVNode("div",{class:h.normalizeClass(["flex items-start justify-start w-full space-y-5",{"pr-[20px]":!i.isVisibleCardInfo}])},[h.createElementVNode("div",{style:h.normalizeStyle({height:(Ae=(Un=i.tableData)==null?void 0:Un.filterState)!=null&&Ae.length?"calc(100vh - 370px)":"calc(100vh - 330px)"}),class:"overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[h.createElementVNode("div",Koe,[s.isNoData?(h.openBlock(),h.createBlock(ge,{key:1})):(h.openBlock(),h.createElementBlock("table",Joe,[h.createElementVNode("thead",Qoe,[h.createElementVNode("tr",eae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(s.columns,me=>(h.openBlock(),h.createBlock(X,{key:me.name,style:h.normalizeStyle({width:s.rowWidth(me==null?void 0:me.name),textAlign:me==null?void 0:me.align,wordBreak:me==null?void 0:me.wrap}),data:me,activeColumn:i.activeColumn,onChangeActive:s.changeActiveColumn},null,8,["style","data","activeColumn","onChangeActive"]))),128)),(Xe=(Ue=s.getActions)==null?void 0:Ue.filter(me=>me!=="add"&&me!=="view"))!=null&&Xe.length?(h.openBlock(),h.createElementBlock("th",tae)):h.createCommentVNode("",!0)])]),h.createElementVNode("tbody",nae,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((ct=i.tableData)==null?void 0:ct.rows,(me,En)=>{var Di,Zt,dn,Rr,Or,yr,ri,br,Ii,Pi,$e,ii;return h.openBlock(),h.createElementBlock("tr",{key:(me==null?void 0:me.id)||En,class:h.normalizeClass({"bg-gray-50":((Zt=(Di=t.$route)==null?void 0:Di.query)==null?void 0:Zt.card)===(me==null?void 0:me.id)})},[h.createElementVNode("td",{class:h.normalizeClass(["px-1 py-3 text-gray-600 pe-4",[(dn=s.columns[0])!=null&&dn.align?`text-${((Rr=s.columns[0])==null?void 0:Rr.align)||"left"}`:""]])},[h.createElementVNode("button",{onClick:Wn=>{s.pushToCard(me==null?void 0:me.id),s.pushToLinkCard(s.columns[0],me)},class:h.normalizeClass(["font-medium",[...s.getCustomStyles(s.columns[0]),((Or=this.tableData)==null?void 0:Or.card)===!1?"":" text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"]])},[h.createVNode(te,{row:me,column:s.columns[0],table:n.table,onUpdateTable:s.getTableData},null,8,["row","column","table","onUpdateTable"])],10,rae)],2),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList((yr=s.columns)==null?void 0:yr.slice(1),Wn=>(h.openBlock(),h.createElementBlock("td",{onClick:Ri=>{s.changeActiveCardInfo(me==null?void 0:me.id),s.pushToLinkCard(Wn,me)},class:h.normalizeClass(["px-1 py-3 text-gray-600 pe-3",s.getCustomStyles(Wn)]),key:Wn.name},[h.createVNode(te,{row:me,column:Wn,table:n.table,onUpdateTable:s.getTableData},null,8,["row","column","table","onUpdateTable"])],10,iae))),128)),(br=(ri=s.getActions)==null?void 0:ri.filter(Wn=>Wn!=="add"&&Wn!=="view"))!=null&&br.length?(h.openBlock(),h.createElementBlock("td",{key:0,class:h.normalizeClass(["text-center sticky right-0 w-[80px] px-[10px]",{"bg-gray-50":((Pi=(Ii=t.$route)==null?void 0:Ii.query)==null?void 0:Pi.card)===(me==null?void 0:me.id),"bg-white":((ii=($e=t.$route)==null?void 0:$e.query)==null?void 0:ii.card)!==(me==null?void 0:me.id)}])},[h.createVNode(H,{actions:s.getActions,isForm:s.isForm,item:me,table:n.table,onUpdateTable:s.getTableData},null,8,["actions","isForm","item","table","onUpdateTable"])],2)):h.createCommentVNode("",!0)],2)}),128))]),h.createVNode(ke,{columns:s.columns,agg:(Ht=i.tableData)==null?void 0:Ht.agg},null,8,["columns","agg"])]))])],4)],2),h.createElementVNode("div",sae,[h.createElementVNode("div",oae,[h.createElementVNode("p",aae,[h.createElementVNode("span",lae,[h.createTextVNode(h.toDisplayString(i.filters||i.searchValue?"Відображено":"Об'єктів")+" "+h.toDisplayString(((rn=i.tableData)==null?void 0:rn.count)||"0 ")+" ",1),i.filters||i.searchValue?(h.openBlock(),h.createElementBlock("span",cae," з")):h.createCommentVNode("",!0)]),i.filters||i.searchValue?(h.openBlock(),h.createElementBlock("span",dae,h.toDisplayString(" "+((Pt=i.tableData)==null?void 0:Pt.filtered)||0),1)):h.createCommentVNode("",!0)])]),Math.ceil(((It=i.tableData)==null?void 0:It.filtered)/i.limit)>1?(h.openBlock(),h.createBlock(Se,{key:0,class:"justify-end","default-page":parseInt(s.defaultPage),total:((cn=i.tableData)==null?void 0:cn.filtered)||0,onPageChange:s.handlePageChange,pageSize:parseInt(i.limit),pageSizes:[10,20,50,100]},null,8,["default-page","total","onPageChange","pageSize"])):h.createCommentVNode("",!0)])],2),h.createVNode(h.Transition,{name:"slide-fade"},{default:h.withCtx(()=>{var me;return[i.isVisibleCardInfo?(h.openBlock(),h.createBlock(Pe,{key:0,table:n.table,columns:(me=i.tableData)==null?void 0:me.columns,row:s.activeCardRow},null,8,["table","columns","row"])):h.createCommentVNode("",!0)]}),_:1})])])])])}const hae={components:{AdminTable:Ve(Hoe,[["render",uae],["__scopeId","data-v-156a144d"]])},data(){return{table:!1,interface:"",title:""}},watch:{$route:{async handler(){bs!=null&&bs.value||await this.getMenu(),await this.checkPageType()},deep:!0},title(t){var e;t&&(document.title=(((e=Vn.value)==null?void 0:e.titlePrefix)||"")+t)}},async mounted(){await this.checkPageType()},methods:{flattenMenu(t){const e=[];return t.forEach(n=>{n.menu?e.push(...this.flattenMenu(n.menu)):e.push(n)}),e},async checkPageType(){var r,i;const t=this.flattenMenu(bs.value);t!=null&&t.length||this.$router.replace("/404");const e=t==null?void 0:t.find(s=>{var a,o;return(s==null?void 0:s.path)==((o=(a=this.$route)==null?void 0:a.params)==null?void 0:o.catchAll)});this.title=e==null?void 0:e.ua,e||this.$router.replace("/404"),e!=null&&e.component&&this.$router.replace((i=(r=this.$route)==null?void 0:r.params)==null?void 0:i.catchAll);const n=e==null?void 0:e.table;this.table=n||!1,!n&&this.getInterface()},async getInterface(){var t,e;try{const{data:n}=await tt.get(`/api/template/interface/${((e=(t=this.$route)==null?void 0:t.params)==null?void 0:e.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},fae=["innerHTML"];function pae(t,e,n,r,i,s){const a=h.resolveComponent("AdminTable");return i.table?(h.openBlock(),h.createBlock(a,{key:0,table:i.table,title:i.title},null,8,["table","title"])):(h.openBlock(),h.createElementBlock("div",{key:1,class:"w-full bg-gray-50",style:{height:"calc(100vh - 120px)"},innerHTML:i.interface},null,8,fae))}const mae=Object.freeze(Object.defineProperty({__proto__:null,default:Ve(hae,[["render",pae]])},Symbol.toStringTag,{value:"Module"}));return tre});
|