1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/empty-search-D2GbGfWP.js","assets/translation-D__16jkl.js","assets/translation-DGfc5ist.css","assets/index-Ba1aykP2.js","assets/bootstrap-CY0Ip2mn.js","assets/vue-directives-CnKVJup6.js","assets/coupon-B-rA1fk2.js","assets/coupon-BzWZGw92.css","assets/index-CBMNJGe0.js","assets/index-ByCgbFnp.js","assets/table-C-YiBJTc.js","assets/vue3-smooth-dnd.esm-C7gD_4jf.js","assets/isString-CdjolYgN.js","assets/uniq-Bls6adae.js","assets/_isIterateeCall-D_jJeRnx.js","assets/index-ch4-PdZp.js","assets/index-D5hNKEWf.js","assets/index-BVTmdwWZ.js","assets/index-B3nNcDfc.js","assets/index-Cj8xPAsm.js","assets/index-DHvDUiIM.js","assets/wizard-BGNQ7DoD.js","assets/dot-navigation-CGcCKJk1.js","assets/dot-navigation-kyM59Wny.css","assets/_channel-type-selector-DJXkOhvG.js","assets/_email-CNdKYZBm.js","assets/_create-instagram-Dm79AHeJ.js","assets/_verify-4Z3OwTCs.js","assets/_smtp-BeCy_Xyq.js","assets/_forward-BUIaG3k4.js","assets/_forward-CpT2mZN9.css","assets/index-Dnjn7xBD.js","assets/sticky-gradient-D-_jYyjD.js","assets/_assignValue-CRhnZBTq.js","assets/index-h9r8GS9Y.js","assets/index-DLHuNc_V.css","assets/index-iSBAvRMN.js","assets/index-DiYux1sH.js","assets/_details.modal-BLwROfIo.js","assets/core-1V0zldzQ.js","assets/_details-BMgaPCwx.css","assets/index-HMZK4hIJ.js","assets/index-dnlpnKKX.js","assets/index-Bz3Gt9e9.js","assets/index-z6JozCSx.js","assets/overview-DLKq2bn3.js","assets/animated-number-DJWlpZB6.js","assets/index-BofmwHdd.js","assets/overview-C4OZcfll.css","assets/performance-Djt06laK.js","assets/performance-DD2maizq.css","assets/docs-Cl979EK-.js","assets/customer-satisfaction-B44TJEVO.js","assets/customer-satisfaction-CIEBTwNu.css","assets/index-DJpWqteb.js","assets/index-CNwoqQUM.js","assets/existingLocales-BjhRFfn5.js","assets/index-DoikJLrk.css","assets/index-BhhNfK3q.js","assets/show-DffkvnBe.js","assets/common-DoZ4TEch.js","assets/xml-CKLTxCyJ.js","assets/show-D0hggsn-.css","assets/wizard-mZGIg9Ob.js","assets/overview-Cgm5OI1D.js","assets/_site-vOJelW39.js","assets/_category-J7SvVdNE.js","assets/_article-Bfl8P7IP.js","assets/detail-BqVIKU5L.js","assets/table-B5hy_zY9.js","assets/index-BsVZJIyy.js","assets/detail-BOro1IZ2.js","assets/index-QV8ZLWMS.js","assets/index-DC_IV-R7.js","assets/index-DBHVLxuP.js","assets/index-CRlruCGw.css","assets/index-DkFmMdMo.js","assets/_welcome-CLNFJfeh.js","assets/_additional-data-IspcQEEQ.js","assets/_final-DC_8Hsg6.js","assets/_enable-2fa.modal-CogA8hU_.js","assets/_edit.modal-pA6kOeKo.js","assets/modal-form-layout-CGrw4uhu.js","assets/_create.modal-B_4q2QRH.js","assets/json-fields-Czm1Qc2f.js","assets/_edit.modal-BQvBy8Pe.js","assets/spm-form-editor-BsnX0CCM.js","assets/_create.modal-BlMU7V8h.js","assets/_edit.modal-dY4WgtLu.js","assets/_create.modal-D6jj-jRQ.js","assets/_edit-author.modal
1-CD4PXY66.js","assets/_edit-redirects.modal-D90qWOUU.js","assets/_edit.modal-Dpw2HoS1.js","assets/_move.modal-DC-1U8Wa.js","assets/conflicts-UxcWRwmK.js","assets/_show-docs-article.modal-BWuxukVm.js","assets/index-BxWhcMXN.js","assets/_create.modal-CKq010x-.js","assets/translation-switcher-DBDBPuFP.js","assets/_edit.modal-Ds3LRs9g.js","assets/_move.modal-Cds3Pln4.js","assets/certificate.modal-B-nY7RzO.js","assets/_create.modal-DOXPY4RS.js","assets/_create-token.modal-BZBheRIg.js","assets/_edit-auto-reply.modal-qPTcWz62.js","assets/use-placeholder-hint-DCMyGX8Q.js","assets/_edit-reply-template.modal-BsDksHON.js","assets/_edit-signature.modal-9Gxur1_1.js","assets/_upgrade_plan.modal-DGUHhARY.js","assets/_custom-field-templates.modal-DGOs4kHm.js","assets/_custom-field-templates-CpwsdrNW.css","assets/_custom-ticket-sidebar.modal-BpZ2LSTx.js","assets/_deepl-key.modal-BK4isZ-H.js","assets/_shopify-sidebar.modal-CZCsQSrn.js","assets/_slack.modal-Bip7Mhv3.js","assets/_sso.modal-BYf898Zd.js","assets/_webhooks.modal-k2TSsL8W.js","assets/_xentral-sidebar.modal-CBzDmdN1.js","assets/_zapier.modal-mJV1zDDX.js","assets/_video-product-demo.modal-CBVqpHzH.js","assets/_quick-reply.modal-Cf3MJSV2.js","assets/_create.modal-BzL_Y3IZ.js","assets/_edit.modal-BI92UbEk.js","assets/_add-coupon.modal-Clymhuun.js","assets/_addon.modal-Cn4VIeXR.js","assets/_agents.modal-Dc63cYbQ.js","assets/number-selector-DExVi-iX.js","assets/_cancel.modal-BHJtwqWp.js","assets/_checkout-window.modal-CsJCOh0o.js","assets/_checkout.modal-Du7RfiEH.js","assets/_plan-finder.modal-x6ObAzar.js","assets/_single-addon.modal-C_eSgo9S.js","assets/_update-payment.modal-CJhtvbPt.js","assets/_create.modal-CVCDjSTJ.js","assets/_edit.modal-lJOpYWv3.js","assets/_create.modal-CQ5AMbT2.js","assets/_edit.modal-DGv6IUht.js","assets/_create.modal-Hu0HLMIT.js","assets/userRoles-Dfa5PQZ2.js","assets/_edit.modal-DiYYTJrt.js","assets/_create.modal-wYt54ILe.js","assets/_create-board.modal-CbKjZEgl.js","assets/comments-Cfreefh-.js","assets/comments-o3bc8SoI.css","assets/_edit-status.modal-D0WtZ841.js","assets/_edit-task.modal-RxTIFTIH.js","assets/_template-picker.modal-xw_WxDmY.js","assets/_view-task.modal-DZveDi_P.js","assets/_view-task-CIRjyKF-.css","assets/_change-ticket-channel.modal-cKfi3Rzf.js","assets/_change-ticket-contact.modal-Bo7jm_H4.js","assets/_confirm-delete.modal-CLB3sr9r.js","assets/_create-ticket.modal-l237QlSv.js","assets/_edit-custom-fields.modal-DYDZdsio.js","assets/_forward-message.modal-BhHhONLL.js","assets/_next-action-default.modal-CXp1eaui.js","assets/_quick-reply.modal-KtQRPv_c.js","assets/_show-docs-article.modal-BRD4orrB.js","assets/_show-raw-message.modal-CdYzyZpA.js","assets/_show-ticket.modal-BXEG_gB2.js","assets/_split-message.modal-ChKb20Uj.js","assets/_wait_until.modal-psnJTakp.js","assets/navigation-left-C2kcqwZs.js","assets/navigation-left-CTvg0sgf.css","assets/_login-C5TiXknq.js","assets/_forgotten-58cmM3za.js","assets/_reset-JUwf1z_m.js","assets/_centered-9GOsaJHA.js","assets/index-D-ImWE9u.js","assets/index-DfzwP_sC.js"])))=>i.map(i=>d[i]); 2var fC=Object.defineProperty;var dv=t=>{throw TypeError(t)};var hC=(t,e,n)=>e in t?fC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var te=(t,e,n)=>hC(t,typeof e!="symbol"?e+"":e,n),af=(t,e,n)=>e.has(t)||dv("Cannot "+n);var ve=(t,e,n)=>(af(t,e,"read from private field"),n?n.call(t):e.get(t)),_t=(t,e,n)=>e.has(t)?dv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),mn=(t,e,n,r)=>(af(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),tt=(t,e,n)=>(af(t,e,"access private method"),n);var pc=(t,e,n,r)=>({set _(i){mn(t,e,i,n)},get _(){return ve(t,e,r)}});import{a as ze}from"./bootstrap-CY0Ip2mn.js";import{g as wn,c as pr,i as Qs,e as nk,r as gd,w as qo,a as On,b as rm,k as pC,t as mC,_ as Qt,V as vd,d as gC,f as vC,h as yC,j as lo,s as rk,l as Ri,u as No,m as bC,n as ii,o as Yl,p as im,q as Ya,v as Ae,x as ha,y as C,z as S,A as Tt,B as X,C as Y,D as Ye,E as K,F as wt,T as Ii,G as sm,H as om,I as ik,J as kC,K as wC,L as xC,M as x,N as L,O as Lt,P as ct,Q as am,R as z,S as ls,U as P,W as Fe,X as nt,Y as re,Z as Ir,$ as Me,a0 as $i,a1 as SC,a2 as TC,a3 as xn,a4 as kr,a5 as _C,a6 as EC,a7 as sk,a8 as fv,a9 as CC,aa as ok,ab as OC,ac as ak,ad as lk,ae as AC,af as wr,ag as ck,ah as MC,ai as IC,aj as LC,ak as PC,al as RC,am as $C,an as DC,ao as lm,ap as NC,aq as FC,ar as jC,as as BC}
2from"./translation-D__16jkl.js";import{_ as Xl,a as cm,b as HC,c as uk,d as dk,e as fk,f as hk,g as UC,h as pk,S as rr,T as pa,i as VC,j as zC,k as WC,r as KC,t as qC,l as GC,m as YC}from"./vue-directives-CnKVJup6.js";import{G as XC,T as Jl,C as JC,W as QC,b as ZC,a as eO,f as tO,c as nO,F as rO,S as iO,d as sO,D as oO,X as aO}from"./coupon-B-rA1fk2.js";const lO="modulepreload",cO=function(t){return"/build/"+t},hv={},ne=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=cO(l),l in hv)return;hv[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":lO,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};function mh(t){"@babel/helpers - typeof";return mh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mh(t)}function Sn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uO(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Tn(t,e,n){return e&&uO(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function gh(){return gh=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gh.apply(this,arguments)}function ir(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vh(t,e)}function ou(t){return ou=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ou(t)}function vh(t,e){return vh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},vh(t,e)}function dO(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fO(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hO(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fO(t)}function sr(t){var e=dO();return function(){var r=ou(t),i;if(e){var s=ou(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return hO(this,i)}}var um=function(){function t(){Sn(this,t)}return Tn(t,[{key:"listenForWhisper",value:function(n,r){return this.listen(".client-"+n,r)}},{key:"notification",value:function(n){return this.listen(".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated",n)}},{key:"stopListeningForWhisper",value:function(n,r){return this.stopListening(".client-"+n,r)}}]),t}(),mk=function(){function t(e){Sn(this,t),this.namespace=e}return Tn(t,[{key:"format",value:function(n){return n.charAt(0)==="."||n.charAt(0)==="\\"?n.substr(1):(this.namespace&&(n=this.namespace+"."+n),n.replace(/\./g,"\\"))}},{key:"setNamespace",value:function(n){this.namespace=n}}]),t}(),yd=function(t){ir(n,t);var e=sr(n);function n(r,i,s){var o;return Sn(this,n),o=e.call(this),o.name=i,o.pusher=r,o.options=s,o.eventFormatter=new mk(o.options.namespace),o.subscribe(),o}return Tn(n,[{key:"subscribe",value:function(){this.subscription=this.pusher.subscribe(this.name)}},{key:"unsubscribe",value:function(){this.pusher.unsubscribe(this.name)}},{key:"listen",value:function(i,s){return this.on(this.eventFormatter.format(i),s),this}},{key:"listenToAll",value:function(i){var s=this;return this.subscription.bind_global(function(o,a){if(!o.startsWith("pusher:")){var l=s.options.namespace.replace(/\./g,"\\"),c=o.startsWith(l)?o.substring(l.length+1):"."+o;i(c,a)}}),this}},{key:"stopListening",value:function(i,s){return s?this.subscription.unbind(this.eventFormatter.format(i),s):this.subscription.unbind(this.eventFormatter.format(i)),this}},{key:"stopListeningToAll",value:function(i){return i?this.subscription.unbind_global(i):this.subscription.unbind_global(),this}},{key:"subscribed",value:function(i){return this.on("pusher:subscription_succeeded",function(){i()}),this}},{key:"error",value:function(i){return this.on("pusher:subscription_error",function(s){i(s)}),this}},{key:"on",value:function(i,s){return this.subscription.bind(i,s),this}}]),n}(um),pO=function(t){ir(n,t);var e=sr(n);function n(){return Sn(this,n),e.apply(this,arguments)}return Tn(n,[{key:"whisper",value:function(i,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(i),s),this}}]),n}(yd),mO=function(t){ir(n,t);var e=sr(n);function n(){return Sn(this,n),e.apply(this,arguments)}return Tn(n,[{key:"whisper",value:function(i,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(i),s),this}}]),n}(yd),gO=function(t){ir(n,t);var e=sr(n);function n(){return Sn(this,n),e.apply(this,arguments)}return Tn(n,[{key:"here",value:function(i){return this.on("pusher:subscription_succeeded",function(s){i(Object.keys(s.members).map(function(o){return s.members[o]}))}),this}},{key:"joining",value:function(i){return this.on("pusher:member_added",function(s){i(s.info)}),this}},{key:"whisper",value:function(i,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(i),s),this}},{key:"leaving",value:function(i){return this.on("pusher:member_removed",function(s){i(s.info)}),this}}]),n}(yd),gk=function(t){ir(n,t);var e=sr(n);function n(r,i,s){var o;return Sn(this,n),o=e.call(this),o.events={},o.listeners={},o.name=i,o.socket=r,o.options=s,o.eventFormatter=new mk(o.options.namespace),o.subscribe(),o}return Tn(n,[{key:"subscribe",value:function(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"unsubscribe",value:function(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"listen",value:function(i,s){return this.on(this.eventFormatter.format(i),s),this}},{key:"stopListening",value:function(i,s){return this.unbindEvent(this.eventFormatter.format(i),s),this}},{key:"subscribed",value:function(i){return this.on("connect",function(s){i(s)}),this}},{key:"error",value:function(i){return this}},{key:"on",value:function(i,s){var o=this;return this.listeners[i]=this.listeners[i]||[],this.events[i]||(this.events[i]=function(a,l){o.name===a&&o.listeners[i]&&o.listeners[i].forEac
2h(function(c){return c(l)})},this.socket.on(i,this.events[i])),this.listeners[i].push(s),this}},{key:"unbind",value:function(){var i=this;Object.keys(this.events).forEach(function(s){i.unbindEvent(s)})}},{key:"unbindEvent",value:function(i,s){this.listeners[i]=this.listeners[i]||[],s&&(this.listeners[i]=this.listeners[i].filter(function(o){return o!==s})),(!s||this.listeners[i].length===0)&&(this.events[i]&&(this.socket.removeListener(i,this.events[i]),delete this.events[i]),delete this.listeners[i])}}]),n}(um),vk=function(t){ir(n,t);var e=sr(n);function n(){return Sn(this,n),e.apply(this,arguments)}return Tn(n,[{key:"whisper",value:function(i,s){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(i),data:s}),this}}]),n}(gk),vO=function(t){ir(n,t);var e=sr(n);function n(){return Sn(this,n),e.apply(this,arguments)}return Tn(n,[{key:"here",value:function(i){return this.on("presence:subscribed",function(s){i(s.map(function(o){return o.user_info}))}),this}},{key:"joining",value:function(i){return this.on("presence:joining",function(s){return i(s.user_info)}),this}},{key:"whisper",value:function(i,s){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(i),data:s}),this}},{key:"leaving",value:function(i){return this.on("presence:leaving",function(s){return i(s.user_info)}),this}}]),n}(vk),au=function(t){ir(n,t);var e=sr(n);function n(){return Sn(this,n),e.apply(this,arguments)}return Tn(n,[{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}},{key:"listen",value:function(i,s){return this}},{key:"listenToAll",value:function(i){return this}},{key:"stopListening",value:function(i,s){return this}},{key:"subscribed",value:function(i){return this}},{key:"error",value:function(i){return this}},{key:"on",value:function(i,s){return this}}]),n}(um),pv=function(t){ir(n,t);var e=sr(n);function n(){return Sn(this,n),e.apply(this,arguments)}return Tn(n,[{key:"whisper",value:function(i,s){return this}}]),n}(au),yO=function(t){ir(n,t);var e=sr(n);function n(){return Sn(this,n),e.apply(this,arguments)}return Tn(n,[{key:"here",value:function(i){return this}},{key:"joining",value:function(i){return this}},{key:"whisper",value:function(i,s){return this}},{key:"leaving",value:function(i){return this}}]),n}(au),dm=function(){function t(e){Sn(this,t),this._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},broadcaster:"pusher",csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"},this.setOptions(e),this.connect()}return Tn(t,[{key:"setOptions",value:function(n){this.options=gh(this._defaultOptions,n);var r=this.csrfToken();return r&&(this.options.auth.headers["X-CSRF-TOKEN"]=r,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=r),r=this.options.bearerToken,r&&(this.options.auth.headers.Authorization="Bearer "+r,this.options.userAuthentication.headers.Authorization="Bearer "+r),n}},{key:"csrfToken",value:function(){var n;return typeof window<"u"&&window.Laravel&&window.Laravel.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"&&(n=document.querySelector('meta[name="csrf-token"]'))?n.getAttribute("content"):null}}]),t}(),bO=function(t){ir(n,t);var e=sr(n);function n(){var r;return Sn(this,n),r=e.apply(this,arguments),r.channels={},r}return Tn(n,[{key:"connect",value:function(){typeof this.options.client<"u"?this.pusher=this.options.client:this.options.Pusher?this.pusher=new this.options.Pusher(this.options.key,this.options):this.pusher=new Pusher(this.options.key,this.options)}},{key:"signin",value:function(){this.pusher.signin()}},{key:"listen",value:function(i,s,o){return this.channel(i).listen(s,o)}},{key:"channel",value:function(i){return this.channels[i]||(this.channels[i]=new yd(this.pusher,i,this.options)),this.channels[i]}},{key:"privateChannel",value:function(i){return this.channels["private-"+i]||(this.channels["private-"+i]=new pO(this.pusher,"private-"+i,this.options)),this.channels["private-"+i]}},{key:"encryptedPrivateChannel",value:function(i){return this.channels["private-encrypted-"+i]||(this.channels["private-encrypted-"+i]=new mO(this.pusher,"private-encrypted-"+i,this.options)),this.channels["private-encrypted-"+i]}},{key:"presenceChannel",value:function(i){return this.channels["presence-"+i]||(this.channels["presence-"+i]=new gO(this.pusher,"presence-"+i,this.options)),this.channels["presence-"+i]}},{key:"leave",value:function(i){var s=this,o=[i,"private-"+i,"private-encrypted-"+i,"presence-"+i];o.forEach(function(a,l){s.leaveChannel(a)})}},{key:"leaveChannel",value:function(i){this.channels[i]&&(this.channels[i].unsubscribe(),delete this.channels[i])}},{key:"socketId",value:function(){return this.pusher.connection.socket_id}},{key:"disconnect",value:function(){this.pusher.disconnect()}}]),n}(dm),kO=function(t){ir(n,t);var e=sr(n);function n(){var r;return Sn(this,n),r=e.apply(this,arguments),r.channels={},r}
2return Tn(n,[{key:"connect",value:function(){var i=this,s=this.getSocketIO();return this.socket=s(this.options.host,this.options),this.socket.on("reconnect",function(){Object.values(i.channels).forEach(function(o){o.subscribe()})}),this.socket}},{key:"getSocketIO",value:function(){if(typeof this.options.client<"u")return this.options.client;if(typeof io<"u")return io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}},{key:"listen",value:function(i,s,o){return this.channel(i).listen(s,o)}},{key:"channel",value:function(i){return this.channels[i]||(this.channels[i]=new gk(this.socket,i,this.options)),this.channels[i]}},{key:"privateChannel",value:function(i){return this.channels["private-"+i]||(this.channels["private-"+i]=new vk(this.socket,"private-"+i,this.options)),this.channels["private-"+i]}},{key:"presenceChannel",value:function(i){return this.channels["presence-"+i]||(this.channels["presence-"+i]=new vO(this.socket,"presence-"+i,this.options)),this.channels["presence-"+i]}},{key:"leave",value:function(i){var s=this,o=[i,"private-"+i,"presence-"+i];o.forEach(function(a){s.leaveChannel(a)})}},{key:"leaveChannel",value:function(i){this.channels[i]&&(this.channels[i].unsubscribe(),delete this.channels[i])}},{key:"socketId",value:function(){return this.socket.id}},{key:"disconnect",value:function(){this.socket.disconnect()}}]),n}(dm),wO=function(t){ir(n,t);var e=sr(n);function n(){var r;return Sn(this,n),r=e.apply(this,arguments),r.channels={},r}return Tn(n,[{key:"connect",value:function(){}},{key:"listen",value:function(i,s,o){return new au}},{key:"channel",value:function(i){return new au}},{key:"privateChannel",value:function(i){return new pv}},{key:"encryptedPrivateChannel",value:function(i){return new pv}},{key:"presenceChannel",value:function(i){return new yO}},{key:"leave",value:function(i){}},{key:"leaveChannel",value:function(i){}},{key:"socketId",value:function(){return"fake-socket-id"}},{key:"disconnect",value:function(){}}]),n}(dm),xO=function(){function t(e){Sn(this,t),this.options=e,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}return Tn(t,[{key:"channel",value:function(n){return this.connector.channel(n)}},{key:"connect",value:function(){this.options.broadcaster=="pusher"?this.connector=new bO(this.options):this.options.broadcaster=="socket.io"?this.connector=new kO(this.options):this.options.broadcaster=="null"?this.connector=new wO(this.options):typeof this.options.broadcaster=="function"&&(this.connector=new this.options.broadcaster(this.options))}},{key:"disconnect",value:function(){this.connector.disconnect()}},{key:"join",value:function(n){return this.connector.presenceChannel(n)}},{key:"leave",value:function(n){this.connector.leave(n)}},{key:"leaveChannel",value:function(n){this.connector.leaveChannel(n)}},{key:"leaveAllChannels",value:function(){for(var n in this.connector.channels)this.leaveChannel(n)}},{key:"listen",value:function(n,r,i){return this.connector.listen(n,r,i)}},{key:"private",value:function(n){return this.connector.privateChannel(n)}},{key:"encryptedPrivate",value:function(n){return this.connector.encryptedPrivateChannel(n)}},{key:"socketId",value:function(){return this.connector.socketId()}},{key:"registerInterceptors",value:function(){typeof Vue=="function"&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),(typeof Turbo>"u"?"undefined":mh(Turbo))==="object"&&this.registerTurboRequestInterceptor()}},{key:"registerVueRequestInterceptor",value:function(){var n=this;Vue.http.interceptors.push(function(r,i){n.socketId()&&r.headers.set("X-Socket-ID",n.socketId()),i()})}},{key:"registerAxiosRequestInterceptor",value:function(){var n=this;axios.interceptors.request.use(function(r){return n.socketId()&&(r.headers["X-Socket-Id"]=n.socketId()),r})}},{key:"registerjQueryAjaxSetup",value:function(){var n=this;typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter(function(r,i,s){n.socketId()&&s.setRequestHeader("X-Socket-Id",n.socketId())})}},{key:"registerTurboRequestInterceptor",value:function(){var n=this;document.addEventListener("turbo:before-fetch-request",function(r){r.detail.fetchOptions.headers["X-Socket-Id"]=n.socketId()})}}]),t}(),yk={exports:{}};/*! 3 * Pusher JavaScript Library v7.0.6 4 * https://pusher.com/ 5 * 6 * Copyright 2020, Pusher 7 * Released under the MIT licence. 8 */(function(t,e){(function(r,i){t.exports=i()})(window,function(){return function(n){var r={};
8function i(s){if(r[s])return r[s].exports;var o=r[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=n,i.c=r,i.d=function(s,o,a){i.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:a})},i.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},i.t=function(s,o){if(o&1&&(s=i(s)),o&8||o&4&&typeof s=="object"&&s&&s.__esModule)return s;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:s}),o&2&&typeof s!="string")for(var l in s)i.d(a,l,(function(c){return s[c]}).bind(null,l));return a},i.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(o,"a",o),o},i.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},i.p="",i(i.s=2)}([function(n,r,i){var s=this&&this.__extends||function(){var g=function(m,b){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,E){T.__proto__=E}||function(T,E){for(var w in E)E.hasOwnProperty(w)&&(T[w]=E[w])},g(m,b)};return function(m,b){g(m,b);function T(){this.constructor=m}m.prototype=b===null?Object.create(b):(T.prototype=b.prototype,new T)}}();Object.defineProperty(r,"__esModule",{value:!0});var o=256,a=function(){function g(m){m===void 0&&(m="="),this._paddingCharacter=m}return g.prototype.encodedLength=function(m){return this._paddingCharacter?(m+2)/3*4|0:(m*8+5)/6|0},g.prototype.encode=function(m){for(var b="",T=0;T<m.length-2;T+=3){var E=m[T]<<16|m[T+1]<<8|m[T+2];b+=this._encodeByte(E>>>3*6&63),b+=this._encodeByte(E>>>2*6&63),b+=this._encodeByte(E>>>1*6&63),b+=this._encodeByte(E>>>0*6&63)}var w=m.length-T;if(w>0){var E=m[T]<<16|(w===2?m[T+1]<<8:0);b+=this._encodeByte(E>>>3*6&63),b+=this._encodeByte(E>>>2*6&63),w===2?b+=this._encodeByte(E>>>1*6&63):b+=this._paddingCharacter||"",b+=this._paddingCharacter||""}return b},g.prototype.maxDecodedLength=function(m){return this._paddingCharacter?m/4*3|0:(m*6+7)/8|0},g.prototype.decodedLength=function(m){return this.maxDecodedLength(m.length-this._getPaddingLength(m))},g.prototype.decode=function(m){if(m.length===0)return new Uint8Array(0);for(var b=this._getPaddingLength(m),T=m.length-b,E=new Uint8Array(this.maxDecodedLength(T)),w=0,M=0,A=0,I=0,j=0,$=0,J=0;M<T-4;M+=4)I=this._decodeChar(m.charCodeAt(M+0)),j=this._decodeChar(m.charCodeAt(M+1)),$=this._decodeChar(m.charCodeAt(M+2)),J=this._decodeChar(m.charCodeAt(M+3)),E[w++]=I<<2|j>>>4,E[w++]=j<<4|$>>>2,E[w++]=$<<6|J,A|=I&o,A|=j&o,A|=$&o,A|=J&o;if(M<T-1&&(I=this._decodeChar(m.charCodeAt(M)),j=this._decodeChar(m.charCodeAt(M+1)),E[w++]=I<<2|j>>>4,A|=I&o,A|=j&o),M<T-2&&($=this._decodeChar(m.charCodeAt(M+2)),E[w++]=j<<4|$>>>2,A|=$&o),M<T-3&&(J=this._decodeChar(m.charCodeAt(M+3)),E[w++]=$<<6|J,A|=J&o),A!==0)throw new Error("Base64Coder: incorrect characters for decoding");return E},g.prototype._encodeByte=function(m){var b=m;return b+=65,b+=25-m>>>8&6,b+=51-m>>>8&-75,b+=61-m>>>8&-15,b+=62-m>>>8&3,String.fromCharCode(b)},g.prototype._decodeChar=function(m){var b=o;return b+=(42-m&m-44)>>>8&-o+m-43+62,b+=(46-m&m-48)>>>8&-o+m-47+63,b+=(47-m&m-58)>>>8&-o+m-48+52,b+=(64-m&m-91)>>>8&-o+m-65+0,b+=(96-m&m-123)>>>8&-o+m-97+26,b},g.prototype._getPaddingLength=function(m){var b=0;if(this._paddingCharacter){for(var T=m.length-1;T>=0&&m[T]===this._paddingCharacter;T--)b++;if(m.length<4||b>2)throw new Error("Base64Coder: incorrect padding")}return b},g}();r.Coder=a;var l=new a;function c(g){return l.encode(g)}r.encode=c;function u(g){return l.decode(g)}r.decode=u;var d=function(g){s(m,g);function m(){return g!==null&&g.apply(this,arguments)||this}return m.prototype._encodeByte=function(b){var T=b;return T+=65,T+=25-b>>>8&6,T+=51-b>>>8&-75,T+=61-b>>>8&-13,T+=62-b>>>8&49,String.fromCharCode(T)},m.prototype._decodeChar=function(b){var T=o;return T+=(44-b&b-46)>>>8&-o+b-45+62,T+=(94-b&b-96)>>>8&-o+b-95+63,T+=(47-b&b-58)>>>8&-o+b-48+52,T+=(64-b&b-91)>>>8&-o+b-65+0,T+=(96-b&b-123)>>>8&-o+b-97+26,T},m}(a);r.URLSafeCoder=d;var f=new d;function p(g){return f.encode(g)}r.encodeURLSafe=p;function h(g){return f.decode(g)}
8r.decodeURLSafe=h,r.encodedLength=function(g){return l.encodedLength(g)},r.maxDecodedLength=function(g){return l.maxDecodedLength(g)},r.decodedLength=function(g){return l.decodedLength(g)}},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var s="utf8: invalid string",o="utf8: invalid source encoding";function a(u){for(var d=new Uint8Array(l(u)),f=0,p=0;p<u.length;p++){var h=u.charCodeAt(p);h<128?d[f++]=h:h<2048?(d[f++]=192|h>>6,d[f++]=128|h&63):h<55296?(d[f++]=224|h>>12,d[f++]=128|h>>6&63,d[f++]=128|h&63):(p++,h=(h&1023)<<10,h|=u.charCodeAt(p)&1023,h+=65536,d[f++]=240|h>>18,d[f++]=128|h>>12&63,d[f++]=128|h>>6&63,d[f++]=128|h&63)}return d}r.encode=a;function l(u){for(var d=0,f=0;f<u.length;f++){var p=u.charCodeAt(f);if(p<128)d+=1;else if(p<2048)d+=2;else if(p<55296)d+=3;else if(p<=57343){if(f>=u.length-1)throw new Error(s);f++,d+=4}else throw new Error(s)}return d}r.encodedLength=l;function c(u){for(var d=[],f=0;f<u.length;f++){var p=u[f];if(p&128){var h=void 0;if(p<224){if(f>=u.length)throw new Error(o);var g=u[++f];if((g&192)!==128)throw new Error(o);p=(p&31)<<6|g&63,h=128}else if(p<240){if(f>=u.length-1)throw new Error(o);var g=u[++f],m=u[++f];if((g&192)!==128||(m&192)!==128)throw new Error(o);p=(p&15)<<12|(g&63)<<6|m&63,h=2048}else if(p<248){if(f>=u.length-2)throw new Error(o);var g=u[++f],m=u[++f],b=u[++f];if((g&192)!==128||(m&192)!==128||(b&192)!==128)throw new Error(o);p=(p&15)<<18|(g&63)<<12|(m&63)<<6|b&63,h=65536}else throw new Error(o);if(p<h||p>=55296&&p<=57343)throw new Error(o);if(p>=65536){if(p>1114111)throw new Error(o);p-=65536,d.push(String.fromCharCode(55296|p>>10)),p=56320|p&1023}}d.push(String.fromCharCode(p))}return d.join("")}r.decode=c},function(n,r,i){n.exports=i(3).default},function(n,r,i){i.r(r);var s=function(){function y(v,k){this.lastId=0,this.prefix=v,this.name=k}return y.prototype.create=function(v){this.lastId++;var k=this.lastId,_=this.prefix+k,O=this.name+"["+k+"]",N=!1,oe=function(){N||(v.apply(null,arguments),N=!0)};return this[k]=oe,{number:k,id:_,name:O,callback:oe}},y.prototype.remove=function(v){delete this[v.number]},y}(),o=new s("_pusher_script_","Pusher.ScriptReceivers"),a={VERSION:"7.0.6",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},l=a,c=function(){function y(v){this.options=v,this.receivers=v.receivers||o,this.loading={}}return y.prototype.load=function(v,k,_){var O=this;if(O.loading[v]&&O.loading[v].length>0)O.loading[v].push(_);else{O.loading[v]=[_];var N=xt.createScriptRequest(O.getPath(v,k)),oe=O.receivers.create(function(_e){if(O.receivers.remove(oe),O.loading[v]){var it=O.loading[v];delete O.loading[v];for(var Ot=function(Pn){Pn||N.cleanup()},ln=0;ln<it.length;ln++)it[ln](_e,Ot)}});N.send(oe)}},y.prototype.getRoot=function(v){var k,_=xt.getDocument().location.protocol;return v&&v.useTLS||_==="https:"?k=this.options.cdn_https:k=this.options.cdn_http,k.replace(/\/*$/,"")+"/"+this.options.version},y.prototype.getPath=function(v,k){return this.getRoot(k)+"/"+v+this.options.suffix+".js"},y}(),u=c,d=new s("_pusher_dependencies","Pusher.DependenciesReceivers"),f=new u({cdn_http:l.cdn_http,cdn_https:l.cdn_https,version:l.VERSION,suffix:l.dependency_suffix,receivers:d}),p={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/authenticating_users"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},h=function(y){var v="See:",k=p.urls[y];if(!k)return"";var _;return k.fullUrl?_=k.fullUrl:k.path&&(_=p.baseUrl+k.path),_?v+" "+_:""},g={buildLogSuffix:h},m=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}
8v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}(),b=function(y){m(v,y);function v(k){var _=this.constructor,O=y.call(this,k)||this;return Object.setPrototypeOf(O,_.prototype),O}return v}(Error),T=function(y){m(v,y);function v(k){var _=this.constructor,O=y.call(this,k)||this;return Object.setPrototypeOf(O,_.prototype),O}return v}(Error),E=function(y){m(v,y);function v(k){var _=this.constructor,O=y.call(this,k)||this;return Object.setPrototypeOf(O,_.prototype),O}return v}(Error),w=function(y){m(v,y);function v(k){var _=this.constructor,O=y.call(this,k)||this;return Object.setPrototypeOf(O,_.prototype),O}return v}(Error),M=function(y){m(v,y);function v(k){var _=this.constructor,O=y.call(this,k)||this;return Object.setPrototypeOf(O,_.prototype),O}return v}(Error),A=function(y){m(v,y);function v(k){var _=this.constructor,O=y.call(this,k)||this;return Object.setPrototypeOf(O,_.prototype),O}return v}(Error),I=function(y){m(v,y);function v(k){var _=this.constructor,O=y.call(this,k)||this;return Object.setPrototypeOf(O,_.prototype),O}return v}(Error),j=function(y){m(v,y);function v(k,_){var O=this.constructor,N=y.call(this,_)||this;return N.status=k,Object.setPrototypeOf(N,O.prototype),N}return v}(Error),$=function(y,v,k){var _=this,O;O=xt.createXHR(),O.open("POST",_.options.authEndpoint,!0),O.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var N in this.authOptions.headers)O.setRequestHeader(N,this.authOptions.headers[N]);return O.onreadystatechange=function(){if(O.readyState===4)if(O.status===200){var oe=void 0,_e=!1;try{oe=JSON.parse(O.responseText),_e=!0}
8catch{k(new j(200,"JSON returned from auth endpoint was invalid, yet status code was 200. Data was: "+O.responseText),{auth:""})}_e&&k(null,oe)}else{var it=g.buildLogSuffix("authenticationEndpoint");k(new j(O.status,"Unable to retrieve auth string from auth endpoint - "+("received status: "+O.status+" from "+_.options.authEndpoint+". ")+("Clients must be authenticated to join private or presence channels. "+it)),{auth:""})}},O.send(this.composeQuery(v)),O},J=$;function se(y){return ke(ge(y))}var Q=String.fromCharCode,G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ee=function(y){var v=y.charCodeAt(0);return v<128?y:v<2048?Q(192|v>>>6)+Q(128|v&63):Q(224|v>>>12&15)+Q(128|v>>>6&63)+Q(128|v&63)},ge=function(y){return y.replace(/[^\x00-\x7F]/g,ee)},ae=function(y){var v=[0,2,1][y.length%3],k=y.charCodeAt(0)<<16|(y.length>1?y.charCodeAt(1):0)<<8|(y.length>2?y.charCodeAt(2):0),_=[G.charAt(k>>>18),G.charAt(k>>>12&63),v>=2?"=":G.charAt(k>>>6&63),v>=1?"=":G.charAt(k&63)];return _.join("")},ke=window.btoa||function(y){return y.replace(/[\s\S]{1,3}/g,ae)},Le=function(){function y(v,k,_,O){var N=this;this.clear=k,this.timer=v(function(){N.timer&&(N.timer=O(N.timer))},_)}return y.prototype.isRunning=function(){return this.timer!==null},y.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},y}(),Ue=Le,Ze=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}();function Je(y){window.clearTimeout(y)}function Xe(y){window.clearInterval(y)}var We=function(y){Ze(v,y);function v(k,_){return y.call(this,setTimeout,Je,k,function(O){return _(),null})||this}return v}(Ue),rt=function(y){Ze(v,y);function v(k,_){return y.call(this,setInterval,Xe,k,function(O){return _(),O})||this}return v}(Ue),je={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(y){return new We(0,y)},method:function(y){var v=Array.prototype.slice.call(arguments,1);return function(k){return k[y].apply(k,v.concat(arguments))}}},Te=je;function q(y){for(var v=[],k=1;k<arguments.length;k++)v[k-1]=arguments[k];for(var _=0;_<v.length;_++){var O=v[_];for(var N in O)O[N]&&O[N].constructor&&O[N].constructor===Object?y[N]=q(y[N]||{},O[N]):y[N]=O[N]}return y}function pe(){for(var y=["Pusher"],v=0;v<arguments.length;v++)typeof arguments[v]=="string"?y.push(arguments[v]):y.push(D(arguments[v]));return y.join(" : ")}function ce(y,v){var k=Array.prototype.indexOf;if(y===null)return-1;if(k&&y.indexOf===k)return y.indexOf(v);for(var _=0,O=y.length;_<O;_++)if(y[_]===v)return _;return-1}function be(y,v){for(var k in y)Object.prototype.hasOwnProperty.call(y,k)&&v(y[k],k,y)}function He(y){var v=[];return be(y,function(k,_){v.push(_)}),v}function at(y){var v=[];return be(y,function(k){v.push(k)}),v}function Ce(y,v,k){for(var _=0;_<y.length;_++)v.call(k||window,y[_],_,y)}function Oe(y,v){for(var k=[],_=0;_<y.length;_++)k.push(v(y[_],_,y,k));return k}function lt(y,v){var k={};return be(y,function(_,O){k[O]=v(_)}),k}function yt(y,v){v=v||function(O){return!!O};for(var k=[],_=0;_<y.length;_++)v(y[_],_,y,k)&&k.push(y[_]);return k}function ht(y,v){var k={};return be(y,function(_,O){(v&&v(_,O,y,k)||_)&&(k[O]=_)}),k}function R(y){var v=[];return be(y,function(k,_){v.push([_,k])}),v}function F(y,v){for(var k=0;k<y.length;k++)if(v(y[k],k,y))return!0;return!1}function ie(y,v){for(var k=0;k<y.length;k++)if(!v(y[k],k,y))return!1;return!0}function fe(y){return lt(y,function(v){return typeof v=="object"&&(v=D(v)),encodeURIComponent(se(v.toString()))})}function Ve(y){var v=ht(y,function(_){return _!==void 0}),k=Oe(R(fe(v)),Te.method("join","=")).join("&");return k}function B(y){var v=[],k=[];return function _(O,N){var oe,_e,it;switch(typeof O){case"object":if(!O)return null;for(oe=0;oe<v.length;oe+=1)if(v[oe]===O)return{$ref:k[oe]};if(v.push(O),k.push(N),Object.prototype.toString.apply(O)==="[object Array]")for(it=[],oe=0;oe<O.length;oe+=1)it[oe]=_(O[oe],N+"["+oe+"]");else{it={};for(_e in O)Object.prototype.hasOwnProperty.call(O,_e)&&(it[_e]=_(O[_e],N+"["+JSON.stringify(_e)+"]"))}return it;case"number":case"string":case"boolean":return O}}(y,"$")}function D(y){try{return JSON.stringify(y)}catch{return JSON.stringify(B(y))}}var U=function(){function y(){this.globalLog=function(v){window.console&&window.console.log&&window.console.log(v)}}return y.prototype.debug=function(){for(var v=[],k=0;k<arguments.length;k++)v[k]=arguments[k];this.log(this.globalLog,v)},y.prototype.warn=function(){for(var v=[],k=0;k<arguments.length;k++)v[k]=arguments[k];this.log(this.globalLogWarn,v)},y.prototype.error=function(){for(var v=[],k=0;k<arguments.length;k++)v[k]=arguments[k];this.log(this.globalLogError,v)},y.prototype.globalLogWarn=function(v){window.console&&window.console.warn?window.console.warn(v):this.globalLog(v)},y.prototype.globalLogError=function(v){window.console&&window.console.error?window.console.error(v):this.globalLogWarn(v)},y.prototype.log=function(v){var k=pe.apply(this,arguments);if(rf.log)rf.log(k);else if(rf.logToConsole){var _=v.bind(this);_(k)}},y}(),le=new U,Ie=function(y,v,k){this.authOptions.headers!==void 0&&le.warn("To send headers with the auth request, you must use AJAX, rather than JSONP.");var _=y.nextAuthCallbackID.toString();y.nextAuthCallbackID++;var O=y.getDocument(),N=O.createElement("script");y.auth_callbacks[_]=function(it){k(null,it)};var oe="Pusher.auth_callbacks['"+_+"']";N.src=this.options.authEndpoint+"?callback="+encodeURIComponent(oe)+"&"+this.composeQuery(v);var _e=O.getElementsByTagName("head")[0]||O.documentElement;_e.insertBefore(N,_e.firstChild)},Ke=Ie,H=function(){function y(v){this.src=v}return y.prototype.send=function(v){var k=this,_="Error loading "+k.src;k.script=document.createElement("script"),k.script.id=v.id,k.script.src=k.src,k.script.type="text/javascript",k.script.charset="UTF-8",k.script.addEventListener?(k.script.onerror=function(){v.callback(_)},k.script.onload=function(){v.callback(null)}):k.script.onreadystatechange=function(){(k.script.readyState==="loaded"||k.script.readyState==="complete")&&v.callback(null)},k.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(k.errorScript=document.createElement("script"),k.errorScript.id=v.id+"_error",k.errorScript.text=v.name+"('"+_+"');",k.script.async=k.errorScript.async=!1):k.script.async=!0;var O=document.getElementsByTagName("head")[0];O.insertBefore(k.script,O.firstChild),k.errorScript&&O.insertBefore(k.errorScript,k.script.nextSibling)},y.prototype.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null},y}(),V=H,Z=function(){function y(v,k){this.url=v,this.data=k}return y.prototype.send=function(v){if(!this.request){var k=Ve(this.data),_=this.url+"/"+v.number+"?"+k;this.request=xt.createScriptRequest(_),this.request.send(v)}},y.prototype.cleanup=function(){this.request&&this.request.cleanup()},y}(),de=Z,Pe=function(y,v){return function(k,_){var O="http"+(v?"s":"")+"://",N=O+(y.host||y.options.host)+y.options.path,oe=xt.createJSONPRequest(N,k),_e=xt.ScriptReceivers.create(function(it,Ot){o.remove(_e),oe.cleanup(),Ot&&Ot.host&&(y.host=Ot.host),_&&_(it,Ot)});oe.send(_e)}},W={name:"jsonp",getAgent:Pe},ue=W;function we(y,v,k){var _=y+(v.useTLS?"s":""),O=v.useTLS?v.hostTLS:v.hostNonTLS;return _+"://"+O+k}function Ge(y,v){var k="/app/"+y,_="?protocol="+l.PROTOCOL+"&client=js&ver
8sion="+l.VERSION+(v?"&"+v:"");return k+_}var xe={getInitial:function(y,v){var k=(v.httpPath||"")+Ge(y,"flash=false");return we("ws",v,k)}},Ee={getInitial:function(y,v){var k=(v.httpPath||"/pusher")+Ge(y);return we("http",v,k)}},De={getInitial:function(y,v){return we("http",v,v.httpPath||"/pusher")},getPath:function(y,v){return Ge(y)}},dt=function(){function y(){this._callbacks={}}return y.prototype.get=function(v){return this._callbacks[$t(v)]},y.prototype.add=function(v,k,_){var O=$t(v);this._callbacks[O]=this._callbacks[O]||[],this._callbacks[O].push({fn:k,context:_})},y.prototype.remove=function(v,k,_){if(!v&&!k&&!_){this._callbacks={};return}var O=v?[$t(v)]:He(this._callbacks);k||_?this.removeCallback(O,k,_):this.removeAllCallbacks(O)},y.prototype.removeCallback=function(v,k,_){Ce(v,function(O){this._callbacks[O]=yt(this._callbacks[O]||[],function(N){return k&&k!==N.fn||_&&_!==N.context}),this._callbacks[O].length===0&&delete this._callbacks[O]},this)},y.prototype.removeAllCallbacks=function(v){Ce(v,function(k){delete this._callbacks[k]},this)},y}(),bt=dt;function $t(y){return"_"+y}var ui=function(){function y(v){this.callbacks=new bt,this.global_callbacks=[],this.failThrough=v}return y.prototype.bind=function(v,k,_){return this.callbacks.add(v,k,_),this},y.prototype.bind_global=function(v){return this.global_callbacks.push(v),this},y.prototype.unbind=function(v,k,_){return this.callbacks.remove(v,k,_),this},y.prototype.unbind_global=function(v){return v?(this.global_callbacks=yt(this.global_callbacks||[],function(k){return k!==v}),this):(this.global_callbacks=[],this)},y.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},y.prototype.emit=function(v,k,_){for(var O=0;O<this.global_callbacks.length;O++)this.global_callbacks[O](v,k);var N=this.callbacks.get(v),oe=[];if(_?oe.push(k,_):k&&oe.push(k),N&&N.length>0)for(var O=0;O<N.length;O++)N[O].fn.apply(N[O].context||window,oe);else this.failThrough&&this.failThrough(v,k);return this},y}(),Hn=ui,Xn=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}(),Xd=function(y){Xn(v,y);function v(k,_,O,N,oe){var _e=y.call(this)||this;return _e.initialize=xt.transportConnectionInitializer,_e.hooks=k,_e.name=_,_e.priority=O,_e.key=N,_e.options=oe,_e.state="new",_e.timeline=oe.timeline,_e.activityTimeout=oe.activityTimeout,_e.id=_e.timeline.generateUniqueID(),_e}return v.prototype.handlesActivityChecks=function(){return!!this.hooks.handlesActivityChecks},v.prototype.supportsPing=function(){return!!this.hooks.supportsPing},v.prototype.connect=function(){var k=this;if(this.socket||this.state!=="initialized")return!1;var _=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(_,this.options)}catch(O){return Te.defer(function(){k.onError(O),k.changeState("closed")}),!1}return this.bindListeners(),le.debug("Connecting",{transport:this.name,url:_}),this.changeState("connecting"),!0},v.prototype.close=function(){return this.socket?(this.socket.close(),!0):!1},v.prototype.send=function(k){var _=this;return this.state==="open"?(Te.defer(function(){_.socket&&_.socket.send(k)}),!0):!1},v.prototype.ping=function(){this.state==="open"&&this.supportsPing()&&this.socket.ping()},v.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},v.prototype.onError=function(k){this.emit("error",{type:"WebSocketError",error:k}),this.timeline.error(this.buildTimelineMessage({error:k.toString()}))},v.prototype.onClose=function(k){k?this.changeState("closed",{code:k.code,reason:k.reason,wasClean:k.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},v.prototype.onMessage=function(k){this.emit("message",k)}
8,v.prototype.onActivity=function(){this.emit("activity")},v.prototype.bindListeners=function(){var k=this;this.socket.onopen=function(){k.onOpen()},this.socket.onerror=function(_){k.onError(_)},this.socket.onclose=function(_){k.onClose(_)},this.socket.onmessage=function(_){k.onMessage(_)},this.supportsPing()&&(this.socket.onactivity=function(){k.onActivity()})},v.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},v.prototype.changeState=function(k,_){this.state=k,this.timeline.info(this.buildTimelineMessage({state:k,params:_})),this.emit(k,_)},v.prototype.buildTimelineMessage=function(k){return q({cid:this.id},k)},v}(Hn),ba=Xd,mo=function(){function y(v){this.hooks=v}return y.prototype.isSupported=function(v){return this.hooks.isSupported(v)},y.prototype.createConnection=function(v,k,_,O){return new ba(this.hooks,v,k,_,O)},y}(),go=mo,v_=new go({urls:xe,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!xt.getWebSocketAPI()},isSupported:function(){return!!xt.getWebSocketAPI()},getSocket:function(y){return xt.createWebSocket(y)}}),Ug={urls:Ee,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Vg=q({getSocket:function(y){return xt.HTTPFactory.createStreamingSocket(y)}},Ug),zg=q({getSocket:function(y){return xt.HTTPFactory.createPollingSocket(y)}},Ug),Wg={isSupported:function(){return xt.isXHRSupported()}},y_=new go(q({},Vg,Wg)),b_=new go(q({},zg,Wg)),k_={ws:v_,xhr_streaming:y_,xhr_polling:b_},dc=k_,w_=new go({file:"sockjs",urls:De,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(y,v){return new window.SockJS(y,null,{js_path:f.getPath("sockjs",{useTLS:v.useTLS}),ignore_null_origin:v.ignoreNullOrigin})},beforeOpen:function(y,v){y.send(JSON.stringify({path:v}))}}),Kg={isSupported:function(y){var v=xt.isXDRSupported(y.useTLS);return v}},x_=new go(q({},Vg,Kg)),S_=new go(q({},zg,Kg));dc.xdr_streaming=x_,dc.xdr_polling=S_,dc.sockjs=w_;var T_=dc,__=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}(),E_=function(y){__(v,y);function v(){var k=y.call(this)||this,_=k;return window.addEventListener!==void 0&&(window.addEventListener("online",function(){_.emit("online")},!1),window.addEventListener("offline",function(){_.emit("offline")},!1)),k}return v.prototype.isOnline=function(){return window.navigator.onLine===void 0?!0:window.navigator.onLine},v}(Hn),C_=new E_,O_=function(){function y(v,k,_){this.manager=v,this.transport=k,this.minPingDelay=_.minPingDelay,this.maxPingDelay=_.maxPingDelay,this.pingDelay=void 0}return y.prototype.createConnection=function(v,k,_,O){var N=this;O=q({},O,{activityTimeout:this.pingDelay});var oe=this.transport.createConnection(v,k,_,O),_e=null,it=function(){oe.unbind("open",it),oe.bind("closed",Ot),_e=Te.now()},Ot=function(ln){if(oe.unbind("closed",Ot),ln.code===1002||ln.code===1003)N.manager.reportDeath();else if(!ln.wasClean&&_e){var Pn=Te.now()-_e;Pn<2*N.maxPingDelay&&(N.manager.reportDeath(),N.pingDelay=Math.max(Pn/2,N.minPingDelay))}};return oe.bind("open",it),oe},y.prototype.isSupported=function(v){return this.manager.isAlive()&&this.transport.isSupported(v)},y}(),A_=O_,qg={decodeMessage:function(y){try{var v=JSON.parse(y.data),k=v.data;if(typeof k=="string")try{k=JSON.parse(v.data)}catch{}var _={event:v.event,channel:v.channel,data:k};return v.user_id&&(_.user_id=v.user_id),_}catch(O){throw{type:"MessageParseError",error:O,data:y.data}}},encodeMessage:function(y){return JSON.stringify(y)},processHandshake:function(y){var v=qg.decodeMessage(y);if(v.event==="pusher:connection_established"){if(!v.data.activity_timeout)throw"No activity timeout specified in handshake";
8return{action:"connected",id:v.data.socket_id,activityTimeout:v.data.activity_timeout*1e3}}else{if(v.event==="pusher:error")return{action:this.getCloseAction(v.data),error:this.getCloseError(v.data)};throw"Invalid handshake"}},getCloseAction:function(y){return y.code<4e3?y.code>=1002&&y.code<=1004?"backoff":null:y.code===4e3?"tls_only":y.code<4100?"refused":y.code<4200?"backoff":y.code<4300?"retry":"refused"},getCloseError:function(y){return y.code!==1e3&&y.code!==1001?{type:"PusherError",data:{code:y.code,message:y.reason||y.message}}:null}},ws=qg,M_=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}(),I_=function(y){M_(v,y);function v(k,_){var O=y.call(this)||this;return O.id=k,O.transport=_,O.activityTimeout=_.activityTimeout,O.bindListeners(),O}return v.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},v.prototype.send=function(k){return this.transport.send(k)},v.prototype.send_event=function(k,_,O){var N={event:k,data:_};return O&&(N.channel=O),le.debug("Event sent",N),this.send(ws.encodeMessage(N))},v.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},v.prototype.close=function(){this.transport.close()},v.prototype.bindListeners=function(){var k=this,_={message:function(N){var oe;try{oe=ws.decodeMessage(N)}catch(_e){k.emit("error",{type:"MessageParseError",error:_e,data:N.data})}if(oe!==void 0){switch(le.debug("Event recd",oe),oe.event){case"pusher:error":k.emit("error",{type:"PusherError",data:oe.data});break;case"pusher:ping":k.emit("ping");break;case"pusher:pong":k.emit("pong");break}k.emit("message",oe)}},activity:function(){k.emit("activity")},error:function(N){k.emit("error",N)},closed:function(N){O(),N&&N.code&&k.handleCloseEvent(N),k.transport=null,k.emit("closed")}},O=function(){be(_,function(N,oe){k.transport.unbind(oe,N)})};be(_,function(N,oe){k.transport.bind(oe,N)})},v.prototype.handleCloseEvent=function(k){var _=ws.getCloseAction(k),O=ws.getCloseError(k);O&&this.emit("error",O),_&&this.emit(_,{action:_,error:O})},v}(Hn),L_=I_,P_=function(){function y(v,k){this.transport=v,this.callback=k,this.bindListeners()}return y.prototype.close=function(){this.unbindListeners(),this.transport.close()},y.prototype.bindListeners=function(){var v=this;this.onMessage=function(k){v.unbindListeners();var _;try{_=ws.processHandshake(k)}catch(O){v.finish("error",{error:O}),v.transport.close();return}_.action==="connected"?v.finish("connected",{connection:new L_(_.id,v.transport),activityTimeout:_.activityTimeout}):(v.finish(_.action,{error:_.error}),v.transport.close())},this.onClosed=function(k){v.unbindListeners();var _=ws.getCloseAction(k)||"backoff",O=ws.getCloseError(k);v.finish(_,{error:O})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},y.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},y.prototype.finish=function(v,k){this.callback(q({transport:this.transport,action:v},k))},y}(),R_=P_,$_=function(){function y(v,k){this.channel=v;var _=k.authTransport;if(typeof xt.getAuthorizers()[_]>"u")throw"'"+_+"' is not a recognized auth transport";this.type=_,this.options=k,this.authOptions=k.auth||{}}return y.prototype.composeQuery=function(v){var k="socket_id="+encodeURIComponent(v)+"&channel_name="+encodeURIComponent(this.channel.name);for(var _ in this.authOptions.params)k+="&"+encodeURIComponent(_)+"="+encodeURIComponent(this.authOptions.params[_]);return k},y.prototype.authorize=function(v,k){y.authorizers=y.authorizers||xt.getAuthorizers(),y.authorizers[this.type].call(this,xt,v,k)},y}(),D_=$_,N_=function(){function y(v,k){this.timeline=v,this.options=k||{}}return y.prototype.send=function(v,k){this.timeline.isEmpty()||this.timeline.send(xt.TimelineTransport.getAgent(this,v),k)},y}
8(),F_=N_,j_=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}(),B_=function(y){j_(v,y);function v(k,_){var O=y.call(this,function(N,oe){le.debug("No callbacks on "+k+" for "+N)})||this;return O.name=k,O.pusher=_,O.subscribed=!1,O.subscriptionPending=!1,O.subscriptionCancelled=!1,O}return v.prototype.authorize=function(k,_){return _(null,{auth:""})},v.prototype.trigger=function(k,_){if(k.indexOf("client-")!==0)throw new b("Event '"+k+"' does not start with 'client-'");if(!this.subscribed){var O=g.buildLogSuffix("triggeringClientEvents");le.warn("Client event triggered before channel 'subscription_succeeded' event . "+O)}return this.pusher.send_event(k,_,this.name)},v.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},v.prototype.handleEvent=function(k){var _=k.event,O=k.data;if(_==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(k);else if(_.indexOf("pusher_internal:")!==0){var N={};this.emit(_,O,N)}},v.prototype.handleSubscriptionSucceededEvent=function(k){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",k.data)},v.prototype.subscribe=function(){var k=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(_,O){_?(k.subscriptionPending=!1,le.error(_.toString()),k.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:_.message},_ instanceof j?{status:_.status}:{}))):k.pusher.send_event("pusher:subscribe",{auth:O.auth,channel_data:O.channel_data,channel:k.name})}))},v.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},v.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},v.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},v}(Hn),Gg=B_,H_=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}(),U_=function(y){H_(v,y);function v(){return y!==null&&y.apply(this,arguments)||this}return v.prototype.authorize=function(k,_){var O=jr.createAuthorizer(this,this.pusher.config);return O.authorize(k,_)},v}(Gg),Jd=U_,V_=function(){function y(){this.reset()}return y.prototype.get=function(v){return Object.prototype.hasOwnProperty.call(this.members,v)?{id:v,info:this.members[v]}:null},y.prototype.each=function(v){var k=this;be(this.members,function(_,O){v(k.get(O))})},y.prototype.setMyID=function(v){this.myID=v},y.prototype.onSubscription=function(v){this.members=v.presence.hash,this.count=v.presence.count,this.me=this.get(this.myID)},y.prototype.addMember=function(v){return this.get(v.user_id)===null&&this.count++,this.members[v.user_id]=v.user_info,this.get(v.user_id)},y.prototype.removeMember=function(v){var k=this.get(v.user_id);return k&&(delete this.members[v.user_id],this.count--),k},y.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},y}(),z_=V_,W_=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}(),K_=function(y){W_(v,y);function v(k,_){var O=y.call(this,k,_)||this;return O.members=new z_,O}return v.prototype.authorize=function(k,_){var O=this;y.prototype.authorize.call(this,k,function(N,oe){if(!N){if(oe=oe,oe.channel_data===void 0){var _e=g.buildLogSuffix("authenticationEndpoint");le.error("Invalid auth response for channel '"+O.name+"',"+("expected 'channel_data' field. "+_e)),_("Invalid auth response");return}var it=JSON.parse(oe.channel_data);O.members.setMyID(it.user_id)}_(N,oe)})},v.prototype.handleEvent=function(k){var _=k.event;if(_.indexOf("pusher_internal:")===0)this.handleInternalEvent(k);else{var O=k.data,N={};
8k.user_id&&(N.user_id=k.user_id),this.emit(_,O,N)}},v.prototype.handleInternalEvent=function(k){var _=k.event,O=k.data;switch(_){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(k);break;case"pusher_internal:member_added":var N=this.members.addMember(O);this.emit("pusher:member_added",N);break;case"pusher_internal:member_removed":var oe=this.members.removeMember(O);oe&&this.emit("pusher:member_removed",oe);break}},v.prototype.handleSubscriptionSucceededEvent=function(k){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(k.data),this.emit("pusher:subscription_succeeded",this.members))},v.prototype.disconnect=function(){this.members.reset(),y.prototype.disconnect.call(this)},v}(Jd),q_=K_,G_=i(1),Qd=i(0),Y_=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}(),X_=function(y){Y_(v,y);function v(k,_,O){var N=y.call(this,k,_)||this;return N.key=null,N.nacl=O,N}return v.prototype.authorize=function(k,_){var O=this;y.prototype.authorize.call(this,k,function(N,oe){if(N){_(N,oe);return}var _e=oe.shared_secret;if(!_e){_(new Error("No shared_secret key in auth payload for encrypted channel: "+O.name),null);return}O.key=Object(Qd.decode)(_e),delete oe.shared_secret,_(null,oe)})},v.prototype.trigger=function(k,_){throw new M("Client events are not currently supported for encrypted channels")},v.prototype.handleEvent=function(k){var _=k.event,O=k.data;if(_.indexOf("pusher_internal:")===0||_.indexOf("pusher:")===0){y.prototype.handleEvent.call(this,k);return}this.handleEncryptedEvent(_,O)},v.prototype.handleEncryptedEvent=function(k,_){var O=this;if(!this.key){le.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!_.ciphertext||!_.nonce){le.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+_);return}var N=Object(Qd.decode)(_.ciphertext);if(N.length<this.nacl.secretbox.overheadLength){le.error("Expected encrypted event ciphertext length to be "+this.nacl.secretbox.overheadLength+", got: "+N.length);return}var oe=Object(Qd.decode)(_.nonce);if(oe.length<this.nacl.secretbox.nonceLength){le.error("Expected encrypted event nonce length to be "+this.nacl.secretbox.nonceLength+", got: "+oe.length);return}var _e=this.nacl.secretbox.open(N,oe,this.key);if(_e===null){le.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,function(it,Ot){if(it){le.error("Failed to make a request to the authEndpoint: "+Ot+". Unable to fetch new key, so dropping encrypted event");return}if(_e=O.nacl.secretbox.open(N,oe,O.key),_e===null){le.error("Failed to decrypt event with new key. Dropping encrypted event");return}O.emit(k,O.getDataToEmit(_e))});return}this.emit(k,this.getDataToEmit(_e))},v.prototype.getDataToEmit=function(k){var _=Object(G_.decode)(k);try{return JSON.parse(_)}catch{return _}},v}(Jd),J_=X_,Q_=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}(),Z_=function(y){Q_(v,y);function v(k,_){var O=y.call(this)||this;O.state="initialized",O.connection=null,O.key=k,O.options=_,O.timeline=O.options.timeline,O.usingTLS=O.options.useTLS,O.errorCallbacks=O.buildErrorCallbacks(),O.connectionCallbacks=O.buildConnectionCallbacks(O.errorCallbacks),O.handshakeCallbacks=O.buildHandshakeCallbacks(O.errorCallbacks);var N=xt.getNetwork();return N.bind("online",function(){O.timeline.info({netinfo:"online"}),(O.state==="connecting"||O.state==="unavailable")&&O.retryIn(0)}),N.bind("offline",function(){O.timeline.info({netinfo:"offline"}),O.connection&&O.sendActivityCheck()}),O.updateStrategy(),O}return v.prototype.connect=function(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}},v.prototype.send=function(k){return this.connection?this.connection.send(k):!1},v.prototype.send_event=function(k,_,O){return this.connection?this.connection.send_event(k,_,O):!1},v.prototype.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},v.prototype.isUsingTLS=function(){return this.usingTLS},v.prototype.startConnecting=function(){var k=this,_=function(O,N){O?k.runner=k.strategy.connect(0,_):N.action==="error"?(k.emit("error",{type:"HandshakeError",error:N.error}),k.timeline.error({handshakeError:N.error})):(k.abortConnecting(),k.handshakeCallbacks[N.action](N))};this.runner=this.strategy.connect(0,_)},v.prototype.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},v.prototype.disconnectInternally=function(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var k=this.abandonConnection();k.close()}},v.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},v.prototype.retryIn=function(k){var _=this;this.timeline.info({action:"retry",delay:k}),k>
80&&this.emit("connecting_in",Math.round(k/1e3)),this.retryTimer=new We(k||0,function(){_.disconnectInternally(),_.connect()})},v.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},v.prototype.setUnavailableTimer=function(){var k=this;this.unavailableTimer=new We(this.options.unavailableTimeout,function(){k.updateState("unavailable")})},v.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},v.prototype.sendActivityCheck=function(){var k=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new We(this.options.pongTimeout,function(){k.timeline.error({pong_timed_out:k.options.pongTimeout}),k.retryIn(0)})},v.prototype.resetActivityCheck=function(){var k=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new We(this.activityTimeout,function(){k.sendActivityCheck()}))},v.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},v.prototype.buildConnectionCallbacks=function(k){var _=this;return q({},k,{message:function(O){_.resetActivityCheck(),_.emit("message",O)},ping:function(){_.send_event("pusher:pong",{})},activity:function(){_.resetActivityCheck()},error:function(O){_.emit("error",O)},closed:function(){_.abandonConnection(),_.shouldRetry()&&_.retryIn(1e3)}})},v.prototype.buildHandshakeCallbacks=function(k){var _=this;return q({},k,{connected:function(O){_.activityTimeout=Math.min(_.options.activityTimeout,O.activityTimeout,O.connection.activityTimeout||1/0),_.clearUnavailableTimer(),_.setConnection(O.connection),_.socket_id=_.connection.id,_.updateState("connected",{socket_id:_.socket_id})}})},v.prototype.buildErrorCallbacks=function(){var k=this,_=function(O){return function(N){N.error&&k.emit("error",{type:"WebSocketError",error:N.error}),O(N)}};return{tls_only:_(function(){k.usingTLS=!0,k.updateStrategy(),k.retryIn(0)}),refused:_(function(){k.disconnect()}),backoff:_(function(){k.retryIn(1e3)}),retry:_(function(){k.retryIn(0)})}},v.prototype.setConnection=function(k){this.connection=k;for(var _ in this.connectionCallbacks)this.connection.bind(_,this.connectionCallbacks[_]);this.resetActivityCheck()},v.prototype.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var k in this.connectionCallbacks)this.connection.unbind(k,this.connectionCallbacks[k]);var _=this.connection;return this.connection=null,_}},v.prototype.updateState=function(k,_){var O=this.state;if(this.state=k,O!==k){var N=k;N==="connected"&&(N+=" with new socket ID "+_.socket_id),le.debug("State changed",O+" -> "+N),this.timeline.info({state:k,params:_}),this.emit("state_change",{previous:O,current:k}),this.emit(k,_)}},v.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},v}(Hn),eE=Z_,tE=function(){function y(){this.channels={}}return y.prototype.add=function(v,k){return this.channels[v]||(this.channels[v]=rE(v,k)),this.channels[v]},y.prototype.all=function(){return at(this.channels)},y.prototype.find=function(v){return this.channels[v]},y.prototype.remove=function(v){var k=this.channels[v];return delete this.channels[v],k},y.prototype.disconnect=function(){be(this.channels,function(v){v.disconnect()})},y}(),nE=tE;function rE(y,v){if(y.indexOf("private-encrypted-")===0){if(v.config.nacl)return jr.createEncryptedChannel(y,v,v.config.nacl);var k="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",_=g.buildLogSuffix("encryptedChannelSupport");throw new M(k+". "+_)}else return y.indexOf("private-")===0?jr.createPrivateChannel(y,v):y.indexOf("presence-")===0?jr.createPresenceChannel(y,v):jr.createChannel(y,v)}var iE={createChannels:function(){return new nE},createConnectionManager:function(y,v){return new eE(y,v)},createChannel:function(y,v){return new Gg(y,v)},createPrivateChannel:function(y,v){return new Jd(y,v)},createPresenceChannel:function(y,v){return new q_(y,v)},createEncryptedChannel:function(y,v,k){return new J_(y,v,k)},createTimelineSender:function(y,v){return new F_(y,v)},createAuthorizer:function(y,v){return v.authorizer?v.authorizer(y,v):new D_(y,v)},createHandshake:function(y,v){return new R_(y,v)},createAssistantToTheTransportManager:function(y,v,k){return new A_(y,v,k)}},jr=iE,sE=function(){function y(v){this.options=v||{},this.livesLeft=this.options.lives||1/0}return y.prototype.getAssistant=function(v){return jr.createAssistantToTheTransportManager(this,v,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},y.prototype.isAlive=function(){return this.livesLeft>0},y.prototype.reportDeath=function(){this.livesLeft-=1},y}(),Yg=sE,oE=function(){function y(v,k){this.strategies=v,this.loop=!!k.loop,this.failFast=!!k.failFast,this.timeout=k.timeout,this.timeoutLimit=k.timeoutLimit}return y.prototype.isSupported=function(){return F(this.strategies,Te.method("isSupported"))},y.prototype.connect=function(v,k){var _=this,O=this.strategies,N=0,oe=this.timeout,_e=null,it=function(Ot,ln){ln?k(null,ln):(N=N+1,_.loop&&(N=N%O.length),N<O.length?(oe&&(oe=oe*2,_.timeoutLimit&&(oe=Math.min(oe,_.timeoutLimit))),_e=_.tryStrategy(O[N],v,{timeout:oe,failFast:_.failFast},it)):k(!0))};return _e=this.tryStrategy(O[N],v,{timeout:oe,failFast:this.failFast},it),{abort:function(){_e.abort()},forceMinPriority:function(Ot){v=Ot,_e&&_e.forceMinPriority(Ot)}}},y.prototype.tryStrategy=function(v,k,_,O){var N=null,oe=null;return _.timeout>0&&(N=new We(_.timeout,function(){oe.abort(),O(!0)})),oe=v.connect(k,function(_e,it){_e&&N&&N.isRunning()&&!_.failFast||(N&&N.ensureAborted(),O(_e,it))}),{abort:function(){N&&N.ensureAborted(),oe.abort()},forceMinPriority:function(_e){oe.forceMinPriority(_e)}}},y}(),xs=oE,aE=function(){function y(v){this.strategies=v}return y.prototype.isSupported=function(){return F(this.strategies,Te.method("isSupported"))},y.prototype.connect=function(v,k){return lE(this.strategies,v,function(_,O){return function(N,oe){if(O[_].error=N,N){cE(O)&&k(!0);return}Ce(O,function(_e){_e.forceMinPriority(oe.transport.priority)}),k(null,oe)}})},y}(),Zd=aE;function lE(y,v,k){var _=Oe(y,function(O,N,oe,_e){return O.connect(v,k(N,_e))});return{abort:function(){Ce(_,uE)},forceMinPriority:function(O){Ce(_,function(N){N.forceMinPriority(O)})}}}function cE(y){return ie(y,function(v){return!!v.error})}function uE(y){!y.error&&!y.aborted&&(y.abort(),y.aborted=!0)}var dE=function(){function y(v,k,_){this.strategy=v,this.transports=k,this.ttl=_.ttl||1800*1e3,this.usingTLS=_.useTLS,this.timeline=_.timeline}return y.prototype.isSupported=function(){return this.strategy.isSupported()},y.prototype.connect=function(v,k){var _=this.usingTLS,O=hE(_),N=[this.strategy];if(O&&O.timestamp+this.ttl>=Te.now()){var oe=this.transports[O.transport];oe&&(this.timeline.info({cached:!0,transport:O.transport,latency:O.latency}),N.push(new xs([oe],{timeout:O.latency*2+1e3,failFast:!0})))}var _e=Te.now(),it=N.pop().connect(v,function Ot(ln,Pn){ln?(Xg(_),N.length>0?(_e=Te.now(),it=N.pop().connect(v,Ot)):k(ln)):(pE(_,Pn.transport.name,Te.now()-_e),k(null,Pn))});return{abort:function(){it.abort()},forceMinPriority:function(Ot){v=Ot,it&&it.forceMinPriority(Ot)}}},y}(),fE=dE;function ef(y){return"pusherTransport"+(y?"TLS":"NonTLS")}function hE(y){var v=xt.getLocalStorage();if(v)try{var k=v[ef(y)];if(k)return JSON.parse(k)}catch{Xg(y)}return null}function pE(y,v,k){var _=xt.getLocalStorage();if(_)try{_[ef(y)]=D({timestamp:Te.now(),transport:v,latency:k})}catch{}}function Xg(y){var v=xt.getLocalStorage();if(v)try{delete v[ef(y)]}catch{}}var mE=function(){function y(v,k){var _=k.delay;this.strategy=v,this.options={delay:_}}return y.prototype.isSupported=function(){return this.strategy.isSupported()},y.prototype.connect=function(v,k){var _=this.strategy,O,N=new We(this.options.delay,function(){O=_.connect(v,k)});return{abort:function(){N.ensureAborted(),O&&O.abort()},forceMinPriority:function(oe){v=oe,O&&O.forceMinPriority(oe)}}},y}(),fc=mE,gE=function(){function y(v,k,_){this.test=v,this.trueBranch=k,this.falseBranch=_}return y.prototype.isSupported=function(){var v=this.test()?this.trueBranch:this.falseBranch;return v.isSupported()},y.prototype.connect=function(v,k){var _=this.test()?this.trueBranch:this.falseBranch;return _.connect(v,k)},y}(),ka=gE,vE=function(){function y(v){this.strategy=v}return y.prototype.isSupported=function(){return this.strategy.isSupported()},y.prototype.connect=function(v,k){var _=this.strategy.connect(v,function(O,N){N&&_.abort(),k(O,N)});return _},y}(),yE=vE;function wa(y){return function(){return y.isSupported()}}var bE=function(y,v,k){var _={};function O(cv,lC,cC,uC,dC){var uv=k(y,cv,lC,cC,uC,dC);return _[cv]=uv,uv}var N=Object.assign({},v,{hostNonTLS:y.wsHost+":"+y.wsPort,hostTLS:y.wsHost+":"+y.wssPort,httpPath:y.wsPath}),oe=Object.assign({},N,{useTLS:!0}),_e=Object.assign({},v,{hostNonTLS:y.httpHost+":"+y.httpPort,hostTLS:y.httpHost+":"+y.httpsPort,httpPath:y.httpPath}),it={loop:!0,timeout:15e3,timeoutLimit:6e4},Ot=new Yg({lives:2,minPingDelay:1e4,maxPingDelay:y.activityTimeout}),ln=new Yg({lives:2,minPingDelay:1e4,maxPingDelay:y.activityTimeout}),Pn=O("ws","ws",3,N,Ot),Br=O("wss","ws",3,oe,Ot),rC=O("sockjs","sockjs",1,_e),rv=O("xhr_streaming","xhr_streaming",1,_e,ln),iC=O("xdr_streaming","xdr_streaming",1,_e,ln),iv=O("xhr_polling","xhr_polling",1,_e),sC=O("xdr_polling","xdr_polling",1,_e),sv=new xs([Pn],it),oC=new xs([Br],it),aC=new xs([rC],it),ov=new xs([new ka(wa(rv),rv,iC)],it),av=new xs([new ka(wa(iv),iv,sC)],it),lv=new xs([new ka(wa(ov),new Zd([ov,new fc(av,{delay:4e3})]),av)],it),sf=new ka(wa(lv),lv,aC),of;return v.useTLS?of=new Zd([sv,new fc(sf,{delay:2e3})]):of=new Zd([sv,new fc(oC,{delay:2e3}),new fc(sf,{delay:5e3})]),new fE(new yE(new ka(wa(Pn),of,sf)),_,{ttl:18e5,timeline:v.timeline,useTLS:v.useTLS})},kE=bE,wE=function(){var y=this;y.timeline.info(y.buildTimelineMessage({transport:y.name+(y.options.useTLS?"s":"")})),y.hooks.isInitialized()?y.changeState("initialized"):y.hooks.file?(y.changeState("initializing"),f.load(y.hooks.file,{useTLS:y.options.useTLS},function(v,k){y.hooks.isInitialized()?(y.changeState("initialized"),k(!0)):(v&&y.onError(v),y.onClose(),k(!1))})):y.onClose()},xE={getRequest:function(y){var v=new window.XDomainRequest;return v.ontimeout=function(){y.emit("error",new T),y.close()},v.onerror=function(k){y.emit("error",k),y.close()},v.onprogress=function(){v.responseText&&v.responseText.length>0&&y.onChunk(200,v.responseText)},v.onload=function(){v.responseText&&v.responseText.length>0&&y.onChunk(200,v.responseText),y.emit("finished",200),y.close()},v},abortRequest:function(y){y.ontimeout=y.onerror=y.onprogress=y.onload=null,y.abort()}}
8,SE=xE,TE=function(){var y=function(v,k){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,O){_.__proto__=O}||function(_,O){for(var N in O)O.hasOwnProperty(N)&&(_[N]=O[N])},y(v,k)};return function(v,k){y(v,k);function _(){this.constructor=v}v.prototype=k===null?Object.create(k):(_.prototype=k.prototype,new _)}}(),_E=256*1024,EE=function(y){TE(v,y);function v(k,_,O){var N=y.call(this)||this;return N.hooks=k,N.method=_,N.url=O,N}return v.prototype.start=function(k){var _=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){_.close()},xt.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(k)},v.prototype.close=function(){this.unloader&&(xt.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},v.prototype.onChunk=function(k,_){for(;;){var O=this.advanceBuffer(_);if(O)this.emit("chunk",{status:k,data:O});else break}this.isBufferTooLong(_)&&this.emit("buffer_too_long")},v.prototype.advanceBuffer=function(k){var _=k.slice(this.position),O=_.indexOf(` 9`);return O!==-1?(this.position+=O+1,_.slice(0,O)):null},v.prototype.isBufferTooLong=function(k){return this.position===k.length&&k.length>_E},v}(Hn),CE=EE,tf;(function(y){y[y.CONNECTING=0]="CONNECTING",y[y.OPEN=1]="OPEN",y[y.CLOSED=3]="CLOSED"})(tf||(tf={}));var Ss=tf,OE=1,AE=function(){function y(v,k){this.hooks=v,this.session=Qg(1e3)+"/"+PE(8),this.location=ME(k),this.readyState=Ss.CONNECTING,this.openStream()}return y.prototype.send=function(v){return this.sendRaw(JSON.stringify([v]))},y.prototype.ping=function(){this.hooks.sendHeartbeat(this)},y.prototype.close=function(v,k){this.onClose(v,k,!0)},y.prototype.sendRaw=function(v){if(this.readyState===Ss.OPEN)try{return xt.createSocketRequest("POST",Jg(IE(this.location,this.session))).start(v),!0}catch{return!1}else return!1},y.prototype.reconnect=function(){this.closeStream(),this.openStream()},y.prototype.onClose=function(v,k,_){this.closeStream(),this.readyState=Ss.CLOSED,this.onclose&&this.onclose({code:v,reason:k,wasClean:_})},y.prototype.onChunk=function(v){if(v.status===200){this.readyState===Ss.OPEN&&this.onActivity();var k,_=v.data.slice(0,1);switch(_){case"o":k=JSON.parse(v.data.slice(1)||"{}"),this.onOpen(k);break;case"a":k=JSON.parse(v.data.slice(1)||"[]");for(var O=0;O<k.length;O++)this.onEvent(k[O]);break;case"m":k=JSON.parse(v.data.slice(1)||"null"),this.onEvent(k);break;case"h":this.hooks.onHeartbeat(this);break;case"c":k=JSON.parse(v.data.slice(1)||"[]"),this.onClose(k[0],k[1],!0);break}}},y.prototype.onOpen=function(v){this.readyState===Ss.CONNECTING?(v&&v.hostname&&(this.location.base=LE(this.location.base,v.hostname)),this.readyState=Ss.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)},y.prototype.onEvent=function(v){this.readyState===Ss.OPEN&&this.onmessage&&this.onmessage({data:v})},y.prototype.onActivity=function(){this.onactivity&&this.onactivity()},y.prototype.onError=function(v){this.onerror&&this.onerror(v)},y.prototype.openStream=function(){var v=this;this.stream=xt.createSocketRequest("POST",Jg(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",function(k){v.onChunk(k)}),this.stream.bind("finished",function(k){v.hooks.onFinished(v,k)}),this.stream.bind("buffer_too_long",function(){v.reconnect()});try{this.stream.start()}catch(k){Te.defer(function(){v.onError(k),v.onClose(1006,"Could not start streaming",!1)})}},y.prototype.closeStream=function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)},y}();function ME(y){var v=/([^\?]*)\/*(\??.*)/.exec(y);return{base:v[1],queryString:v[2]}}function IE(y,v){return y.base+"/"+v+"/xhr_send"}function Jg(y){var v=y.indexOf("?")===-1?"?":"&";return y+v+"t="+ +new Date+"&n="+OE++}function LE(y,v){var k=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(y);return k[1]+v+k[3]}function Qg(y){return Math.floor(Math.random()*y)}function PE(y){for(var v=[],k=0;k<y;
9k++)v.push(Qg(32).toString(32));return v.join("")}var RE=AE,$E={getReceiveURL:function(y,v){return y.base+"/"+v+"/xhr_streaming"+y.queryString},onHeartbeat:function(y){y.sendRaw("[]")},sendHeartbeat:function(y){y.sendRaw("[]")},onFinished:function(y,v){y.onClose(1006,"Connection interrupted ("+v+")",!1)}},DE=$E,NE={getReceiveURL:function(y,v){return y.base+"/"+v+"/xhr"+y.queryString},onHeartbeat:function(){},sendHeartbeat:function(y){y.sendRaw("[]")},onFinished:function(y,v){v===200?y.reconnect():y.onClose(1006,"Connection interrupted ("+v+")",!1)}},FE=NE,jE={getRequest:function(y){var v=xt.getXHRAPI(),k=new v;return k.onreadystatechange=k.onprogress=function(){switch(k.readyState){case 3:k.responseText&&k.responseText.length>0&&y.onChunk(k.status,k.responseText);break;case 4:k.responseText&&k.responseText.length>0&&y.onChunk(k.status,k.responseText),y.emit("finished",k.status),y.close();break}},k},abortRequest:function(y){y.onreadystatechange=null,y.abort()}},BE=jE,HE={createStreamingSocket:function(y){return this.createSocket(DE,y)},createPollingSocket:function(y){return this.createSocket(FE,y)},createSocket:function(y,v){return new RE(y,v)},createXHR:function(y,v){return this.createRequest(BE,y,v)},createRequest:function(y,v,k){return new CE(y,v,k)}},Zg=HE;Zg.createXDR=function(y,v){return this.createRequest(SE,y,v)};var UE=Zg,VE={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:o,DependenciesReceivers:d,getDefaultStrategy:kE,Transports:T_,transportConnectionInitializer:wE,HTTPFactory:UE,TimelineTransport:ue,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(y){var v=this;window.Pusher=y;var k=function(){v.onDocumentBody(y.ready)};window.JSON?k():f.load("json2",{},k)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:J,jsonp:Ke}},onDocumentBody:function(y){var v=this;document.body?y():setTimeout(function(){v.onDocumentBody(y)},0)},createJSONPRequest:function(y,v){return new de(y,v)},createScriptRequest:function(y){return new V(y)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var y=this.getXHRAPI();return new y},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return C_},createWebSocket:function(y){var v=this.getWebSocketAPI();return new v(y)},createSocketRequest:function(y,v){if(this.isXHRSupported())return this.HTTPFactory.createXHR(y,v);if(this.isXDRSupported(v.indexOf("https:")===0))return this.HTTPFactory.createXDR(y,v);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var y=this.getXHRAPI();return!!y&&new y().withCredentials!==void 0},isXDRSupported:function(y){var v=y?"https:":"http:",k=this.getProtocol();return!!window.XDomainRequest&&k===v},addUnloadListener:function(y){window.addEventListener!==void 0?window.addEventListener("unload",y,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",y)},removeUnloadListener:function(y){window.addEventListener!==void 0?window.removeEventListener("unload",y,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",y)}},xt=VE,nf;(function(y){y[y.ERROR=3]="ERROR",y[y.INFO=6]="INFO",y[y.DEBUG=7]="DEBUG"})(nf||(nf={}));var hc=nf,zE=function(){function y(v,k,_){this.key=v,this.session=k,this.events=[],this.options=_||{},this.sent=0,this.uniqueID=0}return y.prototype.log=function(v,k){v<=this.options.level&&(this.events.push(q({},k,{timestamp:Te.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},y.prototype.error=function(v){this.log(hc.ERROR,v)},y.prototype.info=function(v){this.log(hc.INFO,v)},y.prototype.debug=function(v){this.log(hc.DEBUG,v)},y.prototype.isEmpty=function(){return this.events.length===0},y.prototype.send=function(v,k){var _=this,O=q({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],v(O,function(N,oe){N||_.sent++,k&&k(N,oe)}),!0},y.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},y}(),WE=zE,KE=function(){function y(v,k,_,O){this.name=v,this.priority=k,this.transport=_,this.options=O||{}}return y.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},y.prototype.connect=function(v,k){var _=this;
9if(this.isSupported()){if(this.priority<v)return ev(new E,k)}else return ev(new I,k);var O=!1,N=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),oe=null,_e=function(){N.unbind("initialized",_e),N.connect()},it=function(){oe=jr.createHandshake(N,function(Br){O=!0,Pn(),k(null,Br)})},Ot=function(Br){Pn(),k(Br)},ln=function(){Pn();var Br;Br=D(N),k(new w(Br))},Pn=function(){N.unbind("initialized",_e),N.unbind("open",it),N.unbind("error",Ot),N.unbind("closed",ln)};return N.bind("initialized",_e),N.bind("open",it),N.bind("error",Ot),N.bind("closed",ln),N.initialize(),{abort:function(){O||(Pn(),oe?oe.close():N.close())},forceMinPriority:function(Br){O||_.priority<Br&&(oe?oe.close():N.close())}}},y}(),qE=KE;function ev(y,v){return Te.defer(function(){v(y)}),{abort:function(){},forceMinPriority:function(){}}}var GE=xt.Transports,YE=function(y,v,k,_,O,N){var oe=GE[k];if(!oe)throw new A(k);var _e=(!y.enabledTransports||ce(y.enabledTransports,v)!==-1)&&(!y.disabledTransports||ce(y.disabledTransports,v)===-1),it;return _e?(O=Object.assign({ignoreNullOrigin:y.ignoreNullOrigin},O),it=new qE(v,_,N?N.getAssistant(oe):oe,O)):it=XE,it},XE={isSupported:function(){return!1},connect:function(y,v){var k=Te.defer(function(){v(new I)});return{abort:function(){k.ensureAborted()},forceMinPriority:function(){}}}};function JE(y){var v={activityTimeout:y.activityTimeout||l.activityTimeout,authEndpoint:y.authEndpoint||l.authEndpoint,authTransport:y.authTransport||l.authTransport,cluster:y.cluster||l.cluster,httpPath:y.httpPath||l.httpPath,httpPort:y.httpPort||l.httpPort,httpsPort:y.httpsPort||l.httpsPort,pongTimeout:y.pongTimeout||l.pongTimeout,statsHost:y.statsHost||l.stats_host,unavailableTimeout:y.unavailableTimeout||l.unavailableTimeout,wsPath:y.wsPath||l.wsPath,wsPort:y.wsPort||l.wsPort,wssPort:y.wssPort||l.wssPort,enableStats:tC(y),httpHost:QE(y),useTLS:eC(y),wsHost:ZE(y)};return"auth"in y&&(v.auth=y.auth),"authorizer"in y&&(v.authorizer=y.authorizer),"disabledTransports"in y&&(v.disabledTransports=y.disabledTransports),"enabledTransports"in y&&(v.enabledTransports=y.enabledTransports),"ignoreNullOrigin"in y&&(v.ignoreNullOrigin=y.ignoreNullOrigin),"timelineParams"in y&&(v.timelineParams=y.timelineParams),"nacl"in y&&(v.nacl=y.nacl),v}function QE(y){return y.httpHost?y.httpHost:y.cluster?"sockjs-"+y.cluster+".pusher.com":l.httpHost}function ZE(y){return y.wsHost?y.wsHost:y.cluster?tv(y.cluster):tv(l.cluster)}function tv(y){return"ws-"+y+".pusher.com"}function eC(y){return xt.getProtocol()==="https:"?!0:y.forceTLS!==!1}function tC(y){return"enableStats"in y?y.enableStats:"disableStats"in y?!y.disableStats:!1}var nv=function(){function y(v,k){var _=this;if(nC(v),k=k||{},!k.cluster&&!(k.wsHost||k.httpHost)){var O=g.buildLogSuffix("javascriptQuickStart");le.warn("You should always specify a cluster when connecting. "+O)}"disableStats"in k&&le.warn("The disableStats option is deprecated in favor of enableStats"),this.key=v,this.config=JE(k),this.channels=jr.createChannels(),this.global_emitter=new Hn,this.sessionID=Math.floor(Math.random()*1e9),this.timeline=new WE(this.key,this.sessionID,{cluster:this.config.cluster,features:y.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:hc.INFO,version:l.VERSION}),this.config.enableStats&&(this.timelineSender=jr.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+xt.TimelineTransport.name}));var N=function(oe){return xt.getDefaultStrategy(_.config,oe,YE)};this.connection=jr.createConnectionManager(this.key,{getStrategy:N,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",function(){_.subscribeAll(),_.timelineSender&&_.timelineSender.send(_.connection.isUsingTLS())}),this.connection.bind("message",function(oe){var _e=oe.event,it=_e.indexOf("pusher_internal:")===0;if(oe.channel){var Ot=_.channel(oe.channel);Ot&&Ot.handleEvent(oe)}it||_.global_emitter.emit(oe.event,oe.data)}),this.connection.bind("connecting",function(){_.channels.disconnect()}),this.connection.bind("disconnected",function(){_.channels.disconnect()}),this.connection.bind("error",function(oe){le.warn(oe)}),y.instances.push(this),this.timeline.info({instances:y.instances.length}),y.isReady&&this.connect()}return y.ready=function(){y.isReady=!0;for(var v=0,k=y.instances.length;v<k;v++)y.instances[v].connect()},y.getClientFeatures=function(){return He(ht({ws:xt.Transports.ws},function(v){return v.isSupported({})}))},y.prototype.channel=function(v){return this.channels.find(v)},y.prototype.allChannels=function(){return this.channels.all()},y.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var v=this.connection.isUsingTLS(),k=this.timelineSender;this.timelineSenderTimer=new rt(6e4,function(){k.send(v)})}},y.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},y.prototype.bind=function(v,k,_){return this.global_emitter.bind(v,k,_),this},y.prototype.unbind=function(v,k,_){return this.global_emitter.unbind(v,k,_),this},y.prototype.bind_global=function(v){return this.global_emitter.bind_global(v),this},y.prototype.unbind_global=function(v){return this.global_emitter.unbind_global(v),this},y.prototype.unbind_all=function(v){return this.global_emitter.unbind_all(),this},y.prototype.subscribeAll=function(){var v;
9for(v in this.channels.channels)this.channels.channels.hasOwnProperty(v)&&this.subscribe(v)},y.prototype.subscribe=function(v){var k=this.channels.add(v,this);return k.subscriptionPending&&k.subscriptionCancelled?k.reinstateSubscription():!k.subscriptionPending&&this.connection.state==="connected"&&k.subscribe(),k},y.prototype.unsubscribe=function(v){var k=this.channels.find(v);k&&k.subscriptionPending?k.cancelSubscription():(k=this.channels.remove(v),k&&k.subscribed&&k.unsubscribe())},y.prototype.send_event=function(v,k,_){return this.connection.send_event(v,k,_)},y.prototype.shouldUseTLS=function(){return this.config.useTLS},y.instances=[],y.isReady=!1,y.logToConsole=!1,y.Runtime=xt,y.ScriptReceivers=xt.ScriptReceivers,y.DependenciesReceivers=xt.DependenciesReceivers,y.auth_callbacks=xt.auth_callbacks,y}(),rf=r.default=nv;function nC(y){if(y==null)throw"You must pass your app key when you instantiate Pusher."}xt.setup(nv)}])})})(yk);var SO=yk.exports;const TO=wn(SO);window.Pusher=TO;window.Echo=new xO({broadcaster:"pusher",key:"awe344uihzDRTzjh",wsHost:"ws.helpspace.com",wsPort:6001,wssPort:443,disableStats:!0,enabledTransports:["wss","ws"],forceTLS:!0}),window.Echo.connector.pusher.connection.strategy.transports.wss.transport.manager.livesLeft=1/0;function _O(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var bk={exports:{}};/*! 10 * @overview es6-promise - a tiny implementation of Promises/A+. 11 * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) 12 * @license Licensed under MIT license 13 * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE 14 * @version v4.2.8+1e68dce6 15 */(function(t,e){(function(n,r){t.exports=r()})(pr,function(){function n(B){var D=typeof B;return B!==null&&(D==="object"||D==="function")}function r(B){return typeof B=="function"}var i=void 0;Array.isArray?i=Array.isArray:i=function(B){return Object.prototype.toString.call(B)==="[object Array]"};var s=i,o=0,a=void 0,l=void 0,c=function(D,U){A[o]=D,A[o+1]=U,o+=2,o===2&&(l?l(I):$())};function u(B){l=B}function d(B){c=B}var f=typeof window<"u"?window:void 0,p=f||{},h=p.MutationObserver||p.WebKitMutationObserver,g=typeof self>"u"&&typeof process<"u"&&{}.toString.call(process)==="[object process]",m=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function b(){return function(){return process.nextTick(I)}}function T(){return typeof a<"u"?function(){a(I)}:M()}function E(){var B=0,D=new h(I),U=document.createTextNode("");return D.observe(U,{characterData:!0}),function(){U.data=B=++B%2}}function w(){var B=new MessageChannel;return B.port1.onmessage=I,function(){return B.port2.postMessage(0)}}function M(){var B=setTimeout;return function(){return B(I,1)}}var A=new Array(1e3);function I(){for(var B=0;B<o;B+=2){var D=A[B],U=A[B+1];D(U),A[B]=void 0,A[B+1]=void 0}o=0}function j(){try{var B=Function("return this")().require("vertx");return a=B.runOnLoop||B.runOnContext,T()}catch{return M()}}var $=void 0;g?$=b():h?$=E():m?$=w():f===void 0&&typeof _O=="function"?$=j():$=M();function J(B,D){var U=this,le=new this.constructor(G);le[Q]===void 0&&Ce(le);var Ie=U._state;if(Ie){var Ke=arguments[Ie-1];c(function(){return ce(Ie,le,Ke,U._result)})}else q(U,le,B,D);return le}function se(B){var D=this;if(B&&typeof B=="object"&&B.constructor===D)return B;var U=new D(G);return We(U,B),U}var Q=Math.random().toString(36).substring(2);function G(){}var ee=void 0,ge=1,ae=2;function ke(){return new TypeError("You cannot resolve a promise with itself")}function Le(){return new TypeError("A promises callback cannot return that same promise.")}function Ue(B,D,U,le){try{B.call(D,U,le)}catch(Ie){return Ie}}function Ze(B,D,U){c(function(le){var Ie=!1,Ke=Ue(U,D,function(H){Ie||(Ie=!0,D!==H?We(le,H):je(le,H))},function(H){Ie||(Ie=!0,Te(le,H))},"Settle: "+(le._label||" unknown promise"));!Ie&&Ke&&(Ie=!0,Te(le,Ke))},B)}function Je(B,D){D._state===ge?je(B,D._result):D._state===ae?Te(B,D._result):q(D,void 0,function(U){return We(B,U)},function(U){return Te(B,U)})}
15function Xe(B,D,U){D.constructor===B.constructor&&U===J&&D.constructor.resolve===se?Je(B,D):U===void 0?je(B,D):r(U)?Ze(B,D,U):je(B,D)}function We(B,D){if(B===D)Te(B,ke());else if(n(D)){var U=void 0;try{U=D.then}catch(le){Te(B,le);return}Xe(B,D,U)}else je(B,D)}function rt(B){B._onerror&&B._onerror(B._result),pe(B)}function je(B,D){B._state===ee&&(B._result=D,B._state=ge,B._subscribers.length!==0&&c(pe,B))}function Te(B,D){B._state===ee&&(B._state=ae,B._result=D,c(rt,B))}function q(B,D,U,le){var Ie=B._subscribers,Ke=Ie.length;B._onerror=null,Ie[Ke]=D,Ie[Ke+ge]=U,Ie[Ke+ae]=le,Ke===0&&B._state&&c(pe,B)}function pe(B){var D=B._subscribers,U=B._state;if(D.length!==0){for(var le=void 0,Ie=void 0,Ke=B._result,H=0;H<D.length;H+=3)le=D[H],Ie=D[H+U],le?ce(U,le,Ie,Ke):Ie(Ke);B._subscribers.length=0}}function ce(B,D,U,le){var Ie=r(U),Ke=void 0,H=void 0,V=!0;if(Ie){try{Ke=U(le)}catch(Z){V=!1,H=Z}if(D===Ke){Te(D,Le());return}}else Ke=le;D._state!==ee||(Ie&&V?We(D,Ke):V===!1?Te(D,H):B===ge?je(D,Ke):B===ae&&Te(D,Ke))}function be(B,D){try{D(function(le){We(B,le)},function(le){Te(B,le)})}catch(U){Te(B,U)}}var He=0;function at(){return He++}function Ce(B){B[Q]=He++,B._state=void 0,B._result=void 0,B._subscribers=[]}function Oe(){return new Error("Array Methods must be provided an Array")}var lt=function(){function B(D,U){this._instanceConstructor=D,this.promise=new D(G),this.promise[Q]||Ce(this.promise),s(U)?(this.length=U.length,this._remaining=U.length,this._result=new Array(this.length),this.length===0?je(this.promise,this._result):(this.length=this.length||0,this._enumerate(U),this._remaining===0&&je(this.promise,this._result))):Te(this.promise,Oe())}return B.prototype._enumerate=function(U){for(var le=0;this._state===ee&&le<U.length;le++)this._eachEntry(U[le],le)},B.prototype._eachEntry=function(U,le){var Ie=this._instanceConstructor,Ke=Ie.resolve;if(Ke===se){var H=void 0,V=void 0,Z=!1;try{H=U.then}catch(Pe){Z=!0,V=Pe}if(H===J&&U._state!==ee)this._settledAt(U._state,le,U._result);else if(typeof H!="function")this._remaining--,this._result[le]=U;else if(Ie===fe){var de=new Ie(G);Z?Te(de,V):Xe(de,U,H),this._willSettleAt(de,le)}else this._willSettleAt(new Ie(function(Pe){return Pe(U)}),le)}else this._willSettleAt(Ke(U),le)},B.prototype._settledAt=function(U,le,Ie){var Ke=this.promise;Ke._state===ee&&(this._remaining--,U===ae?Te(Ke,Ie):this._result[le]=Ie),this._remaining===0&&je(Ke,this._result)},B.prototype._willSettleAt=function(U,le){var Ie=this;q(U,void 0,function(Ke){return Ie._settledAt(ge,le,Ke)},function(Ke){return Ie._settledAt(ae,le,Ke)}
15)},B}();function yt(B){return new lt(this,B).promise}function ht(B){var D=this;return s(B)?new D(function(U,le){for(var Ie=B.length,Ke=0;Ke<Ie;Ke++)D.resolve(B[Ke]).then(U,le)}):new D(function(U,le){return le(new TypeError("You must pass an array to race."))})}function R(B){var D=this,U=new D(G);return Te(U,B),U}function F(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ie(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var fe=function(){function B(D){this[Q]=at(),this._result=this._state=void 0,this._subscribers=[],G!==D&&(typeof D!="function"&&F(),this instanceof B?be(this,D):ie())}return B.prototype.catch=function(U){return this.then(null,U)},B.prototype.finally=function(U){var le=this,Ie=le.constructor;return r(U)?le.then(function(Ke){return Ie.resolve(U()).then(function(){return Ke})},function(Ke){return Ie.resolve(U()).then(function(){throw Ke})}):le.then(U,U)},B}();fe.prototype.then=J,fe.all=yt,fe.race=ht,fe.resolve=se,fe.reject=R,fe._setScheduler=u,fe._setAsap=d,fe._asap=c;function Ve(){var B=void 0;if(typeof pr<"u")B=pr;else if(typeof self<"u")B=self;else try{B=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var D=B.Promise;if(D){var U=null;try{U=Object.prototype.toString.call(D.resolve())}catch{}if(U==="[object Promise]"&&!D.cast)return}B.Promise=fe}return fe.polyfill=Ve,fe.Promise=fe,fe})})(bk);var EO=bk.exports;EO.polyfill();function CO(){return kk().__VUE_DEVTOOLS_GLOBAL_HOOK__}function kk(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const OO=typeof Proxy=="function",AO="devtools-plugin:setup",MO="plugin:settings:set";let vo,yh;function IO(){var t;return vo!==void 0||(typeof window<"u"&&window.performance?(vo=!0,yh=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(vo=!0,yh=globalThis.perf_hooks.performance):vo=!1),vo}function LO(){return IO()?yh.now():Date.now()}class PO{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const o in e.settings){const a=e.settings[o];r[o]=a.defaultValue}const i=`__vue-devtools-plugin-settings__${e.id}`;let s=Object.assign({},r);try{const o=localStorage.getItem(i),a=JSON.parse(o);Object.assign(s,a)}catch{}this.fallbacks={getSettings(){return s},setSettings(o){try{localStorage.setItem(i,JSON.stringify(o))}catch{}s=o},now(){return LO()}},n&&n.on(MO,(o,a)=>{o===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(o,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(o,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}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 RO(t,e){const n=t,r=kk(),i=CO(),s=OO&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))i.emit(AO,t,e);else{const o=s?new PO(n,i):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}/*! 16 * vuex v4.1.0 17 * (c) 2022 Evan You 18 * @license MIT 19 */var fm="store";function $O(t){return t===void 0&&(t=null),Qs(t!==null?t:fm)}function DO(t,e){return t.filter(e)[0]}function bh(t,e){if(e===void 0&&(e=[]),t===null||typeof t!="object")return t;var n=DO(e,function(i){return i.original===t});if(n)return n.copy;var r=Array.isArray(t)?[]:{};return e.push({original:t,copy:r}),Object.keys(t).forEach(function(i){r[i]=bh(t[i],e)}),r}function ma(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function wk(t){return t!==null&&typeof t=="object"}function NO(t){return t&&typeof t.then=="function"}function FO(t,e){return function(){return t(e)}}function xk(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}}function Sk(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;bd(t,n,[],t._modules.root,!0),hm(t,n,e)}function hm(t,e,n){var r=t._state,i=t._scope;t.getters={},t._makeLocalGettersCache=Object.create(null);var s=t._wrappedGetters,o={},a={},l=nk(!0);l.run(function(){ma(s,function(c,u){o[u]=FO(c,t),a[u]=On(function(){return o[u]()}),Object.defineProperty(t.getters,u,{get:function(){return a[u].value},enumerable:!0})})}),t._state=gd({data:e}),t._scope=l,t.strict&&VO(t),r&&n&&t._withCommit(function(){r.data=null}),i&&i.stop()}function bd(t,e,n,r,i){var s=!n.length,o=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[o],t._modulesNamespaceMap[o]=r),!s&&!i){var a=pm(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit(function(){a[l]=r.state})}var c=r.context=jO(t,o,n);r.forEachMutation(function(u,d){var f=o+d;BO(t,f,u,c)}),r.forEachAction(function(u,d){var f=u.root?d:o+d,p=u.handler||u;HO(t,f,p,c)}),r.forEachGetter(function(u,d){var f=o+d;UO(t,f,u,c)}),r.forEachChild(function(u,d){bd(t,e,n.concat(d),u,i)})}
19function jO(t,e,n){var r=e==="",i={dispatch:r?t.dispatch:function(s,o,a){var l=lu(s,o,a),c=l.payload,u=l.options,d=l.type;return(!u||!u.root)&&(d=e+d),t.dispatch(d,c)},commit:r?t.commit:function(s,o,a){var l=lu(s,o,a),c=l.payload,u=l.options,d=l.type;(!u||!u.root)&&(d=e+d),t.commit(d,c,u)}};return Object.defineProperties(i,{getters:{get:r?function(){return t.getters}:function(){return Tk(t,e)}},state:{get:function(){return pm(t.state,n)}}}),i}function Tk(t,e){if(!t._makeLocalGettersCache[e]){var n={},r=e.length;Object.keys(t.getters).forEach(function(i){if(i.slice(0,r)===e){var s=i.slice(r);Object.defineProperty(n,s,{get:function(){return t.getters[i]},enumerable:!0})}}),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}function BO(t,e,n,r){var i=t._mutations[e]||(t._mutations[e]=[]);i.push(function(o){n.call(t,r.state,o)})}function HO(t,e,n,r){var i=t._actions[e]||(t._actions[e]=[]);i.push(function(o){var a=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},o);return NO(a)||(a=Promise.resolve(a)),t._devtoolHook?a.catch(function(l){throw t._devtoolHook.emit("vuex:error",l),l}):a})}function UO(t,e,n,r){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(s){return n(r.state,r.getters,s.state,s.getters)})}function VO(t){qo(function(){return t._state.data},function(){},{deep:!0,flush:"sync"})}function pm(t,e){return e.reduce(function(n,r){return n[r]},t)}function lu(t,e,n){return wk(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}var zO="vuex bindings",mv="vuex:mutations",lf="vuex:actions",yo="vuex",WO=0;function KO(t,e){RO({id:"org.vuejs.vuex",app:t,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[zO]},function(n){n.addTimelineLayer({id:mv,label:"Vuex Mutations",color:gv}),n.addTimelineLayer({id:lf,label:"Vuex Actions",color:gv}),n.addInspector({id:yo,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree(function(r){if(r.app===t&&r.inspectorId===yo)if(r.filter){var i=[];Ok(i,e._modules.root,r.filter,""),r.rootNodes=i}else r.rootNodes=[Ck(e._modules.root,"")]}),n.on.getInspectorState(function(r){if(r.app===t&&r.inspectorId===yo){var i=r.nodeId;Tk(e,i),r.state=YO(JO(e._modules,i),i==="root"?e.getters:e._makeLocalGettersCache,i)}}),n.on.editInspectorState(function(r){if(r.app===t&&r.inspectorId===yo){var i=r.nodeId,s=r.path;i!=="root"&&(s=i.split("/").filter(Boolean).concat(s)),e._withCommit(function(){r.set(e._state.data,s,r.state.value)})}}),e.subscribe(function(r,i){var s={};r.payload&&(s.payload=r.payload),s.state=i,n.notifyComponentUpdate(),n.sendInspectorTree(yo),n.sendInspectorState(yo),n.addTimelineEvent({layerId:mv,event:{time:Date.now(),title:r.type,data:s}})}),e.subscribeAction({before:function(r,i){var s={};r.payload&&(s.payload=r.payload),r._id=WO++,r._time=Date.now(),s.state=i,n.addTimelineEvent({layerId:lf,event:{time:r._time,title:r.type,groupId:r._id,subtitle:"start",data:s}})},after:function(r,i){var s={},o=Date.now()-r._time;s.duration={_custom:{type:"duration",display:o+"ms",tooltip:"Action duration",value:o}},r.payload&&(s.payload=r.payload),s.state=i,n.addTimelineEvent({layerId:lf,event:{time:Date.now(),title:r.type,groupId:r._id,subtitle:"end",data:s}})}})})}var gv=8702998,qO=6710886,GO=16777215,_k={label:"namespaced",textColor:GO,backgroundColor:qO};function Ek(t){return t&&t!=="root"?t.split("/").slice(-2,-1)[0]:"Root"}function Ck(t,e){return{id:e||"root",label:Ek(e),tags:t.namespaced?[_k]:[],children:Object.keys(t._children).map(function(n){return Ck(t._children[n],e+n+"/")})}}function Ok(t,e,n,r){r.includes(n)&&t.push({id:r||"root",label:r.endsWith("/")?r.slice(0,r.length-1):r||"Root",tags:e.namespaced?[_k]:[]}),Object.keys(e._children).forEach(function(i){Ok(t,e._children[i],n,r+i+"/")})}function YO(t,e,n){e=n==="root"?e:e[n];var r=Object.keys(e),i={state:Object.keys(t.state).map(function(o){return{key:o,editable:!0,value:t.state[o]}})};if(r.length){var s=XO(e);i.getters=Object.keys(s).map(function(o){return{key:o.endsWith("/")?Ek(o):o,editable:!1,value:kh(function(){return s[o]})}})}return i}function XO(t){var e={};return Object.keys(t).forEach(function(n){var r=n.split("/");if(r.length>1){var i=e,s=r.pop();
19r.forEach(function(o){i[o]||(i[o]={_custom:{value:{},display:o,tooltip:"Module",abstract:!0}}),i=i[o]._custom.value}),i[s]=kh(function(){return t[n]})}else e[n]=kh(function(){return t[n]})}),e}function JO(t,e){var n=e.split("/").filter(function(r){return r});return n.reduce(function(r,i,s){var o=r[i];if(!o)throw new Error('Missing module "'+i+'" for path "'+e+'".');return s===n.length-1?o:o._children},e==="root"?t:t.root._children)}function kh(t){try{return t()}catch(e){return e}}var Nr=function(e,n){this.runtime=n,this._children=Object.create(null),this._rawModule=e;var r=e.state;this.state=(typeof r=="function"?r():r)||{}},Ak={namespaced:{configurable:!0}};Ak.namespaced.get=function(){return!!this._rawModule.namespaced};Nr.prototype.addChild=function(e,n){this._children[e]=n};Nr.prototype.removeChild=function(e){delete this._children[e]};Nr.prototype.getChild=function(e){return this._children[e]};Nr.prototype.hasChild=function(e){return e in this._children};Nr.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)};Nr.prototype.forEachChild=function(e){ma(this._children,e)};Nr.prototype.forEachGetter=function(e){this._rawModule.getters&&ma(this._rawModule.getters,e)};Nr.prototype.forEachAction=function(e){this._rawModule.actions&&ma(this._rawModule.actions,e)};Nr.prototype.forEachMutation=function(e){this._rawModule.mutations&&ma(this._rawModule.mutations,e)};Object.defineProperties(Nr.prototype,Ak);var co=function(e){this.register([],e,!1)};co.prototype.get=function(e){return e.reduce(function(n,r){return n.getChild(r)},this.root)};co.prototype.getNamespace=function(e){var n=this.root;return e.reduce(function(r,i){return n=n.getChild(i),r+(n.namespaced?i+"/":"")},"")};co.prototype.update=function(e){Mk([],this.root,e)};co.prototype.register=function(e,n,r){var i=this;r===void 0&&(r=!0);var s=new Nr(n,r);if(e.length===0)this.root=s;else{var o=this.get(e.slice(0,-1));o.addChild(e[e.length-1],s)}n.modules&&ma(n.modules,function(a,l){i.register(e.concat(l),a,r)})};co.prototype.unregister=function(e){var n=this.get(e.slice(0,-1)),r=e[e.length-1],i=n.getChild(r);i&&i.runtime&&n.removeChild(r)};co.prototype.isRegistered=function(e){var n=this.get(e.slice(0,-1)),r=e[e.length-1];return n?n.hasChild(r):!1};function Mk(t,e,n){if(e.update(n),n.modules)for(var r in n.modules){if(!e.getChild(r))return;Mk(t.concat(r),e.getChild(r),n.modules[r])}}function Ik(t){return new jn(t)}var jn=function(e){var n=this;e===void 0&&(e={});var r=e.plugins;r===void 0&&(r=[]);var i=e.strict;i===void 0&&(i=!1);var s=e.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new co(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=s;var o=this,a=this,l=a.dispatch,c=a.commit;this.dispatch=function(f,p){return l.call(o,f,p)},this.commit=function(f,p,h){return c.call(o,f,p,h)},this.strict=i;var u=this._modules.root.state;bd(this,u,[],this._modules.root),hm(this,u),r.forEach(function(d){return d(n)})},mm={state:{configurable:!0}};jn.prototype.install=function(e,n){e.provide(n||fm,this),e.config.globalProperties.$store=this;var r=this._devtools!==void 0?this._devtools:!1;r&&KO(e,this)};mm.state.get=function(){return this._state.data};mm.state.set=function(t){};jn.prototype.commit=function(e,n,r){var i=this,s=lu(e,n,r),o=s.type,a=s.payload,l={type:o,payload:a},c=this._mutations[o];c&&(this._withCommit(function(){c.forEach(function(d){d(a)})}),this._subscribers.slice().forEach(function(u){return u(l,i.state)}))};jn.prototype.dispatch=function(e,n){var r=this,i=lu(e,n),s=i.type,o=i.payload,a={type:s,payload:o},l=this._actions[s];if(l){try{this._actionSubscribers.slice().filter(function(u){return u.before}).forEach(function(u){return u.before(a,r.state)})}catch{}var c=l.length>1?Promise.all(l.map(function(u){return u(o)})):l[0](o);return new Promise(function(u,d){c.then(function(f){try{r._actionSubscribers.filter(function(p){return p.after}
19).forEach(function(p){return p.after(a,r.state)})}catch{}u(f)},function(f){try{r._actionSubscribers.filter(function(p){return p.error}).forEach(function(p){return p.error(a,r.state,f)})}catch{}d(f)})})}};jn.prototype.subscribe=function(e,n){return xk(e,this._subscribers,n)};jn.prototype.subscribeAction=function(e,n){var r=typeof e=="function"?{before:e}:e;return xk(r,this._actionSubscribers,n)};jn.prototype.watch=function(e,n,r){var i=this;return qo(function(){return e(i.state,i.getters)},n,Object.assign({},r))};jn.prototype.replaceState=function(e){var n=this;this._withCommit(function(){n._state.data=e})};jn.prototype.registerModule=function(e,n,r){r===void 0&&(r={}),typeof e=="string"&&(e=[e]),this._modules.register(e,n),bd(this,this.state,e,this._modules.get(e),r.preserveState),hm(this,this.state)};jn.prototype.unregisterModule=function(e){var n=this;typeof e=="string"&&(e=[e]),this._modules.unregister(e),this._withCommit(function(){var r=pm(n.state,e.slice(0,-1));delete r[e[e.length-1]]}),Sk(this)};jn.prototype.hasModule=function(e){return typeof e=="string"&&(e=[e]),this._modules.isRegistered(e)};jn.prototype.hotUpdate=function(e){this._modules.update(e),Sk(this,!0)};jn.prototype._withCommit=function(e){var n=this._committing;this._committing=!0,e(),this._committing=n};Object.defineProperties(jn.prototype,mm);var Lk=wd(function(t,e){var n={};return kd(e).forEach(function(r){var i=r.key,s=r.val;n[i]=function(){var a=this.$store.state,l=this.$store.getters;if(t){var c=xd(this.$store,"mapState",t);if(!c)return;a=c.context.state,l=c.context.getters}return typeof s=="function"?s.call(this,a,l):a[s]},n[i].vuex=!0}),n}),Pk=wd(function(t,e){var n={};return kd(e).forEach(function(r){var i=r.key,s=r.val;n[i]=function(){for(var a=[],l=arguments.length;l--;)a[l]=arguments[l];var c=this.$store.commit;if(t){var u=xd(this.$store,"mapMutations",t);if(!u)return;c=u.context.commit}return typeof s=="function"?s.apply(this,[c].concat(a)):c.apply(this.$store,[s].concat(a))}}),n}),Rk=wd(function(t,e){var n={};return kd(e).forEach(function(r){var i=r.key,s=r.val;s=t+s,n[i]=function(){if(!(t&&!xd(this.$store,"mapGetters",t)))return this.$store.getters[s]},n[i].vuex=!0}),n}),$k=wd(function(t,e){var n={};return kd(e).forEach(function(r){var i=r.key,s=r.val;n[i]=function(){for(var a=[],l=arguments.length;l--;)a[l]=arguments[l];var c=this.$store.dispatch;if(t){var u=xd(this.$store,"mapActions",t);if(!u)return;c=u.context.dispatch}return typeof s=="function"?s.apply(this,[c].concat(a)):c.apply(this.$store,[s].concat(a))}}),n}),QO=function(t){return{mapState:Lk.bind(null,t),mapGetters:Rk.bind(null,t),mapMutations:Pk.bind(null,t),mapActions:$k.bind(null,t)}};function kd(t){return ZO(t)?Array.isArray(t)?t.map(function(e){return{key:e,val:e}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}}):[]}function ZO(t){return Array.isArray(t)||wk(t)}function wd(t){return function(e,n){return typeof e!="string"?(n=e,e=""):e.charAt(e.length-1)!=="/"&&(e+="/"),t(e,n)}}function xd(t,e,n){var r=t._modulesNamespaceMap[n];return r}function eA(t){t===void 0&&(t={});var e=t.collapsed;e===void 0&&(e=!0);var n=t.filter;n===void 0&&(n=function(u,d,f){return!0});var r=t.transformer;r===void 0&&(r=function(u){return u});var i=t.mutationTransformer;i===void 0&&(i=function(u){return u});var s=t.actionFilter;s===void 0&&(s=function(u,d){return!0});var o=t.actionTransformer;o===void 0&&(o=function(u){return u});var a=t.logMutations;a===void 0&&(a=!0);var l=t.logActions;l===void 0&&(l=!0);var c=t.logger;return c===void 0&&(c=console),function(u){var d=bh(u.state);typeof c>"u"||(a&&u.subscribe(function(f,p){var h=bh(p);if(n(f,d,h)){var g=bv(),m=i(f),b="mutation "+f.type+g;vv(c,b,e),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(d)),c.log("%c mutation","color: #03A9F4; font-weight: bold",m),c.log("%c next state","color: #4CAF50; font-weight: bold",r(h)),yv(c)}d=h}),l&&u.subscribeAction(function(f,p){if(s(f,p)){var h=bv(),g=o(f),m="action "+f.type+h;vv(c,m,e),c.log("%c action","color: #03A9F4; font-weight: bold",g),yv(c)}}))}}function vv(t,e,n){var r=n?t.groupCollapsed:t.group;try{r.call(t,e)}catch{t.log(e)}}function yv(t){try{t.groupEnd()}catch{t.log("ââ log end ââ")}}function bv(){var t=new Date;return" @ "+mc(t.getHours(),2)+":"+mc(t.getMinutes(),2)+":"+mc(t.getSeconds(),2)+"."+mc(t.getMilliseconds(),3)}function tA(t,e){return new Array(e+1).join(t)}function mc(t,e){return tA("0",e-t.toString().length)+t}var gm={version:"4.1.0",Store:jn,storeKey:fm,createStore:Ik,useStore:$O,mapState:Lk,mapMutations:Pk,mapGetters:Rk,mapActions:$k,createNamespacedHelpers:QO,createLogger:eA};const nA={state:{messages:[]},getters:{notify:t=>t.messages},mutations:{addNotifyMessage(t,e){t.messages.push(e)},removeNotifyMessage(t,e){t.messages.splice(e,1)}
19,pauseNotifyMessage(t,e){t.messages[e]&&(t.messages[e].createdAt=0)}}},rA={state:{customerId:window.CustomerId?window.CustomerId:!1,isTrial:window.IsTrial?JSON.parse(window.IsTrial):!1,trialEndsAt:window.TrialEndsAt?window.TrialEndsAt:!1,trialHasEnded:window.TrialHasEnded?JSON.parse(window.TrialHasEnded):!1,customerInfo:window.CustomerInfo?JSON.parse(window.CustomerInfo):!1,subscription:window.Subscription?JSON.parse(window.Subscription):!1},getters:{isTrial:t=>t.isTrial,trialEndsAt:t=>t.trialEndsAt,trialHasEnded:t=>t.trialHasEnded,subscription:t=>t.subscription,customerInfo:t=>t.customerInfo},mutations:{setSubscription(t,e){t.subscription=e.data},setCustomerInfo(t,e){t.customerInfo=e.data}},actions:{getSubscription(t,e){let n=e?"/billing/subscription?new=1":"/billing/subscription";ze.get(n).then(r=>{t.commit("setSubscription",r.data),t.dispatch("getCustomerInfo")})},getCustomerInfo(t){ze.get("/auth/customerinfo").then(n=>{t.commit("setCustomerInfo",n.data)})}}},iA={state:{formModal:{show:!1,component:"",params:{}},ticketModal:{show:!1,component:"",params:{}},taskModal:{show:!1,component:"",params:{}},docsArticleModal:{show:!1,component:"",params:{}},dialogModal:{show:!1,component:"",params:{},title:"",text:"",buttons:["No","Yes"],type:"normal",closeOnEsc:!0},previewModal:{show:!1,title:"",text:"",src:"",type:"image",mime:"",list:[]},commandBarModal:{show:!1,params:{}}},getters:{formModal:t=>t.formModal,ticketModal:t=>t.ticketModal,taskModal:t=>t.taskModal,docsArticleModal:t=>t.docsArticleModal,dialogModal:t=>t.dialogModal,previewModal:t=>t.previewModal,commandBarModal:t=>t.commandBarModal},mutations:{showFormModal(t,e){t.formModal={show:!0,component:e.component,params:e.params?e.params:{}}},hideFormModal(t){t.formModal.show=!1,t.formModal.component="",typeof t.formModal.params.onClose=="function"&&t.formModal.params.onClose(),t.formModal.params={}},showTicketModal(t,e){t.ticketModal={show:!0,component:e.component,params:e.params?e.params:{}}},hideTicketModal(t){t.ticketModal.show=!1,t.ticketModal.component="",t.ticketModal.params={}},showTaskModal(t,e){t.taskModal={show:!0,component:e.component,params:e.params?e.params:{}}},showCommandBarModal(t,e){t.commandBarModal={show:!0,params:e&&e.params?e.params:{}}},updateTaskModal(t,e){t.taskModal.params.task=e},hideTaskModal(t){t.taskModal.show=!1,t.taskModal.component="",t.taskModal.params={}},hideCommandBarModal(t){t.commandBarModal.show=!1,t.commandBarModal.params={}},showDocsArticleModal(t,e){t.docsArticleModal={show:!0,component:e.component,params:e.params?e.params:{}}},hideDocsArticleModal(t){t.docsArticleModal.show=!1,t.docsArticleModal.component="",t.docsArticleModal.params={}},showDialogModal(t,e){t.dialogModal={show:!0,component:e.component,params:e.params?e.params:{},title:e.title,text:e.text,buttons:e.buttons,type:e.type?e.type:t.dialogModal.type,closeOnEsc:typeof e.closeOnEsc<"u"?e.closeOnEsc:!0}},hideDialogModal(t){t.dialogModal.show=!1,t.dialogModal.component="";const e=t.dialogModal.params.onClose;delete t.dialogModal.params.onClose,typeof e=="function"&&e()},showPreviewModal(t,e){t.previewModal={show:!0,title:e.title,text:e.text,src:e.src,type:e.type,mime:e.mime,list:e.list}},hidePreviewModal(t){t.previewModal.show=!1}}};var sA=Xl,oA=rm,aA=pC;function lA(t){return function(e,n,r){var i=Object(e);if(!oA(e)){var s=sA(n);e=aA(e),n=function(a){return s(i[a],a,i)}}var o=t(e,n,r);return o>-1?i[s?e[o]:o]:void 0}}var cA=lA;function uA(t,e,n,r){for(var i=t.length,s=n+(r?1:-1);r?s--:++s<i;)if(e(t[s],s,t))return s;return-1}var Dk=uA,dA=mC,kv=1/0,fA=17976931348623157e292;function hA(t){if(!t)return t===0?t:0;if(t=dA(t),t===kv||t===-kv){var e=t<0?-1:1;return e*fA}return t===t?t:0}var pA=hA,mA=pA;function gA(t){var e=mA(t),n=e%1;return e===e?n?e-n:e:0}var Nk=gA,vA=Dk,yA=Xl,bA=Nk,kA=Math.max;function wA(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:bA(n);return i<0&&(i=kA(r+i,0)),vA(t,yA(e),i)}var Fk=wA;const un=wn(Fk);var xA=cA,SA=Fk,TA=xA(SA),_A=TA;const jk=wn(_A),EA={state:{globalTaskList:[],activeBoard:null,boards:[],taskIsLoading:!1,tasksLastPath:localStorage.getItem("tasksLastPath")},getters:{activeBoard:t=>t.activeBoard,boards:t=>t.boards,globalTaskList:t=>t.globalTaskList,taskIsLoading:t=>t.taskIsLoading,tasksLastPath:t=>t.tasksLastPath},mutations:{setTaskIsLoading(t,e){t.taskIsLoading=e},setBoards(t,e){t.boards=e},setActiveBoard(t,e){t.activeBoard=e},setTasksLastPath(t,e){localStorage.setItem("tasksLastPath",e),t.tasksLastPath=e},setGlobalTaskList(t,e){t.globalTaskList=e},addTaskToGlobalTaskList(t,e){t.globalTaskList.findIndex(r=>
19r.id===e.id)<0&&t.globalTaskList.push(e)},addTasksToGlobalTaskList(t,e){t.globalTaskList=t.globalTaskList.concat(e)},updateTaskInGlobalTaskList(t,e){const n=t.globalTaskList.findIndex(r=>r.id===e.task.id);n>=0?t.globalTaskList[n]=e.task:typeof e.updateOrAdd=="boolean"&&e.updateOrAdd&&t.globalTaskList.push(e.task)},deleteTaskFromGlobalTaskList(t,e){const n=t.globalTaskList.findIndex(r=>r.id===e);n>=0&&t.globalTaskList.splice(n,1)},updateDoneInGlobalTaskList(t,e){const n=t.globalTaskList.findIndex(r=>r.id===e.task.id);n>=0&&(t.globalTaskList[n].done_at=e.task.done_at)}},actions:{fetchBoards:Qt(function({commit:t,getters:e},n){ze.get("/selectable/boards").then(r=>{t("setBoards",r.data.data);let i=jk(e.boards,function(s){return s.id==n});t("setActiveBoard",i||e.boards[0])})},3e3,{leading:!0}),tasksGetTaskById(t,e){return t.commit("setTaskIsLoading",!0),ze.get("/tasks/"+e).then(n=>(t.commit("updateTaskInGlobalTaskList",{task:n.data.data}),t.commit("setTaskIsLoading",!1),n.data.data)).catch(()=>{t.commit("setTaskIsLoading",!1)})},editTask(t,e){t.commit("showFormModal",{component:"tasks/modals/_edit-task.modal.vue",params:{task:e,updated:n=>{typeof n=="object"&&typeof n.id<"u"&&t.commit("updateTaskInGlobalTaskList",{task:n})},deleted:n=>{typeof n=="object"&&typeof n.id<"u"&&t.commit("deleteTaskFromGlobalTaskList",n.id)}}})},viewTask(t,e){typeof e=="object"&&(e=e.id),!(typeof e!="object"&&(t.dispatch("tasksGetTaskById",e).then(n=>{t.commit("updateTaskModal",n)}),t.getters.taskModal.show))&&t.commit("showTaskModal",{component:"tasks/modals/_view-task.modal.vue",params:{task:e,updated:n=>{typeof n=="object"&&typeof n.id<"u"&&t.commit("updateTaskInGlobalTaskList",{task:n})},deleted:n=>{typeof n=="object"&&typeof n.id<"u"&&t.commit("deleteTaskFromGlobalTaskList",n.id)}}})},taskToggleDone(t,e){const n=e.done_at;e.done_at=e.done_at?null:new Date().toISOString(),t.commit("updateDoneInGlobalTaskList",{task:e}),t.dispatch("taskUpdateDoneRequest",{task:e,done_at:e.done_at}).catch(()=>{e.done_at=n,t.commit("updateDoneInGlobalTaskList",{task:e}),this.$notify.error(this.$trans.get("There was an error, please check your connection."))})},taskUpdateDoneRequest(t,e){return ze.patch("/tasks/"+e.task.id,{done_at:e.done_at}).then(n=>(t.commit("updateTaskInGlobalTaskList",{task:n.data.data}),n))}}};vd.use(gm);const CA={state:{initialTicketId:0,ticketId:0,tickets:[],isLoading:!1,draft:null,error:null},getters:{ticketId:t=>t.ticketId,initialTicketId:t=>t.initialTicketId,ticket:t=>{let e=un(t.tickets,n=>n.id==t.ticketId);return t.tickets[e]instanceof Object?t.tickets[e]:{}},tickets:t=>t.tickets,draft:(t,e)=>e.ticket.draft instanceof Object?e.ticket.draft:null,isLoading:t=>t.isLoading,isTicketCached:t=>e=>{let n=un(t.tickets,r=>r.id==e);return t.tickets[n]instanceof Object},getTicketFromCache:t=>e=>{let n=un(t.tickets,r=>r.id==e);return t.tickets[n]instanceof Object?t.tickets[n]:!1},error:t=>t.error},mutations:{ticketLoadingEnd:Qt(function(t){t.isLoading=!1},0),clearInitialTicketId(t){t.initialTicketId=!1}},actions:{setInitialTicketId({state:t},e){t.initialTicketId=e},setTicketContact({state:t},e){let n=un(t.tickets,r=>r.id==e.ticket_id);t.tickets[n].contact=e.contact},setTicketAssignee({state:t},e){let n=un(t.tickets,r=>r.id==e.id);t.tickets[n].assignee=e.assignee},setTicketMessageBody({state:t},e){let n=un(t.tickets,i=>i.id==e.ticket_id);if(n===-1)return;let r=un(t.tickets[n].messages,i=>i.id==e.message_id);t.tickets[n].messages[r].body=e.body,t.tickets[n].messages[r].raw_body_loaded=!0},loadOlderMessages({state:t},e){if(!e||!e.id)return Promise.resolve();let n=un(t.tickets,s=>s.id==e.id);if(n===-1)return Promise.resolve();let r=t.tickets[n],i=r.messages_meta;return!i||!i.has_more||!i.next_cursor||r._loading_older_messages?Promise.resolve():(r._loading_older_messages=!0,ze.get(`/tickets/${e.id}/messages`,{params:{before_id:i.next_cursor,before_created_at:i.next_cursor_created_at||void 0,per_page:i.per_page||15}}).then(s=>{let o=un(t.tickets,f=>f.id==e.id);if(o===-1)return s;let a=t.tickets[o],l=Array.isArray(a.messages)?a.messages:[],c=new Set(l.map(f=>f.id)),u=(s.data.data||[]).filter(f=>!c.has(f.id));a.messages=l.concat(u);let d=s.data.meta||{};return a.messages_meta={total:a.messages_meta?a.messages_meta.total:l.length+u.length,loaded:l.length+u.length,per_page:d.per_page||a.messages_meta&&a.messages_meta.per_page||15,has_more:!!d.has_more,next_cursor:d.next_cursor||null,next_cursor_created_at:d.next_cursor_created_at||null},s}).catch(s=>s).finally(()=>{let s=un(t.tickets,o=>o.id==e.id);s!==-1&&(t.tickets[s]._loading_older_messages=!1)}))},getTicket:Qt(function({dispatch:t,getters:e,state:n},r){!r.id||r.id<=0||(r.id!=n.ticketId&&!e.isTicketCached(r.id)&&
19(n.isLoading=!0),n.ticketId=r.id,r.fetch==!0&&t("fetchTicket",r.id).then(i=>i))},300,{leading:!0}),cacheTicket({state:t,getters:e,commit:n},r){if(typeof r>"u")return;let i=un(t.tickets,s=>s.id==r.id);i===-1?t.tickets.push(r):t.tickets[i]=r,setTimeout(()=>{n("updateTicketInTicketList",{ticket:r,section:e.section})},400)},cacheDraftCreate({state:t},e){if(typeof e.draft>"u")return;let n=un(t.tickets,r=>r.id==e.id);n!==-1&&t.tickets[n]instanceof Object&&(t.tickets[n].draft=e.draft)},cacheDraftUpdate({state:t},e){if(typeof e.draft>"u")return;let n=un(t.tickets,r=>r.id==e.id);n!==-1&&t.tickets[n]instanceof Object&&t.tickets[n].draft instanceof Object&&(t.tickets[n].draft=e.draft)},revealTicket({getters:t},e){ze.get("/tickets/"+e.ticket_id).then(n=>(t.getRouter.push({name:"tickets-section",params:{section:n.data.data.section,id:n.data.data.id},query:t.getRouter.currentRoute.query}),n))},setTicket({dispatch:t,commit:e},n){typeof n>"u"||(this.getters.section!=n.section&&["mine","unassigned","assigned","closed","spam","trash"].includes(this.getters.section)&&!this.getters.ticketModal.params.id&&localStorage.initialTicketId==n.id&&this.getters.getRouter.push({name:"tickets-section",params:{section:n.section,id:n.id},query:this.getters.getRouter.currentRoute.query}),this.getters.mobileView&&!this.getters.ticketModal.params.id&&this.getters.initialTicketId==0&&(t("setInitialTicketId",n.id),e("showView"),e("closeSubMenuLeft")),t("cacheTicket",n),e("ticketLoadingEnd"))},reloadCurrentTicket({dispatch:t,getters:e}){t("fetchTicket",e.ticketId)},fetchTicket:Qt(function({state:t,dispatch:e,commit:n},r){t.error=null,r&&ze.get("/tickets/"+r).then(function(i){return e("setTicket",i.data.data),i}).catch(function(i){return n("ticketLoadingEnd"),t.error=i.response,i}).finally(function(){})},800,{leading:!0}),deleteDraft({state:t},e){let n=un(t.tickets,r=>r.id==e);t.tickets[n].draft=null},fetchTicketAndPushToTicketList:Qt(function({dispatch:t,commit:e},n){n&&ze.get("/tickets/"+n).then(function(r){return e("prependToTicketList",{section:r.data.data.section,ticket:r.data.data}),t("cacheTicket",r.data.data),r}).catch(function(r){return r}).finally(function(){})},500,{leading:!0})}},OA=["contacts","assignees","teams","status","orTags","andTicketIds","subject","body","subjectOrBody"];function Bk(t){return!t||typeof t!="object"||Array.isArray(t)?{}:Object.fromEntries(OA.flatMap(e=>{const n=Array.isArray(t[e])?[...new Set(t[e].filter(r=>typeof r=="string"||typeof r=="number").map(r=>String(r).trim()).filter(Boolean))]:[];return n.length?[[e,n]]:[]}))}function Nse(t){try{return Bk(JSON.parse(t||"{}"))}catch{return{}}}function wv(t,e){const n={contacts:"contact",assignees:"agent",teams:"team",status:"status",orTags:"orTag",subject:"subject",body:"body",subjectOrBody:"subjectOrBody"},r=Object.entries(Bk(e)).flatMap(([i,s])=>s.map(o=>{const a=o.replace(/^"(.*)"$/s,"$1").trim();return i==="andTicketIds"?`#${a.replace(/^#/,"")}`:`${n[i]}:"${a}"`}));return[String(t||"").trim(),...r].filter(Boolean).join(" ")}var AA=vC,MA=gC,IA="Expected a function";function LA(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(IA);return MA(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),AA(t,e,{leading:r,maxWait:e,trailing:i})}var PA=LA;const Jr=wn(PA);function RA(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var $A=RA,DA=$A,NA=cm,FA=yC,jA=lo;function BA(t,e){var n=jA(t)?DA:NA;return n(t,FA(e))}var HA=BA;const UA=wn(HA);vd.use(gm);const VA={state:{channels:[],selectedChannel:null,section:"unassigned",sectionsCounts:{},ticketLists:[],ticketListSearchedItems:[],ticketListMeta:{},ticketListIsLoading:!0,ticketListSearchIsLoading:!1,ticketListFirstTicketId:!1,searchQuery:"",searchTagIds:[],searchAdvancedFilters:{},searchCancelTokenSource:null},getters:{channels:t=>t.channels,selectedChannel:t=>t.selectedChannel,section:t=>t.section,ticketListMeta:t=>{const e=t.searchQuery||t.searchTagIds.length>0||Object.keys(t.searchAdvancedFilters).length>0;return t.ticketListSearchedItems instanceof Array&&t.ticketListMeta.search instanceof Object&&(e||t.ticketListSearchedItems.length>
190)?t.ticketListMeta.search:t.ticketListMeta[t.section]instanceof Object?t.ticketListMeta[t.section]:{}},nextPageLink:(t,e)=>e.ticketListMeta.next_page?"?page="+e.ticketListMeta.next_page:!1,ticketList:t=>t.ticketLists[t.section]instanceof Array?t.ticketLists[t.section]:[],ticketListSearchedItems:t=>t.ticketListSearchedItems instanceof Array?t.ticketListSearchedItems:[],ticketListSearchIsLoading:t=>t.ticketListSearchIsLoading,sectionsCounts:t=>e=>t.sectionsCounts instanceof Object?t.sectionsCounts[e]:"",ticketListFirstTicketId:(t,e)=>e.ticketList.length>0&&e.ticketList[0]instanceof Object?e.ticketList[0].id:0,ticketListIsLoading:t=>t.ticketListIsLoading,isTicketListOfSectionInCached:t=>e=>t.ticketLists[e]instanceof Array,searchQuery:t=>t.searchQuery,searchAdvancedFilters:t=>t.searchAdvancedFilters,searchTagIds:t=>t.searchTagIds,isTicketSearchActive:t=>!!t.searchQuery||t.searchTagIds.length>0||Object.keys(t.searchAdvancedFilters).length>0,searchedWithoutResults:(t,e)=>{var n;return!!(e.isTicketSearchActive&&((n=t.ticketListSearchedItems)==null?void 0:n.length)==0)}},mutations:{ticketListLoadingEnd:Qt(function(t){t.ticketListIsLoading=!1},10),setChannels(t,e){t.channels=e},appendToTicketList(t,e){t.ticketLists[e.section].push(...e.data)},appendToTicketListSearchedItems(t,e){t.ticketListSearchedItems.push(...e.data)},prependToTicketList(t,e){let n=JSON.parse(JSON.stringify(e.ticket));n.messages=[],t.ticketLists[e.section]&&t.ticketLists[e.section].findIndex(i=>i.id==n.id)==-1&&t.ticketLists[e.section].unshift(n)},deleteTicketFromTicketList(t,e){if(t.ticketLists[e.section]){const n=t.ticketLists[e.section].findIndex(r=>
19r.id==e.ticket_id);n>=0&&t.ticketLists[e.section].splice(n,1)}if(t.ticketListSearchedItems){const n=t.ticketListSearchedItems.findIndex(r=>r.id==e.ticket_id);n>=0&&t.ticketListSearchedItems.splice(n,1)}},updateTicketPropertyInTicketList(t,e){if(t.ticketLists[e.section]){const n=t.ticketLists[e.section].findIndex(r=>r.id==e.ticket_id);n>=0&&(t.ticketLists[e.section][n][e.key]=e.value)}if(t.ticketListSearchedItems){const n=t.ticketListSearchedItems.findIndex(r=>r.id==e.ticket_id);n>=0&&(t.ticketListSearchedItems[n][e.key]=e.value)}},updateTicketInTicketList(t,e){let n=JSON.parse(JSON.stringify(e.ticket));if(n.messages=[],t.ticketLists[e.section]){const r=t.ticketLists[e.section].findIndex(i=>i.id==n.id);r>=0&&(t.ticketLists[e.section][r]=n)}if(t.ticketListSearchedItems){const r=t.ticketListSearchedItems.findIndex(i=>i.id==n.id);r>=0&&(t.ticketListSearchedItems[r]=n)}},setTicketListMeta(t,e){const n={current_page:e.meta.current_page,from:e.meta.from,last_page:e.meta.last_page,next_page:e.meta.current_page<e.meta.last_page?e.meta.current_page+1:!1,per_page:e.meta.per_page,to:e.meta.to,total:e.meta.total,section:e.section};t.ticketListMeta[e.section]=n},unsetTicketListMeta(t,e){t.ticketListMeta[e.section]={}},setTicketListSearchedItems(t,e){t.ticketListSearchedItems=e},setTicketListSearchIsLoading(t,e){t.ticketListSearchIsLoading=e},setSearchQuery:(t,e)=>t.searchQuery=e,setSearchAdvancedFilters(t,e){t.searchAdvancedFilters=e},setSearchTagIds(t,e){t.searchTagIds=Array.isArray(e)?e:[]}},actions:{getChannels:Qt(function({commit:t}){ze.get("/selectable/channels").then(e=>{t("setChannels",e.data.data)})},500,{leading:!0}),getTicketList:Qt(function({dispatch:t,getters:e,state:n,commit:r},i){i.section&&(e.channels.length==0&&t("getChannels"),r("unsetTicketListMeta",{section:i.section}),n.ticketListIsLoading=!0,n.section=i.section,e.isTicketListOfSectionInCached(i.section)&&(t("selectTicket",i.id),r("ticketListLoadingEnd")),t("fetchTicketListDebounced",{section:i.section,id:i.id}))},500,{leading:!0}),setTicketList:Qt(function({state:t,dispatch:e,commit:n},r){if(typeof r.section>"u"){n("ticketListLoadingEnd");return}if(typeof r.data>"u"){t.ticketLists[r.section]=[],n("ticketListLoadingEnd");return}t.ticketLists[r.section]=r.data,t.ticketListIsLoading&&e("selectTicket",r.id)},0,{leading:!0}),selectTicket({state:t,commit:e,getters:n,dispatch:r},i){i=i>0?i:n.ticketListFirstTicketId,i>0&&n.getRouter&&(n.getRouter.push({name:"tickets-section",params:{section:t.section,id:i},query:(n.getRouter.currentRoute.value||n.getRouter.currentRoute).query}),r("getTicket",{id:i,fetch:!1})),e("ticketListLoadingEnd")},preFetchTicketLists({dispatch:t},e){e.old instanceof Object&&UA(e.old,function(n,r){n!=e.new[r]&&t("fetchTicketList",{section:r,id:0})})},async reloadTicketListSync({dispatch:t,getters:e}){return await t("updateSectionsCounts"),t("fetchTicketList",{section:e.section,id:e.ticketId})},reloadTicketList:Qt(function({dispatch:t}){t("reloadTicketListSync")},300),reloadTicketListIfPageOne:Qt(function({dispatch:t,getters:e}){typeof e.ticketListMeta.current_page<"u"&&e.ticketListMeta.current_page==1&&t("reloadTicketListSync")},500),fetchTicketListDebounced:Qt(function({dispatch:t},e){t("fetchTicketList",{section:e.section,id:e.id})},300),updateSectionsCounts:Jr(function({state:t,dispatch:e}){ze.get("/tickets/sections/count").then((function(n){let r=t.sectionsCounts;t.sectionsCounts=n.data,e("preFetchTicketLists",{old:r,new:n.data})}).bind(this))},0,{leading:!0}),updateSectionsCountsOnly:Jr(function({state:t}){ze.get("/tickets/sections/count").then((function(e){t.sectionsCounts=e.data}).bind(this))},0,{leading:!0}),searchTicketsDebounced:Qt(function({dispatch:t},e){t("searchTickets",e)},1300),async searchTickets({getters:t,commit:e,dispatch:n,state:r},i){typeof i=="string"?i=i.trim():i=(r.searchQuery||"").trim();const s=r.searchTagIds,o=t.getRouter,a=o.currentRoute.value||o.currentRoute,l={...a.query};if(i?l.search=i:delete l.search,s.length?l.tags=s.join(","):delete l.tags,Object.keys(r.searchAdvancedFilters).length?l.advanced=JSON.stringify(r.searchAdvancedFilters):delete l.advanced,JSON.stringify(l)!==JSON.stringify(a.query)&&await o.replace({query:l}),!i&&!s.length&&!Object.keys(r.searchAdvancedFilters).length){n("resetTicketSearch");return}return r.searchCancelTokenSource&&(r.searchCancelTokenSource.cancel("CancelSearchLoadAgain"),r.searchCancelTokenSource=null),r.searchCancelTokenSource=ze.CancelToken.source(),e("setTicketListSearchIsLoading",!0),ze.post("/tickets/search",{text:wv(i,r.searchAdvancedFilters),tags:s,section:t.section},{cancelToken:r.searchCancelTokenSource.token}).then(c=>(e("setSearchQuery",i),c.data.data[0]&&n("selectTicket",c.data.data[0].id),e("setTicketListSearchedItems",c.data.data),e("setTicketListMeta",{section:"search",meta:c.data.meta}),setTimeout(()=>{e("setTicketListSearchIsLoading",!1)},400),c)).catch(c=>{c.message!="CancelSearchLoadAgain"&&e("setTicketListSearchIsLoading",!1)}).finally(()=>{})},resetTicketSearch({commit:t,state:e}){t("setTicketListSearchedItems",[]),t("setSearchQuery",""),t("setSearchTagIds",[]),t("setSearchAdvancedFilters",{}),t("setTicketListSearchIsLoading",!1),t("setTicketListMeta",{section:"search",meta:{}}),e.searchCancelTokenSource&&(e.searchCancelTokenSource.cancel("CancelSearchLoadAgain"),e.searchCancelTokenSource=null)},fetchTicketList({dispatch:t,commit:e,getters:n},r){e("setTicketListMeta",{section:r.section,meta:{}}),ze.get("/tickets/section/"+r.section).then(i=>{i.data.meta.first instanceof Object&&t("cacheTicket",i.data.meta.first),e("setTicketListMeta",{section:r.section,meta:i.data.meta}),t("setTicketList",{section:r.section,data:i.data.data,id:r.id})}).catch(i=>{i.response&&i.response.status===404&&this.getters.getRouter.push({name:"tickets-section",params:{section:"unassigned",id:0},query:(n.getRouter.currentRoute.value||n.getRouter.currentRoute).query})})},appendTicketList({commit:t,dispatch:e,getters:n},r){n.nextPageLink&&ze.get("/tickets/section/"+r.section+n.nextPageLink).then(i=>{i.data.data.length?(t("setTicketListMeta",{section:r.section,meta:i.data.meta}),t("appendToTicketList",{section:r.section,data:i.data.data})):e("reloadTicketList")}).catch(()=>{e("reloadTicketList")}).finally(()=>{})},appendTicketListSearchedItems({commit:t,getters:e,state:n},r){ze.post("/tickets/search"+e.nextPageLink,{text:wv(r.query,n.searchAdvancedFilters),tags:n.searchTagIds,section:e.section}).then(i=>{t("setTicketListMeta",{section:"search",meta:i.data.meta}),t("appendToTicketListSearchedItems",{section:r.section,data:i.data.data})})},updateTicketsPropertyInTicketList({commit:t},e){e.ids.forEach(n=>{e.ticket_id=n,t("updateTicketPropertyInTicketList",e)})},deleteTicketsFromTicketList({commit:t},e){e.ids.forEach(n=>{e.ticket_id=n,t("deleteTicketFromTicketList",e)})}}},zA={state:{notifications:[],announcements:[],announcementDetails:null},getters:{notifications:t=>t},mutations:{setNotifications(t,e){t.announcements=e.announcements,t.notifications=e.notifications},showAnnouncementDetails(t,e){t.announcementDetails=e}},actions:{getNotifications(t){ze.get("/notifications").then(e=>{t.commit("setNotifications",e.data)})},readNotifications(t){ze.get("/notifications/read").then(e=>{t.commit("setUserData",e.data.data)})}}};vd.use(gm);const WA={state:{docsArticle:null,docsSites:null,docsSiteActive:null,docsSitesIsLoading:!1,docsArticleIsLoading:!1,docsArticleEditMode:!1},getters:{docsBreadcrumb:t=>{let e=[];return e.push({name:$trans.get("Docs"),path:"/docs",arrow:!0,hidden:window.innerWidth<=990}),t.docsSiteActive!=null&&(e.push({name:t.docsSiteActive.name,path:"/docs/"+t.docsSiteActive.id+"/articles/",arrow:!0,hidden:window.innerWidth<=990}),t.docsArticle!=null&&e.push({name:t.docsArticle.title,arrow:!0})),e},docsSiteVisibility:t=>t.docsSiteActive==null?"":t.docsSiteActive.is_public?"public":"private",docsSites:t=>t.docsSites,docsSiteActive:t=>t.docsSiteActive,docsSitesIsLoading:t=>t.docsSitesIsLoading,docsArticle:t=>t.docsArticle,docsArticleIsLoading:t=>t.docsArticleIsLoading,docsArticleEditMode:t=>t.docsArticleEditMode},mutations:{setDocsArticle(t,e){t.docsArticle=e},setDocsSites(t,e){t.docsSites=e},setDocsSiteActive(t,e){t.docsSiteActive=e},mutateDocsArticleEditMode(t,e){t.docsArticleEditMode=e},setDocsArticleAliases(t,e){t.docsArticle.aliases=e}},actions:{updateDocsSiteActive({commit:t},e){t("setDocsSiteActive",e)},enableDocsArticleEditMode({commit:t}){t("mutateDocsArticleEditMode",!0)},disableDocsArticleEditMode({commit:t}){t("mutateDocsArticleEditMode",!1)},updateDocsArticle({commit:t},e){t("setDocsArticle",e)},unsetDocsArticle({commit:t}){t("setDocsArticle",null)},fetchDocsArticle({commit:t,state:e},n){return e.docsArticleIsLoading=!0,n.reset==!0&&t("setDocsArticle",null),ze.get("/app/docs/articles/"+n.articleId).then(r=>(t("setDocsArticle",r.data.data),t("setDocsSiteActive",r.data.data.site),r)).catch(r=>(t("setDocsArticle",null),r)).finally(()=>{e.docsArticleIsLoading=!1})},fetchDocsSites({commit:t,state:e},n){return e.docsSiteActive==null&&(e.docsSitesIsLoading=!0),ze.get("/app/docs/sites/").then(r=>(t("setDocsSites",r.data.data),r)).catch(r=>(t("setDocsSites",null),r)).finally(()=>{e.docsSitesIsLoading=!1})}}},gl=Ik({modules:{notify:nA,account:rA,modals:iA,tasks:EA,tickets:CA,ticketList:VA,notifications:zA,knowledgeBase:WA},state:{unsavedChanges:!1,router:null,user:window.User?JSON.parse(window.User):{},assetsVersion:window.AssetsVersion,mobileView:window.innerWidth<=990,isMac:navigator.userAgent.indexOf("Mac OS X")!=-1,commandKey:navigator.userAgent.indexOf("Mac OS X")!=-1?"â":"â",controlKey:navigator.userAgent.indexOf("Mac OS X")!=-1?"â":"ctrl",altKey:navigator.userAgent.indexOf("Mac OS X")!=-1?"â¥":"alt",backspaceKey:navigator.userAgent.indexOf("Mac OS X")!=-1?"â«":"del",refreshRequired:!1,showSubMenuLeft:localStorage.hasOwnProperty("showSubMenuLeft")?JSON.parse(localStorage.getItem("showSubMenuLeft")):!0,listIsVisible:!0,viewIsVisible:!1,infoIsVisible:!1},getters:{listIsVisible:t=>t.listIsVisible,viewIsVisible:t=>t.viewIsVisible,infoIsVisible:t=>t.infoIsVisible,hasUnsavedChanges:t=>t.unsavedChanges,showSubMenuLeft:t=>()=>t.showSubMenuLeft,refreshRequired:t=>t.refreshRequired,mobileView:t=>t.mobileView,user:t=>t.user,getRouter:t=>t.router,isMac:t=>t.isMac,commandKey:t=>t.commandKey,controlKey:t=>t.controlKey,altKey:t=>t.altKey,backspaceKey:t=>t.backspaceKey},mutations:{showList(t){t.viewIsVisible=!1,t.listIsVisible=!0,t.infoIsVisible=!1},showInfo(t){t.viewIsVisible=!1,t.listIsVisible=!1,t.infoIsVisible=!0},showView(t){t.listIsVisible=!1,t.viewIsVisible=!0,t.infoIsVisible=!1},setUnsavedChanges(t,e){t.unsavedChanges=e},setRouter(t,e){t.router=e},setUserData(t,e){t.user=e},setRefreshRequired(t,e){t.refreshRequired=e},toggleSubMenuLeft(t){t.showSubMenuLeft=!t.showSubMenuLeft,localStorage.setItem("showSubMenuLeft",t.showSubMenuLeft)},closeSubMenuLeft(t){t.showSubMenuLeft=!1,localStorage.setItem("showSubMenuLeft",t.showSubMenuLeft)}},actions:{fetchAuthUser(t){ze.get("/auth/user").then(e=>{t.commit("setUserData",e.data.data)})},initWidget({commit:t,state:e}){window.HelpWidget("init",{always_hide_bubble:!0,style:"modal",auth:{token:"V7qngeKr7Ae042r2LlJjB4Qp5LR9uYfGkYGWfFk1",client_id:"aa8c4ace9d514924b7170f62edfb1b70",widget_id:"8848b9bc-f5b9-475c-b694-f28dd59087e6"}}),window.HelpWidget("user",{name:e.user.name,email:e.user.email,id:e.user.id,show:!1})},checkAssetsVersion(t){ze.get("/assetsversion").then(e=>{t.commit("setRefreshRequired",window.AssetsVersion!=e.data)})}}});/*! 20 * vue-router v4.6.4 21 * (c) 2025 Eduardo San Martin Morote 22 * @license MIT 23 */const _o=typeof document<"u";function Hk(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function KA(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&Hk(t.default)}const At=Object.assign;function cf(t,e){const n={};for(const r in e){const i=e[r];n[r]=Lr(i)?i.map(t):t(i)}return n}const Xa=()=>{},Lr=Array.isArray;function xv(t,e){const n={};for(const r in t)n[r]=r in e?e[r]:t[r];return n}const Uk=/#/g,qA=/&/g,GA=/\//g,YA=/=/g,XA=/\?/g,Vk=/\+/g,JA=/%5B/g,QA=/%5D/g,zk=/%5E/g,ZA=/%60/g,Wk=/%7B/g,eM=/%7C/g,Kk=/%7D/g,tM=/%20/g;function vm(t){return t==null?"":encodeURI(""+t).replace(eM,"|").replace(JA,"[").replace(QA,"]")}function nM(t){return vm(t).replace(Wk,"{").replace(Kk,"}").replace(zk,"^")}function wh(t){return vm(t).replace(Vk,"%2B").replace(tM,"+").replace(Uk,"%23").replace(qA,"%26").replace(ZA,"`").replace(Wk,"{").replace(Kk,"}").replace(zk,"^")}function rM(t){return wh(t).replace(YA,"%3D")}function iM(t){return vm(t).replace(Uk,"%23").replace(XA,"%3F")}function sM(t){return iM(t).replace(GA,"%2F")}function vl(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const oM=/\/$/,aM=t=>t.replace(oM,"");function uf(t,e,n="/"){let r,i={},s="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=e.slice(0,l),s=e.slice(l,a>0?a:e.length),i=t(s.slice(1))),a>=0&&(r=r||e.slice(0,a),o=e.slice(a,e.length)),r=dM(r??e,n),{fullPath:r+s+o,path:r,query:i,hash:vl(o)}}function lM(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function Sv(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function cM(t,e,n){const r=e.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&Go(e.matched[r],n.matched[i])&&qk(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Go(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function qk(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!uM(t[n],e[n]))return!1;return!0}function uM(t,e){return Lr(t)?Tv(t,e):Lr(e)?Tv(e,t):(t==null?void 0:t.valueOf())===(e==null?void 0:e.valueOf())}function Tv(t,e){return Lr(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t.length===1&&t[0]===e}function dM(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),r=t.split("/"),i=r[r.length-1];(i===".."||i===".")&&r.push("");let s=n.length-1,o,a;for(o=0;o<r.length;o++)if(a=r[o],a!==".")if(a==="..")s>1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(o).join("/")}const Fi={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let xh=function(t){return t.pop="pop",t.push="push",t}({}),df=function(t){return t.back="back",t.forward="forward",t.unknown="",t}({});function fM(t){if(!t)if(_o){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),aM(t)}const hM=/^[^#]+#/;function pM(t,e){return t.replace(hM,"#")+e}function mM(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{behavior:e.behavior,left:r.left-n.left-(e.left||0),top:r.top-n.top-(e.top||0)}}const Sd=()=>({left:window.scrollX,top:window.scrollY});function gM(t){let e;if("el"in t){const n=t.el,r=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;e=mM(i,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}
vendor: 20,358 bytes, lines 23-27
23function _v(t,e){return(history.state?history.state.position-e:-1)+t}const Sh=new Map;function vM(t,e){Sh.set(t,e)}function yM(t){const e=Sh.get(t);return Sh.delete(t),e}function bM(t){return typeof t=="string"||t&&typeof t=="object"}function Gk(t){return typeof t=="string"||typeof t=="symbol"}let Yt=function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t}({});const Yk=Symbol("");Yt.MATCHER_NOT_FOUND+"",Yt.NAVIGATION_GUARD_REDIRECT+"",Yt.NAVIGATION_ABORTED+"",Yt.NAVIGATION_CANCELLED+"",Yt.NAVIGATION_DUPLICATED+"";function Yo(t,e){return At(new Error,{type:t,[Yk]:!0},e)}function di(t,e){return t instanceof Error&&Yk in t&&(e==null||!!(t.type&e))}const kM=["params","query","hash"];function wM(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const n of kM)n in t&&(e[n]=t[n]);return JSON.stringify(e,null,2)}function xM(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;r<n.length;++r){const i=n[r].replace(Vk," "),s=i.indexOf("="),o=vl(s<0?i:i.slice(0,s)),a=s<0?null:vl(i.slice(s+1));if(o in e){let l=e[o];Lr(l)||(l=e[o]=[l]),l.push(a)}else e[o]=a}return e}function Ev(t){let e="";for(let n in t){const r=t[n];if(n=rM(n),r==null){r!==void 0&&(e+=(e.length?"&":"")+n);continue}(Lr(r)?r.map(i=>i&&wh(i)):[r&&wh(r)]).forEach(i=>{i!==void 0&&(e+=(e.length?"&":"")+n,i!=null&&(e+="="+i))})}return e}function SM(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=Lr(r)?r.map(i=>i==null?null:""+i):r==null?r:""+r)}return e}const TM=Symbol(""),Cv=Symbol(""),ym=Symbol(""),Xk=Symbol(""),Th=Symbol("");function xa(){let t=[];function e(r){return t.push(r),()=>{const i=t.indexOf(r);i>-1&&t.splice(i,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function Hi(t,e,n,r,i,s=o=>o()){const o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((a,l)=>{const c=f=>{f===!1?l(Yo(Yt.NAVIGATION_ABORTED,{from:n,to:e})):f instanceof Error?l(f):bM(f)?l(Yo(Yt.NAVIGATION_GUARD_REDIRECT,{from:e,to:f})):(o&&r.enterCallbacks[i]===o&&typeof f=="function"&&o.push(f),a())},u=s(()=>t.call(r&&r.instances[i],e,n,c));let d=Promise.resolve(u);t.length<3&&(d=d.then(c)),d.catch(f=>l(f))})}function ff(t,e,n,r,i=s=>s()){const s=[];for(const o of t)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(Hk(l)){const c=(l.__vccOpts||l)[e];c&&s.push(Hi(c,n,r,o,a,i))}else{let c=l();s.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const d=KA(u)?u.default:u;o.mods[a]=u,o.components[a]=d;const f=(d.__vccOpts||d)[e];return f&&Hi(f,n,r,o,a,i)()}))}}return s}function _M(t,e){const n=[],r=[],i=[],s=Math.max(e.matched.length,t.matched.length);for(let o=0;o<s;o++){const a=e.matched[o];a&&(t.matched.find(c=>Go(c,a))?r.push(a):n.push(a));const l=t.matched[o];l&&(e.matched.find(c=>Go(c,l))||i.push(l))}return[n,r,i]}/*! 24 * vue-router v4.6.4 25 * (c) 2025 Eduardo San Martin Morote 26 * @license MIT 27 */let EM=()=>location.protocol+"//"+location.host;function Jk(t,e){const{pathname:n,search:r,hash:i}=e,s=t.indexOf("#");if(s>-1){let o=i.includes(t.slice(s))?t.slice(s).length:1,a=i.slice(o);return a[0]!=="/"&&(a="/"+a),Sv(a,"")}return Sv(n,t)+r+i}function CM(t,e,n,r){let i=[],s=[],o=null;const a=({state:f})=>{const p=Jk(t,location),h=n.value,g=e.value;let m=0;if(f){if(n.value=p,e.value=f,o&&o===h){o=null;return}m=g?f.position-g.position:0}else r(p);i.forEach(b=>{b(n.value,h,{delta:m,type:xh.pop,direction:m?m>0?df.forward:df.back:df.unknown})})};function l(){o=n.value}function c(f){i.push(f);const p=()=>{const h=i.indexOf(f);h>-1&&i.splice(h,1)};return s.push(p),p}function u(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(At({},f.state,{scroll:Sd()}),"")}}function d(){for(const f of s)f();s=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:c,destroy:d}}function Ov(t,e,n,r=!1,i=!1){return{back:t,current:e,forward:n,replaced:r,position:window.history.length,scroll:i?Sd():null}}function OM(t){const{history:e,location:n}=window,r={value:Jk(t,n)},i={value:e.state};i.value||s(r.value,{back:null,current:r.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function s(l,c,u){const d=t.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?t:t.slice(d))+l:EM()+t+l;try{e[u?"replaceState":"pushState"](c,"",f),i.value=c}catch(p){console.error(p),n[u?"replace":"assign"](f)}}function o(l,c){s(l,At({},e.state,Ov(i.value.back,l,i.value.forward,!0),c,{position:i.value.position}),!0),r.value=l}function a(l,c){const u=At({},i.value,e.state,{forward:l,scroll:Sd()});s(u.current,u,!0),s(l,At({},Ov(r.value,l,null),{position:u.position+1},c),!1),r.value=l}return{location:r,state:i,push:a,replace:o}}function AM(t){t=fM(t);const e=OM(t),n=CM(t,e.state,e.location,e.replace);function r(s,o=!0){o||n.pauseListeners(),history.go(s)}const i=At({location:"",base:t,go:r,createHref:pM.bind(null,t)},e,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>e.state.value}),i}function Qk(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),AM(t)}let Rs=function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t}({});var cn=function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t}(cn||{});const MM={type:Rs.Static,value:""},IM=/[a-zA-Z0-9_]/;function LM(t){if(!t)return[[]];if(t==="/")return[[MM]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(p){throw new Error(`ERR (${n})/"${c}": ${p}`)}let n=cn.Static,r=n;const i=[];let s;function o(){s&&i.push(s),s=[]}let a=0,l,c="",u="";function d(){c&&(n===cn.Static?s.push({type:Rs.Static,value:c}):n===cn.Param||n===cn.ParamRegExp||n===cn.ParamRegExpEnd?(s.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),s.push({type:Rs.Param,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function f(){c+=l}for(;a<t.length;){if(l=t[a++],l==="\\"&&n!==cn.ParamRegExp){r=n,n=cn.EscapeNext;continue}switch(n){case cn.Static:l==="/"?(c&&d(),o()):l===":"?(d(),n=cn.Param):f();break;case cn.EscapeNext:f(),n=r;break;case cn.Param:l==="("?n=cn.ParamRegExp:IM.test(l)?f():(d(),n=cn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case cn.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=cn.ParamRegExpEnd:u+=l;break;case cn.ParamRegExpEnd:d(),n=cn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:e("Unknown state");break}}return n===cn.ParamRegExp&&e(`Unfinished custom RegExp for param "${c}"`),d(),o(),i}const Av="[^/]+?",PM={sensitive:!1,strict:!1,start:!0,end:!0};var $n=function(t){return t[t._multiplier=10]="_multiplier",t[t.Root=90]="Root",t[t.Segment=40]="Segment",t[t.SubSegment=30]="SubSegment",t[t.Static=40]="Static",t[t.Dynamic=20]="Dynamic",t[t.BonusCustomRegExp=10]="BonusCustomRegExp",t[t.BonusWildcard=-50]="BonusWildcard",t[t.BonusRepeatable=-20]="BonusRepeatable",t[t.BonusOptional=-8]="BonusOptional",t[t.BonusStrict=.7000000000000001]="BonusStrict",t[t.BonusCaseSensitive=.25]="BonusCaseSensitive",t}($n||{});const RM=/[.+*?^${}()[\]/\\]/g;function $M(t,e){const n=At({},PM,e),r=[];let i=n.start?"^":"";const s=[];for(const c of t){const u=c.length?[]:[$n.Root];n.strict&&!c.length&&(i+="/");for(let d=0;d<c.length;d++){const f=c[d];let p=$n.Segment+(n.sensitive?$n.BonusCaseSensitive:0);if(f.type===Rs.Static)d||(i+="/"),i+=f.value.replace(RM,"\\$&"),p+=$n.Static;else if(f.type===Rs.Param){const{value:h,repeatable:g,optional:m,regexp:b}=f;s.push({name:h,repeatable:g,optional:m});const T=b||Av;if(T!==Av){p+=$n.BonusCustomRegExp;try{`${T}`}catch(w){throw new Error(`Invalid custom RegExp for param "${h}" (${T}): `+w.message)}}let E=g?`((?:${T})(?:/(?:${T}))*)`:`(${T})`;d||(E=m&&c.length<2?`(?:/${E})`:"/"+E),m&&(E+="?"),i+=E,p+=$n.Dynamic,m&&(p+=$n.BonusOptional),g&&(p+=$n.BonusRepeatable),T===".*"&&(p+=$n.BonusWildcard)}u.push(p)}r.push(u)}if(n.strict&&n.end){const c=r.length-1;r[c][r[c].length-1]+=$n.BonusStrict}n.strict||(i+="/?"),n.end?i+="$":n.strict&&!i.endsWith("/")&&(i+="(?:/|$)");const o=new RegExp(i,n.sensitive?"":"i");function a(c){const u=c.match(o),d={};if(!u)return null;for(let f=1;f<u.length;f++){const p=u[f]||"",h=s[f-1];d[h.name]=p&&h.repeatable?p.split("/"):p}return d}function l(c){let u="",d=!1;for(const f of t){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const p of f)if(p.type===Rs.Static)u+=p.value;else if(p.type===Rs.Param){const{value:h,repeatable:g,optional:m}=p,b=h in c?c[h]:"";if(Lr(b)&&!g)throw new Error(`Provided param "${h}" is an array but it is not repeatable (* or + modifiers)`);const T=Lr(b)?b.join("/"):b;if(!T)if(m)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${h}"`);u+=T}}return u||"/"}return{re:o,score:r,keys:s,parse:a,stringify:l}}function DM(t,e){let n=0;for(;n<t.length&&n<e.length;){const r=e[n]-t[n];if(r)return r;n++}return t.length<e.length?t.length===1&&t[0]===$n.Static+$n.Segment?-1:1:t.length>e.length?e.length===1&&e[0]===$n.Static+$n.Segment?1:-1:0}function Zk(t,e){let n=0;const r=t.score,i=e.score;for(;n<r.length&&n<i.length;){const s=DM(r[n],i[n]);if(s)return s;n++}if(Math.abs(i.length-r.length)===1){if(Mv(r))return 1;if(Mv(i))return-1}return i.length-r.length}function Mv(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const NM={strict:!1,end:!0,sensitive:!1};function FM(t,e,n){const r=$M(LM(t.path),n),i=At(r,{record:t,parent:e,children:[],alias:[]});return e&&!i.record.aliasOf==!e.record.aliasOf&&e.children.push(i),i}function jM(t,e){const n=[],r=new Map;e=xv(NM,e);function i(d){return r.get(d)}function s(d,f,p){const h=!p,g=Lv(d);g.aliasOf=p&&p.record;const m=xv(e,d),b=[g];if("alias"in d){const w=typeof d.alias=="string"?[d.alias]:d.alias;for(const M of w)b.push(Lv(At({},g,{components:p?p.record.components:g.components,path:M,aliasOf:p?p.record:g})))}let T,E;for(const w of b){const{path:M}=w;if(f&&M[0]!=="/"){const A=f.record.path,I=A[A.length-1]==="/"?"":"/";w.path=f.record.path+(M&&I+M)}if(T=FM(w,f,m),p?p.alias.push(T):(E=E||T,E!==T&&E.alias.push(T),h&&d.name&&!Pv(T)&&o(d.name)),ew(T)&&l(T),g.children){const A=g.children;for(let I=0;I<A.length;I++)s(A[I],T,p&&p.children[I])}p=p||T}return E?()=>{o(E)}:Xa}function o(d){if(Gk(d)){const f=r.get(d);f&&(r.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(o),f.alias.forEach(o))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&r.delete(d.record.name),d.children.forEach(o),d.alias.forEach(o))}}function a(){return n}function l(d){const f=UM(d,n);n.splice(f,0,d),d.record.name&&!Pv(d)&&r.set(d.record.name,d)}function c(d,f){let p,h={},g,m;if("name"in d&&d.name){if(p=r.get(d.name),!p)throw Yo(Yt.MATCHER_NOT_FOUND,{location:d});m=p.record.name,h=At(Iv(f.params,p.keys.filter(E=>!E.optional).concat(p.parent?p.parent.keys.filter(E=>E.optional):[]).map(E=>E.name)),d.params&&Iv(d.params,p.keys.map(E=>E.name))),g=p.stringify(h)}else if(d.path!=null)g=d.path,p=n.find(E=>E.re.test(g)),p&&(h=p.parse(g),m=p.record.name);else{if(p=f.name?r.get(f.name):n.find(E=>E.re.test(f.path)),!p)throw Yo(Yt.MATCHER_NOT_FOUND,{location:d,currentLocation:f});m=p.record.name,h=At({},f.params,d.params),g=p.stringify(h)}const b=[];let T=p;for(;T;)b.unshift(T.record),T=T.parent;return{name:m,path:g,params:h,matched:b,meta:HM(b)}}t.forEach(d=>s(d));function u(){n.length=0,r.clear()}return{addRoute:s,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:i}}function Iv(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function Lv(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:BM(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function BM(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const r in t.components)e[r]=typeof n=="object"?n[r]:n;return e}function Pv(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function HM(t){return t.reduce((e,n)=>At(e,n.meta),{})}function UM(t,e){let n=0,r=e.length;for(;n!==r;){const s=n+r>>1;Zk(t,e[s])<0?r=s:n=s+1}const i=VM(t);return i&&(r=e.lastIndexOf(i,r-1)),r}function VM(t){let e=t;for(;e=e.parent;)if(ew(e)&&Zk(t,e)===0)return e}function ew({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function Rv(t){const e=Qs(ym),n=Qs(Xk),r=On(()=>{const l=No(t.to);return e.resolve(l)}),i=On(()=>{const{matched:l}=r.value,{length:c}=l,u=l[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(Go.bind(null,u));if(f>-1)return f;const p=$v(l[c-2]);return c>1&&$v(u)===p&&d[d.length-1].path!==p?d.findIndex(Go.bind(null,l[c-2])):f}),s=On(()=>i.value>-1&&GM(n.params,r.value.params)),o=On(()=>i.value>-1&&i.value===n.matched.length-1&&qk(n.params,r.value.params));function a(l={}){if(qM(l)){const c=e[No(t.replace)?"replace":"push"](No(t.to)).catch(Xa);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:r,href:On(()=>r.value.href),isActive:s,isExactActive:o,navigate:a}}function zM(t){return t.length===1?t[0]:t}const WM=Ri({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Rv,setup(t,{slots:e}){const n=gd(Rv(t)),{options:r}=Qs(ym),i=On(()=>({[Dv(t.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Dv(t.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=e.default&&zM(e.default(n));return t.custom?s:ii("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},s)}}}),KM=WM;function qM(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function GM(t,e){for(const n in e){const r=e[n],i=t[n];if(typeof r=="string"){if(r!==i)return!1}else if(!Lr(i)||i.length!==r.length||r.some((s,o)=>s.valueOf()!==i[o].valueOf()))return!1}return!0}function $v(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const Dv=(t,e,n)=>t??e??n,YM=Ri({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const r=Qs(Th),i=On(()=>t.route||r.value),s=Qs(Cv,0),o=On(()=>{let c=No(s);const{matched:u}=i.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=On(()=>i.value.matched[o.value]);Ya(Cv,On(()=>o.value+1)),Ya(TM,a),Ya(Th,i);const l=Yl();return qo(()=>[l.value,a.value,t.name],([c,u,d],[f,p,h])=>{u&&(u.instances[d]=c,p&&p!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=p.leaveGuards),u.updateGuards.size||(u.updateGuards=p.updateGuards))),c&&u&&(!p||!Go(u,p)||!f)&&(u.enterCallbacks[d]||[]).forEach(g=>g(c))},{flush:"post"}),()=>{const c=i.value,u=t.name,d=a.value,f=d&&d.components[u];if(!f)return Nv(n.default,{Component:f,route:c});const p=d.props[u],h=p?p===!0?c.params:typeof p=="function"?p(c):p:null,m=ii(f,At({},h,e,{onVnodeUnmounted:b=>{b.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return Nv(n.default,{Component:m,route:c})||m}}});function Nv(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const XM=YM;function tw(t){const e=jM(t.routes,t),n=t.parseQuery||xM,r=t.stringifyQuery||Ev,i=t.history,s=xa(),o=xa(),a=xa(),l=rk(Fi);let c=Fi;_o&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=cf.bind(null,q=>""+q),d=cf.bind(null,sM),f=cf.bind(null,vl);function p(q,pe){let ce,be;return Gk(q)?(ce=e.getRecordMatcher(q),be=pe):be=q,e.addRoute(be,ce)}function h(q){const pe=e.getRecordMatcher(q);pe&&e.removeRoute(pe)}function g(){return e.getRoutes().map(q=>q.record)}function m(q){return!!e.getRecordMatcher(q)}function b(q,pe){if(pe=At({},pe||l.value),typeof q=="string"){const Oe=uf(n,q,pe.path),lt=e.resolve({path:Oe.path},pe),yt=i.createHref(Oe.fullPath);return At(Oe,lt,{params:f(lt.params),hash:vl(Oe.hash),redirectedFrom:void 0,href:yt})}let ce;if(q.path!=null)ce=At({},q,{path:uf(n,q.path,pe.path).path});else{const Oe=At({},q.params);for(const lt in Oe)Oe[lt]==null&&delete Oe[lt];ce=At({},q,{params:d(Oe)}),pe.params=d(pe.params)}const be=e.resolve(ce,pe),He=q.hash||"";be.params=u(f(be.params));const at=lM(r,At({},q,{hash:nM(He),path:be.path})),Ce=i.createHref(at);return At({fullPath:at,hash:He,query:r===Ev?SM(q.query):q.query||{}},be,{redirectedFrom:void 0,href:Ce})}function T(q){return typeof q=="string"?uf(n,q,l.value.path):At({},q)}function E(q,pe){if(c!==q)return Yo(Yt.NAVIGATION_CANCELLED,{from:pe,to:q})}function w(q){return I(q)}function M(q){return w(At(T(q),{replace:!0}))}function A(q,pe){const ce=q.matched[q.matched.length-1];if(ce&&ce.redirect){const{redirect:be}=ce;let He=typeof be=="function"?be(q,pe):be;return typeof He=="string"&&(He=He.includes("?")||He.includes("#")?He=T(He):{path:He},He.params={}),At({query:q.query,hash:q.hash,params:He.path!=null?{}:q.params},He)}}function I(q,pe){const ce=c=b(q),be=l.value,He=q.state,at=q.force,Ce=q.replace===!0,Oe=A(ce,be);if(Oe)return I(At(T(Oe),{state:typeof Oe=="object"?At({},He,Oe.state):He,force:at,replace:Ce}),pe||ce);const lt=ce;lt.redirectedFrom=pe;let yt;return!at&&cM(r,be,ce)&&(yt=Yo(Yt.NAVIGATION_DUPLICATED,{to:lt,from:be}),Je(be,be,!0,!1)),(yt?Promise.resolve(yt):J(lt,be)).catch(ht=>di(ht)?di(ht,Yt.NAVIGATION_GUARD_REDIRECT)?ht:Ze(ht):Le(ht,lt,be)).then(ht=>{if(ht){if(di(ht,Yt.NAVIGATION_GUARD_REDIRECT))return I(At({replace:Ce},T(ht.to),{state:typeof ht.to=="object"?At({},He,ht.to.state):He,force:at}),pe||lt)}else ht=Q(lt,be,!0,Ce,He);return se(lt,be,ht),ht})}function j(q,pe){const ce=E(q,pe);return ce?Promise.reject(ce):Promise.resolve()}function $(q){const pe=rt.values().next().value;return pe&&typeof pe.runWithContext=="function"?pe.runWithContext(q):q()}function J(q,pe){let ce;const[be,He,at]=_M(q,pe);ce=ff(be.reverse(),"beforeRouteLeave",q,pe);for(const Oe of be)Oe.leaveGuards.forEach(lt=>{ce.push(Hi(lt,q,pe))});const Ce=j.bind(null,q,pe);return ce.push(Ce),Te(ce).then(()=>{ce=[];for(const Oe of s.list())ce.push(Hi(Oe,q,pe));return ce.push(Ce),Te(ce)}).then(()=>{ce=ff(He,"beforeRouteUpdate",q,pe);for(const Oe of He)Oe.updateGuards.forEach(lt=>{ce.push(Hi(lt,q,pe))});return ce.push(Ce),Te(ce)}).then(()=>{ce=[];for(const Oe of at)if(Oe.beforeEnter)if(Lr(Oe.beforeEnter))for(const lt of Oe.beforeEnter)ce.push(Hi(lt,q,pe));else ce.push(Hi(Oe.beforeEnter,q,pe));return ce.push(Ce),Te(ce)}).then(()=>(q.matched.forEach(Oe=>Oe.enterCallbacks={}),ce=ff(at,"beforeRouteEnter",q,pe,$),ce.push(Ce),Te(ce))).then(()=>{ce=[];for(const Oe of o.list())ce.push(Hi(Oe,q,pe));return ce.push(Ce),Te(ce)}).catch(Oe=>di(Oe,Yt.NAVIGATION_CANCELLED)?Oe:Promise.reject(Oe))}function se(q,pe,ce){a.list().forEach(be=>$(()=>be(q,pe,ce)))}function Q(q,pe,ce,be,He){const at=E(q,pe);if(at)return at;const Ce=pe===Fi,Oe=_o?history.state:{};ce&&(be||Ce?i.replace(q.fullPath,At({scroll:Ce&&Oe&&Oe.scroll},He)):i.push(q.fullPath,He)),l.value=q,Je(q,pe,ce,Ce),Ze()}let G;function ee(){G||(G=i.listen((q,pe,ce)=>{if(!je.listening)return;const be=b(q),He=A(be,je.currentRoute.value);if(He){I(At(He,{replace:!0,force:!0}),be).catch(Xa);return}c=be;const at=l.value;
27_o&&vM(_v(at.fullPath,ce.delta),Sd()),J(be,at).catch(Ce=>di(Ce,Yt.NAVIGATION_ABORTED|Yt.NAVIGATION_CANCELLED)?Ce:di(Ce,Yt.NAVIGATION_GUARD_REDIRECT)?(I(At(T(Ce.to),{force:!0}),be).then(Oe=>{di(Oe,Yt.NAVIGATION_ABORTED|Yt.NAVIGATION_DUPLICATED)&&!ce.delta&&ce.type===xh.pop&&i.go(-1,!1)}).catch(Xa),Promise.reject()):(ce.delta&&i.go(-ce.delta,!1),Le(Ce,be,at))).then(Ce=>{Ce=Ce||Q(be,at,!1),Ce&&(ce.delta&&!di(Ce,Yt.NAVIGATION_CANCELLED)?i.go(-ce.delta,!1):ce.type===xh.pop&&di(Ce,Yt.NAVIGATION_ABORTED|Yt.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),se(be,at,Ce)}).catch(Xa)}))}let ge=xa(),ae=xa(),ke;function Le(q,pe,ce){Ze(q);const be=ae.list();return be.length?be.forEach(He=>He(q,pe,ce)):console.error(q),Promise.reject(q)}function Ue(){return ke&&l.value!==Fi?Promise.resolve():new Promise((q,pe)=>{ge.add([q,pe])})}function Ze(q){return ke||(ke=!q,ee(),ge.list().forEach(([pe,ce])=>q?ce(q):pe()),ge.reset()),q}function Je(q,pe,ce,be){const{scrollBehavior:He}=t;if(!_o||!He)return Promise.resolve();const at=!ce&&yM(_v(q.fullPath,0))||(be||!ce)&&history.state&&history.state.scroll||null;return im().then(()=>He(q,pe,at)).then(Ce=>Ce&&gM(Ce)).catch(Ce=>Le(Ce,q,pe))}const Xe=q=>i.go(q);let We;const rt=new Set,je={currentRoute:l,listening:!0,addRoute:p,removeRoute:h,clearRoutes:e.clearRoutes,hasRoute:m,getRoutes:g,resolve:b,options:t,push:w,replace:M,go:Xe,back:()=>Xe(-1),forward:()=>Xe(1),beforeEach:s.add,beforeResolve:o.add,afterEach:a.add,onError:ae.add,isReady:Ue,install(q){q.component("RouterLink",KM),q.component("RouterView",XM),q.config.globalProperties.$router=je,Object.defineProperty(q.config.globalProperties,"$route",{enumerable:!0,get:()=>No(l)}),_o&&!We&&l.value===Fi&&(We=!0,w(i.location).catch(be=>{}));const pe={};for(const be in Fi)Object.defineProperty(pe,be,{get:()=>l.value[be],enumerable:!0});q.provide(ym,je),q.provide(Xk,bC(pe)),q.provide(Th,l);const ce=q.unmount;rt.add(q),q.unmount=function(){rt.delete(q),rt.size<1&&(c=Fi,G&&G(),G=null,l.value=Fi,We=!1,ke=!1),ce()}}};function Te(q){return q.reduce((pe,ce)=>pe.then(()=>$(ce)),Promise.resolve())}return je}const JM=window.User?["docs-admin"].some(t=>JSON.parse(window.User).roles.includes(t)):!1,QM={path:"/",redirect:{name:JM?"docs":"tickets-section",params:{section:"unassigned",id:0}},children:[{path:"/tickets",redirect:{name:"tickets-section",params:{section:"unassigned",id:0}}}]};/**! 28 * @fileOverview Kickass library to create and place poppers near their reference elements. 29 * @version 1.16.1 30 * @license 31 * Copyright (c) 2016 Federico Zivolo and contributors 32 * 33 * Permission is hereby granted, free of charge, to any person obtaining a copy 34 * of this software and associated documentation files (the "Software"), to deal 35 * in the Software without restriction, including without limitation the rights 36 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 * copies of the Software, and to permit persons to whom the Software is 38 * furnished to do so, subject to the following conditions: 39 * 40 * The above copyright notice and this permission notice shall be included in all 41 * copies or substantial portions of the Software. 42 * 43 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 49 * SOFTWARE. 50 */var Ql=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",ZM=function(){for(var t=["Edge","Trident","Firefox"],e=0;e<t.length;e+=1)if(Ql&&navigator.userAgent.indexOf(t[e])>=0)return 1;return 0}();function eI(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}function tI(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},ZM))}}var nI=Ql&&window.Promise,rI=nI?eI:tI;function nw(t){var e={};return t&&e.toString.call(t)==="[object Function]"}
vendor: 4,585 bytes, line 50
50function uo(t,e){if(t.nodeType!==1)return[];var n=t.ownerDocument.defaultView,r=n.getComputedStyle(t,null);return e?r[e]:r}function bm(t){return t.nodeName==="HTML"?t:t.parentNode||t.host}function Zl(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=uo(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?t:Zl(bm(t))}function rw(t){return t&&t.referenceNode?t.referenceNode:t}var Fv=Ql&&!!(window.MSInputMethodContext&&document.documentMode),jv=Ql&&/MSIE 10/.test(navigator.userAgent);function ga(t){return t===11?Fv:t===10?jv:Fv||jv}function Xo(t){if(!t)return document.documentElement;for(var e=ga(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?t?t.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&uo(n,"position")==="static"?Xo(n):n}function iI(t){var e=t.nodeName;return e==="BODY"?!1:e==="HTML"||Xo(t.firstElementChild)===t}function _h(t){return t.parentNode!==null?_h(t.parentNode):t}function cu(t,e){if(!t||!t.nodeType||!e||!e.nodeType)return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,i=n?e:t,s=document.createRange();s.setStart(r,0),s.setEnd(i,0);var o=s.commonAncestorContainer;if(t!==o&&e!==o||r.contains(i))return iI(o)?o:Xo(o);var a=_h(t);return a.host?cu(a.host,e):cu(t,_h(e).host)}function Jo(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=e==="top"?"scrollTop":"scrollLeft",r=t.nodeName;if(r==="BODY"||r==="HTML"){var i=t.ownerDocument.documentElement,s=t.ownerDocument.scrollingElement||i;return s[n]}return t[n]}function sI(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=Jo(e,"top"),i=Jo(e,"left"),s=n?-1:1;return t.top+=r*s,t.bottom+=r*s,t.left+=i*s,t.right+=i*s,t}function Bv(t,e){var n=e==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+r+"Width"])}function Hv(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],ga(10)?parseInt(n["offset"+t])+parseInt(r["margin"+(t==="Height"?"Top":"Left")])+parseInt(r["margin"+(t==="Height"?"Bottom":"Right")]):0)}function iw(t){var e=t.body,n=t.documentElement,r=ga(10)&&getComputedStyle(n);return{height:Hv("Height",e,n,r),width:Hv("Width",e,n,r)}}var oI=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},aI=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Qo=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},fr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};function is(t){return fr({},t,{right:t.left+t.width,bottom:t.top+t.height})}function Eh(t){var e={};try{if(ga(10)){e=t.getBoundingClientRect();var n=Jo(t,"top"),r=Jo(t,"left");e.top+=n,e.left+=r,e.bottom+=n,e.right+=r}else e=t.getBoundingClientRect()}catch{}var i={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},s=t.nodeName==="HTML"?iw(t.ownerDocument):{},o=s.width||t.clientWidth||i.width,a=s.height||t.clientHeight||i.height,l=t.offsetWidth-o,c=t.offsetHeight-a;if(l||c){var u=uo(t);l-=Bv(u,"x"),c-=Bv(u,"y"),i.width-=l,i.height-=c}return is(i)}function km(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=ga(10),i=e.nodeName==="HTML",s=Eh(t),o=Eh(e),a=Zl(t),l=uo(e),c=parseFloat(l.borderTopWidth),u=parseFloat(l.borderLeftWidth);n&&i&&(o.top=Math.max(o.top,0),o.left=Math.max(o.left,0));var d=is({top:s.top-o.top-c,left:s.left-o.left-u,width:s.width,height:s.height});if(d.marginTop=0,d.marginLeft=0,!r&&i){var f=parseFloat(l.marginTop),p=parseFloat(l.marginLeft);d.top-=c-f,d.bottom-=c-f,d.left-=u-p,d.right-=u-p,d.marginTop=f,d.marginLeft=p}return(r&&!n?e.contains(a):e===a&&a.nodeName!=="BODY")&&(d=sI(d,e)),d}function lI(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=t.ownerDocument.documentElement,r=km(t,n),i=Math.max(n.clientWidth,window.innerWidth||0),s=Math.max(n.clientHeight,window.innerHeight||0),o=e?0:Jo(n),a=e?0:Jo(n,"left"),l={top:o-r.top+r.marginTop,left
vendor: 11,938 bytes, line 50
50:a-r.left+r.marginLeft,width:i,height:s};return is(l)}function sw(t){var e=t.nodeName;if(e==="BODY"||e==="HTML")return!1;if(uo(t,"position")==="fixed")return!0;var n=bm(t);return n?sw(n):!1}function ow(t){if(!t||!t.parentElement||ga())return document.documentElement;for(var e=t.parentElement;e&&uo(e,"transform")==="none";)e=e.parentElement;return e||document.documentElement}function wm(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,s={top:0,left:0},o=i?ow(t):cu(t,rw(e));if(r==="viewport")s=lI(o,i);else{var a=void 0;r==="scrollParent"?(a=Zl(bm(e)),a.nodeName==="BODY"&&(a=t.ownerDocument.documentElement)):r==="window"?a=t.ownerDocument.documentElement:a=r;var l=km(a,o,i);if(a.nodeName==="HTML"&&!sw(o)){var c=iw(t.ownerDocument),u=c.height,d=c.width;s.top+=l.top-l.marginTop,s.bottom=u+l.top,s.left+=l.left-l.marginLeft,s.right=d+l.left}else s=l}n=n||0;var f=typeof n=="number";return s.left+=f?n:n.left||0,s.top+=f?n:n.top||0,s.right-=f?n:n.right||0,s.bottom-=f?n:n.bottom||0,s}function cI(t){var e=t.width,n=t.height;return e*n}function aw(t,e,n,r,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(t.indexOf("auto")===-1)return t;var o=wm(n,r,s,i),a={top:{width:o.width,height:e.top-o.top},right:{width:o.right-e.right,height:o.height},bottom:{width:o.width,height:o.bottom-e.bottom},left:{width:e.left-o.left,height:o.height}},l=Object.keys(a).map(function(f){return fr({key:f},a[f],{area:cI(a[f])})}).sort(function(f,p){return p.area-f.area}),c=l.filter(function(f){var p=f.width,h=f.height;return p>=n.clientWidth&&h>=n.clientHeight}),u=c.length>0?c[0].key:l[0].key,d=t.split("-")[1];return u+(d?"-"+d:"")}function lw(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=r?ow(e):cu(e,rw(n));return km(n,i,r)}function cw(t){var e=t.ownerDocument.defaultView,n=e.getComputedStyle(t),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),i=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),s={width:t.offsetWidth+i,height:t.offsetHeight+r};return s}function uu(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(n){return e[n]})}function uw(t,e,n){n=n.split("-")[0];var r=cw(t),i={width:r.width,height:r.height},s=["right","left"].indexOf(n)!==-1,o=s?"top":"left",a=s?"left":"top",l=s?"height":"width",c=s?"width":"height";return i[o]=e[o]+e[l]/2-r[l]/2,n===a?i[a]=e[a]-r[c]:i[a]=e[uu(a)],i}function ec(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function uI(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(i){return i[e]===n});var r=ec(t,function(i){return i[e]===n});return t.indexOf(r)}function dw(t,e,n){var r=n===void 0?t:t.slice(0,uI(t,"name",n));return r.forEach(function(i){i.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var s=i.function||i.fn;i.enabled&&nw(s)&&(e.offsets.popper=is(e.offsets.popper),e.offsets.reference=is(e.offsets.reference),e=s(e,i))}),e}function dI(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=lw(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=aw(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=uw(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=dw(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function fw(t,e){return t.some(function(n){var r=n.name,i=n.enabled;return i&&r===e})}function xm(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),r=0;r<e.length;r++){var i=e[r],s=i?""+i+n:t;if(typeof document.body.style[s]<"u")return s}return null}function fI(){return this.state.isDestroyed=!0,fw(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[xm("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function hw(t){var e=t.ownerDocument;return e?e.defaultView:window}function pw(t,e,n,r){var i=t.nodeName==="BODY",s=i?t.ownerDocument.defaultView:t;s.addEventListener(e,n,{passive:!0}),i||pw(Zl(s.parentNode),e,n,r),r.push(s)}function hI(t,e,n,r){n.updateBound=r,hw(t).addEventListener("resize",n.updateBound,{passive:!0});var i=Zl(t);return pw(i,"scroll",n.updateBound,n.scrollParents),n.scrollElement=i,n.eventsEnabled=!0,n}function pI(){this.state.eventsEnabled||(this.state=hI(this.reference,this.options,this.state,this.scheduleUpdate))}function mI(t,e){return hw(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEach(function(n){n.removeEventListener("scroll",e.updateBound)}),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e}function gI(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=mI(this.reference,this.state))}function Sm(t){return t!==""&&!isNaN(parseFloat(t))&&isFinite(t)}function Ch(t,e){Object.keys(e).forEach(function(n){var r="";["width","height","top","right","bottom","left"].indexOf(n)!==-1&&Sm(e[n])&&(r="px"),t.style[n]=e[n]+r})}function vI(t,e){Object.keys(e).forEach(function(n){var r=e[n];r!==!1?t.setAttribute(n,e[n]):t.removeAttribute(n)})}function yI(t){return Ch(t.instance.popper,t.styles),vI(t.instance.popper,t.attributes),t.arrowElement&&Object.keys(t.arrowStyles).length&&Ch(t.arrowElement,t.arrowStyles),t}function bI(t,e,n,r,i){var s=lw(i,e,t,n.positionFixed),o=aw(n.placement,s,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return e.setAttribute("x-placement",o),Ch(e,{position:n.positionFixed?"fixed":"absolute"}),n}function kI(t,e){var n=t.offsets,r=n.popper,i=n.reference,s=Math.round,o=Math.floor,a=function(b){return b},l=s(i.width),c=s(r.width),u=["left","right"].indexOf(t.placement)!==-1,d=t.placement.indexOf("-")!==-1,f=l%2===c%2,p=l%2===1&&c%2===1,h=e?u||d||f?s:o:a,g=e?s:a;return{left:h(p&&!d&&e?r.left-1:r.left),top:g(r.top),bottom:g(r.bottom),right:h(r.right)}}var wI=Ql&&/Firefox/i.test(navigator.userAgent);function xI(t,e){var n=e.x,r=e.y,i=t.offsets.popper,s=ec(t.instance.modifiers,function(E){return E.name==="applyStyle"}).gpuAcceleration;s!==void 0&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var o=s!==void 0?s:e.gpuAcceleration,a=Xo(t.instance.popper),l=Eh(a),c={position:i.position},u=kI(t,window.devicePixelRatio<2||!wI),d=n==="bottom"?"top":"bottom",f=r==="right"?"left":"right",p=xm("transform"),h=void 0,g=void 0;if(d==="bottom"?a.nodeName==="HTML"?g=-a.clientHeight+u.bottom:g=-l.height+u.bottom:g=u.top,f==="right"?a.nodeName==="HTML"?h=-a.clientWidth+u.right:h=-l.width+u.right:h=u.left,o&&p)c[p]="translate3d("+h+"px, "+g+"px, 0)",c[d]=0,c[f]=0,c.willChange="transform";else{var m=d==="bottom"?-1:1,b=f==="right"?-1:1;c[d]=g*m,c[f]=h*b,c.willChange=d+", "+f}var T={"x-placement":t.placement};return t.attributes=fr({},T,t.attributes),t.styles=fr({},c,t.styles),t.arrowStyles=fr({},t.offsets.arrow,t.arrowStyles),t}function mw(t,e,n){var r=ec(t,function(a){var l=a.name;return l===e}),i=!!r&&t.some(function(a){return a.name===n&&a.enabled&&a.order<r.order});if(!i){var s="`"+e+"`",o="`"+n+"`";console.warn(o+" modifier is required by "+s+" modifier in order to work, be sure to include it before "+s+"!")}return i}function SI(t,e){var n;if(!mw(t.instance.modifiers,"arrow","keepTogether"))return t;var r=e.element;if(typeof r=="string"){if(r=t.instance.popper.querySelector(r),!r)return t}else if(!t.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var i=t.placement.split("-")[0],s=t.offsets,o=s.popper,a=s.reference,l=["left","right"].indexOf(i)!==-1,c=l?"height":"width",u=l?"Top":"Left",d=u.toLowerCase(),f=l?"left":"top",p=l?"bottom":"right",h=cw(r)[c];a[p]-h<o[d]&&(t.offsets.popper[d]-=o[d]-(a[p]-h)),a[d]+h>o[p]&&(t.offsets.popper[d]+=a[d]+h-o[p]),t.offsets.popper=is(t.offsets.popper);var g=a[d]+a[c]/2-h/2,m=uo(t.instance.popper),b=parseFloat(m["margin"+u]),T=parseFloat(m["border"+u+"Width"]),E=g-t.offsets.popper[d]-b-T;return E=Math.max(Math.min(o[c]-h,E),0),t.arrowElement=r,t.offsets.arrow=(n={},Qo(n,d,Math.round(E)),Qo(n,f,""),n),t}function TI(t){return t==="end"?"start":t==="start"?"end":t}var gw=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],hf=gw.slice(3);function Uv(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=hf.indexOf(t),r=hf.slice(n+1).concat(hf.slice(0,n));return e?r.reverse():r}var pf={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function _I(t,e){if(fw(t.instance.modifiers,"inner")||t.flipped&&t.placement===t.originalPlacement)return t;var n=wm(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],i=uu(r),s=t.placement.split("-")[1]||"",o=[];switch(e.behavior){case pf.FLIP:o=[r,i];break;case pf.CLOCKWISE:o=Uv(r);break;case pf.COUNTERCLOCKWISE:o=Uv(r,!0);break;default:o=e.behavior}return o.forEach(function(a,l){if(r!==a||o.length===l+1)return t;r=t.placement.split("-")[0],i=uu(r);var c=t.offsets.popper,u=t.offsets.reference,d=Math.floor,f=r==="left"&&d(c.right)>d(u.left)||r==="right"&&d(c.left)<d(u.right)||r==="top"&&d(c.bottom)>d(u.top)||r==="bottom"&&d(c.top)<d(u.bottom),p=d(c.left)<d(n.left),h=d(c.right)>d(n.right),g=d(c.top)<d(n.top),m=d(c.bottom)>d(n.bottom),b=r==="left"&&p||r==="right"&&h||r==="top"&&g||r==="bottom"&&m,T=["top","bottom"].indexOf(r)!==-1,E=!!e.flipVariations&&(T&&s==="start"&&p||T&&s==="end"&&h||!T&&s==="start"&&g||!T&&s==="end"&&m),w=!!e.flipVariationsByContent&&(T&&s==="start"&&h||T&&s==="end"&&p||!T&&s==="start"&&m||!T&&s==="end"&&g),M=E||w;(f||b||M)&&(t.flipped=!0,(f||b)&&(r=o[l+1]),M&&(s=TI(s)),t.placement=r+(s?"-"+s:""),t.offsets.popper=fr({},t.offsets.popper,uw(t.instance.popper,t.offsets.reference,t.placement)),t=dw(t.instance.modifiers,t,"flip"))}),t}function EI(t){var e=t.offsets,n=e.popper,r=e.reference,i=t.placement.split("-")[0],s=Math.floor,o=["top","bottom"].indexOf(i)!==-1,a=o?"right":"bottom",l=o?"left":"top",c=o?"width":"height";return n[a]<s(r[l])&&(t.offsets.popper[l]=s(r[l])-n[c]),n[l]>s(r[a])&&(t.offsets.popper[l]=s(r[a])),t}function CI(t,e,n,r){var i=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),s=+i[1],o=i[2];if(!s)return t;if(o.indexOf("%")===0){var a=void 0;switch(o){case"%p":a=n;break;case"%":case"%r":default:a=r}var l=is(a);return l[e]/100*s}else if(o==="vh"||o==="vw"){var c=void 0;return o==="vh"?c=Math.max(document.documentElement.clientHeight,window.innerHeight||0):c=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c/100*s}else return s}function OI(t,e,n,r){var i=[0,0],s=["right","left"].indexOf(r)!==-1,o=t.split(/(\+|\-)/).map(function(u){return u.trim()}),a=o.indexOf(ec(o,function(u){return u.search(/,|\s/)!==-1}));o[a]&&o[a].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=a!==-1?[o.slice(0,a).concat([o[a].split(l)[0]]),[o[a].split(l)[1]].concat(o.slice(a+1))]:[o];return c=c.map(function(u,d){var f=(d===1?!s:s)?"height":"width",p=!1;return u.reduce(function(h,g){return h[h.length-1]===""&&["+","-"].indexOf(g)!==-1?(h[h.length-1]=g,p=!0,h):p?(h[h.length-1]+=g,p=!1,h):h.concat(g)},[]).map(function(h){return CI(h,f,e,n)})}
50),c.forEach(function(u,d){u.forEach(function(f,p){Sm(f)&&(i[d]+=f*(u[p-1]==="-"?-1:1))})}),i}function AI(t,e){var n=e.offset,r=t.placement,i=t.offsets,s=i.popper,o=i.reference,a=r.split("-")[0],l=void 0;return Sm(+n)?l=[+n,0]:l=OI(n,s,o,a),a==="left"?(s.top+=l[0],s.left-=l[1]):a==="right"?(s.top+=l[0],s.left+=l[1]):a==="top"?(s.left+=l[0],s.top-=l[1]):a==="bottom"&&(s.left+=l[0],s.top+=l[1]),t.popper=s,t}function MI(t,e){var n=e.boundariesElement||Xo(t.instance.popper);t.instance.reference===n&&(n=Xo(n));var r=xm("transform"),i=t.instance.popper.style,s=i.top,o=i.left,a=i[r];i.top="",i.left="",i[r]="";var l=wm(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);i.top=s,i.left=o,i[r]=a,e.boundaries=l;var c=e.priority,u=t.offsets.popper,d={primary:function(p){var h=u[p];return u[p]<l[p]&&!e.escapeWithReference&&(h=Math.max(u[p],l[p])),Qo({},p,h)},secondary:function(p){var h=p==="right"?"left":"top",g=u[h];return u[p]>l[p]&&!e.escapeWithReference&&(g=Math.min(u[h],l[p]-(p==="right"?u.width:u.height))),Qo({},h,g)}};return c.forEach(function(f){var p=["left","top"].indexOf(f)!==-1?"primary":"secondary";u=fr({},u,d[p](f))}),t.offsets.popper=u,t}function II(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var i=t.offsets,s=i.reference,o=i.popper,a=["bottom","top"].indexOf(n)!==-1,l=a?"left":"top",c=a?"width":"height",u={start:Qo({},l,s[l]),end:Qo({},l,s[l]+s[c]-o[c])};t.offsets.popper=fr({},o,u[r])}return t}function LI(t){if(!mw(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=ec(t.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(t.hide===!0)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(t.hide===!1)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}function PI(t){var e=t.placement,n=e.split("-")[0],r=t.offsets,i=r.popper,s=r.reference,o=["left","right"].indexOf(n)!==-1,a=["top","left"].indexOf(n)===-1;return i[o?"left":"top"]=s[n]-(a?i[o?"width":"height"]:0),t.placement=uu(e),t.offsets.popper=is(i),t}var RI={shift:{order:100,enabled:!0,fn:II},offset:{order:200,enabled:!0,fn:AI,offset:0},preventOverflow:{order:300,enabled:!0,fn:MI,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:EI},arrow:{order:500,enabled:!0,fn:SI,element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:_I,behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:PI},hide:{order:800,enabled:!0,fn:LI},computeStyle:{order:850,enabled:!0,fn:xI,gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:yI,onLoad:bI,gpuAcceleration:void 0}},$I={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:RI},Td=function(){function t(e,n){var r=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};oI(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=rI(this.update.bind(this)),this.options=fr({},t.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(fr({},t.Defaults.modifiers,i.modifiers)).forEach(function(o){r.options.modifiers[o]=fr({},t.Defaults.modifiers[o]||{},i.modifiers?i.modifiers[o]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(o){return fr({name:o},r.options.modifiers[o])}).sort(function(o,a){return o.order-a.order}),this.modifiers.forEach(function(o){o.enabled&&nw(o.onLoad)&&o.onLoad(r.reference,r.popper,r.options,o,r.state)}),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return aI(t,[{key:"update",value:function(){return dI.call(this)}},{key:"destroy",value:function(){return fI.call(this)}},{key:"enableEventListeners",value:function(){return pI.call(this)}},{key:"disableEventListeners",value:function(){return gI.call(this)}}]),t}();Td.Utils=(typeof window<"u"?window:global).PopperUtils;Td.placements=gw;Td.Defaults=$I;const DI={props:{placement:{type:String,default:"bottom-start",validator:t=>["top","top-end","top-start","right","right-end","right-start","bottom","bottom-end","bottom-start","left","left-end","left-start"].includes(t)},triggerClass:{type:String,default:""},dropdownClass:{type:String,default:""},usePopper:{type:Boolean,default:!0},hideAfterDropdownClick:{type:Boolean,default:!1},clickOutsideToClose:{type:Boolean,default:!0},triggerTogglesDropdown:{type:Boolean,default:!0},small:{type:Boolean,default:!1},distance:{type:String,default:"6px"},disabled:{type:Boolean,default:!1},arrow:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0}},data(){return{open:!1,placementClassesIfNonPopper:"",escapeListener:null}},computed:{isOpen(){return this.open}},created(){this.mountEscapeListener()},unmounted(){document.removeEventListener("keydown",this.escapeListener,!0)},methods:{show(){this.isOpen||(this.open=!this.open,this.$nextTick(()=>{var e,n;this.setupPlacement();const t=(n=(e=this.$refs)==null?void 0:e.dropdown)==null?void 0:n.querySelector("input");typeof this.$parent.$refs.input<"u"?this.$parent.$refs.input.focus():t&&(t.focus(),t.select()),this.$emit("input",!1),this.$emit("open"),this.$emit("stateChange","open")}))},hide(){var e;if(!this.isOpen)return;const t=this.$refs.dropdown;if(t!=null&&t.contains(document.activeElement)){const n=(e=this.$refs.trigger)==null?void 0:e.querySelectorAll('button:not([disabled]), [href], input
50:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),r=Array.from(n||[]).find(i=>!t.contains(i));r==null||r.focus()}this.open=!1,this.$nextTick(()=>{this.$emit("input",!1),this.$emit("close"),this.$emit("stateChange","close")})},toggle(){this.isOpen?this.hide():this.show()},autoToggle(t){if(!this.disabled){if(this.hideAfterDropdownClick&&typeof this.$refs.dropdown<"u"&&this.$refs.dropdown.contains(t.target)){this.hide();return}if(typeof this.$refs.dropdown>"u"){this.show();return}if(!this.$refs.dropdown.contains(t.target))if(this.triggerTogglesDropdown){this.toggle();return}else{this.show();return}}},autoHideClickOutside(t){!this.$el.contains(t.target)&&this.clickOutsideToClose&&this.hide()},onDdClick(){this.$emit("onDdClick",!1)},setupPlacement(){this.usePopper?this.setupPopper():this.setupNonPopper()},setupNonPopper(){switch(this.placement){case"top-end":this.placementClassesIfNonPopper="bottom-0 right-0";break;case"top-start":this.placementClassesIfNonPopper="bottom-0 left-0";break;case"bottom-end":this.placementClassesIfNonPopper="top-0 right-0";break;case"bottom-start":this.placementClassesIfNonPopper="top-0 left-0";break;default:this.placementClassesIfNonPopper="top-0 left-0";break}let t=this.$refs.trigger.clientHeight;this.placement.substring(0,3)=="top"?this.$refs.dropdown.style.marginBottom=t+"px":this.$refs.dropdown.style.marginTop=t+"px"},setupPopper(){this.popper===void 0?this.popper=new Td(this.$refs.trigger,this.$refs.dropdown,{placement:this.placement,modifiers:{offset:{offset:`0, ${this.distance}, 0, 0`}}}):this.popper.scheduleUpdate()},mountEscapeListener(){const t=e=>{this.isOpen&&e.keyCode===27&&this.closeOnEsc&&(e.stopImmediatePropagation(),e.preventDefault(),this.hide())};this.escapeListener=t,document.addEventListener("keydown",this.escapeListener,{capture:!0,passive:!1})}}};function NI(t,e,n,r,i,s){const o=ha("click-outside");return S(),C("div",{ref:"trigger",class:K(["spm-dropdown trigger",[{"is-open":s.isOpen},n.triggerClass]]),onClick:e[0]||(e[0]=(...a)=>s.autoToggle&&s.autoToggle(...a))},[Tt(t.$slots,"trigger",{isOpen:s.isOpen}),X(Ii,{"enter-active-class":"transition-opacity transition-fastest ease-out-quad","leave-active-class":"transition-opacity transition-faster ease-in-quad","enter-class":"opacity-0","enter-to-class":"opacity-100","leave-class":"opacity-100","leave-to-class":"opacity-0"},{default:Y(()=>[Ye((S(),C("div",{ref:"dropdown",class:K(["dropdown absolute z-20 w-70 md:max-w-80 md:w-auto",[{"arrow-t":n.arrow&&n.placement=="bottom","arrow-b":n.arrow&&n.placement=="top","arrow-border":n.arrow},i.placementClassesIfNonPopper,n.small?"md:min-w-48":"md:min-w-64",n.dropdownClass]])},[Tt(t.$slots,"dropdown",{hide:s.hide,isOpen:s.isOpen})],2)),[[wt,s.isOpen],[o,s.autoHideClickOutside]])],void 0,!0),_:3})],2)}const Gn=Ae(DI,[["render",NI]]);function Li(t){return Array.isArray?Array.isArray(t):bw(t)==="[object Array]"}function FI(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function jI(t){return t==null?"":FI(t)}function Qr(t){return typeof t=="string"}function vw(t){return typeof t=="number"}function BI(t){return t===!0||t===!1||HI(t)&&bw(t)=="[object Boolean]"}function yw(t){return typeof t=="object"}function HI(t){return yw(t)&&t!==null}function Zn(t){return t!=null}function mf(t){return!t.trim().length}function bw(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const UI="Incorrect 'index' type",VI=t=>`Invalid value for key ${t}`,zI=t=>`Pattern length exceeds max of ${t}.`,WI=t=>`Missing ${t} property in key`,KI=t=>`Property 'weight' in key '${t}' must be a positive integer`,Vv=Object.prototype.hasOwnProperty;class qI{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{let i=kw(r);n+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,n+=i.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function kw(t){let e=null,n=null,r=null,i=1,s=null;if(Qr(t)||Li(t))r=t,e=zv(t),n=Oh(t);else{if(!Vv.call(t,"name"))throw new Error(WI("name"));const o=t.name;if(r=o,Vv.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(KI(o));e=zv(o),n=Oh(o),s=t.getFn}return{path:e,id:n,weight:i,src:r,getFn:s}}function zv(t){return Li(t)?t:t.split(".")}function Oh(t){return Li(t)?t.join("."):t}function GI(t,e){let n=[],r=!1;const i=(s,o,a)=>
vendor: 10,929 bytes, line 50
50{if(Zn(s))if(!o[a])n.push(s);else{let l=o[a];const c=s[l];if(!Zn(c))return;if(a===o.length-1&&(Qr(c)||vw(c)||BI(c)))n.push(jI(c));else if(Li(c)){r=!0;for(let u=0,d=c.length;u<d;u+=1)i(c[u],o,a+1)}else o.length&&i(c,o,a+1)}};return i(t,Qr(e)?e.split("."):e,0),r?n:n[0]}const YI={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},XI={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},JI={location:0,threshold:.6,distance:100},QI={useExtendedSearch:!1,getFn:GI,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var ut={...XI,...YI,...JI,...QI};const ZI=/[^ ]+/g;function eL(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(i){const s=i.match(ZI).length;if(n.has(s))return n.get(s);const o=1/Math.pow(s,.5*t),a=parseFloat(Math.round(o*r)/r);return n.set(s,a),a},clear(){n.clear()}}}class Tm{constructor({getFn:e=ut.getFn,fieldNormWeight:n=ut.fieldNormWeight}={}){this.norm=eL(n,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Qr(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();Qr(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!Zn(e)||mf(e))return;let r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){let r={i:n,$:{}};this.keys.forEach((i,s)=>{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(Zn(o)){if(Li(o)){let a=[];const l=[{nestedArrIndex:-1,value:o}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(Zn(u))if(Qr(u)&&!mf(u)){let d={v:u,i:c,n:this.norm.get(u)};a.push(d)}else Li(u)&&u.forEach((d,f)=>{l.push({nestedArrIndex:f,value:d})})}r.$[s]=a}else if(Qr(o)&&!mf(o)){let a={v:o,n:this.norm.get(o)};r.$[s]=a}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function ww(t,e,{getFn:n=ut.getFn,fieldNormWeight:r=ut.fieldNormWeight}={}){const i=new Tm({getFn:n,fieldNormWeight:r});return i.setKeys(t.map(kw)),i.setSources(e),i.create(),i}function tL(t,{getFn:e=ut.getFn,fieldNormWeight:n=ut.fieldNormWeight}={}){const{keys:r,records:i}=t,s=new Tm({getFn:e,fieldNormWeight:n});return s.setKeys(r),s.setIndexRecords(i),s}function gc(t,{errors:e=0,currentLocation:n=0,expectedLocation:r=0,distance:i=ut.distance,ignoreLocation:s=ut.ignoreLocation}={}){const o=e/t.length;if(s)return o;const a=Math.abs(r-n);return i?o+a/i:a?1:o}function nL(t=[],e=ut.minMatchCharLength){let n=[],r=-1,i=-1,s=0;for(let o=t.length;s<o;s+=1){let a=t[s];a&&r===-1?r=s:!a&&r!==-1&&(i=s-1,i-r+1>=e&&n.push([r,i]),r=-1)}return t[s-1]&&s-r>=e&&n.push([r,s-1]),n}const Is=32;function rL(t,e,n,{location:r=ut.location,distance:i=ut.distance,threshold:s=ut.threshold,findAllMatches:o=ut.findAllMatches,minMatchCharLength:a=ut.minMatchCharLength,includeMatches:l=ut.includeMatches,ignoreLocation:c=ut.ignoreLocation}={}){if(e.length>Is)throw new Error(zI(Is));const u=e.length,d=t.length,f=Math.max(0,Math.min(r,d));let p=s,h=f;const g=a>1||l,m=g?Array(d):[];let b;for(;(b=t.indexOf(e,h))>-1;){let I=gc(e,{currentLocation:b,expectedLocation:f,distance:i,ignoreLocation:c});if(p=Math.min(I,p),h=b+u,g){let j=0;for(;j<u;)m[b+j]=1,j+=1}}h=-1;let T=[],E=1,w=u+d;const M=1<<u-1;for(let I=0;I<u;I+=1){let j=0,$=w;for(;j<$;)gc(e,{errors:I,currentLocation:f+$,expectedLocation:f,distance:i,ignoreLocation:c})<=p?j=$:w=$,$=Math.floor((w-j)/2+j);w=$;let J=Math.max(1,f-$+1),se=o?d:Math.min(f+$,d)+u,Q=Array(se+2);Q[se+1]=(1<<I)-1;for(let ee=se;ee>=J;ee-=1){let ge=ee-1,ae=n[t.charAt(ge)];if(g&&(m[ge]=+!!ae),Q[ee]=(Q[ee+1]<<1|1)&ae,I&&(Q[ee]|=(T[ee+1]|T[ee])<<1|1|T[ee+1]),Q[ee]&M&&(E=gc(e,{errors:I,currentLocation:ge,expectedLocation:f,distance:i,ignoreLocation:c}),E<=p)){if(p=E,h=ge,h<=f)break;J=Math.max(1,2*f-h)}}if(gc(e,{errors:I+1,currentLocation:f,expectedLocation:f,distance:i,ignoreLocation:c})>p)break;T=Q}const A={isMatch:h>=0,score:Math.max(.001,E)};if(g){const I=nL(m,a);I.length?l&&(A.indices=I):A.isMatch=!1}return A}function iL(t){let e={};for(let n=0,r=t.length;n<r;n+=1){const i=t.charAt(n);e[i]=(e[i]||0)|1<<r-n-1}return e}class xw{constructor(e,{location:n=ut.location,threshold:r=ut.threshold,distance:i=ut.distance,includeMatches:s=ut.includeMatches,findAllMatches:o=ut.findAllMatches,minMatchCharLength:a=ut.minMatchCharLength,isCaseSensitive:l=ut.isCaseSensitive,ignoreLocation:c=ut.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c},this.pattern=l?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const u=(f,p)=>{this.chunks.push({pattern:f,alphabet:iL(f),startIndex:p})},d=this.pattern.length;if(d>Is){let f=0;const p=d%Is,h=d-p;for(;f<h;)u(this.pattern.substr(f,Is),f),f+=Is;if(p){const g=d-Is;u(this.pattern.substr(g),g)}}else u(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,includeMatches:r}=this.options;if(n||(e=e.toLowerCase()),this.pattern===e){let h={isMatch:!0,score:0};return r&&(h.indices=[[0,e.length-1]]),h}const{location:i,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:l,ignoreLocation:c}=this.options;let u=[],d=0,f=!1;this.chunks.forEach(({pattern:h,alphabet:g,startIndex:m})=>{const{isMatch:b,score:T,indices:E}=rL(e,h,g,{location:i+m,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});b&&(f=!0),d+=T,b&&E&&(u=[...u,...E])});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=u),p}}class cs{constructor(e){this.pattern=e}static isMultiMatch(e){return Wv(e,this.multiRegex)}static isSingleMatch(e){return Wv(e,this.singleRegex)}search(){}}function Wv(t,e){const n=t.match(e);return n?n[1]:null}class sL extends cs{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class oL extends cs{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class aL extends cs{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class lL extends cs{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class cL extends cs{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class uL extends cs{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class Sw extends cs{constructor(e,{location:n=ut.location,threshold:r=ut.threshold,distance:i=ut.distance,includeMatches:s=ut.includeMatches,findAllMatches:o=ut.findAllMatches,minMatchCharLength:a=ut.minMatchCharLength,isCaseSensitive:l=ut.isCaseSensitive,ignoreLocation:c=ut.ignoreLocation}={}){super(e),this._bitapSearch=new xw(e,{location:n,threshold:r,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Tw extends cs{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const i=[],s=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+s,i.push([r,n-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const Ah=[sL,Tw,aL,lL,uL,cL,oL,Sw],Kv=Ah.length,dL=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,fL="|";function hL(t,e={}){return t.split(fL).map(n=>{let r=n.trim().split(dL).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=r.length;s<o;s+=1){const a=r[s];let l=!1,c=-1;for(;!l&&++c<Kv;){const u=Ah[c];let d=u.isMultiMatch(a);d&&(i.push(new u(d,e)),l=!0)}if(!l)for(c=-1;++c<Kv;){const u=Ah[c];let d=u.isSingleMatch(a);if(d){i.push(new u(d,e));break}}}return i})}const pL=new Set([Sw.type,Tw.type]);class mL{constructor(e,{isCaseSensitive:n=ut.isCaseSensitive,includeMatches:r=ut.includeMatches,minMatchCharLength:i=ut.minMatchCharLength,ignoreLocation:s=ut.ignoreLocation,findAllMatches:o=ut.findAllMatches,location:a=ut.location,threshold:l=ut.threshold,distance:c=ut.distance}={}){this.query=null,this.options={isCaseSensitive:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:s,location:a,threshold:l,distance:c},this.pattern=n?e:e.toLowerCase(),this.query=hL(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:i}=this.options;e=i?e:e.toLowerCase();let s=0,o=[],a=0;for(let l=0,c=n.length;l<c;l+=1){const u=n[l];o.length=0,s=0;for(let d=0,f=u.length;d<f;d+=1){const p=u[d],{isMatch:h,indices:g,score:m}=p.search(e);if(h){if(s+=1,a+=m,r){const b=p.constructor.type;pL.has(b)?o=[...o,...g]:o.push(g)}}else{a=0,s=0,o.length=0;break}}if(s){let d={isMatch:!0,score:a/s};return r&&(d.indices=o),d}}return{isMatch:!1,score:1}}}const Mh=[];function gL(...t){Mh.push(...t)}function Ih(t,e){for(let n=0,r=Mh.length;n<r;n+=1){let i=Mh[n];if(i.condition(t,e))return new i(t,e)}return new xw(t,e)}const du={AND:"$and",OR:"$or"},Lh={PATH:"$path",PATTERN:"$val"},Ph=t=>!!(t[du.AND]||t[du.OR]),vL=t=>!!t[Lh.PATH],yL=t=>!Li(t)&&yw(t)&&!Ph(t),qv=t=>({[du.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function _w(t,e,{auto:n=!0}={}){const r=i=>{let s=Object.keys(i);const o=vL(i);if(!o&&s.length>1&&!Ph(i))return r(qv(i));if(yL(i)){const l=o?i[Lh.PATH]:s[0],c=o?i[Lh.PATTERN]:i[l];if(!Qr(c))throw new Error(VI(l));const u={keyId:Oh(l),pattern:c};return n&&(u.searcher=Ih(c,e)),u}let a={children:[],operator:s[0]};
50return s.forEach(l=>{const c=i[l];Li(c)&&c.forEach(u=>{a.children.push(r(u))})}),a};return Ph(t)||(t=qv(t)),r(t)}function bL(t,{ignoreFieldNorm:e=ut.ignoreFieldNorm}){t.forEach(n=>{let r=1;n.matches.forEach(({key:i,norm:s,score:o})=>{const a=i?i.weight:null;r*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:s))}),n.score=r})}function kL(t,e){const n=t.matches;e.matches=[],Zn(n)&&n.forEach(r=>{if(!Zn(r.indices)||!r.indices.length)return;const{indices:i,value:s}=r;let o={indices:i,value:s};r.key&&(o.key=r.key.src),r.idx>-1&&(o.refIndex=r.idx),e.matches.push(o)})}function wL(t,e){e.score=t.score}function xL(t,e,{includeMatches:n=ut.includeMatches,includeScore:r=ut.includeScore}={}){const i=[];return n&&i.push(kL),r&&i.push(wL),t.map(s=>{const{idx:o}=s,a={item:e[o],refIndex:o};return i.length&&i.forEach(l=>{l(s,a)}),a})}class us{constructor(e,n={},r){this.options={...ut,...n},this.options.useExtendedSearch,this._keyStore=new qI(this.options.keys),this.setCollection(e,r)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Tm))throw new Error(UI);this._myIndex=n||ww(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Zn(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let r=0,i=this._docs.length;r<i;r+=1){const s=this._docs[r];e(s,r)&&(this.removeAt(r),r-=1,i-=1,n.push(s))}return n}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:r,includeScore:i,shouldSort:s,sortFn:o,ignoreFieldNorm:a}=this.options;let l=Qr(e)?Qr(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return bL(l,{ignoreFieldNorm:a}),s&&l.sort(o),vw(n)&&n>-1&&(l=l.slice(0,n)),xL(l,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e){const n=Ih(e,this.options),{records:r}=this._myIndex,i=[];return r.forEach(({v:s,i:o,n:a})=>{if(!Zn(s))return;const{isMatch:l,score:c,indices:u}=n.searchIn(s);l&&i.push({item:s,idx:o,matches:[{score:c,value:s,norm:a,indices:u}]})}),i}_searchLogical(e){const n=_w(e,this.options),r=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:f}=a,p=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:f});return p&&p.length?[{idx:c,item:l,matches:p}]:[]}const u=[];for(let d=0,f=a.children.length;d<f;d+=1){const p=a.children[d],h=r(p,l,c);if(h.length)u.push(...h);else if(a.operator===du.AND)return[]}return u},i=this._myIndex.records,s={},o=[];return i.forEach(({$:a,i:l})=>{if(Zn(a)){let c=r(n,a,l);c.length&&(s[l]||(s[l]={idx:l,item:a,matches:[]},o.push(s[l])),c.forEach(({matches:u})=>{s[l].matches.push(...u)}))}}),o}_searchObjectList(e){const n=Ih(e,this.options),{keys:r,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!Zn(o))return;let l=[];r.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:o[u],searcher:n}))}),l.length&&s.push({idx:a,item:o,matches:l})}),s}_findMatches({key:e,value:n,searcher:r}){if(!Zn(n))return[];let i=[];if(Li(n))n.forEach(({v:s,i:o,n:a})=>{if(!Zn(s))return;const{isMatch:l,score:c,indices:u}=r.searchIn(s);l&&i.push({score:c,key:e,value:s,idx:o,norm:a,indices:u})});else{const{v:s,n:o}=n,{isMatch:a,score:l,indices:c}=r.searchIn(s);a&&i.push({score:l,key:e,value:s,norm:o,indices:c})}return i}}us.version="6.6.2";us.createIndex=ww;us.parseIndex=tL;us.config=ut;us.parseQuery=_w;gL(mL);function SL(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var TL=SL,_L=TL,Gv=Math.max;function EL(t,e,n){return e=Gv(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=Gv(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),_L(t,this,a)}}var CL=EL;function OL(t){return function(){return t}}var AL=OL,ML=AL,Yv=HC,IL=sm,LL=Yv?function(t,e){return Yv(t,"toString",{configurable:!0,enumerable:!1,value:ML(e),writable:!0})}:IL,PL=LL,RL=800,$L=16,DL=Date.now;function NL(t){var e=0,n=0;return function(){var r=DL(),i=$L-(r-n);if(n=r,i>0){if(++e>=RL)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var FL=NL,jL=PL,BL=FL,HL=BL(jL),UL=HL,VL=sm,zL=CL,WL=UL;function KL(t,e){return WL(zL(t,e,VL),t+"")}var Ew=KL;function qL(t){return t!==t}var GL=qL;function YL(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}var XL=YL,JL=Dk,QL=GL,ZL=XL;function eP(t,e,n){return e===e?ZL(t,e,n):JL(t,QL,n)}var tP=eP,nP=tP;function rP(t,e){var n=t==null?0:t.length;return!!n&&nP(t,e,0)>-1}var Cw=rP;function iP(t,e,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}var Ow=iP,sP=uk,oP=Cw,aP=Ow,lP=om,cP=ik,uP=dk,dP=200;function fP(t,e,n,r){var i=-1,s=oP,o=!0,a=t.length,l=[],c=e.length;if(!a)return l;n&&(e=lP(e,cP(n))),r?(s=aP,o=!1):e.length>=dP&&(s=uP,o=!1,e=new sP(e));e:for(;++i<a;){var u=t[i],d=n==null?u:n(u);if(u=r||u!==0?u:0,o&&d===d){for(var f=c;f--;)if(e[f]===d)continue e;l.push(u)}else s(e,d,r)||l.push(u)}return l}var Aw=fP,Xv=kC,hP=wC,pP=lo,Jv=Xv?Xv.isConcatSpreadable:void 0;function mP(t){return pP(t)||hP(t)||!!(Jv&&t&&t[Jv])}var gP=mP,vP=fk,yP=gP;function Mw(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=yP),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?Mw(a,e-1,n,r,i):vP(i,a):r||(i[i.length]=a)}return i}var _m=Mw;function bP(){}var kP=bP,gf=UC,wP=kP,xP=hk,SP=1/0,TP=gf&&1/xP(new gf([,-0]))[1]==SP?function(t){return new gf(t)}:wP,_P=TP,EP=uk,CP=Cw,OP=Ow,AP=dk,MP=_P,IP=hk,LP=200;function PP(t,e,n){var r=-1,i=CP,s=t.length,o=!0,a=[],l=a;if(n)o=!1,i=OP;else if(s>=LP){var c=e?null:MP(t);if(c)return IP(c);o=!1,i=AP,l=new EP}else l=e?[]:a;e:for(;++r<s;){var u=t[r],d=e?e(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;e&&l.push(d),a.push(u)}else i(l,d,n)||(l!==a&&l.push(d),a.push(u))}return a}var RP=PP,$P=Aw,DP=_m,Qv=RP;function NP(t,e,n){var r=t.length;if(r<2)return r?Qv(t[0]):[];for(var i=-1,s=Array(r);++i<r;)for(var o=t[i],a=-1;++a<r;)a!=i&&(s[i]=$P(s[i]||o,t[a],e,n));return Qv(DP(s,1),e,n)}var FP=NP,jP=rm,BP=xC;function HP(t){return BP(t)&&jP(t)}var Iw=HP,UP=pk,VP=Ew,zP=FP,WP=Iw,KP=VP(function(t){return zP(UP(t,WP))}),qP=KP;const Lw=wn(qP);function GP(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var YP=GP,XP=fk,JP=_m,QP=YP,ZP=lo;function eR(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return XP(ZP(n)?QP(n):[n],JP(e,1))}var tR=eR;const Wc=wn(tR),nR={compatConfig:{COMPONENT_V_MODEL:!1},emits:["update:modelValue"],props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""},disabled:{type:Boolean,default:!1},classCheckbox:{type:String,default:"bg-white"}},computed:{},mounted(){}
50,methods:{toggle(){this.disabled||this.$emit("update:modelValue",!this.modelValue)}}},rR=["innerHTML"];function iR(t,e,n,r,i,s){return S(),C("div",{class:"flex",role:"checkbox",onMousedown:e[0]||(e[0]=ct((...o)=>s.toggle&&s.toggle(...o),["prevent"])),onKeyup:e[1]||(e[1]=Lt(ct((...o)=>s.toggle&&s.toggle(...o),["prevent"]),["space"]))},[x("button",{type:"button",class:K([[{checked:n.modelValue,disabled:n.disabled},n.classCheckbox],"spm-checkbox rounded-md border bg-white border-gray-400 items-center justify-center h-[22px] w-[22px] shadow flex"]),innerHTML:t.svg("feather-check","stroke-icon w-[14px] h-[14px]")},null,10,rR),Ye(x("div",{class:"flex pl-4"},L(n.label),513),[[wt,n.label.length>0]])],32)}const Em=Ae(nR,[["render",iR]]),sR={name:"Vuescroll",props:{ops:{type:Object,default:()=>({})}},methods:{scrollTo(t,e=0){const n=Number.parseFloat((t==null?void 0:t.y)??0);this.$refs.scroller.scrollTo({top:n,behavior:e?"smooth":"auto"})},scrollIntoView(t,e=0){var n;(n=this.$refs.scroller.querySelector(t))==null||n.scrollIntoView({block:"nearest",behavior:e?"smooth":"auto"})}}},oR={ref:"scroller",class:"h-full w-full overflow-auto"};function aR(t,e,n,r,i,s){return S(),C("div",oR,[Tt(t.$slots,"default")],512)}const _d=Ae(sR,[["render",aR]]),lR={components:{SpmCheckbox:Em,vuescroll:_d},model:{prop:"selected"},props:{multiple:{type:Boolean,default:!1},selected:{validator:t=>typeof t=="string"||typeof t=="number"||typeof t=="object"||Array.isArray(t),required:!1,default:null},name:{type:String,required:!0},id:{type:String,default:null},label:{type:String,default:null},options:{type:Array,default:()=>[]},prependOptions:{type:Array,default:()=>[]},optionsUrl:{type:String,default:null},responseDataPath:{type:String,default:null},lazyLoad:{type:Boolean,default:!1},optionKey:{type:String,required:!0},optionValue:{type:String,required:!0},searchKeys:{type:Array,required:!0,default:()=>[]},searchRemote:{type:Boolean,default:!1},highlightActive:{type:Boolean,default:!0},searchPlaceholder:{type:String,required:!1,default:null},searchInputThreshold:{type:Number,required:!1,default:6},fieldClass:{type:String,required:!1,default:null},required:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},moreOptions:{type:Array,default:()=>[{id:0,avatar:"https://cdn.helpspace.com/svg/unassigned.svg",name:"Unassign",type:"moreOptions"}]},initialIndex:{type:Number,required:!1,default:-1}},data(){return{query:null,remoteOptions:[],isLoading:!1,highlightedIndex:0}},computed:{optionsList(){var t;return(t=this.remoteOptions)!=null&&t.length?this.remoteOptions:this.options},filteredOptionsList(){return this.query?this.searchRemote?Wc(this.prependOptions,this.remoteOptions).filter(e=>e):new us(Wc(this.prependOptions,this.optionsList).filter(e=>e),{threshold:.2,keys:this.searchKeys}).search(this.query).map(e=>e.item).filter(e=>e):Wc(this.prependOptions,this.optionsList).filter(e=>e)},filteredOptionsListLength(){return this.filteredOptionsList instanceof Array?this.filteredOptionsList.length:0}},watch:{optionsUrl(){this.getRemoteOptions()}},created(){this.reset()},mounted(){if(this.optionsUrl&&(this.lazyLoad||this.getRemoteOptions(),this.multiple&&!Array.isArray(this.selected)))throw new Error('Prop "multiple" is "true" so prop "selected" must be an "array"!')},methods:{toggle(t){let e=null;this.multiple?e=Lw(this.selected,[t[this.optionKey]]):e=t[this.optionKey],this.$emit("update:selected",e),this.$emit("input",e),typeof this.$parent.$options.methods.dirty=="function"&&this.$parent.dirty(this.name),this.reset(),this.focusSearch()},focusSearch(){let t=this;this.$nextTick(()=>{t.$refs.search.focus()})},isSelected(t){return this.multiple?!!(t&&this.selected.includes(t[this.optionKey])):!!(t&&this.selected==t[this.optionKey])},reset(){this.query="",this.highlightedIndex=this.initialIndex},scrollToIndex(t){var e;typeof this.$refs.options>"u"||typeof this.$refs.options.children[t]>"u"||(e=this.$refs.options.children[t])==null||e.scrollIntoView({block:"nearest"})},selectHighlighted(){this.filteredOptionsListLength&&this.toggle(this.filteredOptionsList[this.highlightedIndex])},lengthOptions(){return this.filteredOptionsListLength},highlightNext(){this.highlightedIndex=this.highlightedIndex==this.filteredOptionsListLength-1?this.filteredOptionsListLength-1:this.highlightedIndex+1,this.scrollToIndex(this.highlightedIndex)},highlightPrevious(){this.highlightedIndex=this.highlightedIndex==0?0:this.highlightedIndex-1,this.scrollToIndex(this.highlightedIndex)},getRemoteOptionsDebounced:Qt(function(){this.getRemoteOptions()},300),getRemoteOptions(){if(!this.searchRemote&&this.optionsList.length||!this.optionsUrl)return;let t="";this.query&&(t="?"+this.searchKeys[0]+"="+this.query);let e=this;this.isLoading=!0,ze({method:"get",url:this.optionsUrl+t,responseType:"json"}).then(function(n){e.remoteOptions=e.responseDataPath?am(n.data,e.responseDataPath):n.data,e.$emit("remoteSuccess",n),e.isLoading=!1}
50).catch(function(n){e.$emit("remoteError",n)}).then(function(){e.isLoading=!1})},hasSlot(t){return!!this.$slots[t]}}},cR={class:"w-full"},uR=["placeholder"],dR=["onClick"],fR=["src"],hR=["innerHTML"],pR={key:0,class:"flex items-center"},mR={class:"flex-1 flex-col"},gR={key:0,class:"text-center font-bold mt-4 mb-4"},vR={key:1,class:"text-center text-xs mt-4 mb-1"};function yR(t,e,n,r,i,s){var l;const o=z("spm-checkbox"),a=z("vuescroll");return S(),C("div",cR,[Ye(x("input",{ref:"search","onUpdate:modelValue":e[0]||(e[0]=c=>i.query=c),class:"px-3 py-2 block w-full whitespace-nowrap rounded-lg bg-gray-200 text-gray-700 text-sm leading-normal",placeholder:n.searchPlaceholder,onKeydown:[e[1]||(e[1]=Lt(c=>s.highlightNext(),["down"])),e[2]||(e[2]=Lt(c=>s.highlightPrevious(),["up"])),e[3]||(e[3]=Lt(ct(c=>s.selectHighlighted(),["prevent"]),["enter"])),e[4]||(e[4]=Lt(ct(()=>{},["prevent"]),["tab"]))],onClick:e[5]||(e[5]=ct(()=>{},["prevent","stop"])),onInput:e[6]||(e[6]=c=>{i.highlightedIndex=0,s.getRemoteOptionsDebounced()})},null,40,uR),[[wt,((l=s.optionsList)==null?void 0:l.length)>n.searchInputThreshold||n.searchInputThreshold==0],[ls,i.query]]),Ye(x("div",{class:K({"h-64 vb-always-visible":s.filteredOptionsListLength>5})},[X(a,null,{default:Y(()=>{var c;return[x("ul",{ref:"options",class:K(["w-full h-full notranslate",{"mt-2":((c=s.optionsList)==null?void 0:c.length)>=n.searchInputThreshold||n.searchInputThreshold==0}])},[(S(!0),C(Fe,null,nt(s.filteredOptionsList,(u,d)=>(S(),C("li",{key:u[n.optionKey],class:K([{highlighted:d===i.highlightedIndex,active:n.highlightActive&&s.isSelected(u)},"flex spm-dropdown-linkitem item items-center p-[0.4rem] mb-[2px]"]),onClick:f=>s.toggle(u)},[Tt(t.$slots,"option",{option:u},()=>[n.multiple?(S(),re(o,{key:0,ref_for:!0,ref:"checkbox","model-value":s.isSelected(u),class:"mr-2"},null,8,["model-value"])):P("",!0),u!=null&&u.avatar?(S(),C("img",{key:1,src:u.avatar,class:"avatar rounded-lg mr-2 h-6 w-6"},null,8,fR)):P("",!0),u!=null&&u.icon?(S(),C("span",{key:2,class:"flex items-center rounded-lg h-6 w-6",innerHTML:t.svg(u.icon,"stroke-icon h-4")},null,8,hR)):P("",!0),u!=null&&u.color?(S(),C("span",{key:3,style:Ir({background:u.color}),class:"w-3 h-3 rounded-lg mr-1 border-2 border-white mt-px"},null,4)):P("",!0),x("span",null,L(u[n.optionValue]),1)])],10,dR))),128))],2),s.filteredOptionsListLength<=2?(S(),C("div",pR,[x("div",mR,[s.filteredOptionsList.length==0?(S(),C("div",gR,L(t.$trans.get("No results!")),1)):s.hasSlot("results-action")?(S(),C("div",vR,L(t.$trans.get("Not what you are looking for?")),1)):P("",!0),Tt(t.$slots,"results-action")])])):P("",!0)]},void 0,!0),_:3})],2),[[wt,!i.isLoading]]),Ye(x("div",null,[...e[7]||(e[7]=[x("div",{class:"w-1/3 h-4 rounded-lg bg-gray-200 mt-1"},null,-1),x("div",{class:"w-5/6 h-4 rounded-lg bg-gray-200 mt-1"},null,-1),x("div",{class:"w-full h-4 rounded-lg bg-gray-200 mt-1"},null,-1)])],512),[[wt,i.isLoading]])])}const Cm=Ae(lR,[["render",yR]]),bR={props:{assignee:{type:Object,default:()=>null,required:!1},title:{type:String,default:""},placement:{type:String,default:"center",validator:t=>["start","center"].includes(t)}}},kR={key:0,class:"flex items-center content-center"},wR={class:"rounded-lg flex-shrink-0 h-10 w-10 mr-1 avatar overflow-hidden bg-gray-500"},xR=["src"],SR={class:"flex flex-col justify-start"},TR={class:"text-xs ml-1 pr-2"},_R={class:"text-sm font-medium ml-1 pr-2"},ER={key:1,class:"flex flex-col text-center"},CR={class:"text-xs text-gray-600"},OR={class:"text-sm font-medium text-gray-600"};function AR(t,e,n,r,i,s){return S(),C("div",{class:K(["w-full flex",{"justify-center":n.placement=="center","justify-start":n.placement=="start"}]),onClick:e[0]||(e[0]=o=>t.$emit("clicked"))},[n.assignee?(S(),C("div",kR,[x("div",wR,[x("img",{class:"h-10 w-10 avatar",src:n.assignee.avatar},null,8,xR)]),x("div",SR,[x("span",TR,L(n.title),1),x("span",_R,L(n.assignee.name),1)])])):(S(),C("div",ER,[x("span",CR,L(t.$trans.get("Agent")),1),x("span",OR,L(t.$trans.get("Unassigned")),1)]))],2)}const MR=Ae(bR,[["render",AR]]),IR={inject:["ticketList"],components:{SpmDropdown:Gn,SpmSelectableList:Cm,FvlForm:Jl,FvlSearchSelect:XC,SpmAssignee:MR},props:{ticket:{type:Object,default:()=>{}},moreOptions:{type:Array,default:()=>[{id:null,avatar:"https://cdn.helpspace.com/svg/unassigned.svg",name:"Unassign",type:"moreOptions"}]},hideAssignee:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},data(){return{formAssignee:{assignee_id:null},formTeam:{team_id:null}}},computed:{current_team_id(){return this.ticket.team instanceof Object?this.ticket.team.id:null},authUser(){return this.$store.getters.user},assignee(){return this.ticket.assignee instanceof Object?this.ticket.assignee:null},selectedItems(){return this.ticketList.selectedItems}},methods:{openDropdown(){this.init(),this.$refs.list.focusSearch()},assigneeChanged(){this.updateAssignee(),this.$refs.dropdown.hide()},init(){this.formTeam.team_id=this.ticket.team instanceof Object?this.ticket.team.id:null,this.formAssignee.assignee_id=this.ticket.assignee instanceof Object?this.ticket.assignee.id:null},teamChanged(){this.selectedItems.length>1?this.updateTeamBulk(this.selectedItems,this.formTeam.team_id):this.updateTeamSingle(this.formTeam.team_id)},updateTeamSingle(t){ze.patch("/tickets/"+this.ticket.id,{team_id:t}).then(e=>{this.$emit("update:ticket",e.data.data),this.$notify.success(this.$trans.get("Team updated"))}).catch(()=>
50{this.$notify.error(this.$trans.get("Oops! We could not update the team."),4e3)}).finally(()=>{this.$store.dispatch("reloadTicketListIfPageOne"),this.$store.dispatch("updateSectionsCountsOnly")})},updateTeamBulk(t,e){this.sendBulkTeamUpdate(t,e).then(()=>{this.$store.getters.ticket&&this.$store.dispatch("getTicket",{id:this.$store.getters.ticket.id,fetch:!0})}).finally(()=>{this.$store.dispatch("reloadTicketListIfPageOne"),this.$store.dispatch("updateSectionsCountsOnly")})},async sendBulkTeamUpdate(t,e){return ze.patch("/tickets/bulk/update-team",{ids:t,team_id:e}).then(n=>n).catch(n=>n).finally(()=>{})},updateAssignee(){if(this.$store.getters.section=="mine"&&this.authUser.id==this.formAssignee.assignee_id)return this.notifyNothingToDo();if(this.$store.getters.section=="unassigned"&&this.formAssignee.assignee_id==null)return this.notifyNothingToDo();this.selectedItems.length>1?this.updateAssigneeBulk(this.selectedItems,this.formAssignee.assignee_id):this.updateAssigneeSingle(this.formAssignee.assignee_id)},notifyNothingToDo(){return this.$notify.error(this.$trans.get("Nothing to change."))},updateAssigneeSingle(t){var e,n;if(t==((n=(e=this.ticket)==null?void 0:e.assignee)==null?void 0:n.id))return this.notifyNothingToDo();ze.patch("/tickets/"+this.ticket.id,{assignee_id:t}).then(r=>{this.$store.getters.section,this.$emit("update:ticket",r.data.data),this.$notify.reveal(this.$trans.get("Assignee updated"),6e3,{id:r.data.data.id,section:r.data.data.section})}).catch(()=>
50{this.$notify.error(this.$trans.get("Oops! We could not update the assignee."),4e3)}).finally(()=>{this.$store.dispatch("reloadTicketListIfPageOne"),this.$store.dispatch("updateSectionsCountsOnly")})},updateAssigneeBulk(t,e){const n=this.$store.getters.section;if(n=="mine"){this.ticketList.gotoNextAndDeleteAllFromTicketList(t,n),this.sendBulkAssigneeUpdate(t,e).finally(()=>{this.$store.dispatch("updateSectionsCountsOnly")});return}if(n=="assigned"&&(this.authUser==e||e=="unassign")){this.ticketList.gotoNextAndDeleteAllFromTicketList(t,n),this.sendBulkAssigneeUpdate(t,e).finally(()=>{this.$store.dispatch("updateSectionsCountsOnly")});return}this.sendBulkAssigneeUpdate(t,e).then(()=>{this.$store.getters.ticket&&this.$store.dispatch("getTicket",{id:this.$store.getters.ticket.id,fetch:!0})}).finally(()=>{this.$store.dispatch("reloadTicketListIfPageOne"),this.$store.dispatch("updateSectionsCountsOnly")})},async sendBulkAssigneeUpdate(t,e){return ze.patch("/tickets/bulk/update-assignee",{ids:t,assignee_id:e}).then(n=>n).catch(n=>n).finally(()=>{})}}},LR={key:0,class:"text-center"},PR=["innerHTML"];function RR(t,e,n,r,i,s){const o=z("spm-assignee"),a=z("fvl-search-select"),l=z("spm-selectable-list"),c=z("fvl-form"),u=z("spm-dropdown");return S(),re(u,{ref:"dropdown","use-popper":!0,disabled:n.disabled,placement:"bottom",onOpen:e[6]||(e[6]=d=>s.openDropdown()),onClose:e[7]||(e[7]=d=>t.$refs.list.reset())},{trigger:Y(({isOpen:d})=>[Tt(t.$slots,"default")]),dropdown:Y(()=>[n.hideAssignee==!1?(S(),re(o,{key:0,assignee:s.assignee,class:"my-8 mt-2 mb-4",title:t.$trans.get("Assigned Agent"),onClicked:e[0]||(e[0]=d=>t.$refs.list.focusSearch())},null,8,["assignee","title"])):P("",!0),X(c,{ref:"formTeam",method:"patch",data:i.formTeam,url:"/tickets/"+n.ticket.id,name:"assign-team",class:"flex flex-wrap w-full",autocomplete:"new-team"},{default:Y(()=>[X(a,{modelValue:i.formTeam.team_id,"onUpdate:modelValue":e[1]||(e[1]=d=>i.formTeam.team_id=d),"search-keys":["name"],"options-url":"/selectable/teams?canAccess=tickets","option-key":"id","option-value":"name","response-data-path":"data",name:"team",label:"",placeholder:t.$trans.get("Assign team..."),autocomplete:"off",class:"w-full mb-2",onChanged:e[2]||(e[2]=d=>s.teamChanged())},null,8,["modelValue","placeholder"]),X(l,{ref:"list",selected:i.formAssignee.assignee_id,"onUpdate:selected":[e[4]||(e[4]=d=>i.formAssignee.assignee_id=d),e[5]||(e[5]=d=>s.assigneeChanged())],name:"blub","response-data-path":"data","search-keys":["name"],"options-url":"/selectable/users?canAccess=tickets","prepend-options":[{id:null,avatar:"https://cdn.helpspace.com/svg/unassigned.svg",name:t.$trans.get("Unassign")}],"option-value":"name","option-key":"id","search-placeholder":t.$trans.get("Search User"),"highlight-active":!1},{"results-action":Y(()=>[t.$userHasRole(["superadmin","admin"])?(S(),C("div",LR,[x("button",{class:"flex items-center w-auto mx-auto text-primary-500 hover:bg-gray-200 rounded pl-2 py-1 font-medium mb-1",onClick:e[3]||(e[3]=d=>t.$router.push("/settings/users"))},[Me(L(t.$trans.get("Manage Users"))+" ",1),x("span",{class:"self
50-center",innerHTML:t.svg("feather-chevron-right","stroke-icon h-4 -ml-px")},null,8,PR)])])):P("",!0)]),_:1},8,["selected","prepend-options","search-placeholder"])],void 0,!0),_:1},8,["data","url"])]),_:3},8,["disabled"])}const $R=Ae(IR,[["render",RR]]);var DR=cm,NR=rm;function FR(t,e){var n=-1,r=NR(t)?Array(t.length):[];return DR(t,function(i,s,o){r[++n]=e(i,s,o)}),r}var Pw=FR,jR=om,BR=Xl,HR=Pw,UR=lo;function VR(t,e){var n=UR(t)?jR:HR;return n(t,BR(e))}var Rw=VR;const $w=wn(Rw),zR={components:{SpmDropdown:Gn,SpmSelectableList:Cm,FvlForm:Jl},props:{tags:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},patchUrl:{type:String,default:""},optionsUrl:{type:String,default:""},dropdownClass:{type:String,required:!1,default:null},small:{type:Boolean,default:!1},arrow:{type:Boolean,default:!0},submitOnClose:{type:Boolean,default:!1},placement:{type:String,required:!1,default:"bottom"}},data(){return{formTags:{tags:[]}}},methods:{openDropdown(){this.init(),this.$refs.list.focusSearch()},init(){this.formTags.tags=$w(this.tags,"id")},onFormUpdate(){!this.submitOnClose&&this.patchUrl&&this.$refs.formTags.submit(),this.$emit("updated",this.formTags.tags)},onDropdownClose(){this.submitOnClose&&this.patchUrl&&this.$refs.formTags.submit(),this.$refs.list.reset()}}},WR={key:0,class:"text-center"},KR=["innerHTML"];function qR(t,e,n,r,i,s){const o=z("spm-selectable-list"),a=z("fvl-form"),l=z("spm-dropdown");return S(),re(l,{ref:"dropdown","use-popper":!0,disabled:n.disabled,placement:n.placement,small:n.small,arrow:n.arrow,"dropdown-class":n.dropdownClass,onOpen:e[3]||(e[3]=c=>s.openDropdown()),onClose:s.onDropdownClose},{trigger:Y(({isOpen:c})=>[Tt(t.$slots,"default")]),dropdown:Y(()=>[X(a,{ref:"formTags",method:"patch",data:i.formTags,url:n.patchUrl,name:"select-tags",class:"flex flex-wrap w-full",onSuccess:e[2]||(e[2]=c=>t.$emit("success",c))},{default:Y(()=>[X(o,{ref:"list",selected:i.formTags.tags,"onUpdate:selected":[e[1]||(e[1]=c=>i.formTags.tags=c),s.onFormUpdate],name:"tags",multiple:!0,"response-data-path":"data","search-keys":["name"],"options-url":n.optionsUrl,"option-value":"name","option-key":"id","search-placeholder":t.$trans.get("Search Tags"),"highlight-active":!1},{"results-action":Y(()=>[t.$userHasRole(["superadmin","admin"])?(S(),C("div",WR,[x("button",{class:"flex items-center w-auto mx-auto text-primary-500 hover:bg-gray-200 rounded pl-2 py-1 font-medium mb-1",onClick:e[0]||(e[0]=c=>t.$router.push("/settings/tags"))},[Me(L(t.$trans.get("Manage Tags"))+" ",1),x("span",{class:"self
50-center",innerHTML:t.svg("feather-chevron-right","stroke-icon h-4 -ml-px")},null,8,KR)])])):P("",!0)]),_:1},8,["selected","options-url","search-placeholder","onUpdate:selected"])],void 0,!0),_:1},8,["data","url"])]),_:3},8,["disabled","placement","small","arrow","dropdown-class","onClose"])}const Om=Ae(zR,[["render",qR]]),GR={components:{SpmDropdownTags:Om},props:{ticket:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}}};function YR(t,e,n,r,i,s){const o=z("spm-dropdown-tags");return S(),re(o,{tags:n.ticket.tags||[],"options-url":"/selectable/tags/ticket","patch-url":"/tickets/"+n.ticket.id+"/synctags",disabled:n.disabled,onSuccess:e[0]||(e[0]=a=>t.$emit("update:ticket",Object.assign({},n.ticket,{tags:a.data.data.tags})))},{default:Y(()=>[Tt(t.$slots,"default")],void 0,!0),_:3},8,["tags","patch-url","disabled"])}const XR=Ae(GR,[["render",YR]]),JR={inject:["ticketList"],components:{SpmDropdown:Gn,SpmSelectableList:Cm,FvlForm:Jl},props:{ticket:{type:Object,default:()=>{}},disabled:{type:Boolean,default:!1}},data(){return{formWatchers:{watchers:[]}}},methods:{success(t){this.$emit("update:ticket",Object.assign({},this.ticket,{watchers:t.data.data.watchers})),this.$store.getters.section=="watching"&&(this.$refs.dropdown.hide(),this.ticketList.gotoNextAndDeleteOneFromTicketList(t.data.data.id,this.$store.getters.section)),this.$store.dispatch("reloadTicketListIfPageOne"),this.$store.dispatch("updateSectionsCountsOnly")},init(){this.formWatchers.watchers=$w(this.ticket.watchers,"id")}}};function QR(t,e,n,r,i,s){const o=z("spm-selectable-list"),a=z("fvl-form"),l=z("spm-dropdown");return S(),re(l,{ref:"dropdown","use-popper":!0,disabled:n.disabled,placement:"bottom",onOpen:e[2]||(e[2]=c=>{s.init(),t.$refs.list.focusSearch()}),onClose:e[3]||(e[3]=c=>t.$refs.list.reset())},{trigger:Y(({isOpen:c})=>[Tt(t.$slots,"default")]),dropdown:Y(()=>[X(a,{ref:"formWatchers",method:"patch",data:i.formWatchers,url:"/tickets/"+n.ticket.id+"/syncwatchers",name:"select-watchers",class:"flex flex-wrap w-full",onSuccess:s.success},{default:Y(()=>[X(o,{ref:"list",selected:i.formWatchers.watchers,"onUpdate:selected":[e[0]||(e[0]=c=>i.formWatchers.watchers=c),e[1]||(e[1]=c=>t.$refs.formWatchers.submit())],name:"blub",multiple:!0,"response-data-path":"data","search-keys":["name"],"options-url":"/selectable/users?canAccess=tickets","option-value":"name","option-key":"id","search-placeholder":t.$trans.get("Search ..."),"highlight-active":!1},null,8,["selected","search-placeholder"])],void 0,!0),_:1},8,["data","url","onSuccess"])]),_:3},8,["disabled"])}const ZR=Ae(JR,[["render",QR]]),e$={model:{prop:"selected"},props:{value:{type:String,default:""},label:{type:String,default:""},disabled:{type:Boolean,default:!1},isSelected:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},hideSelected:{type:Boolean,default:!1}},computed:{},methods:{select(){this.disabled||this.$emit("input",this.value)},focusFirst(){this.$refs.buttons[0].focus()},focus(t){t.focus()},next(t){t.target.nextElementSibling!=null&&t.target.nextElementSibling.focus()},previous(t){t.target.previousElementSibling!=null&&t.target.previousElementSibling.focus()}}},t$=["aria-disabled"];function n$(t,e,n,r,i,s){return n.hideSelected&&n.isSelected?P("",!0):(S(),C("li",{key:0,ref:"buttons",role:"radio",tabindex:"0",class:K(["outline-none",n.isSelected?"disabled":""]),"aria-disabled":n.isSelected?"true":null,onKeydown:[e[0]||(e[0]=Lt(o=>s.next(o),["down"])),e[1]||(e[1]=Lt(o=>s.previous(o),["up"])),e[2]||(e[2]=Lt(o=>o.target.click(),["enter"]))],onClick:e[3]||(e[3]=ct(o=>{s.focus(o.target),s.select()},["prevent"]))},[Tt(t.$slots,"default",{},()=>[Me(L(n.label),1)])],42,t$))}const r$=Ae(e$,[["render",n$]]),i$={compatConfig:{COMPONENT_V_MODEL:!1},components:{SpmCheckbox:Em,SpmOption:r$},emits:["update:modelValue","remoteSuccess","remoteError"],props:{multiple:{type:Boolean,default:!1},modelValue:{validator:t=>typeof t=="string"||typeof t=="number"||typeof t=="object"||Array.isArray(t),required:!0},name:{type:String,required:!0},id:{type:String,default:null},label:{type:String,default:null},options:{type:Array,default:()=>[]},optionsUrl:{type:String,default:null},responseDataPath:{type:String,default:null},lazyLoad:{type:Boolean,default:!1},optionKey:{type:String,required:!0},optionValue:{type:String,required:!0},fieldClass:{type:String,required:!1,default:null},required:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},hideSelected:{type:Boolean,default:!1}},data(){return{remoteOptions:[],isLoading:!1}},computed:{optionsList(){return this.remoteOptions.length?this.remoteOptions:this.options}},mounted(){if(this.optionsUrl&&(this.lazyLoad||this.getRemoteOptions(),this.multiple&&!Array.isArray(this.modelValue)))throw new Error('Prop "multiple" is "true" so prop "selected" must be an "array"!')},methods:{toggle(t){let e=null;this.multiple?e=Lw(this.modelValue,[t[this.optionKey]]):e=t[this.optionKey],this.$emit("update:modelValue",e)},isSelected(t){return this.multiple?(alert("multiple not ready implemented yet"),!!this.modelValue.includes(t[this.optionKey])):this.modelValue==t[this.optionKey]},getRemoteOptions(){if(!this.searchRemote&&this.optionsList.length||!this.optionsUrl)return;let t="";this.query&&(t="?"+this.searchKeys[0]+"="+this.query);let e=this;this.isLoading=!0,ze({method:"get",url:this.optionsUrl+t,responseType:"json"}).then(function(n){e.remoteOptions=e.responseDataPath?am(n.data,e.responseDataPath):n.data,e.$emit("remoteSuccess",n),e.isLoading=!1}
50).catch(function(n){e.$emit("remoteError",n)}).finally(function(){e.isLoading=!1})}}},s$={class:"w-full"},o$={class:"vb-always-visible"},a$={ref:"options",class:"w-full h-full notranslate"},l$=["src"],c$=["innerHTML"];function u$(t,e,n,r,i,s){const o=z("spm-checkbox"),a=z("spm-option");return S(),C("div",s$,[Ye(x("div",o$,[x("div",a$,[(S(!0),C(Fe,null,nt(s.optionsList,l=>(S(),re(a,{ref_for:!0,ref:"options",key:l[n.optionKey],selected:n.modelValue,class:"flex spm-dropdown-linkitem item items-center",value:l[n.optionKey],label:t.$trans.get(l[n.optionValue]),"is-selected":s.isSelected(l),"hide-selected":n.hideSelected,onInput:c=>s.toggle(l)},{default:Y(()=>[Tt(t.$slots,"option",{option:l},()=>[l.avatar?(S(),C("img",{key:0,src:l.avatar,class:"avatar rounded-lg mr-2 h-5 w-5"},null,8,l$)):P("",!0),n.multiple?(S(),re(o,{key:1,ref_for:!0,ref:"checkbox","model-value":s.isSelected(l),class:"mr-4"},null,8,["model-value"])):P("",!0),l.color?(S(),C("span",{key:2,style:Ir({background:l.color}),class:"w-3 h-3 rounded-lg mr-1 border-2 border-white mt-px"},null,4)):P("",!0),x("span",{innerHTML:t.$trans.get(l[n.optionValue])},null,8,c$)])],void 0,!0),_:2},1032,["selected","value","label","is-selected","hide-selected","onInput"]))),128))],512)],512),[[wt,!i.isLoading]]),Ye(x("div",null,[...e[0]||(e[0]=[x("div",{class:"w-1/3 h-4 rounded-lg bg-gray-200 mt-1"},null,-1),x("div",{class:"w-5/6 h-4 rounded-lg bg-gray-200 mt-1"},null,-1),x("div",{class:"w-full h-4 rounded-lg bg-gray-200 mt-1"},null,-1)])],512),[[wt,i.isLoading]])])}const Dw=Ae(i$,[["render",u$]]),d$=[{value:"open",name:"Open"},{value:"escalated",name:"Escalated"},{value:"waiting",name:"Waiting"},{value:"wait_until",name:"Wait until..."},{value:"closed",name:"Closed"},{value:"spam",name:"Spam"}],f$={inject:["ticketList"],components:{SpmDropdown:Gn,SpmSelectableListSimple:Dw},props:{ticket:{type:Object,default:()=>{}},disabled:{type:Boolean,default:!1}},data(){return{possibleStatus:d$,form:{status:""}}},methods:{statusSelected(t){this.updateStatus(this.ticket,t),this.$refs.dropdown.hide()},init(){this.form.status=this.ticket.wait_until?"wait_until":this.ticket.status},updateStatus(t,e,n){if(e=="wait_until"){this.chooseWaitUntilDate(n,t);return}this.ticketList.selectedItems.length>1?this.bulkUpdateStatus(this.ticketList.selectedItems,e):this.singleUpdateStatus(t,e,n)},singleUpdateStatus(t,e){return t.status==e?this.$notify.error(this.$trans.get("Status is already :status",{status:'"'+this.$trans.get(e)+'"'})):ze.patch(`/tickets/${t.id}`,{status:e}).then(n=>(this.doOnSuccess(n,e),this.question(e,t))).catch(()=>{}).finally(()=>{this.$store.dispatch("reloadTicketListIfPageOne"),this.$store.dispatch("updateSectionsCountsOnly")})},bulkUpdateStatus(t,e){const n=this.$store.getters.section;if(n==e){this.$trans.get("Status is already :status",{status:'"'+this.$trans.get(e)+'"'});return}const r=this.newStatusIsArchiveStatus(e)||this.movingFromArchiveSectionToWorkingState(n,e),i=this.$store.getters.section==="all"&&e!="trash";if(r&&!i){this.sendBulkUpdate(t,e),this.ticketList.gotoNextAndDeleteAllFromTicketList(t,n);return}this.sendBulkUpdate(t,e).then(()=>{this.$store.getters.ticket&&this.$store.dispatch("getTicket",{id:this.$store.getters.ticket.id,fetch:!0}),this.$store.dispatch("updateTicketsPropertyInTicketList",{key:"status",value:e,ids:t,section:n})}).finally(()=>{this.$store.dispatch("reloadTicketListIfPageOne"),this.$store.dispatch("updateSectionsCountsOnly")})},async sendBulkUpdate(t,e){return ze.patch("/tickets/bulk/update-status",{ids:t,status:e}).then(n=>n).catch(n=>n).finally(()=>{})},doOnSuccess(t,e){this.$emit("update:ticket",t.data.data);const n=this.$store.getters.section,r=t.data.data.id;this.$notify.reveal(this.$trans.get("Status updated"),6e3,{id:t.data.data.id,section:t.data.data.section});const i=this.newStatusIsArchiveStatus(e)||this.movingFromArchiveSectionToWorkingState(n,e),s=this.$store.getters.section==="all"&&e!="trash";if(i&&!s){this.ticketList.gotoNextAndDeleteOneFromTicketList(r,n);return}},focusFirstOption(){this.$nextTick(()=>{this.$refs.statusOptions.$refs.options.firstElementChild.focus()})},question(t,e){const n=["open","waiting","escalated"];
50return t=="spam"&&e.contact.is_spam!=1?this.alwaysMarkContactAsSpamConfirm(t,e):n.includes(t)&&e.contact.is_spam==1?this.shouldWeRecoverContactConfirm(t,e):Promise.resolve()},chooseWaitUntilDate(t,e){this.$store.commit("showDialogModal",{component:"tickets/modals/_wait_until.modal.vue",title:" ",params:{ticket:e},buttons:[]})},alwaysMarkContactAsSpamConfirm(t,e){return new Promise(n=>{this.$store.commit("showDialogModal",{title:this.$trans.get("Always mark contact as spam?"),params:{onClose:()=>n()},text:this.$trans.choice("Should we always mark <b>:value</b> as spam? All open or new tickets of this contact will be moved to spam directly.",null,{value:e.contact.value}),buttons:[{title:this.$trans.get("Mark as spam!"),class:"btn-red-500",handler:()=>{n(this.updateContactSpamFlag(e,1))}},{title:this.$trans.get("No thanks."),default:!0,handler:()=>n()}]})})},shouldWeRecoverContactConfirm(t,e){return new Promise(n=>{this.$store.commit("showDialogModal",{title:this.$trans.get("Recover contact from spam?"),params:{onClose:()=>n()},text:this.$trans.choice("Someone has reported <b>:value</b> as spam contact. Do you want to recover this contact?",null,{value:e.contact.value}),buttons:[{title:this.$trans.get("Recover contact!"),class:"btn-red-500",handler:()=>{n(this.updateContactSpamFlag(e,0))}},{title:this.$trans.get("No, leave contact in spam."),default:!0,handler:()=>n()}]})})},updateContactSpamFlag(t,e){return ze.patch(`/tickets/${t.id}/contact-spam-flag`,{contact_spam_flag:e}).then(n=>{this.$emit("update:ticket",n.data.data)}).catch(()=>{}).finally(()=>{})},newStatusIsArchiveStatus(t){return["closed","spam"].includes(t)},movingFromArchiveSectionToWorkingState(t,e){const n=["closed","spam"].includes(t),r=["waiting","o
50pen","escalated"].includes(e);return n&&r}}};function h$(t,e,n,r,i,s){const o=z("spm-selectable-list-simple"),a=z("spm-dropdown");return S(),re(a,{ref:"dropdown","use-popper":!0,disabled:n.disabled,placement:"bottom",class:"h-auto",onOpen:e[1]||(e[1]=l=>s.init())},{trigger:Y(()=>[Tt(t.$slots,"default")]),dropdown:Y(()=>[X(o,{ref:"statusOptions",modelValue:i.form.status,"onUpdate:modelValue":[e[0]||(e[0]=l=>i.form.status=l),s.statusSelected],name:"status",options:i.possibleStatus,"option-key":"value","option-value":"name"},null,8,["modelValue","options","onUpdate:modelValue"])]),_:3},8,["disabled"])}const p$=Ae(f$,[["render",h$]]),m$={emits:["click","clicked"],props:{tooltip:{type:String,default:null},disabled:{type:Boolean,default:!1},icon:{type:String,default:null},tooltipPlacement:{type:String,default:"bottom"},iconClass:{type:String,default:"stroke-icon h-4"},keyBindingInfo:{type:String,default:null}},computed:{tippyInfo(){return this.keyBindingInfo?this.tooltip+` <span class="spm-hotkey bg-gray-800 text-[.7rem] bg-opacity-75 ml-2 -mr-1 px-1 rounded">${this.keyBindingInfo}</span>`:this.tooltip}},mounted(){(this.tooltip||this.keyBindingInfo)&&this.$tippy(this.$refs.button,{placement:this.tooltipPlacement,allowHTML:!0})},methods:{handleClick(t){this.$emit("click",t),this.$emit("clicked",t)}}},g$=["data-tippy-content","disabled"],v$=["innerHTML"];function y$(t,e,n,r,i,s){return S(),C("button",{ref:"button","data-tippy-content":s.tippyInfo,class:K({"button-tooltip":n.tooltip,"opacity-25":n.disabled}),disabled:n.disabled,onClick:e[0]||(e[0]=(...o)=>s.handleClick&&s.handleClick(...o))},[n.icon?(S(),C("span",{key:0,innerHTML:t.svg(n.icon,n.iconClass)},null,8,v$)):P("",!0),Tt(t.$slots,"default")],10,g$)}const tc=Ae(m$,[["render",y$]]),b$={inject:["ticketList"],components:{SpmDropformAssignment:$R,SpmDropformTags:XR,SpmDropformStatus:p$,SpmDropformWatchers:ZR,SpmButton:tc,SpmTooltip:rr},model:{prop:"ticket"},props:{isLoading:{type:Boolean,required:!0},ticket:{type:Object,required:!0},viewingUsers:{type:Array,required:!1,default:()=>[]}},mounted(){this.mountKeydownListener()},beforeUnmount(){this.unMountKeydownListener()},methods:{emitThrottled:Jr(function(t){this.$emit(t)},2e3),handleReplyClick(t){if(!this.$store.getters.user.settings.ticket.auto_assign_on_reply&&this.ticket.assignee&&this.ticket.assignee.id!=this.$store.getters.user.id){this.$store.commit("showDialogModal",{title:this.$trans.get("Ticket already assigned"),text:this.$trans.get("This ticket is already assigned to another agent.")+" "+this.$trans.get("Replying or forwarding will reassign it to you.")+"<br><br> "+this.$trans.get("Do you want to continue?"),buttons:[{title:this.$trans.get("Yes"),class:"btn-primary-500",handler:()=>{this.emitThrottled(t)}},{title:this.$trans.get("Cancel"),default:!0}]});return}this.emitThrottled(t)},deleteTicketThrottled:Jr(function(t){this.ticketList.selectedItems.length>0?this.ticketList.bulkDeleteTickets(this.ticketList.selectedItems):this.ticketList.deleteTicket(t)},600),restoreTicketThrottled:Jr(function(t){this.ticketList.selectedItems.length>0?this.ticketList.bulkRestoreTickets(this.ticketList.selectedItems):this.ticketList.restoreTicket(t)},600),destroyTicketThrottled:Jr(function(t){this.ticketList.selectedItems.length>0?this.ticketList.bulkForceDestroyTickets(this.ticketList.selectedItems):this.ticketList.destroyTicket(t)},600),mountKeydownListener(){window.document.addEventListener("keydown",this.addKeyboardShortcuts,!1)},unMountKeydownListener(){window.document.removeEventListener("keydown",this.addKeyboardShortcuts,!1)},generateTldrSummary:Jr(function(t){this.ticketList.generateTldrSummary(t)},600),addKeyboardShortcuts(t){if(t.metaKey&&t.ctrlKey&&t.code==="KeyR"){this.emitThrottled("external"),t.stopPropagation(),t.preventDefault();return}if(t.metaKey&&t.ctrlKey&&t.code==="KeyN"){this.emitThrottled("internal"),t.stopPropagation(),t.preventDefault();return}if(t.metaKey&&t.ctrlKey&&t.code==="KeyF"){this.emitThrottled("forward"),t.stopPropagation(),t.preventDefault();return}if(t.metaKey&&t.ctrlKey&&t.code==="KeyS"){document.getElementById("spm-dropform-status-trigger").click(),t.stopPropagation(),t.preventDefault();return}if(t.metaKey&&t.ctrlKey&&t.code==="KeyA"){document.getElementById("spm-dropform-assignment-tr
50igger").click(),t.stopPropagation(),t.preventDefault();return}if(t.metaKey&&t.ctrlKey&&t.code==="KeyT"){document.getElementById("spm-dropform-tags-trigger").click(),t.stopPropagation(),t.preventDefault();return}if(t.metaKey&&t.ctrlKey&&t.code==="KeyW"){document.getElementById("spm-dropform-watchers-trigger").click(),t.stopPropagation(),t.preventDefault();return}if(t.metaKey&&t.code==="Enter"){document.getElementById("spm-editor-submit-button").click(),t.stopPropagation(),t.preventDefault();return}}}},k$={id:"spm-action-menu",class:"flex items-stretch text-gray-650 py-2 box-style"},w$={class:"flex self-center w-full h-8 px-2 gap-1 md:gap-2 xl:gap-3 ml-1"},x$={class:"ml-auto flex items-center"},S$={class:"relative items-center justify-center flex h-5 w-5"},T$=["src"];function _$(t,e,n,r,i,s){const o=z("spm-button"),a=z("spm-dropform-status"),l=z("spm-dropform-assignment"),c=z("spm-dropform-tags"),u=z("spm-dropform-watchers"),d=z("spm-tooltip");return S(),C("div",k$,[x("div",w$,[Ye(X(o,{tooltip:t.$trans.get("Restore"),class:"spm-action-item","icon-class":"stroke-icon h-4",icon:"feather-repeat",disabled:s.ticketList.selectedItems.length<0||n.isLoading||s.ticketList.unselectNumTickets>0,onClick:e[0]||(e[0]=f=>s.restoreTicketThrottled(n.ticket.id))},null,8,["tooltip","disabled"]),[[wt,t.$store.getters.section=="trash"]]),Ye(X(o,{tooltip:t.$trans.get("Delete Permanently"),class:"spm-action-item","icon-class":"stroke-icon h-4",icon:"feather-trash-2",disabled:s.ticketList.selectedItems.length<0||n.isLoading||s.ticketList.unselectNumTickets>0,onClick:e[1]||(e[1]=f=>s.destroyTicketThrottled(n.ticket.id))},null,8,["tooltip","disabled"]),[[wt,t.$store.getters.section=="trash"]]),Ye(X(o,{tooltip:t.$trans.get("Reply"),"key-binding-info":t.$store.getters.commandKey+" "+t.$store.getters.controlKey+" R",class:K(["spm-action-item",{active:n.ticket.draft&&n.ticket.draft.type=="external"}]),"icon-class":"stroke-icon h-4",icon:"feather-corner-up-left",disabled:!!(n.ticket.draft&&n.ticket.draft.type!="external"||s.ticketList.selectedItems.length>0||n.isLoading||typeof n.ticket.contact=="object"&&n.ticket.contact.spam_complaint!=null),onClick:e[2]||(e[2]=f=>s.handleReplyClick("external"))},null,8,["tooltip","key-binding-info","class","disabled"]),[[wt,t.$store.getters.section!="trash"]]),Ye(X(o,{tooltip:t.$trans.get("Add Note"),"key-binding-info":t.$store.getters.commandKey+" "+t.$store.getters.controlKey+" N",class:K([{active:n.ticket.draft&&n.ticket.draft.type=="internal"},"spm-action-item"]),"icon-class":"stroke-icon h-4",icon:"feather-custom-note",disabled:!!(n.ticket.draft&&n.ticket.draft.type!="internal"||s.ticketList.selectedItems.length>0||n.isLoading||typeof n.ticket.contact=="object"&&n.ticket.contact.spam_complaint!=null),onClick:e[3]||(e[3]=f=>s.emitThrottled("internal"))},null,8,["tooltip","key-binding-info","class","disabled"]),[[wt,t.$store.getters.section!="trash"]]),Ye(X(o,{tooltip:t.$trans.get("Forward"),"key-binding-info":t.$store.getters.commandKey+" "+t.$store.getters.controlKey+" F",class:K([{active:n.ticket.draft&&n.ticket.draft.type=="forward"},"spm-action-item"]),"icon-class":"stroke-icon h-4",icon:"feather-corner-up-right",disabled:!!(n.ticket.draft&&n.ticket.draft.type!="forward"||s.ticketList.selectedItems.length>0||n.isLoading||typeof n.ticket.contact=="object"&&n.ticket.contact.spam_complaint!=null),onClick:e[4]||(e[4]=f=>s.handleReplyClick("forward"))},null,8,["tooltip","key-binding-info","class","disabled"]),[[wt,t.$store.getters.section!="trash"&&!n.ticket.is_social]]),Ye(X(a,{ticket:n.ticket,disabled:n.isLoading||s.ticketList.unselectNumTickets>0,"onUpdate:ticket":e[5]||(e[5]=f=>t.$store.dispatch("cacheTicket",f))},{default:Y(()=>[X(o,{id:"spm-dropform-status-trigger",tooltip:t.$trans.get("Status"),"key-binding-info":t.$store.getters.commandKey+" "+t.$store.getters.controlKey+" S",class:"spm-action-item","icon-class":"stroke-icon h-4",icon:"feather-flag",disabled:n.isLoading||s.ticketList.unselectNumTickets>0},null,8,["tooltip","key-binding-info","disabled"])],void 0,!0),_:1},8,["ticket","disabled"]),[[wt,t.$store.getters.section!="trash"]]),Ye(X(l,{ticket:n.ticket,disabled:n.isLoading||s.ticketList.unselectNumTickets>0,"onUpdate:ticket":e[6]||(e[6]=f=>t.$store.dispatch("cacheTicket",f))},{default:Y(()=>
50[X(o,{id:"spm-dropform-assignment-trigger",tooltip:t.$trans.get("Assignment"),"key-binding-info":t.$store.getters.commandKey+" "+t.$store.getters.controlKey+" A",class:"spm-action-item",icon:"feather-user",disabled:n.isLoading||s.ticketList.unselectNumTickets>0},null,8,["tooltip","key-binding-info","disabled"])],void 0,!0),_:1},8,["ticket","disabled"]),[[wt,t.$store.getters.section!="trash"]]),Ye(X(c,{ticket:n.ticket,disabled:!!(s.ticketList.selectedItems.length>0||n.isLoading),"onUpdate:ticket":e[7]||(e[7]=f=>t.$store.dispatch("cacheTicket",f))},{default:Y(()=>[X(o,{id:"spm-dropform-tags-trigger",tooltip:t.$trans.get("Tags"),"key-binding-info":t.$store.getters.commandKey+" "+t.$store.getters.controlKey+" T",class:"spm-action-item mt-px","icon-class":"stroke-icon h-4",icon:"feather-tag",disabled:!!(s.ticketList.selectedItems.length>0||n.isLoading)},null,8,["tooltip","key-binding-info","disabled"])],void 0,!0),_:1},8,["ticket","disabled"]),[[wt,t.$store.getters.section!="trash"]]),Ye(X(u,{ticket:n.ticket,disabled:!!(s.ticketList.selectedItems.length>0||n.isLoading),"onUpdate:ticket":e[8]||(e[8]=f=>t.$store.dispatch("cacheTicket",f))},{default:Y(()=>[X(o,{id:"spm-dropform-watchers-trigger",tooltip:t.$trans.get("Watchers"),"key-binding-info":t.$store.getters.commandKey+" "+t.$store.getters.controlKey+" W",class:"spm-action-item mt-px","icon-class":"stroke-icon h-4",icon:"feather-eye",disabled:!!(s.ticketList.selectedItems.length>0||n.isLoading)},null,8,["tooltip","key-binding-info","disabled"])],void 0,!0),_:1},8,["ticket","disabled"]),[[wt,t.$store.getters.section!="trash"]]),Ye(X(o,{tooltip:t.$trans.get("Print"),"key-binding-info":t.$store.getters.commandKey+" "+t.$store.getters.controlKey+" P",class:"spm-action-item","icon-class":"stroke-icon h-4",icon:"feather-printer",disabled:n.isLoading||s.ticketList.selectedItems.length>0,onClick:e[9]||(e[9]=f=>t.$bus.emit("print.ticket"))},null,8,["tooltip","key-binding-info","disabled"]),[[wt,t.$store.getters.section!="trash"&&!t.$isMobileOrTablet]]),Ye(X(o,{tooltip:t.$trans.get("Generate AI Summary"),class:"spm-action-item","icon-class":"stroke-icon h-4",icon:"feather-cpu",disabled:n.isLoading||s.ticketList.unselectNumTickets>0,onClick:e[10]||(e[10]=f=>s.generateTldrSummary(n.ticket.id))},null,8,["tooltip","disabled"]),[[wt,t.$store.getters.section!="trash"&&t.$store.getters.customerInfo.conditions.aiFeatures&&t.$store.getters.customerInfo.workspaceSettings.ai.enabled]]),Ye(X(o,{tooltip:t.$trans.get("Delete"),"key-binding-info":t.$store.getters.commandKey+" "+t.$store.getters.backspaceKey,class:"spm-action-item","icon-class":"stroke-icon h-4",icon:"feather-trash-2",disabled:n.isLoading||s.ticketList.unselectNumTickets>0,onClick:e[11]||(e[11]=f=>s.deleteTicketThrottled(n.ticket.id))},null,8,["tooltip","key-binding-info","disabled"]),[[wt,t.$store.getters.section!="trash"]]),x("div",x$,[X($i,{name:"slide",tag:"div",class:"transition-all h-5 relative flex gap-2"},{default:Y(()=>[(S(!0),C(Fe,null,nt(n.viewingUsers,f=>(S(),re(d,{key:f.id,tag:"div",tooltip:t.$trans.get(":agent is currently viewing",{agent:f.name})},{default:Y(()=>[x("span",S$,[e[14]||(e[14]=x("span",{class:"animate-ping absolute inline-flex h-[16px] w-[16px] delay-300 avatar bg-green-800"},null,-1)),x("img",{class:"relative inline-flex avatar ring-2 ring-green-500 rounded-lg h-5 w-5",src:f.avatar},null,8,T$)])],void 0,!0),_:2},1032,["tooltip"]))),128))],void 0,!0),_:1}),t.$store.getters.mobileView?P("",!0):(S(),re(o,{key:0,tooltip:t.$trans.get("Previous"),class:K(["spm-ticket-list-add-keylistener",["
50spm-action-item mr-0",{"text-gray-700":s.ticketList.currentIndex==0}]]),icon:"feather-chevron-left",disabled:n.isLoading||s.ticketList.currentIndex==0,onClick:e[12]||(e[12]=f=>s.ticketList.gotoPrevious())},null,8,["tooltip","class","disabled"])),t.$store.getters.mobileView?P("",!0):(S(),re(o,{key:1,tooltip:t.$trans.get("Next"),class:K(["spm-ticket-list-add-keylistener",["spm-action-item mr-0 ml-0",{"text-gray-700":s.ticketList.currentIndex==s.ticketList.lastIndex}]]),icon:"feather-chevron-right",disabled:n.isLoading||s.ticketList.currentIndex==s.ticketList.lastIndex,onClick:e[13]||(e[13]=f=>s.ticketList.gotoNext())},null,8,["tooltip","class","disabled"]))])])])}const E$=Ae(b$,[["render",_$]]);function C$(t){return t&&t.length?t[0]:void 0}var O$=C$;const A$=wn(O$);function M$(t,e,n){return t===t&&(n!==void 0&&(t=t<=n?t:n),e!==void 0&&(t=t>=e?t:e)),t}var I$=M$,L$=I$,P$=TC,R$=Nk,$$=SC;function D$(t,e,n){return t=$$(t),n=n==null?0:L$(R$(n),0,t.length),e=P$(e),t.slice(n,n+e.length)==e}var N$=D$;const F$=wn(N$),j$={name:"JsonToList",props:{json:{type:[Array,Object],required:!1,default:()=>{}},nested:{type:Boolean,default:!1},hiddenKeys:{type:Array,default:()=>[]},onlyKeys:{type:Array,default:()=>[]}},computed:{firstElement(){return A$(this.json)}},methods:{isNumber(t){return typeof t=="number"},guessValueType(t){let e=F$(t,"https://");const n=/\[(.*?)\]\((https?:\/\/[^\s\)]+)\)/;if(n.test(t)){const r=t.match(n);return'<a href="'+r[2]+'" target="blank">'+r[1]+"</a>"}return e?'<a href="'+t+'" target="blank">'+t+"</a>":this.isValidTimestamp(t)?this.$filters.datetime(t):typeof t=="object"&&t===null?"-":t},formatTitle(t){return typeof t=="string"?t.replaceAll("_"," "):null},isValidTimestamp(t){if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}([+-]\d{2}:\d{2})?$/.test(t))return!1;const n=new Date(t);return n.toISOString()===t||n.toString()!=="Invalid Date"}}},B$=["innerHTML"];function H$(t,e,n,r,i,s){const o=z("json-to-list",!0);return S(),C("dl",{class:K(n.nested?"cs-nested-section":"cs-section")},[(S(!0),C(Fe,null,nt(n.json,(a,l)=>(S(),C(Fe,{key:l},[Ye(x("dt",{class:"cs-title"},L(s.formatTitle(l)),513),[[wt,l&&!s.isNumber(l)&&!n.hiddenKeys.includes(l)&&(n.onlyKeys.length?n.onlyKeys.includes(l):!0)]]),Ye(x("dd",{class:K(s.isNumber(l)?"cs-single":"cs-text")},[typeof a=="object"&&a!==null?(S(),re(o,{key:0,json:a,"hidden-keys":n.hiddenKeys,nested:!0},null,8,["json","hidden-keys"])):(S(),C("div",{key:1,innerHTML:s.guessValueType(a)},null,8,B$))],2),[[wt,!n.hiddenKeys.includes(l)&&(n.onlyKeys.length?n.onlyKeys.includes(l):!0)]])],64))),128))],2)}const Am=Ae(j$,[["render",H$]]),U$={data(){return{isOpen:!1}},methods:{toggleCollapsible(){this.isOpen=!this.isOpen}}},V$={key:0};function z$(t,e,n,r,i,s){const o=ha("auto-animate");return Ye((S(),C("div",null,[x("div",{tabindex:"0",onClick:e[0]||(e[0]=(...a)=>s.toggleCollapsible&&s.toggleCollapsible(...a))},[Tt(t.$slots,"title")]),i.isOpen?(S(),C("div",V$,[Tt(t.$slots,"content")])):P("",!0)])),[[o,{duration:160}]])}const Nw=Ae(U$,[["render",z$]]),W$={components:{SpmJsonToList:Am,SpmLoader:xn,SpmCollapsible:Nw},props:{ticket:{type:Object,required:!0}},data(){return{disabledShopifySidebars:[],shopifySidebar:null,shopifySidebarTitle:"",shopifySidebarLoader:!1,showShopifySidebar:!0,cancelTokenSource:null}},watch:{ticket(t,e){t&&e&&t.id==e.id||(this.cancelTokenSource&&(this.cancelTokenSource.cancel(),this.cancelTokenSource=null),this.shopifySidebar=null,this.shopifySidebarLoader=!0,this.loadShopifySidebar())}},methods:{loadShopifySidebar:Qt(function(){if(this.ticket.id){if(this.disabledShopifySidebars.includes(this.ticket.channel.i
50d)){this.shopifySidebarLoader=!1;return}this.shopifySidebarLoader=!0,this.$emit("shopify-loader",!0),this.cancelTokenSource=axios.CancelToken.source(),axios.get("/tickets/"+this.ticket.id+"/shopify/"+this.ticket.channel.id,{cancelToken:this.cancelTokenSource.token}).then(t=>{var n;if(((n=t.data)==null?void 0:n.disabled)==!0){this.disabledShopifySidebars.push(this.ticket.channel.id);return}let e=this.disabledShopifySidebars.indexOf(this.ticket.channel.id);e!==-1&&this.disabledShopifySidebars.splice(e,1),this.$emit("shopify-enabled",!0),this.shopifySidebar=t.data,this.shopifySidebarTitle=t.data.title}).catch(t=>{t.response&&t.response.status==422&&(this.customSidebar=t.response.data),this.$emit("shopify-hit",!1)}).finally(()=>{this.shopifySidebarLoader=!1,this.$emit("shopify-loader",!1),this.shopifySidebar&&this.shopifySidebar.json?this.$emit("shopify-hit",!0):this.$emit("shopify-hit",!1)})}},1e3)}},K$={class:"w-full my-2 min-h-18"},q$={class:"w-full"},G$={class:"flex flex-grow spm-ticket-sidebar-head"},Y$={key:0,class:"relative flex-wrap w-full py-2 3xl:mr-2"},X$={key:1,class:"w-full mt-4"},J$={class:"flex-grow spm-ticket-sidebar-head"},Q$={class:"font-medium"},Z$={class:"flex w-full text-left cursor-pointer"},eD={class:"flex-grow"},tD={class:"flex font-bold text-sm text-primary-500"},nD=["href","title","innerHTML"],rD={class:"flex text-xs font-medium mt-1"},iD={class:"ml-auto"},sD={class:"flex items-center flex-grow spm-ticket-sidebar-head mt-6"},oD=["innerHTML"],aD={class:"flex items-center flex-grow spm-ticket-sidebar-head mt-6"},lD=["innerHTML"],cD={class:"flex-grow"},uD={class:"text-xs"},dD={class:"font-medium"},fD={class:"text-xs"},hD={key:3,class:"text-center text-sm font-medium mt-6 mb-6"};function pD(t,e,n,r,i,s){const o=z("spm-loader"),a=z("spm-json-to-list"),l=z("spm-collapsible");return S(),C("div",K$,[x("div",q$,[x("h3",G$,[e[0]||(e[0]=Me(" Shopify ",-1)),i.shopifySidebarLoader?(S(),re(o,{key:0,class:"ml-auto",size:"4","show-instant":""})):P("",!0)])]),n.ticket&&i.shopifySidebar&&!i.shopifySidebarLoader&&i.shopifySidebar.json&&i.shopifySidebar.json.customer?(S(),C("div",Y$,[X(a,{json:i.shopifySidebar.json.customer,"hidden-keys":["orders_count"]},null,8,["json"])])):P("",!0),i.shopifySidebar&&!i.shopifySidebarLoader&&i.shopifySidebar.json&&i.shopifySidebar.json.customer?(S(),C("div",X$,[x("h3",J$,[Me(L(t.$trans.get("Orders"))+" ",1),x("span",Q$,"("+L(i.shopifySidebar.json.customer.orders_count)+")",1)])])):P("",!0),i.shopifySidebar&&!i.shopifySidebarLoader&&i.shopifySidebar.json&&i.shopifySidebar.json.orders?(S(!0),C(Fe,{key:2},nt(i.shopifySidebar.json.orders,c=>(S(),C("div",{key:c.id,class:K(["rounded-lg shadow bg-gray-50 border-gray-200 border-l-2 p-3 text-sm mt-3",c.closed_at?"border-l-gray-600":"border-l-green-600"])},[X(l,null,{title:Y(()=>[x("div",Z$,[x("div",eD,[x("div",tD,[Me(L(c.name)+" ",1),x("a",{href:`${i.shopifySidebar.json.url}/admin/orders/${c.id}`,target:"_blank",class:"text-xs font-medium text-gray-600 ml-auto",title:t.$trans.get("View Order in Shopify"),innerHTML:t.svg("feather-external-link","stroke-icon h-4 w-4")},null,8,nD)]),x("div",rD,[Me(L(t.$filters.date(c.created_at))+" ",1),x("span",iD,L(c.total_price)+" "+L(c.currency),1)])])])]),content:Y(()=>[x("h3",sD,[x("span",{class:"h-4",innerHTML:t.svg("feather-truck","stroke-icon w-4 h-4 mr-[6px]")},null,8,oD),x("span",null,L(t.$trans.get("Shipping")),1)]),n.ticket&&i.shopifySidebar?(S(),re(a,{key:0,json:c.fulfillments,"hidden-keys":["id"],class:""},null,8,["json"])):P("",!0),x("h3",aD,[x("span",{innerHTML:t.svg("feather-package","stroke-icon w-4 h-4 mr-[6px]")},null,8,lD),x("span",cD,L(t.$trans.get("Products"))+" ("+L(c.line_items.length)+")",1)]),(S(!0),C(Fe,null,nt(c.line_items,u=>(S(),C("div",{key:u.id,class:"mt-3 pl-2"},[x("div",uD,"#"+L(u.product_id),1),x("div",dD,L(u.quantity)+"x "+L(u.name),1),x("div",fD,L(u.price)+" "+L(c.currency),1)]))),128))]),_:2},1024)],2))),128)):P("",!0),i.shopifySidebarLoader==!1&&!i.shopifySidebar||i.shopifySidebarLoader==!1&&i.shopifySidebar.json.length<=0?(S(),C("div",hD,L(t.$trans.get("No results!")),1)):P("",!0)])}const mD=Ae(W$,[["render",pD]]),gD={components:{SpmJsonToList:Am,SpmLoader:xn,SpmCollapsible:Nw},props:{ticket:{type:Object,required:!0}},data(){return{disabledXentralSidebars:[],xentralSidebar:null,xentralSidebarTitle:"",xentralSidebarLoader:!1,showXentralSidebar:!0,
50cancelTokenSource:null}},watch:{ticket(t,e){t&&e&&t.id==e.id||(this.cancelTokenSource&&(this.cancelTokenSource.cancel(),this.cancelTokenSource=null),this.xentralSidebar=null,this.xentralSidebarLoader=!0,this.loadXentralSidebar())}},methods:{loadXentralSidebar:Qt(function(){if(this.ticket.id){if(this.disabledXentralSidebars.includes(this.ticket.channel.id)){this.xentralSidebarLoader=!1;return}this.xentralSidebarLoader=!0,this.$emit("xentral-loader",!0),this.cancelTokenSource=axios.CancelToken.source(),axios.get("/tickets/"+this.ticket.id+"/xentral/"+this.ticket.channel.id,{cancelToken:this.cancelTokenSource.token}).then(t=>{var n;if(((n=t.data)==null?void 0:n.disabled)==!0){this.disabledXentralSidebars.push(this.ticket.channel.id);return}let e=this.disabledXentralSidebars.indexOf(this.ticket.channel.id);e!==-1&&this.disabledXentralSidebars.splice(e,1),this.$emit("xentral-enabled",!0),this.xentralSidebar=t.data,this.xentralSidebarTitle=t.data.title}).catch(t=>{t.response&&t.response.status==422&&(this.customSidebar=t.response.data),this.$emit("xentral-hit",!1)}).finally(()=>{this.xentralSidebarLoader=!1,this.$emit("xentral-loader",!1),this.xentralSidebar&&this.xentralSidebar.json?this.$emit("xentral-hit",!0):this.$emit("xentral-hit",!1)})}},1e3)}},vD={class:"w-full my-2 min-h-18"},yD={class:"w-full"},bD={class:"flex flex-grow spm-ticket-sidebar-head"},kD={key:0,class:"relative flex-wrap w-full py-2 3xl:mr-2"},wD={key:1,class:"w-full mt-4"},xD={class:"flex-grow spm-ticket-sidebar-head"},SD={class:"font-medium"},TD={class:"flex w-full text-left cursor-pointer"},_D={class:"flex-grow"},ED={class:"flex font-bold text-sm text-primary-500"},CD=["href","title","innerHTML"],OD={class:"flex text-xs font-medium mt-1"},AD={class:"ml-auto"},MD={class:"flex items-center flex-grow spm-ticket-sidebar-head mt-6"},ID=["innerHTML"],LD={class:"flex items-center flex-grow spm-ticket-sidebar-head mt-6"},PD=["innerHTML"],RD={class:"flex-grow"},$D={class:"text-xs"},DD={class:"font-medium"},ND={class:"text-xs"},FD={key:3,class:"text-center text-sm font-medium mt-6 mb-6"};function jD(t,e,n,r,i,s){const o=z("spm-loader"),a=z("spm-json-to-list"),l=z("spm-collapsible");return S(),C("div",vD,[x("div",yD,[x("h3",bD,[e[0]||(e[0]=Me(" Xentral ",-1)),i.xentralSidebarLoader?(S(),re(o,{key:0,class:"ml-auto",size:"4","show-instant":""})):P("",!0)])]),n.ticket&&i.xentralSidebar&&!i.xentralSidebarLoader&&i.xentralSidebar.json&&i.xentralSidebar.json.id?(S(),C("div",kD,[X(a,{json:i.xentralSidebar.json.general,"hidden-keys":["fax","subdivision","vatNumber","taxNumber","gln","birthday","employeeNumber"]},null,8,["json"])])):P("",!0),i.xentralSidebar&&i.xentralSidebar.json&&i.xentralSidebar.json.orders&&!i.xentralSidebarLoader&&i.xentralSidebar.json.id?(S(),C("div",wD,[x("h3",xD,[Me(L(t.$trans.get("Orders"))+" ",1),x("span",SD,"("+L(i.xentralSidebar.json.orders_count)+")",1)])])):P("",!0),i.xentralSidebar&&!i.xentralSidebarLoader&&i.xentralSidebar.json&&i.xentralSidebar.json.orders?(S(!0),C(Fe,{key:2},nt(i.xentralSidebar.json.orders,c=>(S(),C("div",{key:c.id,class:K(["rounded-lg shadow bg-gray-50 border-gray-200 border-l-2 p-3 text-sm mt-3",c.closed_at?"border-l-gray-600":"border-l-green-600"])},[X(l,null,{title:Y(()=>[x("div",TD,[x("div",_D,[x("div",ED,[Me(L(c.name)+" ",1),x("a",{href:`${i.xentralSidebar.json.url}/admin/orders/${c.id}`,target:"_blank",class:"text-xs font-medium text-gray-600 ml-auto",title:t.$trans.get("View Order in Xentral"),innerHTML:t.svg("feather-external-link","stroke-icon h-4 w-4")},null,8,CD)]),x("div",OD,[Me(L(t.$filters.date(c.created_at))+" ",1),x("span",AD,L(c.total_price)+" "+L(c.currency),1)])])])]),content:Y(()=>[x("h3",MD,[x("span",{class:"h-4",innerHTML:t.svg("feather-truck","stroke-icon w-4 h-4 mr-[6px]")},null,8,ID),x("span",null,L(t.$trans.get("Shipping")),1)]),n.ticket&&i.xentralSidebar?(S(),re(a,{key:0,json:c.fulfillments,"hidden-keys":["id"],class:""},null,8,["json"])):P("",!0),x("h3",LD,[x("span",{innerHTML:t.svg("feather-package","stroke-icon w-4 h-4 mr-[6px]")},null,8,PD),x("span",RD,L(t.$trans.get("Products"))+" ("+L(c.line_items.length)+")",1)]),(S(!0),C(Fe,null,nt(c.line_items,u=>(S(),C("div",{key:u.id,class:"mt-3 pl-2"},[x("div",$D,"#"+L(u.product_id),1),x("div",DD,L(u.quantity)+"x "+L(u.name),1),x("div",ND,L(u.price)+" "+L(c.currency),1)]))),128))]),_:2},1024)],2))),128)):P("",!0),i.xentralSidebarLoader==!1&&!i.xentralSidebar||i.xentralSidebarLoader==!1&&!i.xentralSidebar.json.id?(S(),C("div",FD,L(t.$trans.get("No results!")),1
50)):P("",!0)])}const BD=Ae(gD,[["render",jD]]);var HD=cm;function UD(t,e){var n=[];return HD(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}var VD=UD,zD=pk,WD=VD,KD=Xl,qD=lo;function GD(t,e){var n=qD(t)?zD:WD;return n(t,KD(e))}var YD=GD;const Fw=wn(YD),XD={props:{value:{type:String,default:null},tooltip:{type:String,default:null},placement:{type:String,default:"bottom"},tag:{type:String,default:"span"},flashMessage:{type:String,default:"Copied to clipboard!"},delay:{type:Array,default:null}},mounted(){this.tooltip!=null&&(this.tippy=this.$tippy(this.$refs.tippy,{content:this.tooltip,placement:this.placement,delay:this.delay}))},updated(){this.tippy&&this.tooltip!==null&&(this.tippy.setContent(this.tooltip),this.tippy.setProps({content:this.tooltip,placement:this.placement,delay:this.delay}))},methods:{copyToClipboard(){navigator.clipboard.writeText(this.value).then(()=>{this.flashMessage&&this.$notify.success(this.flashMessage)},()=>{this.$notify.error("Could not copy to clipboard!")})}}};function JD(t,e,n,r,i,s){return S(),re(kr(n.tag),{ref:"tippy",class:K(["cursor-copy",n.tooltip?{"button-tooltip":n.tooltip}:""]),onClick:e[0]||(e[0]=o=>s.copyToClipboard())},{default:Y(()=>[Tt(t.$slots,"default")],void 0,!0),_:3},8,["class"])}const jw=Ae(XD,[["render",JD]]),QD={components:{FvlForm:Jl,FvlImage:JC,SpmLoader:xn},props:{url:{type:String,default:""},imgUrl:{type:String,default:""},method:{type:String,default:"post"},size:{type:Number,default:10},sizeIcon:{type:Number,default:5},allowDelete:{type:Boolean,default:!1}},data(){return{formAvatar:{avatar:""},avatarImage:{isLoading:!1,uploaded:!1,uploadProgressValue:null}}},computed:{hasUploadedAvatar(){return typeof this.imgUrl=="string"&&this.imgUrl.includes("media/avatar")},deleteUsesAvatarEndpoint(){return typeof this.url=="string"&&this.url.includes("/avatar")}},watch:{imgUrl:{handler:function(t){this.formAvatar.avatar=t},immediate:!0}},methods:{avatarImageUploadProgress(t){this.avatarImage.uploadProgressValue=t},removeAvatar(){!this.allowDelete||!this.deleteUsesAvatarEndpoint||!this.hasUploadedAvatar||(this.avatarImage.isLoading=!0,ze.delete(this.url).then(t=>{this.formAvatar.avatar="",this.$emit("success",t)}).finally(()=>{this.avatarImage.isLoading=!1}))}}},ZD={class:"inline-flex"},eN=["onClick"],tN=["src"],nN=["src"],rN={class:"w-full h-full absolute inset-0 flex"},iN=["innerHTML"],sN=["title","aria-label","innerHTML"],oN=["onClick"];function aN(t,e,n,r,i,s){const o=z("spm-loader"),a=z("fvl-image"),l=z("fvl-form");return S(),C("div",ZD,[X(l,{ref:"formAvatar",data:i.formAvatar,url:n.url,autocomplete:"off",class:"inline-flex",method:n.method,multipart:"",onSuccess:e[4]||(e[4]=c=>t.$emit("success",c)),onRequestfinished:e[5]||(e[5]=c=>i.avatarImage.isLoading=!1),onRequeststarted:e[6]||(e[6]=c=>i.avatarImage.isLoading=!0),onUploadProgress:s.avatarImageUploadProgress},{default:Y(()=>[X(a,{label:"",name:"avatar","field-class":"display-none","show-file-name":!1,class:"p-0",modelValue:i.formAvatar.avatar,"onUpdate:modelValue":e[1]||(e[1]=c=>i.formAvatar.avatar=c),onProgressstarted:e[2]||(e[2]=c=>i.avatarImage.isLoading=!0),onChanged:e[3]||(e[3]=c=>{i.avatarImage.uploaded=!1,i.avatarImage.isLoading=!0,t.$refs.formAvatar.submit()})},{preview:Y(({preview:c,selectImage:u})=>[x("div",{class:K(["spm-avatar-uploader-wrapper-image flex rounded-lg avatar bg-gray-400 cursor-pointer relative","h-"+n.size+" w-"+n.size]),onClick:d=>u()},[c.src?(S(),C("img",{key:0,class:K(["h-full w-full object-cover avatar",{"opacity-50":i.avatarImage.isLoading}]),src:c.src},null,10,tN)):(S(),C("img",{key:1,class:K(["h-full w-full object-cover avatar",{"opacity-50":i.avatarImage.isLoading}]),src:n.imgUrl},null,10,nN)),x("div",rN,[i.avatarImage.isLoading?(S(),re(o,{key:0,"show-instant":"",class:"mx-auto self-center"})):P("",!0)]),x("div",{class:"spm-avatar-uploader-wrapper-overlay w-full h-full absolute inset-0 flex rounded-lg spm-mask-squircle opacity-75 bg-primary-900",innerHTML:t.svg("feather-camera","h-"+n.sizeIcon+" w-"+n.sizeIcon+" stroke-icon text-gray-100 mx-auto self-center")},null,8,iN),n.allowDelete&&s.hasUploadedAvatar&&!i.avatarImage.isLoading?(S(),C("button",{key:2,type:"button",class:"spm-avatar-delete-btn bg-gray-100 shadow-lg absolute top-0 right-0 -mr-4 -mt-4 z-20 flex rounded-md p-1 text-gray-600 transition-colors hover:text-red-600 focus:outline-none",title:t.$trans.get("Remove profile photo"),"aria-label":t.$trans.get("Remove profile photo"),onClick:e[0]||(e[0]=ct((...d)=>s.removeAvatar&&s.removeAvatar(...d),["stop","prevent"])),innerHTML:t.svg("feather-trash-2","stroke-icon h-4 w-4 pointer-events-none")},null,8,sN)):P("",!0)],10,eN)]),"button-wrapper":Y(({selectImage:c})=>[x("span",{onClick:u=>c()},null,8,oN)]),_:1},8,["modelValue"])],void 0,!0),_:1},8,["data","url","method","onUploadProgress"])])}const lN=Ae(QD,[["render",aN]]);function cN(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}var uN=cN,Zv=_C;function dN(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,s=Zv(t),o=e!==void 0,a=e===null,l=e===e,c=Zv(e);if(!a&&!c&&!s&&t>e||s&&o&&l&&!a&&!c||r&&o&&l||!n&&l||!i)return 1;if(!r&&!s&&!c&&t<e||c&&n&&i&&!r&&!s||a&&n&&i||!o&&i||!l)return-1}return 0}var fN=dN,hN=fN;function pN(t,e,n){for(var r=-1,i=t.criteria,s=e.criteria,o=i.length,a=n.length;++r<o;){var l=hN(i[r],s[r]);if(l){if(r>=a)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var mN=pN,vf=om,gN=EC,vN=Xl,yN=Pw,bN=uN,kN=ik,wN=mN,xN=sm,SN=lo;function TN(t,e,n){e.length?e=vf(e,function(s){return SN(s)?function(o){return gN(o,s.length===1?s[0]:s)}:s}):e=[xN];var r=-1;e=vf(e,kN(vN));var i=yN(t,function(s,o,a){var l=vf(e,function(c){return c(s)});return{criteria:l,index:++r,value:s}});return bN(i,function(s,o){return wN(s,o,n)})}var _N=TN,EN=_N,ey=lo;function CN(t,e,n,r){return t==null?[]:(ey(e)||(e=e==null?[]:[e]),n=r?void 0:n,ey(n)||(n=n==null?[]:[n]),EN(t,e,n))}var ON=CN;const AN=wn(ON),MN={components:{TextHighlight:pa},props:{data:{type:Object,default:()=>{}},queries:{type:Array,default:()=>[]}}},IN={class:"flex-grow"},LN={class:"flex items-center mb-1"},PN={class:"w-9 shrink-0 text-gray-600"},RN=["innerHTML"],$N={class:"mb-px"},DN={class:"flex-grow text-base font-medium text-gray-700"},NN={class:"text-gray-650 text-sm flex items-center"},FN={class:"mr-1 text-gray-600"},jN=["title"],BN={class:"spm-ticket-list-name truncate w-auto text-sm text-gray-600 py-1 ml-2"};function HN(t,e,n,r,i,s){const o=z("text-highlight");return S(),C("div",IN,[x("div",LN,[x("div",PN,[x("span",{innerHTML:t.svg("feather-mail","stroke-icon h-5 w-5")},null,8,RN)]),x("div",null,[x("div",$N,[x("h4",DN,[x("span",NN,[x("span",FN,"#"+L(n.data.id),1),x("span",{title:t.$trans.get(n.data.status),class:K("w-[6px] h-[6px] mx-1 mr-2 priority ring-2 ring-white inline-block rounded-full status-bg-"+n.data.status)},null,10,jN),X(o,{class:"truncate","highlight-class":"docs-search-hit",queries:n.queries},{default:Y(()=>[Me(L(n.data.subject),1)],void 0,!0),_:1},8,["queries"]),X(o,{class:"ml-1 font-normal truncate","highlight-class":"docs-search-hit",queries:n.queries},{default:Y(()=>[Me(" - "+L(n.data.contact.name),1)],void 0,!0),_:1},8,["queries"]),x("div",BN,L(t.$filters.distanceInWordsToNow(n.data.last_contact)),1)])]),e[0]||(e[0]=x("div",{class:"flex"},null,-1))]),X(o,{class:"text-sm font-medium text-gray-700","highlight-class":"docs-search-hit",queries:n.queries},{default:Y(()=>[Me(L(n.data.latest_message_excerpt),1)],void 0,!0),_:1},8,["queries"])])])])}const Bw=Ae(MN,[["render",HN]]),UN={components:{TextHighlight:pa},props:{data:{type:Object,default:()=>{}},queries:{type:Array,default:()=>[]}}},VN={class:"flex-grow"},zN={class:"flex items-center"},WN={class:"w-9 shrink-0 text-gray-600"},KN=["innerHTML"],qN={class:"flex-grow text-sm font-medium text-gray-700"},GN={class:"flex items-center w-full mb-1 text-gray-650"},YN=["innerHTML"],XN={key:0},JN=["innerHTML"];function QN(t,e,n,r,i,s){const o=z("text-highlight");return S(),C("div",VN,[x("div",zN,[x("div",WN,[x("span",{innerHTML:t.svg("feather-file-text","stroke-icon h-5 w-5")},null,8,KN)]),x("h4",qN,[x("small",GN,[Me(L(n.data.site_name)+" ",1),x("span",{innerHTML:t.svg("feather-chevron-right","stroke-icon h-3 w-3 mx-px")},null,8,YN),n.data.locale?(S(),C("span",XN,L(n.data.locale.toUpperCase()),1)):P("",!0),n.data.locale?(S(),C("span",{key:1,innerHTML:t.svg("feather-chevron-right","stroke-icon h-3 w-3 mx-px")},null,8,JN)):P("",!0),Me(" "+L(n.data.category),1)]),X(o,{"highlight-class":"docs-search-hit",queries:n.queries},{default:Y(()=>[Me(L(n.data.title),1)],void 0,!0),_:1},8,["queries"]),n.data.subtitle?(S(),re(o,{key:0,class:"block text-sm text-gray-600 font-light","highlight-class":"docs-search-hit",queries:n.queries},{default:Y(()=>
50[Me(L(n.data.subtitle),1)],void 0,!0),_:1},8,["queries"])):P("",!0)])])])}const Hw=Ae(UN,[["render",QN]]),ZN={components:{TextHighlight:pa},props:{data:{type:Object,default:()=>{}},queries:{type:Array,default:()=>[]}}},e2={class:"flex-grow"},t2={class:"flex items-center mb-1"},n2={class:"flex-grow text-sm font-medium text-gray-700"},r2={class:"flex items-center w-full mb-1 text-gray-650"},i2=["innerHTML"],s2={key:1};function o2(t,e,n,r,i,s){const o=z("text-highlight");return S(),C("div",e2,[x("div",t2,[x("h4",n2,[x("small",r2,[Me(L(n.data.board_name)+" ",1),n.data.board_name?(S(),C("span",{key:0,innerHTML:t.svg("feather-chevron-right","stroke-icon h-3 w-3 mx-px")},null,8,i2)):(S(),C("span",s2,"Task #")),Me(" "+L(n.data.number),1)]),X(o,{"highlight-class":"docs-search-hit",queries:n.queries},{default:Y(()=>[Me(L(n.data.title),1)],void 0,!0),_:1},8,["queries"])])])])}const Uw=Ae(ZN,[["render",o2]]),a2={components:{SpmLoader:xn,OnClickOutside:VC,TextHighlight:pa,SpmTooltip:rr,Ticket:Bw,Article:Hw,Task:Uw},props:{label:{type:String,default:null},options:{type:Array,default:()=>[]},placeholder:{type:String,required:!1,default:"Search"},fieldClass:{type:String,required:!1,default:null},fieldStyle:{type:Object,required:!1,default:null},labelClass:{type:String,required:!1,default:""},context:{type:String,required:!1,default:""},slim:{type:Boolean,required:!1,default:!1},loaderColor:{type:String,required:!1,default:"white"},loaderClass:{type:String,required:!1,default:"mr-4 mt-5"},loaderSize:{type:String,required:!1,default:"6"},searchSections:{type:Array,default:()=>["tickets","articles","tasks","customers"]},initialFocus:{type:Boolean,default:!1},withoutRelatedTicketsOfTask:{type:Number,default:null},disabled:{type:Boolean,default:!1},dropdownBelow:{type:Boolean,default:!1},withoutArticlesOfTask:{type:Number,default:null},withoutTasksOfArticle:{type:Number,default:null},withoutTasksOfTicket:{type:Number,default:null},canSelectWithoutClose:{type:Boolean,default:!1},createOnEnter:{type:Boolean,default:!1}},data(){return{isOpen:!1,requestSequence:0,isDisposed:!1,query:null,highlightedIndex:-1,isLoading:!0,searchResults:[],searchResultsHits:0,searchFailed:!1,selected:[],dropdownMaxHeight:512,dropdownOpensAbove:!1}},computed:{queries(){return this.query?this.query.split(" "):[]},mergedResults(){return this.searchResults.length?this.searchResults.map(t=>{const e=t.results;return Array.isArray(e)?e:(e==null?void 0:e.data)??[]}).flat().filter(t=>!this.selected.includes(t.id)):[]},highlightedItem(){return this.mergedResults[this.highlightedIndex]}},mounted(){this.initialFocus&&this.focusInput(),this.onViewportChange=()=>{this.isOpen&&this.updateDropdownMaxHeight()},window.addEventListener("resize",this.onViewportChange),window.addEventListener("scroll",this.onViewportChange,!0)},beforeUnmount(){this.isDisposed=!0,this.requestSequence++,window.removeEventListener("resize",this.onViewportChange),window.removeEventListener("scroll",this.onViewportChange,!0),this.popper!==void 0&&this.popper.destroy()},methods:{focusInput(){this.$refs.searchinput.focus()},triggerSearch(){if(this.requestSequence++,this.searchFailed=!1,this.open(),!this.query){this.isLoading=!1;return}this.isLoading=!0,this.searchResults=[],this.search()},search:Qt(function(){if(this.isDisposed||this.disabled)return;if(!this.query){this.isLoading=!1,this.highlightedIndex=-1,this.searchResults=[],this.searchResultsHits=0;return}this.isLoading=!0,this.highlightedIndex=-1;const t=this.requestSequence,e=this.query;let n="/global/search";const r={sections:this.searchSections,text:this.query};return this.withoutRelatedTicketsOfTask&&(r.withoutTicketsOfTask=this.withoutRelatedTicketsOfTask),this.withoutArticlesOfTask&&(r.withoutArticlesOfTask=this.withoutArticlesOfTask),this.withoutTasksOfArticle&&(r.withoutTasksOfArticle=this.withoutTasksOfArticle),this.withoutTasksOfTicket&&(r.withoutTasksOfTicket=this.withoutTasksOfTicket),ze.post(n,r).then(i=>{this.isDisposed||t!==this.requestSequence||e!==this.query||(this.searchResults=i.data.data,this.searchResultsHits=i.data.hits)}).catch(()=>{!this.isDisposed&&t===this.requestSequence&&e===this.query&&(this.searchFailed=!0)}).finally(()=>{this.isDisposed||t!==this.requestSequence||e!==this.query||(this.isLoading=!1,this.$nextTick(()=>{this.updateDropdownMaxHeight()}))})},500),selectHighlighted(){if(this.highlightedItem){this.select(this.highlightedItem);return}this.createOnEnter&&this.query&&(this.$emit("create",this.query),this.close())},open(){this.disabled||this.isOpen||(this.isOpen=!0,this.$nextTick(()=>{this.highlightedIndex=-1,this.updateDropdownMaxHeight()}))},close(){this.isOpen&&(this.isOpen=!1,setTimeout(()=>{this.selected=[],this.query=null},150))},select(t){this.disabled||(this.close(),this.$emit("select",t),this.query=null)},selectWithoutClose(t){this.$emit("select",t),setTimeout(()=>{this.selected.push(t.id),this.mergedResults.length===0&&this.close()},150)},optionClicked(t,e){t=="insert-link"&&(this.$emit("option-clicked",{action:"insert-link",article:e}),this.close())}
50,toggle(){this.disabled||this.readonly||(this.isOpen?this.close():this.open())},highlightNext(){this.highlightedIndex=this.highlightedIndex==this.mergedResults.length-1?this.mergedResults.length-1:this.highlightedIndex+1,this.$nextTick(()=>{this.scrollHighlightedIntoView()})},highlightPrevious(){this.highlightedIndex=this.highlightedIndex==0?0:this.highlightedIndex-1,this.$nextTick(()=>{this.scrollHighlightedIntoView()})},scrollHighlightedIntoView(){var i;const t=this.$refs.resultsContainer,e=(i=this.$refs.resultitem)==null?void 0:i[this.highlightedIndex];if(!t||!e)return;const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();r.top<n.top?t.scrollTop-=n.top-r.top:r.bottom>n.bottom&&(t.scrollTop+=r.bottom-n.bottom)},updateDropdownMaxHeight(){const t=this.$refs.searchinput;if(!t)return;const e=16,n=512,r=120,i=t.getBoundingClientRect(),s=window.innerHeight-i.bottom-e,o=i.top-e;!this.dropdownBelow&&s<180&&o>s?(this.dropdownOpensAbove=!0,this.dropdownMaxHeight=Math.max(r,Math.min(n,o))):(this.dropdownOpensAbove=!1,this.dropdownMaxHeight=Math.max(r,Math.min(n,s)))}}},l2=["placeholder","disabled"],c2={key:1,role:"alert",class:"text-sm text-gray-700 mt-2"},u2=["onClick"],d2=["onClick"],f2=["innerHTML"];function h2(t,e,n,r,i,s){const o=z("spm-loader"),a=z("on-click-outside");return S(),re(a,{onDo:e[8]||(e[8]=l=>(s.close(),t.$emit("click-outside")))},{default:Y(()=>[x("div",{class:K(["relative",{"search-dropdown-is-open":i.isOpen}])},[Tt(t.$slots,"icon"),Ye(x("input",{ref:"searchinput","onUpdate:modelValue":e[0]||(e[0]=l=>i.query=l),name:"Search",class:K([n.fieldClass]),style:Ir(n.fieldStyle),type:"text",placeholder:t.$trans.get(n.placeholder),autocomplete:"off",disabled:n.disabled,onClick:e[1]||(e[1]=ct(l=>s.open(),["prevent"])),onKeydown:[e[2]||(e[2]=Lt(ct(l=>{t.$emit("esc"),s.close()},["prevent","stop"]),["esc"])),e[3]||(e[3]=Lt(ct(()=>{},["prevent"]),["tab"])),e[5]||(e[5]=Lt(ct((...l)=>s.highlightNext&&s.highlightNext(...l),["prevent"]),["down"])),e[6]||(e[6]=Lt(ct((...l)=>s.highlightPrevious&&s.highlightPrevious(...l),["prevent"]),["up"])),e[7]||(e[7]=Lt(ct((...l)=>s.selectHighlighted&&s.selectHighlighted(...l),["prevent"]),["enter"]))],onInput:e[4]||(e[4]=(...l)=>s.triggerSearch&&s.triggerSearch(...l))},null,46,l2),[[ls,i.query,void 0,{trim:!0}]]),i.isLoading&&i.query?(S(),re(o,{key:0,class:K(["absolute right-0 top-0 mt-[12px] mr-4 self-center",n.loaderClass]),color:n.loaderColor,size:n.loaderSize,"show-instant":""},null,8,["class","color","size"])):P("",!0),i.searchFailed&&i.query?(S(),C("div",c2,L(t.$trans.get("There was an error, please check your connection.")),1)):P("",!0),X(Ii,{name:"fvl-dropdown-transition"},{default:Y(()=>[Ye(x("div",{ref:"resultsContainer",class:K(["absolute left-0 w-full overflow-y-auto bg-white rounded-lg border-2 shadow-xl border-gray-500 z-50",[n.slim?"p-2":"p-4",i.dropdownOpensAbove?"bottom-full mb-px":"top-full mt-px"]]),style:Ir({maxHeight:`${i.dropdownMaxHeight}px`})},[(S(!0),C(Fe,null,nt(s.mergedResults,(l,c)=>(S(),C("button",{ref_for:!0,ref:"resultitem",key:l.id,class:K(["w-full flex text-left rounded-lg hover:bg-gray-100 cursor-pointer",[n.slim?"px-2 py-3":"p-4",{"bg-gray-100":c===i.highlightedIndex}]]),style:{"word-break":"break-word"},onClick:u=>s.select(l)},[Tt(t.$slots,"result",{result:l},()=>[(S(),re(kr(l.search_type),{data:l,queries:s.queries},null,8,["data","queries"]))]),n.canSelectWithoutClose?(S(),C("div",{key:0,class:"px-2 py-4 self-center justify-center items-center",onClick:ct(u=>s.selectWithoutClose(l),["stop","prevent"])},[x("span",{innerHTML:t.svg("feather-link-2","stroke-icon h-4")},null,8,f2)],8,d2)):P("",!0)],10,u2))),128))],6),[[wt,i.isOpen&&i.query&&s.mergedResults.length!==0]])],void 0,!0),_:3})],2)],void 0,!0),_:3})}const p2=Ae(a2,[["render",h2]]),m2={components:{SpmTooltip:rr,SpmCheckbox:Em},props:{task:{type:Object,required:!0},compact:{type:Boolean,default:!1}}},g2={key:0,class:"flex-shrink pl-px pr-3"},v2={key:0,class:"ml-1"};function y2(t,e,n,r,i,s){const o=z("spm-checkbox"),a=z("spm-tooltip");return S(),C("div",null,[n.task.scrum_board_status_id?(S(),re(a,{key:1,tooltip:n.compact?n.task.status.name:null,placement:"top",class:"flex items-center flex-shrink text-xs rounded-md text-gray-800 bg-gray-300 font-bold px-2 h-6 p-1 mr-3"},{default:Y(()=>[x("span",{class:"rounded-full h-[8px] w-[8px] bg-gray-500",style:Ir({"background-color":n.task.status.color})},null,4),n.compact?P("",!0):(S(),C("span",v2,L(n.task.status.name),1))],void 0,!0),_:1},8,["tooltip"])):(S(),C("div",g2,[X(o,{ref:"checkbox","model-value":!!n.task.done_at,"class-checkbox":"rounded-md border bg-white border-gray-400 items-center justify-center h-6 w-6 shadow flex","onUpdate:modelValue":e[0]||(e[0]=l=>t.$store.dispatch("taskToggleDone",n.task))},null,8,["model-value"])]))])}const Mm=Ae(m2,[["render",y2]]),b2={components:{SpmGlobalSearchInput:p2,SpmLoader:xn,SpmTaskStatus:Mm,SpmTooltip:rr},props:{taskableId:{type:Number,required:!0},canManage:{type:Boolean,default:!0},taskableType:{type:String,required:!0}},data(){return{taskListIsLoading:!0,taskList:[],loadFailed:!1,isSaving:!1,requestSequence:0,targetGeneration:0,isDisposed:!1}},computed:{targetKey(){return`${this.taskableType}:${this.taskableId}`},targetUrl(){const t={ticket:"/tickets",article:"/app/docs/articles"}[this.taskableType];return t?`${t}/${this.taskableId}`:null},taskListOrdered(){return AN(this.taskList,["done_at","due_at","created_at"],["desc","asc","desc"])}},watch:{targetKey(){this.targetGeneration++,this.isSaving=!1,this.getTaskListRequest()}},beforeUnmount(){var t,e;this.isDisposed=!0,this.$bus.off("taskables.tasks.reload",this.reloadTarget),this.$bus.off("tasks.updated",this.updateTaskInTaskList),(t=this.taskChannel)==null||t.stopListening(".TaskUpdated",this.onTaskUpdated),(e=this.taskChannel)==null||e.stopListening(".TaskDeleted",this.onTaskDeleted)},created(){this.$bus.on("taskables.tasks.reload",this.reloadTarget),this.$bus.on("tasks.updated",this.updateTaskInTaskList)},mounted(){this.getTaskListRequest(),this.taskChannel=window.Echo.private(this.$store.getters.user.workspace+".tasks"),this.taskChannel.listen(".TaskUpdated",this.onTaskUpdated).listen(".TaskDeleted",this.onTaskDeleted)},methods:{onTaskUpdated(t){this.updateTaskInTaskList(t.task)},onTaskDeleted(t){this.deleteTaskFromTaskList(t.task_id)},reloadTarget(t){(t==null?void 0:t.type)===this.taskableType&&Number(t.id)===this.taskableId&&this.getTaskListRequest()},isCurrentTarget(t,e){return!this.isDisposed&&t===this.targetKey&&e===this.targetGeneration},async saveTaskLink(t,e=!1,n=!1){if(!this.canManage||this.isSaving||!this.targetUrl)return;const r=this.targetKey,i=this.targetGeneration;this.isSaving=!0;try{const s=await t();if(!this.isCurrentTarget(r,i))return;if(this.requestSequence++,this.taskListIsLoading=!1,this.loadFailed=!1,e){const o=s.data.data;this.taskList.some(a=>a.id===o.id)||this.taskList.push(o)}else this.taskList=s.data.data;n&&this.$store.commit("hideFormModal")}catch{this.isCurrentTarget(r,i)&&this.$notify.error(this.$trans.get("There was an error, please check your connection."))}finally{this.isCurrentTarget(r,i)&&(this.isSaving=!1)}},deleteTaskFromTaskList(t){if(typeof t<"u"){const e=this.taskList.findIndex(n=>n.id===t);e>=0&&this.taskList.splice(e,1)}},editTask(t){this.$store.commit("showFormModal",{component:"tasks/modals/_edit-task.modal.vue",params:{task:t,updated:e=>{this.updateTaskInTaskList(e)},deleted:e=>{this.deleteTaskFromTaskList(e.id)}}})},toggleDone(t){const e=t.done_at;t.done_at=t.done_at?null:new Date().toISOString(),this.updateTaskInTaskList(t),this.updateDoneRequest
50(t,t.done_at).catch(()=>{t.done_at=e,this.updateTaskInTaskList(t),this.$notify.error(this.$trans.get("There was an error, please check your connection."))})},async updateDoneRequest(t,e){return axios.patch("/tasks/"+t.id,{done_at:e}).then(n=>(this.updateTaskInTaskList(n.data.data),n))},updateTaskInTaskList(t){if(typeof t=="object"&&typeof t.id<"u"){const e=this.taskList.findIndex(n=>n.id===t.id);e>=0&&(this.taskList[e]=t)}},attachTask(t){if(!(!(t!=null&&t.id)||this.taskList.some(e=>e.id===t.id)))return this.saveTaskLink(()=>axios.patch(`${this.targetUrl}/attach-tasks`,{tasks:[t.id]}))},createTaskFromQuery(t){if(t!=null&&t.trim())return this.saveTaskLink(()=>axios.post("/tasks",{taskable_id:this.taskableId,taskable_type:this.taskableType,title:t}),!0)},showTaskTemplatesUpgradeDialog(){this.$store.commit("showDialogModal",{title:this.$trans.get("Upgrade your plan."),text:this.$trans.get("Task templates are available on the Business plan. Please upgrade to access this feature."),buttons:[{title:this.$trans.get("View Subscription Plans"),class:"btn-primary-500 text-white",handler:()=>{this.$router.push({name:"subscription"}),this.$store.commit("hideDialogModal")}},{title:this.$trans.get("Cancel"),default:!0}]})},openTemplatePicker(){var n,r;if(!this.canManage||this.isSaving)return;const t=this.targetKey,e=this.targetGeneration;if(!((r=(n=this.$store.getters.customerInfo)==null?void 0:n.conditions)!=null&&r.taskTemplates)){this.showTaskTemplatesUpgradeDialog();return}this.$store.commit("showFormModal",{component:"tasks/modals/_template-picker.modal.vue",params:{modalWidth:"max-w-4xl",modalClass:"bg-gray-200",onSelect:i=>{if(this.isCurrentTarget(t,e))return this.createTaskFromTemplate(i)}}})},createTaskFromTemplate(t){return this.saveTaskLink(()=>axios.post(`/tasks/${t.id}/create-from-template`,{taskable_id:this.taskableId,taskable_type:this.taskableType}),!0,!0)},async getTaskListRequest(){const t=++this.requestSequence,e=this.targetKey,n=this.targetGeneration;this.taskList=[],this.taskListIsLoading=!0,this.loadFailed=!1;try{if(!this.targetUrl)throw new Error("Unsupported task target");const r=await axios.get(`${this.targetUrl}/tasks`);t===this.requestSequence&&this.isCurrentTarget(e,n)&&(this.taskList=r.data.data)}catch{t===this.requestSequence&&this.isCurrentTarget(e,n)&&(this.loadFailed=!0)}finally{t===this.requestSequence&&this.isCurrentTarget(e,n)&&(this.taskListIsLoading=!1)}}}},k2=["aria-label"],w2={class:"flex text-gray-600 pb-4 h-5"},x2={class:"flex-grow spm-ticket-sidebar-head"},S2=["innerHTML"],T2={key:0,class:"flex w-full py-2 items-center text-sm border-b overflow-hidden"},_2=["onClick"],E2=["src","onClick"],C2={key:1,role:"alert",class:"text-sm py-2"},O2=["aria-label","disabled","innerHTML"];function A2(t,e,n,r,i,s){const o=z("spm-loader"),a=z("spm-task-status"),l=z("spm-global-search-input"),c=z("spm-tooltip");return S(),C("section",{"aria-label":t.$trans.get("Tasks"),class:"w-full text-gray-650 box-style mt-2 p-6"},[x("div",w2,[x("h3",x2,L(t.$trans.get("Tasks")),1),i.taskListIsLoading?(S(),re(o,{key:0,size:"4",class:"text-center"})):P("",!0),i.taskListIsLoading?P("",!0):(S(),C("span",{key:1,innerHTML:t.svg("feather-chevron-down","stroke-icon h-4")},null,8,S2))]),i.taskListIsLoading?P("",!0):(S(),re($i,{key:0,tag:"div",class:"flex flex-wrap w-full"},{default:Y(()=>[(S(!0),C(Fe,null,nt(s.taskListOrdered,u=>(S(),C(Fe,{key:u.id},[u.deleted_at?P("",!0):(S(),C("div",T2,[X(a,{compact:"",task:u},null,8,["task"]),x("div",{class:K(["flex-grow overflow-hidden break-word leading-snug cursor-pointer",{"line-through":!!u.done_at}]),onClick:d=>t.$store.dispatch("viewTask",u)},L(u.title),11,_2),u.assignee?(S(),C("img",{key:0,src:u.assignee.avatar,class:"flex-none avatar rounded-lg mr-2 h-5 w-5",onClick:d=>t.$store.dispatch("viewTask",u)},null,8,E2)):P("",!0)]))],64))),128))],void 0,!0),_:1})),i.loadFailed?(S(),C("div",C2,[Me(L(t.$trans.get("There was an error, please check your connection."))+" ",1),x("button",{type:"button",class:"underline",onClick:e[0]||(e[0]=(...u)=>s.getTaskListRequest&&s.getTaskListRequest(...u))}
50,L(t.$trans.get("Try again")),1)])):P("",!0),n.canManage&&!i.taskListIsLoading&&!i.loadFailed?(S(),C("div",{key:2,class:K(["flex items-center w-full pt-3 gap-2",{"pointer-events-none opacity-50":i.isSaving}])},[(S(),re(l,{key:s.targetKey,class:"flex-grow min-w-0","field-class":"w-full bg-white text-sm resize-none break-word flex w-full items-center text-gray-700 focus-within:ring-0 focus:ring-0",slim:!0,placeholder:t.$trans.get("Add a task"),"loader-color":"primary-500","loader-class":"mr-2 mt-2","loader-size":"4","search-sections":["tasks"],"without-tasks-of-ticket":n.taskableType==="ticket"?n.taskableId:null,"without-tasks-of-article":n.taskableType==="article"?n.taskableId:null,"create-on-enter":!0,onSelect:s.attachTask,onCreate:s.createTaskFromQuery},null,8,["placeholder","without-tasks-of-ticket","without-tasks-of-article","onSelect","onCreate"])),X(c,{tooltip:t.$trans.get("Create from Template"),placement:"top"},{default:Y(()=>[x("button",{type:"button",class:"hover:bg-gray-400 rounded text-gray-600 hover:text-black p-1","aria-label":t.$trans.get("Create from Template"),disabled:i.isSaving,onClick:e[1]||(e[1]=(...u)=>s.openTemplatePicker&&s.openTemplatePicker(...u)),innerHTML:t.svg("feather-clipboard","stroke-icon h-4 w-4")},null,8,O2)],void 0,!0),_:1},8,["tooltip"])],2)):P("",!0)],8,k2)}const M2=Ae(b2,[["render",A2]]),I2={props:{tag:{type:Object,required:!0},light:{type:Boolean,default:!1},dir:{type:String,default:"ltr",validator:t=>["ltr","rtl"].includes(t)}}};function L2(t,e,n,r,i,s){return S(),C("div",{class:K(["flex items-center px-2 h-5 rounded-md text-2xs font-bold whitespace-nowrap text-gray-650 mr-2 last:mr-0",[n.light?"bg-gray-100":"bg-gray-400",n.dir=="ltr"?"mr-2 last:mr-0":"ml-2 first:ml-0"]])},[x("span",{class:"inline-block h-2 w-2 self-center rounded mr-1",style:Ir({background:n.tag.color})},null,4),x("span",null,L(n.tag.name),1)],2)}const va=Ae(I2,[["render",L2]]),P2={name:"TicketSidebar",components:{SpmTabShopify:mD,SpmTabXentral:BD,SpmDropdown:Gn,SpmCopyToClipboard:jw,SpmAvatarUploader:lN,SpmLoader:xn,SpmJsonToList:Am,SpmTaskList:M2,SpmButton:tc,SpmTag:va},props:{ticket:{type:Object,default:()=>null}},data(){return{showRecentTickets:!0,activeTab:1,disabledCustomSidebars:[],customSidebar:null,customSidebarTitle:"",customSidebarLoader:!1,showCustomSidebar:!0,cancelTokenSource:null,shopifyCustomerExists:!1,shopifyIsLoading:!1,shopifyIsEnabled:!1,xentralCustomerExists:!1,xentralIsLoading:!1,xentralIsEnabled:!1}},computed:{recentTickets(){let t=this;return Fw(this.ticket.related_tickets,function(e){return e.id!=t.ticket.id})}},watch:{ticket(t,e){t&&e&&t.id==e.id||(this.cancelTokenSource&&(this.cancelTokenSource.cancel(),this.cancelTokenSource=null),this.shopifyCustomerExists=!1,this.xentralCustomerExists=!1,this.customSidebar=null,this.loadCustomSidebar())}},methods:{getContactUrlByType(t){return t.type=="email"?"mailto:"+t.value:t.type=="twitter"?"https://x.com/"+t.value:t.type=="facebook"?"https://facebook.com/"+t.value:t.type=="instagram"?"https://instagram.com/"+t.value:t.type=="tiktok"?"https://tiktok.com/@"+t.value:t.type=="phone"||t.type=="mobile"?"tel:"+t.value:t.type=="whatsapp"?"https://wa.me/"+t.value:t.value},successUploadAvatar(){this.$store.dispatch("reloadCurrentTicket")},editUser(t){this.$store.commit("showFormModal",{component:"customers/_edit.modal.vue",params:t})},isObject(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)},formatFieldName(t){return t.replace(/_/g," ").replace(/([A-Z])/g," $1").replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()).trim()},formatFieldValue(t){return t==null?"â":typeof t=="boolean"?t?"Yes":"No":Array.isArray(t)?t.join(", "):this.isObject(t)?"...":t.toString()},updateContactSpamFlag(t,e){ze.patch(`/contacts/${t}/update-spam-flag`,{is_spam:e}).then(()=>{this.$store.dispatch("reloadCurrentTicket")}).catch(()=>{}).finally(()=>{})},changeTicketContact(){this.$store.commit("showFormModal",{component:"tickets/modals/_change-ticket-contact.modal.vue",params:this.ticket})},changeTicketChannel(){this.$store.commit("showFormModal",{component:"tickets/modals/_change-ticket-channel.modal.vue",params:this.ticket})},editCustomFields(){this.$store.commit("showFormModal",{component:"tickets/modals/_edit-custom-fields.modal.vue",params:{ticket:this.ticket},onSuccess:()=>{this.$store.dispatch("reloadCurrentTicket")}})}
50,loadCustomSidebar:Qt(function(){this.ticket.id&&(this.disabledCustomSidebars.includes(this.ticket.channel.id)||(this.customSidebarLoader=!0,this.cancelTokenSource=ze.CancelToken.source(),ze.get("/tickets/"+this.ticket.id+"/sidebar/"+this.ticket.channel.id,{cancelToken:this.cancelTokenSource.token}).then(t=>{var n;if(((n=t.data)==null?void 0:n.disabled)==!0){this.disabledCustomSidebars.push(this.ticket.channel.id);return}let e=this.disabledCustomSidebars.indexOf(this.ticket.channel.id);e!==-1&&this.disabledCustomSidebars.splice(e,1),this.customSidebar=t.data,this.customSidebarTitle=t.data.title}).catch(t=>{t.response&&t.response.status==422&&(this.customSidebar=t.response.data)}).finally(()=>{this.customSidebarLoader=!1})))},1e3)}},R2={id:"spm-side-info",class:"flex-shrink-0 hide-native-scrollbar h-full overflow-y-auto w-screen lg:block lg:w-56 xl:w-64 2xl:w-70 4xl:w-84 pb-13 pl-1 pr-2"},$2={id:"spm-side-info-first",class:"box-style rounded-lg"},D2={class:"flex items-stretch w-full h-13 text-gray-650 py-2"},N2={class:"flex gap-2 self-center h-8 px-3"},F2={key:0,id:"spm-contact-info",class:"flex flex-wrap px-6 pt-2 pb-4"},j2={class:"w-full"},B2={class:"flex-grow spm-ticket-sidebar-head"},H2={key:0,class:"relative flex-wrap w-full mt-2 bg-gray-200 rounded-lg px-2 py-4 3xl:mr-2"},U2={key:0,class:"absolute -top-4 -right-4 flex-shrink-0 w-10 h-10 rounded-lg overflow-hidden avatar"},V2={class:"absolute top-7 right-1"},z2=["innerHTML"],W2={ref:"options",class:"spm-list"},K2={key:1,class:"flex-wrap w-full px-2 pr-[0.6rem]"},q2={key:2,class:"flex"},G2={key:3,class:"flex w-full px-2 text-sm pr-5"},Y2={ref:"options",class:"spm-list"},X2={key:4,class:"flex w-full items-center text-gray-650 text-xs pl-2 pr-5 pt-2 mb-1"},J2=["src"],Q2={class:"break-all"},Z2={key:5,class:"flex w-full text-gray-650 text-xs pl-2 pr-5"},eF={class:"truncate"},tF={key:6,class:"flex-wrap w-full px-2 break-all text-gray-650 text-xs pt-2"},nF={key:0},rF={key:1,innerHTML:", "},iF={key:2},sF={key:7,class:"pt-3"},oF=["href"],aF=["innerHTML"],lF={key:0,class:"break-all -ml-1"},cF={key:1,class:"break-all"},uF=["onClick"],dF={key:8,class:"flex-wrap w-full px-2 text-gray-650 text-xs pt-3 leading-tight"},fF={class:"text-xs"},hF={key:9,class:"flex-wrap w-full px-2 text-gray-650 text-xs pt-3 leading-tight"},pF=["innerHTML"],mF={key:10,class:"flex flex-wrap m-1 md:justify-start mt-2 ml-1"},gF={key:1,class:"w-full text-gray-650 p-6 pt-0"},vF={class:"flex-grow spm-ticket-sidebar-head mb-px"},yF={class:"flex group mb-4 min-h-8 text-sm"},bF={class:"grow"},kF={key:0},wF=["innerHTML"],xF={key:1,class:"rounded-full bg-gray-100 min-h-4 py-1 w-30"},SF={key:2,class:"text-gray-600 break-all"},TF={key:3,class:"rounded-full bg-gray-100 h-3 py-1 w-40 mt-2"},_F=["innerHTML"],EF={class:"flex-grow spm-ticket-sidebar-head mb-px"},CF={key:0,class:"min-h-4 mb-4 text-sm"},OF={key:1,class:"rounded-full bg-gray-100 min-h-4 py-1 w-26 mb-4"},AF={class:"flex-grow spm-ticket-sidebar-head mb-px"},MF={class:"flex justify-center items-center text-sm mb-4"},IF={key:0,class:"w-6 h-6 shink-0"},LF={class:"rounded-lg h-6 w-6"},PF=["src"],RF={class:"flex-grow pl-2"},$F={key:2},DF={class:"flex-grow spm-ticket-sidebar-head mb-1"},NF={class:"flex items-center text-sm mb-4"},FF={class:"rounded-lg h-6 w-6 mr-1"},jF=["src"],BF={class:"flex-grow spm-ticket-sidebar-head mb-px"},HF={class:"flex justify-center items-center text-sm mb-4"},UF={class:"flex-grow"},VF={key:3,class:"flex flex-grow spm-ticket-sidebar-head pb-2"},zF={class:"flex-grow"},WF=["innerHTML"],KF={key:4,class:"pl-2 border-l"},qF={key:5},GF={class:"w-full text-gray-650 p-6 pt-0"},YF={class:"w-full text-gray-650 p-6 pt-0"},XF={key:1,class:"w-full text-gray-650 box-style mt-2 p-6"},JF={class:"flex text-gray-600 pb-4"},QF={class:"flex-grow spm-ticket-sidebar-head"},ZF=["innerHTML"],e3={class:"flex w-4 pr-2 items-center"},t3=["onClick"],n3={key:2,class:"w-full text-gray-650 box-style mt-2 mb-4 p-6"},r3={class:"flex text-gray-600"},i3={class:"flex-grow spm-ticket-sidebar-head"},s3=["innerHTML"],o3=["innerHTML"],a3={key:1,class:"pt-4"};function l3(t,e,n,r,i,s){const o=z("spm-button"),a=z("spm-avatar-uploader"),l=z("spm-copy-to-cl
50ipboard"),c=z("spm-dropdown"),u=z("spm-json-to-list"),d=z("spm-tag"),f=z("spm-tab-shopify"),p=z("spm-tab-xentral"),h=z("spm-task-list"),g=z("spm-loader");return Ye((S(),C("div",R2,[x("div",$2,[x("div",D2,[x("div",N2,[X(o,{tooltip:t.$trans.get("Contact Information"),class:K(["spm-action-item",{active:i.activeTab==1}]),"icon-class":"stroke-icon h-4",icon:"feather-user",onClick:e[0]||(e[0]=m=>i.activeTab=1)},null,8,["tooltip","class"]),i.shopifyIsEnabled?(S(),re(o,{key:0,tooltip:t.$trans.get("Shopify"),class:K(["spm-action-item",[{active:i.activeTab==2},{grayscale:!i.shopifyCustomerExists,"animate-pulse":i.shopifyIsLoading}]]),"icon-class":"h-4",icon:"brands-shopify",onClick:e[1]||(e[1]=m=>i.activeTab=2)},null,8,["tooltip","class"])):P("",!0),i.xentralIsEnabled?(S(),re(o,{key:1,tooltip:t.$trans.get("Xentral"),class:K(["spm-action-item",[{active:i.activeTab==3},{grayscale:!i.xentralCustomerExists,"animate-pulse":i.xentralIsLoading}]]),"icon-class":"h-[1.1rem]",icon:"brands-xentral",onClick:e[2]||(e[2]=m=>i.activeTab=3)},null,8,["tooltip","class"])):P("",!0)])]),i.activeTab==1?(S(),C("div",F2,[x("div",j2,[x("h3",B2,L(t.$trans.get("Contact Information")),1)]),n.ticket&&n.ticket.contact?(S(),C("div",H2,[n.ticket&&n.ticket.contact&&n.ticket.contact.avatar!=""?(S(),C("div",U2,[X(a,{url:`/customers/${n.ticket.contact.user.id}`,method:"patch","img-url":n.ticket.contact.avatar,size:9,onSuccess:s.successUploadAvatar},null,8,["url","img-url","onSuccess"])])):P("",!0),x("div",V2,[n.ticket.contact?(S(),re(c,{key:0,small:!0,"hide-after-dropdown-click":"","dropdown-class":"max-w-8",placement:"bottom-end"},{trigger:Y(()=>[x("span",{class:"flex-shrink-0 hover:text-gray-700 text-gray-600 cursor-pointer bg-gray-200 rounded",innerHTML:t.svg("feather-more-vertical","stroke-icon h-4")},null,8,z2)]),dropdown:Y(()=>{var m,b,T,E;return[x("ul",W2,[x("li",{onClick:e[3]||(e[3]=w=>t.$router.push({name:"customers-detail",params:{id:n.ticket.contact.user_id}}))},L(t.$trans.get("View Profile")),1),x("li",{onClick:e[4]||(e[4]=w=>s.editUser(n.ticket.contact.user))},L(t.$trans.get("Edit Profile")),1),n.ticket.contact.user.organization_id?(S(),C("li",{key:0,onClick:e[5]||(e[5]=w=>t.$router.push({name:"organizations-detail",params:{id:n.ticket.contact.user.organization_id}}))},L(t.$trans.get("View Organization Profile")),1)):P("",!0),n.ticket.is_social?P("",!0):(S(),C("li",{key:1,onClick:e[6]||(e[6]=w=>s.changeTicketContact())},L(t.$trans.get("Change Contact")),1)),!n.ticket.contact.is_spam&&!n.ticket.contact.deleted_at&&((b=(m=n.ticket)==null?void 0:m.channel)==null?void 0:b.type)=="email"?(S(),C("li",{key:2,onClick:e[7]||(e[7]=w=>s.updateContactSpamFlag(n.ticket.contact.id,!0))},L(t.$trans.get("Mark Contact as Spam")),1)):P("",!0),n.ticket.contact&&((E=(T=n.ticket)==null?void 0:T.channel)==null?void 0:E.type)=="email"?(S(),re(l,{key:3,tag:"li",value:n.ticket.contact.value,"flash-message":t.$trans.get("Email address copied to clipboard!")},{default:Y(()=>[Me(L(t.$trans.get("Copy Email Address")),1)],void 0,!0),_:1},8,["value","flash-message"])):P("",!0)],512)]}),_:1})):P("",!0)]),n.ticket.contact?(S(),C("div",K2,[n.ticket.contact?(S(),re(l,{key:0,class:"text-sm font-display font-normal tracking-tight text-gray-800 truncate",tag:"div",value:n.ticket.contact.name,delay:[350,0],tooltip:t.$trans.get("Copy to clipboard"),"flash-message":t.$trans.get("Copied to clipboard!")},{default:Y(()=>[Me(L(n.ticket.contact.name),1)],void 0,!0),_:1},8,["value","tooltip","flash-message"])):P("",!0)])):(S(),C("div",q2,[...e[19]||(e[19]=[x("div",{class:"flex-grow mt-1"},[x("div",{class:"bg-gray-500 h-3 w-1/2 ml-2 rounded-full"}),x("div",{class:"bg-primary-200 opacity-50 h-3 w-2/3 ml-2 rounded-full mt-1"})],-1),x("div",{class:"flex w-10 h-10 -mt-6 -mr-6 rounded-full bg-gray-400 border-2 border-white"},null,-1)])])),n.ticket.contact?(S(),C("div",G2,[X(l,{class:"text-primary-500 text-xs break-all",tag:"a",delay:[350,0],value:n.ticket.contact.value,tooltip:t.$trans.get("Copy to clipboard"),"flash-message":t.$trans.get("Email address copied to clipboard!")},{default:Y(()=>[Me(L(n.ticket.contact?n.ticket.contact.value:""),1)],void 0,!0),_:1},8,["value","tooltip","flash-message"]),n.ticket.contact&&n.ticket.contact.
50is_spam?(S(),re(c,{key:0,small:!0,"hide-after-dropdown-click":"",placement:"bottom-end"},{trigger:Y(()=>[n.ticket.contact.is_spam?(S(),re(o,{key:0,tag:"div",tooltip:t.$trans.get("New Tickets from :value will be marked as spam.",{value:n.ticket.contact.value})+" "+t.$trans.get("Click to change"),class:K(["stroke-icon h-4 text-red-500 cursor-pointer truncate"]),"tooltip-placement":"top",icon:"feather-alert-triangle"},null,8,["tooltip"])):P("",!0)]),dropdown:Y(()=>[x("ul",Y2,[n.ticket.contact.is_spam?(S(),C("li",{key:0,onClick:e[8]||(e[8]=m=>s.updateContactSpamFlag(n.ticket.contact.id,!1))},L(t.$trans.get("Remove Spam Flag")),1)):P("",!0)],512)]),_:1})):P("",!0)])):P("",!0),n.ticket.contact&&n.ticket.contact.user.organization?(S(),C("div",X2,[n.ticket.contact.user.organization.avatar?(S(),C("img",{key:0,src:n.ticket.contact.user.organization.avatar,class:"bg-gray-200 avatar w-4 min-h-4 mr-1"},null,8,J2)):P("",!0),x("span",Q2,L(n.ticket.contact.user.organization.name),1)])):P("",!0),n.ticket.contact&&n.ticket.contact.user.job_title?(S(),C("div",Z2,[x("span",eF,L(n.ticket.contact.user.job_title),1)])):P("",!0),n.ticket.contact&&(n.ticket.contact.user.city||n.ticket.contact.user.country)?(S(),C("div",tF,[n.ticket.contact.user.city?(S(),C("span",nF,L(n.ticket.contact.user.city),1)):P("",!0),n.ticket.contact.user.city&&n.ticket.contact.user.country?(S(),C("span",rF)):P("",!0),n.ticket.contact.user.country?(S(),C("span",iF,L(n.ticket.contact.user.country),1)):P("",!0)])):P("",!0),n.ticket.contact&&n.ticket.contact.user.additional_contacts.length>0?(S(),C("div",sF,[(S(!0),C(Fe,null,nt(n.ticket.contact.user.additional_contacts,m=>(S(),C("div",{key:m.id,class:"flex-wrap w-full px-2 text-gray-650 text-xs"},[x("a",{class:"text-xs text-gray-600 inline-block pt-[0.15rem]",href:s.getContactUrlByType(m),rel:"nofollow",target:"_blank"},[x("span",{innerHTML:t.svg("feather-"+m.type,"stroke-icon h-3 -ml-1")},null,8,aF),m.value==n.ticket.contact.value?(S(),C("span",lF,L(n.ticket.contact.user.email),1)):(S(),C("span",cF,L(m.value),1))],8,oF),m&&m.value!=n.ticket.contact.value&&m.is_spam?(S(),re(c,{key:0,small:!0,"hide-after-dropdown-click":"",class:"inline",placement:"bottom-end"},{trigger:Y(()=>[m&&m.is_spam?(S(),re(o,{key:0,tooltip:t.$trans.get("New Tickets from :value will be marked as spam.",{value:m.value}),class:K(["text-red-500 cursor-default"]),"tooltip-placement":"top","icon-class":"stroke-icon h-3 mt-px",icon:"feather-alert-triangle"},null,8,["tooltip"])):P("",!0)]),dropdown:Y(()=>[x("ul",{ref_for:!0,ref:"options",class:"spm-list"},[m.is_spam?(S(),C("li",{key:0,onClick:b=>s.updateContactSpamFlag(m.id,!1)},L(t.$trans.get("Remove Spam Flag")),9,uF)):P("",!0)],512)]),_:2},1024)):P("",!0)]))),128))])):P("",!0),n.ticket.contact&&n.ticket.contact.custom_fields?(S(),C("div",dF,[x("small",fF,[X(u,{json:n.ticket.contact.custom_fields},null,8,["json"])])])):P("",!0),n.ticket.contact&&n.ticket.contact.user.note?(S(),C("div",hF,[x("div",{innerHTML:n.ticket.contact.user.note},null,8,pF)])):P("",!0),n.ticket.contact.user.tags&&n.ticket.contact.user.tags.length>0?(S(),C("div",mF,[(S(!0),C(Fe,null,nt(n.ticket.contact.user.tags,m=>(S(),re(d,{key:m.id,tag:m,class:"mr-0 ml-1 mt-1",dir:"ltr"},null,8,["tag"]))),128))])):P("",!0)])):P("",!0)])):P("",!0),i.activeTab==1?(S(),C("div",gF,[x("h3",vF,L(t.$trans.get("Channel")),1),x("div",yF,[x("div",bF,[n.ticket.channel?(S(),C("div",kF,[n.ticket.channel.type=="instagram"?(S(),C("span",{key:0,innerHTML:t.svg("instagram-color","h-4")},null,8,wF)):P("",!0),Me(" "+L(n.ticket.channel.name),1)])):(S(),C("div",xF)),n.ticket.channel?(S(),C("small",SF,L(n.ticket.channel.address),1)):(S(),C("div",TF))]),n.ticket.is_social?P("",!0):(S(),C("div",{key:0,class:"grow-0 invisible group-hover:visible cursor-pointer",onClick:e[9]||(e[9]=m=>s.changeTicketChannel()),innerHTML:t.svg("feather-edit","stroke-icon h-4")},null,8,_F))]),x("h3",EF,L(t.$trans.get("Team")),1),n.ticket?(S(),C("div",CF,L(n.ticket.team?n.ticket.team.name:t.$trans.get("Unassigned")),1)):(S(),C("div",OF)),x("h3",AF,L(t.$trans.get("Assigned Agent")),1),x("div",MF,[n.ticket.assignee?(S(),C("div",IF,[x("span",LF,[x("img",{src:n.ticket.assignee.avatar,class:"avatar rounded-lg h-6 w-6"},null,8,PF)])])):P("",!0),x("div",RF,L(n.ticket.assignee?n.ticket.assignee.name:t.$trans.get("Unassigned")),1)]),n.ticket&&n.ticket.watchers&&n.ticket.watchers.length?(S(),C("div",$F,[x("h3",DF,L(t.$trans.get("Agents Watching")),1),x("div",NF,[(S(!0),C(Fe,null,nt(n.ticket.watchers,m=>(S(),C("div",{key:m.id,class:"w-6 h-6 mr-1"},[x("span",FF,[x("img",{src:m.avatar,class:"avatar rounded-lg h-6 w-6"},null,8,jF)])]))),128))])])):P("",!0),x("h3",BF,L(t.$trans.get("Created at")),1),x("div",HF,[x("div",UF,L(t.$filters.datetime(n.ticket.created_at)),1)]),t.$store.getters.customerInfo.conditions.customFields?(S(),C("h3",VF,[x("span",zF,L(t.$trans.get("Custom Fields")),1),x("div",{class:"grow-0 cursor-pointer",onClick:e[10]||(e[10]=m=>s.editCustomFields()),innerHTML:t.svg("feather-edit","stroke-icon h-4")},null,8,WF)])):P("",!0),n.ticket.custom_fields&&Object.keys(n.ticket.custom_fields).length>0?(S(),C("div",KF,[X(u,{json:n.ticket.custom_fields},null,8,["json"])])):(S(),C("div",qF,[...e[20]||(e[20]=[x("span",null,"-",-1)])]))])):P("",!0),Ye(x("div",GF,[X(f,{ticket:n.ticket,onShopifyHit:e[11]||(e[11]=m=>i.shopifyCustomerExists=m),onShopifyLoader:e[12]||(e[12]=m=>i.shopifyIsLoading=m),onShopifyEnabled:e[13]||(e[13]=m=>i.shopifyIsEnabled=m)},null,8,["ticket"])],512),[[wt,i.activeTab==2]]),Ye(x("div",YF,[X(p,{ticket:n.ticket,onXentralHit:e[14]||(e[14]=m=>i.xentralCustomerExists=m),onXentralLoader:e[15]||(e[15]=m=>i.xentralIsLoading=m),onXentralEnabled:e[16]||(e[16]=m=>i.xentralIsEnabled=m)},null,8,["ticket"])],512),[[wt,i.activeTab==3]])]),t.$store.getters.customerInfo.conditions.scrumBoards&&n.ticket&&n.ticket.id?(S(),re(h,{key:0,"taskable-id":n.ticket.id,"taskable-type":"ticket"},null,8,["taskable-id"])):P("",!0),i.activeTab==1&&n.ticket.related_tickets&&s.recentTickets.length>0?(S(),C("div",XF,[x("div",JF,[x("h3",QF,L(t.$trans.get("Previous Tickets")),1),x("div",{class:K(["flex -mt-px text-xs whitespace-nowrap text-right text-gray-650 items-center trans-all-ease",{"tranr-90-r":!i.showRecentTickets}]),onClick:e[17]||(e[17]=m=>i.showRecentTickets=!i.showRecentTickets),innerHTML:t.svg("feather-chevron-down","stroke-icon h-4")},null,10,ZF)]),i.showRecentTickets?(S(),re($i,{key:0,tag:"div",class:"flex flex-wrap w-full"},{default:Y(()=>[(S(!0),C(Fe,null,nt(s.recentTickets,m=>(S(),C("div",{key:m.id,class:K(["w-full pl-2 pb-4",m.id==n.ticket.id?"hidden":"flex"])},[x("div",e3,[x("span",{class:K(["h-2 w-2 inline-block rounded-full status-bg",["
50status-bg-"+m.status,{"opacity-25":m.status=="closed"}]])},null,2)]),x("a",{class:K(["flex-grow text-xs pr-4 whitespace-nowrap truncate hover:text-primary-500 cursor-pointer",[m.status!="closed"?"text-gray-700 font-bold":"text-gray-600"]]),onClick:b=>t.$store.commit("showTicketModal",{component:"tickets/modals/_show-ticket.modal.vue",params:{id:m.id,parent_id:n.ticket.id}})},L(m.subject),11,t3)],2))),128))],void 0,!0),_:1})):P("",!0)])):P("",!0),i.activeTab==1&&n.ticket.channel&&!i.disabledCustomSidebars.includes(n.ticket.channel.id)?(S(),C("div",n3,[x("div",r3,[x("h3",i3,L(i.customSidebarTitle),1),x("div",{class:K(["flex -mt-px text-xs whitespace-nowrap text-right text-gray-650 items-center trans-all-ease",{"tranr-90-r":!i.showCustomSidebar}]),onClick:e[18]||(e[18]=m=>i.showCustomSidebar=!i.showCustomSidebar)},[i.customSidebarLoader?(S(),re(g,{key:0,size:"4",class:"text-center"})):P("",!0),!i.customSidebarLoader&&i.customSidebar!=null?(S(),C("span",{key:1,innerHTML:t.svg("feather-chevron-down","stroke-icon h-4")},null,8,s3)):P("",!0)],2)]),!i.customSidebarLoader&&i.showCustomSidebar&&i.customSidebar!=null&&i.customSidebar.html?(S(),C("div",{key:0,class:"pt-4",innerHTML:i.customSidebar.html},null,8,o3)):P("",!0),!i.customSidebarLoader&&i.showCustomSidebar&&i.customSidebar!=null&&i.customSidebar.json?(S(),C("div",a3,[X(u,{json:i.customSidebar.json},null,8,["json"])])):P("",!0)])):P("",!0),e[21]||(e[21]=x("div",{class:"h-8"},null,-1))],512)),[[wt,!t.$store.getters.searchedWithoutResults]])}const c3=Ae(P2,[["render",l3]]);function vn(t){this.content=t}vn.prototype={constructor:vn,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 vn(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 vn(n)},addToStart:function(t,e){return new vn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new vn(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 vn(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=vn.from(t),t.size?new vn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=vn.from(t),t.size?new vn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=vn.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}};vn.from=function(t){if(t instanceof vn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new vn(e)};function Vw(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){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)n++;return l&&l<o.length&&l<a.length&&Kw(o.charCodeAt(l-1))&&Ww(o.charCodeAt(l))&&n--,n}if(i.content.size||s.content.size){let o=Vw(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function zw(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 o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let c=o.text,u=a.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&Kw(c.charCodeAt(d-1))&&Ww(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(o.content.size||a.content.size){let c=zw(o.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}function Ww(t){return t>=56320&&t<57344}function Kw(t){return t>=55296&&t<56320}class he{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 o=0,a=0;a<n;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}
vendor: 11,424 bytes, line 50
50textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},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 he(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,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new he(r,i)}cutByIndex(e,n){return e==n?he.empty:e==0&&n==this.content.length?this:new he(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 he(i,s)}addToStart(e){return new he([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new he(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 Vw(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return zw(this,e,n,r)}findIndex(e){if(e==0)return vc(0,e);if(e==this.size)return vc(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?vc(n+1,s):vc(n,r);r=s}}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 he.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return he.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return he.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 he(n||e,r)}static from(e){if(!e)return he.empty;if(e instanceof he)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new he([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}he.empty=new he([],0);const yf={index:0,offset:0};function vc(t,e){return yf.index=t,yf.offset=e,yf}function fu(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(!fu(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!fu(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Rt=class Rh{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&&fu(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 Rh.none;if(e instanceof Rh)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Rt.none=[];class hu extends Error{}class Re{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=Gw(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new Re(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Re(qw(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 Re.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 Re(he.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 Re(e,r,i)}}Re.empty=new Re(he.empty,0,0);function qw(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(qw(s.content,e-i-1,n-i-1)))}function Gw(t,e,n,r,i,s){let{index:o,offset:a}=t.findIndex(e),l=t.maybeChild(o);if(a==e||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=Gw(l.content,e-a-1,n,o==0?r-1:0,o==t.childCount-1?i-1:0,l);return c&&t.replaceChild(o,l.copy(c))}function u3(t,e,n){if(n.openStart>t.depth)throw new hu("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new hu("Inconsistent open depths");return Yw(t,e,n,0)}function Yw(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=Yw(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return Ks(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=d3(n,t);return Ks(s,Jw(t,o,a,e,r))}else return Ks(s,pu(t,e,r))}function Xw(t,e){if(!e.type.compatibleContent(t.type))throw new hu("Cannot join "+e.type.name+" onto "+t.type.name)}function $h(t,e,n){let r=t.node(n);return Xw(r,e.node(n)),r}function Ws(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 Ja(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Ws(t.nodeAfter,r),s++));for(let a=s;a<o;a++)Ws(i.child(a),r);e&&e.depth==n&&e.textOffset&&Ws(e.nodeBefore,r)}function Ks(t,e){return t.type.checkContent(e),t.copy(e)}function Jw(t,e,n,r,i){let s=t.depth>i&&$h(t,e,i+1),o=r.depth>i&&$h(n,r,i+1),a=[];return Ja(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(Xw(s,o),Ws(Ks(s,Jw(t,e,n,r,i+1)),a)):(s&&Ws(Ks(s,pu(t,e,i+1)),a),Ja(e,n,i,a),o&&Ws(Ks(o,pu(n,r,i+1)),a)),Ja(r,null,i,a),new he(a)}function pu(t,e,n){let r=[];if(Ja(null,t,n,r),t.depth>n){let i=$h(t,e,n+1);Ws(Ks(i,pu(t,e,n+1)),r)}return Ja(e,null,n,r),new he(r)}function d3(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(he.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class yl{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 Rt.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].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 mu(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 o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new yl(n,r,s)}
vendor: 4,385 bytes, line 50
50static resolveCached(e,n){let r=ty.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else ty.set(e,r=new f3);let i=r.elts[r.i]=yl.resolve(e,n);return r.i=(r.i+1)%h3,i}}class f3{constructor(){this.elts=[],this.i=0}}const h3=12,ty=new WeakMap;class mu{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 p3=Object.create(null);let Ci=class Dh{constructor(e,n,r,i=Rt.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||he.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&&fu(this.attrs,n||e.defaultAttrs||p3)&&Rt.sameSet(this.marks,r||Rt.none)}copy(e=null){return e==this.content?this:new Dh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Dh(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 Re.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new Re(c,i.depth-o,s.depth-o)}replace(e,n,r){return u3(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 yl.resolveCached(this,e)}resolveNoCache(e){return yl.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()+")"),Qw(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=he.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).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),o=s&&s.matchFragment(this.content,n);return o?o.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=Rt.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(!Rt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}
50`);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=he.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Ci.prototype.text=void 0;class gu extends Ci{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):Qw(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 gu(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new gu(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 Qw(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Zs{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new m3(e,n);if(r.next==null)return Zs.empty;let i=Zw(r);r.next&&r.err("Unexpected trailing text");let s=x3(w3(i));return S3(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(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return he.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,a.concat(u));if(f)return f}}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 o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.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 o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(` 51`)}}Zs.empty=new Zs(!0);class m3{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 Zw(t){let e=[];do e.push(g3(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function g3(t){let e=[];do e.push(v3(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function v3(t){let e=k3(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=y3(t,e);else break;return e}function ny(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");
vendor: 2,433 bytes, line 51
51let e=Number(t.next);return t.pos++,e}function y3(t,e){let n=ny(t),r=n;return t.eat(",")&&(t.next!="}"?r=ny(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function b3(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function k3(t){if(t.eat("(")){let e=Zw(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=b3(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 w3(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let u=n();i(s(o.expr,l),u),l=u}if(o.max==-1)i(s(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let u=n();r(l,u),i(s(o.expr,l),u),l=u}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function e1(t,e){return e-t}function ry(t,e){let n=[];return r(e),n.sort(e1);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function x3(t){let e=Object.create(null);return n(ry(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);ry(t,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new Zs(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(e1);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function S3(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];
vendor: 11,664 bytes, lines 51-52
51o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function t1(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 n1(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 r1(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}function i1(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new _3(t,r,e[r]);return n}let iy=class s1{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=i1(e,r.attrs),this.defaultAttrs=t1(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==Zs.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:n1(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ci(this,this.computeAttrs(e),he.from(n),Rt.setFrom(r))}createChecked(e=null,n,r){return n=he.from(n),this.checkContent(n),new Ci(this,this.computeAttrs(e),n,Rt.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=he.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(he.empty,!0);return s?new Ci(this,e,n.append(s),Rt.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){r1(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:Rt.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new s1(s,n,o));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 T3(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 _3{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?T3(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ed{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=i1(e,i.attrs),this.excluded=null;let s=t1(this.attrs);this.instance=s?new Rt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Rt(this,n1(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Ed(s,i++,n,o)),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){r1(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class o1{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=vn.from(e.nodes),n.marks=vn.from(e.marks||{}),this.nodes=iy.compile(this.spec.nodes,this),this.marks=Ed.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],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=Zs.parse(o,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=a=="_"?null:a?sy(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:sy(this,o.split(" "))}this.nodeFromJSON=i=>Ci.fromJSON(this,i),this.markFromJSON=i=>Rt.fromJSON(this,i),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 iy){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 gu(r,r.defaultAttrs,e,Rt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function sy(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function E3(t){return t.tag!=null}function C3(t){return t.style!=null}class Zi{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(E3(i))this.tags.push(i);else if(C3(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 ay(this,n,!1);return r.addAll(e,Rt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new ay(this,n,!0);return r.addAll(e,Rt.none,n.from,n.to),Re.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(M3(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||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 o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=ly(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=ly(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Zi(e,Zi.schemaRules(e)))}}const a1={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},O3={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},l1={ol:!0,ul:!0},bl=1,Nh=2,Qa=4;function oy(t,e,n){return e!=null?(e?bl:0)|(e==="full"?Nh:0):t&&t.whitespace=="pre"?bl|Nh:n&~Qa}class yc{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=Rt.none,this.match=s||(o&Qa?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(he.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&bl)){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=he.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(he.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&&!a1.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ay{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=oy(null,n.preserveWhitespace,0)|(r?Qa:0);i?s=new yc(i.type,i.attrs,Rt.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new yc(null,null,Rt.none,!0,null,o):s=new yc(e.schema.topNodeType,null,Rt.none,!0,null,o),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&Nh?"full":this.localPreserveWS||(i.options&bl)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,` 52`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(o.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");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],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),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 o=e.nodeName.toLowerCase(),a;l1.hasOwnProperty(o)&&this.parser.normalizeLists&&A3(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:O3.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;
vendor: 4,817 bytes, lines 52-53
52if(a1.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` 53`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}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],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.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(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,s=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=Rt.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):cy(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=oy(e,s,o.options);o.options&Qa&&o.content.length==0&&(a|=Qa);let l=Rt.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):cy(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new yc(e,n,l,i,null,a)),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|=bl)}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),o=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let u=l>
vendor: 4,666 bytes, line 53
530||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return o(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 A3(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&l1.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function M3(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ly(t){let e={};for(let n in t)e[n]=t[n];return e}function cy(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class ds{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=bc(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],u=this.serializeMark(c,o.isInline,n);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){if(e.isText)return bc(n).createTextNode(e.text);let{dom:r,contentDOM:i}=Kc(bc(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&&Kc(bc(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:Kc(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ds(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=uy(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return uy(e.marks)}}function uy(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function bc(t){return t.document||window.document}const dy=new WeakMap;function I3(t){let e=dy.get(t);return e===void 0&&dy.set(t,e=L3(t)),e}function L3(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 Kc(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=I3(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 o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(t.createTextNode(f));else{let{dom:p,contentDOM:h}=Kc(t,f,n,r);if(l.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:l,contentDOM:a}}const c1=65535,u1=Math.pow(2,16);function P3(t,e){return t+e*u1}function fy(t){return t&c1}function R3(t){return(t-(t&c1))/u1}const d1=1,f1=2,qc=4,h1=8;class Fh{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&h1)>0}get deletedBefore(){return(this.delInfo&(d1|qc))>0}get deletedAfter(){return(this.delInfo&(f1|qc))>0}get deletedAcross(){return(this.delInfo&qc)>0}}class er{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&er.empty)return er.empty}recover(e){let n=0,r=fy(e);if(!this.inverted)for(let i=0;i<r;
vendor: 3,658 bytes, line 53
53i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+R3(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,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+s],u=this.ranges[a+o],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,p=l+i+(f<0?0:u);if(r)return p;let h=e==(n<0?l:d)?null:P3(a/3,e-l),g=e==l?f1:e==d?d1:qc;return(n<0?e!=l:e!=d)&&(g|=h1),new Fh(p,g,h)}i+=u-c}return r?e+i:new Fh(e+i,0,null)}touches(e,n){let r=0,i=fy(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+o]-c}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 o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),c=this.ranges[i+n],u=this.ranges[i+r];e(a,a+c,l,l+u),s+=u-c}}invert(){return new er(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?er.empty:new er(e<0?[0,-e,0]:[0,0,e])}}er.empty=new er([]);class kl{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new kl(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),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 kl;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 o=this._maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new Fh(e,i,null)}}const bf=Object.create(null);class In{getMap(){return er.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=bf[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 bf)throw new RangeError("Duplicate use of step JSON ID "+e);return bf[e]=n,n.prototype.jsonID=e,n}}class rn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new rn(e,null)}static fail(e){return new rn(null,e)}static fromReplace(e,n,r,i){try{return rn.ok(e.replace(n,r,i))}catch(s){if(s instanceof hu)return rn.fail(s.message);throw s}}}function Im(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(Im(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return he.fromArray(r)}class Yi extends In{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.no
vendor: 10,990 bytes, line 53
53de(r.sharedDepth(this.to)),s=new Re(Im(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return rn.fromReplace(e,this.from,this.to,s)}invert(){return new Zr(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 Yi(n.pos,r.pos,this.mark)}merge(e){return e instanceof Yi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yi(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 Yi(n.from,n.to,e.markFromJSON(n.mark))}}In.jsonID("addMark",Yi);class Zr extends In{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 Re(Im(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return rn.fromReplace(e,this.from,this.to,r)}invert(){return new Yi(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 Zr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Zr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Zr(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 Zr(n.from,n.to,e.markFromJSON(n.mark))}}In.jsonID("removeMark",Zr);class Xi extends In{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return rn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return rn.fromReplace(e,this.pos,this.pos+1,new Re(he.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 Xi(this.pos,n.marks[i]);return new Xi(this.pos,this.mark)}}return new eo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Xi(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 Xi(n.pos,e.markFromJSON(n.mark))}}In.jsonID("addNodeMark",Xi);class eo extends In{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return rn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return rn.fromReplace(e,this.pos,this.pos+1,new Re(he.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Xi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new eo(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 eo(n.pos,e.markFromJSON(n.mark))}}In.jsonID("removeNodeMark",eo);class tn extends In{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&jh(e,this.from,this.to)?rn.fail("Structure replace would overwrite content"):rn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new er([this.from,this.to-this.from,this.slice.size])}invert(e){return new tn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&tn.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new tn(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof tn)||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?Re.empty:new Re(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new tn(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?Re.empty:new Re(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new tn(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 tn(n.from,n.to,Re.fromJSON(e,n.slice),!!n.structure)}}tn.MAP_BIAS=1;In.jsonID("replace",tn);class fn extends In{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(jh(e,this.from,this.gapFrom)||jh(e,this.gapTo,this.to)))return rn.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return rn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?rn.fromReplace(e,this.from,this.to,r):rn.fail("Content does not fit in gap")}getMap(){return new er([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 fn(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 fn(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 fn(n.from,n.to,n.gapFrom,n.gapTo,Re.fromJSON(e,n.slice),n.insert,!!n.structure)}}In.jsonID("replaceAround",fn);function jh(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 o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function $3(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,n),h=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(h)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=p:i.push(o=new Zr(f,p,d[g])));a&&a.to==f?a.to=p:s.push(a=new Yi(f,p,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function D3(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof Ed){let c=o.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let p=0;p<i.length;p++){let h=i[p];h.step==s-1&&d.eq(i[p].style)&&(f=h)}f?(f.to=c,f.step=s):i.push({style:d,from:Math.max(a,e),to:c,step:s})}}}),i.forEach(o=>t.step(new Zr(o.from,o.to,o.style)))}function Lm(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new tn(a,u,Re.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new Zr(a,u,c.marks[f]));if(i&&c.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new Re(he.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new tn(a+f.index,a+f.index+f[0].length,h))}}a=u}if(!r.validEnd){let l=r.fillBefore(he.empty,!0);t.replace(a,a,new Re(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function N3(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ya(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+i,l=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(a,l,n))return r;if(r==0||o.type.spec.isolating||!N3(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function F3(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,c=a,u=he.empty,d=0;for(let h=s,g=!1;h>n;h--)g||r.index(h)>0?(g=!0,u=he.from(r.node(h).copy(u)),d++):l--;let f=he.empty,p=0;for(let h=s,g=!1;h>n;h--)g||i.after(h+1)<i.end(h)?(g=!0,f=he.from(i.node(h).copy(f)),p++):c++;t.step(new fn(l,c,o,a,new Re(u.append(f),d,p),u.size-d,!0))}function Pm(t,e,n=null,r=t){let i=j3(t,e),s=i&&B3(r,e);return s?i.map(hy).concat({type:e,attrs:n}).concat(s.map(hy)):null}function hy(t){return{type:t,attrs:null}}function j3(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function B3(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:o}function H3(t,e,n){let r=he.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=he.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new fn(i,s,i,s,new Re(r,0,0),n.length,!0))}function U3(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,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&V3(t.doc,t.mapping.slice(s).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?c=!1:!p&&h&&(c=!0)}c===!1&&m1(t,o,a,s),Lm(t,t.mapping.slice(s).map(a,1),r,void 0,c===null);let u=t.mapping.slice(s),d=u.map(a,1),f=u.map(a+o.nodeSize,1);
vendor: 9,568 bytes, lines 53-54
53return t.step(new fn(d,f,d+1,f-1,new Re(he.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&p1(t,o,a,s),!1}})}function p1(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function m1(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(` 54`))}})}function V3(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function z3(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new fn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new Re(he.from(o),0,0),1,!0))}function Oi(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>s;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let g=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(p))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function W3(t,e,n=1,r){let i=t.doc.resolve(e),s=he.empty,o=he.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){s=he.from(i.node(a).copy(s));let u=r&&r[c];o=he.from(u?u.type.create(u.attrs,o):i.node(a).copy(o))}t.step(new tn(e,e,new Re(s.append(o),n,n),!0))}function fs(t,e){let n=t.resolve(e),r=n.index();return g1(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function K3(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function g1(t,e){return!!(t&&e&&!t.isLeaf&&K3(t,e))}function Cd(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&g1(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function q3(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let u=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);u&&!d?r=!1:!u&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);m1(t,u.node(),u.before(),a)}o.inlineContent&&Lm(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new tn(c,l.map(e+n,-1),Re.empty,!0)),r===!0){let u=t.doc.resolve(c);p1(t,u.node(),u.before(),t.steps.length)}return t}function G3(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function v1(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),c=r.node(o),u=!1;if(s==1)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function Od(t,e,n=e,r=Re.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return y1(i,s,r)?new tn(e,n,r):new Y3(i,s,r).fit()}function y1(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Y3{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=he.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=he.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new Re(s,o,a);return e>-1?new fn(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new tn(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=kf(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(o?c.matchType(o.type)||(d=c.fillBefore(he.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:d};if(n==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=kf(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Re(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=kf(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new Re(Da(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new Re(Da(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));d=d.matchFragment(i)}let p=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let g=a.child(c),m=d.matchType(g.type);if(!m)break;c++,(c>1||l==0||g.content.size)&&(d=m,u.push(b1(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=Na(this.placed,n,he.from(u)),this.frontier[n].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,m=a;g<p;g++){let b=m.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),m=b.content}this.unplaced=h?e==0?Re.empty:new Re(Da(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new Re(Da(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!wf(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=wf(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=wf(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Na(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Na(this.placed,this.depth,he.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(he.empty,!0);n.childCount&&(this.placed=Na(this.placed,this.frontier.length,n))}}function Da(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Da(t.firstChild.content,e-1,n)))}function Na(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Na(t.lastChild.content,e-1,n)))}function kf(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function b1(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,b1(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(he.empty,!0)))),t.copy(r)}function wf(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);
vendor: 8,709 bytes, line 54
54return a&&!X3(n,s.content,o)?a:null}function X3(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function J3(t){return t.spec.defining||t.spec.definingForContent}function Q3(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(y1(i,s,r))return t.step(new tn(e,n,r));let o=w1(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let f=i.depth,p=i.pos-1;f>0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;o.indexOf(f)>-1?a=f:i.before(f)==p&&o.splice(1,0,-f)}let l=o.indexOf(a),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=J3(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let g=0;g<o.length;g++){let m=o[(g+l)%o.length],b=!0;m<0&&(b=!1,m=-m);let T=i.node(m-1),E=i.index(m-1);if(T.canReplaceWith(E,E,h.type,h.marks))return t.replace(i.before(m),b?s.after(m):n,new Re(k1(r.content,0,r.openStart,p),p,r.openEnd))}}let d=t.steps.length;for(let f=o.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let p=o[f];p<0||(e=i.before(p),n=s.after(p))}}function k1(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(k1(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(he.empty,!0))}return t}function Z3(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=G3(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Re(he.from(r),0,0))}function ej(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let o=r.sharedDepth(n),a=!1;for(let l=r.depth;l>o;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>o;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=t.doc.resolve(e),i=t.doc.resolve(n)}}let s=w1(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function w1(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class Fo extends In{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return rn.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return rn.fromReplace(e,this.pos,this.pos+1,new Re(he.from(i),0,n.isLeaf?0:1))}getMap(){return er.empty}invert(e){return new Fo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Fo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Fo(n.pos,n.attr,n.value)}}In.jsonID("attr",Fo);class wl extends In{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return rn.ok(r)}getMap(){return er.empty}invert(e){return new wl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new wl(n.attr,n.value)}}In.jsonID("docAttr",wl);let Zo=class extends Error{};Zo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Zo.prototype=Object.create(Error.prototype);Zo.prototype.constructor=Zo;Zo.prototype.name="TransformError";class x1{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new kl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Zo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((s,o,a,l)=>{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=Re.empty){let i=Od(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Re(he.from(r),0,0))}delete(e,n){return this.replace(e,n,Re.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Q3(this,e,n,r),this}replaceRangeWith(e,n,r){return Z3(this,e,n,r),this}deleteRange(e,n){return ej(this,e,n),this}lift(e,n){return F3(this,e,n),this}join(e,n=1){return q3(this,e,n),this}wrap(e,n){return H3(this,e,n),this}setBlockType(e,n=e,r,i=null){return U3(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return z3(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Fo(e,n,r)),this}setDocAttribute(e,n){return this.step(new wl(e,n)),this}addNodeMark(e,n){return this.step(new Xi(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof Rt)n.isInSet(r.marks)&&this.step(new eo(e,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new eo(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return W3(this,e,n,r),this}addMark(e,n,r){return $3(this,e,n,r),this}removeMark(e,n,r){return D3(this,e,n,r),this}clearIncompatible(e,n,r){return Lm(this,e,n,r),this}}const xf=Object.create(null);class mt{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new tj(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=Re.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:c}=o[a],u=e.mapping.slice(s);e.replaceRange(u.map(l.pos),u.map(c.pos),a?Re.empty:n),a==0&&gy(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),c=l.map(o.pos),u=l.map(a.pos);s?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),gy(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ot(e):Eo(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?Eo(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Eo(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new nr(e.node(0))}static atStart(e){return Eo(e,e,0,0,1)||new nr(e)}static atEnd(e){return Eo(e,e,e.content.size,e.childCount,-1)||new nr(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=xf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in xf)throw new RangeError("Duplicate use of selection JSON ID "+e);return xf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ot.between(this.$anchor,this.$head).getBookmark()}}mt.prototype.visible=!0;class tj{constructor(e,n){this.$from=e,this.$to=n}}let py=!1;function my(t){!py&&!t.parent.inlineContent&&(py=!0,console.warn("TextSelection endpoint not pointing into a
54node with inline content ("+t.parent.type.name+")"))}class ot extends mt{constructor(e,n=e){my(e),my(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return mt.near(r);let i=e.resolve(n.map(this.anchor));return new ot(i.parent.inlineContent?i:r,r)}replace(e,n=Re.empty){if(super.replace(e,n),n==Re.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ot&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ad(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ot(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=mt.findFrom(n,r,!0)||mt.findFrom(n,-r,!0);if(s)n=s.$head;else return mt.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(mt.findFrom(e,-r,!0)||mt.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ot(e,n)}}mt.jsonID("text",ot);class Ad{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ad(e.map(this.anchor),e.map(this.head))}resolve(e){return ot.between(e.resolve(this.anchor),e.resolve(this.head))}}class qe extends mt{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?mt.near(s):new qe(s)}content(){return new Re(he.from(this.node),0,0)}eq(e){return e instanceof qe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Rm(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new qe(e.resolve(n.anchor))}static create(e,n){return new qe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}qe.prototype.visible=!1;mt.jsonID("node",qe);class Rm{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ad(r,r):new Rm(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&qe.isSelectable(r)?new qe(n):mt.near(n)}}class nr extends mt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=Re.empty){if(n==Re.empty){e.delete(0,e.doc.content.size);let r=mt.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new nr(e)}map(e){return new nr(e)}eq(e){return e instanceof nr}getBookmark(){return nj}}mt.jsonID("all",nr);const nj={map(){return this},resolve(t){return new nr(t)}};function Eo(t,e,n,r,i,s=!1){if(e.inlineContent)return ot.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&qe.isSelectable(a))return qe.create(t,n-(i<0?a.nodeSize:0))}else{let l=Eo(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function gy(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof tn||i instanceof fn))return;let s=t.mapping.maps[r],o;s.forEach((a,l,c,u)=>{o==null&&(o=u)}),t.setSelection(mt.near(t.doc.resolve(o),n))}const vy=1,kc=2,yy=4;class rj extends x1{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|vy)&~kc,this.storedMarks=null,this}get selectionSet(){return(this.updated&vy)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=kc,this}ensureMarks(e){return Rt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&kc)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~kc,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Rt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(mt.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=yy,this}get scrolledIntoView(){return(this.updated&yy)>0}}function by(t,e){return!e||!t?t:t.bind(e)}class Fa{constructor(e,n,r){this.name=e,this.init=by(n.init,r),this.apply=by(n.apply,r)}}const ij=[new Fa("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Fa("selection",{init(t,e){return t.selection||mt.atStart(e.doc)},apply(t){return t.selection}}),new Fa("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Fa("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Sf{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ij.slice(),n&&n.forEac
vendor: 4,313 bytes, line 54
54h(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Fa(r.key,r.spec.state,r))})}}class Lo{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,c=i?i[o].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<o?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Lo(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new rj(this)}static create(e){let n=new Sf(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Lo(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Sf(this.schema,e.plugins),r=n.fields,i=new Lo(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Sf(e.schema,e.plugins),s=new Lo(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Ci.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=mt.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=c.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function S1(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=S1(i,e,{})),n[r]=i}return n}class an{constructor(e){this.spec=e,this.props={},e.props&&S1(e.props,this,this.props),this.key=e.key?e.key.key:T1("plugin")}getState(e){return e[this.key]}}const Tf=Object.create(null);function T1(t){return t in Tf?t+"$"+ ++Tf[t]:(Tf[t]=0,t+"$")}class Ln{constructor(e="key"){this.key=T1(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const yn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ea=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Bh=null;const yi=function(t,e,n){let r=Bh||(Bh=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},sj=function(){Bh=null},to=function(t,e,n,r){return n&&(ky(t,e,n,r,-1)||ky(t,e,n,r,1))},oj=/^(img|br|input|textarea|hr)$/i;function ky(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:dr(t))){let o=t.parentNode;if(!o||o.nodeType!=1||nc(t)||oj.test(t.nodeName)||t.contentEditable=="false")return!1;e=yn(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?dr(t):0}else return!1}}function dr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function aj(t,e){for(;;
vendor: 6,145 bytes, line 54
54){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=dr(t)}else if(t.parentNode&&!nc(t))e=yn(t),t=t.parentNode;else return null}}function lj(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!nc(t))e=yn(t)+1,t=t.parentNode;else return null}}function cj(t,e,n){for(let r=e==0,i=e==dr(t);r||i;){if(t==n)return!0;let s=yn(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==dr(t)}}function nc(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Md=function(t){return t.focusNode&&to(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Ls(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function uj(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function dj(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(dr(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(dr(r.startContainer),r.startOffset)}}}const si=typeof navigator<"u"?navigator:null,wy=typeof document<"u"?document:null,hs=si&&si.userAgent||"",Hh=/Edge\/(\d+)/.exec(hs),_1=/MSIE \d/.exec(hs),Uh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hs),Wn=!!(_1||Uh||Hh),es=_1?document.documentMode:Uh?+Uh[1]:Hh?+Hh[1]:0,mr=!Wn&&/gecko\/(\d+)/i.test(hs);mr&&+(/Firefox\/(\d+)/.exec(hs)||[0,0])[1];const Vh=!Wn&&/Chrome\/(\d+)/.exec(hs),dn=!!Vh,E1=Vh?+Vh[1]:0,Mn=!Wn&&!!si&&/Apple Computer/.test(si.vendor),ta=Mn&&(/Mobile\/\w+/.test(hs)||!!si&&si.maxTouchPoints>2),cr=ta||(si?/Mac/.test(si.platform):!1),C1=si?/Win/.test(si.platform):!1,ki=/Android \d/.test(hs),rc=!!wy&&"webkitFontSmoothing"in wy.documentElement.style,fj=rc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function hj(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function fi(t,e){return typeof t=="number"?t:t[e]}function pj(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function xy(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=ea(o);continue}let a=o,l=a==s.body,c=l?hj(s):pj(a),u=0,d=0;if(e.top<c.top+fi(r,"top")?d=-(c.top-e.top+fi(i,"top")):e.bottom>c.bottom-fi(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+fi(i,"top")-c.top:e.bottom-c.bottom+fi(i,"bottom")),e.left<c.left+fi(r,"left")?u=-(c.left-e.left+fi(i,"left")):e.right>c.right-fi(r,"right")&&(u=e.right-c.right+fi(i,"right")),u||d)if(l)s.defaultView.scrollBy(u,d);else{let p=a.scrollLeft,h=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let g=a.scrollLeft-p,m=a.scrollTop-h;e={left:e.left-g,top:e.top-m,right:e.right-g,bottom:e.bottom-m}}let f=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:ea(o)}}function mj(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:O1(t.dom)}}function O1(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=ea(r));return e}function gj({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;A1(n,r==0?0:r-e)}function A1(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let bo=null;function vj(t){if(t.setActive)return t.setActive();if(bo)return t.focus(bo);let e=O1(t);t.focus(bo==null?{get preventScroll(){return bo={preventScroll:!0},!0}}:void 0),bo||(bo=!1,A1(e,0))}function M1(t,e){let n,r=2e8,i,s=0,o=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=yi(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=o&&h.bottom>=a){o=Math.max(h.bottom,o),a=Math.min(h.top,a);let g=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,u.nodeType==1&&g&&(s=d+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(s=d+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?yj(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:M1(n,i)}function yj(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let o=Bi(r,1);if(o.top!=o.bottom&&$m(e,o)){i={node:t,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function $m(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function bj(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function kj(t,e,n){let{node:r,offset:i}=M1(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function wj(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>
vendor: 4,373 bytes, line 54
54r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function I1(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if($m(e,c))return I1(o,e,c)}}if((s=(s+1)%r)==i)break}return t}function xj(t,e){let n=t.dom.ownerDocument,r,i=0,s=dj(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=t.dom.getBoundingClientRect();if(!$m(e,c)||(o=I1(t.dom,e,c),!o))return null}if(Mn)for(let c=o;r&&c;c=ea(c))c.draggable&&(r=void 0);if(o=bj(o,e),r){if(mr&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let c;rc&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=wj(t,r,i,e))}a==null&&(a=kj(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Sy(t){return t.top<t.bottom||t.left<t.right}function Bi(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Sy(r))return r}return Array.prototype.find.call(n,Sy)||t.getBoundingClientRect()}const Sj=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function L1(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=rc||mr;if(r.nodeType==3)if(o&&(Sj.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=Bi(yi(r,i,i),n);if(mr&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=Bi(yi(r,i-1,i-1),-1);if(c.top==l.top){let u=Bi(yi(r,i,i+1),-1);if(u.top!=l.top)return Sa(u,u.left<c.left)}}return l}else{let l=i,c=i,u=n<0?1:-1;return n<0&&!i?(c++,u=-1):n>=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Sa(Bi(yi(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==dr(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return _f(l.getBoundingClientRect(),!1)}if(s==null&&i<dr(r)){let l=r.childNodes[i];if(l.nodeType==1)return _f(l.getBoundingClientRect(),!0)}return _f(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==dr(r))){let l=r.childNodes[i-1],c=l.nodeType==3?yi(l,dr(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Sa(Bi(c,1),!1)}if(s==null&&i<dr(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?yi(l,0,o?0:1):l.nodeType==1?l:null:null;if(c)return Sa(Bi(c,-1),!0)}return Sa(Bi(r.nodeType==3?yi(r):r,-n),n>=0)}function Sa(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function _f(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function P1(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function Tj(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return P1(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=L1(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=yi(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const _j=/[\u0590-\u08ac]/;function Ej(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!_j.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:P1(t,e,()=>
vendor: 7,093 bytes, lines 54-55
54{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:g}=t.domSelectionRange(),m=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),m}):r.pos==r.start()||r.pos==r.end()}let Ty=null,_y=null,Ey=!1;function Cj(t,e,n){return Ty==e&&_y==n?Ey:(Ty=e,_y=n,Ey=n=="up"||n=="down"?Tj(t,e,n):Ej(t,e,n))}const gr=0,Cy=1,$s=2,oi=3;class ic{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=gr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>yn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof $1){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof R1&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?yn(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?yn(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],c=o+l.size;if(i==-1&&e<=c){let u=o+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=o;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=yn(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=yn(d.dom);break}n+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),o=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let g=this.children[p],m=h+g.size;if(s>h&&o<m)return g.setSelection(e-h-g.border,n-h-g.border,r,i);h=m}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((mr||Mn)&&e==n){let{node:p,offset:h}=a;if(p.nodeType==3){if(d=!!(h&&p.nodeValue[h-1]==` 55`),d&&h==p.nodeValue.length)for(let g=p,m;g;g=g.parentNode){if(m=g.nextSibling){m.nodeName=="BR"&&(a=l={node:m.parentNode,offset:yn(m)+1});break}let b=g.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let g=p.childNodes[h-1];d=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(mr&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||d&&Mn)&&to(a.node,a.offset,u.anchorNode,u.anchorOffset)&&to(l.node,l.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(d&&mr)){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let h=a;a=l,l=h}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?$s:Cy,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=oi:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?$s:oi}r=o}this.dirty=$s}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?$s:Cy;n.dirty<r&&(n.dirty=r)}
vendor: 3,738 bytes, line 55
55}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class R1 extends ic{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==gr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Oj extends ic{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class no extends ic{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=ds.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new no(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&oi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=oi&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=gr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=gr}}slice(e,n,r){let i=no.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=Wh(s,n,o,r)),e>0&&(s=Wh(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ts extends ic{constructor(e,n,r,i,s,o,a,l,c){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,c=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=ds.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=F1(u,r,n),c?l=new Aj(e,n,r,i,u,d||null,f,c,s,o+1):n.isText?new Id(e,n,r,i,u,f,s):new ts(e,n,r,i,u,d||null,f,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>he.empty)}return e}matchesNode(e,n,r){return this.dirty==gr&&e.eq(this.node)&&vu(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}
vendor: 17,712 bytes, line 55
55updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new Ij(this,o&&o.node,e);Rj(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e,u):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Rt.none:this.node.child(u).marks,r,e,u),l.placeWidget(c,e,i)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e,f);let p;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(p=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(c,u,d,p,e)||l.updateNextNode(c,u,d,e,f,i)||l.addNode(c,u,d,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==$s)&&(o&&this.protectLocalComposition(e,o),D1(this.contentDOM,this.children,e),ta&&$j(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ot)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=Dj(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new Oj(this,s,n,i);e.input.compositionNodes.push(o),this.children=Wh(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==oi||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=gr}updateOuterDeco(e){if(vu(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=N1(this.dom,this.nodeDOM,zh(this.outerDeco,this.node,n),zh(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Oy(t,e,n,r,i){F1(r,e,t);let s=new ts(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Id extends ts{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==oi||this.dirty!=gr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=gr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=gr,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Id(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=oi)}get domAtom(){return!1}isText(e){return this.node.text==e}}class $1 extends ic{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==gr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Aj extends ts{constructor(e,n,r,i,s,o,a,l,c,u){super(e,n,r,i,s,o,a,c,u),this.spec=l}update(e,n,r,i){if(this.dirty==oi)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function D1(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=Ay(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof no){let l=r?r.previousSibling:t.lastChild;D1(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Ay(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Za=function(t){t&&(this.nodeName=t)};Za.prototype=Object.create(null);const Ds=[new Za];function zh(t,e,n){if(t.length==0)return Ds;let r=n?Ds[0]:new Za,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new Za(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Za(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function N1(t,e,n,r){if(n==Ds&&r==Ds)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Ds[0]),i=l}Mj(i,a||Ds[0],o)}return i}function Mj(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function F1(t,e,n){return N1(t,t,Ds,zh(e,n,t.nodeType!=1))}function vu(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Ay(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Ij{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Lj(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,i){let s=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;s<a&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=gr,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1,c=this.top.children.length;i<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let u=this.index;u<c;u++){let d=this.top.children[u];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){l=u;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=no.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==oi&&o.dom==o.contentDOM&&(o.dirty=$s),o.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ts){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=oi&&vu(n,l.outerDeco));if(!f&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,n,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=$s,d.updateChildren(i,o+1),d.dirty=gr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!vu(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=ts.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let o=ts.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new R1(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof no;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Id)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Mn||dn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new $1(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Lj(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof no)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function Pj(t,e){return t.type.side-e.type.side}function Rj(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,i,e.forChild(s,u),c),s+=u.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let u,d;for(;o<i.length&&i[o].to==s;){let m=i[o++];m.widget&&(u?(d||(d=[u])).push(m):u=m)}if(u)if(d){d.sort(Pj);for(let m=0;m<d.length;m++)n(d[m],c,!!l)}else n(u,c,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let m=0;m<a.length;m++)a[m].to<=s&&a.splice(m--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let h=s+f.nodeSize;if(f.isText){let m=h;o<i.length&&i[o].from<m&&(m=i[o].from);for(let b=0;b<a.length;b++)a[b].to<m&&(m=a[b].to);m<h&&(l=f.cut(m-s),f=f.cut(0,m-s),h=m,p=-1)}else for(;o<i.length&&i[o].to<h;)o++;let g=f.isInline&&!f.isLeaf?a.filter(m=>!m.inline):a.slice();r(f,g,e.forChild(s,f),p),s=h}}function $j(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Dj(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let c=t.child(i++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Wh(t,e,n,r,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],c=a,u=a+=l.size;c>=n||u<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,r)),i&&(s.push(i),i=void 0),u>n&&s.push(l.slice(n-c,l.size,r)))}return s}function Dm(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,c;if(Md(n)){for(l=o;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&qe.isSelectable(d)&&i.parent&&!(d.isInline&&cj(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new qe(o==f?a:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=o,f=o;for(let p=0;p<n.rangeCount;p++){let h=n.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[l,o]=f==t.state.selection.anchor?[f,d]:[d,f],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let d=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;c=Nm(t,u,a,d)}return c}function j1(t){return t.editable?t.hasFocus():H1(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ai(t,e=!1){let n=t.state.selection;if(B1(t,n),!j1(t))return;let r=t.input.mouseDown;if(!e&&dn&&r){let i=t.domSelectionRange(),s=t.domObserver.currentSelection;if(i.anchorNode&&s.anchorNode&&to(i.anchorNode,i.anchorOffset,s.anchorNode,s.anchorOffset)&&r.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Fj(t);else{let{anchor:i,head:s}=n,o,a;My&&!(n instanceof ot)&&(n.$from.parent.inlineContent||(o=Iy(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=Iy(t,n.to))),t.docView.setSelection(i,s,t,e),My&&(o&&Ly(o),a&&Ly(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Nj(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const My=Mn||dn&&E1<63;function Iy(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Mn&&i&&i.contentEditable=="false")return Ef(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Ef(i);if(s)return Ef(s)}}function Ef(t){return t.contentEditable="true",Mn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Ly(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Nj(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!j1(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Fj(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,yn(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Wn&&es<=11&&(n.disabled=!0,n.disabled=!1)}function B1(t,e){if(e instanceof qe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Py(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Py(t)}function Py(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Nm(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ot.between(e,n,r)}function Ry(t){return t.editable&&!t.hasFocus()?!1:H1(t)}function H1(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function jj(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return to(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Kh(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&mt.findFrom(s,e)}function Ui(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function $y(t,e,n){let r=t.state.selection;if(r instanceof ot)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Ui(t,new ot(r.$anchor,o))}
vendor: 4,167 bytes, line 55
55else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Kh(t.state,e);return i&&i instanceof qe?Ui(t,i):!1}else if(!(cr&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?qe.isSelectable(s)?Ui(t,new qe(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):rc?Ui(t,new ot(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof qe&&r.node.isInline)return Ui(t,new ot(e>0?r.$to:r.$from));{let i=Kh(t.state,e);return i?Ui(t,i):!1}}}function yu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function el(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ko(t,e){return e<0?Bj(t):Hj(t)}function Bj(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(mr&&n.nodeType==1&&r<yu(n)&&el(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(el(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(U1(n))break;{let a=n.previousSibling;for(;a&&el(a,-1);)i=n.parentNode,s=yn(a),a=a.previousSibling;if(a)n=a,r=yu(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?qh(t,n,r):i&&qh(t,i,s)}function Hj(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=yu(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(el(a,1))s=n,o=++r;else break}else{if(U1(n))break;{let a=n.nextSibling;for(;a&&el(a,1);)s=a.parentNode,o=yn(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=yu(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&qh(t,s,o)}function U1(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Uj(t,e){for(;t&&e==t.childNodes.length&&!nc(t);)e=yn(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Vj(t,e){for(;t&&!e&&!nc(t);)e=yn(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function qh(t,e,n){if(e.nodeType!=3){let s,o;(o=Uj(e,n))?(e=o,n=0):(s=Vj(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Md(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Ai(t)},50)}function Dy(t,e){let n=t.state.doc.resolve(e);if(!(dn||C1)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Ny(t,e,n){let r=t.state.selection;if(r instanceof ot&&!r.empty||n.indexOf("s")>-1||cr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=Kh(t.state,e);if(o&&o instanceof qe)return Ui(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof nr?mt.near(o,e):mt.findFrom(o,e);return a?Ui(t,a):!1}return!1}function Fy(t,e){if(!(t.state.selection instanceof ot))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function jy(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function zj(t){if(!Mn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;jy(t,r,"true"),setTimeout(()=>jy(t,r,"false"),20)}return!1}function Wj(t){let e="";
vendor: 4,156 bytes, lines 55-58
55return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Kj(t,e){let n=e.keyCode,r=Wj(e);if(n==8||cr&&n==72&&r=="c")return Fy(t,-1)||ko(t,-1);if(n==46&&!e.shiftKey||cr&&n==68&&r=="c")return Fy(t,1)||ko(t,1);if(n==13||n==27)return!0;if(n==37||cr&&n==66&&r=="c"){let i=n==37?Dy(t,t.state.selection.from)=="ltr"?-1:1:-1;return $y(t,i,r)||ko(t,i)}else if(n==39||cr&&n==70&&r=="c"){let i=n==39?Dy(t,t.state.selection.from)=="ltr"?1:-1:1;return $y(t,i,r)||ko(t,i)}else{if(n==38||cr&&n==80&&r=="c")return Ny(t,-1,r)||ko(t,-1);if(n==40||cr&&n==78&&r=="c")return zj(t)||Ny(t,1,r)||ko(t,1);if(r==(cr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Fm(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=t.someProp("clipboardSerializer")||ds.fromSchema(t.state.schema),a=G1(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=q1[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` 56 57`);return{dom:l,text:f,slice:e}}function V1(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,s||r,t)}),s)return a=new Re(he.from(t.state.schema.text(e.replace(/\r\n?/g,` 58`))),0,0),t.someProp("transformPasted",f=>{a=f(a,t,!0)}),a;let d=t.someProp("clipboardTextParser",f=>f(e,i,r,t));if(d)a=d;else{let f=i.marks(),{schema:p}=t.state,h=ds.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=o.appendChild(document.createElement("p"));g&&m.appendChild(h.serializeNode(p.text(g,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),o=Xj(n),rc&&Jj(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Zi.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!qj.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=Qj(By(a,+u[1],+u[2]),u[4]);else if(a=Re.maxOpen(Gj(a.content,i),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d<a.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=By(a,d,f)}return t.someProp("transformPasted",d=>{a=d(a,t,l)}),a}const qj=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Gj(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),c;if(!l)return o=null;if(c=o.length&&s.length&&W1(l,s,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=K1(o[o.length-1],s.length));let u=z1(a,l);o.push(u),i=i.matchType(u.type),s=l}}),o)return he.from(o)}return t}function z1(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,he.from(t));return t}function W1(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=W1(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(he.from(z1(n,t,i+1))))}}function K1(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,K1(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(he.empty,!0);return t.copy(n.append(r))}
vendor: 4,816 bytes, line 58
58function Gh(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<r-1&&(a=Gh(a,e,n,r,i+1,s)),i>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(he.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function By(t,e,n){return e<t.openStart&&(t=new Re(Gh(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Re(Gh(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const q1={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Hy=null;function G1(){return Hy||(Hy=document.implementation.createHTMLDocument("title"))}let Cf=null;function Yj(t){let e=window.trustedTypes;return e?(Cf||(Cf=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Cf.createHTML(t)):t}function Xj(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=G1().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&q1[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=Yj(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function Jj(t){let e=t.querySelectorAll(dn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent=="Â "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function Qj(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=he.from(l.create(r[a+1],i)),s++,o++}return new Re(i,s,o)}const Nn={},Fn={},Zj={touchstart:!0,touchmove:!0};class eB{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function tB(t){for(let e in Nn){let n=Nn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{rB(t,r)&&!jm(t,r)&&(t.editable||!(r.type in Fn))&&n(t,r)},Zj[e]?{passive:!0}:void 0)}Mn&&t.dom.addEventListener("input",()=>null),Yh(t)}function wi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function nB(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Yh(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>jm(t,r))})}function jm(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function rB(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function iB(t,e){!jm(t,e)&&Nn[e.type]&&(t.editable||!(e.type in Fn))&&Nn[e.type](t,e)}Fn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Q1(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(ki&&dn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ta&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Ls(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Kj(t,n)?n.preventDefault():wi(t,"key")};Fn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Fn.keypress=(t,e)=>{let n=e;if(Q1(t)||!n.charCode||n.ctrlKey&&!n.altKey||cr&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ot)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function sc(t){return{left:t.clientX,top:t.clientY}}function sB(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}
vendor: 14,959 bytes, line 58
58function Bm(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function oc(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function oB(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&qe.isSelectable(r)?(oc(t,new qe(n)),!0):!1}function aB(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof qe&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(qe.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(oc(t,qe.create(t.state.doc,i)),!0):!1}function lB(t,e,n,r,i){return Bm(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?aB(t,n):oB(t,n))}function cB(t,e,n,r){return Bm(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function uB(t,e,n,r){return Bm(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||dB(t,n,r)}function dB(t,e,n){if(n.button!=0)return!1;let r=Y1(t,e,!0),i=t.state.doc;return r?(oc(t,r),r instanceof ot&&i.eq(t.state.doc)&&(t.input.mouseDown=new hB(t,r)),!0):!1}function Y1(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?ot.create(r,0,r.content.size):null;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)return ot.create(r,a+1,a+1+o.content.size);if(n&&qe.isSelectable(o))return qe.create(r,a)}return null}function Hm(t){return bu(t)}const X1=cr?"metaKey":"ctrlKey";Nn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Hm(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&sB(n,t.input.lastClick)&&!n[X1]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let o=t.posAtCoords(sc(n));o&&(s=="singleClick"?t.input.mouseDown=new fB(t,o,n,!!r):(s=="doubleClick"?cB:uB)(t,o.pos,o.inside,n)?n.preventDefault():wi(t,"pointer"))};class J1{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class fB extends J1{constructor(e,n,r,i){super(e),this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[X1],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let u=e.state.doc.resolve(n.pos);s=u.parent,o=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof qe&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&mr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),wi(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Ai(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(sc(e))),this.updateAllowDefault(e),this.allowDefault||!n?wi(this.view,"pointer"):lB(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Mn&&this.mightDrag&&!this.mightDrag.node.isAtom||dn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(oc(this.view,mt.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):wi(this.view,"pointer")}move(e){this.updateAllowDefault(e),wi(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class hB extends J1{constructor(e,n){super(e),this.startSelection=n,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),wi(this.view,"pointer");let n=this.view.posAtCoords(sc(e)),r=n&&Y1(this.view,n.inside,!1);if(!r)return;let{doc:i}=this.view.state,s=this.startSelection,[o,a]=r.from<s.from?[s.to,r.from]:[s.from,r.to];oc(this.view,ot.create(i,o,a))}}Nn.touchstart=t=>{t.input.lastTouch=Date.now(),Hm(t),wi(t,"pointer")};Nn.touchmove=t=>{t.input.lastTouch=Date.now(),wi(t,"pointer")};Nn.contextmenu=t=>Hm(t);function Q1(t,e){return t.composing?!0:Mn&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const pB=ki?5e3:-1;Fn.compositionstart=Fn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ot&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||dn&&C1&&mB(t)))t.markCursor=t.state.storedMarks||n.marks(),bu(t,!0),t.markCursor=null;else if(bu(t,!e.selection.empty),mr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}Z1(t,pB)};function mB(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Fn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Z1(t,20))};function Z1(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>bu(t),e))}function ex(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function gB(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=aj(e.focusNode,e.focusOffset),r=lj(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function bu(t,e=!1){if(!(ki&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ex(t),e||t.docView&&t.docView.dirty){let n=Dm(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function vB(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const xl=Wn&&es<15||ta&&fj<604;Nn.copy=Fn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=xl?null:n.clipboardData,o=r.content(),{dom:a,text:l}=Fm(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):vB(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function yB(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function bB(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Sl(t,r.value,null,i,e):Sl(t,r.textContent,r.innerHTML,i,e)},50)}function Sl(t,e,n,r,i){let s=V1(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||Re.empty)))return!0;if(!s)return!1;let o=yB(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function tx(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Fn.paste=(t,e)=>{let n=e;if(t.composing&&!ki)return;let r=xl?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Sl(t,tx(r),r.getData("text/html"),i,n)?n.preventDefault():bB(t,n)};class nx{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const kB=cr?"altKey":"ctrlKey";function rx(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[kB]}Nn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(sc(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof qe?i.to-1:i.to))){if(r&&r.mightDrag)o=qe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(o=qe.create(t.state.doc,d.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:c,slice:u}=Fm(t,a);(!n.dataTransfer.files.length||!dn||E1>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(xl?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",xl||n.dataTransfer.setData("text/plain",c),t.dragging=new nx(u,rx(t,n),o)};Nn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Fn.dragover=Fn.dragenter=(t,e)=>e.preventDefault();Fn.drop=(t,e)=>{try{wB(t,e,t.dragging)}finally{t.dragging=null}};function wB(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(sc(e));if(!r)return;let i=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",p=>{s=p(s,t,!1)}):s=V1(t,tx(e.dataTransfer),xl?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&rx(t,e));if(t.someProp("handleDrop",p=>p(t,e,s||Re.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?v1(t.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=t.state.tr;if(o){let{node:p}=n;p?p.replace(l):l.deleteSelection()}let c=l.mapping.map(a),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=l.doc;if(u?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(d))return;let f=l.doc.resolve(c);if(u&&qe.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new qe(f));else{let p=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((h,g,m,b)=>p=b),l.setSelection(Nm(t,f,l.doc.resolve(p)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}Nn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ai(t)},20))};Nn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Nn.beforeinput=(t,e)=>{if(dn&&ki&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,Ls(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Fn)Nn[t]=Fn[t];function Tl(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class ku{constructor(e,n){this.toDOM=e,this.spec=n||qs,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new tr(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ku&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Tl(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ns{constructor(e,n){this.attrs=e,this.spec=n||qs}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new tr(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof ns&&Tl(this.attrs,e.attrs)&&Tl(this.spec,e.spec)}static is(e){return e.type instanceof ns}destroy(){}}class Um{constructor(e,n){this.attrs=e,this.spec=n||qs}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new tr(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof Um&&Tl(this.attrs,e.attrs)&&Tl(this.spec,e.spec)}destroy(){}}class tr{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new tr(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new tr(e,e,new ku(n,r))}static inline(e,n,r,i){return new tr(e,n,new ns(r,i))}
vendor: 4,234 bytes, line 58
58static node(e,n,r,i){return new tr(e,n,new Um(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ns}get widget(){return this.type instanceof ku}}const Co=[],qs={};class nn{constructor(e,n){this.local=e.length?e:Co,this.children=n.length?n:Co}static create(e,n){return n.length?wu(n,e,0,qs):Cn}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==Cn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||qs)}mapInner(e,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?xB(this.children,o||[],e,n,r,i,s):o?new nn(o.sort(Gs),Co):Cn}add(e,n){return n.length?this==Cn?nn.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,l)=>{let c=l+r,u;if(u=sx(n,a,c)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,u,c+1):i.splice(s,0,l,l+a.nodeSize,wu(u,a,c+1,qs)),s+=3}});let o=ix(s?ox(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new nn(o.length?this.local.concat(o).sort(Gs):this.local,i||this.children)}remove(e){return e.length==0||this==Cn?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(o||(o=[])).push(d));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(o,a+1);c!=Cn?r[s+2]=c:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new nn(i,r):Cn}forChild(e,n){if(this==Cn)return this;if(n.isLeaf)return nn.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof ns){let c=Math.max(s,l.from)-s,u=Math.min(o,l.to)-s;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let a=new nn(i.sort(Gs),Co);return r?new Ki([a,r]):a}return r||Cn}eq(e){if(this==e)return!0;if(!(e instanceof nn)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Vm(this.localsInner(e))}localsInner(e){if(this==Cn)return Co;if(e.inlineContent||!this.local.some(ns.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ns||n.push(this.local[r]);return n}forEachSet(e){e(this)}}nn.empty=new nn([],[]);nn.removeOverlap=Vm;const Cn=nn.empty;class Ki{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,qs));return Ki.from(r)}forChild(e,n){if(n.isLeaf)return nn.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=Cn&&(s instanceof Ki?r=r.concat(s.members):r.push(s))}return Ki.from(r)}eq(e){if(!(e instanceof Ki)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?Vm(r?n:n.sort(Gs)):Co}static from(e){switch(e.length){case 0:return Cn;case 1:return e[0];default:return new Ki(e.every(n=>n instanceof nn)?e:e.reduce((n,r)=>n.concat(r instanceof nn?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;
vendor: 12,008 bytes, line 58
58n++)this.members[n].forEachSet(e)}}function xB(t,e,n,r,i,s,o){let a=t.slice();for(let c=0,u=s;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,p,h,g)=>{let m=g-h-(p-f);for(let b=0;b<a.length;b+=3){let T=a[b+1];if(T<0||f>T+u-d)continue;let E=a[b]+u-d;p>=E?a[b+1]=f<=E?-2:-1:f>=u&&m&&(a[b]+=m,a[b+1]+=m)}d+=m}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+s),d=u-i;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+s,-1),p=f-i,{index:h,offset:g}=r.content.findIndex(d),m=r.maybeChild(h);if(m&&g==d&&g+m.nodeSize==p){let b=a[c+2].mapInner(n,m,u+1,t[c]+s+1,o);b!=Cn?(a[c]=d,a[c+1]=p,a[c+2]=b):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=SB(a,t,e,n,i,s,o),u=wu(c,r,0,o);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let p=u.children[d];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new nn(e.sort(Gs),a)}function ix(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new tr(i.from+e,i.to+e,i.type))}return n}function SB(t,e,n,r,i,s,o){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,i,c);d?n.push(d):o.onRemove&&o.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function sx(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function ox(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function wu(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let c=sx(t,a,l+n);if(c){s=!0;let u=wu(c,a,n+l+1,r);u!=Cn&&i.push(l,l+a.nodeSize,u)}});let o=ix(s?ox(t):t,-n).sort(Gs);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new nn(o,i):Cn}function Gs(t,e){return t.from-e.from||t.to-e.to}function Vm(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),Uy(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),Uy(e,i,r.copy(s.from,r.to)));break}}}return e}function Uy(t,e,n){for(;e<t.length&&Gs(n,t[e])>0;)e++;t.splice(e,0,n)}function Of(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Cn&&e.push(r)}),t.cursorWrapper&&e.push(nn.create(t.state.doc,[t.cursorWrapper.deco])),Ki.from(e)}const TB={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},_B=Wn&&es<=11;class EB{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class CB{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new EB,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Wn&&es<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Mn&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),_B&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,TB)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ry(this.view)){if(this.suppressingSelectionUpdates)return Ai(this.view);if(Wn&&es<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&to(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=ea(s))n.add(s);for(let s=e.anchorNode;s;s=ea(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Ry(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(s=s<0?d.from:Math.min(d.from,s),o=o<0?d.to:Math.max(d.to,o),d.typeOver&&(a=!0))}if(l.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||dn&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(u=>u.type=="childList"&&u.removedNodes.length))){for(let u of l)if(u.nodeName=="BR"&&u.parentNode){let d=u.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){u.parentNode.removeChild(u);break}d=d.firstChild}}}else if(mr&&l.length){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&p.nodeName=="LI"&&(!d||MB(e,d)!=p)&&f.remove()}}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Md(r)&&(c=Dm(e))&&c.eq(mt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ai(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),OB(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,IB(e,l)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ai(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Wn&&es<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let o=i&&i.parentNode==e.target?yn(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?yn(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Vy=new WeakMap,zy=!1;function OB(t){if(!Vy.has(t)&&(Vy.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=mr,zy)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),zy=!0}}function Wy(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return to(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function AB(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Wy(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Wy(t,n):null}function MB(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function IB(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(s,a.firstChild),r==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function LB(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Md(l)||c.push({node:l.focusNode,offset:l.focusOffset})),dn&&t.input.lastKeyCode===8)for(let m=s;m>i;m--){let b=r.childNodes[m-1],T=b.pmViewDesc;if(b.nodeName=="BR"&&!T){s=m;break}if(!T||T.size)break}let d=t.state.doc,f=t.someProp("domParser")||Zi.fromSchema(t.state.schema),p=d.resolve(o),h=null,g=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:PB,context:p});if(c&&c[0].pos!=null){let m=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=m),h={anchor:m+o,head:b+o}}return{doc:g,sel:h,from:o,to:a}}function PB(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Mn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Mn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const RB=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function $B(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let I=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,j=Dm(t,I);
vendor: 1,194 bytes, line 58
58if(j&&!t.state.selection.eq(j)){if(dn&&ki&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",J=>J(t,Ls(13,"Enter"))))return;let $=t.state.tr.setSelection(j);I=="pointer"?$.setMeta("pointer",!0):I=="key"&&$.scrollIntoView(),s&&$.setMeta("composition",s),t.dispatch($)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=LB(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=FB(d.content,c.doc.content,c.from,f,p);if(h&&t.input.domChangeCount++,(ta&&t.input.lastIOSEnter>Date.now()-225||ki)&&i.some(I=>I.nodeType==1&&!RB.test(I.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",I=>I(t,Ls(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof ot&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let I=Ky(t,t.state.doc,c.sel);if(I&&!I.eq(t.state.selection)){let j=t.state.tr.setSelection(I);
vendor: 11,101 bytes, line 58
58s&&j.setMeta("composition",s),t.dispatch(j)}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof ot&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),Wn&&es<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)==" Â "&&(h.start--,h.endA--,h.endB--);let g=c.doc.resolveNoCache(h.start-c.from),m=c.doc.resolveNoCache(h.endB-c.from),b=u.resolve(h.start),T=g.sameParent(m)&&g.parent.inlineContent&&b.end()>=h.endA;if((ta&&t.input.lastIOSEnter>Date.now()-225&&(!T||i.some(I=>I.nodeName=="DIV"||I.nodeName=="P"))||!T&&g.pos<c.doc.content.size&&(!g.sameParent(m)||!g.parent.inlineContent)&&g.pos<m.pos&&!/\S/.test(c.doc.textBetween(g.pos,m.pos,"","")))&&t.someProp("handleKeyDown",I=>I(t,Ls(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&NB(u,h.start,h.endA,g,m)&&t.someProp("handleKeyDown",I=>I(t,Ls(8,"Backspace")))){ki&&dn&&t.domObserver.suppressSelectionUpdates();return}dn&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),ki&&!T&&g.start()!=m.start()&&m.parentOffset==0&&g.depth==m.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,m=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(I){return I(t,Ls(13,"Enter"))})},20));let E=h.start,w=h.endA,M=I=>{let j=I||t.state.tr.replace(E,w,c.doc.slice(h.start-c.from,h.endB-c.from));if(c.sel){let $=Ky(t,j.doc,c.sel);$&&!(dn&&t.composing&&$.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&($.head==E||$.head==j.mapping.map(w)-1)||Wn&&$.empty&&$.head==E)&&j.setSelection($)}return s&&j.setMeta("composition",s),j.scrollIntoView()},A;if(T)if(g.pos==m.pos){Wn&&es<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ai(t),20));let I=M(t.state.tr.delete(E,w)),j=u.resolve(h.start).marksAcross(u.resolve(h.endA));j&&I.ensureMarks(j),t.dispatch(I)}else if(h.endA==h.endB&&(A=DB(g.parent.content.cut(g.parentOffset,m.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start())))){let I=M(t.state.tr);A.type=="add"?I.addMark(E,w,A.mark):I.removeMark(E,w,A.mark),t.dispatch(I)}else if(g.parent.child(g.index()).isText&&g.index()==m.index()-(m.textOffset?0:1)){let I=g.parent.textBetween(g.parentOffset,m.parentOffset),j=()=>M(t.state.tr.insertText(I,E,w));t.someProp("handleTextInput",$=>$(t,E,w,I,j))||t.dispatch(j())}else t.dispatch(M());else t.dispatch(M())}function Ky(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Nm(t,e.resolve(n.anchor),e.resolve(n.head))}function DB(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)s=n[u].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(he.from(c).eq(t))return{mark:a,type:o}}function NB(t,e,n,r,i){if(n-e<=i.pos-r.pos||Af(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(Af(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Af(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Af(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function FB(t,e,n,r,i){let s=t.findDiffStart(e,n),o=n+t.size,a=n+e.size;if(s==null)return null;let{a:l,b:c}=t.findDiffEnd(e,o,a);if(i=="end"){let u=Math.max(0,s-Math.min(l,c));r-=l+u-s}if(l<s&&o<a){let u=r<=s&&r>=l?s-r:0;s-=u,c=s+(c-l),l=s}else if(c<s){let u=r<=s&&r>=c?s-r:0;s-=u,l=s+(l-c),c=s}return{start:s,endA:l,endB:c}}class ax{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new eB,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Jy),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Yy(this),Gy(this),this.nodeViews=Xy(this),this.docView=Oy(this.state.doc,qy(this),Of(this),this.dom,this),this.domObserver=new CB(this,(r,i,s,o)=>$B(this,r,i,s,o)),this.domObserver.start(),tB(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Yh(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Jy),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(ex(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=Xy(this);BB(p,this.nodeViews)&&(this.nodeViews=p,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Yh(this),this.editable=Yy(this),Gy(this);let l=Of(this),c=qy(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(i.selection))&&(o=!0);let f=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&mj(this);if(o){this.domObserver.stop();let p=d&&(Wn||dn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&jB(i.selection,e.selection);if(d){let g=dn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=gB(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Oy(e.doc,c,l,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}let h=this.input.mouseDown;p||!(h&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&jj(this)&&h.delaySelUpdate())?Ai(this,p):(B1(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&gj(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof qe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&xy(this,n.getBoundingClientRect(),e)}else xy(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new nx(e.slice,e.move,i<0?void 0:qe.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Wn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&vj(this.dom),Ai(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return xj(this,e)}coordsAtPos(e,n=1){return L1(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return Cj(this,n||this.state,e)}pasteHTML(e,n){return Sl(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Sl(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Fm(this,e)}destroy(){this.docView&&(nB(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Of(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,sj())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return iB(this,e)}domSelectionRange(){let e=this.domSelection();return e?Mn&&this.root.nodeType===11&&uj(this.dom.ownerDocument)==this.dom&&AB(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}ax.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function qy(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}
vendor: 4,159 bytes, line 58
58),e.translate||(e.translate="no"),[tr.node(0,t.state.doc.content.size,e)]}function Gy(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:tr.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Yy(t){return!t.someProp("editable",e=>e(t.state)===!1)}function jB(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Xy(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function BB(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Jy(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var ss={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},xu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},HB=typeof navigator<"u"&&/Mac/.test(navigator.platform),UB=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var bn=0;bn<10;bn++)ss[48+bn]=ss[96+bn]=String(bn);for(var bn=1;bn<=24;bn++)ss[bn+111]="F"+bn;for(var bn=65;bn<=90;bn++)ss[bn]=String.fromCharCode(bn+32),xu[bn]=String.fromCharCode(bn);for(var Mf in ss)xu.hasOwnProperty(Mf)||(xu[Mf]=ss[Mf]);function VB(t){var e=HB&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||UB&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?xu:ss)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const zB=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),WB=typeof navigator<"u"&&/Win/.test(navigator.platform);function KB(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))zB?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function qB(t){let e=Object.create(null);for(let n in t)e[KB(n)]=t[n];return e}function If(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function GB(t){return new an({props:{handleKeyDown:lx(t)}})}function lx(t){let e=qB(t);return function(n,r){let i=VB(r),s,o=e[If(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[If(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(WB&&r.ctrlKey&&r.altKey)&&(s=ss[r.keyCode])&&s!=i){let a=e[If(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const zm=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function cx(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const ux=(t,e,n)=>{let r=cx(t,n);if(!r)return!1;let i=Wm(r);if(!i){let o=r.blockRange(),a=o&&ya(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(bx(t,i,e,-1))return!0;
vendor: 4,282 bytes, lines 58-59
58if(r.parent.content.size==0&&(na(s,"end")||qe.isSelectable(s)))for(let o=r.depth;;o--){let a=Od(t.doc,r.before(o),r.after(o),Re.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(na(s,"end")?mt.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):qe.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},YB=(t,e,n)=>{let r=cx(t,n);if(!r)return!1;let i=Wm(r);return i?dx(t,i,e):!1},XB=(t,e,n)=>{let r=hx(t,n);if(!r)return!1;let i=Km(r);return i?dx(t,i,e):!1};function dx(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=Od(t.doc,s,l,Re.empty);if(!c||c.from!=s||c instanceof tn&&c.slice.size>=l-s)return!1;if(n){let u=t.tr.step(c);u.setSelection(ot.create(u.doc,s)),n(u.scrollIntoView())}return!0}function na(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const fx=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=Wm(r)}let o=s&&s.nodeBefore;return!o||!qe.isSelectable(o)?!1:(e&&e(t.tr.setSelection(qe.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function Wm(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function hx(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const px=(t,e,n)=>{let r=hx(t,n);if(!r)return!1;let i=Km(r);if(!i)return!1;let s=i.nodeAfter;if(bx(t,i,e,1))return!0;if(r.parent.content.size==0&&(na(s,"start")||qe.isSelectable(s))){let o=Od(t.doc,r.before(),r.after(),Re.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(na(s,"start")?mt.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):qe.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},mx=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=Km(r)}let o=s&&s.nodeAfter;return!o||!qe.isSelectable(o)?!1:(e&&e(t.tr.setSelection(qe.create(t.doc,s.pos)).scrollIntoView()),!0)};function Km(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const JB=(t,e)=>{let n=t.selection,r=n instanceof qe,i;if(r){if(n.node.isTextblock||!fs(t.doc,n.from))return!1;i=n.from}else if(i=Cd(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(qe.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},QB=(t,e)=>{let n=t.selection,r;if(n instanceof qe){if(n.node.isTextblock||!fs(t.doc,n.to))return!1;r=n.to}else if(r=Cd(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},ZB=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&ya(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},gx=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` 59`).scrollIntoView()),!0)};function qm(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const e4=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=qm(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(mt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},vx=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof nr||r.parent.inlineContent||i.parent.inlineContent)return!1;
vendor: 65,459 bytes, lines 59-138
59let s=qm(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(ot.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},yx=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Oi(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ya(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function t4(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof qe&&e.selection.node.isBlock)return!r.parentOffset||!Oi(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){l=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),a=qm(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),s.unshift(l&&a?{type:a}:null),o=p;break}else{if(p==1)return!1;s.unshift(null)}let u=e.tr;(e.selection instanceof ot||e.selection instanceof nr)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=Oi(u.doc,d,s.length,s);if(f||(s[0]=a?{type:a}:null,f=Oi(u.doc,d,s.length,s)),!f)return!1;if(u.split(d,s.length,s),!l&&c&&r.node(o).type!=a){let p=u.mapping.map(r.before(o)),h=u.doc.resolve(p);a&&r.node(o-1).canReplaceWith(h.index(),h.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(o)),a)}return n&&n(u.scrollIntoView()),!0}}const n4=t4(),r4=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(qe.create(t.doc,i))),!0)};function i4(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||fs(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function bx(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&i4(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let p=e.pos+s.nodeSize,h=he.empty;for(let b=o.length-1;b>=0;b--)h=he.from(o[b].create(null,h));h=he.from(i.copy(h));let g=t.tr.step(new fn(e.pos-1,p,e.pos,p,new Re(h,1,0),o.length,!0)),m=g.doc.resolve(p+2*o.length);m.nodeAfter&&m.nodeAfter.type==i.type&&fs(g.doc,m.pos)&&g.join(m.pos),n(g.scrollIntoView())}return!0}let u=s.type.spec.isolating||r>0&&l?null:mt.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&ya(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&na(s,"start",!0)&&na(i,"end")){let p=i,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let g=s,m=1;for(;!g.isTextblock;g=g.firstChild)m++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=he.empty;for(let E=h.length-1;E>=0;E--)b=he.from(h[E].copy(b));let T=t.tr.step(new fn(e.pos-h.length,e.pos+s.nodeSize,e.pos+m,e.pos+s.nodeSize-m,new Re(b,h.length,0),0,!0));n(T.scrollIntoView())}return!0}}return!1}function kx(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(ot.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const s4=kx(-1),o4=kx(1);function a4(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&Pm(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function Qy(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}function Gm(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Gm(zm,ux,fx);Gm(zm,px,mx);Gm(gx,vx,yx,n4);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function l4(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s);if(!o)return!1;let a=r?n.tr:null;return c4(a,o,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function c4(t,e,n,r=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);s=new mu(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new mu(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=Pm(s,n,r,e);return a?(t&&u4(t,e,a,i,n),!0):!1}function u4(t,e,n,r,i){let s=he.empty;for(let u=n.length-1;u>=0;u--)s=he.from(n[u].type.create(n[u].attrs,s));t.step(new fn(e.start-(r?2:0),e.end,e.start,e.end,new Re(s,0,0),n.length,!0));let o=0;for(let u=0;u<n.length;u++)n[u].type==i&&(o=u+1);let a=n.length-o,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&Oi(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function d4(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?f4(e,n,t,s):h4(e,n,s):!0:!1}}function f4(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new fn(s-1,o,s,o,new Re(he.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new mu(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=ya(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return fs(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function h4(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,h=n.endIndex-1,g=n.startIndex;h>g;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(a?0:1),u+1,o.content.append(l?he.empty:he.from(i))))return!1;let d=s.pos,f=d+o.nodeSize;return r.step(new fn(d-(a?1:0),f+(l?1:0),d+1,f-1,new Re((a?he.empty:he.from(i.copy(he.empty))).append(l?he.empty:he.from(i.copy(he.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function p4(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=he.from(c?t.create():null),d=new Re(he.from(t.create(null,he.from(a.type.create(null,u)))),c?3:1,0),f=s.start,p=s.end;n(e.tr.step(new fn(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function Ld(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}class Pd{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const d=l(...u)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a=[],l=!!e,c=e||s.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),a.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...g)=>{const m=this.buildProps(c,n),b=p(...g)(m);return a.push(b),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a={tr:e,editor:i,view:o,state:Ld({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class m4{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){const r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function Ne(t,e,n){return t.config[e]===void 0&&t.parent?Ne(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Ne(t.parent,e,n):null}):t.config[e]}function Rd(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function wx(t){const e=[],{nodeExtensions:n,markExtensions:r}=Rd(t),i=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage,extensions:i},l=Ne(o,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,p])=>{e.push({type:d,name:f,attribute:{...s,...p}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=Ne(o,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,d])=>{const f={...s,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:o.name,name:u,attribute:f})})}),e}function pn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function jt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?String(s).split(" "):[],l=r[i]?r[i].split(" "):[],c=a.filter(u=>!l.includes(u));r[i]=[...l,...c].join(" ")}else if(i==="style"){const a=s?s.split(";").map(u=>u.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[d,f]=u.split(":").map(p=>p.trim());c.set(d,f)}),a.forEach(u=>{const[d,f]=u.split(":").map(p=>p.trim());c.set(d,f)}),r[i]=Array.from(c.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[i]=s}),r},{})}function Xh(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>jt(n,r),{})}function xx(t){return typeof t=="function"}function vt(t,e=void 0,...n){return xx(t)?e?t.bind(e)(...n):t(...n):t}function g4(t={}){return Object.keys(t).length===0&&t.constructor===Object}function v4(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Zy(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):v4(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function eb(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&g4(n)?!1:n!=null))}function y4(t,e){var n;const r=wx(t),{nodeExtensions:i,markExtensions:s}=Rd(t),o=(n=i.find(c=>Ne(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(c=>{const u=r.filter(b=>b.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((b,T)=>{const E=Ne(T,"extendNodeSchema",d);return{...b,...E?E(c):{}}},{}),p=eb({...f,content:vt(Ne(c,"content",d)),marks:vt(Ne(c,"marks",d)),group:vt(Ne(c,"group",d)),inline:vt(Ne(c,"inline",d)),atom:vt(Ne(c,"atom",d)),selectable:vt(Ne(c,"selectable",d)),draggable:vt(Ne(c,"draggable",d)),code:vt(Ne(c,"code",d)),whitespace:vt(Ne(c,"whitespace",d)),linebreakReplacement:vt(Ne(c,"linebreakReplacement",d)),defining:vt(Ne(c,"defining",d)),isolating:vt(Ne(c,"isolating",d)),attrs:Object.fromEntries(u.map(b=>{var T;return[b.name,{default:(T=b==null?void 0:b.attribute)===null||T===void 0?void 0:T.default}]}))}),h=vt(Ne(c,"parseHTML",d));h&&(p.parseDOM=h.map(b=>Zy(b,u)));const g=Ne(c,"renderHTML",d);g&&(p.toDOM=b=>g({node:b,HTMLAttributes:Xh(b,u)}));const m=Ne(c,"renderText",d);return m&&(p.toText=m),[c.name,p]})),l=Object.fromEntries(s.map(c=>{const u=r.filter(m=>m.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((m,b)=>{const T=Ne(b,"extendMarkSchema",d);return{...m,...T?T(c):{}}},{}),p=eb({...f,inclusive:vt(Ne(c,"inclusive",d)),excludes:vt(Ne(c,"excludes",d)),group:vt(Ne(c,"group",d)),spanning:vt(Ne(c,"spanning",d)),code:vt(Ne(c,"code",d)),attrs:Object.fromEntries(u.map(m=>{var b;return[m.name,{default:(b=m==null?void 0:m.attribute)===null||b===void 0?void 0:b.default}]}))}),h=vt(Ne(c,"parseHTML",d));h&&(p.parseDOM=h.map(m=>Zy(m,u)));const g=Ne(c,"renderHTML",d);return g&&(p.toDOM=m=>g({mark:m,HTMLAttributes:Xh(m,u)})),[c.name,p]}));return new o1({topNode:o,nodes:a,marks:l})}function Lf(t,e){return e.nodes[t]||e.marks[t]||null}function tb(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Ym(t,e){const n=ds.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const b4=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,c;const u=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-s))}),n};function Xm(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class $d{constructor(e){this.find=e.find,this.handler=e.handler}}const k4=(t,e)=>{if(Xm(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function wc(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=b4(c)+s;return o.forEach(f=>{if(u)return;const p=k4(d,f.find);if(!p)return;const h=l.state.tr,g=Ld({state:l.state,transaction:h}),m={from:r-(p[0].length-s.length),to:i},{commands:b,chain:T,can:E}=new Pd({editor:n,state:g});f.handler({state:g,range:m,match:p,commands:b,chain:T,can:E})===null||!h.steps.length||(h.setMeta(a,{transform:h,from:r,to:i,text:s}),l.dispatch(h),u=!0)}),u}function w4(t){const{editor:e,rules:n}=t,r=new an({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=Ym(he.from(u),o.schema);const{from:d}=l,f=d+u.length;wc({editor:e,from:d,to:f,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return wc({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&wc({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?wc({editor:e,from:o.pos,to:o.pos,text:` 60`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function x4(t){return Object.prototype.toString.call(t).slice(8,-1)}function xc(t){return x4(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Dd(t,e){const n={...t};return xc(t)&&xc(e)&&Object.keys(e).forEach(r=>{xc(e[r])&&xc(t[r])?n[r]=Dd(t[r],e[r]):n[r]=e[r]}),n}class Pr{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=vt(Ne(this,"addOptions",{name:this.name}))),this.storage=vt(Ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Pr(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Dd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Pr(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=vt(Ne(n,"addOptions",{name:n.name})),n.storage=vt(Ne(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=o.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function S4(t){return typeof t=="number"}class T4{constructor(e){this.find=e.find,this.handler=e.handler}}const _4=(t,e,n)=>{if(Xm(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function E4(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:c,can:u}=new Pd({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,i,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;const g=Math.max(r,h),m=Math.min(i,h+p.content.size),b=p.textBetween(g-h,m-h,void 0,"");_4(b,s.find,o).forEach(E=>{if(E.index===void 0)return;const w=g+E.index+1,M=w+E[0].length,A={from:n.tr.mapping.map(w),to:n.tr.mapping.map(M)},I=s.handler({state:n,range:A,match:E,commands:l,chain:c,can:u,pasteEvent:o,dropEvent:a});d.push(I)})}),d.every(p=>p!==null)}let Sc=null;const C4=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function O4(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:u,from:d,to:f,rule:p,pasteEvt:h})=>{const g=u.tr,m=Ld({state:u,transaction:g});if(!(!E4({editor:e,state:m,from:Math.max(d-1,0),to:f.b-1,rule:p,pasteEvent:h,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new an({view(d){const f=h=>{var g;r=!((g=d.dom.parentElement)===null||g===void 0)&&g.contains(h.target)?d.dom.parentElement:null,r&&(Sc=e)},p=()=>{Sc&&(Sc=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(s=r===d.dom.parentElement,a=f,!s){const p=Sc;p!=null&&p.isEditable&&setTimeout(()=>{const h=p.state.selection;h&&p.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(d,f)=>{var p;const h=(p=f.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return o=f,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,p)=>{const h=d[0],g=h.getMeta("uiEvent")==="paste"&&!i,m=h.getMeta("uiEvent")==="drop"&&!s,b=h.getMeta("applyPasteRules"),T=!!b;if(!g&&!m&&!T)return;if(T){let{text:M}=b;typeof M=="string"?M=M:M=Ym(he.from(M),p.schema);const{from:A}=b,I=A+M.length,j=C4(M);return l({rule:u,state:p,from:A,to:{b:I},pasteEvt:j})}const E=f.doc.content.findDiffStart(p.doc.content),w=f.doc.content.findDiffEnd(p.doc.content);if(!(!S4(E)||!w||E===w.b))return l({rule:u,state:p,from:E,to:w,pasteEvt:o})}}))}function A4(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Po{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Po.resolve(e),this.schema=y4(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Po.sort(Po.flatten(e)),r=A4(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=Ne(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const s=Ne(r,"priority")||100,o=Ne(i,"priority")||100;return s>o?-1:s<o?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Lf(n.name,this.schema)},i=Ne(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Po.sort([...this.extensions].reverse()),r=[],i=[],s=n.map(o=>{const a={name:o.name,options:o.options,storage:o.storage,editor:e,type:Lf(o.name,this.schema)},l=[],c=Ne(o,"addKeyboardShortcuts",a);let u={};if(o.type==="mark"&&Ne(o,"exitable",a)&&(u.ArrowRight=()=>Pr.handleExit({editor:e,mark:o})),c){const g=Object.fromEntries(Object.entries(c()).map(([m,b])=>[m,()=>b({editor:e})]));u={...u,...g}}const d=GB(u);l.push(d);const f=Ne(o,"addInputRules",a);tb(o,e.options.enableInputRules)&&f&&r.push(...f());const p=Ne(o,"addPasteRules",a);tb(o,e.options.enablePasteRules)&&p&&i.push(...p());const h=Ne(o,"addProseMirrorPlugins",a);if(h){const g=h();l.push(...g)}return l}).flat();return[w4({editor:e,rules:r}),...O4({editor:e,rules:i}),...s]}get attributes(){return wx(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Rd(this.extensions);return Object.fromEntries(n.filter(r=>!!Ne(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:pn(r.name,this.schema)},o=Ne(r,"addNodeView",s);if(!o)return[];const a=(l,c,u,d,f)=>{const p=Xh(l,i);return o()({node:l,view:c,getPos:u,decorations:d,innerDecorations:f,editor:e,extension:r,HTMLAttributes:p})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Lf(e.name,this.schema)};e.type==="mark"&&(!((n=vt(Ne(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=Ne(e,"onBeforeCreate",r),s=Ne(e,"onCreate",r),o=Ne(e,"onUpdate",r),a=Ne(e,"onSelectionUpdate",r),l=Ne(e,"onTransaction",r),c=Ne(e,"onFocus",r),u=Ne(e,"onBlur",r),d=Ne(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}class kn{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=vt(Ne(this,"addOptions",{name:this.name}))),this.storage=vt(Ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new kn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Dd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new kn({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=vt(Ne(n,"addOptions",{name:n.name})),n.storage=vt(Ne(n,"addStorage",{name:n.name,options:n.options})),n}}function Sx(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=` 61 62`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,c,u,d)=>{var f;l.isBlock&&c>r&&(a+=s);const p=o==null?void 0:o[l.type.name];if(p)return u&&(a+=p({node:l,pos:c,parent:u,index:d,range:e})),!1;l.isText&&(a+=(f=l==null?void 0:l.text)===null||f===void 0?void 0:f.slice(Math.max(r,c)-c,i-c))}),a}function Tx(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const M4=kn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new an({key:new Ln("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(u=>u.$from.pos)),a=Math.max(...s.map(u=>u.$to.pos)),l=Tx(n);return Sx(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),I4=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),L4=(t=!1)=>({commands:e})=>e.setContent("",t),P4=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),f=c.resolve(u.map(l+a.nodeSize)),p=d.blockRange(f);if(!p)return;const h=ya(p);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,g)}(h||h===0)&&e.lift(p,h)})}),!0},R4=t=>e=>t(e),$4=()=>({state:t,dispatch:e})=>vx(t,e),D4=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new ot(r.doc.resolve(Math.max(o-1,0)))),!0},N4=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1},F4=t=>({tr:e,state:n,dispatch:r})=>{const i=pn(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),c=s.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1},j4=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},B4=()=>({state:t,dispatch:e})=>zm(t,e),H4=()=>({commands:t})=>t.keyboardShortcut("Enter"),U4=()=>({state:t,dispatch:e})=>e4(t,e);function Su(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Xm(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function _x(t,e,n={}){return t.find(r=>r.type===e&&Su(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function nb(t,e,n={}){return!!_x(t,e,n)}function Jm(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!_x([...i.node.marks],e,n)))return;let o=i.index,a=t.start()+i.offset,l=o+1,c=a+i.node.nodeSize;for(;o>0&&nb([...t.parent.child(o-1).marks],e,n);)o-=1,a-=t.parent.child(o).nodeSize;for(;l<t.parent.childCount&&nb([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function ps(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const V4=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=ps(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){const d=Jm(l,s,e);if(d&&d.from<=c&&d.to>=u){const f=ot.create(o,d.from,d.to);n.setSelection(f)}}return!0},z4=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Qm(t){return t instanceof ot}function xi(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Ex(t,e=null){if(!e)return null;const n=mt.atStart(t),r=mt.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?ot.create(t,xi(0,i,s),xi(t.content.size,i,s)):ot.create(t,xi(e,i,s),xi(e,i,s))}function Jh(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function _l(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function W4(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const K4=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(_l()||Jh())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),W4()&&!_l()&&!Jh()&&r.dom.focus({preventScroll:!0}))})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!Qm(n.state.selection))return o(),!0;const a=Ex(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},q4=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),G4=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Cx=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Cx(r)}return t};function Tc(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Cx(n)}function El(t,e,n){if(t instanceof Ci||t instanceof he)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return he.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),El("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new o1({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Zi.fromSchema(l).parseSlice(Tc(t),n.parseOptions):Zi.fromSchema(l).parse(Tc(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Zi.fromSchema(e);return n.slice?s.parseSlice(Tc(t),n.parseOptions).content:s.parse(Tc(t),n.parseOptions)}return El("",e,n)}function Y4(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof tn||i instanceof fn))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,c,u)=>{o===0&&(o=u)}),t.setSelection(mt.near(t.doc.resolve(o),n))}const X4=t=>!("type"in t),J4=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=m=>{s.emit("contentError",{editor:s,error:m,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{El(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(m){l(m)}try{a=El(e,s.schema,{parseOptions:c,errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:s.options.enableContentCheck})}catch(m){return l(m),!1}let{from:u,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0;if((X4(a)?a:[a]).forEach(m=>{m.check(),f=f?m.isText&&m.marks.length===0:!1,p=p?m.isBlock:!1}),u===d&&p){const{parent:m}=r.doc.resolve(u);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,d+=1)}let g;if(f){if(Array.isArray(e))g=e.map(m=>m.text||"").join("");else if(e instanceof he){let m="";e.forEach(b=>{b.text&&(m+=b.text)}),g=m}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,d)}else g=a,r.replaceWith(u,d,g);n.updateSelection&&Y4(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},Q4=()=>({state:t,dispatch:e})=>JB(t,e),Z4=()=>({state:t,dispatch:e})=>QB(t,e),e8=()=>({state:t,dispatch:e})=>ux(t,e),t8=()=>({state:t,dispatch:e})=>px(t,e),n8=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Cd(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},r8=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Cd(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},i8=()=>({state:t,dispatch:e})=>YB(t,e),s8=()=>({state:t,dispatch:e})=>XB(t,e);function Ox(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function o8(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))_l()||Ox()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const a8=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=o8(t).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function Cl(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?pn(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(d,f)=>{if(d.isText)return;const p=Math.max(r,f),h=Math.min(i,f+d.nodeSize);a.push({node:d,from:p,to:h})});const l=i-r,c=a.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>Su(d.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=l}const l8=(t,e={})=>({state:n,dispatch:r})=>{const i=pn(t,n.schema);return Cl(n,i,e)?ZB(n,r):!1},c8=()=>({state:t,dispatch:e})=>yx(t,e),u8=t=>({state:e,dispatch:n})=>{const r=pn(t,e.schema);return d4(r)(e,n)},d8=()=>({state:t,dispatch:e})=>gx(t,e);function Nd(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function rb(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const f8=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Nd(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=pn(t,r.schema)),a==="mark"&&(o=ps(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{s&&s===c.type&&n.setNodeMarkup(u,void 0,rb(c.attrs,e)),o&&c.marks.length&&c.marks.forEach(d=>{o===d.type&&n.addMark(u,u+c.nodeSize,o.create(rb(d.attrs,e)))})})}),!0):!1},h8=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),p8=()=>({tr:t,dispatch:e})=>{if(e){const n=new nr(t.doc);t.setSelection(n)}return!0},m8=()=>({state:t,dispatch:e})=>fx(t,e),g8=()=>({state:t,dispatch:e})=>mx(t,e),v8=()=>({state:t,dispatch:e})=>r4(t,e),y8=()=>({state:t,dispatch:e})=>o4(t,e),b8=()=>({state:t,dispatch:e})=>s4(t,e);function Qh(t,e,n={},r={}){return El(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const k8=(t,e=!1,n={},r={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{var l,c;const{doc:u}=s;if(n.preserveWhitespace!=="full"){const d=Qh(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return o&&s.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!e),!0}return o&&s.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck})};function Ax(t,e){const n=ps(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function w8(t,e){const n=new x1(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function x8(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Fse(t,e){const n=[];return t.descendants((r,i)=>{e(r)&&n.push({node:r,pos:i})}),n}function S8(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function T8(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Zm(t){return e=>T8(e.$from,t)}function _8(t,e){const n={from:0,to:t.content.size};return Sx(t,n,e)}function E8(t,e){const n=pn(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function Mx(t,e){const n=Nd(typeof e=="string"?e:e.name,t.schema);return n==="node"?E8(t,e):n==="mark"?Ax(t,e):{}}function C8(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function O8(t){const e=C8(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,o)=>o!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function A8(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const c=e.slice(s).map(a,-1),u=e.slice(s).map(l),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),O8(r)}function eg(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=Jm(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function Gc(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function Zh(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?ps(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>Su(d.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:d,$to:f})=>{const p=d.pos,h=f.pos;t.doc.nodesBetween(p,h,(g,m)=>{if(!g.isText&&!g.marks.length)return;const b=Math.max(p,m),T=Math.min(h,m+g.nodeSize),E=T-b;o+=E,a.push(...g.marks.map(w=>({mark:w,from:b,to:T})))})}),o===0)return!1;const l=a.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>Su(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=a.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,f)=>d+f.to-f.from,0);return(l>0?l+c:l)>=o}function M8(t,e,n={}){if(!e)return Cl(t,null,n)||Zh(t,null,n);const r=Nd(e,t.schema);return r==="node"?Cl(t,e,n):r==="mark"?Zh(t,e,n):!1}function ib(t,e){const{nodeExtensions:n}=Rd(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=vt(Ne(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function tg(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(tg(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function Ix(t){return t instanceof qe}function I8(t,e,n){const i=t.state.doc.content.size,s=xi(e,0,i),o=xi(n,0,i),a=t.coordsAtPos(s),l=t.coordsAtPos(o,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),f=Math.max(a.right,l.right),p=f-d,h=u-c,b={top:c,bottom:u,left:d,right:f,width:p,height:h,x:d,y:c};return{...b,toJSON:()=>b}}function L8(t,e,n){var r;const{selection:i}=e;let s=null;if(Qm(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=p&&h}return!c}),c})}const P8=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=ps(t,r.schema);if(i)if(o){const c=Ax(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,p)=>{const h=Math.max(p,u),g=Math.min(p+f.nodeSize,d);f.marks.find(b=>b.type===l)?f.marks.forEach(b=>{l===b.type&&n.addMark(h,g,l.create({...b.attrs,...e}))}):n.addMark(h,g,l.create(e))})});return L8(r,n,l)},R8=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),$8=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=pn(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>Qy(s,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>Qy(s,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},D8=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=xi(t,0,r.content.size),s=qe.create(r,i);e.setSelection(s)}return!0},N8=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=ot.atStart(r).from,a=ot.atEnd(r).to,l=xi(i,o,a),c=xi(s,o,a),u=ot.create(r,l,c);e.setSelection(u)}return!0},F8=t=>({state:e,dispatch:n})=>{const r=pn(t,e.schema);return p4(r)(e,n)};function sb(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const j8=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,c=i.extensionManager.attributes,u=Gc(c,a.node().type.name,a.node().attrs);if(s instanceof qe&&s.node.isBlock)return!a.parentOffset||!Oi(o,a.pos)?!1:(r&&(t&&sb(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:x8(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=d&&f?[{type:f,attrs:u}]:void 0,h=Oi(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!h&&Oi(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(h&&(s instanceof ot&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),f&&!d&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),m=e.doc.resolve(g);a.node(-1).canReplaceWith(m.index(),m.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&sb(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return h},B8=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=pn(t,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const d=l.node(-1);if(d.type!==a)return!1;const f=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let b=he.empty;const T=l.index(-1)?1:l.index(-2)?2:3;for(let j=l.depth-T;j>=l.depth-3;j-=1)b=he.from(l.node(j).copy(b));const E=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,w={...Gc(f,l.node().type.name,l.node().attrs),...e},M=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(w))||void 0;b=b.append(he.from(a.createAndFill(null,M)||void 0));const A=l.before(l.depth-(T-1));n.replace(A,l.after(-E),new Re(b,4-T,0));let I=-1;n.doc.nodesBetween(A,n.doc.content.size,(j,$)=>{if(I>-1)return!1;j.isTextblock&&j.content.size===0&&(I=$+1)}),I>-1&&n.setSelection(ot.near(n.doc.resolve(I))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,h={...Gc(f,d.type.name,d.attrs),...e},g={...Gc(f,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const m=p?[{type:a,attrs:h},{type:p,attrs:g}]:[{type:a,attrs:h}];if(!Oi(n.doc,l.pos,2))return!1;if(i){const{selection:b,storedMarks:T}=r,{splittableMarks:E}=s.extensionManager,w=T||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,m).scrollIntoView(),!w||!i)return!0;const M=w.filter(A=>E.includes(A.type.name));n.ensureMarks(M)}return!0},Pf=(t,e)=>{const n=Zm(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&fs(t.doc,n.pos)&&t.join(n.pos),!0},Rf=(t,e)=>{const n=Zm(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&fs(t.doc,r)&&t.join(r),!0},H8=(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,p=pn(t,o.schema),h=pn(e,o.schema),{selection:g,storedMarks:m}=o,{$from:b,$to:T}=g,E=b.blockRange(T),w=m||g.$to.parentOffset&&g.$from.marks();if(!E)return!1;const M=Zm(A=>ib(A.type.name,d))(g);if(E.depth>=1&&M&&E.depth-M.depth<=1){if(M.node.type===p)return c.liftListItem(h);if(ib(M.node.type.name,d)&&p.validContent(M.node.content)&&a)return l().command(()=>(s.setNodeMarkup(M.pos,p),!0)).command(()=>Pf(s,p)).command(()=>Rf(s,p)).run()}return!n||!w||!a?l().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>Pf(s,p)).command(()=>Rf(s,p)).run():l().command(()=>{const A=u().wrapInList(p,r),I=w.filter(j=>f.includes(j.type.name));return s.ensureMarks(I),A?!0:c.clearNodes()}).wrapInList(p,r).command(()=>Pf(s,p)).command(()=>Rf(s,p)).run()},U8=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=ps(t,r.schema);return Zh(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},V8=(t,e,n={})=>({state:r,commands:i})=>{const s=pn(t,r.schema),o=pn(e,r.schema),a=Cl(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},z8=(t,e={})=>({state:n,commands:r})=>{const i=pn(t,n.schema);return Cl(n,i,e)?r.lift(i):r.wrapIn(i,e)},W8=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},K8=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},q8=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=ps(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!i)return!0;if(u&&o){let{from:f,to:p}=a;const h=(s=c.marks().find(m=>m.type===l))===null||s===void 0?void 0:s.attrs,g=Jm(c,l,h);g&&(f=g.from,p=g.to),n.removeMark(f,p,l)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},G8=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Nd(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=pn(t,r.schema)),a==="mark"&&(o=ps(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;let d,f,p,h;n.selection.empty?r.doc.nodesBetween(c,u,(g,m)=>{s&&s===g.type&&(p=Math.max(m,c),h=Math.min(m+g.nodeSize,u),d=m,f=g)}):r.doc.nodesBetween(c,u,(g,m)=>{m<c&&s&&s===g.type&&(p=Math.max(m,c),h=Math.min(m+g.nodeSize,u),d=m,f=g),m>=c&&m<=u&&(s&&s===g.type&&n.setNodeMarkup(m,void 0,{...g.attrs,...e}),o&&g.marks.length&&g.marks.forEach(b=>{if(o===b.type){const T=Math.max(m,c),E=Math.min(m+g.nodeSize,u);n.addMark(T,E,o.create({...b.attrs,...e}))}}))}),f&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(g=>{o===g.type&&n.addMark(p,h,o.create({...g.attrs,...e}))}))}),!0):!1},Y8=(t,e={})=>({state:n,dispatch:r})=>{const i=pn(t,n.schema);return a4(i,e)(n,r)},X8=(t,e={})=>({state:n,dispatch:r})=>{const i=pn(t,n.schema);return l4(i,e)(n,r)};var J8=Object.freeze({__proto__:null,blur:I4,clearContent:L4,clearNodes:P4,command:R4,createParagraphNear:$4,cut:D4,deleteCurrentNode:N4,deleteNode:F4,deleteRange:j4,deleteSelection:B4,enter:H4,exitCode:U4,extendMarkRange:V4,first:z4,focus:K4,forEach:q4,insertContent:G4,insertContentAt:J4,joinBackward:e8,joinDown:Z4,joinForward:t8,joinItemBackward:n8,joinItemForward:r8,joinTextblockBackward:i8,joinTextblockForward:s8,joinUp:Q4,keyboardShortcut:a8,lift:l8,liftEmptyBlock:c8,liftListItem:u8,newlineInCode:d8,resetAttributes:f8,scrollIntoView:h8,selectAll:p8,selectNodeBackward:m8,selectNodeForward:g8,selectParentNode:v8,selectTextblockEnd:y8,selectTextblockStart:b8,setContent:k8,setMark:P8,setMeta:R8,setNode:$8,setNodeSelection:D8,setTextSelection:N8,sinkListItem:F8,splitBlock:j8,splitListItem:B8,toggleList:H8,toggleMark:U8,toggleNode:V8,toggleWrap:z8,undoInputRule:W8,unsetAllMarks:K8,unsetMark:q8,updateAttributes:G8,wrapIn:Y8,wrapInList:X8});const Q8=kn.create({name:"commands",addCommands(){return{...J8}}}),Z8=kn.create({name:"drop",addProseMirrorPlugins(){return[new an({key:new Ln("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),e5=kn.create({name:"editable",addProseMirrorPlugins(){return[new an({key:new Ln("editable"),props:{editable:()=>this.editor.options.editable}})]}}),t5=new Ln("focusEvents"),n5=kn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new an({key:t5,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),r5=kn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:d}=l,{pos:f,parent:p}=d,h=d.parent.isTextblock&&f>0?a.doc.resolve(f-1):d,g=h.parent.type.spec.isolating,m=d.pos-d.parentOffset,b=g&&h.parent.childCount===1?m===d.pos:mt.atStart(c).from===f;return!u||!p.type.isTextblock||p.textContent.length||!b||b&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return _l()||Ox()?s:i},addProseMirrorPlugins(){return[new an({key:new Ln("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=mt.atStart(e.doc).from,c=mt.atEnd(e.doc).to;if(s||!(o===l&&a===c)||!tg(n.doc))return;const f=n.tr,p=Ld({state:n,transaction:f}),{commands:h}=new Pd({editor:this.editor,state:p});if(h.clearNodes(),!!f.steps.length)return f}})]}}),i5=kn.create({name:"paste",addProseMirrorPlugins(){return[new an({key:new Ln("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),s5=kn.create({name:"tabindex",addProseMirrorPlugins(){return[new an({key:new Ln("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Ps{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You canât set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Ps(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Ps(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Ps(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=this.pos+r+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(o);if(!i&&a.depth<=this.depth)return;const l=new Ps(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new Ps(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const o5=`.ProseMirror { 63 position: relative; 64} 65 66.ProseMirror { 67 word-wrap: break-word; 68 white-space: pre-wrap; 69 white-space: break-spaces; 70 -webkit-font-variant-ligatures: none; 71 font-variant-ligatures: none; 72 font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ 73} 74 75.ProseMirror [contenteditable="false"] { 76 white-space: normal; 77} 78 79.ProseMirror [contenteditable="false"] [contenteditable="true"] { 80 white-space: pre-wrap; 81} 82 83.ProseMirror pre { 84 white-space: pre-wrap; 85} 86 87img.ProseMirror-separator { 88 display: inline !important; 89 border: none !important; 90 margin: 0 !important; 91 width: 0 !important; 92 height: 0 !important; 93} 94 95.ProseMirror-gapcursor { 96 display: none; 97 pointer-events: none; 98 position: absolute; 99 margin: 0; 100} 101 102.ProseMirror-gapcursor:after { 103 content: ""; 104 display: block; 105 position: absolute; 106 top: -2px; 107 width: 20px; 108 border-top: 1px solid black; 109 animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; 110} 111 112@keyframes ProseMirror-cursor-blink { 113 to { 114 visibility: hidden; 115 } 116} 117 118.ProseMirror-hideselection *::selection { 119 background: transparent; 120} 121 122.ProseMirror-hideselection *::-moz-selection { 123 background: transparent; 124} 125 126.ProseMirror-hideselection * { 127 caret-color: transparent; 128} 129 130.ProseMirror-focused .ProseMirror-gapcursor { 131 display: block; 132} 133 134.tippy-box[data-animation=fade][data-state=hidden] { 135 opacity: 0 136}`;function a5(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let l5=class extends m4{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=a5(o5,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=xx(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;r=r.filter(a=>!a.key.startsWith(o))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[e5,M4.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),Q8,n5,r5,s5,Z8,i5].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new Po(i,this)}createCommandManager(){this.commandManager=new Pd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Qh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=Qh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=Ex(n,this.options.autofocus);this.view=new ax(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Lo.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const s=this.view.dom;s.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(o)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Mx(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return M8(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Ym(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=` 137 138`,textSerializers:r={}}=e||{};return _8(this.state.doc,{blockSeparator:n,textSerializers:{...Tx(this.schema),...r}})}get isEmpty(){return tg(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.
138content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Ps(n,this)}get $doc(){return this.$pos(0)}};function ra(t){return new $d({find:t.find,handler:({state:e,range:n,match:r})=>{const i=vt(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),c=n.from+a.indexOf(o),u=c+o.length;if(eg(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>c).length)return null;u<n.to&&s.delete(u,n.to),c>n.from&&s.delete(n.from+l,c);const f=n.from+l+o.length;s.addMark(n.from+l,f,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function Lx(t){return new $d({find:t.find,handler:({state:e,range:n,match:r})=>{const i=vt(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>a?u=a:a=u+r[1].length;const d=r[0][r[0].length-1];s.insertText(d,o+r[0].length-1),s.replaceWith(u,a,l)}else if(r[0]){const c=t.type.isInline?o:o-1;s.insert(c,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()}})}function ep(t){return new $d({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=vt(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function Ol(t){return new $d({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=vt(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),c=l&&Pm(l,t.type,s);if(!c)return null;if(o.wrap(l,c),t.keepMarks&&t.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,h=f||d.$to.parentOffset&&d.$from.marks();if(h){const g=h.filter(m=>p.includes(m.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,s).run()}const u=o.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&fs(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&o.join(n.from-1)}})}let Yn=class tp{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=vt(Ne(this,"addOptions",{name:this.name}))),this.storage=vt(Ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new tp(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Dd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new tp(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=vt(Ne(n,"addOptions",{name:n.name})),n.storage=vt(Ne(n,"addStorage",{name:n.name,options:n.options})),n}};class c5{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,s,o,a,l;const{view:c}=this.editor,u=e.target,d=u.nodeType===3?(n=u.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!d)return;let f=0,p=0;if(this.dom!==d){const T=this.dom.getBoundingClientRect(),E=d.getBoundingClientRect(),w=(i=e.offsetX)!==null&&i!==void 0?i:(s=e.nativeEvent)===null||s===void 0?void 0:s.offsetX,M=(o=e.offsetY)!==null&&o!==void 0?o:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;
138f=E.x-T.x+w,p=E.y-T.y+M}const h=this.dom.cloneNode(!0);(l=e.dataTransfer)===null||l===void 0||l.setDragImage(h,f,p);const g=this.getPos();if(typeof g!="number")return;const m=qe.create(c.state.doc,g),b=c.state.tr.setSelection(m);c.dispatch(b)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const s=e.type.startsWith("drag"),o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o&&!s)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=qe.isSelectable(this.node),f=e.type==="copy",p=e.type==="paste",h=e.type==="cut",g=e.type==="mousedown";if(!u&&d&&s&&e.target===this.dom&&e.preventDefault(),u&&s&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(u&&l&&!c&&g){const m=r.closest("[data-drag-handle]");m&&(this.dom===m||this.dom.contains(m))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||o||f||p||h||g&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(_l()||Jh())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function ro(t){return new T4({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=vt(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),d=n.from+l.indexOf(a),f=d+a.length;if(eg(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===t.type&&m!==h.mark.type)).filter(h=>h.to>d).length)return null;f<n.to&&o.delete(f,n.to),d>n.from&&o.delete(n.from+u,d),c=n.from+u+a.length,o.addMark(n.from+u,c,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}function u5(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof qe){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function d5(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var vr="top",Rr="bottom",$r="right",yr="left",ng="auto",ac=[vr,Rr,$r,yr],ia="start",rg="end",f5="clippingParents",Px="viewport",Ta="popper",h5="reference",ob=ac.reduce(function(t,e){return t.concat([e+"-"+ia,e+"-"+rg])},[]),Rx=[].concat(ac,[ng]).reduce(function(t,e){return t.concat([e,e+"-"+ia,e+"-"+rg])},[]),p5="beforeRead",m5="read",g5="afterRead",v5="beforeMain",y5="main",b5="afterMain",k5="beforeWrite",w5="write",x5="afterWrite",S5=[p5,m5,g5,v5,y5,b5,k5,w5,x5];function ai(t){return t?(t.nodeName||"").toLowerCase():null}function Fr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Al(t){var e=Fr(t).Element;return t instanceof e||t instanceof Element}function Dr(t){var e=Fr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function $x(t){if(typeof ShadowRoot>"u")return!1;var e=Fr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function T5(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];
vendor: 17,427 bytes, line 138
138!Dr(s)||!ai(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(o){var a=i[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function _5(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Dr(i)||!ai(i)||(Object.assign(i.style,a),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}const Dx={name:"applyStyles",enabled:!0,phase:"write",fn:T5,effect:_5,requires:["computeStyles"]};function ti(t){return t.split("-")[0]}function sa(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function ig(t){var e=sa(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Nx(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&$x(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Pi(t){return Fr(t).getComputedStyle(t)}function E5(t){return["table","td","th"].indexOf(ai(t))>=0}function ms(t){return((Al(t)?t.ownerDocument:t.document)||window.document).documentElement}function Fd(t){return ai(t)==="html"?t:t.assignedSlot||t.parentNode||($x(t)?t.host:null)||ms(t)}function ab(t){return!Dr(t)||Pi(t).position==="fixed"?null:t.offsetParent}function C5(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Dr(t)){var r=Pi(t);if(r.position==="fixed")return null}for(var i=Fd(t);Dr(i)&&["html","body"].indexOf(ai(i))<0;){var s=Pi(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function lc(t){for(var e=Fr(t),n=ab(t);n&&E5(n)&&Pi(n).position==="static";)n=ab(n);return n&&(ai(n)==="html"||ai(n)==="body"&&Pi(n).position==="static")?e:n||C5(t)||e}function sg(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var rs=Math.max,Ml=Math.min,_c=Math.round;function Yc(t,e,n){return rs(t,Ml(e,n))}function Fx(){return{top:0,right:0,bottom:0,left:0}}function jx(t){return Object.assign({},Fx(),t)}function Bx(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var O5=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,jx(typeof e!="number"?e:Bx(e,ac))};function A5(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=ti(n.placement),l=sg(a),c=[yr,$r].indexOf(a)>=0,u=c?"height":"width";if(!(!s||!o)){var d=O5(i.padding,n),f=ig(s),p=l==="y"?vr:yr,h=l==="y"?Rr:$r,g=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],m=o[l]-n.rects.reference[l],b=lc(s),T=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,E=g/2-m/2,w=d[p],M=T-f[u]-d[h],A=T/2-f[u]/2+E,I=Yc(w,A,M),j=l;n.modifiersData[r]=(e={},e[j]=I,e.centerOffset=I-A,e)}}function M5(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Nx(e.elements.popper,i)&&(e.elements.arrow=i))}const I5={name:"arrow",enabled:!0,phase:"main",fn:A5,effect:M5,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};var L5={top:"auto",right:"auto",bottom:"auto",left:"auto"};function P5(t){var e=t.x,n=t.y,r=window,i=r.devicePixelRatio||1;return{x:_c(_c(e*i)/i)||0,y:_c(_c(n*i)/i)||0}}function lb(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.offsets,o=t.position,a=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,u=c===!0?P5(s):typeof c=="function"?c(s):s,d=u.x,f=d===void 0?0:d,p=u.y,h=p===void 0?0:p,g=s.hasOwnProperty("x"),m=s.hasOwnProperty("y"),b=yr,T=vr,E=window;if(l){var w=lc(n),M="clientHeight",A="clientWidth";w===Fr(n)&&(w=ms(n),Pi(w).position!=="static"&&(M="scrollHeight",A="scrollWidth")),w=w,i===vr&&(T=Rr,h-=w[M]-r.height,h*=a?1:-1),i===yr&&(b=$r,f-=w[A]-r.width,f*=a?1:-1)}var I=Object.assign({position:o},l&&L5);if(a){var j;return Object.assign({},I,(j={},j[T]=m?"0":"",j[b]=g?"0":"",j.transform=(E.devicePixelRatio||1)<2?"translate("+f+"px, "+h+"px)":"translate3d("+f+"px, "+h+"px, 0)",j))}return Object.assign({},I,(e={},e[T]=m?h+"px":"",e[b]=g?f+"px":"",e.transform="",e))}function R5(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,o=s===void 0?!0:s,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:ti(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,lb(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,lb(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const $5={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:R5,data:{}};var Ec={passive:!0};function D5(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=i===void 0?!0:i,o=r.resize,a=o===void 0?!0:o,l=Fr(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",n.update,Ec)}),a&&l.addEventListener("resize",n.update,Ec),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Ec)}),a&&l.removeEventListener("resize",n.update,Ec)}}const N5={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:D5,data:{}};var F5={left:"right",right:"left",bottom:"top",top:"bottom"};function Xc(t){return t.replace(/left|right|bottom|top/g,function(e){return F5[e]})}var j5={start:"end",end:"start"};function cb(t){return t.replace(/start|end/g,function(e){return j5[e]})}function og(t){var e=Fr(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ag(t){return sa(ms(t)).left+og(t).scrollLeft}function B5(t){var e=Fr(t),n=ms(t),r=e.visualViewport,i=n.clientWidth,s=n.clientHeight,o=0,a=0;return r&&(i=r.width,s=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,a=r.offsetTop)),{width:i,height:s,x:o+ag(t),y:a}}function H5(t){var e,n=ms(t),r=og(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=rs(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=rs(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+ag(t),l=-r.scrollTop;return Pi(i||n).direction==="rtl"&&(a+=rs(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function lg(t){var e=Pi(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Hx(t){return["html","body","#document"].indexOf(ai(t))>=0?t.ownerDocument.body:Dr(t)&&lg(t)?t:Hx(Fd(t))}function tl(t,e){var n;e===void 0&&(e=[]);var r=Hx(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=Fr(r),o=i?[s].concat(s.visualViewport||[],lg(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(tl(Fd(o)))}function np(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function U5(t){var e=sa(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function ub(t,e){return e===Px?np(B5(t)):Dr(e)?U5(e):np(H5(ms(t)))}function V5(t){var e=tl(Fd(t)),n=["absolute","fixed"].indexOf(Pi(t).position)>=0,r=n&&Dr(t)?lc(t):t;return Al(r)?e.filter(function(i){return Al(i)&&Nx(i,r)&&ai(i)!=="body"}):[]}function z5(t,e,n){var r=e==="clippingParents"?V5(t):[].concat(e),i=[].concat(r,[n]),s=i[0],o=i.reduce(function(a,l){var c=ub(t,l);return a.top=rs(c.top,a.top),a.right=Ml(c.right,a.right),a.bottom=Ml(c.bottom,a.bottom),a.left=rs(c.left,a.left),a},ub(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Il(t){return t.split("-")[1]}function Ux(t){var e=t.reference,n=t.element,r=t.placement,i=r?ti(r):null,s=r?Il(r):null,o=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case vr:l={x:o,y:e.y-n.height};break;case Rr:l={x:o,y:e.y+e.height};break;case $r:l={x:e.x+e.width,y:a};break;case yr:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?sg(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case ia:l[c]=l[c]-(e[u]/2-n[u]/2);break;case rg:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Ll(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,s=n.boundary,o=s===void 0?f5:s,a=n.rootBoundary,l=a===void 0?Px:a,c=n.elementContext,u=c===void 0?Ta:c,d=n.altBoundary,f=d===void 0?!1:d,p=n.padding,h=p===void 0?0:p,g=jx(typeof h!="number"?h:Bx(h,ac)),m=u===Ta?h5:Ta,b=t.elements.reference,T=t.rects.popper,E=t.elements[f?m:u],w=z5(Al(E)?E:E.contextElement||ms(t.elements.popper),o,l),M=sa(b),A=Ux({reference:M,element:T,placement:i}),I=np(Object.assign({},T,A)),j=u===Ta?I:M,$={top:w.top-j.top+g.top,bottom:j.bottom-w.bottom+g.bottom,left:w.left-j.left+g.left,right:j.right-w.right+g.right},J=t.modifiersData.offset;if(u===Ta&&J){var se=J[i];Object.keys($).forEach(function(Q){var G=[$r,Rr].indexOf(Q)>=0?1:-1,ee=[vr,Rr].indexOf(Q)>=0?"y":"x";$[Q]+=se[ee]*G})}return $}function W5(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?Rx:l,u=Il(r),d=u?a?ob:ob.filter(function(h){return Il(h)===u}):ac,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,g){return h[g]=Ll(t,{placement:g,boundary:i,rootBoundary:s,padding:o})[ti(g)],h},{});return Object.keys(p).sort(function(h,g){return p[h]-p[g]})}function K5(t){if(ti(t)===ng)return[];var e=Xc(t);return[cb(t),e,cb(e)]}function q5(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,g=n.allowedAutoPlacements,m=e.options.placement,b=ti(m),T=b===m,E=l||(T||!h?[Xc(m)]:K5(m)),w=[m].concat(E).reduce(function(rt,je){return rt.concat(ti(je)===ng?W5(e,{placement:je,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:g}):je)},[]),M=e.rects.reference,A=e.rects.popper,I=new Map,j=!0,$=w[0],J=0;J<w.length;J++){var se=w[J],Q=ti(se),G=Il(se)===ia,ee=[vr,Rr].indexOf(Q)>=0,ge=ee?"width":"height",ae=Ll(e,{placement:se,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),ke=ee?G?$r:yr:G?Rr:vr;M[ge]>A[ge]&&(ke=Xc(ke));var Le=Xc(ke),Ue=[];if(s&&Ue.push(ae[Q]<=0),a&&Ue.push(ae[ke]<=0,ae[Le]<=0),Ue.every(function(rt){return rt})){$=se,j=!1;break}I.set(se,Ue)}if(j)for(var Ze=h?3:1,Je=function(je){var Te=w.find(function(q){var pe=I.get(q);if(pe)return pe.slice(0,je).every(function(ce){return ce})});if(Te)return $=Te,"break"},Xe=Ze;Xe>0;Xe--){var We=Je(Xe);if(We==="break")break}e.placement!==$&&(e.modifiersData[r]._skip=!0,e.placement=$,e.reset=!0)}}const G5={name:"flip",enabled:!0,phase:"main",fn:q5,requiresIfExists:["offset"],data:{_skip:!1}};function db(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function fb(t){return[vr,$r,Rr,yr].some(function(e){return t[e]>=0})}function Y5(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=Ll(e,{elementContext:"reference"}),a=Ll(e,{altBoundary:!0}),l=db(o,r),c=db(a,i,s),u=fb(l),d=fb(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const X5={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Y5};function J5(t,e,n){var r=ti(t),i=[yr,vr].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[yr,$r].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Q5(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=i===void 0?[0,0]:i,o=Rx.reduce(function(u,d){return u[d]=J5(d,e.rects,s),u},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}const Z5={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Q5};function eH(t){var e=t.state,n=t.name;e.modifiersData[n]=Ux({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const tH={name:"popperOffsets",enabled:!0,phase:"read",fn:eH,data:{}};function nH(t){return t==="x"?"y":"x"}function rH(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,h=n.tetherOffset,g=h===void 0?0:h,m=Ll(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),b=ti(e.placement),T=Il(e.placement),E=!T,w=sg(b),M=nH(w),A=e.modifiersData.popperOffsets,I=e.rects.reference,j=e.rects.popper,$=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,J={x:0,y:0};if(A){if(s||a){var se=w==="y"?vr:yr,Q=w==="y"?Rr:$r,G=w==="y"?"height":"width",ee=A[w],ge=A[w]+m[se],ae=A[w]-m[Q],ke=p?-j[G]/2:0,Le=T===ia?I[G]:j[G],Ue=T===ia?-j[G]:-I[G],Ze=e.elements.arrow,Je=p&&Ze?ig(Ze):{width:0,height:0},Xe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Fx(),We=Xe[se],rt=Xe[Q],je=Yc(0,I[G],Je[G]),Te=E?I[G]/2-ke-je-We-$:Le-je-We-$,q=E?-I[G]/2+ke+je+rt+$:Ue+je+rt+$,pe=e.elements.arrow&&lc(e.elements.arrow),ce=pe?w==="y"?pe.clientTop||0:pe.clientLeft||0:0,be=e.modifiersData.offset?e.modifiersData.offset[e.placement][w]:0,He=A[w]+Te-be-ce,at=A[w]+q-be;if(s){var Ce=Yc(p?Ml(ge,He):ge,ee,p?rs(ae,at):ae);A[w]=Ce,J[w]=Ce-ee}if(a){var Oe=w==="x"?vr:yr,lt=w==="x"?Rr:$r,yt=A[M],ht=yt+m[Oe],R=yt-m[lt],F=Yc(p?Ml(ht,He):ht,yt,p?rs(R,at):R);A[M]=F,J[M]=F-yt}}e.modifiersData[r]=J}}const iH={name:"preventOverflow",enabled:!0,phase:"main",fn:rH,requiresIfExists:["offset"]};function sH(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function oH(t){return t===Fr(t)||!Dr(t)?og(t):sH(t)}function aH(t,e,n){n===void 0&&(n=!1);var r=ms(e),i=sa(t),s=Dr(e),o={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(s||!s&&!n)&&((ai(e)!=="body"||lg(r))&&(o=oH(e)),Dr(e)?(a=sa(e),a.x+=e.clientLeft,a.y+=e.clientTop):r&&(a.x=ag(r))),{x:i.left+o.scrollLeft-a.x,y:i.top+o.scrollTop-a.y,width:i.width,height:i.height}}function lH(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function i(s){n.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||i(s)}),r}function cH(t){var e=lH(t);return S5.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function uH(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function dH(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var hb={placement:"bottom",modifiers:[],strategy:"absolute"};function pb(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function fH(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?hb:i;return function(a,l,c){c===void 0&&(c=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},hb,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],f=!1,p={state:u,setOptions:function(b){g(),u.options=Object.assign({},s,u.options,b),u.scrollParents={reference:Al(a)?tl(a):a.contextElement?tl(a.contextElement):[],popper:tl(l)};var T=cH(dH([].concat(r,u.options.modifiers)));return u.orderedModifiers=T.filter(function(E){return E.enabled}),h(),p.update()},forceUpdate:function(){if(!f){var b=u.elements,T=b.reference,E=b.popper;if(pb(T,E)){u.rects={reference:aH(T,lc(E),u.options.strategy==="fixed"),popper:ig(E)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(J){return u.modifiersData[J.name]=Object.assign({},J.data)});for(var w=0;w<u.orderedModifiers.length;w++){if(u.reset===!0){u.reset=!1,w=-1;continue}var M=u.orderedModifiers[w],A=M.fn,I=M.options,j=I===void 0?{}:I,$=M.name;typeof A=="function"&&(u=A({state:u,options:j,name:$,instance:p})||u)}}}},update:uH(function(){return new Promise(function(m){p.forceUpdate(),m(u)})}),destroy:function(){g(),f=!0}};if(!pb(a,l))return p;p.setOptions(c).then(function(m){!f&&c.onFirstUpdate&&c.onFirstUpdate(m)});
vendor: 14,994 bytes, line 138
138function h(){u.orderedModifiers.forEach(function(m){var b=m.name,T=m.options,E=T===void 0?{}:T,w=m.effect;if(typeof w=="function"){var M=w({state:u,name:b,instance:p,options:E}),A=function(){};d.push(M||A)}})}function g(){d.forEach(function(m){return m()}),d=[]}return p}}var hH=[N5,tH,$5,Dx,Z5,G5,iH,I5,X5],pH=fH({defaultModifiers:hH}),mH="tippy-box",Vx="tippy-content",gH="tippy-backdrop",zx="tippy-arrow",Wx="tippy-svg-arrow",Cs={passive:!0,capture:!0},Kx=function(){return document.body};function $f(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function cg(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function qx(t,e){return typeof t=="function"?t.apply(void 0,e):t}function mb(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function vH(t){return t.split(/\s+/).filter(Boolean)}function Oo(t){return[].concat(t)}function gb(t,e){t.indexOf(e)===-1&&t.push(e)}function yH(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function bH(t){return t.split("-")[0]}function Tu(t){return[].slice.call(t)}function vb(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function nl(){return document.createElement("div")}function jd(t){return["Element","Fragment"].some(function(e){return cg(t,e)})}function kH(t){return cg(t,"NodeList")}function wH(t){return cg(t,"MouseEvent")}function xH(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function SH(t){return jd(t)?[t]:kH(t)?Tu(t):Array.isArray(t)?t:Tu(document.querySelectorAll(t))}function Df(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function yb(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function TH(t){var e,n=Oo(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function _H(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var s=i.popperRect,o=i.popperState,a=i.props,l=a.interactiveBorder,c=bH(o.placement),u=o.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,g=s.top-r+d>l,m=r-s.bottom-f>l,b=s.left-n+p>l,T=n-s.right-h>l;return g||m||b||T})}function Nf(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function bb(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Xr={isTouch:!1},kb=0;function EH(){Xr.isTouch||(Xr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Gx))}function Gx(){var t=performance.now();t-kb<20&&(Xr.isTouch=!1,document.removeEventListener("mousemove",Gx)),kb=t}function CH(){var t=document.activeElement;if(xH(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function OH(){document.addEventListener("touchstart",EH,Cs),window.addEventListener("blur",CH)}var AH=typeof window<"u"&&typeof document<"u",MH=AH?!!window.msCrypto:!1,IH={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},LH={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Mr=Object.assign({appendTo:Kx,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},IH,LH),PH=Object.keys(Mr),RH=function(e){var n=Object.keys(e);n.forEach(function(r){Mr[r]=e[r]})};function Yx(t){var e=t.plugins||[],n=e.reduce(function(r,i){var s=i.name,o=i.defaultValue;if(s){var a;r[s]=t[s]!==void 0?t[s]:(a=Mr[s])!=null?a:o}return r},{});return Object.assign({},t,n)}function $H(t,e){var n=e?Object.keys(Yx(Object.assign({},Mr,{plugins:e}))):PH,r=n.reduce(function(i,s){var o=(t.getAttribute("data-tippy-"+s)||"").trim();if(!o)return i;if(s==="content")i[s]=o;else try{i[s]=JSON.parse(o)}catch{i[s]=o}return i},{});return r}function wb(t,e){var n=Object.assign({},e,{content:qx(e.content,[t])},e.ignoreAttributes?{}:$H(t,e.plugins));return n.aria=Object.assign({},Mr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var DH=function(){return"innerHTML"};function rp(t,e){t[DH()]=e}function xb(t){var e=nl();return t===!0?e.className=zx:(e.className=Wx,jd(t)?e.appendChild(t):rp(e,t)),e}function Sb(t,e){jd(e.content)?(rp(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?rp(t,e.content):t.textContent=e.content)}function ip(t){var e=t.firstElementChild,n=Tu(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Vx)}),arrow:n.find(function(r){return r.classList.contains(zx)||r.classList.contains(Wx)}),backdrop:n.find(function(r){return r.classList.contains(gH)})}}function Xx(t){var e=nl(),n=nl();n.className=mH,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=nl();r.className=Vx,r.setAttribute("data-state","hidden"),Sb(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(s,o){var a=ip(e),l=a.box,c=a.content,u=a.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&Sb(c,t.props),o.arrow?u?s.arrow!==o.arrow&&(l.removeChild(u),l.appendChild(xb(o.arrow))):l.appendChild(xb(o.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:i}}Xx.$$tippy=!0;var NH=1,Cc=[],Ff=[];function FH(t,e){var n=wb(t,Object.assign({},Mr,Yx(vb(e)))),r,i,s,o=!1,a=!1,l=!1,c=!1,u,d,f,p=[],h=mb(Oe,n.interactiveDebounce),g,m=NH++,b=null,T=yH(n.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},w={id:m,reference:t,popper:nl(),popperInstance:b,props:n,state:E,plugins:T,clearDelayTimeouts:le,setProps:Ie,setContent:Ke,show:H,hide:V,hideWithInteractivity:Z,enable:D,disable:U,unmount:de,destroy:Pe};if(!n.render)return w;var M=n.render(w),A=M.popper,I=M.onUpdate;A.setAttribute("data-tippy-root",""),A.id="tippy-"+w.id,w.popper=A,t._tippy=w,A._tippy=w;var j=T.map(function(W){return W.fn(w)}),$=t.hasAttribute("aria-expanded");return He(),Ze(),ke(),Le("onCreate",[w]),n.showOnCreate&&Ve(),A.addEventListener("mouseenter",function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()}),A.addEventListener("mouseleave",function(){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&ee().addEventListener("mousemove",h)}),w;function J(){var W=w.props.touch;return Array.isArray(W)?W:[W,0]}function se(){return J()[0]==="hold"}function Q(){var W;return!!((W=w.props.render)!=null&&W.$$tippy)}function G(){return g||t}function ee(){var W=G().parentNode;return W?TH(W):document}function ge(){return ip(A)}function ae(W){return w.state.isMounted&&!w.state.isVisible||Xr.isTouch||u&&u.type==="focus"?0:$f(w.props.delay,W?0:1,Mr.delay)}function ke(W){W===void 0&&(W=!1),A.style.pointerEvents=w.props.interactive&&!W?"":"none",A.style.zIndex=""+w.props.zIndex}function Le(W,ue,we){if(we===void 0&&(we=!0),j.forEach(function(xe){xe[W]&&xe[W].apply(xe,ue)}),we){var Ge;(Ge=w.props)[W].apply(Ge,ue)}}function Ue(){var W=w.props.aria;if(W.content){var ue="aria-"+W.content,we=A.id,Ge=Oo(w.props.triggerTarget||t);Ge.forEach(function(xe){var Ee=xe.getAttribute(ue);if(w.state.isVisible)xe.setAttribute(ue,Ee?Ee+" "+we:we);else{var De=Ee&&Ee.replace(we,"").trim();De?xe.setAttribute(ue,De):xe.removeAttribute(ue)}})}}function Ze(){if(!($||!w.props.aria.expanded)){var W=Oo(w.props.triggerTarget||t);W.forEach(function(ue){w.props.interactive?ue.setAttribute("aria-expanded",w.state.isVisible&&ue===G()?"true":"false"):ue.removeAttribute("aria-expanded")})}}function Je(){ee().removeEventListener("mousemove",h),Cc=Cc.filter(function(W){return W!==h})}function Xe(W){if(!(Xr.isTouch&&(l||W.type==="mousedown"))){var ue=W.composedPath&&W.composedPath()[0]||W.target;if(!(w.props.interactive&&bb(A,ue))){if(Oo(w.props.triggerTarget||t).some(function(we){return bb(we,ue)})){if(Xr.isTouch||w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else Le("onClickOutside",[w,W]);w.props.hideOnClick===!0&&(w.clearDelayTimeouts(),w.hide(),a=!0,setTimeout(function(){a=!1}),w.state.isMounted||Te())}}}function We(){l=!0}function rt(){l=!1}function je(){var W=ee();W.addEventListener("mousedown",Xe,!0),W.addEventListener("touchend",Xe,Cs),W.addEventListener("touchstart",rt,Cs),W.addEventListener("touchmove",We,Cs)}function Te(){var W=ee();W.removeEventListener("mousedown",Xe,!0),W.removeEventListener("touchend",Xe,Cs),W.removeEventListener("touchstart",rt,Cs),W.removeEventListener("touchmove",We,Cs)}function q(W,ue){ce(W,function(){!w.state.isVisible&&A.parentNode&&A.parentNode.contains(A)&&ue()})}function pe(W,ue){ce(W,ue)}function ce(W,ue){var we=ge().box;function Ge(xe){xe.target===we&&(Nf(we,"remove",Ge),ue())}if(W===0)return ue();Nf(we,"remove",d),Nf(we,"add",Ge),d=Ge}function be(W,ue,we){we===void 0&&(we=!1);var Ge=Oo(w.props.triggerTarget||t);Ge.forEach(function(xe){xe.addEventListener(W,ue,we),p.push({node:xe,eventType:W,handler:ue,options:we})})}function He(){se()&&(be("touchstart",Ce,{passive:!0}),be("touchend",lt,{passive:!0})),vH(w.props.trigger).forEach(function(W){if(W!=="manual")switch(be(W,Ce),W){case"mouseenter":be("mouseleave",lt);break;case"focus":be(MH?"focusout":"blur",yt);break;case"focusin":be("focusout",yt);break}})}function at(){p.forEach(function(W){var ue=W.node,we=W.eventType,Ge=W.handler,xe=W.options;ue.removeEventListener(we,Ge,xe)}),p=[]}function Ce(W){var ue,we=!1;if(!(!w.state.isEnabled||ht(W)||a)){var Ge=((ue=u)==null?void 0:ue.type)==="focus";u=W,g=W.currentTarget,Ze(),!w.state.isVisible&&wH(W)&&Cc.forEach(function(xe){return xe(W)}),W.type==="click"&&(w.props.trigger.indexOf("mouseenter")<0||o)&&w.props.hideOnClick!==!1&&w.state.isVisible?we=!0:Ve(W),W.type==="click"&&(o=!we),we&&!Ge&&B(W)}}function Oe(W){var ue=W.target,we=G().contains(ue)||A.contains(ue);if(!(W.type==="mousemove"&&we)){var Ge=fe().concat(A).map(function(xe){var Ee,De=xe._tippy,dt=(Ee=De.popperInstance)==null?void 0:Ee.state;return dt?{popperRect:xe.getBoundingClientRect(),popperState:dt,props:n}:null}).filter(Boolean);_H(Ge,W)&&(Je(),B(W))}}function lt(W){var ue=ht(W)||w.props.trigger.indexOf("click")>=0&&o;if(!ue){if(w.props.interactive){w.hideWithInteractivity(W);return}B(W)}}function yt(W){w.props.trigger.indexOf("focusin")<0&&W.target!==G()||w.props.interactive&&W.relatedTarget&&A.contains(W.relatedTarget)||B(W)}function ht(W){return Xr.isTouch?se()!==W.type.indexOf("touch")>=0:!1}function R(){F();var W=w.props,ue=W.popperOptions,we=W.placement,Ge=W.offset,xe=W.getReferenceClientRect,Ee=W.moveTransition,De=Q()?ip(A).arrow:null,dt=xe?{getBoundingClientRect:xe,contextElement:xe.contextElement||G()}:t,bt={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Hn){var Xn=Hn.state;if(Q()){var Xd=ge(),ba=Xd.box;["placement","reference-hidden","escaped"].forEach(function(mo){mo==="placement"?ba.setAttribute("data-placement",Xn.placement):Xn.attributes.popper["data-popper-"+mo]?ba.setAttribute("data-"+mo,""):ba.removeAttribute("data-"+mo)}),Xn.attributes.popper={}}}},$t=[{name:"offset",options:{offset:Ge}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ee}},bt];Q()&&De&&$t.push({name:"arrow",options:{element:De,padding:3}}),$t.push.apply($t,(ue==null?void 0:ue.modifiers)||[]),w.popperInstance=pH(dt,A,Object.assign({},ue,{placement:we,onFirstUpdate:f,modifiers:$t}))}function F(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ie(){var W=w.props.appendTo,ue,we=G();w.props.interactive&&W===Kx||W==="parent"?ue=we.parentNode:ue=qx(W,[we]),ue.contains(A)||ue.appendChild(A),w.state.isMounted=!0,R()}function fe(){return Tu(A.querySelectorAll("[data-tippy-root]"))}function Ve(W){w.clearDelayTimeouts(),W&&Le("onTrigger",[w,W]),je();var ue=ae(!0),we=J(),Ge=we[0],xe=we[1];Xr.isTouch&&Ge==="hold"&&xe&&(ue=xe),ue?r=setTimeout(function(){w.show()},ue):w.show()}function B(W){if(w.clearDelayTimeouts(),Le("onUntrigger",[w,W]),!w.state.isVisible){Te();return}if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(W.type)>=0&&o)){var ue=ae(!1);ue?i=setTimeout(function(){w.state.isVisible&&w.hide()},ue):s=requestAnimationFrame(function(){w.hide()})}}function D(){w.state.isEnabled=!0}function U(){w.hide(),w.state.isEnabled=!1}function le(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(s)}function Ie(W){if(!w.state.isDestroyed){Le("onBeforeUpdate",[w,W]),at();var ue=w.props,we=wb(t,Object.assign({},ue,vb(W),{ignoreAttributes:!0}));w.props=we,He(),ue.interactiveDebounce!==we.interactiveDebounce&&(Je(),h=mb(Oe,we.interactiveDebounce)),ue.triggerTarget&&!we.triggerTarget?Oo(ue.triggerTarget).forEach(function(Ge){Ge.removeAttribute("aria-expanded")}):we.triggerTarget&&t.removeAttribute("aria-expanded"),Ze(),ke(),I&&I(ue,we),w.popperInstance&&(R(),fe().forEach(function(Ge){requestAnimationFrame(Ge._tippy.popperInstance.forceUpdate)})),Le("onAfterUpdate",[w,W])}}function Ke(W){w.setProps({content:W})}function H(){var W=w.state.isVisible,ue=w.state.isDestroyed,we=!w.state.isEnabled,Ge=Xr.isTouch&&!w.props.touch,xe=$f(w.props.duration,0,Mr.duration);if(!(W||ue||we||Ge)&&!G().hasAttribute("disabled")&&(Le("onShow",[w],!1),w.props.onShow(w)!==!1)){if(w.state.isVisible=!0,Q()&&(A.style.visibility="visible"),ke(),je(),w.state.isMounted||(A.style.transition="none"),Q()){var Ee=ge(),De=Ee.box,dt=Ee.content;Df([De,dt],0)}f=function(){var $t;if(!(!w.state.isVisible||c)){if(c=!0,A.offsetHeight,A.style.transition=w.props.moveTransition,Q()&&w.props.animation){var ui=ge(),Hn=ui.box,Xn=ui.content;Df([Hn,Xn],xe),yb([Hn,Xn],"visible")}Ue(),Ze(),gb(Ff,w),($t=w.popperInstance)==null||$t.forceUpdate(),Le("onMount",[w]),w.props.animation&&Q()&&pe(xe,function(){w.state.isShown=!0,Le("onShown",[w])})}},ie()}}function V(){var W=!w.state.isVisible,ue=w.state.isDestroyed,we=!w.state.isEnabled,Ge=$f(w.props.duration,1,Mr.duration);if(!(W||ue||we)&&(Le("onHide",[w],!1),w.props.onHide(w)!==!1)){if
138(w.state.isVisible=!1,w.state.isShown=!1,c=!1,o=!1,Q()&&(A.style.visibility="hidden"),Je(),Te(),ke(!0),Q()){var xe=ge(),Ee=xe.box,De=xe.content;w.props.animation&&(Df([Ee,De],Ge),yb([Ee,De],"hidden"))}Ue(),Ze(),w.props.animation?Q()&&q(Ge,w.unmount):w.unmount()}}function Z(W){ee().addEventListener("mousemove",h),gb(Cc,h),h(W)}function de(){w.state.isVisible&&w.hide(),w.state.isMounted&&(F(),fe().forEach(function(W){W._tippy.unmount()}),A.parentNode&&A.parentNode.removeChild(A),Ff=Ff.filter(function(W){return W!==w}),w.state.isMounted=!1,Le("onHidden",[w]))}function Pe(){w.state.isDestroyed||(w.clearDelayTimeouts(),w.unmount(),at(),delete t._tippy,w.state.isDestroyed=!0,Le("onDestroy",[w]))}}function gs(t,e){e===void 0&&(e={});var n=Mr.plugins.concat(e.plugins||[]);OH();var r=Object.assign({},e,{plugins:n}),i=SH(t),s=i.reduce(function(o,a){var l=a&&FH(a,r);return l&&o.push(l),o},[]);return jd(t)?s[0]:s}gs.defaultProps=Mr;gs.setDefaultProps=RH;gs.currentInput=Xr;Object.assign({},Dx,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});gs.setDefaultProps({render:Xx});class jH{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:s=250,shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:d,selection:f}=l,{empty:p}=f,h=!d.textBetween(c,u).length&&Qm(l.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var d,f,p;const{state:h,composing:g}=a,{selection:m}=h;if(g||!l&&!c)return;this.createTooltip();const{ranges:T}=m,E=Math.min(...T.map(A=>A.$from.pos)),w=Math.max(...T.map(A=>A.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,element:this.element,view:a,state:h,oldState:u,from:E,to:w}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(Ix(h.selection)){let A=a.nodeDOM(E);if(A){const I=A.dataset.nodeViewWrapper?A:A.querySelector("[data-node-view-wrapper]");if(I&&(A=I.firstChild),A)return A.getBoundingClientRect()}}return I8(a,E,w)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=s,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.element.tabIndex=0,!(this.tippy||!n)&&(this.tippy=gs(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const s=!(n!=null&&n.selection.eq(e.state.selection)),o=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,s,o,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Jx=t=>new an({key:typeof t.pluginKey=="string"?new Ln(t.pluginKey):t.pluginKey,view:e=>
138new jH({view:e,...t})});kn.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Jx({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const Bse=Ri({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=Yl(null);return lk(()=>{const{updateDelay:r,editor:i,pluginKey:s,shouldShow:o,tippyOptions:a}=t;i.registerPlugin(Jx({updateDelay:r,editor:i,element:n.value,pluginKey:s,shouldShow:o,tippyOptions:a}))}),ok(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return ii("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Tb(t){return OC((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class BH extends l5{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Tb(this.view.state),this.reactiveExtensionStorage=Tb(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),sk(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const r=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const HH=Ri({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=Yl(),n=ak();return CC(()=>{const r=t.editor;r&&r.options.element&&e.value&&im(()=>{if(!e.value||!r.options.element.firstChild)return;const i=No(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:i}),r.createNodeViews()})}),ok(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return ii("div",{ref:t=>{this.rootEl=t}})}}),UH=Ri({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return ii(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});class Qx{constructor(e,{props:n={},editor:r}){this.editor=r,this.component=sk(e),this.el=document.createElement("div"),this.props=gd(n),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,n,r,i;return!((n=(e=this.renderedComponent.vNode)===null||e===void 0?void 0:e.component)===null||n===void 0)&&n.exposed?this.renderedComponent.vNode.component.exposed:(i=(r=this.renderedComponent.vNode)===null||r===void 0?void 0:r.component)===null||i===void 0?void 0:i.proxy}renderComponent(){let e=ii(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&fv(e,this.el),{vNode:e,destroy:()=>{this.el&&fv(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){Object.entries(e).forEach(([n,r])=>{this.props[n]=r}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const VH={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}};class zH extends c5{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=Yl(this.getDecorationClasses());const r=Ri({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:i=>{var s,o;return Ya("onDragStart",n),Ya("decorationClasses",this.decorationClasses),(o=(s=this.component).setup)===null||o===void 0?void 0:o.call(s,i,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new Qx(r,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}
138get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,r){const i=s=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(s)};if(typeof this.options.update=="function"){const s=this.node,o=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:s,oldDecorations:o,newNode:e,newDecorations:n,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>i({node:e,decorations:n,innerDecorations:r})})}return e.type!==this.node.type?!1:(e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,i({node:e,decorations:n,innerDecorations:r})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(e=>e.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function WH(t,e){return n=>{if(!n.editor.contentComponent)return{};const r=typeof t=="function"&&"__vccOpts"in t?t.__vccOpts:t;return new zH(r,n,e)}}const KH=/^\s*>\s$/,qH=Yn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",jt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}}
vendor: 1,036 bytes, line 138
138,addInputRules(){return[Ol({find:KH,type:this.type})]}}),GH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,YH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,XH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,JH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,QH=Pr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",jt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ra({find:GH,type:this.type}),ra({find:XH,type:this.t
vendor: 8,488 bytes, lines 138-141
138ype})]},addPasteRules(){return[ro({find:YH,type:this.type}),ro({find:JH,type:this.type})]}}),ZH="listItem",_b="textStyle",Eb=/^\s*([-+*])\s$/,eU=Yn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",jt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ZH,this.editor.getAttributes(_b)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ol({find:Eb,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ol({find:Eb,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(_b),editor:this.editor})),[t]}}),tU=/(^|[^`])`([^`]+)`(?!`)/,nU=/(^|[^`])`([^`]+)`(?!`)/g,rU=Pr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",jt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ra({find:tU,type:this.type})]},addPasteRules(){return[ro({find:nU,type:this.type})]}}),iU=/^```([a-z]+)?[\s\n]$/,sU=/^~~~([a-z]+)?[\s\n]$/,oU=Yn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",jt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` 139 140`);return!s||!o?!1:t.chain().command(({tr:a})=>(a.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 a=i.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(mt.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[ep({find:iU,type:this.type,getAttributes:t=>({language:t[1]})}),ep({find:sU,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new an({key:new Ln("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:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,` 141`));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(ot.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),aU=Yn.create({name:"doc",topNode:!0,content:"block+"});function lU(t={}){return new an({view(e){return new cU(e,t)}})}class cU{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=o=>{this[i](o)};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,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(n){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let h=p.getBoundingClientRect(),g=d?h.bottom:h.top;d&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*a;r={left:h.left,right:h.right,top:g-m,bottom:g+m}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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 c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=l.getBoundingClientRect(),f=d.width/l.offsetWidth,p=d.height/l.offsetHeight;c=d.left-l.scrollLeft*f,u=d.top-l.scrollTop*p}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"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 o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=v1(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const uU=kn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[lU(this.options)]}});class Zt extends mt{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Zt.valid(r)?new Zt(r):mt.near(r)}content(){return Re.empty}eq(e){return e instanceof Zt&&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 Zt(e.resolve(n.pos))}getBookmark(){return new ug(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!dU(e)||!fU(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&&Zt.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>
vendor: 1,360 bytes, line 141
1410?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if(Zt.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!qe.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if(Zt.valid(a))return a}return null}}}Zt.prototype.visible=!1;Zt.findFrom=Zt.findGapCursorFrom;mt.jsonID("gapcursor",Zt);class ug{constructor(e){this.pos=e}map(e){return new ug(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Zt.valid(n)?new Zt(n):mt.near(n)}}function Zx(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function dU(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||Zx(i.type))return!0;if(i.inlineContent)return!1}}return!0}function fU(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||Zx(i.type))return!0;if(i.inlineContent)return!1}}return!0}function hU(){return new an({props:{decorations:vU,createSelectionBetween(t,e,n){return e.pos==n.pos&&Zt.valid(n)?new Zt(n):null}
vendor: 3,516 bytes, lines 141-142
141,handleClick:mU,handleKeyDown:pU,handleDOMEvents:{beforeinput:gU}}})}const pU=lx({ArrowLeft:Oc("horiz",-1),ArrowRight:Oc("horiz",1),ArrowUp:Oc("vert",-1),ArrowDown:Oc("vert",1)});function Oc(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof ot){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Zt.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new Zt(c))),!0):!1}}function mU(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Zt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&qe.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Zt(r))),!0)}function gU(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Zt))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=he.empty;for(let o=r.length-1;o>=0;o--)i=he.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new Re(i,0,0));return s.setSelection(ot.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function vU(t){if(!(t.selection instanceof Zt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",nn.create(t.doc,[tr.widget(t.selection.head,e,{key:"gapcursor"})])}const yU=kn.create({name:"gapCursor",addProseMirrorPlugins(){return[hU()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=vt(Ne(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),bU=Yn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",jt(this.options.HTMLAttributes,t)]},renderText(){return` 142`},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:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&o){const d=l.filter(f=>a.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),kU=Yn.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]}`,jt(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=>ep({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
142)\\s$`),type:this.type,getAttributes:{level:t}}))}});var _u=200,hn=function(){};hn.prototype.append=function(e){return e.length?(e=hn.from(e),!this.length&&e||e.length<_u&&this.leafAppend(e)||this.length<_u&&e.leafPrepend(this)||this.appendInner(e)):this};hn.prototype.prepend=function(e){return e.length?hn.from(e).append(this):this};hn.prototype.appendInner=function(e){return new wU(this,e)};hn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?hn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};hn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};hn.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)};hn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i};hn.from=function(e){return e instanceof hn?e:e&&e.length?new eS(e):hn.empty};var eS=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,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=_u)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=_u)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}(hn);hn.empty=new eS([]);var wU=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,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!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}(hn);const xU=500;class Ar{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 o=e.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),s=i.maps.length),s--,u.push(d);return}if(i){u.push(new Vr(d.map));let p=d.step.map(i.slice(s)),h;p&&o.maybeStep(p).doc&&(h=o.mapping.maps[o.mapping.maps.length-1],c.push(new Vr(h,void 0,void 0,c.length+u.length))),s--,h&&i.appendMap(h,s)}else o.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(s)):d.selection,l=new Ar(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new Vr(e.mapping.maps[u],d,n),p;(p=l&&l.merge(f))&&(f=p,u?s.pop():a=a.slice(0,a.length-1)),s.push(f),n&&(o++,n=void 0),i||(l=f)}let c=o-r.depth;return c>TU&&(a=SU(a,c),o-=c),new Ar(a.append(s),o)}remapping(e,n){let r=new kl;
vendor: 4,480 bytes, line 142
142return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ar(this.items.append(e.map(n=>new Vr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},i);let l=n;this.items.forEach(f=>{let p=s.getMirror(--l);if(p==null)return;o=Math.min(o,p);let h=s.maps[p];if(f.step){let g=e.steps[p].invert(e.docs[p]),m=f.selection&&f.selection.map(s.slice(l+1,p));m&&a++,r.push(new Vr(h,g,m))}else r.push(new Vr(h))},i);let c=[];for(let f=n;f<o;f++)c.push(new Vr(s.maps[f]));let u=this.items.slice(0,i).append(c).append(r),d=new Ar(u,a);return d.emptyItemCount()>xU&&(d=d.compress(this.items.length-r.length)),d}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((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=o.selection&&o.selection.map(n.slice(r));u&&s++;let d=new Vr(c.invert(),l,u),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else o.map&&r--},this.items.length,0),new Ar(hn.from(i.reverse()),s)}}Ar.empty=new Ar(hn.empty,0);function SU(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Vr{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 Vr(n.getMap().invert(),n,this.selection)}}}class Vi{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const TU=20;function _U(t,e,n,r){let i=n.getMeta(Ys),s;if(i)return i.historyState;n.getMeta(OU)&&(t=new Vi(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Ys))return o.getMeta(Ys).redo?new Vi(t.done.addTransform(n,void 0,r,Jc(e)),t.undone,Cb(n.mapping.maps),t.prevTime,t.prevComposition):new Vi(t.done,t.undone.addTransform(n,void 0,r,Jc(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!EU(n,t.prevRanges)),c=o?jf(t.prevRanges,n.mapping):Cb(n.mapping.maps);return new Vi(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Jc(e)),Ar.empty,c,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Vi(t.done.rebased(n,s),t.undone.rebased(n,s),jf(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Vi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),jf(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function EU(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 Cb(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function jf(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 CU(t,e,n){let r=Jc(e),i=Ys.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new Vi(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Ys,{redo:n,historyState:l})}let Bf=!1,Ob=null;function Jc(t){let e=t.plugins;if(Ob!=e){Bf=!1,Ob=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Bf=!0;break}}return Bf}const Ys=new Ln("history"),OU=new Ln("closeHistory");function AU(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new an({key:Ys,state:{init(){return new Vi(Ar.empty,Ar.empty,null,0,-1)},apply(e,n,r){return _U(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?nS:r=="historyRedo"?rS:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function tS(t,e){return(n,r)=>{let i=Ys.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=CU(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}
vendor: 5,585 bytes, line 142
142const nS=tS(!1,!0),rS=tS(!0,!0),MU=kn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>nS(t,e),redo:()=>({state:t,dispatch:e})=>rS(t,e)}},addProseMirrorPlugins(){return[AU(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()}}}),IU=Yn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",jt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!u5(e,e.schema.nodes[this.name]))return!1;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}):Ix(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:o,dispatch:a})=>{var l;if(a){const{$to:c}=o.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?o.setSelection(ot.create(o.doc,c.pos+1)):c.nodeAfter.isBlock?o.setSelection(qe.create(o.doc,c.pos)):o.setSelection(ot.create(o.doc,c.pos));else{const d=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();d&&(o.insert(u,d),o.setSelection(ot.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Lx({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.type})]}}),LU=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,PU=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,RU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,$U=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,DU=Pr.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",jt(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[ra({find:LU,type:this.type}),ra({find:RU,type:this.type})]},addPasteRules(){return[ro({find:PU,type:this.type}),ro({find:$U,type:this.type})]}}),NU=Yn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",jt(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)}}}),FU="listItem",Ab="textStyle",Mb=/^(\d+)\.\s$/,jU=Yn.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:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",jt(this.options.HTMLAttributes,n),0]:["ol",jt(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(FU,this.editor.getAttributes(Ab)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ol({find:Mb,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=Ol({find:Mb,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Ab)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),BU=Yn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",jt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),HU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,UU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,VU=Pr.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",jt(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()}}
142,addInputRules(){return[ra({find:HU,type:this.type})]},addPasteRules(){return[ro({find:UU,type:this.type})]}}),zU=Yn.create({name:"text",group:"inline"}),WU=kn.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(QH.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(qH.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(eU.configure(this.options.bulletList)),this.options.code!==!1&&t.push(rU.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(oU.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(aU.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(uU.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(yU.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(bU.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(kU.configure(this.options.heading)),this.options.history!==!1&&t.push(MU.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(IU.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(DU.configure(this.options.italic)),this.options.listItem!==!1&&t.push(NU.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(jU.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(BU.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(VU.configure(this.options.strike)),this.options.text!==!1&&t.push(zU.configure(this.options.text)),t}}),KU="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
142ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",qU="ελ1Ï
2бг1ел3деÑи4еÑ2каÑолик6ом3мÐ
142ºÐ´2он1Ñква6онлайн5Ñг3ÑÑÑ2Ñ2ÑайÑ3Ñб3ÑкÑ3Òаз3Õ°Õ¡Õµ3×שר××5×§××3Ø§Ø¨ÙØ¸Ø¨Ù5را٠ÙÙ5ÙØ§Ø±Ø¯Ù4Ø¨ØØ±ÙÙ5جزائر5Ø³Ø¹ÙØ¯ÙØ©6عÙÙØ§Ù5٠غرب5٠ارات5ÛØ±Ø§Ù5بارت2زار4ÙØªÙ3ھارت5تÙÙØ³4Ø³ÙØ¯Ø§Ù3Ø±ÙØ©5Ø´Ø¨ÙØ©4عراÙ2ب2٠اÙ4ÙÙØ³Ø·ÙÙ6ÙØ·Ø±3ÙØ§Ø«ÙÙÙÙ6ÙÙ 3٠صر2ÙÙØ³Ùا5ÙØ±ÙتاÙÙØ§7ÙØ¹4Ù٠راÙ5پاکستاÙ7ÚØ§Ø±Øª4à¤à¥à¤®3नà¥à¤3à¤à¤¾à¤°à¤¤0मà¥3à¥à¤¤5सà¤à¤à¤ न5বাà¦à¦²à¦¾5à¦à¦¾à¦°à¦¤2ৰত4à¨à¨¾à¨°à¨¤4àªàª¾àª°àª¤4à¬à¬¾à¬°à¬¤4à®à®¨à¯à®¤à®¿à®¯à®¾6லà®à¯à®à¯6à®à®¿à®à¯à®à®ªà¯à®ªà¯à®°à¯11à°à°¾à°°à°¤à±5à²à²¾à²°à²¤4à´à´¾à´°à´¤à´5à¶½à¶à¶à·4à¸à¸à¸¡3à¹à¸à¸¢3ລາວ3áá2ã¿ããª3ã¢ãã¾ã³4ã¯ã©ã¦ã4ã°ã¼ã°ã«4ã³ã 2ã¹ãã¢3ã»ã¼ã«3ãã¡ãã·ã§ã³6ãã¤ã³ã4ä¸ç2ä¸ä¿¡1å½1å1æç½3äºé©¬é3ä¼ä¸2ä½å±±2ä¿¡æ¯2å¥åº·2å «å¦2å ¬å¸1ç2å°æ¹¾1ç£2åå1åº1æ 2åé0大é åº5å¨çº¿2大æ¿2天主æ3娱ä¹2å®¶é»2广ä¸2å¾®å2æ å2æç±ä½ 3ææº2æè2æ¿å¡1åº2æ°å å¡2é»2æ¶å°2æ¸ç±2æºæ2淡马é¡3游æ2æ¾³é2ç¹ç2ç§»å¨2ç»ç»æºæ4ç½å1åº1ç«1ç»2èé2è°·æ2è´ç©2é販2éå¢2é»è¨çç§4é£å©æµ¦3é£å2é¤å 2馿 ¼éæ3港2ë·ë·1ì»´2ì¼ì±2íêµ2",sp="numeric",op="ascii",ap="alpha",rl="asciinumeric",ja="alphanumeric",lp="domain",iS="emoji",GU="scheme",YU="slashscheme",Hf="whitespace";function XU(t,e){return t in e||(e[t]=[]),e[t]}function Ns(t,e,n){e[sp]&&(e[rl]=!0,e[ja]=!0),e[op]&&(e[rl]=!0,e[ap]=!0),e[rl]&&(e[ja]=!0),e[ap]&&(e[ja]=!0),e[ja]&&(e[lp]=!0),e[iS]&&(e[lp]=!0);for(const r in e){const i=XU(r,n);i.indexOf(t)<0&&i.push(t)}}function JU(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function zn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}zn.groups={};zn.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||zn.groups;let i;return e&&e.j?i=e:(i=new zn(e),n&&r&&Ns(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(t[o]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||zn.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let o,a=i.go(t);if(a?(o=new zn,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new zn,s){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(JU(o.t,r),n);Ns(s,l,r)}else n&&Ns(s,n,r);o.t=s}return i.j[t]=o,o}};const gt=(t,e,n,r,i)=>t.ta(e,n,r,i),Kt=(t,e,n,r,i)=>t.tr(e,n,r,i),Ib=(t,e,n,r,i)=>t.ts(e,n,r,i),me=(t,e,n,r,i)=>t.tt(e,n,r,i),gi="WORD",cp="UWORD",sS="ASCIINUMERICAL",oS="ALPHANUMERICAL",Pl="LOCALHOST",up="TLD",dp="UTLD",Qc="SCHEME",Ao="SLASH_SCHEME",dg="NUM",fp="WS",fg="NL",il="OPENBRACE",sl="CLOSEBRACE",Eu="OPENBRACKET",Cu="CLOSEBRACKET",Ou="OPENPAREN",Au="CLOSEPAREN",Mu="OPENANGLEBRACKET",Iu="CLOSEANGLEBRACKET",Lu="FULLWIDTHLEFTPAREN",Pu="FULLWIDTHRIGHTPAREN",Ru="LEFTCORNERBRACKET",$u="RIGHTCORNERBRACKET",Du="LEFTWHITECORNERBRACKET",Nu="RIGHTWHITECORNERBRACKET",Fu="FULLWIDTHLESSTHAN",ju="FULLWIDTHGREATERTHAN",Bu="AMPERSAND",Hu="APOSTROPHE",Uu="ASTERISK",zi="AT",Vu="BACKSLASH",zu="BACKTICK",Wu="CARET",Fs="COLON",hg="COMMA",Ku="DOLLAR",zr="DOT",qu="EQUALS",pg="EXCLAMATION",lr="HYPHEN",ol="PERCENT",Gu="PIPE",Yu="PLUS",Xu="POUND",al="QUERY",mg="QUOTE",aS="FULLWIDTHMIDDLEDOT",gg="SEMI",Wr="SLASH",ll="TILDE",Ju="UNDERSCORE",lS="EMOJI",Qu="SYM";var cS=Object.freeze({__proto__:null,ALPHANUMERICAL:oS,AMPERSAND:Bu,APOSTROPHE:Hu,ASCIINUMERICAL:sS,ASTERISK:Uu,AT:zi,BACKSLASH:Vu,BACKTICK:zu,CARET:Wu,CLOSEANGLEBRACKET:Iu,CLOSEBRACE:sl,CLOSEBRACKET:Cu,CLOSEPAREN:Au,COLON:Fs,COMMA:hg,DOLLAR:Ku,DOT:zr,EMOJI:lS,EQUALS:qu,EXCLAMATION:pg,FULLWIDTHGREATERTHAN:ju,FULLWIDTHLEFTPAREN:Lu,FULLWIDTHLESSTHAN:Fu,FULLWIDTHMIDDLEDOT:aS,FULLWIDTHRIGHTPAREN:Pu,HYPHEN:lr,LEFTCORNERBRACKET:Ru,LEFTWHITECORNERBRACKET:Du,LOCALHOST:Pl,NL:fg,NUM:dg,OPENANGLEBRACKET:Mu,OPENBRACE:il,OPENBRACKET:Eu,OPENPAREN:Ou,PERCENT:ol,PIPE:Gu,PLUS:Yu,POUND:Xu,QUERY:al,QUOTE:mg,RIGHTCORNERBRACKET:$u,RIGHTWHITECORNERBRACKET:Nu,SCHEME:Qc,SEMI:gg,SLASH:Wr,SLASH_SCHEME:Ao,SYM:Qu,TILDE:ll,TLD:up,UNDERSCORE:Ju,UTLD:dp,UWORD:cp,WORD:gi,WS:fp});const hi=/[a-z]/,_a=new RegExp("\\p{L}","u"),Uf=new RegExp("\\p{Emoji}","u"),pi=/\d/,Vf=/\s/,Lb="\r",zf=` 143`,QU="ï¸",ZU="â",Wf="";let Ac=null,Mc=null;function e6(t=[]){const e={};zn.groups=e;const n=new zn;Ac==null&&(Ac=Pb(KU)),Mc==null&&(Mc=Pb(qU)),me(n,"'",Hu),me(n,"{",il),me(n,"}
143",sl),me(n,"[",Eu),me(n,"]",Cu),me(n,"(",Ou),me(n,")",Au),me(n,"<",Mu),me(n,">",Iu),me(n,"ï¼",Lu),me(n,"ï¼",Pu),me(n,"ã",Ru),me(n,"ã",$u),me(n,"ã",Du),me(n,"ã",Nu),me(n,"ï¼",Fu),me(n,"ï¼",ju),me(n,"&",Bu),me(n,"*",Uu),me(n,"@",zi),me(n,"`",zu),me(n,"^",Wu),me(n,":",Fs),me(n,",",hg),me(n,"$",Ku),me(n,".",zr),me(n,"=",qu),me(n,"!",pg),me(n,"-",lr),me(n,"%",ol),me(n,"|",Gu),me(n,"+",Yu),me(n,"#",Xu),me(n,"?",al),me(n,'"',mg),me(n,"/",Wr),me(n,";",gg),me(n,"~",ll),me(n,"_",Ju),me(n,"\\",Vu),me(n,"ã»",aS);const r=Kt(n,pi,dg,{[sp]:!0});Kt(r,pi,r);const i=Kt(r,hi,sS,{[rl]:!0}),s=Kt(r,_a,oS,{[ja]:!0}),o=Kt(n,hi,gi,{[op]:!0});Kt(o,pi,i),Kt(o,hi,o),Kt(i,pi,i),Kt(i,hi,i);const a=Kt(n,_a,cp,{[ap]:!0});Kt(a,hi),Kt(a,pi,s),Kt(a,_a,a),Kt(s,pi,s),Kt(s,hi),Kt(s,_a,s);const l=me(n,zf,fg,{[Hf]:!0}),c=me(n,Lb,fp,{[Hf]:!0}),u=Kt(n,Vf,fp,{[Hf]:!0});me(n,Wf,u),me(c,zf,l),me(c,Wf,u),Kt(c,Vf,u),me(u,Lb),me(u,zf),Kt(u,Vf,u),me(u,Wf,u);const d=Kt(n,Uf,lS,{[iS]:!0});me(d,"#"),Kt(d,Uf,d),me(d,QU,d);const f=me(d,ZU);me(f,"#"),Kt(f,Uf,d);const p=[[hi,o],[pi,i]],h=[[hi,null],[_a,a],[pi,s]];for(let g=0;g<Ac.length;g++)ji(n,Ac[g],up,gi,p);for(let g=0;g<Mc.length;g++)ji(n,Mc[g],dp,cp,h);Ns(up,{tld:!0,ascii:!0},e),Ns(dp,{utld:!0,alpha:!0},e),ji(n,"file",Qc,gi,p),ji(n,"mailto",Qc,gi,p),ji(n,"http",Ao,gi,p),ji(n,"https",Ao,gi,p),ji(n,"ftp",Ao,gi,p),ji(n,"ftps",Ao,gi,p),Ns(Qc,{scheme:!0,ascii:!0},e),Ns(Ao,{slashscheme:!0,ascii:!0},e),t=t.sort((g,m)=>g[0]>m[0]?1:-1);for(let g=0;g<t.length;g++){const m=t[g][0],T=t[g][1]?{[GU]:!0}:{[YU]:!0};m.indexOf("-")>=0?T[lp]=!0:hi.test(m)?pi.test(m)?T[rl]=!0:T[op]=!0:T[sp]=!0,Ib(n,m,m,T)}return Ib(n,"localhost",Pl,{ascii:!0}),n.jd=new zn(Qu),{start:n,tokens:Object.assign({groups:e},cS)}}function uS(t,e){const n=t6(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let s=0,o=0;for(;o<r;){let a=t,l=null,c=0,u=null,d=-1,f=-1;for(;o<r&&(l=a.go(n[o]));
vendor: 11,520 bytes, lines 143-146
143)a=l,a.accepts()?(d=0,f=0,u=a):d>=0&&(d+=n[o].length,f++),c+=n[o].length,s+=n[o].length,o++;s-=d,o-=f,c-=d,i.push({t:u.t,v:e.slice(s-c,s),s:s-c,e:s})}return i}function t6(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,o=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function ji(t,e,n,r,i){let s;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];t.j[l]?s=t.j[l]:(s=new zn(r),s.jr=i.slice(),t.j[l]=s),t=s}return s=new zn(n),s.jr=i.slice(),t.j[e[o-1]]=s,s}function Pb(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(t[r]),r++}return e}const Rl={defaultProtocol:"http",events:null,format:Rb,formatHref:Rb,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function vg(t,e=null){let n=Object.assign({},Rl);t&&(n=Object.assign(n,t instanceof vg?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}vg.prototype={o:Rl,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Rl[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Rb(t){return t}function dS(t,e){this.t="token",this.v=t,this.tk=e}dS.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"â¦":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Rl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:i,attributes:o,content:s,eventListeners:d}}};function Bd(t,e){class n extends dS{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const n6=Bd("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),$b=Bd("text"),r6=Bd("nl"),Ic=Bd("url",{isLink:!0,toHref(t=Rl.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Pl&&t[1].t===Fs}}),or=t=>new zn(t);function i6({groups:t}){const e=t.domain.concat([Bu,Uu,zi,Vu,zu,Wu,Ku,qu,lr,dg,ol,Gu,Yu,Xu,Wr,Qu,ll,Ju]),n=[Hu,Fs,hg,zr,pg,ol,al,mg,gg,Mu,Iu,il,sl,Cu,Eu,Ou,Au,Lu,Pu,Ru,$u,Du,Nu,Fu,ju],r=[Bu,Hu,Uu,Vu,zu,Wu,Ku,qu,lr,il,sl,ol,Gu,Yu,Xu,al,Wr,Qu,ll,Ju],i=or(),s=me(i,ll);gt(s,r,s),gt(s,t.domain,s);const o=or(),a=or(),l=or();gt(i,t.domain,o),gt(i,t.scheme,a),gt(i,t.slashscheme,l),gt(o,r,s),gt(o,t.domain,o);const c=me(o,zi);me(s,zi,c),me(a,zi,c),me(l,zi,c);const u=me(s,zr);gt(u,r,s),gt(u,t.domain,s);const d=or();gt(c,t.domain,d),gt(d,t.domain,d);const f=me(d,zr);gt(f,t.domain,d);const p=or(n6);gt(f,t.tld,p),gt(f,t.utld,p),me(c,Pl,p);const h=me(d,lr);me(h,lr,h),gt(h,t.domain,d),gt(p,t.domain,d),me(p,zr,f),me(p,lr,h);const g=me(o,lr),m=me(o,zr);me(g,lr,g),gt(g,t.domain,o),gt(m,r,s),gt(m,t.domain,o);const b=or(Ic);gt(m,t.tld,b),gt(m,t.utld,b),gt(b,t.domain,o),gt(b,r,s),me(b,zr,m),me(b,lr,g),me(b,zi,c);const T=me(b,Fs),E=or(Ic);gt(T,t.numeric,E);const w=or(Ic),M=or();gt(w,e,w),gt(w,n,M),gt(M,e,w),gt(M,n,M),me(b,Wr,w),me(E,Wr,w);const A=me(a,Fs),I=me(l,Fs),j=me(I,Wr),$=me(j,Wr);gt(a,t.domain,o),me(a,zr,m),me(a,lr,g),gt(l,t.domain,o),me(l,zr,m),me(l,lr,g),gt(A,t.domain,w),me(A,Wr,w),me(A,al,w),gt($,t.domain,w),gt($,e,w),me($,Wr,w);const J=[[il,sl],[Eu,Cu],[Ou,Au],[Mu,Iu],[Lu,Pu],[Ru,$u],[Du,Nu],[Fu,ju]];for(let se=0;se<J.length;se++){const[Q,G]=J[se],ee=me(w,Q);me(M,Q,ee);const ge=or(Ic);gt(ee,e,ge);const ae=or();gt(ee,n,ae),me(ee,G,w),gt(ge,e,ge),gt(ge,n,ae),gt(ae,e,ge),gt(ae,n,ae),me(ge,G,w),me(ae,G,w)}return me(i,Pl,b),me(i,fg,r6),{start:i,tokens:cS}}function s6(t,e,n){let r=n.length,i=0,s=[],o=[];for(;i<r;){let a=t,l=null,c=null,u=0,d=null,f=-1;for(;i<r&&!(l=a.go(n[i].t));)o.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,a=c,a.accepts()?(f=0,d=a):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(s.push(Kf($b,e,o)),o=[]),i-=f,u-=f;const p=d.t,h=n.slice(i-u,i);s.push(Kf(p,e,h))}}return o.length>0&&s.push(Kf($b,e,o)),s}function Kf(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const o6=typeof console<"u"&&console&&console.warn||(()=>{}),a6="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Nt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function l6(){return zn.groups={},Nt.scanner=null,Nt.parser=null,Nt.tokenQueue=[],Nt.pluginQueue=[],Nt.customSchemes=[],Nt.initialized=!1,Nt}function Db(t,e=!1){if(Nt.initialized&&o6(`linkifyjs: already initialized - will not register custom scheme "${t}" ${a6}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1441. Must only contain digits, lowercase ASCII letters or "-" 1452. Cannot start or end with "-" 1463. "-" cannot repeat`);Nt.customSchemes.push([t,e])}function c6(){Nt.scanner=e6(Nt.customSchemes);for(let t=0;t<Nt.tokenQueue.length;t++)Nt.tokenQueue[t][1]({scanner:Nt.scanner});Nt.parser=i6(Nt.scanner.tokens);for(let t=0;t<Nt.pluginQueue.length;t++)Nt.pluginQueue[t][1]({scanner:Nt.scanner,parser:Nt.parser});return Nt.initialized=!0,Nt}function yg(t){return Nt.initialized||c6(),s6(Nt.parser.start,t,uS(Nt.scanner.start,t))}yg.scan=uS;function fS(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new vg(n),i=yg(t),s=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}const bg="[\0-  áá â-\u2029âã]",u6=new RegExp(bg),d6=new RegExp(`${bg}$`),f6=new RegExp(bg,"g");function h6(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function p6(t){return new an({key:new Ln("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=w8(n.doc,[...e]);if(A8(a).forEach(({newRange:c})=>{const u=S8(r.doc,c,p=>p.isTextblock);let d,f;if(u.length>1)d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const p=r.doc.textBetween(c.from,c.to," "," ");if(!d6.test(p))return;d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")}if(d&&f){const p=f.split(u6).filter(Boolean);if(p.length<=0)return!1;const h=p[p.length-1],g=d.pos+f.lastIndexOf(h);if(!h)return!1;const m=yg(h).map(b=>b.toObject(t.defaultProtocol));if(!h6(m))return!1;m.filter(b=>b.isLink).map(b=>({...b,from:g+b.start+1,to:g+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{eg(b.from,b.to,r.doc).some(T=>T.mark.type===t.type)||o.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function m6(t){return new an({key:new Ln("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let o=r.target;const a=[];for(;o.nodeName!=="DIV";)a.push(o),o=o.parentNode;if(!a.find(f=>f.nodeName==="A"))return!1;const l=Mx(e.state,t.type.name),c=r.target,u=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:l.href,d=(s=c==null?void 0:c.target)!==null&&s!==void 0?s:l.target;return c&&u?(window.open(u,d),!0):!1}}})}function g6(t){return new an({key:new Ln("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:s}=i,{empty:o}=s;if(o)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=fS(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function Ts(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(f6,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const v6=Pr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Db(t);return}Db(t.scheme,t.optionalSlashes)})},onDestroy(){l6()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Ts(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Ts(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Ts(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",jt(this.options.HTMLAttributes,t),0]:["a",jt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ts(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ts(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ro({find:t=>{const e=[];
146if(t){const{protocols:n,defaultProtocol:r}=this.options,i=fS(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!Ts(o,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(p6({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Ts(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(m6({type:this.type})),this.options.linkOnPaste&&t.push(g6({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),y6=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;const s=n.getAttribute("style"),o=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${o};${s}`)})},b6=Pr.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&y6(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",jt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(s=>!!s))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}
146),k6=kn.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()}}}),w6=Pr.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",jt(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()}}});function x6(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:o,$position:a}=t,l=r&&!i,c=d5(n),u=new RegExp(`\\s${c}$`),d=o?"^":"",f=i?"":c,p=l?new RegExp(`${d}${c}.*?(?=\\s${f}|$)`,"gm"):new RegExp(`${d}(?:^)?${c}[^\\s${f}]*`,"gm"),h=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!h)return null;const g=a.pos-h.length,m=Array.from(h.matchAll(p)).pop();if(!m||m.input===void 0||m.index===void 0)return null;const b=m.input.slice(Math.max(0,m.index-1),m.index),T=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(b);if(s!==null&&!T)return null;const E=g+m.index;let w=E+m[0].length;return l&&u.test(h.slice(w-1,w+1))&&(m[0]+=" ",w+=1),E<a.pos&&w>=a.pos?{range:{from:E,to:w},query:m[0].slice(n.length),text:m[0]}:null}const S6=new Ln("suggestion");function T6({pluginKey:t=S6,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:s=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:u="is-empty",command:d=()=>null,items:f=()=>[],render:p=()=>({}),allow:h=()=>!0,findSuggestionMatch:g=x6}){let m;const b=p==null?void 0:p(),T=new an({key:t,view(){return{update:async(E,w)=>{var M,A,I,j,$,J,se;const Q=(M=this.key)===null||M===void 0?void 0:M.getState(w),G=(A=this.key)===null||A===void 0?void 0:A.getState(E.state),ee=Q.active&&G.active&&Q.range.from!==G.range.from,ge=!Q.active&&G.active,ae=Q.active&&!G.active,ke=!ge&&!ae&&Q.query!==G.query,Le=ge||ee&&ke,Ue=ke||ee,Ze=ae||ee&&ke;if(!Le&&!Ue&&!Ze)return;const Je=Ze&&!Le?Q:G,Xe=E.dom.querySelector(`[data-decoration-id="${Je.decorationId}"]`);m={editor:e,range:Je.range,query:Je.query,text:Je.text,items:[],command:We=>d({editor:e,range:Je.range,props:We}),decorationNode:Xe,clientRect:Xe?()=>{var We;const{decorationId:rt}=(We=this.key)===null||We===void 0?void 0:We.getState(e.state),je=E.dom.querySelector(`[data-decoration-id="${rt}"]`);return(je==null?void 0:je.getBoundingClientRect())||null}:null},Le&&((I=b==null?void 0:b.onBeforeStart)===null||I===void 0||I.call(b,m)),Ue&&((j=b==null?void 0:b.onBeforeUpdate)===null||j===void 0||j.call(b,m)),(Ue||Le)&&(m.items=await f({editor:e,query:Je.query})),Ze&&(($=b==null?void 0:b.onExit)===null||$===void 0||$.call(b,m)),Ue&&((J=b==null?void 0:b.onUpdate)===null||J===void 0||J.call(b,m)),Le&&((se=b==null?void 0:b.onStart)===null||se===void 0||se.call(b,m))},destroy:()=>{var E;m&&((E=b==null?void 0:b.onExit)===null||E===void 0||E.call(b,m))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(E,w,M,A){const{isEditable:I}=e,{composing:j}=e.view,{selection:$}=E,{empty:J,from:se}=$,Q={...w};if(Q.composing=j,I&&(J||e.view.composing)){(se<w.range.from||se>w.range.to)&&!j&&!w.composing&&(Q.active=!1);const G=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:o,$position:$.$from}),ee=`id_${Math.floor(Math.random()*4294967295)}`;G&&h({editor:e,state:A,range:G.range,isActive:w.active})?(Q.active=!0,Q.decorationId=w.decorationId?w.decorationId:ee,Q.range=G.range,Q.query=G.query,Q.text=G.text):Q.active=!1}else Q.active=!1;return Q.active||(Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null),Q}},props:{handleKeyDown(E,w){var M;const{active:A,range:I}=T.getState(E.state);return A&&((M=b==null?void 0:b.onKeyDown)===null||M===void 0?void 0:M.call(b,{view:E,event:w,range:I}))||!1},decorations(E){const{active:w,range:M,decorationId:A,query:I}=T.getState(E);if(!w)return null;const j=!(I!=null&&I.length),$=[l];
146return j&&$.push(u),nn.create(E.doc,[tr.inline(M.from,M.to,{nodeName:a,class:$.join(" "),"data-decoration-id":A,"data-decoration-content":c})])}}});return T}function _6({editor:t,overrideSuggestionOptions:e,extensionName:n,char:r="@"}){const i=new Ln;return{editor:t,char:r,pluginKey:i,command:({editor:s,range:o,props:a})=>{var l,c,u;const d=s.view.state.selection.$to.nodeAfter;((l=d==null?void 0:d.text)===null||l===void 0?void 0:l.startsWith(" "))&&(o.to+=1),s.chain().focus().insertContentAt(o,[{type:n,attrs:{...a,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(u=(c=s.view.dom.ownerDocument.defaultView)===null||c===void 0?void 0:c.getSelection())===null||u===void 0||u.collapseToEnd()},allow:({state:s,range:o})=>{const a=s.doc.resolve(o.from),l=s.schema.nodes[n];return!!a.parent.type.contentMatch.matchType(l)},...e}}function hS(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>_6({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function Nb(t,e){const n=hS(t),r=n.find(i=>i.char===e);return r||(n.length?n[0]:null)}const E6=Yn.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,r;return`${(n=e==null?void 0:e.char)!==null&&n!==void 0?n:"@"}${(r=t.attrs.label)!==null&&r!==void 0?r:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var r,i;return["span",jt(this.HTMLAttributes,t.HTMLAttributes),`${(r=n==null?void 0:n.char)!==null&&r!==void 0?r:"@"}${(i=e.attrs.label)!==null&&i!==void 0?i:e.attrs.id}`]},suggestions:[],suggestion:{}}},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}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=Nb(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",jt({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const r={...this.options};r.HTMLAttributes=jt({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:r,node:t,suggestion:n});return typeof i=="string"?["span",jt({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:t}){const e={options:this.options,node:t,suggestion:Nb(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:i,anchor:s}=r;if(!i)return!1;e.doc.nodesBetween(s-1,s,(l,c)=>{if(l.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",c,c+l.nodeSize),!1});let o=new Ci,a=0;return e.doc.nodesBetween(s-1,s,(l,c)=>{if(l.type.name===this.name)return n=!0,o=l,a=c,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,a,a+o.nodeSize),n})}},addProseMirrorPlugins(){return hS(this).map(T6)}}),C6=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,O6=Yn.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",jt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}}
146,addInputRules(){return[Lx({find:C6,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Ut={init:A6,document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function wo(){}function A6(t){const e=t;Ut.document=e.document,Ut.DocumentFragment=e.DocumentFragment||wo,Ut.SVGElement=e.SVGElement||wo,Ut.SVGSVGElement=e.SVGSVGElement||wo,Ut.SVGElementInstance=e.SVGElementInstance||wo,Ut.Element=e.Element||wo,Ut.HTMLElement=e.HTMLElement||Ut.Element,Ut.Event=e.Event,Ut.Touch=e.Touch||wo,Ut.PointerEvent=e.PointerEvent||e.MSPointerEvent}const pS=t=>!!(t&&t.Window)&&t instanceof t.Window;let mS,fo;function gS(t){mS=t;const e=t.document.createTextNode("");e.ownerDocument!==t.document&&typeof t.wrap=="function"&&t.wrap(e)===e&&(t=t.wrap(t)),fo=t}typeof window<"u"&&window&&gS(window);function oa(t){return pS(t)?t:(t.ownerDocument||t).defaultView||fo.window}const M6=t=>t===fo||pS(t),I6=t=>Hd(t)&&t.nodeType===11,Hd=t=>!!t&&typeof t=="object",vS=t=>typeof t=="function",L6=t=>typeof t=="number",P6=t=>typeof t=="boolean",R6=t=>typeof t=="string",$6=t=>{if(!t||typeof t!="object")return!1;const e=oa(t)||fo;return/object|function/.test(typeof Element)?t instanceof Element||t instanceof e.Element:t.nodeType===1&&typeof t.nodeName=="string"},D6=t=>Hd(t)&&!!t.constructor&&/function Object\b/.test(t.constructor.toString()),N6=t=>Hd(t)&&typeof t.length<"u"&&vS(t.splice),ye={window:M6,docFrag:I6,object:Hd,func:vS,number:L6,bool:P6,string:R6,element:$6,plainObject:D6,array:N6},Xt={init:F6,supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null};function F6(t){const e=Ut.Element,n=t.navigator||{};Xt.supportsTouch="ontouchstart"in t||ye.func(t.DocumentTouch)&&Ut.document instanceof t.DocumentTouch,Xt.supportsPointerEvent=n.pointerEnabled!==!1&&!!Ut.PointerEvent,Xt.isIOS=/iP(hone|od|ad)/.test(n.platform),Xt.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),Xt.isIe9=/MSIE 9/.test(n.userAgent),Xt.isOperaMobile=n.appName==="Opera"&&Xt.supportsTouch&&/Presto/.test(n.userAgent),Xt.prefixedMatchesSelector="matches"in e.prototype?"matches":"webkitMatchesSelector"in e.prototype?"webkitMatchesSelector":"mozMatchesSelector"in e.prototype?"mozMatchesSelector":"oMatchesSelector"in e.prototype?"oMatchesSelector":"msMatchesSelector",Xt.pEventTypes=Xt.supportsPointerEvent?Ut.PointerEvent===t.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,Xt.wheelEvent=Ut.document&&"onmousewheel"in Ut.document?"mousewheel":"wheel"}const j6=(t,e)=>t.indexOf(e)!==-1,yS=(t,e)=>{for(const n of e)t.push(n);return t},bS=t=>yS([],t),Ud=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return n;return-1},hp=(t,e)=>t[Ud(t,e)];function aa(t){const e={};for(const n in t){const r=t[n];ye.plainObject(r)?e[n]=aa(r):ye.array(r)?e[n]=bS(r):e[n]=r}return e}function st(t,e){for(const r in e)t[r]=e[r];return t}let Fb=0,vi,Os;function B6(t){if(vi=t.requestAnimationFrame,Os=t.cancelAnimationFrame,!vi){const e=["ms","moz","webkit","o"];for(const n of e)vi=t[`${n}RequestAnimationFrame`],Os=t[`${n}CancelAnimationFrame`]||t[`${n}CancelRequestAnimationFrame`]}vi=vi&&vi.bind(t),Os=Os&&Os.bind(t),vi||(vi=e=>{const n=Date.now(),r=Math.max(0,16-(n-Fb)),i=t.setTimeout(()=>{e(n+r)},r);return Fb=n+r,i},Os=e=>clearTimeout(e))}const H6={request:t=>vi(t),cancel:t=>Os(t),init:B6};function jo(t,e,n){if(n=n||{},ye.string(t)&&t.search(" ")!==-1&&(t=jb(t)),ye.array(t))return t.reduce((r,i)=>st(r,jo(i,e,n)),n);if(ye.object(t)&&(e=t,t=""),ye.func(e))n[t]=n[t]||[],n[t].push(e);else if(ye.array(e))for(const r of e)jo(t,r,n);else if(ye.object(e))for(const r in e){const i=jb(r).map(s=>`${t}${s}`);jo(i,e[r],n)}return n}function jb(t){return t.trim().split(/ +/)}function Bb(t,e){for(const n of e){if(t.immediatePropagationStopped)break;n(t)}}
146class kS{constructor(e){te(this,"options");te(this,"types",{});te(this,"propagationStopped",!1);te(this,"immediatePropagationStopped",!1);te(this,"global");this.options=st({},e||{})}fire(e){let n;const r=this.global;(n=this.types[e.type])&&Bb(e,n),!e.propagationStopped&&r&&(n=r[e.type])&&Bb(e,n)}on(e,n){const r=jo(e,n);for(e in r)this.types[e]=yS(this.types[e]||[],r[e])}off(e,n){const r=jo(e,n);for(e in r){const i=this.types[e];if(!(!i||!i.length))for(const s of r[e]){const o=i.indexOf(s);o!==-1&&i.splice(o,1)}}}getRect(e){return null}}function Xs(t,e){if(t.contains)return t.contains(e);for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function wS(t,e){for(;ye.element(t);){if(so(t,e))return t;t=ho(t)}return null}function ho(t){let e=t.parentNode;if(ye.docFrag(e)){for(;(e=e.host)&&ye.docFrag(e););return e}return e}function so(t,e){return fo!==mS&&(e=e.replace(/\/deep\//g," ")),t[Xt.prefixedMatchesSelector](e)}function pp(t,e,n){for(;ye.element(t);){if(so(t,e))return!0;if(t=ho(t),t===n)return so(t,e)}return!1}function Hb(t){return t.correspondingUseElement||t}function U6(t){return t=t||fo,{x:t.scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop}}function xS(t){const e=t instanceof Ut.SVGElement?t.getBoundingClientRect():t.getClientRects()[0];return e&&{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width||e.right-e.left,height:e.height||e.bottom-e.top}}function kg(t){const e=xS(t);if(!Xt.isIOS7&&e){const n=U6(oa(t));e.left+=n.x,e.right+=n.x,e.top+=n.y,e.bottom+=n.y}return e}function Ub(t){return ye.string(t)?(Ut.document.querySelector(t),!0):!1}function V6(t,e,n){return t==="parent"?ho(n):t==="self"?e.getRect(n):wS(n,t)}function $l(t,e,n,r){let i=t;return ye.string(i)?i=V6(i,e,n):ye.func(i)&&(i=i(...r)),ye.element(i)&&(i=kg(i)),i}function Vd(t){return t&&{x:"x"in t?t.x:t.left,y:"y"in t?t.y:t.top}}function z6(t){return t&&!("left"in t&&"top"in t)&&(t=st({},t),t.left=t.x||0,t.top=t.y||0,t.right=t.right||t.left+t.width,t.bottom=t.bottom||t.top+t.height),t}function Vb(t){return t&&!("x"in t&&"y"in t)&&(t=st({},t),t.x=t.left||0,t.y=t.top||0,t.width=t.width||(t.right||0)-t.x,t.height=t.height||(t.bottom||0)-t.y),t}function wg(t,e,n){t.left&&(e.left+=n.x),t.right&&(e.right+=n.x),t.top&&(e.top+=n.y),t.bottom&&(e.bottom+=n.y),e.width=e.right-e.left,e.height=e.bottom-e.top}function xg(t,e,n){const r=t.options[n],s=r&&r.origin||t.options.origin,o=$l(s,t,e,[t&&e]);return Vd(o)||{x:0,y:0}}const zd=(t,e)=>Math.sqrt(t*t+e*e);class SS{constructor(e){te(this,"immediatePropagationStopped",!1);te(this,"propagationStopped",!1);this._interaction=e}preventDefault(){}stopPropagation(){this.propagationStopped=!0}stopImmediatePropagation(){this.immediatePropagationStopped=this.propagationStopped=!0}}Object.defineProperty(SS.prototype,"interaction",{get(){return this._interaction._proxy},set(){}});const TS={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}};class Sg extends SS{constructor(n,r,i,s,o,a,l){super(n);te(this,"relatedTarget",null);te(this,"screenX");te(this,"screenY");te(this,"button");te(this,"buttons");te(this,"ctrlKey");te(this,"shiftKey");te(this,"altKey");te(this,"metaKey");te(this,"page");te(this,"client");te(this,"delta");te(this,"rect");te(this,"x0");te(this,"y0");te(this,"t0");te(this,"dt");te(this,"duration");te(this,"clientX0");te(this,"clientY0");te(this,"velocity");te(this,"speed");te(this,"swipe");te(this,"axes");te(this,"preEnd");o=o||n.element;const c=n.interactable,u=(c&&c.options||TS).deltaSource,d=xg(c,o,i),f=s==="start",p=s==="end",h=f?this:n.prevEvent,g=f?n.coords.start:p?{page:h.page,client:h.client,timeStamp:n.coords.cur.timeStamp}:n.coords.cur;this.page=st({},g.page),this.client=st({},g.client),this.rect=st({},n.rect),this.timeStamp=g.timeStamp,p||(this.page.x-=d.x,this.page.y-=d.y,this.client.x-=d.x,this.client.y-=d.y),this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.button=r.button,this.buttons=r.buttons,this.target=o,this.currentTarget=o,this.preEnd=a,this.type=l||i+(s||""),this.interactable=c,this.t0=f?n.pointers[n.pointers.length-1].downTime:h.t0,this.x0=n.coords.start.page.x-d.x,this.y0=n.coords.start.page.y-d.y,this.clientX0=n.coords.start.client.x-d.x,this.clientY0=n.coords.start.client.y-d.y,f||p?this.delta={x:0,y:0}:this.delta={x:this[u].x-h[u].x,y:this[u].y-h[u].y},this.dt=n.coords.delta.timeStamp,this.duration=this.timeStamp-this.t0,this.velocity=st({},n.coords.velocity[u]),this.speed=zd(this.velocity.x,this.velocity.y),this.swipe=p||s==="inertiastart"?this.get
146Swipe():null}getSwipe(){const n=this._interaction;if(n.prevEvent.speed<600||this.timeStamp-n.prevEvent.timeStamp>150)return null;let r=180*Math.atan2(n.prevEvent.velocityY,n.prevEvent.velocityX)/Math.PI;const i=22.5;r<0&&(r+=360);const s=135-i<=r&&r<225+i,o=225-i<=r&&r<315+i,a=!s&&(315-i<=r||r<45+i),l=!o&&45-i<=r&&r<135+i;return{up:o,down:l,left:s,right:a,angle:r,speed:n.prevEvent.speed,velocity:{x:n.prevEvent.velocityX,y:n.prevEvent.velocityY}}}preventDefault(){}stopImmediatePropagation(){this.immediatePropagationStopped=this.propagationStopped=!0}stopPropagation(){this.propagationStopped=!0}}Object.defineProperties(Sg.prototype,{pageX:{get(){return this.page.x},set(t){this.page.x=t}},pageY:{get(){return this.page.y},set(t){this.page.y=t}},clientX:{get(){return this.client.x},set(t){this.client.x=t}},clientY:{get(){return this.client.y},set(t){this.client.y=t}},dx:{get(){return this.delta.x},set(t){this.delta.x=t}},dy:{get(){return this.delta.y},set(t){this.delta.y=t}},velocityX:{get(){return this.velocity.x},set(t){this.velocity.x=t}},velocityY:{get(){return this.velocity.y},set(t){this.velocity.y=t}}});function Dl(t,e){let n=!1;return function(){return n||(fo.console.warn(e),n=!0),t.apply(this,arguments)}}function _S(t,e){return t.name=e.name,t.axis=e.axis,t.edges=e.edges,t}function ES(t,e){t.__set||(t.__set={});for(const n in e)typeof t[n]!="function"&&n!=="__set"&&Object.defineProperty(t,n,{get(){return n in t.__set?t.__set[n]:t.__set[n]=e[n]},set(r){t.__set[n]=r},configurable:!0});return t}function qf(t,e){t.page=t.page||{},t.page.x=e.page.x,t.page.y=e.page.y,t.client=t.client||{},t.client.x=e.client.x,t.client.y=e.client.y,t.timeStamp=e.timeStamp}function W6(t,e,n){t.page.x=n.page.x-e.page.x,t.page.y=n.page.y-e.page.y,t.client.x=n.client.x-e.client.x,t.client.y=n.client.y-e.client.y,t.timeStamp=n.timeStamp-e.timeStamp}function K6(t,e){const n=Math.max(e.timeStamp/1e3,.001);t.page.x=e.page.x/n,t.page.y=e.page.y/n,t.client.x=e.client.x/n,t.client.y=e.client.y/n,t.timeStamp=n}function q6(t){t.page.x=0,t.page.y=0,t.client.x=0,t.client.y=0}function CS(t){return t instanceof Ut.Event||t instanceof Ut.Touch}function Zu(t,e,n){return n=n||{},t=t||"page",n.x=e[t+"X"],n.y=e[t+"Y"],n}function G6(t,e){return e=e||{x:0,y:0},Xt.isOperaMobile&&CS(t)?(Zu("screen",t,e),e.x+=window.scrollX,e.y+=window.scrollY):Zu("page",t,e),e}function Y6(t,e){return e=e||{},Xt.isOperaMobile&&CS(t)?Zu("screen",t,e):Zu("client",t,e),e}function ed(t){return ye.number(t.pointerId)?t.pointerId:t.identifier}function X6(t,e,n){const r=e.length>1?OS(e):e[0];G6(r,t.page),Y6(r,t.client),t.timeStamp=n}function Tg(t){const e=[];return ye.array(t)?(e[0]=t[0],e[1]=t[1]):t.type==="touchend"?t.touches.length===1?(e[0]=t.touches[0],e[1]=t.changedTouches[0]):t.touches.length===0&&(e[0]=t.changedTouches[0],e[1]=t.changedTouches[1]):(e[0]=t.touches[0],e[1]=t.touches[1]),e}function OS(t){const e={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0};for(const n of t)for(const r in e)e[r]+=n[r];for(const n in e)e[n]/=t.length;return e}function J6(t){if(!t.length)return null;const e=Tg(t),n=Math.min(e[0].pageX,e[1].pageX),r=Math.min(e[0].pageY,e[1].pageY),i=Math.max(e[0].pageX,e[1].pageX),s=Math.max(e[0].pageY,e[1].pageY);return{x:n,y:r,left:n,top:r,right:i,bottom:s,width:i-n,height:s-r}}function Q6(t,e){const n=e+"X",r=e+"Y",i=Tg(t),s=i[0][n]-i[1][n],o=i[0][r]-i[1][r];return zd(s,o)}function Z6(t,e){const n=e+"X",r=e+"Y",i=Tg(t),s=i[1][n]-i[0][n],o=i[1][r]-i[0][r];return 180*Math.atan2(o,s)/Math.PI}function eV(t){return ye.string(t.pointerType)?t.pointerType:ye.number(t.pointerType)?[void 0,void 0,"touch","pen","mouse"][t.pointerType]:/touch/.test(t.type||"")||t instanceof Ut.Touch?"touch":"mouse"}function AS(t){const e=ye.func(t.composedPath)?t.composedPath():t.path;return[Hb(e?e[0]:t.target),Hb(t.currentTarget)]}function Ea(){return{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}}function mp(t,e){if(e.phaselessTypes[t])return!0;for(const n in e.map)if(t.indexOf(n)===0&&t.substr(n.length)in e.phases)return!0;return!1}function tV(t){const e=(n,r)=>{let i=t.interactables.get(n,r);
146return i||(i=t.interactables.new(n,r),i.events.global=e.globalEvents),i};return e.getPointerAverage=OS,e.getTouchBBox=J6,e.getTouchDistance=Q6,e.getTouchAngle=Z6,e.getElementRect=kg,e.getElementClientRect=xS,e.matchesSelector=so,e.closest=wS,e.globalEvents={},e.version="1.10.17",e.scope=t,e.use=function(n,r){return this.scope.usePlugin(n,r),this},e.isSet=function(n,r){return!!this.scope.interactables.get(n,r&&r.context)},e.on=Dl(function(r,i,s){if(ye.string(r)&&r.search(" ")!==-1&&(r=r.trim().split(/ +/)),ye.array(r)){for(const o of r)this.on(o,i,s);return this}if(ye.object(r)){for(const o in r)this.on(o,r[o],i);return this}return mp(r,this.scope.actions)?this.globalEvents[r]?this.globalEvents[r].push(i):this.globalEvents[r]=[i]:this.scope.events.add(this.scope.document,r,i,{options:s}),this},"The interact.on() method is being deprecated"),e.off=Dl(function(r,i,s){if(ye.string(r)&&r.search(" ")!==-1&&(r=r.trim().split(/ +/)),ye.array(r)){for(const o of r)this.off(o,i,s);return this}if(ye.object(r)){for(const o in r)this.off(o,r[o],i);return this}if(mp(r,this.scope.actions)){let o;r in this.globalEvents&&(o=this.globalEvents[r].indexOf(i))!==-1&&this.globalEvents[r].splice(o,1)}else this.scope.events.remove(this.scope.document,r,i,s);return this},"The interact.off() method is being deprecated"),e.debug=function(){return this.scope},e.supportsTouch=function(){return Xt.supportsTouch},e.supportsPointerEvent=function(){return Xt.supportsPointerEvent},e.stop=function(){for(const n of this.scope.interactions.list)n.stop();return this},e.pointerMoveTolerance=function(n){return ye.number(n)?(this.scope.interactions.pointerMoveTolerance=n,this):this.scope.interactions.pointerMoveTolerance},e.addDocument=function(n,r){this.scope.addDocument(n,r)},e.removeDocument=function(n){this.scope.removeDocument(n)},e}class nV{constructor(e,n,r,i){te(this,"options");te(this,"_actions");te(this,"target");te(this,"events",new kS);te(this,"_context");te(this,"_win");te(this,"_doc");te(this,"_scopeEvents");te(this,"_rectChecker");this._actions=n.actions,this.target=e,this._context=n.context||r,this._win=oa(Ub(e)?this._context:e),this._doc=this._win.document,this._scopeEvents=i,this.set(n)}get _defaults(){return{base:{},perAction:{},actions:{}}}setOnEvents(e,n){return ye.func(n.onstart)&&this.on(`${e}start`,n.onstart),ye.func(n.onmove)&&this.on(`${e}move`,n.onmove),ye.func(n.onend)&&this.on(`${e}end`,n.onend),ye.func(n.oninertiastart)&&this.on(`${e}inertiastart`,n.oninertiastart),this}updatePerActionListeners(e,n,r){(ye.array(n)||ye.object(n))&&this.off(e,n),(ye.array(r)||ye.object(r))&&this.on(e,r)}setPerAction(e,n){const r=this._defaults;for(const i in n){const s=i,o=this.options[e],a=n[s];s==="listeners"&&this.updatePerActionListeners(e,o.listeners,a),ye.array(a)?o[s]=bS(a):ye.plainObject(a)?(o[s]=st(o[s]||{},aa(a)),ye.object(r.perAction[s])&&"enabled"in r.perAction[s]&&(o[s].enabled=a.enabled!==!1)):ye.bool(a)&&ye.object(r.perAction[s])?o[s].enabled=a:o[s]=a}}getRect(e){return e=e||(ye.element(this.target)?this.target:null),ye.string(this.target)&&(e=e||this._context.querySelector(this.target)),kg(e)}rectChecker(e){return ye.func(e)?(this._rectChecker=e,this.getRect=n=>{const r=st({},this._rectChecker(n));return"width"in r||(r.width=r.right-r.left,r.height=r.bottom-r.top),r},this):e===null?(delete this.getRect,delete this._rectChecker,this):this.getRect}_backCompatOption(e,n){if(Ub(n)||ye.object(n)){this.options[e]=n;for(const r in this._actions.map)this.options[r][e]=n;return this}return this.options[e]}origin(e){return this._backCompatOption("origin",e)}deltaSource(e){return e==="page"||e==="client"?(this.options.deltaSource=e,this):this.options.deltaSource}context(){return this._context}inContext(e){return this._context===e.ownerDocument||Xs(this._context,e)}testIgnoreAllow(e,n,r){return!this.testIgnore(e.ignoreFrom,n,r)&&this.testAllow(e.allowFrom,n,r)}testAllow(e,n,r){return e?ye.element(r)?ye.string(e)?pp(r,e,n):ye.element(e)?Xs(e,r):!1:!1:!0}testIgnore(e,n,r){return!e||!ye.element(r)?!1:ye.string(e)?pp(r,e,n):ye.element(e)?Xs(e,r):!1}fire(e){return this.events.fire(e),this}_onOff(e,n,r,i){ye.object(n)&&!ye.array(n)&&(i=r,r=null);const s=e==="on"?"add":"remove",o=jo(n,r);for(let a in o){a==="wheel"&&(a=Xt.wheelEvent);for(const l of o[a])mp(a,this._actions)?this.events[e](a,l):ye.string(this.target)?this._scopeEvents[`${s}
146Delegate`](this.target,this._context,a,l,i):this._scopeEvents[s](this.target,a,l,i)}return this}on(e,n,r){return this._onOff("on",e,n,r)}off(e,n,r){return this._onOff("off",e,n,r)}set(e){const n=this._defaults;ye.object(e)||(e={}),this.options=aa(n.base);for(const r in this._actions.methodDict){const i=r,s=this._actions.methodDict[i];this.options[i]={},this.setPerAction(i,st(st({},n.perAction),n.actions[i])),this[s](e[i])}for(const r in e)ye.func(this[r])&&this[r](e[r]);return this}unset(){if(ye.string(this.target))for(const e in this._scopeEvents.delegatedEvents){const n=this._scopeEvents.delegatedEvents[e];for(let r=n.length-1;r>=0;r--){const{selector:i,context:s,listeners:o}=n[r];i===this.target&&s===this._context&&n.splice(r,1);for(let a=o.length-1;a>=0;a--)this._scopeEvents.removeDelegate(this.target,this._context,e,o[a][0],o[a][1])}}else this._scopeEvents.remove(this.target,"all")}}class rV{constructor(e){te(this,"list",[]);te(this,"selectorMap",{});te(this,"scope");this.scope=e,e.addListeners({"interactable:unset":({interactable:n})=>{const{target:r,_context:i}=n,s=ye.string(r)?this.selectorMap[r]:r[this.scope.id],o=Ud(s,a=>a.context===i);s[o]&&(s[o].context=null,s[o].interactable=null),s.splice(o,1)}})}new(e,n){n=st(n||{},{actions:this.scope.actions});const r=new this.scope.Interactable(e,n,this.scope.document,this.scope.events),i={context:r._context,interactable:r};return this.scope.addDocument(r._doc),this.list.push(r),ye.string(e)?(this.selectorMap[e]||(this.selectorMap[e]=[]),this.selectorMap[e].push(i)):(r.target[this.scope.id]||Object.defineProperty(e,this.scope.id,{value:[],configurable:!0}),e[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:e,options:n,interactable:r,win:this.scope._win}),r}get(e,n){const r=n&&n.context||this.scope.document,i=ye.string(e),s=i?this.selectorMap[e]:e[this.scope.id];if(!s)return null;const o=hp(s,a=>a.context===r&&(i||a.interactable.inContext(e)));return o&&o.interactable}forEachMatch(e,n){for(const r of this.list){let i;if((ye.string(r.target)?ye.element(e)&&so(e,r.target):e===r.target)&&r.inContext(e)&&(i=n(r)),i!==void 0)return i}}}function iV(t){var e;const n=[],r={},i=[],s={add:o,remove:a,addDelegate:l,removeDelegate:c,delegateListener:u,delegateUseCapture:d,delegatedEvents:r,documents:i,targets:n,supportsOptions:!1,supportsPassive:!1};(e=t.document)==null||e.createElement("div").addEventListener("test",null,{get capture(){return s.supportsOptions=!0},get passive(){return s.supportsPassive=!0}}),t.events=s;function o(f,p,h,g){const m=Ca(g);let b=hp(n,T=>T.eventTarget===f);b||(b={eventTarget:f,events:{}},n.push(b)),b.events[p]||(b.events[p]=[]),f.addEventListener&&!j6(b.events[p],h)&&(f.addEventListener(p,h,s.supportsOptions?m:m.capture),b.events[p].push(h))}function a(f,p,h,g){const m=Ca(g),b=Ud(n,M=>M.eventTarget===f),T=n[b];if(!T||!T.events)return;if(p==="all"){for(p in T.events)T.events.hasOwnProperty(p)&&a(f,p,"all");return}let E=!1;const w=T.events[p];if(w){if(h==="all"){for(let M=w.length-1;M>=0;M--)a(f,p,w[M],m);return}else for(let M=0;M<w.length;M++)if(w[M]===h){f.removeEventListener(p,h,s.supportsOptions?m:m.capture),w.splice(M,1),w.length===0&&(delete T.events[p],E=!0);break}}E&&!Object.keys(T.events).length&&n.splice(b,1)}function l(f,p,h,g,m){const b=Ca(m);if(!r[h]){r[h]=[];for(const w of i)o(w,h,u),o(w,h,d,!0)}const T=r[h];let E=hp(T,w=>w.selector===f&&w.context===p);E||(E={selector:f,context:p,listeners:[]},T.push(E)),E.listeners.push([g,b])}function c(f,p,h,g,m){const b=Ca(m),T=r[h];let E=!1,w;if(T)for(w=T.length-1;w>=0;w--){const M=T[w];if(M.selector===f&&M.context===p){const{listeners:A}=M;for(let I=A.length-1;I>=0;I--){const[j,{capture:$,passive:J}]=A[I];if(j===g&&$===b.capture&&J===b.passive){A.splice(I,1),A.length||(T.splice(w,1),a(p,h,u),a(p,h,d,!0)),E=!0;break}}if(E)break}}}function u(f,p){const h=Ca(p),g=new sV(f),m=r[f.type],[b]=AS(f);let T=b;for(;ye.element(T);){for(let E=0;E<m.length;E++){const w=m[E],{selector:M,context:A}=w;if(so(T,M)&&Xs(A,b)&&Xs(A,T)){const{listeners:I}=w;g.currentTarget=T;for(const[j,{capture:$,passive:J}]of I)$===h.capture&&J===h.passive&&j(g)}}T=ho(T)}}function d(f){return u.call(this,f,!0)}return s}
146class sV{constructor(e){te(this,"currentTarget");te(this,"originalEvent");te(this,"type");this.originalEvent=e,ES(this,e)}preventOriginalDefault(){this.originalEvent.preventDefault()}stopPropagation(){this.originalEvent.stopPropagation()}stopImmediatePropagation(){this.originalEvent.stopImmediatePropagation()}}function Ca(t){if(!ye.object(t))return{capture:!!t,passive:!1};const e=st({},t);return e.capture=!!t.capture,e.passive=!!t.passive,e}const oV={id:"events",install:iV};class aV{constructor(e,n,r,i,s){te(this,"id");te(this,"pointer");te(this,"event");te(this,"downTime");te(this,"downTarget");this.id=e,this.pointer=n,this.event=r,this.downTime=i,this.downTarget=s}}let gp;(function(t){t.interactable="",t.element="",t.prepared="",t.pointerIsDown="",t.pointerWasMoved="",t._proxy=""})(gp||(gp={}));let vp;(function(t){t.start="",t.move="",t.end="",t.stop="",t.interacting=""})(vp||(vp={}));let lV=0;class cV{constructor({pointerType:e,scopeFire:n}){te(this,"interactable",null);te(this,"element",null);te(this,"rect",null);te(this,"_rects");te(this,"edges",null);te(this,"_scopeFire");te(this,"prepared",{name:null,axis:null,edges:null});te(this,"pointerType");te(this,"pointers",[]);te(this,"downEvent",null);te(this,"downPointer",{});te(this,"_latestPointer",{pointer:null,event:null,eventTarget:null});te(this,"prevEvent",null);te(this,"pointerIsDown",!1);te(this,"pointerWasMoved",!1);te(this,"_interacting",!1);te(this,"_ending",!1);te(this,"_stopped",!0);te(this,"_proxy",null);te(this,"simulation",null);te(this,"doMove",Dl(function(e){this.move(e)},"The interaction.doMove() method has been renamed to interaction.move()"));te(this,"coords",{start:Ea(),prev:Ea(),cur:Ea(),delta:Ea(),velocity:Ea()});te(this,"_id",lV++);this._scopeFire=n,this.pointerType=e;const r=this;this._proxy={};for(const i in gp)Object.defineProperty(this._proxy,i,{get(){return r[i]}});for(const i in vp)Object.defineProperty(this._proxy,i,{value:(...s)=>r[i](...s)});this._scopeFire("interactions:new",{interaction:this})}get pointerMoveTolerance(){return 1}pointerDown(e,n,r){const i=this.updatePointer(e,n,r,!0),s=this.pointers[i];this._scopeFire("interactions:down",{pointer:e,event:n,eventTarget:r,pointerIndex:i,pointerInfo:s,type:"down",interaction:this})}start(e,n,r){return this.interacting()||!this.pointerIsDown||this.pointers.length<(e.name==="gesture"?2:1)||!n.options[e.name].enabled?!1:(_S(this.prepared,e),this.interactable=n,this.element=r,this.rect=n.getRect(r),this.edges=this.prepared.edges?st({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}pointerMove(e,n,r){!this.simulation&&!(this.modification&&this.modification.endResult)&&this.updatePointer(e,n,r,!1);const i=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;let s,o;this.pointerIsDown&&!this.pointerWasMoved&&(s=this.coords.cur.client.x-this.coords.start.client.x,o=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=zd(s,o)>this.pointerMoveTolerance);const a=this.getPointerIndex(e),l={pointer:e,pointerIndex:a,pointerInfo:this.pointers[a],event:n,type:"move",eventTarget:r,dx:s,dy:o,duplicate:i,interaction:this};i||K6(this.coords.velocity,this.coords.delta),this._scopeFire("interactions:move",l),!i&&!this.simulation&&(this.interacting()&&(l.type=null,this.move(l)),this.pointerWasMoved&&qf(this.coords.prev,this.coords.cur))}move(e){(!e||!e.event)&&q6(this.coords.delta),e=st({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},e||{}),e.phase="move",this._doPhase(e)}pointerUp(e,n,r,i){let s=this.getPointerIndex(e);s===-1&&(s=this.updatePointer(e,n,r,!1));const o=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire(`interactions:${o}`,{pointer:e,pointerIndex:s,pointerInfo:this.pointers[s],event:n,eventTarget:r,type:o,curEventTarget:i,interaction:this}),this.simulation||this.end(n),this.removePointer(e,n)}documentBlur(e){this.end(e),this._scopeFire("interactions:blur",{event:e,type:"blur",interaction:this})}end(e){this._ending=!0,e=e||this._latestPointer.event;let n;this.interacting()&&(n=this._doPhase({event:e,interaction:this,phase:"end"})),this._ending=!1,n===!0&&this.stop()}currentAction(){return this._interacting?this.prepared.name:null}interacting(){return this._interacting}stop(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}getPointerIndex(e){const n=ed(e);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:Ud(this.pointers,r=>r.id===n)}getPointerInfo(e){return this.pointers[this.getPointerIndex(e)]}updatePointer(e,n,r,i){const s=ed(e);let o=this.getPointerIndex(e),a=this.pointers[o];return i=i===!1?!1:i||/(down|start)$/i.test(n.type),a?a.pointer=e:(a=new aV(s,e,n,null,null),o=this.pointers.length,this.pointers.push(a)),X6(this.coords.cur,this.pointers.map(l=>l.pointer),this._now()),W6(this.coords.delta,this.coords.prev,this.coords.cur),i&&(this.pointerIsDown=!0,a.downTime=this.coords.cur.timeStamp,a.downTarget=r,ES(this.downPointer,e),this.interacting()||(qf(this.coords.start,this.coords.cur),qf(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(e,n,r),this._scopeFire("interactions:update-pointer",{pointer:e,event:n,eventTarget:r,down:i,pointerInfo:a,pointerIndex:o,interaction:this}),o}removePointer(e,n){const r=this.getPointerIndex(e);if(r===-1)return;const i=this.pointers[r];this._scopeFire("interactions:remove-pointer",{pointer:e,event:n,eventTarget:null,pointerIndex:r,pointerInfo:i,interaction:this}),this.pointers.splice(r,1),this.pointerIsDown=!1}_updateLatestPointer(e,n,r){this._latestPointer.pointer=e,this._latestPointer.event=n,this._latestPointer.eventTarget=r}destroy(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}_createPreparedEvent(e,n,r,i){return new Sg(this,e,this.prepared.name,n,this.element,r,i)}_fireEvent(e){var n;(n=this.interactable)==null||n.fire(e),(!this.prevEvent||e.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=e)}_doPhase(e){const{event:n,phase:r,preEnd:i,type:s}=e,{rect:o}=this;if(o&&r==="move"&&(wg(this.edges,o,this.coords.delta[this.interactable.options.deltaSource]),o.width=o.right-o.left,o.height=o.bottom-o.top),this._scopeFire(`interactions:before-action-${r}`,e)===!1)return!1;const l=e.iEvent=this._createPreparedEvent(n,r,i,s);return this._scopeFire(`interactions:action-${r}`,e),r==="start"&&(this.prevEvent=l),this._fireEvent(l),this._scopeFire(`interactions:after-action-${r}`,e),!0}_now(){return Date.now()}}function uV(t){return/^(always|never|auto)$/.test(t)?(this.options.preventDefault=t,this):ye.bool(t)?(this.options.preventDefault=t?"always":"never",this):this.options.preventDefault}function dV(t,e,n){const r=t.options.preventDefault;if(r!=="never"){if(r==="always"){n.preventDefault();return}if(e.events.supportsPassive&&/^touch(start|move)$/.test(n.type)){const i=oa(n.target).document,s=e.getDocOptions(i);if(!(s&&s.events)||s.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(n.type)||ye.element(n.target)&&so(n.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||n.preventDefault()}}function fV({interaction:t,event:e}){t.interactable&&t.interactable.checkAndPreventDefault(e)}function hV(t){const{Interactable:e}=t;e.prototype.preventDefault=uV,e.prototype.checkAndPreventDefault=function(n){return dV(this,t,n)},t.interactions.docEvents.push({type:"dragstart",listener(n){for(const r of t.interactions.list)if(r.element&&(r.element===n.target||Xs(r.element,n.target))){r.interactable.checkAndPreventDefault(n);return}}})}const pV={id:"core/interactablePreventDefault",install:hV,listeners:["down","move","up","cancel"].reduce((t,e)=>(t[`interactions:${e}`]=fV,t),{})},yp={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search(t){for(const e of yp.methodOrder){const n=yp[e](t);if(n)return n}return null},simulationResume({pointerType:t,eventType:e,eventTarget:n,scope:r}){if(!/down|start/i.test(e))return null;for(const i of r.interactions.list){let s=n;if(i.simulation&&i.simulation.allowResume&&i.pointerType===t)for(;s;){if(s===i.element)return i;s=ho(s)}}return null},mouseOrPen({pointerId:t,pointerType:e,eventType:n,scope:r}){if(e!=="mouse"&&e!=="pen")return null;let i;for(const s of r.interactions.list)if(s.pointerType===e){if(s.simulation&&!zb(s,t))continue;if(s.interacting())return s;i||(i=s)}if(i)return i;for(const s of r.interactions.list)if(s.pointerType===e&&!(/down/i.test(n)&&s.simulation))return s;return null},hasPointer({pointerId:t,scope:e}){for(const n of e.interactions.list)if(zb(n,t))return n;return null},idle({pointerType:t,scope:e}){for(const n of e.interactions.list){if(n.pointers.length===1){const r=n.interactable;if(r&&!(r.options.gesture&&r.options.gesture.enabled))continue}else if(n.pointers.length>=2)continue;if(!n.interacting()&&t===n.pointerType)return n}return null}};function zb(t,e){return t.pointers.some(({id:n})=>n===e)}const MS=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function mV(t){const e={};for(const s of MS)e[s]=IS(s,t);const n=Xt.pEventTypes;let r;Ut.PointerEvent?r=[{type:n.down,listener:i},{type:n.down,listener:e.pointerDown},{type:n.move,listener:e.pointerMove},{type:n.up,listener:e.pointerUp},{type:n.cancel,listener:e.pointerUp}]:r=[{type:"mousedown",listener:e.pointerDown},{type:"mousemove",listener:e.pointerMove},{type:"mouseup",listener:e.pointerUp},{type:"touchstart",listener:i},{type:"touchstart",listener:e.pointerDown},{type:"touchmove",listener:e.pointerMove},{type:"touchend",listener:e.pointerUp},{type:"touchcancel",listener:e.pointerUp}],r.push({type:"blur",listener(s){for(const o of t.interactions.list)o.documentBlur(s)}}),t.prevTouchTime=0,t.Interaction=class extends cV{get pointerMoveTolerance(){return t.interactions.pointerMoveTolerance}set pointerMoveTolerance(s){t.interactions.pointerMoveTolerance=s}_now(){return t.now()}},t.interactions={list:[],new(s){s.scopeFire=(a,l)=>t.fire(a,l);const o=new t.Interaction(s);return t.interactions.list.push(o),o},listeners:e,docEvents:r,pointerMoveTolerance:1};function i(){for(const s of t.interactions.list)if(!(!s.pointerIsDown||s.pointerType!=="touch"||s._interacting))for(const o of s.pointers)t.documents.some(({doc:a})=>Xs(a,o.downTarget))||s.removePointer(o.pointer,o.event)}t.usePlugin(pV)}function IS(t,e){return function(n){const r=e.interactions.list,i=eV(n),[s,o]=AS(n),a=[];if(/^touch/.test(n.type)){e.prevTouchTime=e.now();for(const l of n.changedTouches){const c=l,u=ed(c),d={pointer:c,pointerId:u,pointerType:i,eventType:n.type,eventTarget:s,curEventTarget:o,scope:e},f=Wb(d);a.push([d.pointer,d.eventTarget,d.curEventTarget,f])}}else{let l=!1;if(!Xt.supportsPointerEvent&&/mouse/.test(n.type)){for(let c=0;c<r.length&&!l;c++)l=r[c].pointerType!=="mouse"&&r[c].pointerIsDown;l=l||e.now()-e.prevTouchTime<500||n.timeStamp===0}if(!l){const c={pointer:n,pointerId:ed(n),pointerType:i,eventType:n.type,curEventTarget:o,eventTarget:s,scope:e},u=Wb(c);a.push([c.pointer,c.eventTarget,c.curEventTarget,u])}}for(const[l,c,u,d]of a)d[t](l,n,c,u)}}function Wb(t){const{pointerType:e,scope:n}=t,i={interaction:yp.search(t),searchDetails:t};return n.fire("interactions:find",i),i.interaction||n.interactions.new({pointerType:e})}function Gf({doc:t,scope:e,options:n},r){const{interactions:{docEvents:i},events:s}=e,o=s[r];e.browser.isIOS&&!n.events&&(n.events={passive:!1});for(const l in s.delegatedEvents)o(t,l,s.delegateListener),o(t,l,s.delegateUseCapture,!0);const a=n&&n.events;for(const{type:l,listener:c}of i)o(t,l,c,a)}
146const gV={id:"core/interactions",install:mV,listeners:{"scope:add-document":t=>Gf(t,"add"),"scope:remove-document":t=>Gf(t,"remove"),"interactable:unset":({interactable:t},e)=>{for(let n=e.interactions.list.length-1;n>=0;n--){const r=e.interactions.list[n];r.interactable===t&&(r.stop(),e.fire("interactions:destroy",{interaction:r}),r.destroy(),e.interactions.list.length>2&&e.interactions.list.splice(n,1))}}},onDocSignal:Gf,doOnInteractions:IS,methodNames:MS};class vV{constructor(){te(this,"id",`__interact_scope_${Math.floor(Math.random()*100)}`);te(this,"isInitialized",!1);te(this,"listenerMaps",[]);te(this,"browser",Xt);te(this,"defaults",aa(TS));te(this,"Eventable",kS);te(this,"actions",{map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}});te(this,"interactStatic",tV(this));te(this,"InteractEvent",Sg);te(this,"Interactable");te(this,"interactables",new rV(this));te(this,"_win");te(this,"document");te(this,"window");te(this,"documents",[]);te(this,"_plugins",{list:[],map:{}});te(this,"onWindowUnload",e=>this.removeDocument(e.target));const e=this;this.Interactable=class extends nV{get _defaults(){return e.defaults}set(n){return super.set(n),e.fire("interactable:set",{options:n,interactable:this}),this}unset(){super.unset();const n=e.interactables.list.indexOf(this);n<0||(super.unset(),e.interactables.list.splice(n,1),e.fire("interactable:unset",{interactable:this}))}}}addListeners(e,n){this.listenerMaps.push({id:n,map:e})}fire(e,n){for(const{map:{[e]:r}}of this.listenerMaps)if(r&&r(n,this,e)===!1)return!1}init(e){return this.isInitialized?this:yV(this,e)}pluginIsInstalled(e){return this._plugins.map[e.id]||this._plugins.list.indexOf(e)!==-1}usePlugin(e,n){if(!this.isInitialized)return this;if(this.pluginIsInstalled(e))return this;if(e.id&&(this._plugins.map[e.id]=e),this._plugins.list.push(e),e.install&&e.install(this,n),e.listeners&&e.before){let r=0;const i=this.listenerMaps.length,s=e.before.reduce((o,a)=>(o[a]=!0,o[Kb(a)]=!0,o),{});for(;r<i;r++){const o=this.listenerMaps[r].id;if(s[o]||s[Kb(o)])break}this.listenerMaps.splice(r,0,{id:e.id,map:e.listeners})}else e.listeners&&this.listenerMaps.push({id:e.id,map:e.listeners});return this}addDocument(e,n){if(this.getDocIndex(e)!==-1)return!1;const r=oa(e);n=n?st({},n):{},this.documents.push({doc:e,options:n}),this.events.documents.push(e),e!==this.document&&this.events.add(r,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:e,window:r,scope:this,options:n})}removeDocument(e){const n=this.getDocIndex(e),r=oa(e),i=this.documents[n].options;this.events.remove(r,"unload",this.onWindowUnload),this.documents.splice(n,1),this.events.documents.splice(n,1),this.fire("scope:remove-document",{doc:e,window:r,scope:this,options:i})}getDocIndex(e){for(let n=0;n<this.documents.length;n++)if(this.documents[n].doc===e)return n;return-1}getDocOptions(e){const n=this.getDocIndex(e);return n===-1?null:this.documents[n].options}now(){return(this.window.Date||Date).now()}}function yV(t,e){return t.isInitialized=!0,ye.window(e)&&gS(e),Ut.init(e),Xt.init(e),H6.init(e),t.window=e,t.document=e.document,t.usePlugin(gV),t.usePlugin(oV),t}function Kb(t){return t&&t.replace(/\/.*$/,"")}const LS=new vV,js=LS.interactStatic,bV=typeof globalThis<"u"?globalThis:typeof window<"u"?window:void 0;LS.init(bV);function kV(t){const{Interactable:e}=t;e.prototype.getAction=function(r,i,s,o){const a=wV(this,i,s,o,t);return this.options.actionChecker?this.options.actionChecker(r,i,a,this,o,s):a},e.prototype.ignoreFrom=Dl(function(n){return this._backCompatOption("ignoreFrom",n)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),e.prototype.allowFrom=Dl(function(n){return this._backCompatOption("allowFrom",n)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),e.prototype.actionChecker=SV,e.prototype.styleCursor=xV}function wV(t,e,n,r,i){const s=t.getRect(r),o=e.buttons||{0:1,1:4,3:8,4:16}[e.button],a={action:null,interactable:t,interaction:n,element:r,rect:s,buttons:o};return i.fire("auto-start:check",a),a.action}function xV(t){return ye.bool(t)?(this.options.styleCursor=t,this):t===null?(delete this.options.styleCursor,this):this.options.styleCursor}function SV(t){return ye.func(t)?(this.options.actionChecker=t,this):t===null?(delete this.options.actionChecker,this):this.options.actionChecker}const TV={id:"auto-start/interactableMethods",install:kV};function _V(t){const{interactStatic:e,defaults:n}=t;t.usePlugin(TV),n.base.actionChecker=null,n.base.styleCursor=!0,st(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),e.maxInteractions=r=>DS(r,t),t.autoStart={maxInteractions:1/0,withinInteractionLimit:Wd,cursorElement:null}}function EV({interaction:t,pointer:e,event:n,eventTarget:r}
146,i){if(t.interacting())return;const s=RS(t,e,n,r,i);$S(t,s,i)}function CV({interaction:t,pointer:e,event:n,eventTarget:r},i){if(t.pointerType!=="mouse"||t.pointerIsDown||t.interacting())return;const s=RS(t,e,n,r,i);$S(t,s,i)}function OV(t,e){const{interaction:n}=t;if(!n.pointerIsDown||n.interacting()||!n.pointerWasMoved||!n.prepared.name)return;e.fire("autoStart:before-start",t);const{interactable:r}=n,i=n.prepared.name;i&&r&&(r.options[i].manualStart||!Wd(r,n.element,n.prepared,e)?n.stop():(n.start(n.prepared,r,n.element),NS(n,e)))}function AV({interaction:t},e){const{interactable:n}=t;n&&n.options.styleCursor&&bp(t.element,"",e)}function PS(t,e,n,r,i){return e.testIgnoreAllow(e.options[t.name],n,r)&&e.options[t.name].enabled&&Wd(e,n,t,i)?t:null}function MV(t,e,n,r,i,s,o){for(let a=0,l=r.length;a<l;a++){const c=r[a],u=i[a],d=c.getAction(e,n,t,u);if(!d)continue;const f=PS(d,c,u,s,o);if(f)return{action:f,interactable:c,element:u}}return{action:null,interactable:null,element:null}}function RS(t,e,n,r,i){let s=[],o=[],a=r;function l(c){s.push(c),o.push(a)}for(;ye.element(a);){s=[],o=[],i.interactables.forEachMatch(a,l);const c=MV(t,e,n,s,o,r,i);if(c.action&&!c.interactable.options[c.action.name].manualStart)return c;a=ho(a)}return{action:null,interactable:null,element:null}}function $S(t,{action:e,interactable:n,element:r},i){e=e||{name:null},t.interactable=n,t.element=r,_S(t.prepared,e),t.rect=n&&e.name?n.getRect(r):null,NS(t,i),i.fire("autoStart:prepared",{interaction:t})}function Wd(t,e,n,r){const i=t.options,s=i[n.name].max,o=i[n.name].maxPerElement,a=r.autoStart.maxInteractions;let l=0,c=0,u=0;if(!(s&&o&&a))return!1;for(const d of r.interactions.list){const f=d.prepared.name;if(d.interacting()){if(l++,l>=a)return!1;if(d.interactable===t&&(c+=f===n.name?1:0,c>=s||d.element===e&&(u++,f===n.name&&u>=o)))return!1}}return a>0}function DS(t,e){return ye.number(t)?(e.autoStart.maxInteractions=t,this):e.autoStart.maxInteractions}function bp(t,e,n){const{cursorElement:r}=n.autoStart;r&&r!==t&&(r.style.cursor=""),t.ownerDocument.documentElement.style.cursor=e,t.style.cursor=e,n.autoStart.cursorElement=e?t:null}function NS(t,e){const{interactable:n,element:r,prepared:i}=t;if(!(t.pointerType==="mouse"&&n&&n.options.styleCursor)){e.autoStart.cursorElement&&bp(e.autoStart.cursorElement,"",e);return}let s="";if(i.name){const o=n.options[i.name].cursorChecker;ye.func(o)?s=o(i,n,r,t._interacting):s=e.actions.map[i.name].getCursor(i)}bp(t.element,s||"",e)}const _g={id:"auto-start/base",before:["actions"],install:_V,listeners:{"interactions:down":EV,"interactions:move":(t,e)=>{CV(t,e),OV(t,e)},"interactions:stop":AV},maxInteractions:DS,withinInteractionLimit:Wd,validateAction:PS};function IV({interaction:t,eventTarget:e,dx:n,dy:r},i){if(t.prepared.name!=="drag")return;const s=Math.abs(n),o=Math.abs(r),a=t.interactable.options.drag,l=a.startAxis,c=s>o?"x":s<o?"y":"xy";if(t.prepared.axis=a.lockAxis==="start"?c[0]:a.lockAxis,c!=="xy"&&l!=="xy"&&l!==c){t.prepared.name=null;let u=e;const d=function(f){if(f===t.interactable)return;const p=t.interactable.options.drag;if(!p.manualStart&&f.testIgnoreAllow(p,u,e)){const h=f.getAction(t.downPointer,t.downEvent,t,u);if(h&&h.name==="drag"&&LV(c,f)&&_g.validateAction(h,f,u,e,i))return f}};for(;ye.element(u);){const f=i.interactables.forEachMatch(u,d);if(f){t.prepared.name="drag",t.interactable=f,t.element=u;break}u=ho(u)}}}function LV(t,e){if(!e)return!1;const n=e.options.drag.startAxis;return t==="xy"||n==="xy"||n===t}const PV={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":IV}};function RV(t){const{defaults:e}=t;t.usePlugin(_g),e.perAction.hold=0,e.perAction.delay=0}function Yf(t){const e=t.prepared&&t.prepared.name;if(!e)return null;const n=t.interactable.options;return n[e].hold||n[e].delay}const $V={id:"auto-start/hold",install:RV,listeners:{"interactions:new":({interaction:t})=>{t.autoStartHoldTimer=null},"autoStart:prepared":({interaction:t})=>{const e=Yf(t);e>0&&(t.autoStartHoldTimer=setTimeout(()=>{t.start(t.prepared,t.interactable,t.element)},e))},"interactions:move":({interaction:t,duplicate:e})=>{t.autoStartHoldTimer&&t.pointerWasMoved&&!e&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":({interaction:t})=>{Yf(t)>0&&(t.prepared.name=null)}},getHoldDuration:Yf},DV={id:"auto-start",install(t){t.usePlugin(_g),t.usePlugin($V),t.usePlugin(PV)}};js.use(DV);function NV(t){const{actions:e,browser:n,Interactable:r,defaults:i}=t;Si.cursors=HV(n),Si.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,r.prototype.resizable=function(s){return jV(this,s,t)},e.map.resize=Si,e.methodDict.resize="resizable",i.actions.resize=Si.defaults}function FV(t){const{interaction:e,interactable:n,element:r,rect:i,buttons:s}=t;if(!i)return;const o=st({},e.coords.cur.page),a=n.options.resize;if(!(!(a&&a.enabled)||e.pointerIsDown&&/mouse|pointer/.test(e.pointerType)&&!(s&a.mouseButtons))){if(ye.object(a.edges)
146){const l={left:!1,right:!1,top:!1,bottom:!1};for(const c in l)l[c]=BV(c,a.edges[c],o,e._latestPointer.eventTarget,r,i,a.margin||Si.defaultMargin);l.left=l.left&&!l.right,l.top=l.top&&!l.bottom,(l.left||l.right||l.top||l.bottom)&&(t.action={name:"resize",edges:l})}else{const l=a.axis!=="y"&&o.x>i.right-Si.defaultMargin,c=a.axis!=="x"&&o.y>i.bottom-Si.defaultMargin;(l||c)&&(t.action={name:"resize",axes:(l?"x":"")+(c?"y":"")})}return t.action?!1:void 0}}function jV(t,e,n){return ye.object(e)?(t.options.resize.enabled=e.enabled!==!1,t.setPerAction("resize",e),t.setOnEvents("resize",e),ye.string(e.axis)&&/^x$|^y$|^xy$/.test(e.axis)?t.options.resize.axis=e.axis:e.axis===null&&(t.options.resize.axis=n.defaults.actions.resize.axis),ye.bool(e.preserveAspectRatio)?t.options.resize.preserveAspectRatio=e.preserveAspectRatio:ye.bool(e.square)&&(t.options.resize.square=e.square),t):ye.bool(e)?(t.options.resize.enabled=e,t):t.options.resize}function BV(t,e,n,r,i,s,o){if(!e)return!1;if(e===!0){const a=ye.number(s.width)?s.width:s.right-s.left,l=ye.number(s.height)?s.height:s.bottom-s.top;if(o=Math.min(o,Math.abs((t==="left"||t==="right"?a:l)/2)),a<0&&(t==="left"?t="right":t==="right"&&(t="left")),l<0&&(t==="top"?t="bottom":t==="bottom"&&(t="top")),t==="left"){const c=a>=0?s.left:s.right;return n.x<c+o}if(t==="top"){const c=l>=0?s.top:s.bottom;return n.y<c+o}if(t==="right")return n.x>(a>=0?s.right:s.left)-o;if(t==="bottom")return n.y>(l>=0?s.bottom:s.top)-o}return ye.element(r)?ye.element(e)?e===r:pp(r,e,i):!1}function HV(t){return t.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}function UV({iEvent:t,interaction:e}){if(e.prepared.name!=="resize"||!e.prepared.edges)return;const n=t,r=e.rect;e._rects={start:st({},r),corrected:st({},r),previous:st({},r),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}}
146,n.edges=e.prepared.edges,n.rect=e._rects.corrected,n.deltaRect=e._rects.delta}function VV({iEvent:t,interaction:e}){if(e.prepared.name!=="resize"||!e.prepared.edges)return;const n=t,i=e.interactable.options.resize.invert,s=i==="reposition"||i==="negate",o=e.rect,{start:a,corrected:l,delta:c,previous:u}=e._rects;if(st(u,l),s){if(st(l,o),i==="reposition"){if(l.top>l.bottom){const d=l.top;l.top=l.bottom,l.bottom=d}if(l.left>l.right){const d=l.left;l.left=l.right,l.right=d}}}else l.top=Math.min(o.top,a.bottom),l.bottom=Math.max(o.bottom,a.top),l.left=Math.min(o.left,a.right),l.right=Math.max(o.right,a.left);l.width=l.right-l.left,l.height=l.bottom-l.top;for(const d in l)c[d]=l[d]-u[d];n.edges=e.prepared.edges,n.rect=l,n.deltaRect=c}function zV({iEvent:t,interaction:e}){if(e.prepared.name!=="resize"||!e.prepared.edges)return;const n=t;n.edges=e.prepared.edges,n.rect=e._rects.corrected,n.deltaRect=e._rects.delta}function qb({iEvent:t,interaction:e}){if(e.prepared.name!=="resize"||!e.resizeAxes)return;const n=e.interactable.options,r=t;n.resize.square?(e.resizeAxes==="y"?r.delta.x=r.delta.y:r.delta.y=r.delta.x,r.axes="xy"):(r.axes=e.resizeAxes,e.resizeAxes==="x"?r.delta.y=0:e.resizeAxes==="y"&&(r.delta.x=0))}const Si={id:"actions/resize",before:["actions/drag"],install:NV,listeners:{"interactions:new":({interaction:t})=>{t.resizeAxes="xy"},"interactions:action-start":t=>{UV(t),qb(t)},"interactions:action-move":t=>{VV(t),qb(t)},"interactions:action-end":zV,"auto-start:check":FV},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor({edges:t,axis:e,name:n}){const r=Si.cursors;let i=null;if(e)i=r[n+e];else if(t){let s="";for(const o of["top","bottom","left","right"])t[o]&&(s+=o);i=r[s]}return i},defaultMargin:null};js.use(Si);const WV=()=>{},KV=()=>{},qV=t=>{const e=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(([r,i])=>r in t||i in t),n=(r,i)=>{const{range:s,limits:o={left:-1/0,right:1/0,top:-1/0,bottom:1/0},offset:a={x:0,y:0}}=t,l={range:s,grid:t,x:null,y:null};for(const[c,u]of e){const d=Math.round((r-a.x)/t[c]),f=Math.round((i-a.y)/t[u]);l[c]=Math.max(o.left,Math.min(o.right,d*t[c]+a.x)),l[u]=Math.max(o.top,Math.min(o.bottom,f*t[u]+a.y))}return l};return n.grid=t,n.coordFields=e,n},GV=Object.freeze(Object.defineProperty({__proto__:null,edgeTarget:WV,elements:KV,grid:qV},Symbol.toStringTag,{value:"Module"})),YV={id:"snappers",install(t){const{interactStatic:e}=t;e.snappers=st(e.snappers||{},GV),e.createSnapGrid=e.snappers.grid}};class FS{constructor(e){te(this,"states",[]);te(this,"startOffset",{left:0,right:0,top:0,bottom:0});te(this,"startDelta");te(this,"result");te(this,"endResult");te(this,"edges");te(this,"interaction");this.interaction=e,this.result=Lc()}start({phase:e},n){const{interaction:r}=this,i=XV(r);this.prepareStates(i),this.edges=st({},r.edges),this.startOffset=JV(r.rect,n),this.startDelta={x:0,y:0};const s=this.fillArg({phase:e,pageCoords:n,preEnd:!1});return this.result=Lc(),this.startAll(s),this.result=this.setAll(s)}fillArg(e){const{interaction:n}=this;return e.interaction=n,e.interactable=n.interactable,e.element=n.element,e.rect=e.rect||n.rect,e.edges=this.edges,e.startOffset=this.startOffset,e}startAll(e){for(const n of this.states)n.methods.start&&(e.state=n,n.methods.start(e))}setAll(e){const{phase:n,preEnd:r,skipModifiers:i,rect:s}=e;e.coords=st({},e.pageCoords),e.rect=st({},s);const o=i?this.states.slice(i):this.states,a=Lc(e.coords,e.rect);for(const d of o){var l;const{options:f}=d,p=st({},e.coords);let h=null;(l=d.methods)!=null&&l.set&&this.shouldDo(f,r,n)&&(e.state=d,h=d.methods.set(e),wg(this.interaction.edges,e.rect,{x:e.coords.x-p.x,y:e.coords.y-p.y})),a.eventProps.push(h)}a.delta.x=e.coords.x-e.pageCoords.x,a.delta.y=e.coords.y-e.pageCoords.y,a.rectDelta.left=e.rect.left-s.left,a.rectDelta.right=e.rect.right-s.right,a.rectDelta.top=e.rect.top-s.top,a.rectDelta.bottom=e.rect.bottom-s.bottom;const c=this.result.coords,u=this.result.rect;if(c&&u){const d=a.rect.left!==u.left||a.rect.right!==u.right||a.rect.top!==u.top||a.rect.bottom!==u.bottom;a.changed=d||c.x!==a.coords.x||c.y!==a.coords.y}return a}
146applyToInteraction(e){const{interaction:n}=this,{phase:r}=e,i=n.coords.cur,s=n.coords.start,{result:o,startDelta:a}=this,l=o.delta;r==="start"&&st(this.startDelta,o.delta);for(const[d,f]of[[s,a],[i,l]])d.page.x+=f.x,d.page.y+=f.y,d.client.x+=f.x,d.client.y+=f.y;const{rectDelta:c}=this.result,u=e.rect||n.rect;u.left+=c.left,u.right+=c.right,u.top+=c.top,u.bottom+=c.bottom,u.width=u.right-u.left,u.height=u.bottom-u.top}setAndApply(e){const{interaction:n}=this,{phase:r,preEnd:i,skipModifiers:s}=e,o=this.setAll(this.fillArg({preEnd:i,phase:r,pageCoords:e.modifiedCoords||n.coords.cur.page}));if(this.result=o,!o.changed&&(!s||s<this.states.length)&&n.interacting())return!1;if(e.modifiedCoords){const{page:a}=n.coords.cur,l={x:e.modifiedCoords.x-a.x,y:e.modifiedCoords.y-a.y};o.coords.x+=l.x,o.coords.y+=l.y,o.delta.x+=l.x,o.delta.y+=l.y}this.applyToInteraction(e)}beforeEnd(e){const{interaction:n,event:r}=e,i=this.states;if(!i||!i.length)return;let s=!1;for(const o of i){e.state=o;const{options:a,methods:l}=o,c=l.beforeEnd&&l.beforeEnd(e);if(c)return this.endResult=c,!1;s=s||!s&&this.shouldDo(a,!0,e.phase,!0)}s&&n.move({event:r,preEnd:!0})}stop(e){const{interaction:n}=e;if(!this.states||!this.states.length)return;const r=st({states:this.states,interactable:n.interactable,element:n.element,rect:null},e);this.fillArg(r);for(const i of this.states)r.state=i,i.methods.stop&&i.methods.stop(r);this.states=null,this.endResult=null}prepareStates(e){this.states=[];for(let n=0;n<e.length;n++){const{options:r,methods:i,name:s}=e[n];this.states.push({options:r,methods:i,index:n,name:s})}return this.states}restoreInteractionCoords({interaction:{coords:e,rect:n,modification:r}}){if(!r.result)return;const{startDelta:i}=r,{delta:s,rectDelta:o}=r.result,a=[[e.start,i],[e.cur,s]];for(const[l,c]of a)l.page.x-=c.x,l.page.y-=c.y,l.client.x-=c.x,l.client.y-=c.y;n.left-=o.left,n.right-=o.right,n.top-=o.top,n.bottom-=o.bottom}shouldDo(e,n,r,i){return!(!e||e.enabled===!1||i&&!e.endOnly||e.endOnly&&!n||r==="start"&&!e.setStart)}copyFrom(e){this.startOffset=e.startOffset,this.startDelta=e.startDelta,this.edges=e.edges,this.states=e.states.map(n=>aa(n)),this.result=Lc(st({},e.result.coords),st({},e.result.rect))}destroy(){for(const e in this)this[e]=null}}function Lc(t,e){return{rect:e,coords:t,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function XV(t){const e=t.interactable.options[t.prepared.name],n=e.modifiers;return n&&n.length?n:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(r=>{const i=e[r];return i&&i.enabled&&{options:i,methods:i._methods}}).filter(r=>!!r)}function JV(t,e){return t?{left:e.x-t.left,top:e.y-t.top,right:t.right-e.x,bottom:t.bottom-e.y}:{left:0,top:0,right:0,bottom:0}}function vs(t,e){const{defaults:n}=t,r={start:t.start,set:t.set,beforeEnd:t.beforeEnd,stop:t.stop},i=s=>{const o=s||{};o.enabled=o.enabled!==!1;for(const l in n)l in o||(o[l]=n[l]);const a={options:o,methods:r,name:e,enable:()=>(o.enabled=!0,a),disable:()=>(o.enabled=!1,a)};return a};return e&&typeof e=="string"&&(i._defaults=n,i._methods=r),i}function Xf({iEvent:t,interaction:e}){const n=e.modification.result;n&&(t.modifiers=n.eventProps)}const QV={id:"modifiers/base",before:["actions"],install:t=>{t.defaults.perAction.modifiers=[]},listeners:{"interactions:new":({interaction:t})=>{t.modification=new FS(t)},"interactions:before-action-start":t=>{const e=t.interaction.modification;e.start(t,t.interaction.coords.start.page),t.interaction.edges=e.edges,e.applyToInteraction(t)},"interactions:before-action-move":t=>t.interaction.modification.setAndApply(t),"interactions:before-action-end":t=>t.interaction.modification.beforeEnd(t),"interactions:action-start":Xf,"interactions:action-move":Xf,"interactions:action-end":Xf,"interactions:after-action-start":t=>t.interaction.modification.restoreInteractionCoords(t),"interactions:after-action-move":t=>t.interaction.modification.restoreInteractionCoords(t),"interactions:stop":t=>t.interaction.modification.stop(t)}},ZV={start(t){const{state:e,rect:n,edges:r,pageCoords:i}=t;let{ratio:s}=e.options;const{equalDelta:o,modifiers:a}=e.options;s==="preserve"&&(s=n.width/n.height),e.startCoords=st({},i),e.startRect=st({},n),e.ratio=s,e.equalDelta=o;const l=e.linkedEdges={top:r.top||r.left&&!r.bottom,left:r.left||r.top&&!r.right,bottom:r.bottom||r.right&&!r.top,right:r.right||r.bottom&&!r.left};if(e.xIsPrimaryAxis=!!(r.left||r.right),e.equalDelta){const u=(l.left?1:-1)*(l.top?1:-1);e.edgeSign={x:u,y:u}}else e.edgeSign={x:l.left?-1:1,y:l.top?-1:1};if(st(t.edges,l),!a||!a.length)return;const c=new FS(t.interaction);c.copyFrom(t.interaction.modification),c.prepareStates(a),e.subModification=c,c.startAll({...t})},set(t){const{state:e,rect:n,coords:r}=t,i=st({},r),s=e.equalDelta?ez:tz;if(s(e,e.xIsPrimaryAxis,r,n),!e.subModification)return null;const o=st({},n);wg(e.linkedEdges,o,{x:r.x-i.x,y:r.y-i.y});const a=e.subModification.setAll({...t,rect:o,edges:e.linkedEdges,pageCoords:r,prevCoords:r,prevRect:o}),{delta:l}=a;if(a.changed){const c=Math.abs(l.x)>
146Math.abs(l.y);s(e,c,a.coords,a.rect),st(r,a.coords)}return a.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function ez({startCoords:t,edgeSign:e},n,r){n?r.y=t.y+(r.x-t.x)*e.y:r.x=t.x+(r.y-t.y)*e.x}function tz({startRect:t,startCoords:e,ratio:n,edgeSign:r},i,s,o){if(i){const a=o.width/n;s.y=e.y+(a-t.height)*r.y}else{const a=o.height*n;s.x=e.x+(a-t.width)*r.x}}const nz=vs(ZV,"aspectRatio"),Ba=()=>{};Ba._defaults={};function rz({rect:t,startOffset:e,state:n,interaction:r,pageCoords:i}){const{options:s}=n,{elementRect:o}=s,a=st({left:0,top:0,right:0,bottom:0},s.offset||{});if(t&&o){const l=oo(s.restriction,r,i);if(l){const c=l.right-l.left-t.width,u=l.bottom-l.top-t.height;c<0&&(a.left+=c,a.right+=c),u<0&&(a.top+=u,a.bottom+=u)}a.left+=e.left-t.width*o.left,a.top+=e.top-t.height*o.top,a.right+=e.right-t.width*(1-o.right),a.bottom+=e.bottom-t.height*(1-o.bottom)}n.offset=a}function iz({coords:t,interaction:e,state:n}){const{options:r,offset:i}=n,s=oo(r.restriction,e,t);if(!s)return;const o=z6(s);t.x=Math.max(Math.min(o.right-i.right,t.x),o.left+i.left),t.y=Math.max(Math.min(o.bottom-i.bottom,t.y),o.top+i.top)}function oo(t,e,n){return ye.func(t)?$l(t,e.interactable,e.element,[n.x,n.y,e]):$l(t,e.interactable,e.element)}const sz={restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1},td={start:rz,set:iz,defaults:sz},oz=vs(td,"restrict"),jS={top:1/0,left:1/0,bottom:-1/0,right:-1/0},BS={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function az({interaction:t,startOffset:e,state:n}){const{options:r}=n;let i;if(r){const s=oo(r.offset,t,t.coords.start.page);i=Vd(s)}i=i||{x:0,y:0},n.offset={top:i.y+e.top,left:i.x+e.left,bottom:i.y-e.bottom,right:i.x-e.right}}function lz({coords:t,edges:e,interaction:n,state:r}){const{offset:i,options:s}=r;if(!e)return;const o=st({},t),a=oo(s.inner,n,o)||{},l=oo(s.outer,n,o)||{};Gb(a,jS),Gb(l,BS),e.top?t.y=Math.min(Math.max(l.top+i.top,o.y),a.top+i.top):e.bottom&&(t.y=Math.max(Math.min(l.bottom+i.bottom,o.y),a.bottom+i.bottom)),e.left?t.x=Math.min(Math.max(l.left+i.left,o.x),a.left+i.left):e.right&&(t.x=Math.max(Math.min(l.right+i.right,o.x),a.right+i.right))}function Gb(t,e){for(const n of["top","left","bottom","right"])n in t||(t[n]=e[n]);return t}const cz={inner:null,outer:null,offset:null,endOnly:!1,enabled:!1},cl={noInner:jS,noOuter:BS,start:az,set:lz,defaults:cz},uz=vs(cl,"restrictEdges"),dz=st({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(t){}},td.defaults),fz={start:td.start,set:td.set,defaults:dz},hz=vs(fz,"restrictRect"),pz={width:-1/0,height:-1/0},mz={width:1/0,height:1/0};function gz(t){return cl.start(t)}function vz(t){const{interaction:e,state:n,rect:r,edges:i}=t,{options:s}=n;if(!i)return;const o=Vb(oo(s.min,e,t.coords))||pz,a=Vb(oo(s.max,e,t.coords))||mz;n.options={endOnly:s.endOnly,inner:st({},cl.noInner),outer:st({},cl.noOuter)},i.top?(n.options.inner.top=r.bottom-o.height,n.options.outer.top=r.bottom-a.height):i.bottom&&(n.options.inner.bottom=r.top+o.height,n.options.outer.bottom=r.top+a.height),i.left?(n.options.inner.left=r.right-o.width,n.options.outer.left=r.right-a.width):i.right&&(n.options.inner.right=r.left+o.width,n.options.outer.right=r.left+a.width),cl.set(t),n.options=s}const yz={min:null,max:null,endOnly:!1,enabled:!1},bz={start:gz,set:vz,defaults:yz},kz=vs(bz,"restrictSize");function wz(t){const{interaction:e,interactable:n,element:r,rect:i,state:s,startOffset:o}=t,{options:a}=s,l=a.offsetWithOrigin?Sz(t):{x:0,y:0};let c;if(a.offset==="startCoords")c={x:e.coords.start.page.x,y:e.coords.start.page.y};else{const d=$l(a.offset,n,r,[e]);c=Vd(d)||{x:0,y:0},c.x+=l.x,c.y+=l.y}const{relativePoints:u}=a;s.offsets=i&&u&&u.length?u.map((d,f)=>({index:f,relativePoint:d,x:o.left-i.width*d.x+c.x,y:o.top-i.height*d.y+c.y})):[{index:0,relativePoint:null,x:c.x,y:c.y}]}function xz(t){const{interaction:e,coords:n,state:r}=t,{options:i,offsets:s}=r,o=xg(e.interactable,e.element,e.prepared.name),a=st({},n),l=[];i.offsetWithOrigin||(a.x-=o.x,a.y-=o.y);for(const u of s){const d=a.x-u.x,f=a.y-u.y;for(let p=0,h=i.targets.length;p<h;p++){const g=i.targets[p];let m;ye.func(g)?m=g(d,f,e._proxy,u,p):m=g,m&&l.push({x:(ye.number(m.x)?m.x:d)+u.x,y:(ye.number(m.y)?m.y:f)+u.y,range:ye.number(m.range)?m.range:i.range,source:g,index:
146p,offset:u})}}const c={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}};for(const u of l){const d=u.range,f=u.x-a.x,p=u.y-a.y,h=zd(f,p);let g=h<=d;d===1/0&&c.inRange&&c.range!==1/0&&(g=!1),(!c.target||(g?c.inRange&&d!==1/0?h/d<c.distance/c.range:d===1/0&&c.range!==1/0||h<c.distance:!c.inRange&&h<c.distance))&&(c.target=u,c.distance=h,c.range=d,c.inRange=g,c.delta.x=f,c.delta.y=p)}return c.inRange&&(n.x=c.target.x,n.y=c.target.y),r.closest=c,c}function Sz(t){const{element:e}=t.interaction;return Vd($l(t.state.options.origin,null,null,[e]))||xg(t.interactable,e,t.interaction.prepared.name)}const Tz={range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1},Eg={start:wz,set:xz,defaults:Tz},_z=vs(Eg,"snap");function Ez(t){const{state:e,edges:n}=t,{options:r}=e;if(!n)return null;t.state={options:{targets:null,relativePoints:[{x:n.left?0:1,y:n.top?0:1}],offset:r.offset||"self",origin:{x:0,y:0},range:r.range}},e.targetFields=e.targetFields||[["width","height"],["x","y"]],Eg.start(t),e.offsets=t.state.offsets,t.state=e}function Cz(t){const{interaction:e,state:n,coords:r}=t,{options:i,offsets:s}=n,o={x:r.x-s[0].x,y:r.y-s[0].y};n.options=st({},i),n.options.targets=[];for(const l of i.targets||[]){let c;if(ye.func(l)?c=l(o.x,o.y,e):c=l,!!c){for(const[u,d]of n.targetFields)if(u in c||d in c){c.x=c[u],c.y=c[d];break}n.options.targets.push(c)}}const a=Eg.set(t);return n.options=i,a}const Oz={range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1},nd={start:Ez,set:Cz,defaults:Oz},Az=vs(nd,"snapSize");function Mz(t){const{edges:e}=t;return e?(t.state.targetFields=t.state.targetFields||[[e.left?"left"
146:"right",e.top?"top":"bottom"]],nd.start(t)):null}const Iz={start:Mz,set:nd.set,defaults:st(aa(nd.defaults),{targets:null,range:null,offset:{x:0,y:0}})},Lz=vs(Iz,"snapEdges"),Jf={aspectRatio:nz,restrictEdges:uz,restrict:oz,restrictRect:hz,restrictSize:kz,snapEdges:Lz,snap:_z,snapSize:Az,spring:Ba,avoid:Ba,transform:Ba,rubberband:Ba},Pz={id:"modifiers",install(t){const{interactStatic:e}=t;t.usePlugin(QV),t.usePlugin(YV),e.modifiers=Jf;for(const n in Jf){const{_defaults:r,_methods:i}=Jf[n];r._methods=i,t.defaults.perAction[n]=r}}};js.use(Pz);let HS=null;const Rz=t=>{js(".spm-resizable").on(["resizestart","hold","down"],function(e){document.addEventListener("dragstart",function(n){n.preventDefault()}),e.target.setAttribute("draggable",!1)}).resizable({edges:{top:!1,left:!1,bottom:!1,right:!0},invert:"reposition",inertia:!1,modifiers:[js.modifiers.aspectRatio({ratio:"preserve"}),js.modifiers.snapSize({targets:[{width:1},js.snappers.grid({width:1,height:1})]})]}).on(["resizestart","resizemove","resizeend"],$z)};function $z(t){const e={x:0,y:0};t.type=="resizestart"&&t.target.setAttribute("draggable",!1);const{width:n,height:r}=t.rect;if(t.type=="resizemove"){if(Math.round(n)>=768)return;e.x+=t.deltaRect.left,e.y+=t.deltaRect.top,t.target.style.height=`${Math.round(r)}px`,t.target.style.width=`${Math.round(n)}px`}t.type=="resizeend"&&(t.target.setAttribute("draggable",!0),HS.chain().focus().updateAttributes("image",{width:`${Math.round(n)}px`,height:`${Math.round(r)}px`}).run())}const Dz=O6.extend({draggable:!1,isolating:!0,onCreate({editor:t}){HS=t,Rz()},addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),id:{parseHTML:e=>e.id},class:{default:"spm-resizable",parseHTML:e=>e.class},background:{renderHTML:e=>{if(e.background)return{style:`background: ${e.background} no-repeat center center; background-size: contain;`}}},width:{parseHTML:e=>e.getAttribute("data-width"),renderHTML:e=>({"data-width":e.width,width:e.width})},height:{parseHTML:e=>e.getAttribute("data-height"),renderHTML:e=>({"data-height":e.height})}}},addProseMirrorPlugins(){const t=this.options.uploader;return[new an({props:{handleDOMEvents:{paste(e,n){const r=(n.clipboardData||n.originalEvent.clipboardData).items;t&&Array.from(r).forEach(async i=>{const s=i.getAsFile();if(!s)return;n.preventDefault();let o={from:e.state.selection.from,to:e.state.selection.to};await t(s,o)})}}}})]}}),Nz={components:{NodeViewWrapper:UH},props:VH,data(){return{vHtml:this.node.attrs.html,htmlInput:!this.node.attrs.html}},methods:{toggleHtml(){this.editor.options.editable&&(this.htmlInput=!this.htmlInput)},updateContent(){this.updateAttributes({html:this.vHtml}),console.log(this.node.textContent)},removeCustomHtml(t){t==""&&this.deleteNode({})}}},Fz=["innerHTML"],jz={class:"url"};function Bz(t,e,n,r,i,s){const o=z("node-view-wrapper");return S(),re(o,{class:K(["custom-html-component relative group",t.editor.options.editable?"is-editable":"not-editable"])},{default:Y(()=>[x("div",{ref:"customhtml",class:"custom-html",onClick:e[0]||(e[0]=a=>s.toggleHtml()),innerHTML:i.vHtml},null,8,Fz),Ye(x("div",jz,[e[7]||(e[7]=x("div",{class:"mt-3"},null,-1)),Ye(x("textarea",{"onUpdate:modelValue":e[1]||(e[1]=a=>i.vHtml=a),tabindex:"0",class:"w-full fvl-textarea spm-editor-custom-html-input leading-relaxed font-mono !bg-gray-950 text-white !border-0 !m-0 !p-5 !text-[1rem]",placeholder:"Paste your HTML",type:"text",rows:"20",onChange:e[2]||(e[2]=a=>s.updateContent(a.target.value)),onPaste:e[3]||(e[3]=ct(()=>{},["stop"])),onKeydown:e[4]||(e[4]=Lt(a=>s.removeCustomHtml(a.target.value),["delete"]))},null,544),[[ls,i.vHtml,void 0,{lazy:!0,trim:!0}]]),i.vHtml?(S(),C("button",{key:0,type:"button",title:"Hide Raw HTML",class:"absolute right-0 top-0 p-2 text-gray-500 hover:text-gray-650",onClick:e[5]||(e[5]=a=>s.toggleHtml())},[...e[6]||(e[6]=[x("svg",{class:"icon flex h-5 text-gray-600 stroke-icon",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"},[x("polyline",{points:"18 15 12 9 6 15"})],-1)])])):P("",!0)],512),[[wt,i.htmlInput]])],void 0,!0),_:1},8,["class"])}const Hz=Ae(Nz,[["render",Bz]]),Uz=Yn.create({name:"custom-html",group:"block",atom:!0,addAttributes(){return{html:{default:"",parseHTML:t=>t==null?void 0:t.getAttribute("html")}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("custom-html")}]},renderHTML({HTMLAttributes:t}){return["div",jt(t,{class:"custom-html"})]},addNodeView(){return WH(Hz)},addCommands(){return{addCustomHtml:t=>({tr:e,dispatch:n})=>{const{selection:r}=e,i=this.type.create(t);return n&&e.replaceRangeWith(r.from,r.to,i),!0}}}}),Vz={emits:["click","toggle"],props:{dataTest:{type:String,default:null},triggerDropdown:{type:Boolean,default:!1},text:{type:String,default:""},icon:{type:String,default:""},iconClass:{type:String,default:"stroke-icon h-4"},info:{type:String,default:""},keyBindingInfo:{type:String,default:null},disabled:{type:Boolean,default:!1},showTooltipWhenDisabled:{type:Boolean,default:!1}},data(){return{slot:!1}},computed:{tippyInfo(){return this.keyBindingInfo?this.info+` <span class="spm-hotkey bg-gray-800 text-[.7rem] bg-opacity-75 ml-2 -mr-1 px-1 rounded">${this.keyBindingInfo}</span>`:this.info}},mounted(){(this.info||this.keyBindingInfo)&&this.$tippy(this.$refs.button,{allowHTML:!0})},methods:{onClick(t){this.disabled||(this.$emit("click",t),this.toggleSlot())},showSlot(){this.slot=!0},hideSlot(){this.slot=!1},toggleSlot(t){this.$emit("toggle"),this.triggerDropdown&&(this.slot=!this.slot)}}},zz={class:"spm-editor-button"},Wz=["data-tippy-content","aria-haspopup","disabled","aria-disabled","innerHTML"];function Kz(t,e,n,r,i,s){const o=ha("click-outside");return Ye((S(),C("div",zz,[x("button",{ref:"button",type:"button","data-tippy-content":s.tippyInfo,"aria-haspopup":i.slot?"true":null,class:K([[i.slot?"text-primary-500":"",{"opacity-25":n.disabled},{"w-auto px-2":n.text}
146],"spm-editor-toolbar-item has-tooltip"]),"data-tippy-placement":"bottom",tabindex:"-1",disabled:n.disabled&&!n.showTooltipWhenDisabled,"aria-disabled":n.disabled&&n.showTooltipWhenDisabled?"true":null,onClick:e[0]||(e[0]=(...a)=>s.onClick&&s.onClick(...a)),innerHTML:n.icon?t.svg("feather-"+n.icon,n.iconClass):`<span class='mx-auto font-medium'>${n.text}</span>`},null,10,Wz),x("div",null,[i.slot?Tt(t.$slots,"default",{},void 0,void 0,0):P("",!0)])])),[[o,s.hideSlot]])}const US=Ae(Vz,[["render",Kz]]),qz={props:{elementtype:{type:String,required:!0}}};function Gz(t,e,n,r,i,s){return S(),re(kr(n.elementtype),null,{default:Y(()=>[Tt(t.$slots,"default")],void 0,!0),_:3})}const Yz=Ae(qz,[["render",Gz]]),Xz={components:{SpmTag:Yz},emits:["close"],props:{editor:{type:Object,required:!0},styles:{type:Array,default:()=>[{level:1,tag:"h2",name:"heading"},{level:3,tag:"h3",name:"subheading"},{level:0,tag:"p",name:"normal"},{level:6,tag:"small",name:"small"}]}},methods:{setStyle(t){t==0?this.editor.chain().focus().clearNodes().run():this.editor.chain().focus().toggleHeading({level:t}).run(),this.$emit("close")}}},Jz=["aria-label"],Qz=["onClick"];function Zz(t,e,n,r,i,s){const o=z("spm-tag");return S(),C("ul",{role:"menu","aria-label":t.$t("editor.style"),class:"spm-editor-ul"},[(S(!0),C(Fe,null,nt(n.styles,a=>(S(),C("li",{key:a.tag,role:"menuitem",tabindex:"-1",class:K({"bg-gray-200":n.editor.isActive("heading",{level:a.level})}),onClick:l=>s.setStyle(a.level)},[X(o,{elementtype:a.tag},{default:Y(()=>[Me(L(t.$t("editor.styles."+a.name)),1)],void 0,!0),_:2},1032,["elementtype"])],10,Qz))),128))],8,Jz)}const eW=Ae(Xz,[["render",Zz]]),tW={emits:["close"],props:{editor:{type:Object,required:!0},isOpen:{type:Boolean,default:!1}},data(){return{colors:["rgb(29, 140, 224)","rgb(65, 184, 131)","rgb(255, 160, 0)","rgb(246, 0, 0)","rgb(240, 224, 47)","rgb(0, 220, 119)","rgb(230, 228, 28)","rgb(224, 38, 160)","rgb(0, 0, 0)","rgb(50, 64, 87)","rgb(132, 146, 166)","rgb(153, 169, 191)"],custom:this.editor.getAttributes("textStyle").color}},watch:{isOpen(t){t&&this.$nextTick(()=>{this.custom=this.editor.getAttributes("textStyle").color})}},methods:{setColor(t){t=="rgb(0, 0, 0)"?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().setColor(t).run(),this.$emit("close")},selectColor(){this.$refs.colorpicker.click()}}},nW={class:"spm-editor-fontcolor"},rW=["onClick"],iW=["innerHTML"],sW={class:"text-white text-xs font-bold",style:{"text-shadow":"0px 0 4px black"}},oW=["value"];function aW(t,e,n,r,i,s){return S(),C("div",nW,[(S(!0),C(Fe,null,nt(i.colors,o=>(S(),C("button",{key:o,type:"button",style:Ir({backgroundColor:o}),class:K([{"ring-2":n.editor.isActive("textStyle",{color:o})},"zoom"]),onClick:a=>s.setColor(o)},[n.editor.isActive("textStyle",{color:o})?(S(),C("span",{key:0,class:"text-white",innerHTML:t.svg("feather-check","stroke-icon h-4")},null,8,iW)):P("",!0)],14,rW))),128)),x("button",{type:"button",style:Ir([{backgroundColor:i.custom},{width:"100%"}]),class:K({"ring-2":n.editor.isActive("textStyle",{color:i.custom})}),onClick:e[0]||(e[0]=o=>s.selectColor(t.color))},[x("span",sW,L(t.$trans.get("Custom Color")),1)],6),x("input",{ref:"colorpicker",class:"opacity-0 h-1 w-1 mr-auto",type:"color",value:i.custom,onInput:e[1]||(e[1]=o=>(n.editor.chain().focus().setColor(o.target.value).run(),i.custom=o.target.value))},null,40,oW)])}const lW=Ae(tW,[["render",aW]]),cW={emits:["close"],props:{editor:{type:Object,required:!0},isOpen:{type:Boolean,default:!1}},data(){return{link:"",newWindow:!0}},watch:{isOpen(t){t&&(this.link=this.editor.getAttributes("link").href,this.newWindow=this.editor.getAttributes("link").target!="_self",this.$nextTick(()=>{this.focus()}))}},methods:{setLink(){this.editor.chain().focus().extendMarkRange("link").setLink({href:this.link,target:this.newWindow?"_blank":"_self"}).run(),this.link="",this.$emit("close")},resetLink(){this.editor.chain().focus().unsetLink().run(),this.link="",this.$emit("close")},focus(){this.$refs.addlink.focus(),this.$refs.addlink.select()}}},uW={class:"flex mb-2 items-center"},dW={for:"newwindow",class:"pl-1"};function fW(t,e,n,r,i,s){return S(),C("div",null,[Ye(x("input",{ref:"addlink","onUpdate:modelValue":e[0]||(e[0]=o=>i.link=o),class:"flex-1 w-full md:w-70 h-8 bg-gray-200 rounded-lg py-1 px-2 mb-2 text-sm",type:"text",placeholder:"Enter your link",onClick:e[1]||(e[1]=o=>s.focus()),onKeyup:e[2]||(e[2]=Lt((...o)=>s.setLink&&s.setLink(...o),["enter"]))},null,544),[[ls,i.link]]),x("div",uW,[Ye(x("input",{name:"newwindow","onUpdate:modelValue":e[3]||(e[3]=o=>i.newWindow=o),type:"checkbox"},null,512),[[AC,i.newWindow]]),x("label",dW,L(t.$t("editor.newWindow")),1)]),x("button",{type:"button",class:"bg-primary-500 hover:bg-primary-600 text-white text-sm font-bold py-2 px-3 rounded-lg",onClick:e[4]||(e[4]=(...o)=>s.setLink&&s.setLink(...o))},L(t.$t("editor.apply")),1),x("button",{type:"button",class:"ml-2 bg-red-500 hover:bg-red-600 text-white text-sm font-bold py-2 px-3 rounded-lg",onClick:e[5]||(e[5]=(...o)=>s.resetLink&&s.resetLink(...o))},L(t.$t("editor.reset")),1),x("button",{type:"button",class:"ml-auto text-gray-600 text-sm font-bold py-2 px-3 rounded-lg",onClick:e[6]||(e[6]=o=>t.$emit("close"))},L(t.$t("editor.cancel")),1)])}const hW=Ae(cW,[["render",fW]]),pW={components:{SpmLoader:xn},emits:["close"],props:{editor:{type:Object,required:!0},uploadUrl:{type:String,required:!0},allowSvg:{type:Boolean,default:!1}},data(){return{file:"",imageUrl:"",invalidUrl:!1,isLoading:!1}},computed:{accept(){let t="image/gif, image/jpeg, image/png, image/bmp";return this.allowSvg&&(t=t+", image/svg, image/svg+xml"),t},validUrl(){var t=/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(this.imageUrl)}},methods:{setImage(t){let e=this;if(this.isLoading=!0,this.file=this.$refs.imageFile.files[0],this.file.size>1e7){alert("Max file size is 10 MB!"),this.isLoading=!1;return}var n=new FormData;n.append("file",this.file),axios.post(this.uploadUrl,n).then(function(r){e.editor.chain().focus().setImage({src:r.data.data.url,alt:r.data.data.file_name}).run()}).catch(function(r){}).finally(()=>{this.isLoading=!1,this.$emit("close")})},setImageByUrl(){if(this.validUrl){this.editor.chain().focus().setImage({src:this.imageUrl}).run(),this.imageUrl="",this.$emit("close");return}this.invalidUrl=!0},focus(){this.$refs.addimage.focus()}}},mW={key:0,class:"spm-list"},gW={tabindex:"1",class:"upload-img text-sm"},vW=["innerHTML"],yW=["accept"],bW=["innerHTML"],kW=["placeholder"],wW={key:1,class:"py-6"};function xW(t,e,n,r,i,s){const o=z("spm-loader");return S(),C("div",null,[i.isLoading?(S(),C("div",wW,[X(o,{"show-instant":"",class:"text-center"}
146)])):(S(),C("ul",mW,[x("li",gW,[x("i",{innerHTML:t.svg("feather-upload-cloud","stroke-icon h-4")},null,8,vW),Me(" "+L(t.$t("editor.selectImage"))+" ",1),x("input",{ref:"imageFile",type:"file",accept:s.accept,class:"text-sm",onChange:e[0]||(e[0]=(...a)=>s.setImage&&s.setImage(...a))},null,40,yW)]),x("li",{class:K({"border border-red":i.invalidUrl})},[x("i",{innerHTML:t.svg("feather-link","stroke-icon h-4")},null,8,bW),Ye(x("input",{ref:"addimage","onUpdate:modelValue":e[1]||(e[1]=a=>i.imageUrl=a),placeholder:t.$t("editor.selectImageFromUrl"),class:"flex-1 rounded-lg bg-transparent text-sm",type:"url",onClick:e[2]||(e[2]=a=>s.focus()),onChange:e[3]||(e[3]=(...a)=>s.setImageByUrl&&s.setImageByUrl(...a))},null,40,kW),[[ls,i.imageUrl]])],2)]))])}const SW=Ae(pW,[["render",xW]]);var TW=Aw,_W=Ew,EW=Iw,CW=_W(function(t,e){return EW(t)?TW(t,e):[]}),OW=CW;const AW=wn(OW);function VS(t){return!!t.url&&/^image\//.test(t.mime_type||"")&&!["image/svg","image/svg+xml"].includes(t.mime_type)&&!["queue","error","uploading"].includes(t.state)&&(t.percentComplete==null||t.percentComplete===100)}function ul(t,e){const n=new URL(t,e),r=n.origin===new URL(e).origin&&n.pathname.match(/^\/media\/(?:inline\/)?(\d+)(?:\/(?:small|large))?$/);return r?`media:${r[1]}`:n.href}function zS(t=[],e=[],n=window.location.href){const r=t.filter(VS).map(a=>({text:a.file_name||a.name,src:a.url,type:"image",mime:a.mime_type})),i=new Map(r.map(a=>[ul(a.src,n),a])),s=[],o=new Set;for(const a of e){const l=a.getAttribute("src");if(!l)continue;const c=ul(l,n);if(o.has(c))continue;o.add(c);const u=new URL(l,n);u.origin===new URL(n).origin&&/^\/media\/inline\/\d+(?:\/(?:small|large))?$/.test(u.pathname)&&(u.pathname=u.pathname.replace(/\/(small|large)$/,"")+"/large"),s.push(i.get(c)||{text:a.alt,src:u.href,type:"image"})}for(const a of r){const l=ul(a.src,n);o.has(l)||(o.add(l),s.push(a))}return s}function MW(t,e,n=window.location.href){return t.find(r=>ul(r.src,n)===ul(e,n))}const IW={components:{SpmTooltip:rr},props:{files:{type:Array,default:()=>[]},imagePreviewList:{type:Function,default:null},classAttachment:{type:String,default:""}},data(){return{previewUrl:"",icons:{success:"feather-x",queue:"feather-pause",error:"feather-alert-circle"}}},mounted(){this.$tippy(".has-tooltipp")},methods:{getId(t){return t.$id?t.$id:t.id},getName(t){return t.file_name?t.file_name:t.name},isInProgress(t){return t.percentComplete?t.percentComplete!==100:!1},getTooltipErrorMessage(t){return typeof t.errors[0]>"u"?this.$t("editor.errors.server"):t.errors[0].msg},preview(t){if(!t.url||this.isInProgress(t))return;const e=t.mime_type||"",n=e.split("/")[0],r=VS(t);r||e==="application/pdf"?this.$store.commit("showPreviewModal",{text:this.getName(t),src:t.url,type:n,mime:e,...r?{list:this.imagePreviewList?this.imagePreviewList():zS(this.files)}:{}}):window.open(t.url,"_blank")}}},LW={class:"flex overflow-hidden items-center"},PW={class:"flex items-center whitespace-nowrap text-xs hover:cursor-pointer"},RW=["disabled","title","onClick"],$W={class:"flex-1 pl-2 whitespace-nowrap text-xs text-gray-600"};function DW(t,e,n,r,i,s){const o=z("spm-tooltip");return S(),C("div",{class:K(["flex flex-wrap",{"mb-2":n.files.length}])},[(S(!0),C(Fe,null,nt(n.files,a=>(S(),C("div",{key:s.getId(a),style:Ir(s.isInProgress(a)?"background: linear-gradient(to right, #EFF3F7 0%,#EFF3F7 "+a.percentComplete+"%,#ffffff "+a.percentComplete+"%,#ffffff 100%);":""),class:K(["spm-attachment flex flex-wrap mt-2 px-2 mr-2 rounded-lg hover:bg-gray-400",[s.isInProgress(a)?"border-2 border-dashed py-0":"py-1",a.state==="error"?"bg-red-100":"bg-gray-200",n.classAttachment?n.classAttachment:""]])},[x("div",LW,[a.errors&&a.errors.length||a.state==="error"||a.state==="queue"?(S(),re(o,{key:0,tag:"div",class:K([a.state==="error"?"text-red-600":"text-gray-400","flex-1 mr-1 whitespace-nowrap text-sm has-tooltipp"]),"data-tippy-content":s.getTooltipErrorMessage(a),"data-tippy-placement":"top-center","data-tippy-hide-on-click":"true","data-tippy-arrow":"true",title:s.getTooltipErrorMessage(a),innerHTML:t.svg(i.icons[a.state],"stroke-icon h-4")},null,8,["class","data-tippy-content","title","innerHTML"])):P("",!0),x("div",PW,[x("button",{type:"button",disabled:s.isInProgress(a),class:K([s.isInProgress(a)?"text-gray-700":"text-blue-500 hover:underline","flex max-w-xxs md:max-w-xs self-center text-left lg:md:max-w-full whitespace-normal truncate text-blue-500 font-medium hover:underline"]),title:s.getName(a),onClick:l=>s.preview(a)},L(s.getName(a)),11,RW)]),x("div",$W,L(t.$filters.prettyBytes(a.size)),1),Tt(t.$slots,"options",{file:a})])],6))),128))],2)}const WS=Ae(IW,[["render",DW]]),NW={components:{Attachments:WS,Portal:QC},props:{uploaderId:{type:String,required:!0},icon:{type:String,default:""},info:{type:String,default:""},url:{type:String,required:!0},initialFiles:{type:Array,default:()=>[]},maxFilesSize:{type:Number,default:1e3*1e3*10}},data(){return{loadedFiles:this.initialFiles,files:[]}},computed:{fileCount(){return this.$upload.files(this.uploaderId).all.length+this.loadedFiles.length},allFiles(){return Wc(this.loadedFiles,this.$upload.files(this.uploaderId).all).filter(t=>t)},allFilesSize(){let t=0;
146return this.allFiles.forEach(e=>{t=t+e.size}),t}},watch:{url(){this.$upload.option(this.uploaderId,"url",this.url)}},mounted(){this.$upload.on(this.uploaderId,{dropzoneId:this.uploaderId+"-dropzone",accept:"*/*",async:!0,maxFiles:50,maxFilesInProgress:5,maxFilesSelect:15,multiple:!0,startOnSelect:!0,extensions:!1,maxSizePerFile:1e3*1e3*10,maxFilesSelectMsg:this.$trans.get("Max file selection of {max} exceeded"),maxFileSizeMsg:this.$trans.get("File size is bigger than {max}MB"),invalidExtensionMsg:this.$trans.get("File must be one of {extensions}"),http:function(e){axios.post(e.url,e.body,{onUploadProgress:e.progress}).then(e.success).catch(e.error)},parseErrors:function(e){return e?{code:"fileError",msg:e.message}:[]},onSuccess(t,e){t.id=e.data.data.id,t.url=e.data.data.url,this.files.push(e.data.data)},onError(t){t.error.msg=="File size is bigger than 9MB"&&this.$notify.error("File size cannot be bigger than 10 Mb!",4e3),this.removeFile(t)}}),this.$upload.option(this.uploaderId,"url",this.url)},beforeUnmount(){this.$upload.off(this.uploaderId)},methods:{removeFile(t){typeof t.id<"u"&&axios.delete(this.url+"/"+t.id).then(function(e){}),typeof t.$id<"u"?(t.clear(),this.files.splice(t)):this.loadedFiles=AW(this.loadedFiles,t)}}},FW={class:"spm-editor-button"},jW=["data-tippy-content","innerHTML"],BW={key:0,class:"spm-editor-upload-list"},HW={key:0,class:"ml-1"},UW={key:1,class:"ml-1 text-red-500 font-bold"},VW={key:1,class:"flex mx-2 text-xs font-bold text-red-400"},zW={class:"flex flex-wrap px-2 pt-2"},WW=["onClick","innerHTML"];function KW(t,e,n,r,i,s){const o=z("attachments"),a=z("portal");return S(),C("div",FW,[x("button",{type:"button",tabindex:"-1","data-tippy-content":n.info,"data-tippy-placement":"bottom",class:"spm-editor-toolbar-item has-tooltipp",onClick:e[0]||(e[0]=l=>t.$upload.select(n.uploaderId)),innerHTML:t.svg("feather-"+n.icon,"stroke-icon h-4")},null,8,jW),X(a,{to:n.uploaderId},{default:Y(()=>[s.fileCount?(S(),C("div",BW,[Me(L(s.fileCount)+" "+L(t.$trans.get("Attachments",s.fileCount))+" ",1),s.allFilesSize<n.maxFilesSize?(S(),C("div",HW,"("+L(t.$filters.prettyBytes(s.allFilesSize))+")",1)):(S(),C("div",UW," ("+L(t.$filters.prettyBytes(s.allFilesSize))+") Your attachments can only be up to 10MB total! ",1))])):P("",!0),t.$upload.errors(n.uploaderId).length&&t.$upload.errors(n.uploaderId)[t.$upload.errors(n.uploaderId).length-1].code==="file-max-select"?(S(),C("div",VW,L(t.$upload.errors(n.uploaderId)[t.$upload.errors(n.uploaderId).length-1].msg),1)):P("",!0),x("div",zW,[X(o,{files:s.allFiles},{options:Y(({file:l})=>[x("a",{class:"flex-1 ml-2 whitespace-nowrap text-sm text-gray-600 hover:text-gray-900 hover:cursor-pointer",onClick:c=>s.removeFile(l),innerHTML:t.svg("feather-x","stroke-icon h-4")},null,8,WW)]),_:1},8,["files"])])],void 0,!0),_:1},8,["to"])])}const qW=Ae(NW,[["render",KW]]),GW={components:{SpmDropdownTags:Om,SpmTag:va},props:{editor:{type:Object,required:!0},draftId:{type:Number,required:!0}},data(){return{query:"",replies:[],selectedReply:null,loading:!1,repliesLoaded:!1,tagOptions:[],tagsLoading:!1,tagsLoaded:!1,selectedTagIds:[]}},computed:{selectedReplyHtml(){return this.selectedReply&&(typeof this.selectedReply.body_parsed=="string"?this.selectedReply.body_parsed:this.selectedReply.body||"")||""},searchableReplies(){return this.replies.map(t=>({...t,tagSearchBlob:Array.isArray(t.tags)?t.tags.map(e=>{const n=e.name;return typeof n=="string"?n:n&&n.en||""}).filter(Boolean).join(" "):""}))},fuseFilteredReplies(){return this.searchableReplies.length?this.query===""?this.searchableReplies.map(e=>{const n={...e};return Reflect.deleteProperty(n,"tagSearchBlob"),n}):new us(this.searchableReplies,{keys:["name","tagSearchBlob"],threshold:.35}).search(this.query).map(e=>{const n={...e.item};return Reflect.deleteProperty(n,"tagSearchBlob"),n}):[]},visibleReplies(){let t=[...this.fuseFilteredReplies];return this.selectedTagIds.length>0&&(t=t.filter(e=>{const n=(e.tags||[]).map(r=>typeof r=="number"?r:r.id).filter(r=>Number.isFinite(r));return this.selectedTagIds.some(r=>n.includes(r))})),t.sort((e,n)=>String(e.name||"").localeCompare(String(n.name||""),void 0,{sensitivity:"base"}))},tagsTagFilterDisabled(){return this.tagsLoading||this.tagsLoaded&&!this.tagOptions.length},selectedTags(){return this.selectedTagIds.map(t=>this.tagOptions.find(e=>
146e.id===t)).filter(Boolean)}},watch:{visibleReplies:{handler(t){if(!t.length){this.selectedReply=null;return}(!this.selectedReply||!t.some(e=>e.id===this.selectedReply.id))&&(this.selectedReply=t[0])},immediate:!1}},mounted(){this.loadReplies(),this.loadTags(),this.focusSearchWhenModalReady()},methods:{tagLabel(t){var r;const e=t==null?void 0:t.name,n=typeof((r=this.$i18n)==null?void 0:r.locale)=="string"?this.$i18n.locale.split("-")[0]:"";return typeof e=="string"?e:e&&typeof e=="object"?e[n]||e.en||Object.values(e).find(Boolean)||"":String((t==null?void 0:t.slug)||(t==null?void 0:t.id)||"")},onFilterTagsUpdated(t){this.selectedTagIds=Array.isArray(t)?t.slice():[]},displayTagBody(t){return{id:t.id,color:t.color||"#848484",name:this.tagLabel(t)}},removeTagFilter(t){this.selectedTagIds=this.selectedTagIds.filter(e=>e!==t)},clearTagFilters(){this.selectedTagIds=[]},selectReply(t){this.selectedReply=t},onQuickReplySearchEnter(t){t.isComposing||t.keyCode===229||this.selectedReply&&(t.preventDefault(),this.insertSelected())},insertQuickReply(t){this.selectedReply=t,this.insertSelected()},focusSearchWhenModalReady(){const t=()=>{const e=this.$refs.searchInput;e&&typeof e.focus=="function"&&e.focus()};this.$nextTick(()=>{t(),requestAnimationFrame(t),window.setTimeout(t,50)})},moveReplySelection(t){const e=this.visibleReplies;if(!e.length)return;let n=e.findIndex(i=>this.selectedReply&&i.id===this.selectedReply.id);if(n===-1){n=t>0?0:e.length-1,this.selectedReply=e[n],this.scrollSelectedReplyIntoView();return}const r=n+t;r<0||r>=e.length||(this.selectedReply=e[r],this.scrollSelectedReplyIntoView())},scrollSelectedReplyIntoView(){this.$nextTick(()=>{var i;const t=(i=this.selectedReply)==null?void 0:i.id;if(t==null)return;const e=this.$refs.replyList;if(!e)return;const n=e.querySelector("#quick-reply-option-"+String(t));n==null||n.scrollIntoView({block:"nearest",behavior:"smooth"});const r=this.$refs.searchInput;if(r&&typeof r.focus=="function")try{r.focus({preventScroll:!0})}catch{r.focus()}})},loadReplies(){if(!this.draftId){this.replies=[],this.repliesLoaded=!0;return}this.loading=!0,axios.get("/canned-responses/draft/"+this.draftId).then(t=>{this.replies=t.data.data||[]}).catch(()=>{this.replies=[]}).finally(()=>{this.loading=!1,this.repliesLoaded=!0})},loadTags(){this.tagsLoading=!0,axios.get("/selectable/tags/quick-reply").then(t=>{var e;this.tagOptions=((e=t.data)==null?void 0:e.data)??[]}).catch(()=>{this.tagOptions=[]}).finally(()=>{this.tagsLoading=!1,this.tagsLoaded=!0})},insertSelected(){if(!this.selectedReply)return;const t=this.selectedReply.body_parsed||this.selectedReply.body;t&&(this.editor.commands.insertContentAt(this.editor.view.state.selection.$anchor.pos,t,{updateSelection:!0,parseOptions:{preserveWhitespace:!1}}),this.editor.commands.focus(),this.$emit("close"))},saveQuickReply(){this.$emit("close"),this.$nextTick(()=>{this.$store.commit("showFormModal",{component:"tickets/modals/_quick-reply.modal.vue",params:{action:"create",html:this.editor.getHTML(),draftId:this.draftId,getResponses:()=>{}}})})},editQuickReply(t){this.$emit("close"),this.$nextTick(()=>{this.$store.commit("showFormModal",{component:"tickets/modals/_quick-reply.modal.vue",params:{action:"update",html:t.body,id:t.id,name:t.name,tags:t.tags||[],getResponses:()=>{}}})})}}},YW={class:"relative flex flex-col text-gray-800 text-sm"},XW={class:"font-display relative text-2xl pr-14 font-bold text-primary-900 mb-6"},JW=["aria-label","innerHTML"],QW={class:"flex flex-col md:flex-row gap-4 min-h-[50vh] max-h-[75vh] min-w-0"},ZW={class:"flex flex-col w-full md:w-1/3 min-h-60 min-w-0 order-2 md:order-1 pt-0"},e7={class:"box-style flex items-stretch gap-2 mb-2 mr-1 md:p-2"},t7=["placeholder","aria-expanded","aria-activedescendant"],n7=["disabled","title","aria-label"],r7=["innerHTML"],i7={class:"ml-2 text-xs font-medium hidden sm:inline"},s7={key:0,class:"ml-2 min-h-[1.125rem] min-w-[1.125rem] px-1 flex items-center justify-center rounded-full bg-primary-600 text-white text-[0.625rem] font-semibold leading-none tabular-nums"},o7={key:0,class:"flex flex-wrap items-center gap-x-2 gap-y-1 mb-2"}
146,a7={key:1,class:"text-xs text-gray-550 mb-2"},l7=["aria-label"],c7=["id","aria-selected","onClick","onKeydown"],u7={class:"text-left flex-1 min-w-0 font-medium truncate"},d7=["title","aria-label","onClick","innerHTML"],f7=["title","aria-label","onClick","innerHTML"],h7={key:2,class:"py-6 text-center text-gray-550 text-xs"},p7={class:"mt-4 pt-3 border-t border-gray-650/15 shrink-0 space-y-2"},m7=["disabled"],g7={class:"box-style flex flex-col w-full md:w-2/3 min-h-0 min-w-0 order-1 md:order-2 p-3 md:p-4"},v7={class:"flex-1 min-h-0 overflow-y-auto rounded-md bg-white p-4 text-gray-850 prose prose-sm max-w-none"},y7=["innerHTML"],b7={key:1,class:"text-sm text-gray-550 mb-0"};function k7(t,e,n,r,i,s){const o=z("spm-dropdown-tags"),a=z("spm-tag");return S(),C("div",YW,[x("h2",XW,[Me(L(t.$t("editor.quickRepliesModalTitle"))+" ",1),x("button",{type:"button",class:"absolute right-0 top-0 p-4 -mt-8 -mr-8 text-gray-500 hover:text-gray-650","aria-label":t.$t("editor.cancel"),onClick:e[0]||(e[0]=l=>t.$emit("close")),innerHTML:t.svg("feather-x","flex h-5 text-gray-600 stroke-icon")},null,8,JW)]),x("div",QW,[x("aside",ZW,[x("div",e7,[Ye(x("input",{ref:"searchInput","onUpdate:modelValue":e[1]||(e[1]=l=>i.query=l),type:"search",class:"block flex-1 min-w-0 px-3 py-2 rounded-lg bg-gray-650/10 text-gray-800 placeholder-gray-550",placeholder:t.$t("editor.quickRepliesSearchPlaceholder"),role:"combobox","aria-autocomplete":"list","aria-expanded":s.visibleReplies.length>0?"true":"false","aria-activedescendant":i.selectedReply?"quick-reply-option-"+i.selectedReply.id:void 0,"aria-controls":"quick-reply-listbox",onKeydown:[e[2]||(e[2]=Lt(ct(l=>s.moveReplySelection(1),["prevent"]),["down"])),e[3]||(e[3]=Lt(ct(l=>s.moveReplySelection(-1),["prevent"]),["up"])),e[4]||(e[4]=Lt((...l)=>s.onQuickReplySearchEnter&&s.onQuickReplySearchEnter(...l),["enter"]))]},null,40,t7),[[ls,i.query]]),X(o,{"options-url":"/selectable/tags/quick-reply",tags:s.selectedTags,disabled:s.tagsTagFilterDisabled,placement:"bottom-end",small:!0,"dropdown-class":"min-w-[16rem]",onUpdated:s.onFilterTagsUpdated},{default:Y(()=>[x("button",{type:"button",class:K(["inline-flex items-center shrink-0 h-full px-3 py-2 rounded-lg bg-gray-650/10 text-gray-800 hover:bg-gray-650/15 border border-transparent transition",{"ring-2 ring-primary-400 ring-inset border-primary-200 bg-gray-650/15":i.selectedTagIds.length>0}]),disabled:s.tagsTagFilterDisabled,title:t.$t("editor.quickRepliesTagFilter"),"aria-label":t.$t("editor.quickRepliesTagFilter")},[x("span",{class:"flex items-center shrink-0",innerHTML:t.svg("feather-tag","stroke-icon h-4 w-4")},null,8,r7),x("span",i7,L(t.$t("editor.quickRepliesTagsFilterButton")),1
146),i.selectedTagIds.length>0?(S(),C("span",s7,L(i.selectedTagIds.length),1)):P("",!0)],10,n7)],void 0,!0),_:1},8,["tags","disabled","onUpdated"])]),s.selectedTags.length>0?(S(),C("div",o7,[(S(!0),C(Fe,null,nt(s.selectedTags,l=>(S(),C("div",{key:"chip-"+l.id,class:"inline-flex max-w-full items-center gap-1"},[X(a,{tag:s.displayTagBody(l),class:"mr-0 mb-0"},null,8,["tag"])]))),128)),x("button",{type:"button",class:"text-xs font-medium text-primary-700 hover:text-primary-900 py-1",onClick:e[5]||(e[5]=(...l)=>s.clearTagFilters&&s.clearTagFilters(...l))},L(t.$t("editor.quickRepliesClearTagFilters")),1)])):P("",!0),i.tagsLoaded&&!i.tagsLoading&&!i.tagOptions.length?(S(),C("p",a7,L(t.$t("editor.quickRepliesNoTagsHint")),1)):P("",!0),x("ul",{id:"quick-reply-listbox",ref:"replyList",class:"flex-1 overflow-y-auto min-h-0 pr-1",role:"listbox","aria-label":t.$t("editor.quickRepliesModalTitle")},[(S(!0),C(Fe,null,nt(s.visibleReplies,l=>(S(),C("li",{key:l.id,id:"quick-reply-option-"+l.id,role:"option","aria-selected":i.selectedReply&&i.selectedReply.id===l.id?"true":"false",tabindex:"-1",class:"outline-none cursor-pointer",onClick:c=>s.selectReply(l),onKeydown:[e[6]||(e[6]=Lt(ct(c=>s.moveReplySelection(1),["prevent"]),["down"])),e[7]||(e[7]=Lt(ct(c=>s.moveReplySelection(-1),["prevent"]),["up"])),Lt(ct(c=>s.insertQuickReply(l),["prevent"]),["enter"])]},[x("div",{class:K(["box-style mb-1 w-full flex items-stretch px-2 py-2 gap-2",i.selectedReply&&i.selectedReply.id===l.id?"bg-primary-50 border border-primary-200":"hover:bg-gray-100 border border-transparent"])},[x("div",u7,L(l.name),1),i.selectedReply&&i.selectedReply.id===l.id?(S(),C("button",{key:0,type:"button",class:"w-5 shrink-0 flex items-center justify-center text-primary-100 hover:text-gray-700",tabindex:"-1",title:t.$t("editor.quickRepliesEditQuickReply"),"aria-label":t.$t("editor.quickRepliesEditQuickReply"),onClick:ct(c=>s.editQuickReply(l),["stop","prevent"]),innerHTML:t.svg("feather-edit","stroke-icon h-4")},null,8,d7)):P("",!0),x("button",{type:"button",class:"w-6 shrink-0 flex items-center justify-center text-primary-100 hover:text-gray-700",tabindex:"-1",title:t.$t("editor.insertReply"),"aria-label":t.$t("editor.insertReply"),onClick:ct(c=>{s.selectReply(l),s.insertSelected()},["stop","prevent"]),innerHTML:t.svg("feather-plus-square","stroke-icon h-4 mt-[0.2rem]")},null,8,f7)],2)],40,c7))),128))],8,l7),!s.visibleReplies.length&&i.repliesLoaded&&!i.loading?(S(),C("p",h7,L(t.$t("editor.quickRepliesEmptyList")),1)):P("",!0),x("div",p7,[x("button",{type:"button",class:"btn btn-primary-500 w-full text-sm disabled:opacity-50",disabled:!i.selectedReply,onClick:e[8]||(e[8]=(...l)=>s.insertSelected&&s.insertSelected(...l))},L(t.$t("editor.insertReply")),9,m7),x("button",{type:"button",class:"btn btn-plain text-primary-700 w-full text-sm",onClick:e[9]||(e[9]=(...l)=>s.saveQuickReply&&s.saveQuickReply(...l))},L(t.$t("editor.quickRepliesSaveThis")),1)])]),x("main",g7,[x("div",v7,[s.selectedReplyHtml?(S(),C("div",{key:0,class:"spm-ticket-message",innerHTML:s.selectedReplyHtml},null,8,y7)):(S(),C("p",b7,L(t.$t("editor.quickRepliesPickHint")),1))])])])])}const w7=Ae(GW,[["render",k7]]),x7=[{id:"en-US",short:"en",name:"English"},{id:"de-DE",short:"de",name:"German"},{id:"zh-HK",short:"zh",name:"Chinese"},{id:"nl-NL",short:"nl",name:"Dutch"},{id:"fr-FR",short:"fr",name:"French"},{id:"it-IT",short:"it",name:"Italian"},{id:"pl-PL",short:"pl",name:"Polish"},{id:"pt-BR",short:"pt",name:"Portuguese"},{id:"es-ES",short:"es",name:"Spanish"}],S7={components:{SpmDropdown:Gn,SpmEditorButton:US},props:{editor:{type:Object,required:!0},ticketId:{type:Number,required:!0},editorType:{type:String,default:null},disabled:{type:Boolean,default:!1},aiLoading:{type:Boolean,default:!1}},data(){return{isLoading:!1,showTranslateLanguages:!1,systemLocales:x7}},computed:{showGenerateReply(){return["external","forward"].includes(this.editorType)}},watch:{isLoading(t){this.$emit("loading",t)},aiLoading(t){t||(this.isLoading=!1)}},methods:{getEditorText(){const{from:t,to:e}=this.editor.state.selection;
146if(t!==e){const n=this.editor.state.doc.slice(t,e),i=ds.fromSchema(this.editor.schema).serializeFragment(n.content),s=document.createElement("div");return s.appendChild(i),s.innerHTML}return this.editor.getHTML()},applyEditorText(t){const{from:e,to:n}=this.editor.state.selection;e!==n?this.editor.chain().focus().deleteRange({from:e,to:n}).insertContent(t).run():this.editor.commands.setContent(t)},improveWriting(t){const e=this.getEditorText();if(!e||!e.trim()){this.$notify.error(this.$trans.get("Please write something first."));return}this.isLoading=!0,t(),this.$emit("ai-action-started","improve_writing"),axios.post(`/tickets/${this.ticketId}/ai/improve-writing`,{text:e,editor_type:this.editorType||"external"}).then(()=>{this.$store.dispatch("getTicket",{id:this.ticketId,fetch:!0})}).catch(()=>{this.isLoading=!1,this.$notify.error(this.$trans.get("Could not improve writing."))})},generateReply(t){t(),this.isLoading=!0,this.$emit("ai-action-started","suggested_reply"),this.$emit("generate-reply"),axios.patch(`/tickets/${this.ticketId}/generate-reply`).then(()=>{this.$store.dispatch("getTicket",{id:this.ticketId,fetch:!0})}).catch(()=>{this.isLoading=!1,this.$emit("generate-reply-failed"),this.$notify.error(this.$trans.get("Could not start reply generation."))})},openTranslateMenu(){this.showTranslateLanguages=!0},translate(t,e){const n=this.getEditorText();if(!n||!n.trim()){this.$notify.error(this.$trans.get("Please write something first."));return}this.isLoading=!0,e(),this.$emit("ai-action-started","translate"),axios.post(`/tickets/${this.ticketId}/ai/translate`,{text:n,target_language:t.id,editor_type:this.editorType||"external"}).then(()=>{this.showTranslateLanguages=!1,this.$store.dispatch("getTicket",{id:this.ticketId,fetch:!0})}).catch(()=>{this.isLoading=!1,this.showTranslateLanguages=!1,this.$notify.error(this.$trans.get("Could not translate text."))})}}},T7=["disabled","onClick"],_7=["disabled","onClick"],E7=["disabled"],C7=["disabled"],O7=["innerHTML"],A7=["disabled","onClick"];function M7(t,e,n,r,i,s){const o=z("spm-editor-button"),a=z("spm-dropdown");return S(),re(a,{small:!0,placement:"bottom-end",disabled:n.disabled||i.isLoading,"hide-after-dropdown-click":!1,onClose:e[3]||(e[3]=l=>i.showTranslateLanguages=!1)},{trigger:Y(({isOpen:l})=>[X(o,{info:t.$t("editor.ai"),icon:"custom-ai","icon-class":"h-5 w-5",disabled:n.disabled||i.isLoading,class:K({active:l}),onMousedown:e[0]||(e[0]=ct(()=>{},["prevent"]))},null,8,["info","disabled","class"])]),dropdown:Y(({hide:l})=>[Ye(x("div",null,[x("button",{type:"button",class:"flex spm-dropdown-linkitem item items-center w-full",disabled:i.isLoading,onClick:ct(c=>s.improveWriting(l),["stop"])},L(t.$t("editor.improveWriting")),9,T7),s.showGenerateReply?(S(),C("button",{key:0,type:"button",class:"flex spm-dropdown-linkitem item items-center w-full",disabled:i.isLoading,onClick:ct(c=>s.generateReply(l),["stop"])},L(t.$t("editor.generateReply")),9,_7)):P("",!0),e[4]||(e[4]=x("div",{class:"border-t border-gray-200 my-1"},null,-1)),x("button",{type:"button",class:"flex spm-dropdown-linkitem item items-center w-full",disabled:i.isLoading,onClick:e[1]||(e[1]=ct((...c)=>s.openTranslateMenu&&s.openTranslateMenu(...c),["stop"]))},L(t.$t("editor.translateTo")),9,E7)],512),[[wt,!i.showTranslateLanguages]]),Ye(x("div",null,[x("button",{type:"button",class:"flex spm-dropdown-linkitem item items-center w-full text-gray-600",disabled:i.isLoading,onClick:e[2]||(e[2]=ct(c=>i.showTranslateLanguages=!1,["stop"]))},[x("span",{class:"mr-2",innerHTML:t.svg("feather-chevron-left","stroke-icon h-4")},null,8,O7),Me(" "+L(t.$t("editor.translateTo")),1)],8,C7),e[5]||(e[5]=x("div",{class:"border-t border-gray-200 my-1"},null,-1)),(S(!0),C(Fe,null,nt(i.systemLocales,c=>(S(),C("button",{key:c.id,type:"button",class:"flex spm-dropdown-linkitem item items-center w-full",disabled:i.isLoading,onClick:ct(u=>s.translate(c,l),["stop"])},L(c.name),9,A7))),128))],512),[[wt,i.showTranslateLanguages]])]),_:1},8,["disabled"])}const I7=Ae(S7,[["render",M7]]),L7={props:{items:{type:Array,required:!0},command:{type:Function,required:!0}},data(){return{selectedIndex:0}},watch:{items(){this.selectedIndex=0}},methods:{onKeyDown({event:t}){return t.key==="ArrowUp"?(this.upHandler(),!0):t.key==="ArrowDown"?(this.downHandler(),!0):t.key==="Enter"?(this.enterHandler(),!0):!1},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length},enterHandler(){this.selectItem(this.selectedIndex)},selectItem(t){const e=this.items[t];e&&this.command({id:e.id,label:e.name})}}},P7={class:"items"},R7=["onClick"],$7=["src"],D7={key:0,class:"item text-sm opacity-75"};function N7(t,e,n,r,i,s){return S(),C("div",P7,[(S(!0),C(Fe,null,nt(n.items,(o,a)=>(S(),C("button",{key:a,class:K(["item my-1",{"is-selected":a===i.selectedIndex}]),onClick:l=>s.selectItem(a)},[o.avatar?(S(),C("img",{key:0,src:o.avatar,class:"avatar rounded-lg mr-2 h-5 w-5"},null,8,$7)):P("",!0),Me(" "+L(o.name),1)],10,R7))),128)),n.items.length?P("",!0):(S(),C("div",D7,"No users found"))])}const F7=Ae(L7,[["render",N7],["__scopeId","data-v-5593b784"]]),Oa=[],j7={props:{open:{type:Boolean,default:!1},closeOnEsc:{type:Boolean,default:!0},wrapperClass:{type:String,default:""}},data(){return{showModal:!1,showBackdrop:!1,showContent:!1,backdropLeaving:!1,cardLeaving:!1}},computed:{leaving(){return this.backdropLeaving||this.cardLeaving}},watch:{open:{handler:function(t){t?this.show():this.close()},immediate:!0},leaving(t){t===!1&&(this.showModal=!1,this.removeFromModalStack(),this.$emit("close"))}},created(){document.addEventListener("keydown",this.onModalEscape,{capture:!1,passive:!1})},beforeUnmount(){this.removeFromModalStack(),document.removeEventListener("keydown",this.onModalEscape,{capture:!1,passive:!1})},methods:{onModalEscape(t){t.key!=="Escape"||Oa[Oa.length-1]!==this||(t.stopImmediatePropagation(),t.preventDefault(),this.open&&this.showContent&&this.closeOnEsc&&!t.repeat&&this.close())},show(){this.removeFromModalStack(),Oa.push(this),this.showModal=!0,this.showBackdrop=!0,this.showContent=!0},close(){this.showBackdrop=!1,this.showContent=!1},removeFromModalStack(){const t=Oa.indexOf(this);t!==-1&&Oa.splice(t,1)}}},B7={key:0,class:"fixed w-screen h-screen inset-0 z-50 overflow-auto"},H7={key:0};function U7(t,e,n,r,i,s){return i.showModal?(S(),C("div",B7,[X(Ii,{"enter-active-class":"transition-all transition-fast ease-
146out-quad","leave-active-class":"transition-all transition-medium ease-in-quad","enter-class":"opacity-0","enter-to-class":"opacity-100","leave-class":"opacity-100","leave-to-class":"opacity-0",appear:"",onBeforeLeave:e[1]||(e[1]=o=>i.backdropLeaving=!0),onAfterLeave:e[2]||(e[2]=o=>i.backdropLeaving=!1)},{default:Y(()=>[i.showBackdrop?(S(),C("div",H7,[x("div",{class:"fixed w-screen h-screen inset-0 bg-gray-900 opacity-25 py-8",onClick:e[0]||(e[0]=o=>t.$store.getters.refreshRequired||t.$store.getters.dialogModal.show?null:s.close())})])):P("",!0)],void 0,!0),_:1}),X(Ii,{"enter-active-class":"transition-all transition-fast ease-out-quad","leave-active-class":"transition-all transition-medium ease-in-quad","enter-class":"opacity-0 scale-70","enter-to-class":"opacity-100 scale-100","leave-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-70",appear:"",onBeforeLeave:e[3]||(e[3]=o=>i.cardLeaving=!0),onAfterLeave:e[4]||(e[4]=o=>i.cardLeaving=!1)},{default:Y(()=>[i.showContent?(S(),C("div",{key:0,class:K(["flex",n.wrapperClass])},[Tt(t.$slots,"default")],2)):P("",!0)],void 0,!0),_:3})])):P("",!0)}const Di=Ae(j7,[["render",U7]]),V7=t=>t[Math.floor(Math.random()*t.length)],z7={components:{EditorContent:HH,PortalTarget:ZC,SpmDropdown:Gn,SpmEditorAddImage:SW,SpmEditorAddLink:hW,SpmEditorAiMenu:I7,SpmEditorButton:US,SpmEditorFontcolor:lW,SpmEditorQuickRepliesPicker:w7,SpmEditorStyle:eW,SpmEditorUpload:qW,SpmSearchInput:zC,Modal:Di},props:{dark:{type:Boolean,default:!1},draftId:{type:Number,default:0},uploadUrl:{type:String,default:""},uploadInlineUrl:{type:String,default:""},files:{type:Array,default:()=>[]},minHeight:{type:String,default:"130px"},html:{type:String,default:""},footer:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1},quickReply:{type:Boolean,default:!1},showCannedResponses:{type:Boolean,default:!1},showCustomHtml:{type:Boolean,default:!1},mentionList:{type:Array,default:()=>null},editable:{type:Boolean,default:!0},showAiToolbar:{type:Boolean,default:!1},ticketId:{type:Number,default:null},editorType:{type:String,default:null},aiLoading:{type:Boolean,default:!1},aiLoadingAction:{type:String,default:null}},data(){return{editor:null,provider:null,gethtml:this.html,query:null,suggestionRange:null,filteredUsers:[],navigatedUserIndex:0,uploaderId:"spm-editor-uploader"+this._uid,dropdownOpen:!1,docsSearch:!1,isLoading:!1,quickRepliesModalOpen:!1,currentUser:{name:this.$store.getters.user.name,color:this.getRandomColor()}}},computed:{mentionsEnabled(){return Array.isArray(this.mentionList)},attachmentsUploadState(){return this.$upload.state(this.uploaderId)},attachmentsSize(){let t=0;return this.$upload.files(this.uploaderId).all.forEach(e=>{t=t+e.size}),t},hasResults(){return this.filteredUsers.length},showSuggestions(){return this.query||this.hasResults},aiFeatureAvailable(){var t,e;return!!((e=(t=this.$store.getters.customerInfo)==null?void 0:t.conditions)!=null&&e.aiFeatures)},aiToolbarUsable(){var t,e,n;return this.aiFeatureAvailable&&((n=(e=(t=this.$store.getters.customerInfo)==null?void 0:t.workspaceSettings)==null?void 0:e.ai)==null?void 0:n.enabled)},aiUpgradeTooltip(){return this.$t("editor.aiUpgradeToBusiness")},aiProcessing(){return this.aiLoading},aiLoadingLabel(){return{suggested_reply:this.$t("editor.aiLoadingSuggestedReply"),improve_writing:this.$t("editor.aiLoadingImproveWriting"),translate:this.$t("editor.aiLoadingTranslate")}[this.aiLoadingAction]||null},isEditorEditable(){return this.editable&&!this.aiProcessing}},watch:{isEditorEditable(t){this.editor&&this.editor.setEditable(t)},editable(){this.editor&&this.editor.setEditable(this.isEditorEditable)}},created(){this.editor=new BH({enablePasteRules:!1,enableInputRules:!1,autofocus:this.autoFocus,editable:this.editable,extensions:[WU,k6,b6,w6,Uz,v6.extend({addKeyboardShortcuts:()=>
146({"Mod-Shift-l":()=>document.getElementById("linkbutton").click(),"Mod-j":()=>document.getElementById("docssearchbutton").click(),"Mod-Alt-k":()=>this.openQuickRepliesModal(),"Mod-Alt-q":()=>this.editor.commands.toggleBlockquote()})}),Dz.configure({uploader:(t,e)=>this.uploadInlineImage(t,e)}),E6.configure({HTMLAttributes:{class:"mention"},suggestion:{allow:({state:t,range:e})=>this.mentionsEnabled?!!t.doc.resolve(e.from).parent.type.contentMatch.matchType(t.schema.nodes.mention):!1,items:({query:t})=>this.mentionsEnabled?t?new us(this.mentionList,{threshold:.2,keys:["name"]}).search(t).map(n=>n.item):this.mentionList:[],render:()=>{let t,e;return{onStart:n=>{t=new Qx(F7,{props:n,editor:n.editor}),e=gs("body",{getReferenceClientRect:n.clientRect,appendTo:()=>this.$el,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,touch:!0})},onUpdate(n){t.updateProps(n),e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var r;return n.event.key==="Escape"?(e[0].hide(),!0):(r=t.ref)==null?void 0:r.onKeyDown(n)},onExit(){e!=null&&e[0]&&!e[0].state.isDestroyed&&e[0].destroy(),t==null||t.destroy()}}}}})],onCreate({editor:t}){},onUpdate:({editor:t})=>{this.$emit("update",t.getHTML())},content:this.html})},mounted(){},beforeUnmount(){this.editor.destroy()},methods:{openQuickRepliesModal(){!this.showCannedResponses||!this.draftId||(this.quickRepliesModalOpen=!0)},closeQuickRepliesModal(){this.quickRepliesModalOpen=!1},async uploadInlineImage(t,e){if(t.size/1024/1024>10){this.$notify.error(this.$trans.get("Max inline file size is 10 MB!"));return}if(!["image/gif","image/jpeg","image/png","image/bmp"].includes(t.type)){this.$notify.error(this.$trans.get("File type is not supported for clipboard-upload."));return}let n=URL.createObjectURL(t),r="image-"+Date.now();this.editor.chain().setTextSelection({from:e.from,to:e.to}).setImage({id:r,src:n,alt:encodeURI(t.name),class:"spm-image-uploading"}).run(),this.editor.commands.setTextSelection({from:e.to+3,to:e.to+3}),this.isLoading=!0,t.size/1024/1024>2&&t.size/1024/1024<3?this.$notify.success(this.$trans.get("This will take a while ...")):t.size/1024/1024>=3&&this.$notify.success(this.$trans.get("This will take very long ..."));var i=new FormData;i.append("file",t),axios.post(this.uploadInlineUrl,i).then(s=>{let o=null;this.editor.state.doc.descendants((u,d)=>{if(u.type.name==="image"&&u.attrs.id===r)return o=d,!1});let a=document.getElementById(r),l=a?this.calculateAspectRatioFit(a.width,a.height,1920,1920):{width:"",height:""};const c={src:s.data.data.url,alt:encodeURI(s.data.data.file_name),width:a?l.width+"px":"",height:a?l.height+"px":"",background:'url("'+n+'")'};o!==null?this.editor.chain().setNodeSelection(o).setImage(c).run():this.editor.chain().focus("end").setImage(c).run(),a&&a.remove(),this.editor.commands.focus("end"),this.$notify.success(this.$trans.get("Inline image added from clipboard."))}).catch(s=>{this.$notify.error(s.message?s.message:this.$trans.get("Could not upload from clipboard."))}).finally(()=>{this.isLoading=!1})},submit(){this.$emit("submitHtml",this.gethtml)},searchArticleOptionClicked(t){let{action:e,article:n}=t,{url:r,title:i}=n;e=="insert-link"&&(this.editor.commands.insertContent(`<a href="${r}">${i}</a> `),this.editor.commands.focus(),this.docsSearch=!1)},elementFromString(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e},getRandomColor(){return V7(["#958DF1","#F98181","#FBBC88","#FAF594","#70CFF8","#94FADB","#B9F18D"])},calculateAspectRatioFit(t,e,n,r){if(!t||!e)return{width:n,height:r};if(t<=n&&e<=r)return{width:t,height:e};const i=Math.min(n/t,r/e);return{width:Math.round(t*i),height:Math.round(e*i)}},setHtmlContent(t){this.editor.commands.clearContent(),this.editor.commands.setContent(t),this.editor.commands.focus("start")}}},W7=["id"],K7={key:0,class:"spm-editor-dropzone flex items-center absolute top-0 bottom-0 left-0 right-0 rounded opacity-75 bg-white border-2 border-gray-600 border-dashed z-30"},q7={class:"w-full text-center text-gray-700 text-xl"},G7=["innerHTML"],Y7={key:0,class:"relative"},X7={hidefocus:"1"},J7={key:4,class:"spm-editor-toolbar-divider"},Q7={key:0,class:"absolute z-40 md:-mt-10 w-full"},Z7={class:"relative pr-4 md:pl-2 md:pr-6"},eK=["innerHTML"],tK=["innerHTML"],nK={key:0,class:"spm-editor-ai-loading-badge"},rK={ref:"suggestions",class:"suggestion-list"},iK=["onClick"],sK={key:1,class:"suggestion-list__item is-empty"},oK={class:"box-style relative py-8 px-4 md:p-8 my-2 md:my-8 w-[c
146alc(100vw-2rem)] md:w-full max-w-6xl mx-auto flex flex-col bg-gray-200"};function aK(t,e,n,r,i,s){const o=z("spm-editor-button"),a=z("spm-editor-style"),l=z("spm-dropdown"),c=z("spm-editor-fontcolor"),u=z("spm-editor-upload"),d=z("spm-editor-add-image"),f=z("spm-editor-add-link"),p=z("spm-editor-ai-menu"),h=z("spm-search-input"),g=z("editor-content"),m=z("portal-target"),b=z("spm-editor-quick-replies-picker"),T=z("modal");return S(),C("div",{class:K(["spm-editor-ai-loading-wrapper",{"is-loading":s.aiProcessing}])},[x("div",{id:i.uploaderId+"-dropzone",class:K(["spm-editor",{"spm-editor-600":n.dark}])},[X(Ii,{name:"fade"},{default:Y(()=>[t.$upload.dropzone(i.uploaderId).active?(S(),C("div",K7,[x("div",q7,[x("div",{class:"text-gray-600",innerHTML:t.svg("feather-upload-cloud","stroke-icon h-16 w-12")},null,8,G7),Me(" "+L(t.$t("editor.dropFilesToUpload")),1)])])):P("",!0)],void 0,!0),_:1}),i.editor?(S(),C("div",Y7,[x("div",{class:K(["editormenu sticky top-0 z-10 relative",{"pointer-events-none":!s.isEditorEditable}])},[x("div",X7,[x("div",{class:K(["spm-editor-toolbar hide-native-scrollbar transition duration-500 ease-in-out flex-wrap lg:flex",{"hidden md:flex opacity-0":i.docsSearch}])},[X(l,{small:!0,"dropdown-class":"max-w-8",placement:"bottom-start"},{trigger:Y(()=>[X(o,{info:t.$t("editor.style"),class:K({active:i.editor.isActive("heading",{level:1})||i.editor.isActive("heading",{level:3})}),icon:"type",onMousedown:e[0]||(e[0]=ct(()=>{},["prevent"]))},null,8,["info","class"])]),dropdown:Y(({hide:E})=>[X(a,{editor:i.editor,onClose:E},null,8,["editor","onClose"])]),_:1}),X(o,{info:t.$t("editor.bold"),"key-binding-info":t.$store.getters.commandKey+" B",class:K({active:i.editor.isActive("bold")}),icon:"bold",onClick:e[1]||(e[1]=E=>i.editor.chain().focus().toggleBold().run())},null,8,["info","key-binding-info","class"]),X(o,{info:t.$t("editor.italic"),"key-binding-info":t.$store.getters.commandKey+" I",class:K({active:i.editor.isActive("italic")}),icon:"italic",onClick:e[2]||(e[2]=E=>i.editor.chain().focus().toggleItalic().run())},null,8,["info","key-binding-info","class"]),X(o,{info:t.$t("editor.underline"),"key-binding-info":t.$store.getters.commandKey+" U",class:K({active:i.editor.isActive("underline")}),icon:"underline",onClick:e[3]||(e[3]=E=>i.editor.chain().focus().toggleUnderline().run())},null,8,["info","key-binding-info","class"]),X(o,{info:t.$t("editor.strike"),"key-binding-info":t.$store.getters.commandKey+"â§ S",class:K({active:i.editor.isActive("strike")}),icon:"custom-strike",onClick:e[4]||(e[4]=E=>i.editor.chain().focus().toggleStrike().run())},null,8,["info","key-binding-info","class"]),e[22]||(e[22]=x("div",{class:"spm-editor-toolbar-divider"},null,-1)),X(l,{small:!0,"dropdown-class":"max-w-8",placement:"bottom-start"},{trigger:Y(()=>[X(o,{info:t.$t("editor.fontColor"),class:K({active:i.editor.isActive("textStyle")}),icon:"droplet",onMousedown:e[5]||(e[5]=ct(()=>{},["prevent"]))},null,8,["info","class"])]),dropdown:Y(({hide:E,isOpen:w})=>[X(c,{editor:i.editor,"is-open":w,onClose:E},null,8,["editor","is-open","onClose"])]),_:1}),X(o,{info:t.$t("editor.list"),"key-binding-info":t.$store.getters.commandKey+"â§ 8",class:K({active:i.editor.isActive("bulletList")}),icon:"list",onClick:e[6]||(e[6]=E=>i.editor.chain().focus().toggleBulletList().run())},null,8,["info","key-binding-info","class"]),X(o,{info:t.$t("editor.orderedList"),"key-binding-info":t.$store.getters.commandKey+"â§ 7",class:K(["hidden md:flex",{active:i.editor.isActive("orderedList")}]),icon:"custom-ordered-list",onClick:e[7]||(e[7]=E=>i.editor.chain().focus().toggleOrderedList().run())},null,8,["info","key-binding-info","class"]),X(o,{info:t.$t("editor.code"),"key-binding-info":t.$store.getters.commandKey+t.$store.getters.altKey+" C",class:K({active:i.editor.isActive("codeBlock")}),icon:"code",onClick:e[8]||(e[8]=E=>i.editor.chain().focus().toggleCodeBlock().run())},null,8,["info","key-binding-info","class"]),X(o,{info:t.$t("editor.blockquote"),"key-binding-info":t.$store.getters.commandKey+t.$store.getters.altKey+" Q",class:K({active:i.editor.isActive("blockquote")}),icon:"custom-blockquote",onClick:e[9]||(e[9]=E=>i.editor.chain().focus().toggleBlockquote().run())},null,8,["info","key-binding-info","class"]),n.showCustomHtml?(S(),re(o,{key:0,info:t.$t("editor.sandbox"),class:K({active:i.editor.isActive("sandbox")}),icon:"code",onClick:e[10]||(e[10]=E=>i.editor.chain().focus().addCustomHtml().run())},null,8,["info","class"])):P("",!0),e[23]||(e[23]=x("div",{class:"spm-editor-toolbar-divider"},null,-1)),!n.dark||n.uploadUrl!=""?(S(),re(u,{key:1,url:n.uploadUrl,"initial-files":n.files,info:t.$t("editor.uploadAttachment"),"uploader-id":i.uploaderId,icon:"paperclip"},null,8,["url","initial-files","info","uploader-id"])):P("",!0),!n.dark||n.uploadInlineUrl!=""?(S(),re(l,{key:2,small:!0,placement:"bottom-end"},{trigger:Y(()=>[X(o,{info:t.$t("editor.addImage"),icon:"image"},null,8,["info"])]),dropdown:Y(({hide:E})=>[X(d,{"upload-url":n.uploadInlineUrl,editor:i.editor,"allow-svg":!1,onClose:E},null,8,["upload-url","editor","onClose"])]),_:1})):P("",!0),X(l,{"click-outside-to-close":!1,placement:"bottom-end"},{trigger:Y(({isOpen:E})=>[X(o,{id:"linkbutton",info:t.$t("editor.addLink"),"key-binding-info":t.$store.getters.commandKey+"â§ L",class:K({active:i.editor.isActive("link")}),icon:"link-2"},null,8,["info","key-binding-info","class"])]),dropdown:Y(({hide:E,isOpen:w})=>[X(f,{editor:i.editor,"is-open":w,onClose:E},null,8,["editor","is-open","onClose"])]),_:1}),s.mentionsEnabled?(S(),re(o,{key:3,info:t.$t("editor.mention"),"key-binding-info":"@",class:K({active:i.editor.isActive("mention")}),icon:"at-sign",onClick:e[11]||(e[11]=E=>i.editor.chain().insertContent("@").focus().run())},null,8,["info","class"])):P("",!0),n.showCannedResponses?(S(),C("div",J7)):P("",!0),n.showCannedResponses?(S(),re(o,{key:5,id:"cannedresponsesbutton",info:t.$t("editor.quickReplies"),"key-binding-info":t.$store.getters.commandKey+t.$store.getters.altKey+" K",class:K({active:i.quickRepliesModalOpen}),icon:"message-circle",onClick:s.openQuickRepliesModal},null,8,["info","key-binding-info","class","onClick"])):P("",!0),t.$userHasPermission(["docs-site-public-read","docs-site-private-read"])?(S(),re(o,{key:6,id:"docssearchbutton",info:t.$t("editor.searchDocs"),"key-binding-info":t.$store.getters.commandKey+" J",icon:"file-text",onClick:e[12]||(e[12]=E=>i.docsSearch=!i.docsSearch)},null,8,["info","key-binding-info"])):P("",!0),n.showAiToolbar?(S(),C(Fe,{key:7},[i.editor&&s.aiToolbarUsable?(S(),re(p,{key:0,editor:i.editor,"ticket-id":n.ticketId,"editor-type":n.editorType,"ai-loading":n.aiLoading,disabled:!s.isEditorEditable,onLoading:e[13]||(e[13]=E=>t.$emit("ai-loading",E)),onGenerateReply:e[14]||(e[14]=E=>t.$emit("generate-reply")),onGenerateReplyFailed:e[15]||(e[15]=E=>t.$emit("generate-reply-failed")),onAiActionStarted:e[16]||(e[16]=E=>t.$emit("ai-action-started",E))},null,8,["editor","ticket-id","editor-type","ai-loading","disabled"])):i.editor&&!s.aiFeatureAvailable?(S(),re(o,{key:1,info:s.aiUpgradeTooltip,icon:"custom-ai","icon-class":"h-5 w-5",disabled:!0,"show-tooltip-when-disabled":!0,onMousedown:e[17]||(e[17]=ct(()=>{},["prevent"])),onClick:e[18]||(e[18]=ct(()=>{},["prevent"]))},null,8,["info"])):P("",!0)],64)):P("",!0)],2),X(Ii,{name:"fade-down"},{default:Y(()=>[i.docsSearch?(S(),C("div",Q7,[x("div",Z7,[x("div",{class:"hidden md:flex absolute h-full w-10 justify-center left-0 top-0 ml-4 rounded-l z-10 text-gray-600",innerHTML:t.svg("feather-search","flex self-center stroke-icon h-4")},null,8,eK),X(h,{class:"w-full m-2 h-10","field-class":n.dark?"bg-white flex-grow w-full h-full text-sm px-4 md:pl-10 rounded-lg":"bg-gray-200 flex-grow w-full h-full text-sm px-4 md:pl-10 rounded-lg",slim:!0,placeholder:t.$trans.get("Search for articles in all docs sites..."),"loader-color":"primary-500","loader-class":"mr-10 mt-3","loader-size":"4",context:"ticket","initial-focus":!0,onEsc:e[19]||(e[19]=E=>i.docsSearch=!1),onOptionClicked:e[20]||(e[20]=E=>s.searchArticleOptionClicked(E,t.commands))},null,8,["field-class","placeholder"]),x("button",{type:"button",class:"absolute top-0 right-0 mt-3 mr-7 text-gray-800 hover:text-primary-500 cursor-pointer",onClick:e[21]||(e[21]=ct(E=>i.docsSearch=!1,["prevent"])),innerHTML:t.svg("feather-x","stroke-icon h-4")},null,8,tK)])])):P("",!0)],void 0,!0),_:1})]),s.aiProcessing&&s.aiLoadingLabel?(S(),C("div",nK,L(s.aiLoadingLabel),
1461)):P("",!0)],2),Tt(t.$slots,"below-toolbar"),x("div",{class:K({"pointer-events-none select-none":s.aiProcessing})},[X(g,{ref:"editor",editor:i.editor,class:"spm-editor-textarea notranslate"},null,8,["editor"])],2)])):P("",!0),Ye(x("div",rK,[s.hasResults?(S(!0),C(Fe,{key:0},nt(i.filteredUsers,(E,w)=>(S(),C("div",{key:E.id,class:K([{"is-selected":i.navigatedUserIndex===w},"suggestion-list__item"]),onClick:M=>t.selectUser(E)},L(E.name),11,iK))),128)):(S(),C("div",sK,"No users found"))],512),[[wt,s.showSuggestions]]),x("div",{class:K({"border-b-2 rounded-b":!n.footer})},[X(m,{name:i.uploaderId},null,8,["name"])],2),n.footer?Tt(t.$slots,"footer-wrapper",{},()=>[x("div",{class:K(["spm-editor-footer",{"pointer-events-none":s.aiProcessing}])},[Tt(t.$slots,"footer",{attachmentsUploadState:s.attachmentsUploadState,attachmentsSize:s.attachmentsSize})],2)],void 0,1):P("",!0),n.showCannedResponses?(S(),re(T,{key:2,open:i.quickRepliesModalOpen,"wrapper-class":"justify-center",onClose:s.closeQuickRepliesModal},{default:Y(()=>[x("div",oK,[i.editor&&i.quickRepliesModalOpen?(S(),re(b,{key:0,"draft-id":n.draftId,editor:i.editor,onClose:s.closeQuickRepliesModal},null,8,["draft-id","editor","onClose"])):P("",!0)])],void 0,!0),_:1},8,["open","onClose"])):P("",!0)],10,W7)],2)}const lK=Ae(z7,[["render",aK]]),cK={components:{"spm-editor":lK},props:{dark:{type:Boolean,default:!1},draftId:{type:Number,default:0},uploadUrl:{type:String,default:""},uploadInlineUrl:{type:String,default:""},files:{type:Array,default:()=>[]},html:{type:String,default:""},autoFocus:{type:Boolean,default:!1},quickReply:{type:Boolean,default:!1},mentionList:{type:Array,default:()=>[]},editable:{type:Boolean,default:!0},showAiToolbar:{type:Boolean,default:!1},ticketId:{type:Number,default:null},editorType:{type:String,default:null},aiLoading:{type:Boolean,default:!1},aiLoadingAction:{type:String,default:null}},data(){return{newHTML:this.html,id:!1}},methods:{focus(){var t,e;(e=(t=this.$refs.editor)==null?void 0:t.editor)==null||e.chain().focus().run()},getCursorPosition(){var t,e;return((e=(t=this.$refs.editor)==null?void 0:t.editor)==null?void 0:e.state.selection.$anchor.pos)??0},update(t){this.newHTML=t,this.saveDraft(),this.$emit("update",t)},saveDraft(){this.$emit("saveDraft",this.newHTML)},submit(){this.$emit("submit",this.newHTML)}}},uK={class:"relative inline-flex ml-auto"},dK=["disabled"],fK=["disabled","innerHTML"];function hK(t,e,n,r,i,s){const o=z("spm-editor");return S(),C("div",null,[X(o,{ref:"editor",dark:n.dark,"show-canned-responses":!0,html:n.html,"draft-id":n.draftId,"upload-url":n.uploadUrl,"upload-inline-url":n.uploadInlineUrl,files:n.files,"quick-reply":n.quickReply,"auto-focus":n.autoFocus,"mention-list":n.mentionList,editable:n.editable,"show-ai-toolbar":n.showAiToolbar,"ticket-id":n.ticketId,"editor-type":n.editorType,"ai-loading":n.aiLoading,"ai-loading-action":n.aiLoadingAction,onUpdate:s.update,onGenerateReply:e[1]||(e[1]=a=>t.$emit("generate-reply")),onGenerateReplyFailed:e[2]||(e[2]=a=>t.$emit("generate-reply-failed")),onAiLoading:e[3]||(e[3]=a=>t.$emit("ai-loading",a)),onAiActionStarted:e[4]||(e[4]=a=>t.$emit("ai-action-started",a))},{"below-toolbar":Y(()=>[Tt(t.$slots,"below-toolbar")]),footer:Y(({attachmentsUploadState:a,attachmentsSize:l})=>[Tt(t.$slots,"footer-info"),x("div",uK,[Tt(t.$slots,"footer-buttons",{submithtml:s.submit,attachmentsUploadState:a,attachmentsSize:l},()=>[x("button",{disabled:a=="uploading",class:"bg-primary-500 hover:bg-primary-600 text-white text-sm font-bold py-2 px-3 rounded-l",onClick:e[0]||(e[0]=(...c)=>s.submit&&s.submit(...c))},L(t.$t("editor.submit")),9,dK),x("button",{disabled:a=="uploading",type:"button",class:"bg-primary-500 hover:bg-primary-600 border-l border-primary-600 text-white py-2 px-1 rounded-r",innerHTML:t.svg("feather-chevron-down","stroke-icon h-4")},null,8,fK)])])]),_:3},8,["dark","html","draft-id","upload-url","upload-inline-url","files","quick-reply","auto-focus","mention-list","editable","show-ai-toolbar","ticket-id","editor-type","ai-loading","ai-loading-action","onUpdate"])])}const pK=Ae(cK,[["render",hK]]),mK={props:{value:{type:String,default:null},minLength:{type:Number,default:3},inputClass:{type:String,default:"w-full block italic font-normal font-app rounded-lg mr-2 bg-gray-200"},tagClass:{type:String,default:""},errorClass:{type:String,default:"text-xs text-red-600 bold font-app mb-2"},tag:{type:String,default:"span"},errorMessage:{type:String,default:":number letters min."},placeholder:{type:String,default:"Type something ..."}},data(){return{valueLocal:this.value,edit:!1,error:!1}},watch:{value:function(){this.endEditMode(),this.valueLocal=this.value}},methods:{submitChangesThrottle:Jr(function(){this.submitChanges()},600),submitChanges(){if(this.value.trim()==this.valueLocal.trim()){this.endEditMode();return}this.valueLocal.length>=this.minLength?(this.$emit("input",this.valueLocal.trim()),this.endEditMode()):this.error=this.errorMessage},endEditMode(){this.edit=!1,this.error=""},startEditMode(){this.edit=!0,this.error=""}}},gK=["value","placeholder"];function vK(t,e,n,r,i,s){const o=ha("focus");
146return S(),C("div",null,[i.edit?Ye((S(),C("input",{key:0,type:"text",class:K(n.inputClass),value:i.valueLocal,placeholder:t.$trans.get(n.placeholder),onBlur:e[0]||(e[0]=a=>{i.valueLocal=a.target.value,s.submitChangesThrottle()}),onKeyup:e[1]||(e[1]=Lt(a=>{i.valueLocal=a.target.value,s.submitChangesThrottle()},["enter"]))},null,42,gK)),[[o]]):(S(),re(kr(n.tag),{key:1,class:K("cursor-pointer"+n.tagClass),onClick:e[2]||(e[2]=a=>s.startEditMode())},{default:Y(()=>[Me(L(i.valueLocal),1)],void 0,!0),_:1},8,["class"])),Ye(x("div",{class:K(n.errorClass)},L(t.$trans.get(i.error,{number:n.minLength})),3),[[wt,i.error]])])}const yK=Ae(mK,[["render",vK]]),bK={components:{SpmTag:va,SpmCopyToClipboard:jw,SpmClickToChange:yK,SpmTooltip:rr},props:{ticket:{type:Object,required:!0}},methods:{updateTicketSubject(t,e){let n={subject:t};ze.patch(`/tickets/${e.id}/update-subject`,n).then(r=>{this.$notify.success(this.$trans.get("Ticket updated")),this.$store.dispatch("cacheTicket",r.data.data)}).catch(()=>{this.$notify.error(this.$trans.get("Oops! We could not update the subject."),4e3)}).finally(()=>{})},loadRemoteImages(){ze.patch("/tickets/"+this.$route.params.id,{load_remote_images:!0}).then(t=>{this.$store.dispatch("cacheTicket",t.data.data)})}}},kK={key:0,class:"font-semibold text-xs text-red-900 bg-red-300 rounded-lg p-3 mb-4"},wK={class:"font-normal"},xK={id:"spm-ticket-subject",class:"flex mt-2 mb-1"},SK={key:2,class:"w-full self-center font-display text-base font-bold text-gray-700 mr-2"},TK={class:"flex"},_K={class:"flex-auto min-w-64"},EK={class:"inline-flex"},CK={key:0,class:"inline-flex items-center text-xs text-gray-700"},OK=["innerHTML"],AK={class:"inline-flex content-center"},MK={class:"spm-absolute-date text-xs text-gray-600 font-medium button-tooltip py-1"},IK={class:"flex-auto"},LK={class:"flex flex-wrap mt-4 md:mt-0 md:justify-end"},PK={key:1,class:"w-full my-2 bg-red-200 flex flex-col p-6 box-style mt-6"},RK={class:"font-bold text-red-600 text-lg"},$K={class:"font-normal text-sm text-red-600"},DK=["innerHTML"],NK={class:"spm-ticket-message text-red-600 pt-4 text-base"},FK=["innerHTML"];function jK(t,e,n,r,i,s){const o=z("spm-tooltip"),a=z("spm-click-to-change"),l=z("spm-copy-to-clipboard"),c=z("spm-tag");return S(),C("div",null,[n.ticket.id&&n.ticket.will_probably_delete_at?(S(),C("div",kK,[Me(L(t.$trans.choice("This ticket will be permanently deleted :distanceInWordsToNow.",null,{distanceInWordsToNow:t.$filters.distanceInWordsToNow(n.ticket.will_probably_delete_at)}))+" ",1),x("span",wK,L(t.$trans.choice("Only admins can access the trash bin.")),1)])):P("",!0),x("div",xK,[n.ticket.new_messages_count>1?(S(),re(o,{key:0,tooltip:`There are ${n.ticket.new_messages_count} new messages`,tag:"div",class:"flex self-center text-sm font-semibold text-gray-700 rounded-lg bg-gray-500 py-px px-2 mr-1"},{default:Y(()=>[Me(L(n.ticket.new_messages_count),1)],void 0,!0),_:1},8,["tooltip"])):P("",!0),t.$store.getters.section!="trash"?(S(),re(a,{key:1,class:"w-full self-center font-display text-base font-bold text-gray-700 mr-2","input-class":"w-full text-base font-display italic bg-gray-100",placeholder:t.$trans.get("Type a subject"),value:n.ticket.subject,onInput:e[0]||(e[0]=u=>s.updateTicketSubject(u,n.ticket))},null,8,["placeholder","value"])):(S(),C("div",SK,L(n.ticket.subject),1)),n.ticket.id?(S(),re(l,{key:3,class:"ml-auto text-sm text-gray-700 font-medium",tooltip:t.$trans.get("Click to copy Ticket-Id"),tag:"div",value:"#"+n.ticket.id,"flash-message":t.$trans.get("Ticket-Id copied to clipboard!")},{default:Y(()=>[Me("#"+L(n.ticket.id),1)],void 0,!0),_:1},8,["tooltip","value","flash-message"])):P("",!0)]),x("div",TK,[x("div",_K,[x("div",EK,[n.ticket.status?(S(),C("span",{key:0,class:K(["text-xs font-bold px-2 py-1 rounded-lg mr-2","status-bg-"+n.ticket.status])},L(t.$trans.get(n.ticket.status)),3)):P("",!0)]),n.ticket.wait_until?(S(),C("span",CK,[X(o,{class:"spm-relative-date text-xs text-gray-700 font-medium button-tooltip py-1",delay:[300,0],tooltip:t.$filters.datetime(n.ticket.wait_until)},{default:Y(()=>[Me(L(t.$filters.distanceInWordsToNow(n.ticket.wait_until)),1)],void 0,!0),_:1},8,["tooltip"]),x("span",{class:"h-3",innerHTML:t.svg("feather-arrow-right","stroke-icon h-3 w-3 mx-1 text-gray-800")},null,8,OK),x("span",{class:K(["text-xs font-bold px-2 py-1 rounded-lg mr-2 opacity-75","status-bg-"+n.ticket.next_status])},L(t.$trans.get(n.ticket.next_status)),3)])):P("",!0),x("div",AK,[n.ticket.created_at?(S(),re(o,{key:0,class:"spm-relative-date text-xs text-gray-600 font-medium button-tooltip py-1",delay:[300,0],tooltip:t.$filters.datetime(n.ticket.created_at)},{default:Y(()=>[Me(L(t.$trans.choice("Ticket was opened :distanceInWordsToNow",null,{distanceInWordsToNow:t.$filters.distanceInWordsToNow(n.ticket.created_at)})),1)],void 0,!0),_:1},8,["tooltip"])):P("",!0),x("span",MK,L(t.$trans.choice("Ticket was opened :distanceInWordsToNow",null,{distanceInWordsToNow:t.$filters.datetime(n.ticket.created_at)})),1)])]),x("div",IK,[x("div",LK,[(S(!0),C(Fe,null,nt(n.ticket.tags,u=>(S(),re(c,{key:u.id,tag:u,class:"mb-2",dir:"rtl"},null,8,["tag"]))),128))])])]),typeof n.ticket.contact=="object"&&n.ticket.contact.spam_complaint?(S(),C("div",PK,[x("div",RK,[Me(L(t.$trans.get("Spam Complaint"))+" ",1),x("span",$K,L(t.$filters.distanceInWordsToNow(n.ticket.contact.spam_complaint)),1)]),x("div",{class:"text-sm text-red-600 pt-1",innerHTML:t.$trans.get("The ticket contact has submitted a spam complaint.")},null,8,DK),x("div",NK,[x("p",{innerHTML:t.$trans.choice("In order to respect the contact`s complaint, no more messages are sent to :value.",null,{value:`<b>${n.ticket.contact.value}</b>`})},null,8,FK)])])):P("",!0)])}const BK=Ae(bK,[["render",jK]]),HK={components:{SpmDropdown:Gn,SpmSelectableListSimple:Dw},props:{message:{type:Object,default:()=>{}},ticket:{type:Object,default:()=>{}},disabled:{type:Boolean,default:!1}},data(){return{action:""}},computed:{possibleActions(){let t=[{value:"reply-to",name:this.$trans.get("Reply to :name",{name:"
146<i><b>"+this.message.from.name+"</b></i>"})},{value:"forward-message",name:this.draft?this.$trans.get("Add message text to draft"):this.$trans.get("Forward Message")},{value:"show-raw",name:this.$trans.get("Show Raw Message")}];return this.ticket.messages.filter(n=>n.type=="external").length>1&&t.push({value:"split-message",name:this.$trans.get("Split into new Ticket")}),t},draft(){return this.$store.getters.draft}},methods:{openDropdown(){this.init(),this.focusFirstOption()},actionSelected(t){this.doOnSelect(t),this.$refs.dropdown.hide()},doOnSelect(t){switch(t){case"show-raw":this.showRawMessage();break;case"forward-message":this.$emit("forward");break;case"reply-to":this.$emit("reply");break;case"split-message":this.splitMessage();break}},showRawMessage(){this.$store.commit("showFormModal",{component:"tickets/modals/_show-raw-message.modal.vue",params:{ticket:this.ticket,message:this.message}})},splitMessage(){this.$store.commit("showFormModal",{component:"tickets/modals/_split-message.modal.vue",params:{ticket:this.ticket,message:this.message}})},focusFirstOption(){this.$nextTick(()=>{})},init(){this.action=""}}};function UK(t,e,n,r,i,s){const o=z("spm-selectable-list-simple"),a=z("spm-dropdown");return S(),re(a,{ref:"dropdown","use-popper":!0,disabled:n.disabled,distance:"1px",placement:"bottom-end",class:"h-auto",onOpen:e[1]||(e[1]=l=>s.openDropdown())},{trigger:Y(()=>[Tt(t.$slots,"default")]),dropdown:Y(()=>[X(o,{ref:"actions",modelValue:i.action,"onUpdate:modelValue":[e[0]||(e[0]=l=>i.action=l),s.actionSelected],name:"action",options:s.possibleActions,"option-key":"value","option-value":"name"},null,8,["modelValue","options","onUpdate:modelValue"])]),_:3},8,["disabled"])}const VK=Ae(HK,[["render",UK]]),zK={props:{fromIsAgent:{type:Boolean,required:!0,default:()=>null},fromId:{type:[String,Number],required:!0,default:()=>null},contactUserId:{type:[String,Number],required:!0,default:()=>null},messageType:{type:String,required:!0,default:()=>null},deliveredAt:{type:String,required:!1,default:()=>null},openedAt:{type:String,required:!1,default:()=>null},spamAt:{type:String,required:!1,default:()=>null},bouncedAt:{type:String,required:!1,default:()=>null},svg:{type:Function,required:!1,default:()=>null}}},WK={key:0,class:"text-right -mr-4 -mb-4"},KK=["title","innerHTML"],qK=["title","innerHTML"],GK=["title","innerHTML"];function YK(t,e,n,r,i,s){return n.fromIsAgent&&n.fromId!==n.contactUserId?(S(),C("div",WK,[x("div",null,[!n.spamAt&&!n.bouncedAt?(S(),C("span",{key:0,class:K(["text-gray-200",{"text-teal-400":n.deliveredAt}]),title:n.deliveredAt?"Delivered at: "+n.deliveredAt:"",innerHTML:n.svg("feather-check","stroke-icon h-4")},null,10,KK)):P("",!0),!n.spamAt&&!n.bouncedAt?(S(),C("span",{key:1,class:K(["text-gray-200",{"text-teal-400":n.openedAt}]),style:{"margin-left":"-12px"},title:n.openedAt?"Opened at: "+n.openedAt:"",innerHTML:n.svg("feather-check","stroke-icon h-4")},null,10,qK)):P("",!0),n.spamAt||n.bouncedAt?(S(),C("span",{key:2,class:"text-red-500",title:n.bouncedAt?"Bounced at: "+n.bouncedAt:"",innerHTML:n.svg("feather-alert-circle","stroke-icon h-4 stroke-[3px]")},null,8,GK)):P("",!0)])])):P("",!0)}const XK=Ae(zK,[["render",YK]]),rd=new WeakMap;function KS(t,{tooltip:e,title:n}){e.destroy(),n!==null&&t.setAttribute("title",n)}function Yb(t,e){const n=rd.get(t)||new Map;rd.set(t,n);const r=new Set([...t.querySelectorAll("a[href]")].filter(i=>i.getAttribute("href").trim()));n.forEach((i,s)=>{r.has(s)||(KS(s,i),n.delete(s))}),r.forEach(i=>{const s=n.get(i);if(s){s.tooltip.props.content!==i.href&&s.tooltip.setContent(i.href);return}const o=i.getAttribute("title");i.removeAttribute("title");const a=e.instance.$tippy(i,{content:i.href,placement:"bottom",allowHTML:!1,ignoreAttributes:!0,appendTo:()=>document.body,onCreate(l){l.popper.classList.add("spm-message-link-tooltip")}});n.set(i,{tooltip:a,title:o})})}const JK={directives:{messageLinkTooltips:{mounted:Yb,updated:Yb,beforeUnmount(t){var e;(e=rd.get(t))==null||e.forEach((n,r)=>KS(r,n)),rd.delete(t)}}},components:{Attachments:WS,SpmDropdown:Gn,SpmButton:tc,SpmDropformMessageMenu:VK,SpmTooltip:rr,SpmMessageStatus:XK,SpmLoader:xn},props:{ticket:{type:Object,required:!0},hideEvents:{type:Boolean,default:!1},onWhiteBg:{type:Boolean,default:!1},newMessageAlertIds:{type:Array,default:()=>[]}},data(){return{olderMessagesObserver:null}},computed:{firstExternalMessage(){return this.ticket.messages.filter(t=>["external","forward"].includes(t.type)).pop()},hasMoreMessages(){return!!(this.ticket&&this.ticket.messages_meta&&this.ticket.messages_meta.has_more)},isLoadingOlderMessages(){return!!(this.ticket&&this.ticket._loading_older_messages)}},watch:{hasMoreMessages:{immediate:!1,handler(){this.$nextTick(()=>this.observeOlderMessagesSentinel())}},"ticket.id":{immediate:!1,handler(){this.$nextTick(()=>this.observeOlderMessagesSentinel())}}},mounted(){this.$nextTick(()=>{this.observeOlderMessagesSentinel()})},beforeUnmount(){this.disconnectOlderMessagesObserver()}
146,updated(){this.$nextTick(function(){[...document.links].forEach(t=>{t.hostname!=window.location.hostname&&t.rel!="noopener noreferrer nofollow"&&(t.target="_blank",t.rel="noopener")})})},methods:{loadOlderMessages(){!this.hasMoreMessages||this.isLoadingOlderMessages||this.$store.dispatch("loadOlderMessages",{id:this.ticket.id})},observeOlderMessagesSentinel(){if(this.disconnectOlderMessagesObserver(),!this.hasMoreMessages||typeof IntersectionObserver>"u")return;const t=this.$refs.olderMessagesSentinel;t&&(this.olderMessagesObserver=new IntersectionObserver(e=>{e.forEach(n=>{n.isIntersecting&&this.loadOlderMessages()})},{root:null,rootMargin:"400px 0px",threshold:0}),this.olderMessagesObserver.observe(t))},disconnectOlderMessagesObserver(){this.olderMessagesObserver&&(this.olderMessagesObserver.disconnect(),this.olderMessagesObserver=null)},loadBlockQuotes(t){ze.get("/tickets/"+this.ticket.id+"/messages/"+t.id+"/blockquotes").then(e=>{this.$store.dispatch("setTicketMessageBody",{ticket_id:this.ticket.id,message_id:t.id,body:e.data.data.body})})},imagePreviews(t){var n;const e=(n=this.$refs.messages)==null?void 0:n.querySelector(`[id="ticket-message-id-${t.id}"]`);return zS(t.attachments||[],(e==null?void 0:e.querySelectorAll(".spm-ticket-message img"))||[])},openImage(t){var o,a;const e=(a=(o=t.target).closest)==null?void 0:a.call(o,".spm-ticket-message img");if(!e)return;const n=e.closest('[id^="ticket-message-id-"]'),r=this.ticket.messages.find(l=>(n==null?void 0:n.id)===`ticket-message-id-${l.id}`);if(!r)return;const i=this.imagePreviews(r),s=MW(i,e.src);s&&(t.preventDefault(),this.$store.commit("showPreviewModal",{...s,list:i}))},hasAttachments(t){return!!(typeof t.attachments<"u"&&t.attachments.length)},checkRemoteImages(t){let e=/(\<img.+)(data-src=)/gim;return this.ticket.load_remote_images||!this.ticket.has_remote_images?t.replace(e,"$1src="):t},changeTicketContact(){this.$store.commit("showFormModal",{component:"tickets/modals/_change-ticket-contact.modal.vue",params:this.ticket})},showRawMessage(t){this.$store.commit("showFormModal",{component:"tickets/modals/_show-raw-message.modal.vue",params:{ticket:this.ticket,message:t}})},deletePendingMessage(t){ze.delete("/tickets/"+this.ticket.id+"/messages/"+t.id).then(e=>{this.$store.dispatch("setTicket",e.data.data)})},deleteInternalMessage(t){ze.delete("/tickets/"+this.ticket.id+"/messages/"+t.id).then(e=>{this.$store.dispatch("setTicket",e.data.data)})}}},QK=["id"],ZK={class:"message-wrap"},e9={class:"message-from"},t9={class:"spm-absolute-date text-sm"},n9={key:0,class:"border-l-3 pl-2 text-gray-700 mb-1 text-sm"},r9={class:"font-semibold"},i9={class:"inline-block"},s9={key:1,class:"text-gray-200 text-xs"},o9={class:"text-green-500"},a9=["innerHTML"],l9={key:0,class:"relative flex w-fit bg-white -mt-4 ml-3 text-xs font-medium border rounded-xl px-2 p-2 pr-1"},c9={class:"inline-block text-base pr-1"},u9={key:0,class:"flex items-center bg-teal-100 rounded-lg px-2 py-2 -mt-2 mb-4 text-teal-600 font-medium text-xs"},d9=["innerHTML"],f9={key:0,class:"flex items-center bg-orange-200 rounded-lg px-2 py-2 -mt-2 mb-4 text-orange-700 font-medium text-xs"},h9=["innerHTML"],p9=["innerHTML"],m9=["onClick"],g9={class:"block"},v9={class:"flex text-gray-650 items-top"},y9={key:0,class:"flex w-full"},b9={key:0,class:"flex mr-4 flex-shrink-0"},k9=["src"],w9={class:"flex-grow"},x9={class:"flex text-gray-650 font-medium"},S9=["title"],T9=["title"],_9={class:"flex text-sm text-gray-600 mt-px"},E9={class:"spm-absolute-date text-sm"},C9={class:"flex text-gray-650 font-medium"},O9=["title"],A9=["title"],M9={class:"flex text-sm text-gray-600 mt-px pl-px"},I9=["innerHTML"],L9={class:"-ml-px"},P9={class:"spm-absolute-date"},R9={key:2,class:"flex flex-wrap text-xs text-gray-650 mt-1"},$9={class:"pr-1 font-medium"},D9={key:3,class:"flex flex-wrap text-xs text-gray-650 mt-1"},N9={key:4,class:"flex flex-wrap text-xs text-gray-650 mt-1"},F9={key:1,class:"flex w-full h-6 mb-2"},j9={key:0,class:"flex mr-2 flex-shrink-0 self-center"},B9=["src"],H9={class:"flex-grow flex flex-wrap self-center"},U9={class:"flex text-gray-700 w-full text-sm font-medium self-center"},V9=["title"],z9=["title"],W9={class:"flex text-xs text-orange-600 self-center"},K9={class:"spm-absolute-date"},q9=["innerHTML"],G9=["onClick"],Y9={class:"block"},X9={class:"flex justify-end"},J9={class:"border-b p-1 text-xs font-bold text-gray-500"},Q9=["href","innerHTML"],Z9=["innerHTML"],eq={class:"inline-block flex-grow px-2"},tq=["innerHTML"],nq=["onClick"],rq={class:"inline-block h-4"},iq={key:3,class:"mt-5 text-xs font-medium text-gray-600 opacity-75"},sq=["innerHTML"],oq={class:"inline-block h-4"},aq={key:4,class:"border-b mt-8 p-1 text-xs font-bold text-gray-500"},lq=["href","innerHTML"],cq={key:2,class:"w-full pb-1"},uq={class:"flex flex-row-reverse text-gray-700 items-center"},dq={class:"flex-grow px-2 text-center text-gray-700 text-xs rounded-lg leading-normal break-all"},fq={class:"font-medium"},hq={key:0,class:"spm-relative-date font-normal"},pq={class:"w-full"},mq={key:0,class:"flex w-full m-4 justify-end"},gq={class:"flex flex-row-reverse w-3/4 pr-10 text-gray-650 items-center"},vq={key:0,class:"w-auto mx-4"},yq=["src"],bq={class:"ticket-internal-message-me p-4 box-style text-sm text-gray-700 leading-normal rounded-lg"},kq={class:"text-left font-medium text-gray-650"},wq=["title"],xq=["title"],Sq=["innerHTML"],Tq={class:"box-style box-style-ai text-primary-800 items-center"},_q={class:"relative text-gray-900 text-sm leading-snug break-words overflow-x-auto p-5"},Eq=["innerHTML"],Cq={xmlns:"http://www.w3.org/2000/svg",id:"ai-icon","data-name":"Layer 1",viewBox:"0 0 128 128",style:{width:"22px",position:"absolute",bottom:"6px",right:"6px"}},Oq={class:"flex flex-row-reverse text-gray-700 items-center"},Aq={class:"flex-grow px-2 text-center text-gray-700 text-xs rounded-lg leading-normal break-all"},Mq=["innerHTML"],Iq=["innerHTML"],Lq=["title"],Pq={class:"spm-absolute-date font-normal text-gray-600"},Rq={key:2,class:"font-medium"},$q={key:5,class:"w-full pb-1"},Dq={class:"items-center"},Nq={class:"px-2 text-center text-xs rounded-lg leading-normal break-all"},Fq=["onClick"],jq=["innerHTML"],Bq=["innerHTML"],Hq=["title"],Uq={class:"spm-absolute-date font-normal text-orange-500"},Vq={key:6,class:"w-full pb-1"},zq={class:"items-center"},Wq={class:"px-2 text-center text-xs rounded-lg leading-normal break-all"},Kq=["innerHTML"],qq=["innerHTML"],Gq=["title"],Yq={class:"spm-absolute-date font-normal text-gray-700"},Xq={key:7,class:"w-full my-2 bg-red-100 flex flex-col p-6 box-style mb-2 border-l-2 border-red-600"},Jq={class:"font-bold text-red-600 text-lg"},Qq=["title"],Zq={class:"spm-absolute-date font-normal text-sm text-red-500"},eG={class:"spm-ticket-message text-red-600"},tG=["innerHTML"],nG={class:"pl-4 py-2 border-l-2 border-red-500"},rG={key:0,class:"pt-4"},iG={key:0,ref:"olderMessagesSentinel",class:"flex items-center justify-center py-4 text-xs text-gray-600"};function sG(t,e,n,r,i,s){const o=z("spm-tooltip"),a=z("attachments"),l=z("spm-message-status"),c=z("spm-dropdown"),u=z("spm-button"),d=z("spm-dropform-message-menu"),f=z("spm-loader"),p=ha("message-link-tooltips");return n.ticket.messages?(S(),C("div",{key:0,ref:"messages",onClick:e[2]||(e[2]=(...h)=>s.openImage&&s.openImage(...h))},[(S(!0),C(Fe,null,nt(n.ticket.messages,(h,g)=>{var m,b,T,E,w,M,A,I,j,$,J,se,Q,G,ee,ge,ae,ke,Le,Ue,Ze,Je,Xe,We,rt,je,Te,q,pe,ce,be,He,at,Ce,Oe,lt,yt,ht,R,F,ie,fe;return S(),C("div",{id:"ticket-message-id-"+h.id,key:h.id,class:"flex-wrap",style:{display:"grid"}},[n.ticket.is_social&&["internal","external"].includes(h.type)?(S(),C("div",{key:0,class:K(["spm-social-message-box grid",{"message-agent":h.from&&h.from.is_agent&&h.from.user_id!=n.ticket.contact.user_id&&h.type=="external","message-customer":h.from.is_customer&&h.t
146ype=="external","message-note":h.type=="internal"}])},[x("div",ZK,[x("div",e9,[Me(L(h.from.name)+" ",1),h.created_at?(S(),re(o,{key:0,tooltip:t.$filters.datetime(h.created_at),placement:"top",class:"spm-relative-date font-normal text-gray-600 text-xs pl-1 pr-0",delay:[300,0]},{default:Y(()=>[Me(L(t.$filters.distanceInWordsToNow(h.created_at)),1)],void 0,!0),_:2},1032,["tooltip"])):P("",!0),x("span",t9,L(t.$filters.datetime(h.created_at)),1)]),(m=h.parent_message)!=null&&m.excerpt?(S(),C("div",n9,[x("span",r9,L((b=h.parent_message)==null?void 0:b.from.name),1),e[3]||(e[3]=x("br",null,null,-1)),x("span",i9,L((T=h.parent_message)==null?void 0:T.excerpt),1)])):P("",!0),(E=h==null?void 0:h.event_json)!=null&&E.message_changed?(S(),C("div",s9,[x("span",o9,L(t.$trans.choice("Message has been edited :num times",(M=(w=h==null?void 0:h.event_json)==null?void 0:w.message_changed)==null?void 0:M.num_edit,{num:((I=(A=h==null?void 0:h.event_json)==null?void 0:A.message_changed)==null?void 0:I.num_edit)??1})),1)])):P("",!0),Ye(x("div",{innerHTML:h.body},null,8,a9),[[p]]),X(a,{files:h.attachments,"image-preview-list":()=>s.imagePreviews(h),"class-attachment":"mr-2"},null,8,["files","image-preview-list"]),h&&n.ticket?(S(),re(l,{key:2,svg:t.svg,"delivered-at":h==null?void 0:h.delivered_at,"opened-at":h==null?void 0:h.opened_at,"spam-at":h==null?void 0:h.spam_at,"bounced-at":h==null?void 0:h.bounced_at,"from-is-agent":(h==null?void 0:h.from)&&(h==null?void 0:h.from.is_agent),"from-id":(j=h==null?void 0:h.from)==null?void 0:j.id,"contact-user-id":(J=($=n.ticket)==null?void 0:$.contact)==null?void 0:J.user_id,"message-type":h==null?void 0:h.type,class:"p-1"},null,8,["svg","delivered-at","opened-at","spam-at","bounced-at","from-is-agent","from-id","contact-user-id","message-type"])):P("",!0)]),(se=h.event_json)!=null&&se.reactions?(S(),C("div",l9,[(S(!0),C(Fe,null,nt(h.event_json.reactions,(Ve,B)=>(S(),C("div",{key:B,class:"items-left"},[x("span",c9,L(Ve.text),1),X(o,{class:"inline-block text-xs pr-3 pb-px",tag:"span",tooltip:t.$filters.datetime(Ve.at),placement:"top",delay:[300,0],innerHTML:Ve.user_name},null,8,["tooltip","innerHTML"])]))),128))])):P("",!0)],2)):P("",!0),["external","widget","internal","forward"].includes(h.type)&&!n.ticket.is_social?(S(),C("div",{key:1,class:K(["relative p-6 box-style my-2 group",{"border-l-2":["internal","forward"].includes(h.type),"border-l-2 border-primary-600":h.from&&h.from.is_agent&&h.from.user_id!=n.ticket.contact.user_id,"bg-gray-100 ":n.onWhiteBg,"!border-orange-500 bg-orange-50 px-5 py-4":h.type=="internal","!border-blue-600 px-5":h.type=="forward"}])},[X(Ii,{name:"fade-down"},{default:Y(()=>[n.newMessageAlertIds.includes(h.id)?(S(),C("div",u9,[x("i",{class:"mr-1",innerHTML:t.svg("feather-bell","stroke-icon h-4")},null,8,d9),Me(" "+L(t.$trans.get("This message just arrived!")),1)])):P("",!0)],void 0,!0),_:2},1024),h.send_at&&!h.delivered_at?(S(),C("div",f9,[x("i",{innerHTML:t.svg("feather-clock","stroke-icon h-4")},null,8,h9),X(o,{class:"pl-1",tooltip:t.$filters.datetime(h.send_at),placement:"top",delay:[300,0],innerHTML:t.$trans.get("This message is scheduled to be sent :distanceInWordsToNow",{distanceInWordsToNow:"<b>"+t.$filters.distanceInWordsToNow(h.send_at)+"</b>"})},null,8,["tooltip","innerHTML"]),X(c,{small:!0,class:"ml-auto","dropdown-class":"max-w-8",placement:"bottom-end","hide-after-dropdown-click":""},{trigger:Y(()=>[x("button",{innerHTML:t.svg("feather-more-vertical","stroke-icon h-4")},null,8,p9)]),dropdown:Y(()=>[x("ul",{ref_for:!0,ref:"options",class:"spm-list"},[x("li",{onClick:Ve=>s.deletePendingMessage(h)},[x("button",g9,L(t.$trans.get("Delete Message")),1)],8,m9)],512)]),_:2},1024)])):P("",!0),x("div",v9,[["external","widget","forward"].includes(h.type)?(S(),C("div",y9,[(Q=h.from)!=null&&Q.avatar?(S(),C("div",b9,[x("img",{src:h.from.avatar,class:"avatar rounded-lg h-9 w-9"},null,8,k9)])):P("",!0),x("div",w9,[["external","widget"].includes(h.type)?(S(),C(Fe,{key:0},[x("div",x9,[(G=h.from)!=null&&G.value?(S(),C("span",{key:0,title:h.from.value},L(h.from.name),9,S9)):(S(),C("span",{key:1,title:t.$trans.get("This contact has been deleted permanently!")},L(t.$trans.get("Deleted contact")),9,T9))]),x("div",_9,[h==s.firstExternalMessage?(S(),C(Fe,{key:0},[Me(L(h.type=="widget"?t.$trans.get("Created with Widget"):t.$trans.get("Created")),1)],64)):(S(),C(Fe,{key:1},[Me(L(t.$trans.get("Replied")),1)],64)),h.created_at?(S(),re(o,{key:2,tooltip:t.$filters.datetime(h.created_at),placement:"top",class:"spm-relative-date",delay:[300,0]},{default:Y(()=>[Me(" Â "+L(t.$filters.distanceInWordsToNow(h.created_at)),1)],void 0,!0),_:2},1032,["tooltip"])):P("",!0),x("span",E9,"Â "+L(t.$filters.datetime(h.created_at)),1)])],64)):P("",!0),h.type=="forward"?(S(),C(Fe,{key:1},[x("div",C9,[(ee=h.from)!=null&&ee.value?(S(),C("span",{key:0,title:h.from.value},L(h.from.name),9,O9)):(S(),C("span",{key:1,title:t.$trans.get("This contact has been deleted permanently!")},L(t.$trans.get("Deleted contact")),9,A9))]),x("div",M9,[x("span",{class:"text-gray-600 -ml-2 pl-px pt-px mt-px",innerHTML:t.svg("feather-corner-up-right","h-3 stroke-icon ")}
146,null,8,I9),x("span",L9,L(t.$trans.get("Forwarded")),1),h.created_at?(S(),re(o,{key:0,tooltip:t.$filters.datetime(h.created_at),placement:"top",class:"spm-relative-date",delay:[300,0]},{default:Y(()=>[Me(" Â "+L(t.$filters.distanceInWordsToNow(h.created_at)),1)],void 0,!0),_:2},1032,["tooltip"])):P("",!0),x("span",P9,"Â "+L(t.$filters.datetime(h.created_at)),1)])],64)):P("",!0),h.to&&h.to.length?(S(),C("div",R9,[x("span",$9,L(t.$trans.get("To"))+":",1),(S(!0),C(Fe,null,nt(h.to,(Ve,B)=>(S(),C("span",{key:Ve,class:"pr-1"},L(Ve)+L(B+1!=h.to.length?", ":""),1))),128))])):P("",!0),h.cc&&h.cc.length?(S(),C("div",D9,[e[4]||(e[4]=x("span",{class:"pr-1 font-medium"},"Cc:",-1)),(S(!0),C(Fe,null,nt(h.cc,(Ve,B)=>(S(),C("span",{key:Ve,class:"pr-1"},L(Ve)+L(B+1!=h.cc.length?", ":""),1))),128))])):P("",!0),h.bcc&&h.bcc.length?(S(),C("div",N9,[e[5]||(e[5]=x("span",{class:"pr-1 font-medium"},"Bcc:",-1)),(S(!0),C(Fe,null,nt(h.bcc,(Ve,B)=>(S(),C("span",{key:Ve,class:"pr-1"},L(Ve)+L(B+1!=h.bcc.length?", ":""),1))),128))])):P("",!0)])])):P("",!0),h.type=="internal"?(S(),C("div",F9,[(ge=h.from)!=null&&ge.avatar?(S(),C("div",j9,[x("img",{src:h.from.avatar,class:"avatar rounded-lg h-6 w-6"},null,8,B9)])):P("",!0),x("div",H9,[x("div",U9,[(ae=h.from)!=null&&ae.value?(S(),C("span",{key:0,title:h.from.value},L(h.from.name),9,V9)):(S(),C("span",{key:1,title:t.$trans.get("This contact has been deleted permanently!")},L(t.$trans.get("Deleted contact")),9,z9))]),x("div",W9,[Me(L(t.$trans.get("Note created"))+" ",1),h.created_at?(S(),re(o,{key:0,tooltip:t.$filters.datetime(h.created_at),placement:"top",class:"spm-relative-date",delay:[300,0]},{default:Y(()=>[Me(" Â "+L(t.$filters.distanceInWordsToNow(h.created_at)),1)],void 0,!0),_:2},1032,["tooltip"])):P("",!0),x("span",K9," Â "+L(t.$filters.datetime(h.created_at)),1)])]),X(c,{small:!0,class:"ml-auto h-auto","dropdown-class":"max-w-8",placement:"bottom-end","hide-after-dropdown-click":""},{trigger:Y(()=>[x("button",{innerHTML:t.svg("feather-more-vertical","stroke-icon h-4")},null,8,q9)]),dropdown:Y(()=>[x("ul",{ref_for:!0,ref:"options",class:"spm-list"},[x("li",{onClick:Ve=>s.deleteInternalMessage(h)},[x("button",Y9,L(t.$trans.get("Delete")),1)],8,G9)],512)]),_:2},1024)])):P("",!0),x("div",X9,[s.hasAttachments(h)?(S(),re(c,{key:0,ref_for:!0,ref:"dropdown","use-popper":!0,distance:"1px",placement:"bottom-end",class:"h-auto","hide-after-dropdown-click":!0,"dropdown-class":"w-50"},{trigger:Y(()=>[X(u,{tooltip:t.$trans.choice(":num Attachments",h.attachments.length,{num:h.attachments.length}),"tooltip-placement":"top",class:"spm-action-item h-8 w-8 m-0",icon:"feather-paperclip"},null,8,["tooltip"])]),dropdown:Y(()=>[x("div",J9,[x("a",{href:"/tickets/"+t.$route.params.id+"/messages/"+h.id+"/attachments/download",class:"text-gray-500 hover:text-primary-500",title:"Download all",target:"_blank",innerHTML:t.svg("feather-download","stroke-icon h-4")},null,8,Q9),Me(" "+L(t.$trans.choice(":num Attachments",h.attachments.length,{num:h.attachments.length})),1)]),X(a,{files:h.attachments,"image-preview-list":()=>s.imagePreviews(h),"class-attachment":"mr-0 w-full"},null,8,["files","image-preview-list"])]),_:2},1536)):P("",!0),["external","forward"].includes(h.type)&&!n.ticket.deleted_at?(S(),re(d,{key:1,message:h,ticket:n.ticket,disabled:!1,class:"flex cursor-pointer",onForward:Ve=>t.$emit("forward",{message:h,ticket:n.ticket}),onReply:Ve=>t.$emit("reply",{message:h,ticket:n.ticket})},{default:Y(()=>[x("div",{class:"spm-action-item h-8 w-8 m-0 ml-1",innerHTML:t.svg("feather-more-vertical","stroke-icon h-4 ")},null,8,Z9)],void 0,!0),_:1},8,["message","ticket","onForward","onReply"])):P("",!0)])]),(ke=h.event_json)!=null&&ke.rating?(S(),C("div",{key:1,class:K(["relative flex mt-3 text-xs justify-center items-center font-medium border rounded-lg",[((Le=h.event_json)==null?void 0:Le.rating)==1?"border-green-200 bg-green-100 text-green-700":((Ue=h.event_json)==null?void 0:Ue.rating)==2?"border-gray-200 bg-gray-100 text-gray-700":((Ze=h.event_json)==null?void 0:Ze.rating)==3?"border-orange-200 bg-orange-100 text-orange-700":""]])},[x("span",{class:K(["inline-block h-full text-base rounded-l-lg px-2 p-2",((Je=h.event_json)==null?void 0:Je.rating)==1?"bg-green-150":((Xe=h.event_json)==null?void 0:Xe.rating)==2?"bg-gray-150":((We=h.event_json)==null?void 0:We.rating)==3?"bg-orange-150":""])},L(((rt=h.event_json)==null?void 0:rt.rating)==1?"ð":((je=h.event_json)==null?void 0:je.rating)==2?"ð":((Te=h.event_json)==null?void 0:Te.rating)==3?"ð":""),3),x("span",eq,L(((q=h.event_json)==null?void 0:q.comment)||t.$trans.get("No comment")),1)],2)):P("",!0),Ye(x("div",{ref_for:!0,ref:"messagebody",class:K(["spm-ticket-message relative text-gray-900 text-sm leading-normal break-words overflow-x-auto",[h.type=="internal"?"mt-2":"mt-6","spm-message-body-"+h.id]]),innerHTML:s.checkRemoteImages(h.body)},null,10,tq),[[p]]),["external"].includes(h.type)&&!h.raw_body_loaded&&((pe=h.event_json)!=null&&pe.has_removed_blockquotes)?(S(),C("a",{key:2,class:"mt-5 inline-block text-xs font-medium text-blue-700 opacity-75 curs
146or-pointer",onClick:Ve=>s.loadBlockQuotes(h)},[x("span",rq,L(t.$trans.get("Show More...")),1)],8,nq)):P("",!0),h.is_merged?(S(),C("div",iq,[x("span",{class:"inline-block h-4 align-text-bottom pr-px",innerHTML:t.svg("custom-merge","stroke-icon h-4")},null,8,sq),x("span",oq,L(t.$trans.get("This message was merged from another ticket.")),1)])):P("",!0),s.hasAttachments(h)?(S(),C("div",aq,[x("a",{href:"/tickets/"+t.$route.params.id+"/messages/"+h.id+"/attachments/download",class:"text-gray-500 hover:text-primary-500",title:"Download all",innerHTML:t.svg("feather-download","stroke-icon h-4")},null,8,lq),Me(" "+L(t.$trans.choice(":num Attachments",h.attachments.length,{num:h.attachments.length})),1)])):P("",!0),X(a,{files:h.attachments,"image-preview-list":()=>s.imagePreviews(h),"class-attachment":"mr-2"},null,8,["files","image-preview-list"]),h&&n.ticket?(S(),re(l,{key:5,svg:t.svg,"delivered-at":h==null?void 0:h.delivered_at,"opened-at":h==null?void 0:h.opened_at,"spam-at":h==null?void 0:h.spam_at,"bounced-at":h==null?void 0:h.bounced_at,"from-is-agent":(h==null?void 0:h.from)&&(h==null?void 0:h.from.is_agent),"from-id":(ce=h==null?void 0:h.from)==null?void 0:ce.id,"contact-user-id":(He=(be=n.ticket)==null?void 0:be.contact)==null?void 0:He.user_id,"message-type":h==null?void 0:h.type,class:"p-1"},null,8,["svg","delivered-at","opened-at","spam-at","bounced-at","from-is-agent","from-id","contact-user-id","message-type"])):P("",!0)],2)):P("",!0),h.type=="widget"?(S(),C("div",cq,[x("div",uq,[x("div",dq,[x("span",fq,L(t.$trans.get("Message sent via Widget on page:"))+"Â ",1),h.event_json?(S(),C("span",hq,L(h.event_json.url),1)):P("",!0)])])])):P("",!0),x("div",pq,[h.type=="chat"?(S(),C("div",mq,[x("div",gq,[(at=h.from)!=null&&at.avatar?(S(),C("div",vq,[x("img",{src:h.from.avatar,class:"avatar rounded-lg w-10"},null,8,yq)])):P("",!0),x("div",bq,[x("div",kq,[(Ce=h.from)!=null&&Ce.value?(S(),C("span",{key:0,title:h.from.value},L(h.from.name),9,wq)):(S(),C("span",{key:1,title:t.$trans.get("This contact has been deleted permanently!")},L(t.$trans.get("Deleted contact")),9,xq))]),Ye(x("div",{class:"border-0 flex-grow break-all",innerHTML:h.body},null,8,Sq),[[p]])])])])):P("",!0)]),h.type=="event"&&h.event_json&&((Oe=h.event_json)!=null&&Oe.ai_agent)&&((lt=h.event_json)==null?void 0:lt.ai_agent)=="tldr"?(S(),C("div",{key:3,class:K(["w-full pb-1",h.addClass])},[x("div",Tq,[x("div",_q,[x("span",{innerHTML:h.body},null,8,Eq),(S(),C("svg",Cq,[...e[6]||(e[6]=[x("path",{d:"M49.7,43.72l-12,37.44A1.39,1.39,0,0,0,39,83h3.36a1.39,1.39,0,0,0,1.33-1l1.88-6H62l-.23-.37L63.83,82a1.39,1.39,0,0,0,1.33,1h3.36a1.39,1.39,0,0,0,1.33-1.82l-12-37.44a1.4,1.4,0,0,0-1.33-1H51A1.39,1.39,0,0,0,49.7,43.72ZM47.57,70l6.19-19.27L60,70Z"},null,-1),x("rect",{x:"79",y:"42.75",width:"6",height:"40.24",rx:"1.4"},null,-1),x("path",{d:"M67.26,98H38.16A8.16,8.16,0,0,1,30,89.84V38.16A8.16,8.16,0,0,1,38.16,30H89.84A8.16,8.16,0,0,1,98,38.16V64A2.07,2.07,0,0,0,100.12,66h0a11,11,0,0,1,4.91,1.14,2.06,2.06,0,0,0,3-1.87V38.16A18.16,18.16,0,0,0,89.84,20H38.16A18.16,18.16,0,0,0,20,38.16V89.84A18.16,18.16,0,0,0,38.16,108h33.3a2.07,2.07,0,0,0,1.47-3.53,16.13,16.13,0,0,1-3.71-5.06A2.11,2.11,0,0,0,67.26,98Z",style:{fill:"hsl(269 100% 35% / 1)"}},null,-1),x("path",{d:"M111.73,101.8l9.06-3.57a1,1,0,0,0,0-1.86l-9.06-3.57a12.61,12.61,0,0,1-7.09-7.09l-3.57-9a1,1,0,0,0-.93-.63,1,1,0,0,0-.93.63l-3.57,9a12.58,12.58,0,0,1-7.09,7.09l-9,3.57a1,1,0,0,0,0,1.86l9,3.57a12.58,12.58,0,0,1,7.09,7.09l3.57,9a1,1,0,0,0,.93.64,1,1,0,0,0,.93-.64l3.57-9A12.61,12.61,0,0,1,111.73,101.8Z",style:{fill:"#7a00ff"}},null,-1)])]))])])],2)):P("",!0),h.type=="event"&&h.event_json&&!((yt=h.event_json)!=null&&yt.splitted_at)&&!((ht=h.event_json)!=null&&ht.ai_agent)?(S(),C("div",{key:4,class:K(["w-full pb-1",h.addClass])},[x("div",Oq,[x("div",Aq,[h.translation?(S(),C("span",{key:0,class:"font-normal",innerHTML:h.translation},null,8,Mq)):(S(),C("span",{key:1,class:"font-normal",innerHTML:h.body},null,8,Iq)),x("span",{class:"spm-relative-date font-normal text-gray-600 ml-1",title:t.$filters.datetime(h.created_at)},L(t.$filters.distanceInWordsToNow(h.created_at)),9,Lq),x("span",Pq,L(t.$filters.datetime(h.created_at)),1),h.show=="more"?(S(),C("div",Rq,L(t.$trans.get("Show All")),1)):P("",!0)])])],2)):P("",!0),h.type=="event"&&((R=h.event_json)!=null&&R.splitted_at)?(S(),C("div",$q,[x("div",Dq,[x("div",Nq,[x("div",{class:"inline-block mx-auto cursor-pointer",onClick:Ve=>{var B;return t.$router.push({path:`/tickets/all/${(B=h.event_json)==null?void 0:B.ticket_id}`})}},[x("span",{innerHTML:t.svg("custom-split","stroke-icon text-orange-500 h-4")},null,8,jq),x("span",{class:"font-semibold text-orange-500 inline-block ml-1",innerHTML:h.translation},null,8,Bq),x("span",{class:"spm-relative-date font-normal text-orange-500",title:t.$filters.datetime((F=h.event_json)==null?void 0:F.splitted_at)},L(t.$filters.distanceInWordsToNow((ie=h.event_json)==null?void 0:ie.splitted_at)),9,Hq),x("span",Uq,L(t.$filters.datetime((fe=h.event_json)==null?void 0:fe.splitted_at)),1)],8,Fq)])])])):P("",!0),h.type=="error"?(S(),C("div",Vq,[x("div",zq,[x("div",Wq,[x("span",{innerHTML:t.svg("feather-alert-triangle","stroke-icon text-red-600 h-4 font-bold")},null,8,Kq),x("span",{class:"font-semibold text-gray-700",innerHTML:h.body},null,8,qq),x("span",{class:"spm-relative-date font-normal text-gray-700",title:t.$filters.datetime(h.created_at)},L(t.$filters.distanceInWordsToNow(h.created_at)),9,Gq),x("span",Yq,L(t.$filters.datetime(h.created_at)),1)])])])):P("",!0),h.type=="bounce"&&h.event_json?(S(),C("div",Xq,[x("div",Jq,[Me(L(h.event_json.name)+" ",1),x("span",{class:"spm-relative-date font-normal text-sm text-red-500",title:t.$filters.datetime(h.created_at)},L(t.$filters.distanceInWordsToNow(h.created_at)),9,Qq),x("span",Zq,L(t.$filters.datetime(h.created_at)),1)]),x("div",eG,[h.event_json.email?(S(),C("p",{key:0,class:"text-sm",innerHTML:t.$trans.choice("Unable to deliver your message to :value",null,{value:`<b>${h.event_json.email}</b>`})},null,8,tG)):P("",!0),e[7]||(e[7]=x("p",null,null,-1)),x("div",nG,[x("p",null,[x("em",null,L(h.event_json.description),1)]),x("p",null,[x("em",null,L(h.event_json.details),1)])])]),Me(" "+L(n.ticket.from)+" ",1),n.ticket.contact.value==h.event_json.email?(S(),C("div",rG,[x("button",{class:"btn w-full md:w-auto mr-4 mt-2 md:mt-0 shadow-none btn-red-500",onClick:e[0]||(e[0]=(...Ve)=>s.changeTicketContact&&s.changeTicketContact(...Ve))},L(t.$trans.get("Change Contact")),1)])):P("",!0)])):P("",!0)],8,QK)}),128)),s.hasMoreMessages?(S(),C("div",iG,[s.isLoadingOlderMessages?(S(),re(f,{key:0,size:"4",class:"mr-2"})):(S(),C("button",{key:1,type:"button",class:"px-3 py-1 font-medium text-gray-600 hover:text-primary-700",onClick:e[1]||(e[1]=(...h)=>s.loadOlderMessages&&s.loadOlderMessages(...h))},L(t.$trans.get("Load older messages")),1))],512)):P("",!0)],512)):P("",!0)}const oG=Ae(JK,[["render",sG]]),aG=wr(()=>ne(()=>import("./empty-search-D2GbGfWP.js"),__vite__mapDeps([0,1,2]))),lG={inject:["ticketList"],components:{SpmActions:E$,SpmSidebar:c3,SpmFullEditor:pK,SpmTicketHead:BK,SpmTicketMessages:oG,SpmLoader:xn,SpmTooltip:rr,SpmDropdown:Gn,FvlForm:Jl,FvlTagSelect:tO,FvlDatePicker:eO,SpmButton:tc,vuescroll:_d,SpmEmptySearch:aG},beforeRouteEnter(t,e,n){n(r=>
146{r.joinChannel(t)})},beforeRouteLeave(t,e,n){this.leaveTicketChannel(),n()},beforeRouteUpdate(t,e,n){this.showEditorWithType=null,this.showCc=!1,this.submitInProgress=!1,this.tmpInitialEditorBody=null,this.reloadEditor=!0,this.showEditor=!1,this.errors=null,this.send_at=null,this.showScheduler=!1,this.copyAttachmentsInProgress=!1;var r=0;e.params.id!=t.params.id&&(this.newMessageAlertIds=[]),t.params.id&&t.params.id>0&&this.$store.state.ticketId!=t.params.id&&(r=t.params.id,this.$store.dispatch("getTicket",{id:t.params.id,fetch:!0})),t.params.section&&this.$store.getters.section!=t.params.section&&this.$store.dispatch("getTicketList",{section:t.params.section,id:r}),this.joinChannel(t),this.$nextTick(()=>{this.$refs.scrollbarTicket.scrollTo({y:"0"},0)}),n()},data(){return{errors:null,tmpInitialEditorBody:null,maxAttachmentsSize:1e3*1e3*10,transition:"",nextAction:this.$store.getters.user.settings.ticket.next_action,nextStatus:this.$store.getters.user.settings.ticket.next_status,showEditorWithType:null,showCc:!1,reloadEditor:!1,copyAttachmentsInProgress:!1,initializingApiDraft:null,submitInProgress:!1,mentionList:[],showScheduler:!1,send_at:null,newMessageAlertIds:[],usersViewingTicket:[],messageChannel:null,ticketChannelVersion:0,ticketPresenceReady:!1,userTyping:null,aiEditorLoadingManual:!1,aiEditorLoadingActionManual:null,form:{to:null,cc:null,bcc:null},scrollOps:{vuescroll:{mode:"native",sizeStrategy:"percent",detectResize:!0}}}},computed:{apiDraftToInitialize(){var t,e,n,r,i;return this.draftEditable&&((t=this.draft)==null?void 0:t.type)==="external"&&((n=(e=this.draft)==null?void 0:e.event_json)==null?void 0:n.created_via)==="api"&&!((i=(r=this.draft)==null?void 0:r.event_json)!=null&&i.editor_signature_initialized)?this.draft.id:null},showNotEditableMessage(){return!this.draftEditable||this.editorType=="internal"&&!this.isOwnDraft},aiToolbarEnabled(){return this.$store.getters.section!="trash"},draftEditable(){return this.draft&&this.draft.from&&this.draft.from.user_id==this.$store.getters.user.id&&!this.ticket.assignee||["internal"].includes(this.editorType)||this.ticket.assignee&&this.ticket.assignee.id==this.$store.getters.user.id},isOwnDraft(){return this.draft==null||["internal"].includes(this.editorType)&&this.draft&&this.draft.from&&this.draft.from.user_id==this.$store.getters.user.id},listItems(){return this.$store.getters.searchQuery?this.ticketListSearchedItems:this.$store.getters.ticketListItems},error(){return this.$store.getters.error},ticketId(){return Number(this.$store.getters.ticketId)},ticket(){return this.$store.getters.ticket},section(){return this.$store.getters.section},isLoading(){return this.$store.getters.isLoading||this.$store.getters.ticketListSearchIsLoading},ticketListIsLoading(){return this.$store.getters.ticketListIsLoading},draft(){return this.$store.getters.draft},aiEditorLoading(){return this.aiEditorLoadingManual||this.isAiRequestInProgress(this.draft)},aiEditorLoadingAction(){var t,e;return this.aiEditorLoading?((e=(t=this.draft)==null?void 0:t.event_json)==null?void 0:e.ai_agent)||this.aiEditorLoadingActionManual:null},draftId(){return this.draft?this.draft.id:0},editorType(){return this.draft?this.draft.type:this.showEditorWithType?this.showEditorWithType:null},showEditorComputed(){return!this.reloadEditor},html(){return this.tmpInitialEditorBody?this.tmpInitialEditorBody:this.draft?this.draft.body:""},uploadUrl(){return this.draft?"/tickets/"+this.ticket.id+"/messages/"+this.draft.id+"/attachment":""},uploadInlineUrl(){return this.draft?"/tickets/"+this.ticket.id+"/messages/"+this.draft.id+"/inline":""},attachments(){return this.draft?this.draft.attachments:[]},updateUrl(){return this.draft?"/tickets/"+this.ticket.id+"/messages/"+this.draft.id:""},ccBccFormVisible(){var t,e,n,r,i,s,o,a;return["forward"].includes(this.editorType)&&this.ticket?!0:["internal"].includes(this.editorType)&&this.ticket?!1:this.draft&&((e=(t=this.draft)==null?void 0:t.to)!=null&&e.length)&&this.draft.to[0]!=((r=(n=this.ticket)==null?void 0:n.contact)==null?void 0:r.value)||this.draft&&((s=(i=this.draft)==null?void 0:i.cc)!=null&&s.length)||(a=(o=this.draft)==null?void 0:o.bcc)!=null&&a.length?!0:(["forward","external"].includes(this.editorType)||this.showEditorComputed&&this.draft)&&this.ticket&&this.ticket.messages&&(this.ticket.messages[0].cc&&this.ticket.messages[0].cc.length||this.showCc||this.form.cc&&this.form.cc.length||this.form.bcc&&this.form.bcc.length)},mentionListConditional(){return this.editorType=="internal"?this.mentionList:null},viewingUsersWithoutMe(){return this.usersViewingTicket.filter(t=>t.id!==this.$store.getters.user.id)}},watch:{apiDraftToInitialize:{immediate:!0,handler(t){if(!t||this.initializingApiDraft===t)return;const e=this.ticketId;this.initializingApiDraft=t,ze.patch(`/tickets/${e}/messages/${t}`,{initialize_api_signature:!0}).then(n=>{this.$store.dispatch("cacheDraftUpdate",{id:e,draft:n.data.data})}).catch(()=>{}).finally(()=>{this.initializingApiDraft=null})}},draft:function(t){this.form.to=t?t.to:null,this.form.cc=t?t.cc:null,this.form.bcc=t?t.bcc:null,this.$nextTick(()=>{this.reloadEditor=!1})},showCc:function(t){t&&this.$nextTick(()=>{var e;(e=this.form)!=null&&e.to||(this.form.to=[this.ticket.contact.value])})},aiEditorLoading(t){t||(this.aiEditorLoadingActionManual=null)}},mounted(){window.Echo.connector.pusher.connection.bind("state_change",this.onTicketConnectionStateChange),this.messageChannel===null&&this.joinChannel
146(this.$route),this.getMentionList()},beforeUnmount(){window.Echo.connector.pusher.connection.unbind("state_change",this.onTicketConnectionStateChange),this.leaveTicketChannel()},methods:{selectNextStatus(t,e){this.nextStatus=t,t==="wait_until"?(this.setNextStatusDefault("waiting"),this.chooseWaitUntilDate(null,this.ticket)):this.setNextStatusDefault(t),e()},submitCurrentEditor(t){this.send_at=null,this.editorType==="internal"&&(this.nextAction="stay"),t()},submitWithNextAction(t,e,n){this.nextAction=t,n(),e()},openNextActionDefault(t){this.setNextActionDefault(),t()},cancelScheduler(){this.showScheduler=!1,this.send_at=null},scheduleMessage(t,e){e(),t(),this.showScheduler=!1},isAiRequestInProgress(t){var r;const e=(r=t==null?void 0:t.event_json)==null?void 0:r.ai_requested_at;if(!e)return!1;const n=Date.now()-new Date(e).getTime();return n>=0&&n<5*60*1e3},aiActionSuccessMessage(t){return t==="improve_writing"?this.$trans.get("Writing improved."):t==="translate"?this.$trans.get("Text translated."):null},chooseWaitUntilDate(t,e){this.$store.commit("showDialogModal",{component:"tickets/modals/_wait_until.modal.vue",title:" ",params:{ticket:e},buttons:[]})},typing:Jr(function(t){this.viewingUsersWithoutMe.length&&this.messageChannel.whisper("typing",{id:this.$store.getters.user.id,name:this.$store.getters.user.name,text:t,cursor:this.$refs.replyEditor.getCursorPosition()})},1e3),clearTicketViewers(){this.usersViewingTicket=[],this.ticketPresenceReady=!1},onTicketConnectionStateChange({current:t}){t!=="connected"&&this.clearTicketViewers()},leaveTicketChannel(){this.ticketChannelVersion++,this.clearTicketViewers(),this.messageChannel&&(window.Echo.leaveChannel(this.messageChannel.name),this.messageChannel=null)},joinChannel(t){this.leaveTicketChannel();const e=Number(t.params.id);if(!Number.isInteger(e)||e<=0)return;const n=this.ticketChannelVersion;this.messageChannel=window.Echo.join(this.$store.getters.user.workspace+".ticket.message."+e).here(r=>{n===this.ticketChannelVersion&&window.Echo.connector.pusher.connection.state==="connected"&&(this.usersViewingTicket=r,this.ticketPresenceReady=!0)}).joining(r=>{n!==this.ticketChannelVersion||!this.ticketPresenceReady||(this.usersViewingTicket=this.usersViewingTicket.filter(i=>i.id!==r.id),this.usersViewingTicket.push(r))}).leaving(r=>{n!==this.ticketChannelVersion||!this.ticketPresenceReady||(this.usersViewingTicket=this.usersViewingTicket.filter(i=>i.id!==r.id))}).error(()=>{n===this.ticketChannelVersion&&this.clearTicketViewers()}).listenForWhisper("typing",r=>{r.id!=this.$store.getters.user.id&&(this.userTyping=r.name,this.$refs.replyEditor&&this.$refs.replyEditor.$children[0].setHtmlContent(r.text),this.typingTimeoutId&&clearTimeout(this.typingTimeoutId),this.typingTimeoutId=setTimeout(()=>{this.userTyping=null},2e3))}).listen("NewTicketMessageCreated",r=>{this.newMessageAlertIds.push(r.messageId),this.$store.dispatch("getTicket",{id:t.params.id,fetch:!0}),this.$store.dispatch("reloadTicketListIfPageOne"),this.$store.dispatch("updateSectionsCountsOnly")}).listen("MessageAttachmentsCopied",r=>{this.$store.dispatch("getTicket",{id:t.params.id,fetch:!0}).then(()=>{r.copiedMediaCount>0&&(this.$notify.success(this.$trans.get(":count attachments copied",{count:r.copiedMediaCount})),this.reloadDraftEditor(this,null))})}).listen("Ticket\\MessageDraftCreated",r=>{r.createdVia!=="api"&&(r.userId==null||r.userId==this.$store.getters.user.id)||(this.$notify.info(this.$trans.get(":name created a new message draft",{name:r.userName})),this.$store.dispatch("getTicket",{id:t.params.id,fetch:!0}).then(()=>{this.reloadDraftEditor(this,null)}))}).listen("Ticket\\MessageDraftDeleted",r=>{r.userId==null||r.userId==this.$store.getters.user.id||(this.$notify.info(this.$trans.get(":name has deleted message draft",{name:r.userName})),this.$store.dispatch("getTicket",{id:t.params.id,fetch:!0}).then(()=>{this.reloadDraftEditor(this,null)}))}).listen("Ticket\\TicketAssigneeChanged",r=>{r.userId!=null&&r.userId!=this.$store.getters.user.id&&this.$notify.info(this.$trans.get("Ticket has been assigned to :name",{name:r.userName})),this.$store.dispatch("setTicketAssignee",r.ticket)}).listen("NewTicketNoteCreated",r=>{r.userId==null||r.userId==this.$store.getters.user.id||(this.$notify.info(this.$trans.get(":name created a new note",{name:r.userName})),this.$store.dispatch("getTicket",{id:t.params.id,fetch:!0}).then(()=>{this.reloadDraftEditor(this,null)}))}).listen("NewTicketAgentMessageCreated",r=>{r.userId==null||r.userId==this.$store.getters.user.id||(this.$notify.info(this.$trans.get(":name has sent a new message",{name:r.userName})),this.$store.dispatch("getTicket",{id:t.params.id,fetch:!0}).then(()=>{this.reloadDraftEditor(this,null)}))}).listen("AiActionOnTicketFinished",r=>{ze.get("/tickets/"+t.params.id).then(i=>{var o;const s=i.data.data;if(this.$store.dispatch("setTicket",s),s.draft){this.showEditorWithType||(this.showEditorWithType=s.draft.type),this.tmpInitialEditorBody=s.draft.body,this.reloadEditor=!0,this.$nextTick(()=>{this.reloadEditor=!1,this.$nextTick(()=>{this.tmpInitialEditorBody=null})});const a=this.aiActionSuccessMessage((o=s.draft.event_json)==null?void 0:o.ai_agent);a&&this.$notify.success(a)}this.aiEditorLoadingManual=!1}).catch(()=>{this.aiEditorLoadingManual=!1})})},getMentionList(){ze.get("/selectable/users?canAccess=tickets").then(t=>{this.mentionList=t.data.data})},forwardMessage(t){this.draft?(this.tmpInitialEditorBody=this.draft.body+this.getBlockquote(t.message),this.reloadEditor=!0,this.$nextTick(()=>{this.reloadEditor=!1,this.$refs.scrollbarTicket.scrollTo({y:"0"},600),this.$notify.success(this.$trans.get("Added message to draft")),this.$nextTick(()=>{this.tmpInitialEditorBody=null})}),this.saveDraft(this.html,t.ticket.id,this.draft.id)):this.createDraft("forward",t.ticket.id,t.message)},replyToMessage(t){this.draft?(this.form.to=[t.message.from.value],this.$refs.ccbccform.submit(),this.$refs.scrollbarTicket.scrollTo({y:"0"},600)):(this.createDraft("external",t.ticket.id,t.message),this.showCc=!0,this.$nextTick(()=>{this.form.to=[t.message.from.value]}))},getBlockquote(t){let e="<p></p>";return t instanceof Object&&t.from&&t.from.name&&(e=e+`<p><i>${t.from.name} <${t.from.value}> `+this.$trans.get("wrote on")+" "+this.$filters.datetime(t.created_at)+":</i></p>"),e=e+"<blockquote>"+t.body+"</blockquote>",e},createDraft(t,e,n){if(this.$nextTick(()=>{setTimeout(()=>{this.$refs.replyEditor&&this.$refs.replyEditor.focus(),this.$refs.scrollbarTicket.scrollTo({y:"0"},300)},300)}),this.draft)return;t=="forward"&&(n=n||this.getLastTicketMessage(),n&&(this.tmpInitialEditorBody=this.getBlockquote(n)),n&&n.attachments.length>0&&(this.copyAttachmentsInProgress=!0)),t=="external"&&(this.ticket.assignee=this.$store.getters.user,this.ticket.reply_template&&(this.tmpInitialEditorBody=this.ticket.reply_template),this.ticket.signature&&(this.tmpInitialEditorBody=(this.tmpInitialEditorBody??"")+"<p></p>"+this.ticket.signature));
146let r=t=="external"&&n?[n.from.value]:null,i=n&&typeof n=="object"&&n.id?n.id:null;this.transition="append",this.showEditorWithType=t,ze.post(`/tickets/${e}/messages/`,{body:this.html,type:t,parent_id:i,to:r}).then(s=>{this.$store.dispatch("cacheDraftCreate",{id:e,draft:s.data.data}),e==this.ticketId&&(this.transition="")}).catch(()=>{}).finally(()=>{this.tmpInitialEditorBody=null})},reloadDraftEditor:Qt(function(t,e){t.reloadEditor=!0,t.$nextTick(()=>{t.reloadEditor=!1,e&&t.$notify.success(this.$trans.get(e)),t.copyAttachmentsInProgress=!1})},1e3),saveDraft:Qt(function(t,e,n){if(!(n==0||!this.draftEditable))return ze.patch(`/tickets/${e}/messages/${n}`,{body:t}).then(r=>{this.$store.dispatch("cacheDraftUpdate",{id:e,draft:r.data.data})}).catch(()=>{}).finally(()=>{})},800),deleteDraftConfirm(t,e){this.$store.commit("showDialogModal",{title:this.$trans.get("Discard Draft"),text:this.$trans.get("Do you want to discard this draft?")+" "+this.$trans.get("This action cannot be undone."),buttons:[{title:this.$trans.get("Delete this draft"),class:"btn-red-500",handler:()=>{this.deleteDraft(t,e)}},{title:this.$trans.get("Cancel"),default:!0}]})},deleteDraft(t,e){let n=this.editorType;this.showEditorWithType=null,this.$store.dispatch("deleteDraft",t),ze.delete(`/tickets/${t}/messages/${e}`).then(r=>{this.$store.dispatch("cacheTicket",r.data.data),this.showCc=!1,this.form.to=null,this.form.cc=null,this.form.bcc=null}).catch(()=>{t==this.ticketId&&(this.showEditorWithType=n)}).finally(()=>{})},setNextActionDefault(){this.$store.commit("showFormModal",{component:"tickets/modals/_next-action-default.modal.vue"})},setNextStatusDefault(t){ze.patch("/auth/user/settings",{settings:{ticket:{next_status:t}}}).then(()=>{this.$store.dispatch("fetchAuthUser")})},getLastTicketMessage(){if(!this.ticket)return!1;let t=null;return this.ticket.messages.every(e=>["external"].includes(e.type)&&e.is_draft==0?(t=e,!1):!0),t},patchTicketContact(t,e){ze.patch(`/tickets/${t}/contact`,{email:e}).then(n=>{this.$store.dispatch("cacheTicket",n.data.data)})},submitDraft(t,e,n){let r=this.editorType;this.submitInProgress=!0;let i=this.editorType=="forward"?`/tickets/${e}/messages/${n}/forward`:`/tickets/${e}/messages/${n}/send`;ze.post(i,{body:t,send_at:this.send_at,to:this.form.to}).then(s=>{if(e==this.ticketId&&(this.submitInProgress=!1,this.showEditorWithType=null,this.errors=null,this.send_at=null),this.$store.dispatch("cacheTicket",s.data.data),this.$store.dispatch("deleteDraft",e),e==this.ticketId){this.showCc=!1;const o=this.$store.getters.section!=s.data.data.section&&this.$store.getters.section!="all";this.nextAction!="stay"?o?this.ticketList.gotoNextAndDeleteOneFromTicketList(this.ticket.id,this.$store.getters.section):this.ticketList.gotoNext():o&&this.$store.commit("deleteTicketFromTicketList",{ticket_id:this.ticket.id,section:this.$store.getters.section}),this.nextAction=this.$store.getters.user.settings.ticket.next_action}}).catch(s=>{var o,a;if(e==this.ticketId){this.submitInProgress=!1,this.showEditorWithType=r;const l=(a=(o=s.response)==null?void 0:o.data)==null?void 0:a.errors;if(l){this.errors=l;const c=Object.values(l),u=typeof c=="object"&&typeof c[0]=="object"?c[0][0]:!1;u&&typeof u=="string"&&this.$notify.error(u)}}}).finally(()=>{this.$store.dispatch("reloadTicketListIfPageOne"),this.$store.dispatch("updateSectionsCountsOnly")})}}},cG={class:"flex-grow md:flex"},uG={class:"h-full pt-1"},dG={key:0,class:"w-full justify-center items-center text-center mb-1"},fG={class:"relative items-center inline-block -top-1 box-style p-3 py-1 pb-1 rounded-t-none text-xs"},hG={key:0},pG={key:1},mG={id:"spm-ticket-stream-print",class:"relative h-full pb-50"},gG={key:1,class:"mx-1 3xl:mx-4"},vG={key:0},yG={class:"text-gray-600"},bG={key:1,class:"pl-12 text-xs font-medium text-gray-600"},kG=["innerHTML"],wG={class:"text-gray-600"},xG={class:"text-gray-600"},SG={key:2},TG={key:0,class:"flex items-center gap-2 mt-1 w-full bg-orange-200 text-orange-600 font-bold text-xs px-4 py-2"},_G={key:0},EG={key:1},CG={class:"ml-auto"},OG=["disabled"],AG={key:1,class:"flex items-center justify-center ml-2"},MG={class:"text-gray-700 text-xs py-2"},IG=["innerHTML"],LG=["onClick"],PG=["onClick"],RG=["onClick"],$G=["onClick"],DG=["title","disabled","onClick"],NG=["innerHTML"],FG={key:"options"},jG=["onClick"],BG=["onClick"],HG=["onClick"],UG={key:"scheduler",class:"p-2 absolute top-0 mt-2 w-full pr-8"},VG=["innerHTML"],zG={class:"mb-2 mt-4 text-gray-800 font-bold"},WG=["disabled","onClick"],KG={key:3,class:"flex items-center justify-center ml-2 mb-2"},qG={class:"text-primary-800 text-xs py-2 font-medium"},GG={key:0,class:"flex h-full w-full leading-normal font-display font-semibold text-gray-600"},YG={key:0,class:"m-auto"},XG={key:1,class:"m-auto"},JG={class:"flex h-full w-full"},QG={class:"m-auto"};function ZG(t,e,n,r,i,s){const o=z("spm-actions"),a=z("spm-empty-search"),l=z("spm-ticket-head"),c=z("spm-button"),u=z("fvl-tag-select"),d=z("fvl-form"),f=z("spm-tooltip"),p=z("spm-loader"),h=z("spm-dropdown"),g=z("fvl-date-picker"),m=z("spm-full-editor"),b=z("spm-ticket-messages"),T=z("vuescroll"),E=z("spm-sidebar");return S(),C("div",cG,[x("div",{class:K(["flex-grow w-screen md:block md:w-auto h-full pb-26 px-1",{hidden:!t.$store.getters.viewIsVisible}])},[Ye(X(o,{ref:"ticketActionBar","is-loading":s.isLoading,ticket:s.ticket,"viewing-users":s.viewingUsersWithoutMe,onExternal:e[0]||(e[0]=w=>s.createDraft("external",s.ticket.id,null)),onForward:e[1]||(e[1]=w=>s.createDraft("forward",s.ticket.id,null)),onInternal:e[2]||(e[2]=w=>s.createDraft("internal",s.ticket.id,null))},null,8,["is-loading","ticket","viewing-users"]),[[wt,!t.$store.getters.searchedWithoutResults]]),Ye(X(a,{"is-loading":s.isLoading,section:s.section},null,8,["is-loading","section"]),[[wt,t.$store.getters.searchedWithoutResults]]),Ye(x("div",uG,[i.newMessageAlertIds.length>0?(S(),C("div",dG,[X(Ii,{name:"fade-down"},{default:Y(()=>[x("div",fG,[i.newMessageAlertIds.length==1?(S(),C("span",hG,"1 "+L(t.$trans.get("New Message")),1)):(S(),C("span",pG,L(i.newMessageAlertIds.length)+" "+L(t.$trans.get("New Messages")),1))])],void 0,!0),_:1})])):P("",!0),X(T,{ref:"scrollbarTicket",ops:i.scrollOps},{default:Y(()=>[x("div",mG,[s.ticket?(S(),re(l,{key:0,ref:"tickethead",ticket:s.ticket,class:"mx-2 md:mx-3 3xl:mx-6 mt-4 mb-4"},null,8,["ticket"])):P("",!0),!s.ticket.is_social&&!i.copyAttachmentsInProgress&&["external","forward"].includes(s.editorType)?(S(),C("div",gG,[
146s.draftEditable&&["external","forward"].includes(s.editorType)?(S(),re(d,{key:0,ref:"ccbccform",class:"flex flex-wrap w-full",url:s.updateUrl,data:i.form,method:"patch"},{default:Y(()=>{var w,M;return[s.showEditorComputed&&["external","forward"].includes(s.editorType)?(S(),C(Fe,{key:0},[s.ccBccFormVisible?P("",!0):(S(),C("div",vG,[X(c,{tooltip:t.$trans.get("Click to change recipients"),class:"ml-3 text-xs font-medium text-gray-600 border-b border-gray-500","tooltip-placement":"top",disabled:!s.draftEditable,onClick:e[3]||(e[3]=A=>i.showCc=!0)},{default:Y(()=>[Me(L(t.$trans.get("To"))+": "+L(s.ticket.contact.value)+" "+L(t.$trans.get("Cc/Bcc")),1)],void 0,!0),_:1},8,["tooltip","disabled"])])),x("div",{class:K(["w-full",{"pointer-events-none":!s.draftEditable}])},[s.ccBccFormVisible?(S(),re(u,{key:0,class:"w-full flex items-center gap-2","field-class":"bg-white border-gray-400 flex-grow",modelValue:i.form.to,"onUpdate:modelValue":e[4]||(e[4]=A=>i.form.to=A),"search-keys":["email","name"],"allow-new":!0,max:1,"lazy-load":!0,"search-remote":!0,"options-url":"/selectable/email-contacts","response-data-path":"data","option-key":"email","option-value":"email",type:"email",name:"to",label:t.$trans.get("To"),placeholder:"",onChanged:e[5]||(e[5]=A=>t.$refs.ccbccform.submit())},{option:Y(({option:A})=>[Me(L(A.email)+" ",1),x("span",yG,"- "+L(A.name),1)]),_:1},8,["modelValue","label"])):P("",!0),((M=(w=i.form)==null?void 0:w.to)==null?void 0:M.length)>0&&i.form.to!=s.ticket.contact.value?(S(),C("div",bG,[x("span",{innerHTML:t.$trans.get("Do you want to change the ticket contact to :value?",{value:`<b>${i.form.to[0]}</b>`})},null,8,kG),X(c,{tooltip:t.$trans.get("Click to immediately change the ticket contact."),class:"ml-2 text-xs font-medium text-primary-700 underline","tooltip-placement":"top",onClick:e[6]||(e[6]=A=>s.patchTicketContact(s.ticket.id,i.form.to))},{default:Y(()=>[Me(L(t.$trans.get("Yes")),1)],void 0,!0),_:1},8,["tooltip"])])):P("",!0),s.ccBccFormVisible?(S(),re(u,{key:2,class:"w-full flex items-center gap-2","field-class":"bg-white border-gray-400 flex-grow",modelValue:i.form.cc,"onUpdate:modelValue":e[7]||(e[7]=A=>i.form.cc=A),"search-keys":["email","name"],"allow-new":!0,max:10,"lazy-load":!0,"search-remote":!0,"options-url":"/selectable/email-contacts","response-data-path":"data","option-key":"email","option-value":"email",type:"email",name:"cc",label:"Cc",placeholder:"",onChanged:e[8]||(e[8]=A=>t.$refs.ccbccform.submit())},{option:Y(({option:A})=>[Me(L(A.email)+" ",1),x("span",wG,"- "+L(A.name),1)]),_:1},8,["modelValue"])):P("",!0),s.ccBccFormVisible?(S(),re(u,{key:3,class:"w-full flex items-center gap-2","field-class":"bg-white border-gray-400 flex-grow",modelValue:i.form.bcc,"onUpdate:modelValue":e[9]||(e[9]=A=>i.form.bcc=A),"search-keys":["email","name"],"allow-new":!0,max:10,type:"email","lazy-load":!0,"search-remote":!0,"options-url":"/selectable/email-contacts","response-data-path":"data","option-key":"email","option-value":"email",name:"bcc",label:"Bcc",placeholder:"",onChanged:e[10]||(e[10]=A=>t.$refs.ccbccform.submit())},{option:Y(({option:A})=>[Me(L(A.email)+" ",1),x("span",xG,"- "+L(A.name),1)]),_:1},8,["modelValue"])):P("",!0)],2)],64)):P("",!0)]},void 0,!0),_:1},8,["url","data"])):P("",!0)])):P("",!0),i.copyAttachmentsInProgress?P("",!0):(S(),C("div",SG,[!s.apiDraftToInitialize&&s.showEditorComputed&&(["external","internal","forward"].includes(s.editorType)||s.showEditorComputed&&s.draft)?(S(),re(m,{key:`${s.ticketId}-${s.draftId}`,ref:"replyEditor",files:s.attachments,"show-custom-html":!0,html:s.html,"draft-id":s.draftId,"upload-url":s.uploadUrl,"upload-inline-url":s.uploadInlineUrl,"auto-focus":!1,"quick-reply":!0,"mention-list":s.mentionListConditional,class:K("spm-editor-type-"+s.editorType),editable:s.draftEditable,"show-ai-toolbar":s.aiToolbarEnabled,"ticket-id":s.ticketId,"editor-type":s.editorType,"ai-loading":s.aiEditorLoading,onSaveDraft:e[16]||(e[16]=w=>s.saveDraft(w,s.ticketId,s.draftId)),onSubmit:e[17]||(e[17]=w=>s.submitDraft(w,s.ticketId,s.draftId)),onUpdate:s.typing,onGenerateReply:e[18]||(e[18]=w=>i.aiEditorLoadingManual=!0),onGenerateReplyFailed:e[19]||(e[19]=w=>i.aiEditorLoadingManual=!1),onAiLoading:e[20]||(e[20]=w=>i.aiEditorLoadingManual=w),onAiActionStarted:e[21]||(e[21]=w=>i.aiEditorLoadingActionManual=w),"ai-loading-action":s.aiEditorLoadingAction},{"below-toolbar":Y(()=>[s.showNotEditableMessage?(S(),C("div",TG,[i.userTyping?(S(),C("div",_G,[Me(L(t.$trans.get(":name is currently typing",{name:i.userTyping}))+" ",1),e[24]||(e[24]=x("span",{class:"inline-block animate-[bounce_0.9s_ease-in-out_infinite]"},".",-1)),e[25]||(e[25]=x("span",{class:"inline-block delay-75 animate-[bounce_1s_ease-in-out_infinite]"},".",-1)),e[26]||(e[26]=x("span",{class:"inline-block delay-500 animate-[bounce_1.1s_ease-in-out_infinite]"},".",-1))])):(S(),C("div",EG,L(t.$trans.get(":name is writing this message",{name:s.editorType=="internal"?s.draft.from.name:s.ticket.assignee?s.ticket.assignee.name:""})),1)),x("div",CG,[X(f,{tooltip:t.$trans.get("Read only mode. Assign ticket to yourself to edit this message."),innerHTML:t.svg("feather-info","stroke-icon h-4 w-4")},null,8,["tooltip","innerHTML"])])])):P("",!0)]),"footer-info":Y(()=>[i.copyAttachmentsInProgress?P("",!0):(S(),C("button",{key:0,class:K(["p-1 text-xs text-gray-600 rounded-lg",[["external","forward"].includes(s.editorType)?"hover:bg-gray-100 focus:bg-gray-300":"hover:bg-orange-150 focus:bg-orange-300",s.draftId==0||i.submitInProgress||!s.draftEditable?"opacity-25":"opacity-100"]]),disabled:s.draftId==0||i.submitInProgress||!s.draftEditable,onClick:e[11]||(e[11]=w=>s.deleteDraftConfirm(s.ticketId,s.draftId))},[s.editorType=="external"?(S(),C(Fe,{key:0},[Me(L(t.$trans.get("Delete draft")),1)],64)):s.editorType=="forward"?(S(),C(Fe,{key:1},[Me(L(t.$trans.get("Delete forward draft")),1)],64)):s.editorType=="internal"?(S(),C(Fe,{key:2},[Me(L(t.$trans.get("Delete note draft")),1)],64)):P("",!0)],10,OG)),i.copyAttachmentsInProgress?(S(),C("div",AG,[x("span",MG,L(t.$trans.get("Copying Attachments"))+" ...",1),X(p,{class:"ml-1",size:"4"}
146)])):P("",!0)]),"footer-buttons":Y(({submithtml:w,attachmentsUploadState:M,attachmentsSize:A})=>[["external","forward"].includes(s.editorType)?(S(),re(h,{key:0,ref:"nextstatus","use-popper":!0,small:!0,placement:"bottom-end",distance:"3px",class:K(["h-auto flex mr-3",{"pointer-events-none":!s.draftEditable}])},{trigger:Y(({isOpen:I})=>[x("button",{type:"button",class:K(["flex text-gray-600 text-xs self-center items-center pl-2 p-1 rounded-lg hover:bg-gray-100 hover:text-gray-700 focus:bg-gray-200 focus:text-gray-700",{"text-gray-900":I}]),innerHTML:"<span>"+t.$trans.get("Next status")+": <b>"+t.$trans.get(t.$filters._upperFirst(i.nextStatus))+"</b></span>"+t.svg("feather-chevron-down","stroke-icon h-4 self-center")},null,10,IG)]),dropdown:Y(({hide:I})=>[x("button",{class:K(["flex spm-dropdown-linkitem item items-center w-full",{"font-bold":i.nextStatus=="open"}]),type:"button",onClick:j=>s.selectNextStatus("open",I)},L(t.$trans.get("Open")),11,LG),x("button",{class:K(["flex spm-dropdown-linkitem item items-center w-full",{"font-bold":i.nextStatus=="waiting"}]),type:"button",onClick:j=>s.selectNextStatus("waiting",I)},L(t.$trans.get("Waiting")),11,PG),x("button",{class:K(["flex spm-dropdown-linkitem item items-center w-full",{"font-bold":i.nextStatus=="wait_until"}]),type:"button",onClick:j=>s.selectNextStatus("wait_until",I)},L(t.$trans.get("Wait until...")),11,RG),x("button",{class:K(["flex spm-dropdown-linkitem item items-center w-full",{"font-bold":i.nextStatus=="closed"}]),type:"button",onClick:j=>s.selectNextStatus("closed",I)},L(t.$trans.get("Closed")),11,$G)]),_:1},8,["class"])):P("",!0),Ye(x("div",{class:K(["inline-flex pr-0 rounded-lg",{"opacity-75":i.submitInProgress||s.draftId==0||M=="uploading"||A>i.maxAttachmentsSize,"bg-orange-500 hover:bg-orange-600 text-white":s.editorType=="internal","spm-bg-gradient-primary-500":["external","forward"].includes(s.editorType)}])},[x("button",{id:"spm-editor-submit-button",title:M=="uploading"?"Attachment is still uploading ...":null,disabled:i.submitInProgress||s.draftId==0||M=="uploading"||A>i.maxAttachmentsSize||i.showScheduler||!s.draftEditable,class:K([i.submitInProgress||s.draftId==0||M=="uploading"||A>i.maxAttachmentsSize||!s.draftEditable||i.showScheduler?"opacity-25":"","p-2 pl-4 pr-4 rounded text-sm text-white font-bold hover:bg-primary-900 hover:bg-opacity-25"]),onClick:I=>s.submitCurrentEditor(w)},L(["external","forward"].includes(s.editorType)?t.$trans.get("Send"):t.$trans.get("Save Note")),11,DG),["external","forward"].includes(s.editorType)?(S(),re(h,{key:0,ref:"dropdown","use-popper":!0,placement:"bottom-end",distance:"3px",class:K(["h-auto",M=="uploading"||A>i.maxAttachmentsSize||!s.draftEditable?"opacity-75":""]),"hide-after-dropdown-click":!1,"click-outside-to-close":!i.showScheduler,title:M=="uploading"?"Attachment is still uploading ...":null,disabled:M=="uploading"||A>i.maxAttachmentsSize||i.showScheduler||!s.draftEditable,onClose:e[15]||(e[15]=I=>i.showScheduler=!1)},{trigger:Y(({isOpen:I})=>[x("button",{type:"button",class:K(["flex p-2 border-l text-white border-black border-opacity-25 rounded-r-lg hover:bg-primary-900 hover:bg-opacity-25 focus:bg-primary-900 focus:bg-opacity-25",{"bg-primary-900 bg-opacity-25":I}]),innerHTML:t.svg("feather-chevron-down","stroke-icon h-4 mt-px self-center")},null,10,NG)]),dropdown:Y(({hide:I})=>[X($i,{name:"slide-fade-left",tag:"div",class:"overflow-hidden transition-all h-[173px]"},{default:Y(()=>[Ye(x("div",FG,[x("button",{class:K(["flex spm-dropdown-linkitem item items-center w-full",{"font-bold":i.nextAction=="next"}]),type:"button",onClick:j=>s.submitWithNextAction("next",I,w)},L(t.$trans.get("Send and go to next")),11,jG),x("button",{class:K(["flex spm-dropdown-linkitem item items-center w-full",{"font-bold":i.nextAction=="stay"}]),type:"button",onClick:j=>s.submitWithNextAction("stay",I,w)},L(t.$trans.get("Send and stay")),11,BG),x("button",{class:"flex spm-dropdown-linkitem item items-center w-full",type:"button",onClick:e[12]||(e[12]=ct(j=>i.showScheduler=!0,["prevent"]))}
146,L(t.$trans.get("Send later ...")),1),e[27]||(e[27]=x("hr",{class:"border-t border-gray-200 -mx-3 my-3"},null,-1)),x("button",{class:"flex spm-dropdown-linkitem item items-center w-full",type:"button",onClick:j=>s.openNextActionDefault(I)},L(t.$trans.get("Change default")),9,HG)],512),[[wt,!i.showScheduler]]),Ye(x("div",UG,[x("button",{type:"button",class:"flex",onClick:e[13]||(e[13]=j=>s.cancelScheduler())},[x("i",{innerHTML:t.svg("feather-arrow-left","stroke-icon h-4")},null,8,VG)]),x("h4",zG,L(t.$trans.get("Send at")),1),X(d,{url:"",data:{send_at:i.send_at},class:"relative"},{default:Y(()=>[X(g,{modelValue:i.send_at,"onUpdate:modelValue":e[14]||(e[14]=j=>i.send_at=j),name:"send_at",placeholder:t.$trans.get("Select date"),class:"w-full p-0","field-class":"m-0",config:{enableTime:!0,altFormat:"Y-m-d H:i",dateFormat:"Z",altInput:!0,minDate:Date.now(),maxDate:new Date().setHours(168)}},null,8,["modelValue","placeholder","config"]),x("button",{class:K(["w-full btn btn-primary-500 mt-4",{"opacity-75":!i.send_at}]),type:"button",disabled:!i.send_at,onClick:j=>s.scheduleMessage(I,w)},L(t.$trans.get("Schedule")),11,WG)],void 0,!0),_:2},1032,["data"])],512),[[wt,i.showScheduler]])],void 0,!0),_:2},1024)]),_:2},1032,["click-outside-to-close","title","disabled","class"])):P("",!0)],2),[[wt,!i.copyAttachmentsInProgress]])]),_:1},8,["files","html","draft-id","upload-url","upload-inline-url","mention-list","class","editable","show-ai-toolbar","ticket-id","editor-type","ai-loading","onUpdate","ai-loading-action"])):P("",!0)])),i.copyAttachmentsInProgress?(S(),C("div",KG,[x("span",qG,L(t.$trans.get("Preparing attachments. Please wait...")),1),X(p,{class:"ml-1",size:"4"})])):P("",!0),s.ticket?(S(),re(b,{key:4,class:"px-1 md:px-3 3xl:px-6 mt-0",ticket:s.ticket,"new-message-alert-ids":i.newMessageAlertIds,onForward:e[22]||(e[22]=w=>s.forwardMessage(w)),onReply:e[23]||(e[23]=w=>s.replyToMessage(w))},null,8,["ticket","new-message-alert-ids"])):P("",!0)]),e[28]||(e[28]=x("div",{class:"h-20"},null,-1))],void 0,!0),_:1},8,["ops"])],512),[[wt,!s.isLoading&&!s.error&&!t.$store.getters.searchedWithoutResults]]),s.error?(S(),C("div",GG,[s.error.status==404?(S(),C("div",YG,"404 - "+L(t.$trans.get("Ticket not found.")),1)):(S(),C("div",XG,L(s.error.status)+" - "+L(t.$trans.get("Oops, Something went wrong.")),1))])):P("",!0),Ye(x("div",JG,[x("div",QG,[X(p)])],512),[[wt,s.isLoading||!s.ticket&&!s.error]])],2),X(E,{ticket:s.ticket},null,8,["ticket"])])}const eY=Ae(lG,[["render",ZG]]),tY=()=>ne(()=>import("./index-Ba1aykP2.js"),__vite__mapDeps([3,4,1,2,5,6,7])),nY={name:"tickets",path:"/tickets",meta:{basePath:"/tickets/"},component:tY,children:[{name:"tickets-section",path:"/tickets/:section/:id",meta:{basePath:"/tickets/:section/:id/"},component:eY,beforeEnter:(t,e,n)=>{var r;(r=t.params)!=null&&r.id&&(localStorage.initialTicketId=t.params.id),n()}}]},rY=()=>ne(()=>import("./index-CBMNJGe0.js"),__vite__mapDeps([8,5,4,1,2,6,7])),iY=()=>ne(()=>import("./index-ByCgbFnp.js"),__vite__mapDeps([9,10,1,2,4,11,5,12,13,14,6,7])),sY=()=>ne(()=>import("./index-ch4-PdZp.js"),__vite__mapDeps([15,6,1,2,4,7])),oY=()=>ne(()=>import("./index-D5hNKEWf.js"),__vite__mapDeps([16,6,1,2,4,7,5])),aY=()=>ne(()=>import("./index-BVTmdwWZ.js"),__vite__mapDeps([17,4,1,2,5,6,7])),lY=()=>ne(()=>import("./index-B3nNcDfc.js"),__vite__mapDeps([18,10,1,2,4,11,5,12,13,14,6,7])),cY=()=>ne(()=>import("./index-Cj8xPAsm.js"),__vite__mapDeps([19,10,1,2,4,11,5,12,13,14,6,7])),Xb=()=>ne(()=>import("./index-DHvDUiIM.js"),__vite__mapDeps([20,4,1,2,6,7,5])),uY=()=>ne(()=>import("./wizard-BGNQ7DoD.js"),__vite__mapDeps([21,6,1,2,4,7,22,23])),dY=()=>ne(()=>import("./_channel-type-selector-DJXkOhvG.js"),__vite__mapDeps([24,6,1,2,4,7])),fY=()=>ne(()=>import("./_email-CNdKYZBm.js"),__vite__mapDeps([25,4,6,1,2,7])),hY=()=>ne(()=>import("./_create-instagram-Dm79AHeJ.js"),__vite__mapDeps([26,4,6,1,2,7])),pY=()=>ne(()=>import("./_verify-4Z3OwTCs.js"),__vite__mapDeps([27,4,1,2,5,6,7])),mY=()=>ne(()=>import("./_smtp-BeCy_Xyq.js"),__vite__mapDeps([28,4,1,2,6,7])),gY=()=>ne(()=>import("./_forward-BUIaG3k4.js"),__vite__mapDeps([29,4,5,1,2,30])),Jb=()=>ne(()=>import("./index-Dnjn7xBD.js"),__vite__mapDeps([31,4,1,2,32,33,5,6,7])),Qb=()=>ne(()=>import("./index-h9r8GS9Y.js"),__vite__mapDeps([34,4,1,2,6,7,5,35])),vY=()=>ne(()=>import("./index-iSBAvRMN.js"),__vite__mapDeps([36,10,1,2,4,11,5,12,13,14,6,7])),Zb=()=>ne(()=>import("./index-DiYux1sH.js"),__vite__mapDeps([37,10,1,2,4,11,5,12,13,14,38,39,6,7,40])),yY=()=>ne(()=>import("./index-HMZK4hIJ.js"),__vite__mapDeps([41,10,1,2,4,11,5,12,13,14,6,7])),bY=()=>ne(()=>import("./index-dnlpnKKX.js"),__vite__mapDeps([42,1,2])),kY=()=>ne(()=>import("./index-Bz3Gt9e9.js"),__vite__mapDeps([43,1,2,4,5,6,7])),wY={name:"settings",path:"/settings",redirect:"/settings/workspace",meta:{basePath:"/settings/"},component:rY,children:[{name:"workspace",path:"/settings/workspace",meta:{basePath:"/settings/workspace"},component:oY},{name:"users",path:"/settings/users",meta:{basePath:"/settings/users"},component:lY},{name:"teams",path:"/settings/teams",meta:{basePath:"/settings/teams"},component:vY},{name:"event-logs",path:"/settings/event-logs",meta:{basePath:"/settings/event-logs",label:"Event Logs"},component:Zb,children:[{name:"event-log-detail",path:":id",component:Zb,meta:{section:"event-logs"}}]},{name:"tags",path:"/settings/tags",meta:{basePath:"/settings/tags"},component:cY},{name:"quick-replies",path:"/settings/quick-replies",meta:{basePath:"/settings/quick-replies"},component:yY},{name:"feedback",path:"/settings/feedback",meta:{basePath:"/settings/feedback"},component:sY}
146,{name:"channels",path:"/settings/channels",meta:{label:"Channels"},component:Xb,children:[{name:"channel",path:":id",component:Xb,meta:{section:"channels"}}]},{name:"channel-wizard",path:"/settings/channels/wizard",meta:{basePath:"/settings/channels/wizard/",label:"Channels"},component:uY,children:[{name:"channel-type-selector",path:"/settings/channels/wizard/new",components:{wizard:dY},meta:{order:1,canSkip:!1}},{name:"email",path:"/settings/channels/wizard/email",components:{wizard:fY},meta:{order:2,canSkip:!1}},{name:"instagram",path:"/settings/channels/wizard/instagram",components:{wizard:hY},meta:{order:2,canSkip:!1}},{name:"verify",path:"/settings/channels/wizard/verify",components:{wizard:pY},meta:{order:3}},{name:"smtp",path:"/settings/channels/wizard/smtp",components:{wizard:mY},meta:{order:4}},{name:"forward",path:"/settings/channels/wizard/forward",components:{wizard:gY},meta:{order:5}},{name:"final",path:"/settings/channels/wizard/final",redirect:{name:"channels"}}]},{name:"widgets",path:"/settings/widgets",meta:{label:"Widgets"},component:Jb,children:[{name:"widget",path:":id",component:Jb,meta:{section:"widgets"}}]},{name:"rules",path:"/settings/rules",meta:{label:"Rules"},component:Qb,children:[{name:"rule",path:":id",component:Qb,meta:{section:"rules"}}]},{name:"subscription",path:"/settings/subscription",meta:{label:"Subscription"},component:aY},{name:"receipts",path:"/settings/receipts",meta:{label:"Receipts"},component:iY},{name:"integrations",path:"/settings/integrations",meta:{label:"Integrations"},component:bY},{name:"access-tokens",path:"/settings/access-tokens",meta:{label:"Access Tokens"},component:kY}]},xY=()=>ne(()=>import("./index-z6JozCSx.js"),__vite__mapDeps([44,5,4,1,2,6,7])),SY=()=>ne(()=>import("./overview-DLKq2bn3.js"),__vite__mapDeps([45,46,1,2,6,4,7,5,47,48])),TY=()=>ne(()=>import("./performance-Djt06laK.js"),__vite__mapDeps([49,46,1,2,6,4,7,5,47,50])),_Y=()=>ne(()=>import("./docs-Cl979EK-.js"),__vite__mapDeps([51,46,1,2,6,4,7,5,47,50])),EY=()=>ne(()=>import("./customer-satisfaction-B44TJEVO.js"),__vite__mapDeps([52,6,1,2,4,7,5,10,11,12,13,14,47,53])),CY={name:"reports",path:"/reports",redirect:{name:"reports-all"},component:xY,children:[{name:"reports-all",path:"/reports/all",meta:{basePath:"/reports/all"},component:SY},{name:"reports-performance",path:"/reports/performance",meta:{basePath:"/reports/performance"},component:TY},{name:"reports-satisfaction",path:"/reports/satisfaction",meta:{basePath:"/reports/satisfaction"},component:EY},{name:"reports-docs",path:"/reports/docs",meta:{basePath:"/reports/docs"},component:_Y}]},OY=()=>ne(()=>import("./index-DJpWqteb.js"),__vite__mapDeps([54,1,2,4,5,6,7])),AY=()=>ne(()=>import("./index-CNwoqQUM.js"),__vite__mapDeps([55,1,2,4,6,7,5,33,32,56,57])),MY=()=>ne(()=>import("./index-BhhNfK3q.js"),__vite__mapDeps([58,4,11,1,2,5,6,7])),IY=()=>ne(()=>import("./show-DffkvnBe.js"),__vite__mapDeps([59,4,1,2,5,12,6,7,56,60,39,61,62])),LY=()=>ne(()=>import("./wizard-mZGIg9Ob.js"),__vite__mapDeps([63,6,1,2,4,7,22,23])),PY=()=>ne(()=>import("./overview-Cgm5OI1D.js"),__vite__mapDeps([64,5,4,1,2])),RY=()=>ne(()=>import("./_site-vOJelW39.js"),__vite__mapDeps([65,6,1,2,4,7])),$Y=()=>ne(()=>import("./_category-J7SvVdNE.js"),__vite__mapDeps([66,6,1,2,4,7])),DY=()=>ne(()=>import("./_article-Bfl8P7IP.js"),__vite__mapDeps([67,6,1,2,4,7])),NY={path:"/docs",meta:{basePath:"/docs/"},component:OY,children:[{name:"docs",path:"",component:PY},{name:"docs-menu",path:":id/articles",meta:{basePath:":id/articles/"},component:MY,children:[{name:"docs-menu-article-show",path:":articleId",meta:{basePath:":articleId/"},component:IY}]},{name:"docs-settings",path:":id/settings",meta:{basePath:":id/settings/"},component:AY},{name:"docs-wizard",path:"wizard",meta:{basePath:"wizard/"},component:LY,children:[{name:"site",path:"/docs/wizard/site",components:{wizard:RY},meta:{order:1}},{name:"category",path:"/docs/wizard/category",components:{wizard:$Y},meta:{order:2}},{name:"article",path:"/docs/wizard/article",components:{wizard:DY},meta:{order:3}}]}]},FY={name:"InfiniteScroller",props:{tag:{type:String,default:"div"},infiniteScrollDisabled:{type:Boolean,default:!1}},data(){return{observer:null,isComplete:!1}},mounted(){this.observer=new IntersectionObserver(t=>{var e;(e=t[0])!=null&&e.isIntersecting&&!this.infiniteScrollDisabled&&!this.isComplete&&this.$emit("infinite",{loaded:()=>{},complete:()=>{var n;this.isComplete=!0,(n=this.observer)==null||n.disconnect()}})}),this.observer.observe(this.$refs.sentinel)},beforeUnmount(){var t;(t=this.observer)==null||t.disconnect()}};function jY(t,e,n,r,i,s){return S(),re(kr(n.tag),{ref:"sentinel","aria-hidden":"true"},null,512)}
146const qS=Ae(FY,[["render",jY]]),BY={components:{SpmDropdown:Gn,infiniteLoading:qS,SpmTooltip:rr,SpmLoader:xn},data(){return{filter:"all",page:1,busy:!1,loading:!1,activities:[],isOpen:!1}},computed:{getQueryString(){return"&scope="+this.filter}},mounted(){window.Echo.private(this.$store.getters.user.workspace+".ticket").listen("NewTicketMessageCreated",()=>{this.isOpen&&this.fetchActivities()}).listen("NewTicketCreated",()=>{this.isOpen&&this.fetchActivities()})},methods:{selectSection(t){this.filter=t,this.fetchActivities()},open(){this.page=1,this.fetchActivities(),this.isOpen=!0},fetchActivities(){this.page=1,this.busy=!1,this.loading=!0,ze.get("/ticket-activities?page=1"+this.getQueryString).then(t=>{this.activities=t.data.data,this.busy=!t.data.links.next}).finally(()=>{this.loading=!1})},handleLoadMore(t){return this.page=this.page+1,this.busy=!0,ze.get("/ticket-activities?page="+this.page+this.getQueryString).then(e=>{e.data.data.forEach(n=>{this.activities.find(r=>r.id===n.id)||this.activities.push(n)}),this.busy=e.data.meta.current_page>=e.data.meta.last_page,e.data.links.next===null?t.complete():t.loaded()}).catch(()=>{t.complete()})},openActivity(t){this.$router.push({path:"/tickets/all/"+t.ticket_id})},getActorName(t){var e;return((e=t.from)==null?void 0:e.name)||this.$trans.get("System")},usesCardLayout(t){return t.type==="internal"?!0:["external","widget"].includes(t.type)&&!!t.excerpt},usesRepliedStyle(t){if(t.type!=="event")return!0;const e=t.event_key||"";return e==="events.assignee-changed"||e==="events.status-changed"},getCardClasses(t){return t.type==="internal"?"border-orange-200 bg-orange-50/50 group-hover:border-orange-300 group-hover:bg-orange-50/80":"border-gray-200 bg-gray-50 group-hover:border-gray-300 group-hover:bg-white"},getNodeClasses(t){var e;return t.type==="internal"?"border-orange-300":t.is_split?"border-orange-300 text-orange-500":t.type==="event"?(t.event_key||"").includes("status")?"border-gray-300 text-gray-600":"border-gray-200 text-gray-750":(e=t.from)!=null&&e.is_agent?"border-primary-200 text-primary-600":"border-gray-200 text-gray-750"},getActionLabel(t){var e;if(t.type==="event"){const n=t.event_key||"";if(n==="events.assignee-changed"){const r=t.event_new_value||this.$trans.get("Unassigned");return" "+this.$trans.get("assigned :assignee",{assignee:' <span class="font-semibold text-gray-900">'+r+"</span>"})}if(n==="events.status-changed"){const r=this.$trans.get(t.event_new_value||"");return" "+this.$trans.get("changed status to")+' <span class="font-semibold text-gray-900">'+r+"</span>"}}return t.type==="internal"?t.is_mention?" "+this.$trans.get("mentioned you"):" "+this.$trans.get("added a note"):(e=t.from)!=null&&e.is_agent?" "+this.$trans.get("replied"):" "+this.$trans.get("replied")},getActivityIcon(t){var e;if(t.is_split)return"custom-split";if(t.type==="internal")return t.is_mention?"feather-at-sign":"feather-file-text";if(t.type==="event"){const n=t.event_key||"";return n.includes("assignee")?"feather-user":n.includes("status")?"feather-circle":n.includes("team")?"feather-users":n.includes("channel")?"feather-hash":n.includes("contact")?"feather-user":n.includes("subject")?"feather-edit-2":n.includes("watchers")?"feather-eye":n.includes("ticket-created")?"feather-inbox":"feather-activity"}return(e=t.from)!=null&&e.is_agent?"feather-corner-up-left":"feather-mail"}}},HY=["innerHTML"],UY={class:"text-center font-display text-xl px-2 font-bold text-gray-700 w-full mt-2 pb-4"},VY={class:"flex mb-3 w-full justify-center"},zY={class:"flex bg-gray-200 rounded-lg py-1"},WY=["onClick"],KY={class:"min-h-100 max-h-140 overflow-y-auto"},qY=["onClick"],GY={key:0,class:"absolute left-3 top-7 bottom-0 w-px bg-gray-200 transition-colors group-hover:bg-gray-300"},YY={class:"relative z-10 flex-shrink-0"},XY=["src","alt"],JY=["innerHTML"],QY={class:"flex-grow min-w-0 pt-0.5"},ZY={class:"flex items-start justify-between gap-2"},eX={class:"flex-grow min-w-0 text-xs text-gray-700 leading-tight"},tX={class:"font-semibold text-gray-900"},nX=["innerHTML"],rX=["innerHTML"],iX={class:"mt-0.5 text-[11px] text-gray-750 truncate"},sX={key:0,class:"mt-1.5 rounded-md border border-gray-250 bg-white px-2 py-1 text-[11px] text-gray-700 leading-snug activity-excerpt"},oX={key:"loading",class:"flex w-full justify-center mt-10 pb-6"},aX={key:"empty",class:"w-full text-center text-gray-650 font-medium mt
146-10 pb-6"};function lX(t,e,n,r,i,s){const o=z("spm-tooltip"),a=z("spm-loader"),l=z("infinite-loading"),c=z("spm-dropdown");return S(),re(c,{ref:"dropdown",placement:"bottom-end","dropdown-class":"lg:w-[36rem] lg:max-w-180 max-h-screen","hide-after-dropdown-click":!1,onOpen:e[0]||(e[0]=u=>s.open()),onClose:e[1]||(e[1]=u=>i.isOpen=!1)},{trigger:Y(()=>[x("button",{class:"relative text-gray-600 h-8 text-right pt-px px-1 focus:text-gray-700 focus:bg-gray-500 rounded-lg",innerHTML:t.svg("feather-activity","stroke-icon h-4")},null,8,HY)]),dropdown:Y(()=>[x("div",UY,L(t.$trans.get("Recent Activity")),1),x("div",VY,[x("div",zY,[(S(),C(Fe,null,nt(["all","assigned","watching"],u=>x("button",{key:u,class:K(["block p-1 px-3 mx-1 font-medium rounded-lg transition-all",i.filter==u?"bg-white shadow-md text-gray-700":"hover:bg-gray-400"]),onClick:d=>s.selectSection(u)},L(t.$trans.get(t.$filters._upperFirst(u))),11,WY)),64))])]),x("div",KY,[X($i,{tag:"div",name:"list",class:"relative px-4 py-2"},{default:Y(()=>[(S(!0),C(Fe,null,nt(i.activities,(u,d)=>(S(),C("div",{key:u.id,class:K(["relative flex gap-3 group cursor-pointer",d<i.activities.length-1?"pb-5":"pb-1"]),onClick:f=>s.openActivity(u)},[d<i.activities.length-1?(S(),C("div",GY)):P("",!0),x("div",YY,[x("div",{class:K(["flex h-6 w-6 items-center justify-center rounded-full border bg-white shadow-sm overflow-hidden",s.getNodeClasses(u)])},[u.from&&u.from.avatar?(S(),C("img",{key:0,src:u.from.avatar,alt:u.from.name,class:"h-full w-full object-cover"},null,8,XY)):(S(),C("div",{key:1,class:K(["flex items-center justify-center",{"text-orange-500":u.is_split}]),innerHTML:t.svg(s.getActivityIcon(u),"stroke-icon h-3 w-3")},null,10,JY))],2)]),x("div",QY,[x("div",{class:K(s.usesCardLayout(u)?"rounded-lg border p-2 transition-all "+s.getCardClasses(u):"group-hover:rounded-lg group-hover:bg-gray-50 px-0.5 py-0.5")},[x("div",ZY,[x("div",eX,[s.usesRepliedStyle(u)?(S(),C(Fe,{key:0},[x("span",tX,L(s.getActorName(u)),1),x("span",{innerHTML:s.getActionLabel(u)},null,8,nX)],64)):u.type==="event"?(S(),C("span",{key:1,class:K({"text-orange-600":u.is_split}),innerHTML:u.translation||""},null,10,rX)):P("",!0)]),X(o,{tooltip:t.$filters.datetime(u.created_at),placement:"top",tag:"span",class:"flex-none text-[11px] text-gray-750 whitespace-nowrap pt-px"},{default:Y(()=>[Me(L(t.$filters.distanceInWordsToNow(u.created_at)),1)],void 0,!0),_:2},1032,["tooltip"])]),x("div",iX," #"+L(u.ticket_id)+" · "+L(u.ticket_subject),1),u.excerpt?(S(),C("div",sX,L(u.excerpt),1)):P("",!0)],2)])],10,qY))),128)),i.loading?(S(),C("div",oX,[X(a,{"show-instant":"",class:"w-6"})])):i.activities.length?P("",!0):(S(),C("div",aX,L(t.$trans.get("No recent activity")),1)),X(l,{key:"infinite-loading",class:"invisible",tag:"span","infinite-scroll-disabled":i.busy,"infinite-scroll-throttle-delay":"1000","infinite-scroll-immediate-check":"",onDistance:u=>1,onInfinite:s.handleLoadMore},null,8,["infinite-scroll-disabled","onInfinite"])],void 0,!0),_:1})])]),_:1},512)}const cX=Ae(BY,[["render",lX],["__scopeId","data-v-285115a9"]]),uX={components:{SpmTooltip:rr},props:{tags:{type:Array,required:!0},tag:{type:String,default:"span"}}};function dX(t,e,n,r,i,s){const o=z("spm-tooltip");return n.tags?(S(),re(o,{key:0,tag:"div",tooltip:n.tags.map(function(a){return a.name}).join(", "),class:"flex-shrink mx-2"},{default:Y(()=>[(S(!0),C(Fe,null,nt(n.tags,(a,l)=>(S(),C("span",{key:l,class:"inline-block h-2 w-2 self-center rounded-md mr-1",style:Ir({background:a.color})},null,4))),128))],void 0,!0),_:1},8,["tooltip"])):P("",!0)}const fX=Ae(uX,[["render",dX]]),hX={components:{SpmDropdown:Gn,SpmTaskStatus:Mm,infiniteLoading:qS,SpmTooltip:rr,SpmTagsTiny:fX},props:{breadcrumb:{type:Array,default:()=>[]}},data(){return{filter:"open",page:1,busy:!1,tasks:[],isOpen:!1}},computed:{tasksCount(){return this.tasks.length},getQueryString(){let t="";switch(this.filter){case"open":t=t+"&done=0";break;case"done":t=t+"&done=1";break;case"overdue":t=t+"&overdue=1";break}return t}},mounted(){window.Echo.private(this.$store.getters.user.workspace+".tasks").listen(".TaskCreated",t=>{this.isOpen&&this.tasksFetchTaskList()}).listen(".TaskUpdated",t=>{this.isOpen&&this.tasksFetchTaskList()}).listen(".TaskDeleted",t=>{this.isOpen&&this.tasksFetchTaskList()})},methods:{selectSection(t){this.filter=t,this.tasksFetchTaskList()},open(){this.tasksFetchTaskList(),this.isOpen=!0},handleLoadMore(t){this.page=this.page+1,this.busy=!0;let e=this;return axios.get("/tasks/list/?page="+this.page+"&assignees[]="+this.$store.getters.user.id).then(n=>
146{n.data.data.forEach(function(r){e.$store.commit("addTaskToGlobalTaskList",r)}),this.busy=n.data.meta.current_page>=n.data.meta.last_page,n.data.links.next===null?t.complete():t.loaded()})},tasksFetchTaskList(){axios.get("/tasks/list?&assignees[]="+this.$store.getters.user.id+this.getQueryString).then(t=>{this.tasks=t.data.data})}}},pX=["innerHTML"],mX={class:"text-center font-display text-xl px-2 font-bold text-gray-700 w-full mt-2 pb-4"},gX={class:"flex mb-3 w-full justify-center"},vX={class:"flex bg-gray-200 rounded-lg py-1"},yX=["onClick"],bX={class:"h-100 overflow-y-auto"},kX=["onClick"],wX={key:0,class:"italic text-xs"},xX=["innerHTML"],SX=["src"],TX={key:"empty",class:"w-full text-center text-gray-650 font-medium mt-10"};function _X(t,e,n,r,i,s){const o=z("spm-task-status"),a=z("spm-tooltip"),l=z("spm-tags-tiny"),c=z("infinite-loading"),u=z("spm-dropdown");return S(),re(u,{ref:"dropdown",placement:"bottom-end","dropdown-class":"lg:w-[27rem] lg:max-w-140 max-h-screen",onOpen:e[0]||(e[0]=d=>s.open()),onClose:e[1]||(e[1]=d=>i.isOpen=!1)},{trigger:Y(()=>[x("button",{class:K(["relative text-gray-600 h-8 text-right pt-px px-1 focus:text-gray-700 focus:bg-gray-500 rounded-lg",{"indicator-red-500":!1}]),innerHTML:t.svg("feather-check-square","stroke-icon h-4")},null,8,pX)]),dropdown:Y(()=>[x("div",mX,L(t.$trans.get("My Tasks")),1),x("div",gX,[x("div",vX,[(S(),C(Fe,null,nt(["open","overdue","done"],d=>x("button",{key:d,class:K(["block p-1 px-3 mx-1 font-medium rounded-lg transition-all",i.filter==d?"bg-white shadow-md text-gray-700":"hover:bg-gray-400"]),onClick:f=>s.selectSection(d)},L(t.$trans.get(t.$filters._upperFirst(d))),11,yX)),64))])]),x("div",bX,[X($i,{tag:"div",name:"list",class:"flex flex-wrap w-full px-1"},{default:Y(()=>[(S(!0),C(Fe,null,nt(i.tasks,d=>(S(),C("div",{key:d.id,class:"flex w-full py-2 items-center text-sm border-t first:border-t-0"},[X(o,{compact:"",task:d},null,8,["task"]),x("div",{class:K(["flex-grow overflow-hidden break-all leading-snug mr-2",{"line-through opacity-75":!!d.done_at}])},[x("div",{class:"cursor-pointer",onClick:f=>(t.$store.dispatch("viewTask",d.id),t.$refs.dropdown.hide())},L(d.title),9,kX),d.tickets&&d.tickets.length>0?(S(),C("div",wX,[Me(L(t.$trans.get("Related Tickets"))+": ",1),(S(!0),C(Fe,null,nt(d.tickets,(f,p)=>(S(),re(a,{key:p,tooltip:f.subject,placement:"top",class:"text-gray-600 cursor-pointer"},{default:Y(()=>[Me(" #"+L(f.id)+", ",1)],void 0,!0),_:2},1032,["tooltip"]))),128))])):P("",!0)],2),d.tags?(S(),re(l,{key:0,class:"flex-shrink",tags:d.tags},null,8,["tags"])):P("",!0),d.due_at?(S(),re(a,{key:1,tooltip:`${t.$filters.datetime(d.due_at)} - ${t.$filters.distanceInWordsToNow(d.due_at)}`,placement:"top",tag:"div",class:K(["flex-none mr-3 w-3 items-center",d.is_overdue?"text-red-500":"text-gray-500"])},{default:Y(()=>
146[d.due_at?(S(),C("div",{key:0,class:"self-center",innerHTML:t.svg("feather-calendar","stroke-icon h-4")},null,8,xX)):P("",!0)],void 0,!0),_:2},1032,["tooltip","class"])):P("",!0),d.assignee?(S(),re(a,{key:2,tooltip:d.assignee.name,placement:"top",tag:"div",class:"flex-none rounded-lg mr-2 h-5 w-5"},{default:Y(()=>[d.assignee?(S(),C("img",{key:0,src:d.assignee.avatar,class:"avatar rounded-lg mr-2 h-5 w-5"},null,8,SX)):P("",!0)],void 0,!0),_:2},1032,["tooltip"])):P("",!0)]))),128)),i.tasks.length?P("",!0):(S(),C("div",TX,L(t.$trans.get("No Tasks found")),1)),X(c,{key:"infinite-loading",class:"invisible",tag:"span","infinite-scroll-disabled":i.busy,"infinite-scroll-throttle-delay":"1000","infinite-scroll-immediate-check":"",onDistance:d=>1,onInfinite:s.handleLoadMore},null,8,["infinite-scroll-disabled","onInfinite"])],void 0,!0),_:1})])]),_:1},512)}const EX=Ae(hX,[["render",_X]]),CX={components:{SpmDropdown:Gn,SpmNavigationTasks:EX,SpmNavigationActivities:cX},props:{breadcrumb:{type:Array,default:()=>[]}},computed:{tasksCount(){return this.$store.getters.tasks.tasks.length}},methods:{openWidget(){window.HelpWidget("open")},openTourModal(){this.$store.commit("showFormModal",{component:"settings/onboard-status/_video-product-demo.modal.vue",params:{action:"view",openOnboardStatus:()=>null}})},logout(){ze.post("/logout").then(t=>{(t.status===204||t.status===302)&&window.location.reload()}).catch(t=>{(t.response.status===302||t.response.status===401)&&window.location.reload()})}}},OX={id:"spm_top_navigation",class:"flex content-center h-13 w-full"},AX={class:"flex text-gray-650 p-2 text-left items-center text-sm"},MX=["innerHTML"],IX=["onClick","textContent"],LX=["innerHTML"],PX=["innerHTML"],RX=["innerHTML"],$X=["innerHTML"],DX={class:"flex"},NX={class:"rounded-lg mx-2 mr-4 focus:ring-2 focus:ring-primary-500"},FX=["src"],jX={ref:"options",class:"spm-list"},BX={class:"px-2 py-2"},HX={class:"block pt-1"},UX={style:{padding:"0"}},VX={style:{padding:"0"}};function zX(t,e,n,r,i,s){const o=z("spm-navigation-tasks"),a=z("spm-navigation-activities"),l=z("spm-dropdown");return S(),C("div",OX,[x("div",{class:K(["w-screen md:w-2/3 p-2 md:flex",{hidden:!t.$store.getters.listIsVisible}])},[x("div",AX,[x("button",{class:"flex w-6 mr-3 hover:cursor-pointer hover:text-primary-500 focus:bg-gray-500 rounded spm-ticket-list-add-keylistener",onClick:e[0]||(e[0]=c=>t.$store.commit("toggleSubMenuLeft")),innerHTML:t.svg("feather-menu","stroke-icon h-5")},null,8,MX),(S(!0),C(Fe,null,nt(n.breadcrumb,(c,u)=>(S(),C("div",{key:c.name,class:K(["flex truncate",{"font-medium":u==n.breadcrumb.length-1,hidden:c.hidden}])},[c.path?(S(),C("span",{key:0,class:"hover:cursor-pointer hover:underline",onClick:d=>t.$router.push({path:c.path}),textContent:L(c.name)},null,8,IX)):(S(),C(Fe,{key:1},[Me(L(c.name),1)],64)),c.arrow&&u!=n.breadcrumb.length-1?(S(),C("div",{key:2,class:"flex w-6 mt-px",innerHTML:t.svg("feather-chevron-right","stroke-icon mx-auto h-4")},null,8,LX)):P("",!0)],2))),128))])],2),x("div",{class:K(["flex self-center md:flex w-screen md:w-1/3 h-10 justify-end items-center",{hidden:t.$store.getters.listIsVisible}])},[x("div",{class:K(["md:hidden text-gray-600 text-right pt-px px-2 mr-3 ml-2",t.$store.getters.viewIsVisible?"mr-3":"mr-auto"]),onClick:e[1]||(e[1]=c=>t.$store.getters.viewIsVisible?t.$store.commit("showList"):t.$store.commit("showView")),innerHTML:t.svg("feather-arrow-left","stroke-icon h-5")},null,10,PX),x("div",{class:K(["md:hidden text-gray-600 text-right pt-px px-2 mr-auto ml-2",{hidden:!t.$store.getters.viewIsVisible}]),onClick:e[2]||(e[2]=c=>t.$store.commit("showInfo")),innerHTML:t.svg("feather-arrow-right","stroke-icon h-5")},null,10,RX),t.$store.getters.isTrial&&t.$store.getters.trialEndsAt&&!t.$store.getters.trialHasEnded?(S(),C("button",{key:0,class:"rounded-lg text-xs text-orange-800 p-2 py-1 bg-orange-300 mr-3 font-bold",onClick:e[3]||(e[3]=c=>t.$router.push({path:"/settings/subscription"}))},L(t.$trans.get("Your trial ends"))+" "+L(t.$filters.distanceInWordsToNow(t.$store.getters.trialEndsAt)),1)):P("",!0),t.$store.getters.isTrial&&t.$store.getters.trialHasEnded?(S(),C("button",{key:1,class:"rounded-lg text-xs text-red-800 p-2 py-1 bg-red-300 mr-3 font-bold",onClick:e[4]||(e[4]=c=>t.$router.push({path:"/settings/subscription"}))},L(t.$trans.get("Your trial has ended! Upgrade now!")),1)):P("",!0),x("button",{type:"button",class:"relative text-gray-600 h-8 text-right pt-px px-1 focus:text-gray-700 focus:bg-gray-500 rounded-lg",onClick:e[5]||(e[5]=c=>t.$store.commit("showCommandBarModal")),innerHTML:t.svg("feather-search","stroke-icon h-4")},null,8,$X),t.$store.getters.customerInfo.conditions.scrumBoards?(S(),re(o,{key:2})):P("",!0),X(a),X(l,{small:!0,"hide-after-dropdown-click":!0,placement:"bottom-end"},{trigger:Y(()=>[x("div",DX,[x("button",NX,[x("img",{class:"rounded-lg h-6 w-6 cursor-pointer avatar",src:t.$store.getters.user.avatar},null,8,FX)])])]),dropdown:Y(()=>[x("ul",jX,[x("div",BX,[Me(L(t.$trans.get("Signed in as"))+" ",1),e[10]||(e[10]=x("br",null,null,-1)),x("b",HX,L(t.$store.getters.user.name),1)]),e[11]||(e[11]=x("hr",{class:"-mx-4 my-2"},null,-1)),x("li",{onClick:e[6]||(e[6]=c=>t.$store.commit("showFormModal",{component:"auth/profile/_edit.modal.vue",params:t.$store.getters.user}))},L(t.$trans.get("Your Profile")),1),x("li",UX,[x("a",{class:"block px-3 py-2",onClick:e[7]||(e[7]=c=>s.openWidget())},L(t.$trans.get("Help")),1)]),x("li",VX,[x("a",{class:"block px-3 py-2",onClick:e[8]||(e[8]=c=>s.openTourModal())},L(t.$trans.get("Product Tour")),1)]),e[12]||(e[12]=x("hr",{class:"-mx-4 my-2"},null,-1)),x("li",{onClick:e[9]||(e[9]=c=>s.logout())},L(t.$trans.get("Sign out")),1)],512)]),_:1})],2)])}const WX=Ae(CX,[["render",zX]]);var GS={exports:{}};const KX=ck(MC);/**! 147 * Sortable 1.14.0 148 * @author RubaXa <[email protected]> 149 * @author owenm <[email protected]> 150 * @license MIT 151 */function e0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function li(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
vendor: 4,520 bytes, lines 151-152
151e%2?e0(Object(n),!0).forEach(function(r){qX(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e0(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Zc(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Zc=function(e){return typeof e}:Zc=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zc(t)}function qX(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function br(){return br=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},br.apply(this,arguments)}function GX(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function YX(t,e){if(t==null)return{};var n=GX(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function XX(t){return JX(t)||QX(t)||ZX(t)||eJ()}function JX(t){if(Array.isArray(t))return kp(t)}function QX(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ZX(t,e){if(t){if(typeof t=="string")return kp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kp(t,e)}}function kp(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function eJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 152In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var tJ="1.14.0";function Mi(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Ni=Mi(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),cc=Mi(/Edge/i),t0=Mi(/firefox/i),dl=Mi(/safari/i)&&!Mi(/chrome/i)&&!Mi(/android/i),YS=Mi(/iP(ad|od|hone)/i),nJ=Mi(/chrome/i)&&Mi(/android/i),XS={capture:!1,passive:!1};function St(t,e,n){t.addEventListener(e,n,!Ni&&XS)}function kt(t,e,n){t.removeEventListener(e,n,!Ni&&XS)}function id(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function rJ(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Cr(t,e,n,r){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&id(t,e):id(t,e))||r&&t===n)return t;if(t===n)break}while(t=rJ(t))}return null}var n0=/\s+/g;function Wt(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(n0," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(n0," ")}}function Be(t,e,n){var r=t&&t.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=n+(typeof n=="string"?"":"px")}}function Js(t,e){var n="";if(typeof t=="string")n=t;else do{var r=Be(t,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function JS(t,e,n){if(t){var r=t.getElementsByTagName(e),i=0,s=r.length;if(n)for(;i<s;i++)n(r[i],i);return r}return[]}function ni(){var t=document.scrollingElement;return t||document.documentElement}function Vt(t,e,n,r,i){if(!(!t.getBoundingClientRect&&t!==window)){var s,o,a,l,c,u,d;if(t!==window&&t.parentNode&&t!==ni()?(s=t.getBoundingClientRect(),o=s.top,a=s.left,l=s.bottom,c=s.right,u=s.height,d=s.width):(o=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!Ni))do if(i&&i.getBoundingClientRect&&(Be(i,"transform")!=="none"||n&&Be(i,"position")!=="static")){var f=i.getBoundingClientRect();o-=f.top+parseInt(Be(i,"border-top-width")),a-=f.left+parseInt(Be(i,"border-left-width")),l=o+s.height,c=a+s.width;break}while(i=i.parentNode);
vendor: 4,123 bytes, line 152
152if(r&&t!==window){var p=Js(i||t),h=p&&p.a,g=p&&p.d;p&&(o/=g,a/=h,d/=h,u/=g,l=o+u,c=a+d)}return{top:o,left:a,bottom:l,right:c,width:d,height:u}}}function r0(t,e,n){for(var r=Ji(t,!0),i=Vt(t)[e];r;){var s=Vt(r)[n],o=void 0;if(o=i>=s,!o)return r;if(r===ni())break;r=Ji(r,!1)}return!1}function la(t,e,n,r){for(var i=0,s=0,o=t.children;s<o.length;){if(o[s].style.display!=="none"&&o[s]!==et.ghost&&(r||o[s]!==et.dragged)&&Cr(o[s],n.draggable,t,!1)){if(i===e)return o[s];i++}s++}return null}function Cg(t,e){for(var n=t.lastElementChild;n&&(n===et.ghost||Be(n,"display")==="none"||e&&!id(n,e));)n=n.previousElementSibling;return n||null}function Jt(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==et.clone&&(!e||id(t,e))&&n++;return n}function i0(t){var e=0,n=0,r=ni();if(t)do{var i=Js(t),s=i.a,o=i.d;e+=t.scrollLeft*s,n+=t.scrollTop*o}while(t!==r&&(t=t.parentNode));return[e,n]}function iJ(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===t[n][r])return Number(n)}return-1}function Ji(t,e){if(!t||!t.getBoundingClientRect)return ni();var n=t,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=Be(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return ni();if(r||e)return n;r=!0}}while(n=n.parentNode);return ni()}function sJ(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Qf(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var fl;function QS(t,e){return function(){if(!fl){var n=arguments,r=this;n.length===1?t.call(r,n[0]):t.apply(r,n),fl=setTimeout(function(){fl=void 0},e)}}}function oJ(){clearTimeout(fl),fl=void 0}function ZS(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Og(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function s0(t,e){Be(t,"position","absolute"),Be(t,"top",e.top),Be(t,"left",e.left),Be(t,"width",e.width),Be(t,"height",e.height)}function Zf(t){Be(t,"position",""),Be(t,"top",""),Be(t,"left",""),Be(t,"width",""),Be(t,"height","")}var An="Sortable"+new Date().getTime();function aJ(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(Be(i,"display")==="none"||i===et.ghost)){t.push({target:i,rect:Vt(i)});var s=li({},t[t.length-1].rect);if(i.thisAnimationDuration){var o=Js(i,!0);o&&(s.top-=o.f,s.left-=o.e)}i.fromRect=s}})}},addAnimationState:function(r){t.push(r)},removeAnimationState:function(r){t.splice(iJ(t,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var s=!1,o=0;t.forEach(function(a){var l=0,c=a.target,u=c.fromRect,d=Vt(c),f=c.prevFromRect,p=c.prevToRect,h=a.rect,g=Js(c,!0);g&&(d.top-=g.f,d.left-=g.e),c.toRect=d,c.thisAnimationDuration&&Qf(f,d)&&!Qf(u,d)&&(h.top-d.top)/(h.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=cJ(h,f,p,i.options)),Qf(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=i.options.animation),i.animate(c,h,d,l)),l&&(s=!0,o=Math.max(o,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(e),s?e=setTimeout(function(){typeof r=="function"&&r()},o):typeof r=="function"&&r(),t=[]},animate:function(r,i,s,o){if(o){Be(r,"transition",""),Be(r,"transform","");var a=Js(this.el),l=a&&a.a,c=a&&a.d,u=(i.left-s.left)/(l||1),d=(i.top-s.top)/(c||1);r.animatingX=!!u,r.animatingY=!!d,Be(r,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=lJ(r),Be(r,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),Be(r,"transform","translate3d(0,
1520,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){Be(r,"transition",""),Be(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},o)}}}}function lJ(t){return t.offsetWidth}function cJ(t,e,n,r){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*r.animation}var xo=[],eh={initializeByDefault:!0},uc={mount:function(e){for(var n in eh)eh.hasOwnProperty(n)&&!(n in e)&&(e[n]=eh[n]);xo.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),xo.push(e)},pluginEvent:function(e,n,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var s=e+"Global";xo.forEach(function(o){n[o.pluginName]&&(n[o.pluginName][s]&&n[o.pluginName][s](li({sortable:n},r)),n.options[o.pluginName]&&n[o.pluginName][e]&&n[o.pluginName][e](li({sortable:n},r)))})},initializePlugins:function(e,n,r,i){xo.forEach(function(a){var l=a.pluginName;if(!(!e.options[l]&&!a.initializeByDefault)){var c=new a(e,n,e.options);c.sortable=e,c.options=e.options,e[l]=c,br(r,c.defaults)}});for(var s in e.options)if(e.options.hasOwnProperty(s)){var o=this.modifyOption(e,s,e.options[s]);typeof o<"u"&&(e.options[s]=o)}},getEventProperties:function(e,n){var r={};return xo.forEach(function(i){typeof i.eventProperties=="function"&&br(r,i.eventProperties.call(n[i.pluginName],e))}),r},modifyOption:function(e,n,r){var i;return xo.forEach(function(s){e[s.pluginName]&&s.optionListeners&&typeof s.optionListeners[n]=="function"&&(i=s.optionListeners[n].call(e[s.pluginName],r))}),i}};function Ha(t){var e=t.sortable,n=t.rootEl,r=t.name,i=t.targetEl,s=t.cloneEl,o=t.toEl,a=t.from
vendor: 4,356 bytes, line 152
152El,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,f=t.originalEvent,p=t.putSortable,h=t.extraEventProperties;if(e=e||n&&n[An],!!e){var g,m=e.options,b="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Ni&&!cc?g=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(r,!0,!0)),g.to=o||n,g.from=a||n,g.item=i||n,g.clone=s,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=f,g.pullMode=p?p.lastPutMode:void 0;var T=li(li({},h),uc.getEventProperties(r,e));for(var E in T)g[E]=T[E];n&&n.dispatchEvent(g),m[b]&&m[b].call(e,g)}}var uJ=["evt"],Un=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,s=YX(r,uJ);uc.pluginEvent.bind(et)(e,n,li({dragEl:Se,parentEl:qt,ghostEl:pt,rootEl:Ht,nextEl:As,lastDownEl:eu,cloneEl:Gt,cloneHidden:qi,dragStarted:Ua,putSortable:gn,activeSortable:et.active,originalEvent:i,oldIndex:Ro,oldDraggableIndex:hl,newIndex:Qn,newDraggableIndex:Wi,hideGhostForTarget:rT,unhideGhostForTarget:iT,cloneNowHidden:function(){qi=!0},cloneNowShown:function(){qi=!1},dispatchSortableEvent:function(a){Rn({sortable:n,name:a,originalEvent:i})}},s))};function Rn(t){Ha(li({putSortable:gn,cloneEl:Gt,targetEl:Se,rootEl:Ht,oldIndex:Ro,oldDraggableIndex:hl,newIndex:Qn,newDraggableIndex:Wi},t))}var Se,qt,pt,Ht,As,eu,Gt,qi,Ro,Qn,hl,Wi,Pc,gn,Mo=!1,sd=!1,od=[],_s,xr,th,nh,o0,a0,Ua,So,pl,ml=!1,Rc=!1,tu,_n,rh=[],wp=!1,ad=[],Kd=typeof document<"u",$c=YS,l0=cc||Ni?"cssFloat":"float",dJ=Kd&&!nJ&&!YS&&"draggable"in document.createElement("div"),eT=function(){if(Kd){if(Ni)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),tT=function(e,n){var r=Be(e),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),s=la(e,0,n),o=la(e,1,n),a=s&&Be(s),l=o&&Be(o),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Vt(s).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Vt(o).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return o&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return s&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=i&&r[l0]==="none"||o&&r[l0]==="none"&&c+u>i)?"vertical":"horizontal"},fJ=function(e,n,r){var i=r?e.left:e.top,s=r?e.right:e.bottom,o=r?e.width:e.height,a=r?n.left:n.top,l=r?n.right:n.bottom,c=r?n.width:n.height;return i===a||s===l||i+o/2===a+c/2},hJ=function(e,n){var r;return od.some(function(i){var s=i[An].options.emptyInsertThreshold;if(!(!s||Cg(i))){var o=Vt(i),a=e>=o.left-s&&e<=o.right+s,l=n>=o.top-s&&n<=o.bottom+s;if(a&&l)return r=i}}),r},nT=function(e){function n(s,o){return function(a,l,c,u){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(s==null&&(o||d))return!0;if(s==null||s===!1)return!1;if(o&&s==="clone")return s;if(typeof s=="function")return n(s(a,l,c,u),o)(a,l,c,u);var f=(o?a:l).options.group.name;return s===!0||typeof s=="string"&&s===f||s.join&&s.indexOf(f)>-1}}var r={},i=e.group;(!i||Zc(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=n(i.pull,!0),r.checkPut=n(i.put),r.revertClone=i.revertClone,e.group=r},rT=function(){!eT&&pt&&Be(pt,"display","none")},iT=function(){!eT&&pt&&Be(pt,"display","")};Kd&&document.addEventListener("click",function(t){if(sd)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),sd=!1,!1},!0);var Es=function(e){if(Se){e=e.touches?e.touches[0]:e;var n=hJ(e.clientX,e.clientY);if(n){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[An]._onDragOver(r)}}},pJ=function(e){Se&&Se.parentNode[An]._isOutsideThisEl(e.target)};function et(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=br({},e),t[An]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.no
vendor: 4,676 bytes, line 152
152deName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return tT(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,a){o.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:et.supportPointer!==!1&&"PointerEvent"in window&&!dl,emptyInsertThreshold:5};uc.initializePlugins(this,t,n);for(var r in n)!(r in e)&&(e[r]=n[r]);nT(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:dJ,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?St(t,"pointerdown",this._onTapStart):(St(t,"mousedown",this._onTapStart),St(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(St(t,"dragover",this),St(t,"dragenter",this)),od.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),br(this,aJ())}et.prototype={constructor:et,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(So=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,Se):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,r=this.el,i=this.options,s=i.preventOnFilter,o=e.type,a=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(a||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=i.filter;if(xJ(r),!Se&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||i.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&dl&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=Cr(l,i.draggable,r,!1),!(l&&l.animated)&&eu!==l)){if(Ro=Jt(l),hl=Jt(l,i.draggable),typeof u=="function"){if(u.call(this,e,l,this)){Rn({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),Un("filter",n,{evt:e}),s&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=Cr(c,d.trim(),r,!1),d)return Rn({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),Un("filter",n,{evt:e}),!0}),u)){s&&e.cancelable&&e.preventDefault();return}i.handle&&!Cr(c,i.handle,r,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,n,r){var i=this,s=i.el,o=i.options,a=s.ownerDocument,l;if(r&&!Se&&r.parentNode===s){var c=Vt(r);if(Ht=s,Se=r,qt=Se.parentNode,As=Se.nextSibling,eu=r,Pc=o.group,et.dragged=Se,_s={target:Se,clientX:(n||e).clientX,clientY:(n||e).clientY},o0=_s.clientX-c.left,a0=_s.clientY-c.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,Se.style["will-change"]="all",l=function(){if(Un("delayEnded",i,{evt:e}),et.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!t0&&i.nativeDraggable&&(Se.draggable=!0),i._triggerDragStart(e,n),Rn({sortable:i,name:"choose",originalEvent:e}),Wt(Se,o.chosenClass,!0)},o.ignore.split(",").forEach(function(u){JS(Se,u.trim(),ih)}),St(a,"dragover",Es),St(a,"mousemove",Es),St(a,"touchmove",Es),St(a,"mouseup",i._onDrop),St(a,"touchend",i._onDrop),St(a,"touchcancel",i._onDrop),t0&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Se.draggable=!0),Un("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(cc||Ni))){if(et.eventCanceled){this._onDrop();return}St(a,"mouseup",i._disableDelayedDrag),St(a,"touchend",i._disableDelayedDrag),St(a,"touchcancel",i._disableDelayedDrag),St(a,"mousemove",i._delayedDragTouchMoveHandler),St(a,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&St(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(l,o.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Se&&ih(Se),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;kt(e,"mouseup",this._disableDelayedDrag),kt(e,"touchend",this._disableDelayedDrag),kt(e,"touchcancel",this._disableDelayedDrag),kt(e,"mousemove",this._delayedDragTouchMoveHandler),kt(e,"touchmove",this._delayedDragTouchMoveHandler),kt(e,"pointermove",this._delayedDragTouchMoveHandler)}
vendor: 4,098 bytes, line 152
152,_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?St(document,"pointermove",this._onTouchMove):n?St(document,"touchmove",this._onTouchMove):St(document,"mousemove",this._onTouchMove):(St(Se,"dragend",this),St(Ht,"dragstart",this._onDragStart));try{document.selection?nu(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(Mo=!1,Ht&&Se){Un("dragStarted",this,{evt:n}),this.nativeDraggable&&St(document,"dragover",pJ);var r=this.options;!e&&Wt(Se,r.dragClass,!1),Wt(Se,r.ghostClass,!0),et.active=this,e&&this._appendGhost(),Rn({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(xr){this._lastX=xr.clientX,this._lastY=xr.clientY,rT();for(var e=document.elementFromPoint(xr.clientX,xr.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(xr.clientX,xr.clientY),e!==n);)n=e;if(Se.parentNode[An]._isOutsideThisEl(e),n)do{if(n[An]){var r=void 0;if(r=n[An]._onDragOver({clientX:xr.clientX,clientY:xr.clientY,target:e,rootEl:n}),r&&!this.options.dragoverBubble)break}e=n}while(n=n.parentNode);iT()}},_onTouchMove:function(e){if(_s){var n=this.options,r=n.fallbackTolerance,i=n.fallbackOffset,s=e.touches?e.touches[0]:e,o=pt&&Js(pt,!0),a=pt&&o&&o.a,l=pt&&o&&o.d,c=$c&&_n&&i0(_n),u=(s.clientX-_s.clientX+i.x)/(a||1)+(c?c[0]-rh[0]:0)/(a||1),d=(s.clientY-_s.clientY+i.y)/(l||1)+(c?c[1]-rh[1]:0)/(l||1);if(!et.active&&!Mo){if(r&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(pt){o?(o.e+=u-(th||0),o.f+=d-(nh||0)):o={a:1,b:0,c:0,d:1,e:u,f:d};var f="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");Be(pt,"webkitTransform",f),Be(pt,"mozTransform",f),Be(pt,"msTransform",f),Be(pt,"transform",f),th=u,nh=d,xr=s}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!pt){var e=this.options.fallbackOnBody?document.body:Ht,n=Vt(Se,!0,$c,!0,e),r=this.options;if($c){for(_n=e;Be(_n,"position")==="static"&&Be(_n,"transform")==="none"&&_n!==document;)_n=_n.parentNode;_n!==document.body&&_n!==document.documentElement?(_n===document&&(_n=ni()),n.top+=_n.scrollTop,n.left+=_n.scrollLeft):_n=ni(),rh=i0(_n)}pt=Se.cloneNode(!0),Wt(pt,r.ghostClass,!1),Wt(pt,r.fallbackClass,!0),Wt(pt,r.dragClass,!0),Be(pt,"transition",""),Be(pt,"transform",""),Be(pt,"box-sizing","border-box"),Be(pt,"margin",0),Be(pt,"top",n.top),Be(pt,"left",n.left),Be(pt,"width",n.width),Be(pt,"height",n.height),Be(pt,"opacity","0.8"),Be(pt,"position",$c?"absolute":"fixed"),Be(pt,"zIndex","100000"),Be(pt,"pointerEvents","none"),et.ghost=pt,e.appendChild(pt),Be(pt,"transform-origin",o0/parseInt(pt.style.width)*100+"% "+a0/parseInt(pt.style.height)*100+"%")}},_onDragStart:function(e,n){var r=this,i=e.dataTransfer,s=r.options;if(Un("dragStart",this,{evt:e}),et.eventCanceled){this._onDrop();return}Un("setupClone",this),et.eventCanceled||(Gt=Og(Se),Gt.draggable=!1,Gt.style["will-change"]="",this._hideClone(),Wt(Gt,this.options.chosenClass,!1),et.clone=Gt),r.cloneId=nu(function(){Un("clone",r),!et.eventCanceled&&(r.options.removeCloneOnHide||Ht.insertBefore(Gt,Se),r._hideClone(),Rn({sortable:r,name:"clone"}))}),!n&&Wt(Se,s.dragClass,!0),n?(sd=!0,r._loopId=setInterval(r._emulateDragOver,50)):(kt(document,"mouseup",r._onDrop),kt(document,"touchend",r._onDrop),kt(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",s.setData&&s.setData.call(r,i,Se)),St(document,"drop",r),Be(Se,"transform","translateZ(0)")),Mo=!0,r._dragStartId=nu(r._dragStarted.bind(r,n,e)),St(document,"selectstart",r),Ua=!0,dl&&Be(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,r=e.target,i,s,o,a=this.options,l=a.group,c=et.active,u=Pc===l,d=a.sort,f=gn||c,p,h=this,g=!1;if(wp)return;function m(Le,Ue){Un(Le,h,li({evt:e,isOwner:u,axis:p?"vertical":"horizontal",revert:o,dragRect:i,targetRect:s,canSort:d,fromSortable:f,target:r,completed:T,onMove:function(Je,Xe){return Dc(Ht,n,Se,i,Je,Vt(Je),e,Xe)},changed:E},Ue))}
vendor: 1,233 bytes, line 152
152function b(){m("dragOverAnimationCapture"),h.captureAnimationState(),h!==f&&f.captureAnimationState()}function T(Le){return m("dragOverCompleted",{insertion:Le}),Le&&(u?c._hideClone():c._showClone(h),h!==f&&(Wt(Se,gn?gn.options.ghostClass:c.options.ghostClass,!1),Wt(Se,a.ghostClass,!0)),gn!==h&&h!==et.active?gn=h:h===et.active&&gn&&(gn=null),f===h&&(h._ignoreWhileAnimating=r),h.animateAll(function(){m("dragOverAnimationComplete"),h._ignoreWhileAnimating=null}),h!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(r===Se&&!Se.animated||r===n&&!r.animated)&&(So=null),!a.dragoverBubble&&!e.rootEl&&r!==document&&(Se.parentNode[An]._isOutsideThisEl(e.target),!Le&&Es(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),g=!0}function E(){Qn=Jt(Se),Wi=Jt(Se,a.draggable),Rn({sortable:h,name:"change",toEl:n,newIndex:Qn,newDraggableIndex:Wi,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=Cr(r,a.draggable,n,!0),m("dragOver"),et.eventCanceled)return g;if(Se.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||h._ignoreWhileAnimating===r)return T(!1);if(sd=!1,c&&!a.disabled&&(u?d||(o=qt!==Ht):gn===this||(this.lastPutMode=Pc.checkPull(this,c,Se,e))&&l.checkPut(this,c,Se,e))){if
vendor: 5,981 bytes, line 152
152(p=this._getDirection(e,r)==="vertical",i=Vt(Se),m("dragOverValid"),et.eventCanceled)return g;if(o)return qt=Ht,b(),this._hideClone(),m("revert"),et.eventCanceled||(As?Ht.insertBefore(Se,As):Ht.appendChild(Se)),T(!0);var w=Cg(n,a.draggable);if(!w||yJ(e,p,this)&&!w.animated){if(w===Se)return T(!1);if(w&&n===e.target&&(r=w),r&&(s=Vt(r)),Dc(Ht,n,Se,i,r,s,e,!!r)!==!1)return b(),n.appendChild(Se),qt=n,E(),T(!0)}else if(w&&vJ(e,p,this)){var M=la(n,0,a,!0);if(M===Se)return T(!1);if(r=M,s=Vt(r),Dc(Ht,n,Se,i,r,s,e,!1)!==!1)return b(),n.insertBefore(Se,M),qt=n,E(),T(!0)}else if(r.parentNode===n){s=Vt(r);var A=0,I,j=Se.parentNode!==n,$=!fJ(Se.animated&&Se.toRect||i,r.animated&&r.toRect||s,p),J=p?"top":"left",se=r0(r,"top","top")||r0(Se,"top","top"),Q=se?se.scrollTop:void 0;So!==r&&(I=s[J],ml=!1,Rc=!$&&a.invertSwap||j),A=bJ(e,r,s,p,$?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Rc,So===r);var G;if(A!==0){var ee=Jt(Se);do ee-=A,G=qt.children[ee];while(G&&(Be(G,"display")==="none"||G===pt))}if(A===0||G===r)return T(!1);So=r,pl=A;var ge=r.nextElementSibling,ae=!1;ae=A===1;var ke=Dc(Ht,n,Se,i,r,s,e,ae);if(ke!==!1)return(ke===1||ke===-1)&&(ae=ke===1),wp=!0,setTimeout(gJ,30),b(),ae&&!ge?n.appendChild(Se):r.parentNode.insertBefore(Se,ae?ge:r),se&&ZS(se,0,Q-se.scrollTop),qt=Se.parentNode,I!==void 0&&!Rc&&(tu=Math.abs(I-Vt(r)[J])),E(),T(!0)}if(n.contains(Se))return T(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){kt(document,"mousemove",this._onTouchMove),kt(document,"touchmove",this._onTouchMove),kt(document,"pointermove",this._onTouchMove),kt(document,"dragover",Es),kt(document,"mousemove",Es),kt(document,"touchmove",Es)},_offUpEvents:function(){var e=this.el.ownerDocument;kt(e,"mouseup",this._onDrop),kt(e,"touchend",this._onDrop),kt(e,"pointerup",this._onDrop),kt(e,"touchcancel",this._onDrop),kt(document,"selectstart",this)},_onDrop:function(e){var n=this.el,r=this.options;if(Qn=Jt(Se),Wi=Jt(Se,r.draggable),Un("drop",this,{evt:e}),qt=Se&&Se.parentNode,Qn=Jt(Se),Wi=Jt(Se,r.draggable),et.eventCanceled){this._nulling();return}Mo=!1,Rc=!1,ml=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),xp(this.cloneId),xp(this._dragStartId),this.nativeDraggable&&(kt(document,"drop",this),kt(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),dl&&Be(document.body,"user-select",""),Be(Se,"transform",""),e&&(Ua&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),pt&&pt.parentNode&&pt.parentNode.removeChild(pt),(Ht===qt||gn&&gn.lastPutMode!=="clone")&&Gt&&Gt.parentNode&&Gt.parentNode.removeChild(Gt),Se&&(this.nativeDraggable&&kt(Se,"dragend",this),ih(Se),Se.style["will-change"]="",Ua&&!Mo&&Wt(Se,gn?gn.options.ghostClass:this.options.ghostClass,!1),Wt(Se,this.options.chosenClass,!1),Rn({sortable:this,name:"unchoose",toEl:qt,newIndex:null,newDraggableIndex:null,originalEvent:e}),Ht!==qt?(Qn>=0&&(Rn({rootEl:qt,name:"add",toEl:qt,fromEl:Ht,originalEvent:e}),Rn({sortable:this,name:"remove",toEl:qt,originalEvent:e}),Rn({rootEl:qt,name:"sort",toEl:qt,fromEl:Ht,originalEvent:e}),Rn({sortable:this,name:"sort",toEl:qt,originalEvent:e})),gn&&gn.save()):Qn!==Ro&&Qn>=0&&(Rn({sortable:this,name:"update",toEl:qt,originalEvent:e}),Rn({sortable:this,name:"sort",toEl:qt,originalEvent:e})),et.active&&((Qn==null||Qn===-1)&&(Qn=Ro,Wi=hl),Rn({sortable:this,name:"end",toEl:qt,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Un("nulling",this),Ht=Se=qt=pt=As=Gt=eu=qi=_s=xr=Ua=Qn=Wi=Ro=hl=So=pl=gn=Pc=et.dragged=et.ghost=et.clone=et.active=null,ad.forEach(function(e){e.checked=!0}),ad.length=th=nh=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Se&&(this._onDragOver(e),mJ(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,r=this.el.children,i=0,s=r.length,o=this.options;i<s;i++)n=r[i],Cr(n,o.draggable,this.el,!1)&&e.push(n.getAttribute(o.dataIdAttr)||wJ(n));return e},sort:function(e,n){var r={},i=this.el;this.toArray().forEach(function(s,o){var a=i.children[o];Cr(a,this.options.draggable,i,!1)&&(r[s]=a)},this),n&&this.captureAnimationState(),e.forEach(function(s){r[s]&&(i.removeChild(r[s]),i.appendChild(r[s]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return Cr(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var r=this.options;if(n===void 0)return r[e];var i=uc.modifyOption(this,e,n);typeof i<"u"?r[e]=i:r[e]=n,e==="group"&&nT(r)},destroy:function(){Un("destroy",this);var e=this.el;e[An]=null,kt(e,"mousedown",this._onTapStart),kt(e,"touchstart",this._onTapStart),kt(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(kt(e,"dragover",this),kt(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),od.splice(od.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!qi){if(Un("hideClone",this),et.eventCanceled)return;Be(Gt,"display","none"),this.options.removeCloneOnHide&&Gt.parentNode&&Gt.parentNode.removeChild(Gt),qi=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(qi){if(Un("showClone",this),et.eventCanceled)return;Se.parentNode==Ht&&!this.options.group.revertClone?Ht.insertBefore(Gt,Se):As?Ht.insertBefore(Gt,As):Ht.appendChild(Gt),this.options.group.revertClone&&this.animate(Se,Gt),Be(Gt,"display",""),qi=!1}}};function mJ(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Dc(t,e,n,r,i,s,o,a){var l,c=t[An],u=c.options.onMove,d;return window.CustomEvent&&!Ni&&!cc?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=t,l.dragged=n,l.draggedRect=r,l.related=i||e,l.relatedRect=s||Vt(e),l.willInsertAfter=a,l.originalEvent=o,t.dis
152patchEvent(l),u&&(d=u.call(c,l,o)),d}function ih(t){t.draggable=!1}function gJ(){wp=!1}function vJ(t,e,n){var r=Vt(la(n.el,0,n.options,!0)),i=10;return e?t.clientX<r.left-i||t.clientY<r.top&&t.clientX<r.right:t.clientY<r.top-i||t.clientY<r.bottom&&t.clientX<r.left}function yJ(t,e,n){var r=Vt(Cg(n.el,n.options.draggable)),i=10;return e?t.clientX>r.right+i||t.clientX<=r.right&&t.clientY>r.bottom&&t.clientX>=r.left:t.clientX>r.right&&t.clientY>r.top||t.clientX<=r.right&&t.clientY>r.bottom+i}function bJ(t,e,n,r,i,s,o,a){var l=r?t.clientY:t.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(a&&tu<c*i){if(!ml&&(pl===1?l>u+c*s/2:l<d-c*s/2)&&(ml=!0),ml)f=!0;else if(pl===1?l<u+tu:l>d-tu)return-pl}else if(l>u+c*(1-i)/2&&l<d-c*(1-i)/2)return kJ(e)}return f=f||o,f&&(l<u+c*s/2||l>d-c*s/2)?l>u+c/2?1:-1:0}function kJ(t){return Jt(Se)<Jt(t)?1:-1}function wJ(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,r=0;n--;)r+=e.charCodeAt(n);return r.toString(36)}function xJ(t){ad.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var r=e[n];r.checked&&ad.push(r)}}function nu(t){return setTimeout(t,0)}function xp(t){return clearTimeout(t)}Kd&&St(document,"touchmove",function(t){(et.active||Mo)&&t.cancelable&&t.preventDefault()});et.utils={on:St,off:kt,css:Be,find:JS,is:function(e,n){return!!Cr(e,n,e,!1)},extend:sJ,throttle:QS,closest:Cr,toggleClass:Wt,clone:Og,index:Jt,nextTick:nu,cancelNextTick:xp,detectDirection:tT,getChild:la};et.get=function(t){return t[An]};et.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(et.utils=li(li({},et.utils),r.utils)),uc.mount(r)})};et.create=function(t,e){return new et(t,e)};et.version=tJ;var en=[],Va,Sp,Tp=!1,sh,oh,ld,za;function SJ(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var r=n.originalEvent;this.sortable.nativeDraggable?St(document,"dragover",this._handleAutoScroll):this.options.supportPointer?St(document,"pointermove",this._handleFallbackAutoScroll):r.touches?St(document,"touchmove",this._handleFallbackAutoScroll):St(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?kt(document,"dragover",this._handleAutoScroll):(kt(document,"pointermove",this._handleFallbackAutoScroll),kt(document,"touchmove",this._handleFallbackAutoScroll),kt(document,"mousemove",this._handleFallbackAutoScroll)),c0(),ru(),oJ()},nulling:function(){ld=Sp=Va=Tp=za=sh=oh=null,en.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,r){var i=this,s=(n.touches?n.touches[0]:n).clientX,o=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(s,o);if(ld=n,r||this.options.forceAutoScrollFallback||cc||Ni||dl){ah(n,this.options,a,r);var l=Ji(a,!0);Tp&&(!za||s!==sh||o!==oh)&&(za&&c0(),za=setInterval(function(){var c=Ji(document.elementFromPoint(s,o),!0);c!==l&&(l=c,ru()),ah(n,i.options,c,r)},10),sh=s,oh=o)}else{if(!this.options.bubbleScroll||Ji(a,!0)===ni()){ru();return}ah(n,this.options,Ji(a,!1),!1)}}},br(t,{pluginName:"scroll",initializeByDefault:!0})}function ru(){en.forEach(function(t){clearInterval(t.pid)}),en=[]}function c0(){clearInterval(za)}var ah=QS(function(t,e,n,r){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,o=e.scrollSensitivity,a=e.scrollSpeed,l=ni(),c=!1,u;Sp!==n&&(Sp=n,ru(),Va=e.scroll,u=e.scrollFn,Va===!0&&(Va=Ji(n,!0)));var d=0,f=Va;do{var p=f,h=Vt(p),g=h.top,m=h.bottom,b=h.left,T=h.right,E=h.width,w=h.height,M=void 0,A=void 0,I=p.scrollWidth,j=p.scrollHeight,$=Be(p),J=p.scrollLeft,se=p.scrollTop;p===l?(M=E<I&&($.overflowX==="auto"||$.overflowX==="scroll"||$.overflowX==="visible"),A=w<j&&($.overflowY==="auto"||$.overflowY==="scroll"||$.overflowY==="visible")):(M=E<I&&($.overflowX==="auto"||$.overflowX==="scroll"),A=w<j&&($.overflowY==="auto"||$.overflowY==="scroll"));var Q=M&&(Math.abs(T-i)<=o&&J+E<I)-(Math.abs(b-i)<=o&&!!J),G=A&&(Math.abs(m-s)<=o&&se+w<j)-(Math.abs(g-s)<=o&&!!se);if(!en[d])for(var ee=0;ee<=d;ee++)en[ee]||(en[ee]={});(en[d].vx!=Q||en[d].vy!=G||en[d].el!==p)&&(en[d].el=p,en[d].vx=Q,en[d].vy=G,clearInterval(en[d].pid),(Q!=0||G!=0)&&(c=!0,en[d].pid=setInterval((function(){r&&this.layer===0&&et.active._onTouchMove(ld);var ge=en[this.layer].vy?en[this.layer].vy*a:0,ae=en[this.layer].vx?en[this.layer].vx*a:0;typeof u=="function"&&u.call(et.dragged.parentNode[An],ae,ge,t,ld,en[this.layer].el)!=="continue"||ZS(en[this.layer].el,ae,ge)}).bind({layer:d}),24))),d++}while(e.bubbleScroll&&f!==l&&(f=Ji(f,!1)));Tp=c}},30),sT=function(e){var n=e.originalEvent,r=e.putSortable,i=e.dragEl,s=e.activeSortable,o=e.dispatchSortableEvent,a=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(n){var c=r||s;a();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(d)&&(o("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function Ag(){}Ag.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=la(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),r&&r.animateAll()},drop:sT};br(Ag,{pluginName:"revertOnSpill"});function Mg(){}Mg.prototype={onSpill:function(e){var n=e.dragEl,r=e.putSortable,i=r||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop:sT};br(Mg,{pluginName:"removeOnSpill"});var ar;function TJ(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(n){var r=n.dragEl;ar=r},dragOverValid:function(n){var r=n.completed,i=n.target,s=n.onMove,o=n.activeSortable,a=n.changed,l=n.cancel;if(o.options.swap){var c=this.sortable.el,u=this.options;if(i&&i!==c){var d=ar;s(i)!==!1?(Wt(i,u.swapClass,!0),ar=i):ar=null,d&&d!==ar&&Wt(d,u.swapClass,!1)}a(),r(!0),l()}},drop:function(n){var r=n.activeSortable,i=n.putSortable,s=n.dragEl,o=i||this.sortable,a=this.options;ar&&Wt(ar,a.swapClass,!1),ar&&(a.swap||i&&i.options.swap)&&s!==ar&&(o.captureAnimationState(),o!==r&&r.captureAnimationState(),_J(s,ar),o.animateAll(),o!==r&&r.animateAll())},nulling:function(){ar=null}},br(t,{pluginName:"swap",eventProperties:function(){return{swapItem:ar}}})}function _J(t,e){var n=t.parentNode,r=e.parentNode,i,s;!n||!r||n.isEqualNode(e)||r.isEqualNode(t)||(i=Jt(t),s=Jt(e),n.isEqualNode(r)&&i<s&&s++,n.insertBefore(e,n.children[i]),r.insertBefore(t,r.children[s])
vendor: 4,827 bytes, line 152
152)}var ft=[],Jn=[],Aa,Sr,Ma=!1,Vn=!1,To=!1,Dt,Ia,Nc;function EJ(){function t(e){for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this));e.options.supportPointer?St(document,"pointerup",this._deselectMultiDrag):(St(document,"mouseup",this._deselectMultiDrag),St(document,"touchend",this._deselectMultiDrag)),St(document,"keydown",this._checkKeyDown),St(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(i,s){var o="";ft.length&&Sr===e?ft.forEach(function(a,l){o+=(l?", ":"")+a.textContent}):o=s.textContent,i.setData("Text",o)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(n){var r=n.dragEl;Dt=r},delayEnded:function(){this.isMultiDrag=~ft.indexOf(Dt)},setupClone:function(n){var r=n.sortable,i=n.cancel;if(this.isMultiDrag){for(var s=0;s<ft.length;s++)Jn.push(Og(ft[s])),Jn[s].sortableIndex=ft[s].sortableIndex,Jn[s].draggable=!1,Jn[s].style["will-change"]="",Wt(Jn[s],this.options.selectedClass,!1),ft[s]===Dt&&Wt(Jn[s],this.options.chosenClass,!1);r._hideClone(),i()}},clone:function(n){var r=n.sortable,i=n.rootEl,s=n.dispatchSortableEvent,o=n.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||ft.length&&Sr===r&&(u0(!0,i),s("clone"),o()))},showClone:function(n){var r=n.cloneNowShown,i=n.rootEl,s=n.cancel;this.isMultiDrag&&(u0(!1,i),Jn.forEach(function(o){Be(o,"display","")}),r(),Nc=!1,s())},hideClone:function(n){var r=this;n.sortable;var i=n.cloneNowHidden,s=n.cancel;this.isMultiDrag&&(Jn.forEach(function(o){Be(o,"display","none"),r.options.removeCloneOnHide&&o.parentNode&&o.parentNode.removeChild(o)}),i(),Nc=!0,s())},dragStartGlobal:function(n){n.sortable,!this.isMultiDrag&&Sr&&Sr.multiDrag._deselectMultiDrag(),ft.forEach(function(r){r.sortableIndex=Jt(r)}),ft=ft.sort(function(r,i){return r.sortableIndex-i.sortableIndex}),To=!0},dragStarted:function(n){var r=this,i=n.sortable;if(this.isMultiDrag){if(this.options.sort&&(i.captureAnimationState(),this.options.animation)){ft.forEach(function(o){o!==Dt&&Be(o,"position","absolute")});var s=Vt(Dt,!1,!0,!0);ft.forEach(function(o){o!==Dt&&s0(o,s)}),Vn=!0,Ma=!0}i.animateAll(function(){Vn=!1,Ma=!1,r.options.animation&&ft.forEach(function(o){Zf(o)}),r.options.sort&&Fc()})}},dragOver:function(n){var r=n.target,i=n.completed,s=n.cancel;Vn&&~ft.indexOf(r)&&(i(!1),s())},revert:function(n){var r=n.fromSortable,i=n.rootEl,s=n.sortable,o=n.dragRect;ft.length>1&&(ft.forEach(function(a){s.addAnimationState({target:a,rect:Vn?Vt(a):o}),Zf(a),a.fromRect=o,r.removeAnimationState(a)}),Vn=!1,CJ(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(n){var r=n.sortable,i=n.isOwner,s=n.insertion,o=n.activeSortable,a=n.parentEl,l=n.putSortable,c=this.options;if(s){if(i&&o._hideClone(),Ma=!1,c.animation&&ft.length>1&&(Vn||!i&&!o.options.sort&&!l)){var u=Vt(Dt,!1,!0,!0);ft.forEach(function(f){f!==Dt&&(s0(f,u),a.appendChild(f))}),Vn=!0}if(!i)if(Vn||Fc(),ft.length>1){var d=Nc;o._showClone(r),o.options.animation&&!Nc&&d&&Jn.forEach(function(f){o.addAnimationState({target:f,rect:Ia}),f.fromRect=Ia,f.thisAnimationDuration=null})}else o._showClone(r)}},dragOverAnimationCapture:function(n){var r=n.dragRect,i=n.isOwner,s=n.activeSortable;if(ft.forEach(function(a){a.thisAnimationDuration=null}),s.options.animation&&!i&&s.multiDrag.isMultiDrag){Ia=br({},r);var o=Js(Dt,!0);Ia.top-=o.f,Ia.left-=o.e}},dragOverAnimationComplete:function(){Vn&&(Vn=!1,Fc())},drop:function(n){var r=n.originalEvent,i=n.rootEl,s=n.parentEl,o=n.sortable,a=n.dispatchSortableEvent,l=n.oldIndex,c=n.putSortable,u=c||this.sortable;if(r){var d=this.options,f=s.children;if(!To)if(d.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),Wt(Dt,d.selectedClass,!~ft.indexOf(Dt)),~ft.indexOf(Dt))ft.splice(ft.indexOf(Dt),1),Aa=null,Ha({sortable:o,rootEl:i,name:"deselect",targetEl:Dt});else{if(ft.push(Dt),Ha({sortable:o,rootEl:i,name:"select",targetEl:Dt}),r.shiftKey&&Aa&&o.el.contains(Aa)){var p=Jt(Aa),h=Jt(Dt);if(~p&&~h&&p!==h){var g,m;for(h>p?(m=p,g=h):(m=h,g=p+1);m<g;m++)~ft.indexOf(f[m])||(Wt(f[m],d.selectedClass,!0),ft.push(f[m]),Ha({sortable:o,rootEl:i,name:"select",targetEl:f[m]}))}}else Aa=Dt;Sr=u}if(To&&this.isMultiDrag){if(Vn=!1,(s[An].options.sort||s!==i)&&ft.length>1){var b=Vt(Dt),T=Jt(Dt,":not(."+this.options.selectedClass+")");if(!Ma&&d.animation&&(Dt.thisAnimationDuration=null),u.captureAnimationState(),!Ma&&(d.animation&&(Dt.fromRect=b,ft.forEach(function(w){if(w.thisAnimationDuration=null,w!==Dt){var M=Vn?Vt(w):b;w.fromRect=M,u.addAnimationState({target:w,rect:M})}})),Fc(),ft.forEach(function(w){f[T]?s.insertBefore(w,f[T]):s.appendChild(w),T++}),l===Jt(Dt))){var E=!1;ft.forEach(function(w){if(w.sortableIndex!==Jt(w)){E=!0;return}}),E&&a("update")}ft.forEach(function(w){Zf(w)}),u.animateAll()}Sr=u}
152(i===s||c&&c.lastPutMode!=="clone")&&Jn.forEach(function(w){w.parentNode&&w.parentNode.removeChild(w)})}},nullingGlobal:function(){this.isMultiDrag=To=!1,Jn.length=0},destroyGlobal:function(){this._deselectMultiDrag(),kt(document,"pointerup",this._deselectMultiDrag),kt(document,"mouseup",this._deselectMultiDrag),kt(document,"touchend",this._deselectMultiDrag),kt(document,"keydown",this._checkKeyDown),kt(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(n){if(!(typeof To<"u"&&To)&&Sr===this.sortable&&!(n&&Cr(n.target,this.options.draggable,this.sortable.el,!1))&&!(n&&n.button!==0))for(;ft.length;){var r=ft[0];Wt(r,this.options.selectedClass,!1),ft.shift(),Ha({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:r})}},_checkKeyDown:function(n){n.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(n){n.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},br(t,{pluginName:"multiDrag",utils:{select:function(n){var r=n.parentNode[An];!r||!r.options.multiDrag||~ft.indexOf(n)||(Sr&&Sr!==r&&(Sr.multiDrag._deselectMultiDrag(),Sr=r),Wt(n,r.options.selectedClass,!0),ft.push(n))},deselect:function(n){var r=n.parentNode[An],i=ft.indexOf(n);!r||!r.options.multiDrag||!~i||(Wt(n,r.options.selectedClass,!1),ft.splice(i,1))}},eventProperties:function(){var n=this,r=[],i=[];return ft.forEach(function(s){r.push({multiDragElement:s,index:s.sortableIndex});var o;Vn&&s!==Dt?o=-1:Vn?o=Jt(s,":not(."+n.options.selectedClass+")"):o=Jt(s),i.push({multiDragElement:s,index:o})}),{items:XX(ft),clones:[].concat(Jn),oldIndicies:r,newIndicies:i}},optionListeners:{multiDragKey:function(n){return n=n.toLowerCase(),n==="ctrl"?n="Control":n.length>1&&(n=n.charAt(0).toUpperCase()+n.substr(1)),n}}})}function CJ(t,e){ft.forEach(function(n,r){var i=e.children[n.sortableIndex+(t?Number(r):0)];i?e.insertBefore(n,i):e.appendChild(n)})}function u0(t,e){Jn.forEach(function(n,r){var i=e.children[n.sortableIndex+(t?Number(r):0)];i?e.insertBefore(n,i):e.appendChild(n)})}function Fc(){ft.forEach(function(t){t!==Dt&&t.parentNode&&t.parentNode.removeChild(t)})}et.mount(new SJ);et.mount(Mg,Ag);const OJ=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:EJ,Sortable:et,Swap:TJ,default:et},Symbol.toStringTag,{value:"Module"})),AJ=ck(OJ);(function(t,e){(function(r,i){t.exports=i(KX,AJ)})(typeof self<"u"?self:pr,function(n,r){return function(i){var s={};function o(a){if(s[a])return s[a].exports;var l=s[a]={i:a,l:!1,exports:{}};return i[a].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=i,o.c=s,o.d=function(a,l,c){o.o(a,l)||Object.defineProperty(a,l,{enumerable:!0,get:c})},o.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},o.t=function(a,l){if(l&1&&(a=o(a)),l&8||l&4&&typeof a=="object"&&a&&a.__esModule)return a;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:a}),l&2&&typeof a!="string")for(var u in a)o.d(c,u,(function(d){return a[d]}).bind(null,u));return c},o.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return o.d(l,"a",l),l},o.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},o.p="",o(o.s="fb15")}({"00ee":function(i,s,o){var a=o("b622"),l=a("toStringTag"),c={};c[l]="z",i.exports=String(c)==="[object z]"},"0366":function(i,s,o){var a=o("1c0b");i.exports=function(l,c,u){if(a(l),c===void 0)return l;switch(u){case 0:return function(){return l.call(c)};case 1:return function(d){return l.call(c,d)};case 2:return function(d,f){return l.call(c,d,f)};case 3:return function(d,f,p){return l.call(c,d,f,p)}}return function(){return l.apply(c,arguments)}}},"057f":function(i,s,o){var a=o("fc6a"),l=o("241c").f,c={}.toString,u=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],d=function(f){try{return l(f)}catch{return u.slice()}};i.exports.f=function(p){return u&&c.call(p)=="[object Window]"?d(p):l(a(p))}},"06cf":function(i,s,o){var a=o("83ab"),l=o("d1e7"),c=o("5c6c"),u=o("fc6a"),d=o("c04e"),f=o("5135"),p=o("0cfb"),h=Object.getOwnPropertyDescriptor;s.f=a?h:function(m,b){if(m=u(m),b=d(b,!0),p)try{return h(m,b)}catch{}if(f(m,b))return c(!l.f.call(m,b),m[b])}},"0cfb":function(i,s,o){var a=o("83ab"),l=o("d039"),c=o("cc12");i.exports=!a&&!l(function(){return Object.defineProperty(c("div"),"a",{get:function(){return 7}}).a!=7})},"13d5":function(i,s,o){var a=o("23e7"),l=o("d58f").left,c=o("a640"),u=o("ae40"),d=c("reduce"),f=u("reduce",{1:0});a({target:"Array",proto:!0,forced:!d||!f},{reduce:function(h){return l(this,h,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"14c3":function(i,s,o){var a=o("c6b6"),l=o("9263");i.exports=function(c,u){var d=c.exec;
152if(typeof d=="function"){var f=d.call(c,u);if(typeof f!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return f}if(a(c)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return l.call(c,u)}},"159b":function(i,s,o){var a=o("da84"),l=o("fdbc"),c=o("17c2"),u=o("9112");for(var d in l){var f=a[d],p=f&&f.prototype;if(p&&p.forEach!==c)try{u(p,"forEach",c)}catch{p.forEach=c}}},"17c2":function(i,s,o){var a=o("b727").forEach,l=o("a640"),c=o("ae40"),u=l("forEach"),d=c("forEach");i.exports=!u||!d?function(p){return a(this,p,arguments.length>1?arguments[1]:void 0)}:[].forEach},"1be4":function(i,s,o){var a=o("d066");i.exports=a("document","documentElement")},"1c0b":function(i,s){i.exports=function(o){if(typeof o!="function")throw TypeError(String(o)+" is not a function");return o}},"1c7e":function(i,s,o){var a=o("b622"),l=a("iterator"),c=!1;try{var u=0,d={next:function(){return{done:!!u++}},return:function(){c=!0}};d[l]=function(){return this},Array.from(d,function(){throw 2})}catch{}i.exports=function(f,p){if(!p&&!c)return!1;var h=!1;try{var g={};g[l]=function(){return{next:function(){return{done:h=!0}}}},f(g)}catch{}return h}},"1d80":function(i,s){i.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},"1dde":function(i,s,o){var a=o("d039"),l=o("b622"),c=o("2d00"),u=l("species");i.exports=function(d){return c>=51||!a(function(){var f=[],p=f.constructor={};return p[u]=function(){return{foo:1}},f[d](Boolean).foo!==1})}},"23cb":function(i,s,o){var a=o("a691"),l=Math.max,c=Math.min;i.exports=function(u,d){var f=a(u);return f<0?l(f+d,0):c(f,d)}},"23e7":function(i,s,o){var a=o("da84"),l=o("06cf").f,c=o("9112"),u=o("6eeb"),d=o("ce4e"),f=o("e893"),p=o("94ca");i.exports=function(h,g){var m=h.target,b=h.global,T=h.stat,E,w,M,A,I,j;if(b?w=a:T?w=a[m]||d(m,{}):w=(a[m]||{}).prototype,w)for(M in g){if(I=g[M],h.noTargetGet?(j=l(w,M),A=j&&j.value):A=w[M],E=p(b?M:m+(T?".":"#")+M,h.forced),!E&&A!==void 0){if(typeof I==typeof A)continue;f(I,A)}(h.sham||A&&A.sham)&&c(I,"sham",!0),u(w,M,I,h)}}},"241c":function(i,s,o){var a=o("ca84"),l=o("7839"),c=l.concat("length","prototype");s.f=Object.getOwnPropertyNames||function(d){return a(d,c)}},"25f0":function(i,s,o){var a=o("6eeb"),l=o("825a"),c=o("d039"),u=o("ad6d"),d="toString",f=RegExp.prototype,p=f[d],h=c(function(){return p.call({source:"a",flags:"b"})!="/a/b"}),g=p.name!=d;(h||g)&&a(RegExp.prototype,d,function(){var b=l(this),T=String(b.source),E=b.flags,w=String(E===void 0&&b instanceof RegExp&&!("flags"in f)?u.call(b):E);return"/"+T+"/"+w},{unsafe:!0})},"2ca0":function(i,s,o){var a=o("23e7"),l=o("06cf").f,c=o("50c4"),u=o("5a34"),d=o("1d80"),f=o("ab13"),p=o("c430"),h="".startsWith,g=Math.min,m=f("startsWith"),b=!p&&!m&&!!function(){var T=l(String.prototype,"startsWith");return T&&!T.writable}();a({target:"String",proto:!0,forced:!b&&!m},{startsWith:function(E){var w=String(d(this));u(E);var M=c(g(arguments.length>1?arguments[1]:void 0,w.length)),A=String(E);return h?h.call(w,A,M):w.slice(M,M+A.length)===A}})},"2d00":function(i,s,o){var a=o("da84"),l=o("342f"),c=a.process,u=c&&c.versions,d=u&&u.v8,f,p;d?(f=d.split("."),p=f[0]+f[1]):l&&(f=l.match(/Edge\/(\d+)/),(!f||f[1]>=74)&&(f=l.match(/Chrome\/(\d+)/),f&&(p=f[1]))),i.exports=p&&+p},"342f":function(i,s,o){var a=o("d066");i.exports=a("navigator","userAgent")||""},"35a1":function(i,s,o){var a=o("f5df"),l=o("3f8c"),c=o("b622"),u=c("iterator");i.exports=function(d){if(d!=null)return d[u]||d["@@iterator"]||l[a(d)]}},"37e8":function(i,s,o){var a=o("83ab"),l=o("9bf2"),c=o("825a"),u=o("df75");i.exports=a?Object.defineProperties:function(f,p){c(f);for(var h=u(p),g=h.length,m=0,b;g>m;)l.f(f,b=h[m++],p[b]);return f}},"3bbe":function(i,s,o){var a=o("861d");i.exports=function(l){if(!a(l)&&l!==null)throw TypeError("Can't set "+String(l)+" as a prototype");return l}},"3ca3":function(i,s,o){var a=o("6547").charAt,l=o("69f3"),c=o("7dd0"),u="String Iterator",d=l.set,f=l.getterFor(u);c(String,"String",function(p){d(this,{type:u,string:String(p),index:0})},function(){var h=f(this),g=h.string,m=h.index,b;return m>=g.length?{value:void 0,done:!0}:(b=a(g,m),h.index+=b.length,{value:b,done:!1})})},"3f8c":function(i,s){i.exports={}},4160:function(i,s,o){var a=o("23e7"),l=o("17c2");a({target:"Array",proto:!0,forced:[].forEach!=l},{forEach:l})},"428f":function(i,s,o){var a=o("da84");i.exports=a},"44ad":function(i,s,o){var a=o("d039"),l=o("c6b6"),c="".split;i.exports=a(function(){return!Object("z").propertyIsEnumerable(0)})?function(u){return l(u)=="String"?c.call(u,""):Object(u)}:Object},"44d2":function(i,s,o){var a=o("b622"),l=o("7c73"),c=o("9bf2"),u=a("unscopables"),d=Array.prototype;d[u]==null&&c.f(d,u,{configurable:!0,value:l(null)}),i.exports=function(f){d[u][f]=!0}},"44e7":function(i,s,o){var a=o("861d"),l=o("c6b6"),c=o("b622"),u=c("match");i.exports=function(d){var f;return a(d)&&((f=d[u])!==void 0?!!f:l(d)=="RegExp")}},4930:function(i,s,o){var a=o("d039");i.exports=!!Object.getOwnPropertySymbols&&!a(function(){return!String(Symbol())})},"4d64":function(i,s,o){var a=o("fc6a"),l=o("50c4"),c=o("23cb"),u=function(d){return function(f,p,h){var g=a(f),m=l(g.length),b=c(h,m),T;if(d&&p!=p){for(;m>b;)if(T=g[b++],T!=T)return!0}else for(;m>b;b++)if((d||b in g)&&g[b]===p)return d||b||0;return!d&&-1}};i.exports={includes:u(!0),indexOf:u(!1)}},"4de4":function(i,s,o){var a=o("23e7"),l=o("b727").filter,c=o("1dde"),u=o("ae40"),d=c("filter"),f=u("filter");a({target:"Array",proto:!0,forced:!d||!f},{filter:function(h){return l(this,h,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(i,s,o){var a=o("0366"),l=o("7b0b"),c=o("9bdd"),u=o("e95a"),d=o("50c4"),f=o("8418"),p=o("35a1");
152i.exports=function(g){var m=l(g),b=typeof this=="function"?this:Array,T=arguments.length,E=T>1?arguments[1]:void 0,w=E!==void 0,M=p(m),A=0,I,j,$,J,se,Q;if(w&&(E=a(E,T>2?arguments[2]:void 0,2)),M!=null&&!(b==Array&&u(M)))for(J=M.call(m),se=J.next,j=new b;!($=se.call(J)).done;A++)Q=w?c(J,E,[$.value,A],!0):$.value,f(j,A,Q);else for(I=d(m.length),j=new b(I);I>A;A++)Q=w?E(m[A],A):m[A],f(j,A,Q);return j.length=A,j}},"4fad":function(i,s,o){var a=o("23e7"),l=o("6f53").entries;a({target:"Object",stat:!0},{entries:function(u){return l(u)}})},"50c4":function(i,s,o){var a=o("a691"),l=Math.min;i.exports=function(c){return c>0?l(a(c),9007199254740991):0}},5135:function(i,s){var o={}.hasOwnProperty;i.exports=function(a,l){return o.call(a,l)}},5319:function(i,s,o){var a=o("d784"),l=o("825a"),c=o("7b0b"),u=o("50c4"),d=o("a691"),f=o("1d80"),p=o("8aa5"),h=o("14c3"),g=Math.max,m=Math.min,b=Math.floor,T=/\$([$&'`]|\d\d?|<[^>]*>)/g,E=/\$([$&'`]|\d\d?)/g,w=function(M){return M===void 0?M:String(M)};a("replace",2,function(M,A,I,j){var $=j.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,J=j.REPLACE_KEEPS_$0,se=$?"$":"$0";return[function(ee,ge){var ae=f(this),ke=ee==null?void 0:ee[M];return ke!==void 0?ke.call(ee,ae,ge):A.call(String(ae),ee,ge)},function(G,ee){if(!$&&J||typeof ee=="string"&&ee.indexOf(se)===-1){var ge=I(A,G,this,ee);if(ge.done)return ge.value}var ae=l(G),ke=String(this),Le=typeof ee=="function";Le||(ee=String(ee));var Ue=ae.global;if(Ue){var Ze=ae.unicode;ae.lastIndex=0}for(var Je=[];;){var Xe=h(ae,ke);if(Xe===null||(Je.push(Xe),!Ue))break;var We=String(Xe[0]);We===""&&(ae.lastIndex=p(ke,u(ae.lastIndex),Ze))}for(var rt="",je=0,Te=0;Te<Je.length;Te++){Xe=Je[Te];for(var q=String(Xe[0]),pe=g(m(d(Xe.index),ke.length),0),ce=[],be=1;be<Xe.length;be++)ce.push(w(Xe[be]));var He=Xe.groups;if(Le){var at=[q].concat(ce,pe,ke);He!==void 0&&at.push(He);var Ce=String(ee.apply(void 0,at))}else Ce=Q(q,ke,pe,ce,He,ee);pe>=je&&(rt+=ke.slice(je,pe)+Ce,je=pe+q.length)}return rt+ke.slice(je)}];function Q(G,ee,ge,ae,ke,Le){var Ue=ge+G.length,Ze=ae.length,Je=E;return ke!==void 0&&(ke=c(ke),Je=T),A.call(Le,Je,function(Xe,We){var rt;switch(We.charAt(0)){case"$":return"$";case"&":return G;case"`":return ee.slice(0,ge);case"'":return ee.slice(Ue);case"<":rt=ke[We.slice(1,-1)];break;default:var je=+We;if(je===0)return Xe;if(je>Ze){var Te=b(je/10);return Te===0?Xe:Te<=Ze?ae[Te-1]===void 0?We.charAt(1):ae[Te-1]+We.charAt(1):Xe}rt=ae[je-1]}return rt===void 0?"":rt})}})},5692:function(i,s,o){var a=o("c430"),l=o("c6cd");(i.exports=function(c,u){return l[c]||(l[c]=u!==void 0?u:{})})("versions",[]).push({version:"3.6.5",mode:a?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(i,s,o){var a=o("d066"),l=o("241c"),c=o("7418"),u=o("825a");i.exports=a("Reflect","ownKeys")||function(f){var p=l.f(u(f)),h=c.f;return h?p.concat(h(f)):p}},"5a34":function(i,s,o){var a=o("44e7");i.exports=function(l){if(a(l))throw TypeError("The method doesn't accept regular expressions");return l}},"5c6c":function(i,s){i.exports=function(o,a){return{enumerable:!(o&1),configurable:!(o&2),writable:!(o&4),value:a}}},"5db7":function(i,s,o){var a=o("23e7"),l=o("a2bf"),c=o("7b0b"),u=o("50c4"),d=o("1c0b"),f=o("65f0");a({target:"Array",proto:!0},{flatMap:function(h){var g=c(this),m=u(g.length),b;return d(h),b=f(g,0),b.length=l(b,g,g,m,0,1,h,arguments.length>1?arguments[1]:void 0),b}})},6547:function(i,s,o){var a=o("a691"),l=o("1d80"),c=function(u){return function(d,f){var p=String(l(d)),h=a(f),g=p.length,m,b;return h<0||h>=g?u?"":void 0:(m=p.charCodeAt(h),m<55296||m>56319||h+1===g||(b=p.charCodeAt(h+1))<56320||b>57343?u?p.charAt(h):m:u?p.slice(h,h+2):(m-55296<<10)+(b-56320)+65536)}};i.exports={codeAt:c(!1),charAt:c(!0)}},"65f0":function(i,s,o){var a=o("861d"),l=o("e8b5"),c=o("b622"),u=c("species");i.exports=function(d,f){var p;return l(d)&&(p=d.constructor,typeof p=="function"&&(p===Array||l(p.prototype))?p=void 0:a(p)&&(p=p[u],p===null&&(p=void 0))),new(p===void 0?Array:p)(f===0?0:f)}},"69f3":function(i,s,o){var a=o("7f9a"),l=o("da84"),c=o("861d"),u=o("9112"),d=o("5135"),f=o("f772"),p=o("d012"),h=l.WeakMap,g,m,b,T=function($){return b($)?m($):g($,{})},E=function($){return function(J){var se;if(!c(J)||(se=m(J)).type!==$)throw TypeError("Incompatible receiver, "+$+" required");return se}};if(a){var w=new h,M=w.get,A=w.has,I=w.set;g=function($,J){return I.call(w,$,J),J},m=function($){return M.call(w,$)||{}},b=function($){return A.call(w,$)}}else{var j=f("state");p[j]=!0,g=function($,J){return u($,j,J),J},m=function($){return d($,j)?$[j]:{}},b=function($){return d($,j)}}i.exports={set:g,get:m,has:b,enforce:T,getterFor:E}},"6eeb":function(i,s,o){var a=o("da84"),l=o("9112"),c=o("5135"),u=o("ce4e"),d=o("8925"),f=o("69f3"),p=f.get,h=f.enforce,g=String(String).split("String");(i.exports=function(m,b,T,E){var w=E?!!E.unsafe:!1,M=E?!!E.enumerable:!1,A=E?!!E.noTargetGet:!1;if(typeof T=="function"&&(typeof b=="string"&&!c(T,"name")&&l(T,"name",b),h(T).source=g.join(typeof b=="string"?b:"")),m===a){M?m[b]=T:u(b,T);return}else w?!A&&m[b]&&(M=!0):delete m[b];M?m[b]=T:l(m,b,T)})(Function.prototype,"toString",function(){return typeof this=="function"&&p(this).source||d(this)})},"6f53":function(i,s,o){var a=o("83ab"),l=o("df75"),c=o("fc6a"),u=o("d1e7").f,d=function(f){return function(p){for(var h=c(p),g=l(h),m=g.length,b=0,T=[],E;m>b;)E=g[b++],(!a||u.call(h,E))&&T.push(f?[E,h[E]]:h[E]);return T}};i.exports={entries:d(!0),values:d(!1)}},"73d9":function(i,s,o){var a=o("44d2");a("flatMap")}
152,7418:function(i,s){s.f=Object.getOwnPropertySymbols},"746f":function(i,s,o){var a=o("428f"),l=o("5135"),c=o("e538"),u=o("9bf2").f;i.exports=function(d){var f=a.Symbol||(a.Symbol={});l(f,d)||u(f,d,{value:c.f(d)})}},7839:function(i,s){i.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(i,s,o){var a=o("1d80");i.exports=function(l){return Object(a(l))}},"7c73":function(i,s,o){var a=o("825a"),l=o("37e8"),c=o("7839"),u=o("d012"),d=o("1be4"),f=o("cc12"),p=o("f772"),h=">",g="<",m="prototype",b="script",T=p("IE_PROTO"),E=function(){},w=function($){return g+b+h+$+g+"/"+b+h},M=function($){$.write(w("")),$.close();var J=$.parentWindow.Object;return $=null,J},A=function(){var $=f("iframe"),J="java"+b+":",se;return $.style.display="none",d.appendChild($),$.src=String(J),se=$.contentWindow.document,se.open(),se.write(w("document.F=Object")),se.close(),se.F},I,j=function(){try{I=document.domain&&new ActiveXObject("htmlfile")}catch{}j=I?M(I):A();for(var $=c.length;$--;)delete j[m][c[$]];return j()};u[T]=!0,i.exports=Object.create||function(J,se){var Q;return J!==null?(E[m]=a(J),Q=new E,E[m]=null,Q[T]=J):Q=j(),se===void 0?Q:l(Q,se)}},"7dd0":function(i,s,o){var a=o("23e7"),l=o("9ed3"),c=o("e163"),u=o("d2bb"),d=o("d44e"),f=o("9112"),p=o("6eeb"),h=o("b622"),g=o("c430"),m=o("3f8c"),b=o("ae93"),T=b.IteratorPrototype,E=b.BUGGY_SAFARI_ITERATORS,w=h("iterator"),M="keys",A="values",I="entries",j=function(){return this};i.exports=function($,J,se,Q,G,ee,ge){l(se,J,Q);var ae=function(Te){if(Te===G&&Je)return Je;if(!E&&Te in Ue)return Ue[Te];switch(Te){case M:return function(){return new se(this,Te)};case A:return function(){return new se(this,Te)};case I:return function(){return new se(this,Te)}}return function(){return new se(this)}},ke=J+" Iterator",Le=!1,Ue=$.prototype,Ze=Ue[w]||Ue["@@iterator"]||G&&Ue[G],Je=!E&&Ze||ae(G),Xe=J=="Array"&&Ue.entries||Ze,We,rt,je;if(Xe&&(We=c(Xe.call(new $)),T!==Object.prototype&&We.next&&(!g&&c(We)!==T&&(u?u(We,T):typeof We[w]!="function"&&f(We,w,j)),d(We,ke,!0,!0),g&&(m[ke]=j))),G==A&&Ze&&Ze.name!==A&&(Le=!0,Je=function(){return Ze.call(this)}),(!g||ge)&&Ue[w]!==Je&&f(Ue,w,Je),m[J]=Je,G)if(rt={values:ae(A),keys:ee?Je:ae(M),entries:ae(I)},ge)for(je in rt)(E||Le||!(je in Ue))&&p(Ue,je,rt[je]);else a({target:J,proto:!0,forced:E||Le},rt);return rt}},"7f9a":function(i,s,o){var a=o("da84"),l=o("8925"),c=a.WeakMap;i.exports=typeof c=="function"&&/native code/.test(l(c))},"825a":function(i,s,o){var a=o("861d");i.exports=function(l){if(!a(l))throw TypeError(String(l)+" is not an object");return l}},"83ab":function(i,s,o){var a=o("d039");i.exports=!a(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},8418:function(i,s,o){var a=o("c04e"),l=o("9bf2"),c=o("5c6c");i.exports=function(u,d,f){var p=a(d);p in u?l.f(u,p,c(0,f)):u[p]=f}},"861d":function(i,s){i.exports=function(o){return typeof o=="object"?o!==null:typeof o=="function"}},8875:function(i,s,o){var a,l,c;(function(u,d){l=[],a=d,c=typeof a=="function"?a.apply(s,l):a,c!==void 0&&(i.exports=c)})(typeof self<"u"?self:this,function(){function u(){var d=Object.getOwnPropertyDescriptor(document,"currentScript");if(!d&&"currentScript"in document&&document.currentScript||d&&d.get!==u&&document.currentScript)return document.currentScript;try{throw new Error}catch(I){var f=/.*at [^(]*\((.*):(.+):(.+)\)$/ig,p=/@([^@]*):(\d+):(\d+)\s*$/ig,h=f.exec(I.stack)||p.exec(I.stack),g=h&&h[1]||!1,m=h&&h[2]||!1,b=document.location.href.replace(document.location.hash,""),T,E,w,M=document.getElementsByTagName("script");g===b&&(T=document.documentElement.outerHTML,E=new RegExp("(?:[^\\n]+?\\n){0,"+(m-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),w=T.replace(E,"$1").trim());for(var A=0;A<M.length;A++)if(M[A].readyState==="interactive"||M[A].src===g||g===b&&M[A].innerHTML&&M[A].innerHTML.trim()===w)return M[A];return null}}return u})},8925:function(i,s,o){var a=o("c6cd"),l=Function.toString;typeof a.inspectSource!="function"&&(a.inspectSource=function(c){return l.call(c)}),i.exports=a.inspectSource},"8aa5":function(i,s,o){var a=o("6547").charAt;i.exports=function(l,c,u){return c+(u?a(l,c).length:1)}},"8bbf":function(i,s){i.exports=n},"90e3":function(i,s){var o=0,a=Math.random();i.exports=function(l){return"Symbol("+String(l===void 0?"":l)+")_"+(++o+a).toString(36)}},9112:function(i,s,o){var a=o("83ab"),l=o("9bf2"),c=o("5c6c");i.exports=a?function(u,d,f){return l.f(u,d,c(1,f))}:function(u,d,f){return u[d]=f,u}},9263:function(i,s,o){var a=o("ad6d"),l=o("9f7f"),c=RegExp.prototype.exec,u=String.prototype.replace,d=c,f=function(){var m=/a/,b=/b*/g;return c.call(m,"a"),c.call(b,"a"),m.lastIndex!==0||b.lastIndex!==0}(),p=l.UNSUPPORTED_Y||l.BROKEN_CARET,h=/()??/.exec("")[1]!==void 0,g=f||h||p;g&&(d=function(b){var T=this,E,w,M,A,I=p&&T.sticky,j=a.call(T),$=T.source,J=0,se=b;return I&&(j=j.replace("y",""),j.indexOf("g")===-1&&(j+="g"),se=String(b).slice(T.lastIndex),T.lastIndex>0&&(!T.multiline||T.multiline&&b[T.lastIndex-1]!==` 153`)&&($="(?: "+$+")",se=" "+se,J++),w=new RegExp("^(?:"+$+")",j)),h&&(w=new RegExp("^"+$+"$(?!\\s)",j)),f&&(E=T.lastIndex),M=c.call(I?w:T,se),I?M?(M.input=M.input.slice(J),M[0]=M[0].slice(J),M.index=T.lastIndex,T.lastIndex+=M[0].length):T.lastIndex=0:f&&M&&(T.lastIndex=T.global?M.index+M[0].length:E),h&&M&&M.length>1&&u.call(M[0],w,function(){for(A=1;A<arguments.length-2;A++)arguments[A]===void 0&&(M[A]=void 0)}),M}),i.exports=d},"94ca":function(i,s,o){var a=o("d039"),l=/#|\.prototype\./,c=function(h,g){var m=d[u(h)];return m==p?!0:m==f?!1:typeof g=="function"?a(g):!!g},u=c.normalize=function(h){return String(h).replace(l,".").toLowerCase()},d=c.data={},f=c.NATIVE="N",p=c.POLYFILL="P";i.exports=c},"99af":function(i,s,o){var a=o("23e7"),l=o("d039"),c=o("e8b5"),u=o("861d"),d=o("7b0b"),f=o("50c4"),p=o("8418"),h=o("65f
1530"),g=o("1dde"),m=o("b622"),b=o("2d00"),T=m("isConcatSpreadable"),E=9007199254740991,w="Maximum allowed index exceeded",M=b>=51||!l(function(){var $=[];return $[T]=!1,$.concat()[0]!==$}),A=g("concat"),I=function($){if(!u($))return!1;var J=$[T];return J!==void 0?!!J:c($)},j=!M||!A;a({target:"Array",proto:!0,forced:j},{concat:function(J){var se=d(this),Q=h(se,0),G=0,ee,ge,ae,ke,Le;for(ee=-1,ae=arguments.length;ee<ae;ee++)if(Le=ee===-1?se:arguments[ee],I(Le)){if(ke=f(Le.length),G+ke>E)throw TypeError(w);for(ge=0;ge<ke;ge++,G++)ge in Le&&p(Q,G,Le[ge])}else{if(G>=E)throw TypeError(w);p(Q,G++,Le)}return Q.length=G,Q}})},"9bdd":function(i,s,o){var a=o("825a");i.exports=function(l,c,u,d){try{return d?c(a(u)[0],u[1]):c(u)}catch(p){var f=l.return;throw f!==void 0&&a(f.call(l)),p}}},"9bf2":function(i,s,o){var a=o("83ab"),l=o("0cfb"),c=o("825a"),u=o("c04e"),d=Object.defineProperty;s.f=a?d:function(p,h,g){if(c(p),h=u(h,!0),c(g),l)try{return d(p,h,g)}catch{}if("get"in g||"set"in g)throw TypeError("Accessors not supported");return"value"in g&&(p[h]=g.value),p}},"9ed3":function(i,s,o){var a=o("ae93").IteratorPrototype,l=o("7c73"),c=o("5c6c"),u=o("d44e"),d=o("3f8c"),f=function(){return this};i.exports=function(p,h,g){var m=h+" Iterator";return p.prototype=l(a,{next:c(1,g)}),u(p,m,!1,!0),d[m]=f,p}},"9f7f":function(i,s,o){var a=o("d039");function l(c,u){return RegExp(c,u)}s.UNSUPPORTED_Y=a(function(){var c=l("a","y");return c.lastIndex=2,c.exec("abcd")!=null}),s.BROKEN_CARET=a(function(){var c=l("^r","gy");return c.lastIndex=2,c.exec("str")!=null})},a2bf:function(i,s,o){var a=o("e8b5"),l=o("50c4"),c=o("0366"),u=function(d,f,p,h,g,m,b,T){for(var E=g,w=0,M=b?c(b,T,3):!1,A;w<h;){if(w in p){if(A=M?M(p[w],w,f):p[w],m>0&&a(A))E=u(d,f,A,l(A.length),E,m-1)-1;else{if(E>=9007199254740991)throw TypeError("Exceed the acceptable array length");d[E]=A}E++}w++}return E};i.exports=u},a352:function(i,s){i.exports=r},a434:function(i,s,o){var a=o("23e7"),l=o("23cb"),c=o("a691"),u=o("50c4"),d=o("7b0b"),f=o("65f0"),p=o("8418"),h=o("1dde"),g=o("ae40"),m=h("splice"),b=g("splice",{ACCESSORS:!0,0:0,1:2}),T=Math.max,E=Math.min,w=9007199254740991,M="Maximum allowed length exceeded";a({target:"Array",proto:!0,forced:!m||!b},{splice:function(I,j){var $=d(this),J=u($.length),se=l(I,J),Q=arguments.length,G,ee,ge,ae,ke,Le;if(Q===0?G=ee=0:Q===1?(G=0,ee=J-se):(G=Q-2,ee=E(T(c(j),0),J-se)),J+G-ee>w)throw TypeError(M);for(ge=f($,ee),ae=0;ae<ee;ae++)ke=se+ae,ke in $&&p(ge,ae,$[ke]);if(ge.length=ee,G<ee){for(ae=se;ae<J-ee;ae++)ke=ae+ee,Le=ae+G,ke in $?$[Le]=$[ke]:delete $[Le];for(ae=J;ae>J-ee+G;ae--)delete $[ae-1]}else if(G>ee)for(ae=J-ee;ae>se;ae--)ke=ae+ee-1,Le=ae+G-1,ke in $?$[Le]=$[ke]:delete $[Le];for(ae=0;ae<G;ae++)$[ae+se]=arguments[ae+2];return $.length=J-ee+G,ge}})},a4d3:function(i,s,o){var a=o("23e7"),l=o("da84"),c=o("d066"),u=o("c430"),d=o("83ab"),f=o("4930"),p=o("fdbf"),h=o("d039"),g=o("5135"),m=o("e8b5"),b=o("861d"),T=o("825a"),E=o("7b0b"),w=o("fc6a"),M=o("c04e"),A=o("5c6c"),I=o("7c73"),j=o("df75"),$=o("241c"),J=o("057f"),se=o("7418"),Q=o("06cf"),G=o("9bf2"),ee=o("d1e7"),ge=o("9112"),ae=o("6eeb"),ke=o("5692"),Le=o("f772"),Ue=o("d012"),Ze=o("90e3"),Je=o("b622"),Xe=o("e538"),We=o("746f"),rt=o("d44e"),je=o("69f3"),Te=o("b727").forEach,q=Le("hidden"),pe="Symbol",ce="prototype",be=Je("toPrimitive"),He=je.set,at=je.getterFor(pe),Ce=Object[ce],Oe=l.Symbol,lt=c("JSON","stringify"),yt=Q.f,ht=G.f,R=J.f,F=ee.f,ie=ke("symbols"),fe=ke("op-symbols"),Ve=ke("string-to-symbol-registry"),B=ke("symbol-to-string-registry"),D=ke("wks"),U=l.QObject,le=!U||!U[ce]||!U[ce].findChild,Ie=d&&h(function(){return I(ht({},"a",{get:function(){return ht(this,"a",{value:7}).a}})).a!=7})?function(xe,Ee,De){var dt=yt(Ce,Ee);dt&&delete Ce[Ee],ht(xe,Ee,De),dt&&xe!==Ce&&ht(Ce,Ee,dt)}:ht,Ke=function(xe,Ee){var De=ie[xe]=I(Oe[ce]);return He(De,{type:pe,tag:xe,description:Ee}),d||(De.description=Ee),De},H=p?function(xe){return typeof xe=="symbol"}:function(xe){return Object(xe)instanceof Oe},V=function(Ee,De,dt){Ee===Ce&&V(fe,De,dt),T(Ee);var bt=M(De,!0);return T(dt),g(ie,bt)?(dt.enumerable?(g(Ee,q)&&Ee[q][bt]&&(Ee[q][bt]=!1),dt=I(dt,{enumerable:A(0,!1)})):(g(Ee,q)||ht(Ee,q,A(1,{})),Ee[q][bt]=!0),Ie(Ee,bt,dt)):ht(Ee,bt,dt)},Z=function(Ee,De){T(Ee);var dt=w(De),bt=j(dt).concat(we(dt));return Te(bt,function($t){(!d||Pe.call(dt,$t))&&V(Ee,$t,dt[$t])}),Ee},de=function(Ee,De){return De===void 0?I(Ee):Z(I(Ee),De)},Pe=function(Ee){var De=M(Ee,!0),dt=F.call(this,De);return this===Ce&&g(ie,De)&&!g(fe,De)?!1:dt||!g(this,De)||!g(ie,De)||g(this,q)&&this[q][De]?dt:!0},W=function(Ee,De){var dt=w(Ee),bt=M(De,!0);if(!(dt===Ce&&g(ie,bt)&&!g(fe,bt))){var $t=yt(dt,bt);return $t&&g(ie,bt)&&!(g(dt,q)&&dt[q][bt])&&($t.enumerable=!0),$t}},ue=function(Ee){var De=R(w(Ee)),dt=[];return Te(De,function(bt){!g(ie,bt)&&!g(Ue,bt)&&dt.push(bt)}),dt},we=function(Ee){var De=Ee===Ce,dt=R(De?fe:w(Ee)),bt=[];return Te(dt,function($t){g(ie,$t)&&(!De||g(Ce,$t))&&bt.push(ie[$t])}),bt};if(f||(Oe=function(){if(this instanceof Oe)throw TypeError("Symbol is not a constructor");var Ee=!arguments.length||arguments[0]===void 0?void 0:String(arguments[0]),De=Ze(Ee),dt=function(bt){this===Ce&&dt.call(fe,bt),g(this,q)&&g(this[q],De)&&(this[q][De]=!1),Ie(this,De,A(1,bt))};
153return d&&le&&Ie(Ce,De,{configurable:!0,set:dt}),Ke(De,Ee)},ae(Oe[ce],"toString",function(){return at(this).tag}),ae(Oe,"withoutSetter",function(xe){return Ke(Ze(xe),xe)}),ee.f=Pe,G.f=V,Q.f=W,$.f=J.f=ue,se.f=we,Xe.f=function(xe){return Ke(Je(xe),xe)},d&&(ht(Oe[ce],"description",{configurable:!0,get:function(){return at(this).description}}),u||ae(Ce,"propertyIsEnumerable",Pe,{unsafe:!0}))),a({global:!0,wrap:!0,forced:!f,sham:!f},{Symbol:Oe}),Te(j(D),function(xe){We(xe)}),a({target:pe,stat:!0,forced:!f},{for:function(xe){var Ee=String(xe);if(g(Ve,Ee))return Ve[Ee];var De=Oe(Ee);return Ve[Ee]=De,B[De]=Ee,De},keyFor:function(Ee){if(!H(Ee))throw TypeError(Ee+" is not a symbol");if(g(B,Ee))return B[Ee]},useSetter:function(){le=!0},useSimple:function(){le=!1}}),a({target:"Object",stat:!0,forced:!f,sham:!d},{create:de,defineProperty:V,defineProperties:Z,getOwnPropertyDescriptor:W}),a({target:"Object",stat:!0,forced:!f},{getOwnPropertyNames:ue,getOwnPropertySymbols:we}),a({target:"Object",stat:!0,forced:h(function(){se.f(1)})},{getOwnPropertySymbols:function(Ee){return se.f(E(Ee))}}),lt){var Ge=!f||h(function(){var xe=Oe();return lt([xe])!="[null]"||lt({a:xe})!="{}"||lt(Object(xe))!="{}"});a({target:"JSON",stat:!0,forced:Ge},{stringify:function(Ee,De,dt){for(var bt=[Ee],$t=1,ui;arguments.length>$t;)bt.push(arguments[$t++]);if(ui=De,!(!b(De)&&Ee===void 0||H(Ee)))return m(De)||(De=function(Hn,Xn){if(typeof ui=="function"&&(Xn=ui.call(this,Hn,Xn)),!H(Xn))return Xn}),bt[1]=De,lt.apply(null,bt)}})}Oe[ce][be]||ge(Oe[ce],be,Oe[ce].valueOf),rt(Oe,pe),Ue[q]=!0},a630:function(i,s,o){var a=o("23e7"),l=o("4df4"),c=o("1c7e"),u=!c(function(d){Array.from(d)});a({target:"Array",stat:!0,forced:u},{from:l})},a640:function(i,s,o){var a=o("d039");i.exports=function(l,c){var u=[][l];return!!u&&a(function(){u.call(null,c||function(){throw 1},1)})}},a691:function(i,s){var o=Math.ceil,a=Math.floor;i.exports=function(l){return isNaN(l=+l)?0:(l>0?a:o)(l)}},ab13:function(i,s,o){var a=o("b622"),l=a("match");i.exports=function(c){var u=/./;try{"/./"[c](u)}catch{try{return u[l]=!1,"/./"[c](u)}catch{}}return!1}},ac1f:function(i,s,o){var a=o("23e7"),l=o("9263");a({target:"RegExp",proto:!0,forced:/./.exec!==l},{exec:l})},ad6d:function(i,s,o){var a=o("825a");i.exports=function(){var l=a(this),c="";return l.global&&(c+="g"),l.ignoreCase&&(c+="i"),l.multiline&&(c+="m"),l.dotAll&&(c+="s"),l.unicode&&(c+="u"),l.sticky&&(c+="y"),c}},ae40:function(i,s,o){var a=o("83ab"),l=o("d039"),c=o("5135"),u=Object.defineProperty,d={},f=function(p){throw p};i.exports=function(p,h){if(c(d,p))return d[p];h||(h={});var g=[][p],m=c(h,"ACCESSORS")?h.ACCESSORS:!1,b=c(h,0)?h[0]:f,T=c(h,1)?h[1]:void 0;return d[p]=!!g&&!l(function(){if(m&&!a)return!0;var E={length:-1};m?u(E,1,{enumerable:!0,get:f}):E[1]=1,g.call(E,b,T)})}},ae93:function(i,s,o){var a=o("e163"),l=o("9112"),c=o("5135"),u=o("b622"),d=o("c430"),f=u("iterator"),p=!1,h=function(){return this},g,m,b;[].keys&&(b=[].keys(),"next"in b?(m=a(a(b)),m!==Object.prototype&&(g=m)):p=!0),g==null&&(g={}),!d&&!c(g,f)&&l(g,f,h),i.exports={IteratorPrototype:g,BUGGY_SAFARI_ITERATORS:p}},b041:function(i,s,o){var a=o("00ee"),l=o("f5df");i.exports=a?{}.toString:function(){return"[object "+l(this)+"]"}},b0c0:function(i,s,o){var a=o("83ab"),l=o("9bf2").f,c=Function.prototype,u=c.toString,d=/^\s*function ([^ (]*)/,f="name";a&&!(f in c)&&l(c,f,{configurable:!0,get:function(){try{return u.call(this).match(d)[1]}catch{return""}}})},b622:function(i,s,o){var a=o("da84"),l=o("5692"),c=o("5135"),u=o("90e3"),d=o("4930"),f=o("fdbf"),p=l("wks"),h=a.Symbol,g=f?h:h&&h.withoutSetter||u;i.exports=function(m){return c(p,m)||(d&&c(h,m)?p[m]=h[m]:p[m]=g("Symbol."+m)),p[m]}},b64b:function(i,s,o){var a=o("23e7"),l=o("7b0b"),c=o("df75"),u=o("d039"),d=u(function(){c(1)});a({target:"Object",stat:!0,forced:d},{keys:function(p){return c(l(p))}})},b727:function(i,s,o){var a=o("0366"),l=o("44ad"),c=o("7b0b"),u=o("50c4"),d=o("65f0"),f=[].push,p=function(h){var g=h==1,m=h==2,b=h==3,T=h==4,E=h==6,w=h==5||E;return function(M,A,I,j){for(var $=c(M),J=l($),se=a(A,I,3),Q=u(J.length),G=0,ee=j||d,ge=g?ee(M,Q):m?ee(M,0):void 0,ae,ke;Q>G;G++)if((w||G in J)&&(ae=J[G],ke=se(ae,G,$),h)){if(g)ge[G]=ke;else if(ke)switch(h){case 3:return!0;case 5:return ae;case 6:return G;case 2:f.call(ge,ae)}else if(T)return!1}return E?-1:b||T?T:ge}};i.exports={forEach:p(0),map:p(1),filter:p(2),some:p(3),every:p(4),find:p(5),findIndex:
153p(6)}},c04e:function(i,s,o){var a=o("861d");i.exports=function(l,c){if(!a(l))return l;var u,d;if(c&&typeof(u=l.toString)=="function"&&!a(d=u.call(l))||typeof(u=l.valueOf)=="function"&&!a(d=u.call(l))||!c&&typeof(u=l.toString)=="function"&&!a(d=u.call(l)))return d;throw TypeError("Can't convert object to primitive value")}},c430:function(i,s){i.exports=!1},c6b6:function(i,s){var o={}.toString;i.exports=function(a){return o.call(a).slice(8,-1)}},c6cd:function(i,s,o){var a=o("da84"),l=o("ce4e"),c="__core-js_shared__",u=a[c]||l(c,{});i.exports=u},c740:function(i,s,o){var a=o("23e7"),l=o("b727").findIndex,c=o("44d2"),u=o("ae40"),d="findIndex",f=!0,p=u(d);d in[]&&Array(1)[d](function(){f=!1}),a({target:"Array",proto:!0,forced:f||!p},{findIndex:function(g){return l(this,g,arguments.length>1?arguments[1]:void 0)}}),c(d)},c8ba:function(i,s){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch{typeof window=="object"&&(o=window)}i.exports=o},c975:function(i,s,o){var a=o("23e7"),l=o("4d64").indexOf,c=o("a640"),u=o("ae40"),d=[].indexOf,f=!!d&&1/[1].indexOf(1,-0)<0,p=c("indexOf"),h=u("indexOf",{ACCESSORS:!0,1:0});a({target:"Array",proto:!0,forced:f||!p||!h},{indexOf:function(m){return f?d.apply(this,arguments)||0:l(this,m,arguments.length>1?arguments[1]:void 0)}})},ca84:function(i,s,o){var a=o("5135"),l=o("fc6a"),c=o("4d64").indexOf,u=o("d012");i.exports=function(d,f){var p=l(d),h=0,g=[],m;for(m in p)!a(u,m)&&a(p,m)&&g.push(m);for(;f.length>h;)a(p,m=f[h++])&&(~c(g,m)||g.push(m));return g}},caad:function(i,s,o){var a=o("23e7"),l=o("4d64").includes,c=o("44d2"),u=o("ae40"),d=u("indexOf",{ACCESSORS:!0,1:0});a({target:"Array",proto:!0,forced:!d},{includes:function(p){return l(this,p,arguments.length>1?arguments[1]:void 0)}}),c("includes")},cc12:function(i,s,o){var a=o("da84"),l=o("861d"),c=a.document,u=l(c)&&l(c.createElement);i.exports=function(d){return u?c.createElement(d):{}}},ce4e:function(i,s,o){var a=o("da84"),l=o("9112");i.exports=function(c,u){try{l(a,c,u)}catch{a[c]=u}return u}},d012:function(i,s){i.exports={}},d039:function(i,s){i.exports=function(o){try{return!!o()}catch{return!0}}},d066:function(i,s,o){var a=o("428f"),l=o("da84"),c=function(u){return typeof u=="function"?u:void 0};i.exports=function(u,d){return arguments.length<2?c(a[u])||c(l[u]):a[u]&&a[u][d]||l[u]&&l[u][d]}},d1e7:function(i,s,o){var a={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,c=l&&!a.call({1:2},1);s.f=c?function(d){var f=l(this,d);return!!f&&f.enumerable}:a},d28b:function(i,s,o){var a=o("746f");a("iterator")},d2bb:function(i,s,o){var a=o("825a"),l=o("3bbe");
153i.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var c=!1,u={},d;try{d=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,d.call(u,[]),c=u instanceof Array}catch{}return function(p,h){return a(p),l(h),c?d.call(p,h):p.__proto__=h,p}}():void 0)},d3b7:function(i,s,o){var a=o("00ee"),l=o("6eeb"),c=o("b041");a||l(Object.prototype,"toString",c,{unsafe:!0})},d44e:function(i,s,o){var a=o("9bf2").f,l=o("5135"),c=o("b622"),u=c("toStringTag");i.exports=function(d,f,p){d&&!l(d=p?d:d.prototype,u)&&a(d,u,{configurable:!0,value:f})}},d58f:function(i,s,o){var a=o("1c0b"),l=o("7b0b"),c=o("44ad"),u=o("50c4"),d=function(f){return function(p,h,g,m){a(h);var b=l(p),T=c(b),E=u(b.length),w=f?E-1:0,M=f?-1:1;if(g<2)for(;;){if(w in T){m=T[w],w+=M;break}if(w+=M,f?w<0:E<=w)throw TypeError("Reduce of empty array with no initial value")}for(;f?w>=0:E>w;w+=M)w in T&&(m=h(m,T[w],w,b));return m}};i.exports={left:d(!1),right:d(!0)}},d784:function(i,s,o){o("ac1f");var a=o("6eeb"),l=o("d039"),c=o("b622"),u=o("9263"),d=o("9112"),f=c("species"),p=!l(function(){var T=/./;return T.exec=function(){var E=[];return E.groups={a:"7"},E},"".replace(T,"$<a>")!=="7"}),h=function(){return"a".replace(/./,"$0")==="$0"}(),g=c("replace"),m=function(){return/./[g]?/./[g]("a","$0")==="":!1}(),b=!l(function(){var T=/(?:)/,E=T.exec;T.exec=function(){return E.apply(this,arguments)};var w="ab".split(T);return w.length!==2||w[0]!=="a"||w[1]!=="b"});i.exports=function(T,E,w,M){var A=c(T),I=!l(function(){var G={};return G[A]=function(){return 7},""[T](G)!=7}),j=I&&!l(function(){var G=!1,ee=/a/;return T==="split"&&(ee={},ee.constructor={},ee.constructor[f]=function(){return ee},ee.flags="",ee[A]=/./[A]),ee.exec=function(){return G=!0,null},ee[A](""),!G});if(!I||!j||T==="replace"&&!(p&&h&&!m)||T==="split"&&!b){var $=/./[A],J=w(A,""[T],function(G,ee,ge,ae,ke){return ee.exec===u?I&&!ke?{done:!0,value:$.call(ee,ge,ae)}:{done:!0,value:G.call(ge,ee,ae)}:{done:!1}},{REPLACE_KEEPS_$0:h,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:m}),se=J[0],Q=J[1];a(String.prototype,T,se),a(RegExp.prototype,A,E==2?function(G,ee){return Q.call(G,this,ee)}:function(G){return Q.call(G,this)})}M&&d(RegExp.prototype[A],"sham",!0)}},d81d:function(i,s,o){var a=o("23e7"),l=o("b727").map,c=o("1dde"),u=o("ae40"),d=c("map"),f=u("map");a({target:"Array",proto:!0,forced:!d||!f},{map:function(h){return l(this,h,arguments.length>1?arguments[1]:void 0)}})},da84:function(i,s,o){(function(a){var l=function(c){return c&&c.Math==Math&&c};i.exports=l(typeof globalThis=="object"&&globalThis)||l(typeof window=="object"&&window)||l(typeof self=="object"&&self)||l(typeof a=="object"&&a)||Function("return this")()}).call(this,o("c8ba"))},dbb4:function(i,s,o){var a=o("23e7"),l=o("83ab"),c=o("56ef"),u=o("fc6a"),d=o("06cf"),f=o("8418");a({target:"Object",stat:!0,sham:!l},{getOwnPropertyDescriptors:function(h){for(var g=u(h),m=d.f,b=c(g),T={},E=0,w,M;b.length>E;)M=m(g,w=b[E++]),M!==void 0&&f(T,w,M);return T}})},dbf1:function(i,s,o){(function(a){o.d(s,"a",function(){return c});function l(){return typeof window<"u"?window.console:a.console}var c=l()}).call(this,o("c8ba"))},ddb0:function(i,s,o){var a=o("da84"),l=o("fdbc"),c=o("e260"),u=o("9112"),d=o("b622"),f=d("iterator"),p=d("toStringTag"),h=c.values;for(var g in l){var m=a[g],b=m&&m.prototype;if(b){if(b[f]!==h)try{u(b,f,h)}catch{b[f]=h}if(b[p]||u(b,p,g),l[g]){for(var T in c)if(b[T]!==c[T])try{u(b,T,c[T])}catch{b[T]=c[T]}}}}},df75:function(i,s,o){var a=o("ca84"),l=o("7839");i.exports=Object.keys||function(u){return a(u,l)}},e01a:function(i,s,o){var a=o("23e7"),l=o("83ab"),c=o("da84"),u=o("5135"),d=o("861d"),f=o("9bf2").f,p=o("e893"),h=c.Symbol;if(l&&typeof h=="function"&&(!("description"in h.prototype)||h().description!==void 0)){var g={},m=function(){var A=arguments.length<1||arguments[0]===void 0?void 0:String(arguments[0]),I=this instanceof m?new h(A):A===void 0?h():h(A);return A===""&&(g[I]=!0),I};p(m,h);var b=m.prototype=h.prototype;b.constructor=m;var T=b.toString,E=String(h("test"))=="Symbol(test)",w=/^Symbol\((.*)\)[^)]+$/;f(b,"description",{configurable:!0,get:function(){var A=d(this)?this.valueOf():this,I=T.call(A);if(u(g,A))return"";var j=E?I.slice(7,-1):I.replace(w,"$1");return j===""?void 0:j}}),a({global:!0,forced:!0},{Symbol:m})}},e163:function(i,s,o){var a=o("5135"),l=o("7b0b"),c=o("f772"),u=o("e177"),d=c("IE_PROTO"),f=Object.prototype;i.exports=u?Object.getPrototypeOf:function(p){return p=l(p),a(p,d)?p[d]:typeof p.constructor=="function"&&p instanceof p.constructor?p.constructor.prototype:p instanceof Object?f:null}},e177:function(i,s,o){var a=o("d039");i.exports=!a(function(){function l(){}return l.prototype.constructor=null,Object.getPrototypeOf(new l)!==l.prototype})},e260:function(i,s,o){var a=o("fc6a"),l=o("44d2"),c=o("3f8c"),u=o("69f3"),d=o("7dd0"),f="Array Iterator",p=u.set,h=u.getterFor(f);i.exports=d(Array,"Array",function(g,m){p(this,{type:f,target:a(g),index:0,kind:m})},function(){var g=h(this),m=g.target,b=g.kind,T=g.index++;return!m||T>=m.length?(g.target=void 0,{value:void 0,done:!0}):b=="keys"?{value:T,done:!1}:b=="values"?{value:m[T],done:!1}:{value:[T,m[T]],done:!1}},"values"),c.Arguments=c.Array,l("keys"),l("values"),l("entries")},e439:function(i,s,o){var a=o("23e7"),l=o("d039"),c=o("fc6a"),u=o("06cf").f,d=o("83ab"),f=l(function(){u(1)}),p=!d||f;a({target:"Object",stat:!0,forced:p,sham:!d},{getOwnPropertyDescriptor:function(g,m){return u(c(g),m)}})},e538:function(i,s,o){var a=o("b622");s.f=a},e893:function(i,s,o){var a=o("5135"),l=o("56ef"),c=o("06cf"),u=o("9bf2");i.exports=function(d,f){for(var p=l(f),h=u.f,g=c.f,m=0;m<p.length;m++){var b=p[m];a(d,b)||h(d,b,g(f,b))}}},e8b5:function(i,s,o){var a=o("c6b6");i.exports=Array.isArray||function(c){return a(c)=="Array"}},e95a:function(i,s,o){var a=o("b622"),l=o("3f8c"),c=a("iterator"),u=Array.prototype;i.exports=function(d){return d!==void 0&&(l.Array===d||u[c]===d)}},f5df:function(i,s,o){var a=o("00ee"),l=o("c6b6"),c=o("b622"),u=c("toStringTag"),d=l(function(){return arguments}())=="Arguments",f=function(p,h){try{return p[h]}catch{}};i.exports=a?l:function(p){var h,g,m;return p===void 0?"Undefined":p===null?"Null":typeof(g=f(h=Object(p),u))=="string"?g:d?l(h):(m=l(h))=="Object"&&typeof h.callee=="function"?"Arguments":m}}
153,f772:function(i,s,o){var a=o("5692"),l=o("90e3"),c=a("keys");i.exports=function(u){return c[u]||(c[u]=l(u))}},fb15:function(i,s,o){if(o.r(s),typeof window<"u"){var a=window.document.currentScript;{var l=o("8875");a=l(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:l})}var c=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);c&&(o.p=c[1])}o("99af"),o("4de4"),o("4160"),o("c975"),o("d81d"),o("a434"),o("159b"),o("a4d3"),o("e439"),o("dbb4"),o("b64b");function u(H,V,Z){return V in H?Object.defineProperty(H,V,{value:Z,enumerable:!0,configurable:!0,writable:!0}):H[V]=Z,H}function d(H,V){var Z=Object.keys(H);if(Object.getOwnPropertySymbols){var de=Object.getOwnPropertySymbols(H);V&&(de=de.filter(function(Pe){return Object.getOwnPropertyDescriptor(H,Pe).enumerable})),Z.push.apply(Z,de)}return Z}function f(H){for(var V=1;V<arguments.length;V++){var Z=arguments[V]!=null?arguments[V]:{};V%2?d(Object(Z),!0).forEach(function(de){u(H,de,Z[de])}):Object.getOwnPropertyDescriptors?Object.defineProperties(H,Object.getOwnPropertyDescriptors(Z)):d(Object(Z)).forEach(function(de){Object.defineProperty(H,de,Object.getOwnPropertyDescriptor(Z,de))})}return H}function p(H){if(Array.isArray(H))return H}o("e01a"),o("d28b"),o("e260"),o("d3b7"),o("3ca3"),o("ddb0");function h(H,V){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(H)))){var Z=[],de=!0,Pe=!1,W=void 0;try{for(var ue=H[Symbol.iterator](),we;!(de=(we=ue.next()).done)&&(Z.push(we.value),!(V&&Z.length===V));de=!0);}catch(Ge){Pe=!0,W=Ge}finally{try{!de&&ue.return!=null&&ue.return()}finally{if(Pe)throw W}}return Z}}o("a630"),o("fb6a"),o("b0c0"),o("25f0");function g(H,V){(V==null||V>H.length)&&(V=H.length);for(var Z=0,de=new Array(V);Z<V;Z++)de[Z]=H[Z];return de}function m(H,V){if(H){if(typeof H=="string")return g(H,V);var Z=Object.prototype.toString.call(H).slice(8,-1);if(Z==="Object"&&H.constructor&&(Z=H.constructor.name),Z==="Map"||Z==="Set")return Array.from(H);if(Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z))return g(H,V)}}function b(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 154In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(H,V){return p(H)||h(H,V)||m(H,V)||b()}function E(H){if(Array.isArray(H))return g(H)}function w(H){if(typeof Symbol<"u"&&Symbol.iterator in Object(H))return Array.from(H)}function M(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 155In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(H){return E(H)||w(H)||m(H)||M()}var I=o("a352"),j=o.n(I);function $(H){H.parentElement!==null&&H.parentElement.removeChild(H)}function J(H,V,Z){var de=Z===0?H.children[0]:H.children[Z-1].nextSibling;H.insertBefore(V,de)}var se=o("dbf1");o("13d5"),o("4fad"),o("ac1f"),o("5319");function Q(H){var V=Object.create(null);return function(de){var Pe=V[de];return Pe||(V[de]=H(de))}}var G=/-(\w)/g,ee=Q(function(H){return H.replace(G,function(V,Z){return Z.toUpperCase()})});o("5db7"),o("73d9");var ge=["Start","Add","Remove","Update","End"],ae=["Choose","Unchoose","Sort","Filter","Clone"],ke=["Move"],Le=[ke,ge,ae].flatMap(function(H){return H}).map(function(H){return"on".concat(H)}),Ue={manage:ke,manageAndEmit:ge,emit:ae};function Ze(H){return Le.indexOf(H)!==-1}o("caad"),o("2ca0");var Je=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function Xe(H){return Je.includes(H)}function We(H){return["transition-group","TransitionGroup"].includes(H)}function rt(H){return["id","class","role","style"].includes(H)||H.startsWith("data-")||H.startsWith("aria-")||H.startsWith("on")}function je(H){return H.reduce(function(V,Z){var de=T(Z,2),Pe=de[0],W=de[1];return V[Pe]=W,V},{})}function Te(H){var V=H.$attrs,Z=H.componentData,de=Z===void 0?{}:Z,Pe=je(Object.entries(V).filter(function(W){var ue=T(W,2),we=ue[0];return ue[1],rt(we)}));return f(f({},Pe),de)}function q(H){var V=H.$attrs,Z=H.callBackBuilder,de=je(pe(V));
155Object.entries(Z).forEach(function(W){var ue=T(W,2),we=ue[0],Ge=ue[1];Ue[we].forEach(function(xe){de["on".concat(xe)]=Ge(xe)})});var Pe="[data-draggable]".concat(de.draggable||"");return f(f({},de),{},{draggable:Pe})}function pe(H){return Object.entries(H).filter(function(V){var Z=T(V,2),de=Z[0];return Z[1],!rt(de)}).map(function(V){var Z=T(V,2),de=Z[0],Pe=Z[1];return[ee(de),Pe]}).filter(function(V){var Z=T(V,2),de=Z[0];return Z[1],!Ze(de)})}o("c740");function ce(H,V){if(!(H instanceof V))throw new TypeError("Cannot call a class as a function")}function be(H,V){for(var Z=0;Z<V.length;Z++){var de=V[Z];de.enumerable=de.enumerable||!1,de.configurable=!0,"value"in de&&(de.writable=!0),Object.defineProperty(H,de.key,de)}}function He(H,V,Z){return V&&be(H.prototype,V),H}var at=function(V){var Z=V.el;return Z},Ce=function(V,Z){return V.__draggable_context=Z},Oe=function(V){return V.__draggable_context},lt=function(){function H(V){var Z=V.nodes,de=Z.header,Pe=Z.default,W=Z.footer,ue=V.root,we=V.realList;ce(this,H),this.defaultNodes=Pe,this.children=[].concat(A(de),A(Pe),A(W)),this.externalComponent=ue.externalComponent,this.rootTransition=ue.transition,this.tag=ue.tag,this.realList=we}return He(H,[{key:"render",value:function(Z,de){var Pe=this.tag,W=this.children,ue=this._isRootComponent,we=ue?{default:function(){return W}}:W;return Z(Pe,de,we)}},{key:"updated",value:function(){var Z=this.defaultNodes,de=this.realList;Z.forEach(function(Pe,W){Ce(at(Pe),{element:de[W],index:W})})}},{key:"getUnderlyingVm",value:function(Z){return Oe(Z)}},{key:"getVmIndexFromDomIndex",value:function(Z,de){var Pe=this.defaultNodes,W=Pe.length,ue=de.children,we=ue.item(Z);if(we===null)return W;var Ge=Oe(we);if(Ge)return Ge.index;if(W===0)return 0;var xe=at(Pe[0]),Ee=A(ue).findIndex(function(De){return De===xe});return Z<Ee?0:W}},{key:"_isRootComponent",get:function(){return this.externalComponent||this.rootTransition}}]),H}(),yt=o("8bbf");function ht(H,V){var Z=H[V];return Z?Z():[]}function R(H){var V=H.$slots,Z=H.realList,de=H.getKey,Pe=Z||[],W=["header","footer"].map(function(De){return ht(V,De)}),ue=T(W,2),we=ue[0],Ge=ue[1],xe=V.item;if(!xe)throw new Error("draggable element must have an item slot");var Ee=Pe.flatMap(function(De,dt){return xe({element:De,index:dt}).map(function(bt){return bt.key=de(De),bt.props=f(f({},bt.props||{}),{},{"data-draggable":!0}),bt})});if(Ee.length!==Pe.length)throw new Error("Item slot must have only one child");return{header:we,footer:Ge,default:Ee}}function F(H){var V=We(H),Z=!Xe(H)&&!V;return{transition:V,externalComponent:Z,tag:Z?Object(yt.resolveComponent)(H):V?yt.TransitionGroup:H}}function ie(H){var V=H.$slots,Z=H.tag,de=H.realList,Pe=H.getKey,W=R({$slots:V,realList:de,getKey:Pe}),ue=F(Z);return new lt({nodes:W,root:ue,realList:de})}function fe(H,V){var Z=this;Object(yt.nextTick)(function(){return Z.$emit(H.toLowerCase(),V)})}function Ve(H){var V=this;return function(Z,de){if(V.realList!==null)return V["onDrag".concat(H)](Z,de)}}function B(H){var V=this,Z=Ve.call(this,H);return function(de,Pe){Z.call(V,de,Pe),fe.call(V,H,de)}}var D=null,U={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:function(V){return V}},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},le=["update:modelValue","change"].concat(A([].concat(A(Ue.manageAndEmit),A(Ue.emit)).map(function(H){return H.toLowerCase()}))),Ie=Object(yt.defineComponent)({name:"draggable",inheritAttrs:!1,props:U,emits:le,data:function(){return{error:!1}},render:function(){try{this.error=!1;var V=this.$slots,Z=this.$attrs,de=this.tag,Pe=this.componentData,W=this.realList,ue=this.getKey,we=ie({$slots:V,tag:de,realList:W,getKey:ue});this.componentStructure=we;var Ge=Te({$attrs:Z,componentData:Pe});return we.render(yt.h,Ge)}catch(xe){return this.error=!0,Object(yt.h)("pre",{style:{color:"red"}},xe.stack)}},created:function(){this.list!==null&&this.modelValue!==null&&se.a.error("modelValue and list props are mutually exclusive! Please set one or another.")}
155,mounted:function(){var V=this;if(!this.error){var Z=this.$attrs,de=this.$el,Pe=this.componentStructure;Pe.updated();var W=q({$attrs:Z,callBackBuilder:{manageAndEmit:function(Ge){return B.call(V,Ge)},emit:function(Ge){return fe.bind(V,Ge)},manage:function(Ge){return Ve.call(V,Ge)}}}),ue=de.nodeType===1?de:de.parentElement;this._sortable=new j.a(ue,W),this.targetDomElement=ue,ue.__draggable_component__=this}},updated:function(){this.componentStructure.updated()},beforeUnmount:function(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList:function(){var V=this.list;return V||this.modelValue},getKey:function(){var V=this.itemKey;return typeof V=="function"?V:function(Z){return Z[V]}}},watch:{$attrs:{handler:function(V){var Z=this._sortable;Z&&pe(V).forEach(function(de){var Pe=T(de,2),W=Pe[0],ue=Pe[1];Z.option(W,ue)})},deep:!0}},methods:{getUnderlyingVm:function(V){return this.componentStructure.getUnderlyingVm(V)||null},getUnderlyingPotencialDraggableComponent:function(V){return V.__draggable_component__},emitChanges:function(V){var Z=this;Object(yt.nextTick)(function(){return Z.$emit("change",V)})},alterList:function(V){if(this.list){V(this.list);return}var Z=A(this.modelValue);V(Z),this.$emit("update:modelValue",Z)},spliceList:function(){var V=arguments,Z=function(Pe){return Pe.splice.apply(Pe,A(V))};this.alterList(Z)},updatePosition:function(V,Z){var de=function(W){return W.splice(Z,0,W.splice(V,1)[0])};this.alterList(de)},getRelatedContextFromMoveEvent:function(V){var Z=V.to,de=V.related,Pe=this.getUnderlyingPotencialDraggableComponent(Z);if(!Pe)return{component:Pe};var W=Pe.realList,ue={list:W,component:Pe};if(Z!==de&&W){var we=Pe.getUnderlyingVm(de)||{};return f(f({},we),ue)}return ue},getVmIndexFromDomIndex:function(V){return this.componentStructure.getVmIndexFromDomIndex(V,this.targetDomElement)},onDragStart:function(V){this.context=this.getUnderlyingVm(V.item),V.item._underlying_vm_=this.clone(this.context.element),D=V.item},onDragAdd:function(V){var Z=V.item._underlying_vm_;if(Z!==void 0){$(V.item);var de=this.getVmIndexFromDomIndex(V.newIndex);this.spliceList(de,0,Z);var Pe={element:Z,newIndex:de};this.emitChanges({added:Pe})}},onDragRemove:function(V){if(J(this.$el,V.item,V.oldIndex),V.pullMode==="clone"){$(V.clone);return}var Z=this.context,de=Z.index,Pe=Z.element;this.spliceList(de,1);var W={element:Pe,oldIndex:de};this.emitChanges({removed:W})},onDragUpdate:function(V){$(V.item),J(V.from,V.item,V.oldIndex);var Z=this.context.index,de=this.getVmIndexFromDomIndex(V.newIndex);this.updatePosition(Z,de);var Pe={element:this.context.element,oldIndex:Z,newIndex:de};this.emitChanges({moved:Pe})},computeFutureIndex:function(V,Z){if(!V.element)return 0;var de=A(Z.to.children).filter(function(we){return we.style.display!=="none"}),Pe=de.indexOf(Z.related),W=V.component.getVmIndexFromDomIndex(Pe),ue=de.indexOf(D)!==-1;return ue||!Z.willInsertAfter?W:W+1},onDragMove:function(V,Z){var de=this.move,Pe=this.realList;if(!de||!Pe)return!0;var W=this.getRelatedContextFromMoveEvent(V),ue=this.computeFutureIndex(W,V),we=f(f({},this.context),{},{futureIndex:ue}),Ge=f(f({},V),{},{relatedContext:W,draggedContext:we});return de(Ge,Z)},onDragEnd:function(){D=null}}}),Ke=Ie;s.default=Ke},fb6a:function(i,s,o){var a=o("23e7"),l=o("861d"),c=o("e8b5"),u=o("23cb"),d=o("50c4"),f=o("fc6a"),p=o("8418"),h=o("b622"),g=o("1dde"),m=o("ae40"),b=g("slice"),T=m("slice",{ACCESSORS:!0,0:0,1:2}),E=h("species"),w=[].slice,M=Math.max;a({target:"Array",proto:!0,forced:!b||!T},{slice:function(I,j){var $=f(this),J=d($.length),se=u(I,J),Q=u(j===void 0?J:j,J),G,ee,ge;if(c($)&&(G=$.constructor,typeof G=="function"&&(G===Array||c(G.prototype))?G=void 0:l(G)&&(G=G[E],G===null&&(G=void 0)),G===Array||G===void 0))return w.call($,se,Q);for(ee=new(G===void 0?Array:G)(M(Q-se,0)),ge=0;se<Q;se++,ge++)se in $&&p(ee,ge,$[se]);return ee.length=ge,ee}})},fc6a:function(i,s,o){var a=o("44ad"),l=o("1d80");i.exports=function(c){return a(l(c))}},fdbc:function(i,s){i.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},fdbf:function(i,s,o){var a=o("4930");i.exports=a&&!Symbol.sham&&typeof Symbol.iterator=="symbol"}}).default})})(GS);var MJ=GS.exports;const oT=wn(MJ);oT.compatConfig={MODE:3};const IJ={components:{SpmTooltip:rr,Draggable:oT},props:{name:{type:String,required:!0},menu:{type:Array,default:()=>[]},dimmed:{type:Boolean,default:!1},route:{type:Object,default:()=>{}},buttons:{type:Array,default:()=>[]},subItemsToggle:{type:Boolean,default:!1}},data(){return{drag:!1,sortEnabled:!1,order:JSON.parse(localStorage.getItem("SubmenuOrder"+this.name))??[],submenuShowSubItems:{}}},computed:{opacityValue(){return this.dimmed?"opacity-50":"opacity-75"},availableMenu(){return Fw(this.menu,t=>t.accessRoles?this.$userHasRole(t.accessRoles):!0)},dragOptions(){return{animation:200,disabled:!1,ghostClass:"ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",draggable:".draggable-item"}}},methods:{navigate(t){this.$store.getters.mobileView&&this.$store.commit("toggleSubMenuLeft"),this.goTo(t)},orderChanged(t){this.order=this.getKey(t.items,"id"),localStorage.setItem("SubmenuOrder"+this.name+t.name,JSON.stringify(this.order))},dragEnd(t){this.drag=!1},getKey(t,e){return t.map(n=>am(n,e))},goTo(t){if(t!=null&&t.external){window.open(t.link);return}this.$emit("goto",t)},isActive(t){if(typeof t=="object"&&t.path)return this.route.path==t.path;let e=typeof t=="object"?t.link:t;return this.route.params.section?this.route.params.section==e:this.route.meta.section?this.route.meta.section==e:t&&t.linkParams&&t.linkParams.id?this.subIsActive(t):this.route.name==e},subIsActive(t){let e=!1;for(let n=0;n<this.route.matched.length;n++){let r=this.route.matched[n];if(r&&r.name===t.link&&this.route.params.id==t.linkParams.id){e=!0;break}}return e},toggleSubitemsVisibility(t){this.submenuShowSubItems[t.link]=!this.showSubitems(t.link),localStorage.setItem("SubmenuShowSubItems-"+t.link,this.submenuShowSubItems[t.link])},showSubitems(t){return this.subItemsToggle&&(this.submenuShowSubItems[t]??localStorage.getItem("SubmenuShowSubItems-"+t)==="true")}}},LJ={key:0,id:"spm-sidebar",class:"spm-sidebar-bg overflow-y-auto hide-native-scrollbar flex-grow h-full"},PJ={class:"spm-sidebar-head h-13 items-center flex w-full p-2 px-3 pl-4 opacity-75"},RJ={class:"font-bold text-md text-white truncate"},$J={class:"spm-sidebar-menu"},DJ={key:0,class:"spm-sidebar-menu-head flex group w-full"},NJ=["innerHTML"],FJ=["onClick","onTouchend"],jJ=["innerHTML"],BJ=["innerHTML"],HJ={class:"flex-grow truncate"},UJ=["onClick","innerHTML"],VJ=["onClick","innerHTML"],zJ=["innerHTML"],WJ=["textContent"],KJ={class:"ml-2 pl-1 border-l border-[#272930]"},qJ=["onClick"],GJ=["innerHTML"],YJ={class:"flex-grow truncate"},XJ=["innerHTML"],JJ={class:"text-center px-4 mb-4"},QJ=["onClick"];function ZJ(t,e,n,r,i,s){const o=z("spm-tooltip"),a=z("draggable");
155return t.$store.getters.showSubMenuLeft()?(S(),C("div",LJ,[x("button",PJ,[x("div",RJ,L(t.$store.getters.user.workspace_display_name),1)]),Tt(t.$slots,"top"),x("div",$J,[(S(!0),C(Fe,null,nt(s.availableMenu,l=>(S(),C("div",{key:l.name,class:"spm-sidebar-block mt-2"},[l.name&&l.items.length?(S(),C("h3",DJ,[x("span",null,L(l.name),1),l.sortable?(S(),C("button",{key:0,class:K(["ml-auto group-hover:block",i.sortEnabled?"opacity-100":"opacity-50 hidden"]),type:"button",onClick:e[0]||(e[0]=c=>i.sortEnabled=!i.sortEnabled),innerHTML:t.svg("feather-sort","h-4 w-4 currentColor")},null,10,NJ)):P("",!0)])):P("",!0),X(a,IC(s.dragOptions,{modelValue:l.items,"onUpdate:modelValue":c=>l.items=c,"item-key":c=>c.id??c.name,onStart:e[2]||(e[2]=c=>i.drag=!0),onEnd:s.dragEnd,onChange:c=>s.orderChanged(l)}),{item:Y(({element:c})=>[x("div",{class:K({"draggable-item":i.sortEnabled&&l.sortable})},[x("button",{class:K([[!c.badge||!t.$store.getters.sectionsCounts(c.link)?s.opacityValue:"",{active:s.isActive(c)||s.isActive(c.secondary),"has-active-sub":c.items&&s.subIsActive(c)}],"flex w-full spm-sidebar-item group"]),tabindex:"0",type:"button",onClick:u=>s.navigate(c),onTouchend:u=>s.navigate(c)},[i.sortEnabled&&l.sortable?(S(),C("span",{key:0,class:"ml-auto",type:"button",innerHTML:t.svg("feather-menu","stroke-icon h-4")},null,8,jJ)):P("",!0),c.icon?(S(),C("span",{key:1,class:K(["w-7 opacity-75 mr-1",c.badge?"font-bold":"font-normal"]),innerHTML:t.svg(c.icon,"stroke-icon h-4")},null,10,BJ)):P("",!0),x("span",HJ,L(c.name),1),X(o,{tooltip:t.$trans.get("Settings"),delay:[200,0],placement:"right"},{default:Y(()=>[c.secondary?(S(),C("span",{key:0,class:K(["w-auto opacity-0 transition ease-in duration-100 group-hover:opacity-75",[s.isActive(c)||s.isActive(c.secondary)?"opacity-50":"opacity-0",{"opacity-100":s.isActive(c.secondary)}]]),onClick:ct(u=>t.$emit("goto",c.secondary),["stop"]),innerHTML:t.svg(c.secondary.icon,"stroke-icon h-4")},null,10,UJ)):P("",!0)],void 0,!0),_:2},1032,["tooltip"]),n.subItemsToggle?(S(),re(o,{key:2,class:"hidden group-hover:block",tooltip:s.showSubitems(c.link)?t.$trans.get("Close list when leaving section"):t.$trans.get("Keep list open when leaving section"),delay:[50,0],placement:"right"},{default:Y(()=>[c.items&&c.items.length?(S(),C("span",{key:0,class:K(["w-auto opacity-0 transition ease-in duration-100 group-hover:opacity-75 mr-1",[s.isActive(c)||s.isActive(c.secondary)?"opacity-50":"opacity-0",{"opacity-100":s.isActive(c.secondary)}]]),onClick:ct(u=>s.toggleSubitemsVisibility(c),["stop"]),onTouchend:e[1]||(e[1]=ct(()=>{},["stop"])),innerHTML:s.showSubitems(c.link)?t.svg("solid-thumbtack","fill-current h-3 w-3 mt-1"):t.svg("regular-thumbtack","fill-current h-3 w-3 rotate-45 mt-1")},null,42,VJ)):P("",!0)],void 0,!0),_:2},1032,["tooltip"])):P("",!0),c.badge&&t.$store.getters.sectionsCounts(c.link)>0?(S(),C("span",{key:3,class:"w-auto mr-px",innerHTML:t.$store.getters.sectionsCounts(c.link)},null,8,zJ)):P("",!0),c.highlight?(S(),C("span",{key:4,class:"w-auto bg-green-600 p-1 py-px self-center rounded-lg text-white text-xs",textContent:L(c.highlight)},null,8,WJ)):P("",!0)],42,FJ),x("div",KJ,[(S(!0),C(Fe,null,nt(c.items,u=>(S(),C("button",{key:u.link,class:K([[!u.badge||!t.$store.getters.sectionsCounts(u.link)?s.opacityValue:"",{active:n.route.name==u.link||s.isActive(u)},{hidden:!s.showSubitems(c.link)&&(typeof u.hidden<"u"?!n.route.params.section.startsWith("assigned")||u.hidden:n.route.params.id!=u.linkParams.id)}],"flex w-full spm-sidebar-item group p-[7px]"]),tabindex:"0",type:"button",onClick:d=>s.navigate(u)},[u.icon?(S(),C("span",{key:0,class:K(["w-6 mr-1",[u.badge?"font-bold":"font-normal",{"opacity-75":n.route.name!=u.link}]]),innerHTML:t.svg(u.icon,"stroke-icon h-4")},null,10,GJ)):P("",!0),x("span",YJ,L(u.name),1),u.badge&&t.$store.getters.sectionsCounts(u.link)>0?(S(),C("span",{key:1,class:"w-auto mr-px",innerHTML:t.$store.getters.sectionsCounts(u.link)},null,8,XJ)):P("",!0)],10,qJ))),128))])],2)]),_:2},1040,["modelValue","onUpdate:modelValue","item-key","onEnd","onChange"])]))),128)),x("div",JJ,[(S(!0),C(Fe,null,nt(n.buttons,l=>(S(),C("button",{key:l.name,type:"button",class:K(["spm-sidebar-button",l.class]),onClick:c=>l.handler()},L(l.text),11,QJ))),128))])])])):P("",!0)}const eQ=Ae(IJ,[["render",ZJ]]),tQ={compatConfig:{RENDER_FUNCTION:!1},created(){if(this.$store.getters.customerInfo.hasActivePrimaryContract||this.$store.getters.customerInfo.hasActiveTrial)return;let t={noContract:[{title:this.$trans.get("Check your Subscription"),class:"btn bg-green-600 hover:bg-green-700 focus:bg-green-700 text-white",handler:()=>{this.$store.getters.getRouter.push({path:"/settings/subscription"})}},{title:this.$trans.get("Contact us"),default:!0,handler:()=>{window.HelpWidget("open",{contact:!0})}}],trialEnded:[{title:this.$trans.get("Go to Pricing Plans"),class:"btn bg-green-600 hover:bg-green-700 focus:bg-green-700 text-white",handler:()=>{this.$store.getters.getRouter.push({path:"/settings/subscription"})}},{title:this.$trans.get("Not Convinced Yet"),default:!0,handler:()=>{window.HelpWidget("open",{contact:!0})}}]};if(!this.$store.getters.customerInfo.hasActivePrimaryContract&&this.$store.getters.customerInfo.hasContract){this.$store.commit("showDialogModal",{title:this.$trans.get("Subscription Issue")+" ð¨",text:this.$trans.get("Unfortunately, your subscription has an issue.")+"<br><br>"+this.$userHasRole(["superadmin"])?this.$trans.get("Please check your subscription page for more information."):this.$trans.get("Please contact your account administrator."),buttons:this.$userHasRole(["superadmin"])?t.noContract:[],closeOnEsc:!1});return}this.$store.commit("showDialogModal",{title:this.$trans.get("Upgrade Your Account")+" ð",text:this.$trans.get("Thanks for trying HelpSpace.")+" "+this.$trans.get("Unfortunately, your free trial has ended.")+"<br><br>"+this.$trans.get("We'd love to welcome you as our customer, and there are several plans you can subscribe to.")+" "+this.$trans.get("Checkout our pricing plans."),buttons:this.$userHasRole(["superadmin"])?t.trialEnded:[],closeOnEsc:!1})},render(){return null}},nQ={compatConfig:{RENDER_FUNCTION:!1},created(){if(this.$store.getters.customerInfo.hasActiveTrial||!this.$store.getters.customerInfo.hasActivePrimaryContract)return;
155let t={tooManyUsers:[{title:this.$trans.get("Buy more Users ..."),class:"btn bg-green-600 hover:bg-green-700 focus:bg-green-700 text-white",handler:()=>{this.$store.getters.getRouter.push({path:"/settings/subscription"})}},{title:this.$trans.get("Remove Users..."),default:!0,handler:()=>{this.$store.getters.getRouter.push({path:"/settings/users"})}}],tooManyChannels:[{title:this.$trans.get("Buy more Channels ..."),class:"btn bg-green-600 hover:bg-green-700 focus:bg-green-700 text-white",handler:()=>{this.$store.getters.getRouter.push({path:"/settings/subscription"})}},{title:this.$trans.get("Remove Channels ..."),default:!0,handler:()=>{this.$store.getters.getRouter.push({path:"/settings/channels"})}}]};if(this.$store.getters.customerInfo.conditions.agents<this.$store.getters.customerInfo.usage.agents){let e=this.$store.getters.customerInfo.usage.agents-this.$store.getters.customerInfo.conditions.agents;this.$store.commit("showDialogModal",{title:"ð¨ "+this.$trans.get("Subscription Issue"),text:this.$trans.get("Unfortunately, there is an issue with your subscription.")+"<br><br>"+this.$userHasRole(["superadmin","billing"])?this.$trans.get("You have exceeded the maximum number of :usercount users allowed for your subscription plan. Please either remove :additionaluserscount users or buy more users.",{usercount:this.$store.getters.customerInfo.conditions.agents,additionaluserscount:e}):this.$trans.get("Please contact your Administrator."),buttons:this.$userHasRole(["superadmin","billing"])?t.tooManyUsers:[],closeOnEsc:!1});return}if(this.$store.getters.customerInfo.conditions.channels<this.$store.getters.customerInfo.usage.channels){let e=this.$store.getters.customerInfo.usage.channels-this.$store.getters.customerInfo.conditions.channels;this.$store.commit("showDialogModal",{title:"ð¨ "+this.$trans.get("Subscription Issue"),text:this.$trans.get("Unfortunately, there is an issue with your subscription.")+"<br><br>"+this.$userHasRole(["superadmin","billing"])?this.$trans.get("You have exceeded the maximum number of :channelcount channels allowed for your subscription plan. Please either remove :toomanychannelscount Channels or buy more channel Add-Ons.",{channelcount:this.$store.getters.customerInfo.conditions.channels,toomanychannelscount:e}):this.$trans.get("Please contact your Administrator."),buttons:this.$userHasRole(["superadmin","billing"])?t.tooManyChannels:[],closeOnEsc:!1});return}},render(){return null}};var rQ=_m,iQ=Rw,sQ=1/0;function oQ(t,e){return rQ(iQ(t,e),sQ)}var aQ=oQ;const lQ=wn(aQ),cQ={components:{SpmSubmenuLeft:eQ,SpmNavigationTop:WX,SpmCheckSubscriptionCouponTrial:tQ,SpmCheckSubscriptionConditions:nQ},data(){return{menuButtons:[{name:"createcustomer",text:this.$trans.get("Create Contact"),handler:()=>{this.$store.commit("showFormModal",{component:"customers/_create.modal.vue"})}}],menu:[{name:this.$trans.get("Customers"),accessRoles:["superadmin","admin"],items:[{name:this.$trans.get("Contacts"),link:"customers"},{name:this.$trans.get("Organizations"),link:"organizations"}]}]}},computed:{breadcrumb(){function t(i){return[i.items]}let e=jk(lQ(this.menu,t),["link",this.$route.name]),n=e?e.name:WC(this.$route.name),r=[];return r.push({name:this.$trans.get("Customers"),arrow:!0}),n=="Customers-detail"?(r.push({name:this.$trans.get("Contacts"),path:"/customers",arrow:!0}),r.push({name:this.$trans.get("Details"),arrow:!1}),r):(n!="Customers"&&r.push({name:n,arrow:!0}),r)}},methods:{goto(t){this.$router.push({name:t.link,params:t.linkParams})}}},uQ={class:"flex"},dQ={class:"flex flex-col flex-grow h-screen"},fQ={class:"spm-settings-content h-full"};function hQ(t,e,n,r,i,s){const o=z("spm-submenu-left"),a=z("portal"),l=z("spm-navigation-top"),c=z("router-view"),u=z("spm-check-subscription-coupon-trial"),d=z("spm-check-subscription-conditions");return S(),C("div",uQ,[X(a,{to:"submenuleft"},{default:Y(()=>[X(o,{name:t.$trans.get("Customers"),route:t.$route,menu:i.menu,buttons:i.menuButtons,onGoto:s.goto},null,8,["name","route","menu","buttons","onGoto"])],void 0,!0),_:1}),x("div",dQ,[X(l,{breadcrumb:s.breadcrumb},null,8,["breadcrumb"]),x("div",fQ,[X(c)])]),X(u),X(d)])}const pQ=Ae(cQ,[["render",hQ]]),mQ=()=>ne(()=>import("./detail-BqVIKU5L.js"),__vite__mapDeps([68,1,2,10,4,11,5,12,13,14,6,7])),gQ=()=>ne(()=>import("./table-B5hy_zY9.js"),__vite__mapDeps([69,10,1,2,4,11,5,12,13,14,6,7])),vQ=()=>ne(()=>import("./index-BsVZJIyy.js"),__vite__mapDeps([70,10,1,2,4,11,5,12,13,14,6,7])),yQ=()=>ne(()=>import("./detail-BOro1IZ2.js"),__vite__mapDeps([71,1,2,10,4,11,5,12,13,14,6,7])),bQ={path:"/customers",meta:{basePath:"/customers/"},component:pQ,children:[{name:"customers",path:"",meta:{basePath:"/"},component:gQ},{name:"organizations",path:"/customers/organizations",meta:{basePath:"/customers/organizations"},component:vQ},{name:"customers-detail",path:"/customers/:id",meta:{basePath:"/customers/:id/",label:"Contact Details"},component:mQ},{name:"organizations-detail",path:"/organizations/:id",meta:{basePath:"/organizations/:id/",label:"Organization Details"},component:yQ}]},kQ={compatConfig:{RENDER_FUNCTION:!1},mounted(){this.$nextTick(()=>{this.$el.setAttribute("style","height:"+this.$el.scrollHeight+"px;overflow-y:hidden;")}),this.$el.addEventListener("input",this.resizeTextarea)},beforeUnmount(){this.$el.removeEventListener("input",this.resizeTextarea)},methods:{resizeTextarea(t){let e=typeof t.target<"u"?t.target:t;e.style.height="auto",e.style.height=e.scrollHeight+"px"}},render(){return this.$slots.default()[0]}},wQ={compatConfig:{COMPONENT_V_MODEL:!1},components:{ResizableTextarea:kQ},props:{modelValue:{type:String,default:null},placeholder:{type:String,default:null},url:{type:String,default:null},name:{type:String,required:!0},additionalData:{type:Object,default:()=>{}},maxlength:{type:Number,default:255},method:{type:String,default:"patch"},autoSubmit:{type:Boolean,default:!0},focusAfterSubmit:{type:Boolean,default:!1},editMode:{type:Boolean,default:!1},fieldClass:{type:[String,Array],default:""},hoverClass:{type:[String,Array],default:"hover:bg-gray-100 hover:ring-2 hover:ring-gray-100 hover:cursor-pointer"},editClass:{type:[String,Array],default:"focus:ring-2 ring-primary-500"},errorClass:{type:[String,Array],default:"ring-2 ring-red-500"}},emits:["update:modelValue","enter","escape","nochange","success","error"],data(){return{editModeIsActive:!1,currentValue:this.modelValue,hasError:!1,isLoading:!1,dirty:!1}},watch:{editMode(t){t===!0&&this.edit()},modelValue(t,e){t!==e&&(this.currentValue=this.modelValue,this.$nextTick(()=>{this.$refs.resizable.resizeTextarea(this.$refs.inlineeditor)}))},currentValue(){this.dirty=!0}},mounted(){this.editMode!=!1&&this.$nextTick(()=>{this.focus(!1)})},methods:{cancel(t){if(this.currentValue=this.modelValue,this.$nextTick(()=>{this.$refs.resizable.resizeTextarea(t)}),this.editModeIsActive=!1,t&&t.target.blur(),this.url==null){this.$emit("escape");return}},focus(t){this.editModeIsActive=!0,this.$refs.inlineeditor.focus(),t&&this.$refs.inlineeditor.scrollIntoView({behavior:"smooth"})},edit(){this.isLoading||(this.editModeIsActive=!0,this.dirty||(this.currentValue=this.modelValue),this.$nextTick(()=>{this.focus(!1)}))},submit:Qt(function(t){if(this.currentValue==this.modelValue){this.editModeIsActive=!1,this.$emit("nochange");return}if(this.url==null){this.$emit("update:modelValue",this.currentValue),this.$emit("enter");return}let e={};e[this.name]=this.currentValue;let n={...e,...this.additionalData};return this.isLoading=!0,ze({method:this.method,url:this.url,data:n}).then(r=>{this.isLoading=!1,this.$emit("update:modelValue",this.currentValue),this.$emit("success",r),this.dirty=!1,this.currentValue=this.modelValue,this.focusAfterSubmit||(this.editModeIsActive=!1,t&&t.target.blur())}).catch(r=>{this.hasError=!0,this.$emit("error",r),this.$notify.error(this.$trans.get("There was an error, please check your connection.")),this.isLoading=!1})},500,{leading:!0,trailing:!1})}},xQ=["maxlength","readonly","placeholder"];function SQ(t,e,n,r,i,s){const o=z("resizable-textarea");return S(),re(o,{ref:"resizable"},{default:Y(()=>[Ye(x("textarea",{ref:"inlineeditor","onUpdate:modelValue":e[0]||(e[0]=a=>i.currentValue=a),class:K(["w-full resize-none break-word",[n.fieldClass,i.hasError?n.errorClass:"",i.editModeIsActive?n.editClass:n.hoverClass,{"no-drag":i.editModeIsActive}]]),rows:"1",maxlength:n.maxlength,readonly:i.isLoading,placeholder:n.placeholder,role:"textbox",onClick:e[1]||(e[1]=(...a)=>s.edit&&s.edit(...a)),onBlur:e[2]||(e[2]=a=>n.autoSubmit?s.submit():null),onKeyup:e[3]||(e[3]=a=>i.hasError=!1),onKeydown:[e[4]||(e[4]=Lt(ct((...a)=>s.submit&&s.submit(...a),["stop","prevent"]),["enter"])),e[5]||(e[5]=Lt(ct((...a)=>s.cancel&&s.cancel(...a),["stop","prevent"]),["esc"]))]}," ",42,xQ),[[ls,i.currentValue]])],void 0,!0),_:1},512)}const TQ=Ae(wQ,[["render",SQ]]),_Q={name:"InfiniteLoading",components:{SpmLoader:xn},props:{meta:{type:Object,default:null},isLoading:{type:Boolean,default:!1},tag:{type:String,default:"div"}},data(){return{observer:null,observedElement:null,loadRequested:!1}},watch:{isLoading(t,e){e&&!t&&this.releaseLoadRequest()},"meta.current_page"(t,e){t!==e&&this.releaseLoadRequest()}},mounted(){this.observer=new IntersectionObserver(t=>{const e=t[0];e!=null&&e.isIntersecting&&!this.isLoading&&!this.loadRequested&&(this.loadRequested=!0,this.$emit("onShow",{isVisible:!0,entry:e}))}),this.observeSentinel()},updated(){this.observeSentinel()},beforeUnmount(){var t;(t=this.observer)==null||t.disconnect()},methods:{releaseLoadRequest(){this.loadRequested=!1,this.$nextTick(()=>this.observeSentinel())},observeSentinel(){var e,n,r;const t=((e=this.$refs.sentinel)==null?void 0:e.$el)??this.$refs.sentinel??null;t!==this.observedElement&&((n=this.observer)==null||n.disconnect(),this.observedElement=t,t&&((r=this.observer)==null||r.observe(t)))}}},EQ=["data-current-page","data-per-page"],CQ={key:1,class:"ml-2 mr-1 p-2 text-xs text-gray-650 text-center"};function OQ(t,e,n,r,i,s){const o=z("spm-loader");return!n.isLoading&&n.meta&&n.meta.last_page>1?(S(),C("div",{key:0,"data-current-page":n.meta.current_page,"data-
155per-page":n.meta.per_page},[n.meta.current_page!==n.meta.last_page?(S(),re(kr(n.tag),{key:0,ref:"sentinel"},{default:Y(()=>[X(o,{class:"text-center mt-5"})],void 0,!0),_:1},512)):(S(),C("div",CQ,L(t.$trans.get("All items loaded")),1))],8,EQ)):P("",!0)}const AQ=Ae(_Q,[["render",OQ]]),MQ={name:"TaskList",components:{SpmTaskStatus:Mm,SpmEditableTextarea:TQ,SpmTag:va,vuescroll:_d,SpmTooltip:rr,SpmInfiniteLoading:AQ,SpmDropdown:Gn},data(){return{tasks:[],isLoading:!1,meta:null}},computed:{visibleTasks(){return this.tasks.filter(t=>!t.deleted_at)},isTemplatesView(){return this.$route.name==="tasks-board-templates"},taskTemplatesLocked(){var t,e;return this.isTemplatesView&&!((e=(t=this.$store.getters.customerInfo)==null?void 0:t.conditions)!=null&&e.taskTemplates)},newTask(){return{assignee_id:this.$route.name==="tasks-mine"?this.$store.getters.user.id:null,scrum_board_id:["tasks-board-list","tasks-board-templates"].includes(this.$route.name)?this.$route.params.id:null,is_template:this.isTemplatesView}}},watch:{$route(t,e){!this.isTaskListRoute(t.name)||e.name===t.name&&e.params.id===t.params.id||(this.fetchTasks(t.name,!0,t),this.updateBoardSubscription(e.params.id,t.params.id))}},mounted(){this.fetchTasks(this.$route.name,!0,this.$route),this.subscribeToBoard(this.$route.params.id),window.Echo.private(this.$store.getters.user.workspace+".tasks").listen(".TaskUpdated",t=>{let e=un(this.tasks,function(n){return n.id==t.task.id});e!=-1&&(this.tasks[e]=t.task)}).listen(".TaskDeleted",t=>{let e=un(this.tasks,function(n){return n.id==t.task_id});e!=-1&&this.tasks.splice(e,1)})},methods:{isTaskListRoute(t){return["tasks-global","tasks-mine","tasks-board-backlog","tasks-board-list","tasks-board-templates"].includes(t)},subscribeToBoard(t){t&&window.Echo.private(this.$store.getters.user.workspace+".board."+t).listen(".StatusTasksOrderUpdated",()=>{this.fetchTasks(this.$route.name,!1,this.$route)})},updateBoardSubscription(t,e){t!==e&&(t&&window.Echo.leave("private-"+this.$store.getters.user.workspace+".board."+t),this.subscribeToBoard(e))},success(t){this.tasks.unshift(t.data.data)},createTask(){const t=this.isTemplatesView?this.$trans.get("New Template"):this.$trans.get("New Task");ze.post("/tasks/",{...this.newTask,title:t}).then(e=>{this.tasks.unshift(e.data.data),this.$router.push({path:this.$route.path,query:{modal:"view-task",id:e.data.data.id}})})},showTaskTemplatesUpgradeDialog(){this.$store.commit("showDialogModal",{title:this.$trans.get("Upgrade your plan."),text:this.$trans.get("Task templates are available on the Business plan. Please upgrade to access this feature."),buttons:[{title:this.$trans.get("View Subscription Plans"),class:"btn-primary-500 text-white",handler:()=>{this.$router.push({name:"subscription"}),this.$store.commit("hideDialogModal")}},{title:this.$trans.get("Cancel"),default:!0}]})},openTemplatePicker(){var t,e;if(!((e=(t=this.$store.getters.customerInfo)==null?void 0:t.conditions)!=null&&e.taskTemplates)){this.showTaskTemplatesUpgradeDialog();return}this.$store.commit("showFormModal",{component:"tasks/modals/_template-picker.modal.vue",params:{modalWidth:"max-w-4xl",modalClass:"bg-gray-200",onSelect:n=>this.createTaskFromTemplate(n)}})},resolveBoardStatusId(){return this.$route.params.id?ze.get("/selectable/boards").then(t=>{const e=(t.data.data||[]).find(n=>n.id==this.$route.params.id);return e?e.first_status_id:null}).catch(()=>null):Promise.resolve(null)},createTaskFromTemplate(t){return this.resolveBoardStatusId().then(e=>ze.post(`/tasks/${t.id}/create-from-template`,e?{scrum_board_status_id:e}:{})).then(e=>{this.tasks.unshift(e.data.data),this.$store.commit("hideFormModal"),this.$router.push({path:this.$route.path,query:{modal:"view-task",id:e.data.data.id}})}).catch(()=>
155{this.$notify.error(this.$trans.get("There was an error, please check your connection."))})},taskDonePercentage(t){return 100*t.subtasks_count_done/t.subtasks_count_total},offsetLabel(t){const e=Math.floor(t.due_offset_minutes/1440),n=Math.floor(t.due_offset_minutes%1440/60);return this.$trans.get("Due :days days, :hours hours after creation",{days:e,hours:n})},fetchTasks(t,e,n=this.$route){var s,o;if(t==="tasks-board-templates"&&!((o=(s=this.$store.getters.customerInfo)==null?void 0:s.conditions)!=null&&o.taskTemplates)){this.meta=null,this.tasks=[];return}let r="";e&&(this.meta=null,this.tasks=[]);let i=this.meta!==null?this.meta.current_page<this.meta.last_page?this.meta.current_page+1:!1:1;switch(t){case"tasks-global":r="no-board=1";break;case"tasks-mine":r="assignees[]="+this.$store.getters.user.id;break;case"tasks-board-list":r="boards[]="+n.params.id;break;case"tasks-board-backlog":r="boards[]="+n.params.id,r=r+"¬-done=1";break;case"tasks-board-templates":r="boards[]="+n.params.id,r=r+"&template=1";break}i!=!1&&(this.isLoading=!0,ze.get(`/tasks/list?${r}&page=`+i).then(a=>{this.meta&&this.meta.current_page==a.data.meta.current_page||(this.tasks.push(...a.data.data),this.meta=a.data.meta)}).then(()=>{this.isLoading=!1}))},taskListLoadMoreItems(){this.fetchTasks(this.$route.name)}}},IQ=["data-task-count","data-loading","data-current-page"],LQ={key:0,class:"h-full w-[calc(100vw-2rem)] md:w-full box-style p-6 mx-4 flex flex-col items-center justify-center text-center"},PQ=["innerHTML"],RQ={class:"text-lg font-bold font-display mb-1"},$Q={class:"text-gray-600 max-w-md mb-4"},DQ={key:1,class:"h-full w-[calc(100vw-2rem)] md:w-full box-style p-6 mx-4"},NQ={class:"flex items-center gap-2 mb-2"},FQ={class:"flex"},jQ=["innerHTML"],BQ={class:"relative",style:{height:"calc(100% - 40px)"}},HQ=["onClick"],UQ=["innerHTML"],VQ=["innerHTML"],zQ={class:"hidden md:inline-block"},WQ={key:2,class:"flex mr-3 w-auto items-center text-gray-600"},KQ=["innerHTML"],qQ={class:"hidden md:inline-block"},GQ=["src"];function YQ(t,e,n,r,i,s){var p;const o=z("spm-editable-textarea"),a=z("spm-dropdown"),l=z("spm-task-status"),c=z("spm-tag"),u=z("spm-tooltip"),d=z("spm-infinite-loading"),f=z("vuescroll");return S(),C("div",{"data-task-count":i.tasks.length,"data-loading":i.isLoading?"true":null,"data-current-page":((p=i.meta)==null?void 0:p.current_page)??"",class:"flex pb-6",style:{height:"calc(100% - 52px)"}},[s.taskTemplatesLocked?(S(),C("div",LQ,[x("div",{innerHTML:t.svg("feather-clipboard","stroke-icon h-10 w-10 text-gray-400 mb-3")},null,8,PQ),x("h3",RQ,L(t.$trans.get("Task Templates")),1),x("p",$Q,L(t.$trans.get("Task templates are available on the Business plan. Please upgrade to create and reuse task templates.")),1),x("button",{type:"button",class:"btn btn-primary-500",onClick:e[0]||(e[0]=h=>t.$router.push({name:"subscription"}))},L(t.$trans.get("View Subscription Plans")),1)])):(S(),C("div",DQ,[x("div",NQ,[X(o,{ref:"newtaskinput",url:"/tasks/",placeholder:s.isTemplatesView?t.$trans.get("Add a new template ..."):t.$trans.get("Add a new task ..."),method:"post","auto-submit":!1,"focus-after-submit":!0,name:"title","field-class":"flex w-full p-3 items-center text-sm text-gray-700 rounded-lg bg-gray-150 focus-within:bg-white focus-within:ring-2 ring-primary-500","hover-class":"hover:ring-2 hover:ring-primary-500","additional-data":s.newTask,class:"flex-grow",onSuccess:s.success},null,8,["placeholder","additional-data","onSuccess"]),x("div",FQ,[x("button",{type:"button",class:K(["btn btn-primary-500 shrink-0",{"rounded-r-none":!s.isTemplatesView}]),onClick:e[1]||(e[1]=h=>s.createTask())},L(s.isTemplatesView?t.$trans.get("New Template"):t.$trans.get("New Task")),3),s.isTemplatesView?P("",!0):(S(),re(a,{key:0,"use-popper":!0,small:!0,placement:"bottom-end",distance:"3px",class:"h-auto flex-shrink-0","hide-after-dropdown-click":""},{trigger:Y(({isOpen:h})=>[x("button",{type:"button",class:K(["btn btn-primary-500 h-full py-2 px-1 border-l border-primary-800 rounded-l-none",{"bg-primary-600 hover:bg-primary-600 focus:bg-primary-600":h}]),innerHTML:t.svg("feather-chevron-down","stroke-icon h-4")},null,10,jQ)]),dropdown:Y(()=>[x("button",{class:"flex spm-dropdown-linkitem item items-center w-full",onClick:e[2]||(e[2]=h=>s.openTemplatePicker())},L(t.$trans.get("From Template")),1)]),_:1}))])]),x("div",BQ,[X(f,{ref:"scrollbarTaskList"},{default:Y(()=>[X($i,{tag:"div",class:"flex flex-wrap w-full pb-12"},{default:Y(()=>[(S(!0),C(Fe,null,nt(s.visibleTasks,h=>(S(),C("div",{key:h.id,class:"flex w-full py-2 px-1 items-center text-sm border-b"},[X(l,{compact:t.$isMobile,task:h},null,8,["compact","task"]),x("div",{class:K(["flex-grow overflow-hidden break-all text-gray-700 leading-snug cursor-pointer",{"line-through opacity-75":!!h.done_at}]),onClick:g=>t.$router.push({path:t.$route.path,query:{modal:"view-task",id:h.id}})},L(h.title),11,HQ),(S(!0),C(Fe,null,nt(h.tags,g=>(S(),re(c,{key:g.id,class:"flex-shrink hidden md:flex",light:!0,tag:g},null,8,["tag"]))),128)),h.priority!="medium"?(S(),C("span",{key:0,class:"flex items-center rounded-lg mr-1",innerHTML:t.svg("feather-priority-"+h.priority.replace(" ","-"),"stroke-icon h-3 mx-auto")},null,8,UQ)):P("",!0),!h.is_template&&h.due_at?(S(),re(u,{key:1,tooltip:`${t.$filters.datetime(h.due_at)} - ${t.$filters.distanceInWordsToNow(h.due_at)}`,placement:"top",tag:"div",class:"flex mr-3 w-auto items-center text-gray-600"},{default:Y(()=>
155[h.due_at?(S(),C("div",{key:0,class:"self-center mr-1",innerHTML:t.svg("feather-calendar","stroke-icon h-4")},null,8,VQ)):P("",!0),x("span",zQ,L(t.$filters.distanceInWordsToNow(h.due_at)),1)],void 0,!0),_:2},1032,["tooltip"])):h.is_template&&h.due_offset_minutes?(S(),C("div",WQ,[x("div",{class:"self-center mr-1",innerHTML:t.svg("feather-calendar","stroke-icon h-4")},null,8,KQ),x("span",qQ,L(s.offsetLabel(h)),1)])):P("",!0),h.assignee?(S(),C("img",{key:3,src:h.assignee.avatar,class:"flex-none avatar rounded-lg mr-2 h-5 w-5"},null,8,GQ)):P("",!0)]))),128))],void 0,!0),_:1}),X(d,{"is-loading":i.isLoading,meta:i.meta,onOnShow:s.taskListLoadMoreItems},null,8,["is-loading","meta","onOnShow"]),e[3]||(e[3]=x("div",{class:"h-20"},null,-1))],void 0,!0),_:1},512)])]))],8,IQ)}const La=Ae(MQ,[["render",YQ]]),XQ=()=>ne(()=>import("./index-QV8ZLWMS.js"),__vite__mapDeps([72,1,2,4,5,6,7])),JQ=()=>ne(()=>import("./index-DC_IV-R7.js"),__vite__mapDeps([73,1,2])),QQ=()=>ne(()=>import("./index-DBHVLxuP.js"),__vite__mapDeps([74,1,2,5,4,11,13,6,7,75])),ZQ=()=>ne(()=>import("./index-DkFmMdMo.js"),__vite__mapDeps([76,6,1,2,4,7,32,5])),eZ={name:"tasks",path:"/tasks",meta:{basePath:"/tasks/",breadcrumb:"Tasks"},redirect:{name:"tasks-mine"},component:XQ,children:[{name:"tasks-global",path:"global",meta:{basePath:"global",breadcrumb:"Global"},component:La},{name:"tasks-mine",path:"mine",meta:{basePath:"mine",breadcrumb:"My Tasks"},component:La},{path:"boards/:id",meta:{basePath:"boards/:id",breadcrumb:"Board"},component:JQ,children:[{name:"tasks-board",path:"",redirect:{name:"tasks-board-kanban"}},{name:"tasks-board-backlog",path:"backlog",meta:{basePath:"backlog/",breadcrumb:"Backlog"},component:La},{name:"tasks-board-list",path:"list",meta:{basePath:"list/",breadcrumb:"List"},component:La},{name:"tasks-board-kanban",path:"kanban",meta:{basePath:"kanban/",breadcrumb:"Kanban"},component:QQ},{name:"tasks-board-templates",path:"templates",meta:{basePath:"templates/",breadcrumb:"Templates"},component:La},{name:"tasks-board-settings",path:"settings",meta:{basePath:"settings/",breadcrumb:"Settings"},component:ZQ}]}]},tZ={path:"/:pathMatch(.*)*",redirect:{name:"tickets-section",params:{section:"unassigned",id:0}}},nZ=[tZ,QM,nY,CY,wY,NY,eZ,bQ];function rZ(){return tw({history:Qk(),routes:nZ})}function iZ(){return tw({history:Qk(),routes:[{name:"welcome",path:"/",component:()=>ne(()=>import("./_welcome-CLNFJfeh.js"),__vite__mapDeps([77,4,1,2])),meta:{order:1}},{name:"additional",path:"/additional",component:()=>ne(()=>import("./_additional-data-IspcQEEQ.js"),__vite__mapDeps([78,6,1,2,4,7])),meta:{order:2}},{name:"email",path:"/ticket",component:()=>ne(()=>import("./_email-CNdKYZBm.js"),__vite__mapDeps([25,4,6,1,2,7])),meta:{order:3,canSkip:!0}},{name:"verify",path:"/verify",component:()=>ne(()=>import("./_verify-4Z3OwTCs.js"),__vite__mapDeps([27,4,1,2,5,6,7])),meta:{order:4}},{name:"smtp",path:"/smtp",component:()=>ne(()=>import("./_smtp-BeCy_Xyq.js"),__vite__mapDeps([28,4,1,2,6,7])),meta:{order:5}},{name:"forward",path:"/forward",component:()=>ne(()=>import("./_forward-BUIaG3k4.js"),__vite__mapDeps([29,4,5,1,2,30])),meta:{order:6}},{name:"final",path:"/final",component:()=>ne(()=>import("./_final-DC_8Hsg6.js"),__vite__mapDeps([79,1,2])),meta:{order:7}},{path:"/:pathMatch(.*)*",redirect:"/"}]})}var _p={exports:{}};(function(t,e){(function(n,r){r(e)})(pr,function(n){var r=typeof window<"u"&&window.flatpickr!==void 0?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["So","Mo","Di","Mi","Do","Fr","Sa"],longhand:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},months:{shorthand:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],longhand:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},firstDayOfWeek:1,weekAbbreviation:"KW",rangeSeparator:" bis ",scrollTitle:"Zum Ãndern scrollen",toggleTitle:"Zum Umschalten klicken",time_24hr:!0};r.l10ns.de=i;var s=r.l10ns;n.German=i,n.default=s,Object.defineProperty(n,"__esModule",{value:!0})})})(_p,_p.exports);
155var sZ=_p.exports,Ep={exports:{}};(function(t,e){(function(n,r){r(e)})(pr,function(n){var r=typeof window<"u"&&window.flatpickr!==void 0?window.flatpickr:{l10ns:{}},i={firstDayOfWeek:1,weekdays:{shorthand:["dim","lun","mar","mer","jeu","ven","sam"],longhand:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},months:{shorthand:["janv","févr","mars","avr","mai","juin","juil","août","sept","oct","nov","déc"],longhand:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},ordinal:function(o){return o>1?"":"er"},rangeSeparator:" au ",weekAbbreviation:"Sem",scrollTitle:"Défiler pour augmenter la valeur",toggleTitle:"Cliquer pour basculer",time_24hr:!0};r.l10ns.fr=i;var s=r.l10ns;n.French=i,n.default=s,Object.defineProperty(n,"__esModule",{value:!0})})})(Ep,Ep.exports);var oZ=Ep.exports,Cp={exports:{}};(function(t,e){(function(n,r){r(e)})(pr,function(n){var r=typeof window<"u"&&window.flatpickr!==void 0?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],longhand:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"]},months:{shorthand:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],longhand:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"]},ordinal:function(){return"º"},firstDayOfWeek:1,rangeSeparator:" a ",time_24hr:!0};r.l10ns.es=i;var s=r.l10ns;n.Spanish=i,n.default=s,Object.defineProperty(n,"__esModule",{value:!0})})})(Cp,Cp.exports);var aZ=Cp.exports,Op={exports:{}};(function(t,e){(function(n,r){r(e)})(pr,function(n){var r=typeof window<"u"&&window.flatpickr!==void 0?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["zo","ma","di","wo","do","vr","za"],longhand:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},months:{shorthand:["jan","feb","mrt","apr","mei","jun","jul","aug","sept","okt","nov","dec"],longhand:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},firstDayOfWeek:1,weekAbbreviation:"wk",rangeSeparator:" t/m ",scrollTitle:"Scroll voor volgende / vorige",toggleTitle:"Klik om te wisselen",time_24hr:!0,ordinal:function(o){return o===1||o===8||o>=20?"ste":"de"}};r.l10ns.nl=i;var s=r.l10ns;n.Dutch=i,n.default=s,Object.defineProperty(n,"__esModule",{value:!0})})})(Op,Op.exports);var lZ=Op.exports,Ap={exports:{}};(function(t,e){(function(n,r){r(e)})(pr,function(n){var r=typeof window<"u"&&window.flatpickr!==void 0?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],longhand:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"]},months:{shorthand:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],longhand:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"]},rangeSeparator:" até ",time_24hr:!0};r.l10ns.pt=i;var s=r.l10ns;n.Portuguese=i,n.default=s,Object.defineProperty(n,"__esModule",{value:!0})})})(Ap,Ap.exports);var cZ=Ap.exports,Mp={exports:{}};(function(t,e){(function(n,r){r(e)})(pr,function(n){var r=typeof window<"u"&&window.flatpickr!==void 0?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["Nd","Pn","Wt","År","Cz","Pt","So"],longhand:["Niedziela","PoniedziaÅek","Wtorek","Åroda","Czwartek","PiÄ
tek","Sobota"]},months:{shorthand:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],longhand:["StyczeÅ","Luty","Marzec","KwiecieÅ","Maj","Czerwiec","Lipiec","SierpieÅ","WrzesieÅ","Październik","Listopad","GrudzieÅ"]},rangeSeparator:" do ",weekAbbreviation:"tydz.",scrollTitle:"PrzewiÅ, aby zwiÄkszyÄ",toggleTitle:"Kliknij, aby przeÅÄ
czyÄ",firstDayOfWeek:1,time_24hr:!0,ordinal:function(){return"."}};r.l10ns.pl=i;var s=r.l10ns;n.Polish=i,n.default=s,Object.defineProperty(n,"__esModule",{value:!0})})})(Mp,Mp.exports);var uZ=Mp.exports,Ip={exports:{}};(function(t,e){(function(n,r){r(e)})(pr,function(n){var r=typeof window<"u"&&window.flatpickr!==void 0?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],longhand:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"]},months:{shorthand:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],longhand:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},firstDayOfWeek:1,ordinal:function(){return"°"},rangeSeparator:" al ",weekAbbreviation:"Se",scrollTitle:"Scrolla per aumentare",toggleTitle:"Clicca per cambiare",time_24hr:!0};r.l10ns.it=i;var s=r.l10ns;n.Italian=i,n.default=s,Object.defineProperty(n,"__esModule",{value:!0})})}
155)(Ip,Ip.exports);var dZ=Ip.exports,Lp={exports:{}};(function(t,e){(function(n,r){r(e)})(pr,function(n){var r=typeof window<"u"&&window.flatpickr!==void 0?window.flatpickr:{l10ns:{}},i={weekdays:{shorthand:["卿¥","å¨ä¸","å¨äº","å¨ä¸","å¨å","å¨äº","å¨å "],longhand:["æææ¥","ææä¸","ææäº","ææä¸","ææå","ææäº","ææå "]},months:{shorthand:["䏿","äºæ","䏿","åæ","äºæ","å æ","䏿","å «æ","乿","åæ","å䏿","åäºæ"],longhand:["䏿","äºæ","䏿","åæ","äºæ","å æ","䏿","å «æ","乿","åæ","å䏿","åäºæ"]},rangeSeparator:" è³ ",weekAbbreviation:"å¨",scrollTitle:"æ»å¨åæ¢",toggleTitle:"ç¹å»åæ¢ 12/24 å°æ¶æ¶å¶"};r.l10ns.zh=i;var s=r.l10ns;n.Mandarin=i,n.default=s,Object.defineProperty(n,"__esModule",{value:!0})})})(Lp,Lp.exports);var fZ=Lp.exports;const hZ=document.documentElement.lang??"en",pZ={de:sZ.German,fr:oZ.French,es:aZ.Spanish,nl:lZ.Dutch,pt:cZ.Portuguese,pl:uZ.Polish,it:dZ.Italian,zh:fZ.Mandarin},d0=pZ[hZ]??null;function mZ(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map(function(i){i(n)}),(r=t.get("*"))&&r.slice().map(function(i){i(e,n)})}}}/*! 156 * shared v11.4.10 157 * (c) 2026 kazuya kawaguchi 158 * Released under the MIT License. 159 */const cd=typeof window<"u",ys=(t,e=!1)=>e?Symbol.for(t):Symbol(t),gZ=(t,e,n)=>aT({l:t,k:e,s:n}),aT=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),sn=t=>typeof t=="number"&&isFinite(t),lT=t=>Lg(t)==="[object Date]",ca=t=>Lg(t)==="[object RegExp]",Ig=t=>It(t)&&Object.keys(t).length===0,on=Object.assign,vZ=Object.create,Pt=(t=null)=>vZ(t);let f0;const Qi=()=>f0||(f0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Pt()),yZ=Object.prototype.hasOwnProperty;function hr(t,e){return yZ.call(t,e)}const Ft=Array.isArray,zt=t=>typeof t=="function",$e=t=>typeof t=="string",Et=t=>typeof t=="boolean",Ct=t=>t!==null&&typeof t=="object",bZ=t=>Ct(t)&&zt(t.then)&&zt(t.catch),cT=Object.prototype.toString,Lg=t=>cT.call(t),It=t=>Lg(t)==="[object Object]",kZ=t=>t==null?"":Ft(t)||It(t)&&t.toString===cT?JSON.stringify(t,null,2):String(t);function Pg(t,e=""){return t.reduce((n,r,i)=>i===0?n+r:n+e+r,"")}function wZ(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}function h0(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function xZ(t){return t.replace(/&(?![a-z0-9#]{2,6};)/gi,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const SZ=/^javascript:/i,TZ=/^(?:href|src|action|formaction)$/i,_Z=/&#(?:x([0-9a-f]+)|(\d+));?/gi,EZ=/&(?:Tab|NewLine);/g,CZ=/:?/gi,OZ=/[\u0000-\u0020\u007f-\u009f]/g,AZ=/(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i,MZ=/(^|[\s"'<>/])on(\w+\s*=)/gi,IZ=/(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;function LZ(t,e,n){const r=e||n;if(!r)return t;const i=Number.parseInt(r,e?16:10);return i<=127?String.fromCharCode(i):t}function Rg(t){const e=t.replace(_Z,LZ).replace(EZ,"").replace(CZ,":").replace(OZ,"");return SZ.test(e)}function PZ(t){const e=/url\s*\(/gi;let n="",r=0,i;for(;(i=e.exec(t))!==null;){const s=i.index,o=e.lastIndex-1;let a=o+1,l=1,c=null;for(;a<t.length;a++){const f=t[a];if(c){f===c&&(c=null);continue}if(f==='"'||f==="'")c=f;else if(f==="(")l++;else if(f===")"&&(l--,l===0))break}if(l!==0)break;const u=t.slice(o+1,a).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=t.slice(r,s),n+=Rg(d)?"url(about:blank)":t.slice(s,a+1),r=a+1}return n+t.slice(r)}function p0(t,e){if(TZ.test(t)&&Rg(e))return"about:blank";const n=t.toLowerCase()==="style"?PZ(e):e;return xZ(n)}function RZ(t){return t=t.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(e,n,r)=>`${n}="${p0(n,r)}"`),t=t.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(e,n,r)=>`${n}='${p0(n,r)}'`),AZ.test(t)&&(t=t.replace(MZ,"$1on$2")),t=t.replace(IZ,(e,n,r,i)=>Rg(i)?`${n}${r}about:blank`:e),t}const m0=t=>!Ct(t)||Ft(t);function iu(t,e){if(m0(t)||m0(e))throw new Error("Invalid value");
159const n=[{src:t,des:e}];for(;n.length;){const{src:r,des:i}=n.pop();Object.keys(r).forEach(s=>{if(s==="__proto__")return;const o=r[s];if(Ft(o)){const a=[];a.length=o.length,i[s]=a,n.push({src:o,des:a})}else Ct(o)?((!Ct(i[s])||Ft(i[s]))&&(i[s]=Pt()),n.push({src:o,des:i[s]})):i[s]=o})}}/*! 160 * message-compiler v11.4.10 161 * (c) 2026 kazuya kawaguchi 162 * Released under the MIT License. 163 */function $Z(t,e,n){return{line:t,column:e,offset:n}}function Pp(t,e,n){return{start:t,end:e}}const Mt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},DZ=17;function qd(t,e,n={}){const{domain:r,messages:i,args:s}=n,o=t,a=new SyntaxError(String(o));return a.code=t,e&&(a.location=e),a.domain=r,a}function NZ(t){throw t}const Hr=" ",FZ="\r",En=` 164`,jZ="\u2028",BZ="\u2029";function HZ(t){const e=t;let n=0,r=1,i=1,s=0;const o=I=>e[I]===FZ&&e[I+1]===En,a=I=>e[I]===En,l=I=>e[I]===BZ,c=I=>e[I]===jZ,u=I=>o(I)||a(I)||l(I)||c(I),d=()=>n,f=()=>r,p=()=>i,h=()=>s,g=I=>o(I)||l(I)||c(I)?En:e[I],m=()=>g(n),b=()=>g(n+s);function T(){return s=0,u(n)&&(r++,i=0),o(n)&&n++,n++,i++,e[n]}function E(){return o(n+s)&&s++,s++,e[n+s]}function w(){n=0,r=1,i=1,s=0}function M(I=0){s=I}function A(){const I=n+s;for(;I!==n;)T();s=0}return{index:d,line:f,column:p,peekOffset:h,charAt:g,currentChar:m,currentPeek:b,next:T,peek:E,reset:w,resetPeek:M,skipToPeek:A}}const mi=void 0,UZ=".",g0="'",VZ="tokenizer";function zZ(t,e={}){const n=e.location!==!1,r=HZ(t),i=()=>r.index(),s=()=>$Z(r.line(),r.column(),r.index()),o=s(),a=i(),l={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function d(R,F,ie,...fe){const Ve=c();if(F.column+=ie,F.offset+=ie,u){const B=n?Pp(Ve.startLoc,F):null,D=qd(R,B,{domain:VZ,args:fe});u(D)}}function f(R,F,ie){R.endLoc=s(),R.currentType=F;const fe={type:F};return n&&(fe.loc=Pp(R.startLoc,R.endLoc)),ie!=null&&(fe.value=ie),fe}const p=R=>f(R,13);function h(R,F){return R.currentChar()===F?(R.next(),F):(d(Mt.EXPECTED_TOKEN,s(),0,F),"")}function g(R){let F="";for(;R.currentPeek()===Hr||R.currentPeek()===En;)F+=R.currentPeek(),R.peek();return F}function m(R){const F=g(R);return R.skipToPeek(),F}function b(R){if(R===mi)return!1;const F=R.charCodeAt(0);return F>=97&&F<=122||F>=65&&F<=90||F===95}function T(R){if(R===mi)return!1;const F=R.charCodeAt(0);return F>=48&&F<=57}function E(R,F){const{currentType:ie}=F;if(ie!==2)return!1;g(R);const fe=b(R.currentPeek());return R.resetPeek(),fe}function w(R,F){const{currentType:ie}=F;if(ie!==2)return!1;g(R);const fe=R.currentPeek()==="-"?R.peek():R.currentPeek(),Ve=T(fe);return R.resetPeek(),Ve}function M(R,F){const{currentType:ie}=F;if(ie!==2)return!1;g(R);const fe=R.currentPeek()===g0;return R.resetPeek(),fe}function A(R,F){const{currentType:ie}=F;if(ie!==7)return!1;g(R);const fe=R.currentPeek()===".";return R.resetPeek(),fe}function I(R,F){const{currentType:ie}=F;if(ie!==8)return!1;g(R);const fe=b(R.currentPeek());return R.resetPeek(),fe}function j(R,F){const{currentType:ie}=F;if(!(ie===7||ie===11))return!1;g(R);const fe=R.currentPeek()===":";return R.resetPeek(),fe}function $(R,F){const{currentType:ie}=F;if(ie!==9)return!1;const fe=()=>{const B=R.currentPeek();return B==="{"?b(R.peek()):B==="@"||B==="|"||B===":"||B==="."||B===Hr||!B?!1:B===En?(R.peek(),fe()):se(R,!1)},Ve=fe();return R.resetPeek(),Ve}function J(R){g(R);const F=R.currentPeek()==="|";return R.resetPeek(),F}function se(R,F=!0){const ie=(Ve=!1,B="")=>{const D=R.currentPeek();return D==="{"||D==="@"||!D?Ve:D==="|"?!(B===Hr||B===En):D===Hr?(R.peek(),ie(!0,Hr)):D===En?(R.peek(),ie(!0,En)):!0},fe=ie();return F&&R.resetPeek(),fe}function Q(R,F){const ie=R.currentChar();return ie===mi?mi:F(ie)?(R.next(),ie):null}
164function G(R){const F=R.charCodeAt(0);return F>=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===95||F===36}function ee(R){return Q(R,G)}function ge(R){const F=R.charCodeAt(0);return F>=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===95||F===36||F===45}function ae(R){return Q(R,ge)}function ke(R){const F=R.charCodeAt(0);return F>=48&&F<=57}function Le(R){return Q(R,ke)}function Ue(R){const F=R.charCodeAt(0);return F>=48&&F<=57||F>=65&&F<=70||F>=97&&F<=102}function Ze(R){return Q(R,Ue)}function Je(R){let F="",ie="";for(;F=Le(R);)ie+=F;return ie}function Xe(R){let F="";for(;;){const ie=R.currentChar();if(ie==="\\"){const fe=R.peek();fe==="{"||fe==="}"||fe==="@"||fe==="|"||fe==="\\"?(F+=ie+fe,R.next(),R.next()):(R.resetPeek(),F+=ie,R.next())}else{if(ie==="{"||ie==="}"||ie==="@"||ie==="|"||!ie)break;if(ie===Hr||ie===En)if(se(R))F+=ie,R.next();else{if(J(R))break;F+=ie,R.next()}else F+=ie,R.next()}}return F}function We(R){m(R);let F="",ie="";for(;F=ae(R);)ie+=F;const fe=R.currentChar();if(fe&&fe!=="}"&&fe!==mi&&fe!==Hr&&fe!==En&&fe!=="ã"){const Ve=be(R);return d(Mt.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,ie+Ve),ie+Ve}return R.currentChar()===mi&&d(Mt.UNTERMINATED_CLOSING_BRACE,s(),0),ie}function rt(R){m(R);let F="";return R.currentChar()==="-"?(R.next(),F+=`-${Je(R)}`):F+=Je(R),R.currentChar()===mi&&d(Mt.UNTERMINATED_CLOSING_BRACE,s(),0),F}function je(R){return R!==g0&&R!==En}function Te(R){m(R),h(R,"'");let F="",ie="";for(;F=Q(R,je);)F==="\\"?ie+=q(R):ie+=F;const fe=R.currentChar();return fe===En||fe===mi?(d(Mt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),fe===En&&(R.next(),h(R,"'")),ie):(h(R,"'"),ie)}function q(R){const F=R.currentChar();switch(F){case"\\":case"'":return R.next(),`\\${F}`;case"u":return pe(R,F,4);case"U":return pe(R,F,6);default:return d(Mt.UNKNOWN_ESCAPE_SEQUENCE,s(),0,F),""}}function pe(R,F,ie){h(R,F);let fe="";for(let Ve=0;Ve<ie;Ve++){const B=Ze(R);if(!B){d(Mt.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),0,`\\${F}${fe}${R.currentChar()}`);break}fe+=B}return`\\${F}${fe}`}function ce(R){return R!=="{"&&R!=="}"&&R!==Hr&&R!==En}function be(R){m(R);let F="",ie="";for(;F=Q(R,ce);)ie+=F;return ie}function He(R){let F="",ie="";for(;F=ee(R);)ie+=F;return ie}function at(R){const F=ie=>{const fe=R.currentChar();return fe==="{"||fe==="@"||fe==="|"||fe==="("||fe===")"||!fe||fe===Hr?ie:(ie+=fe,R.next(),F(ie))};return F("")}function Ce(R){m(R);const F=h(R,"|");return m(R),F}function Oe(R,F){let ie=null;switch(R.currentChar()){case"{":return F.braceNest>=1&&d(Mt.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),R.next(),ie=f(F,2,"{"),m(R),F.braceNest++,ie;case"}":return F.braceNest>0&&F.currentType===2&&d(Mt.EMPTY_PLACEHOLDER,s(),0),R.next(),ie=f(F,3,"}"),F.braceNest--,F.braceNest>0&&m(R),F.inLinked&&F.braceNest===0&&(F.inLinked=!1),ie;case"@":return F.braceNest>0&&d(Mt.UNTERMINATED_CLOSING_BRACE,s(),0),ie=lt(R,F)||p(F),F.braceNest=0,ie;default:{let Ve=!0,B=!0,D=!0;if(J(R))return F.braceNest>0&&d(Mt.UNTERMINATED_CLOSING_BRACE,s(),0),ie=f(F,1,Ce(R)),F.braceNest=0,F.inLinked=!1,ie;if(F.braceNest>0&&(F.currentType===4||F.currentType===5||F.currentType===6))return d(Mt.UNTERMINATED_CLOSING_BRACE,s(),0),F.braceNest=0,yt(R,F);if(Ve=E(R,F))return ie=f(F,4,We(R)),m(R),ie;if(B=w(R,F))return ie=f(F,5,rt(R)),m(R),ie;if(D=M(R,F))return ie=f(F,6,Te(R)),m(R),ie;if(!Ve&&!B&&!D)return ie=f(F,12,be(R)),d(Mt.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,ie.value),m(R),ie;break}}return ie}function lt(R,F){const{currentType:ie}=F;let fe=null;const Ve=R.currentChar();switch((ie===7||ie===8||ie===11||ie===9)&&(Ve===En||Ve===Hr)&&d(Mt.INVALID_LINKED_FORMAT,s(),0),Ve){case"@":return R.next(),fe=f(F,7,"@"),F.inLinked=!0,fe;case".":return m(R),R.next(),f(F,8,".");case":":return m(R),R.next(),f(F,9,":");default:return J(R)?(fe=f(F,1,Ce(R)),F.braceNest=0,F.inLinked=!1,fe):A(R,F)||j(R,F)?(m(R),lt(R,F)):I(R,F)?(m(R),f(F,11,He(R))):$(R,F)?(m(R),Ve==="{"?Oe(R,F)||fe:f(F,10,at(R))):(ie===7&&d(Mt.INVALID_LINKED_FORMAT,s(),0),F.braceNest=0,F.inLinked=!1,yt(R,F))}}function yt(R,F){let ie={type:13};if(F.braceNest>0)return Oe(R,F)||p(F);if(F.inLinked)return lt(R,F)||p(F);switch(R.currentChar()){case"{":return Oe(R,F)||p(F);case"}":return d(Mt.UNBALANCED_CLOSING_BRACE,s(),0),R.next(),f(F,3,"}");case"@":return lt(R,F)||p(F);
164default:{if(J(R))return ie=f(F,1,Ce(R)),F.braceNest=0,F.inLinked=!1,ie;if(se(R))return f(F,0,Xe(R));break}}return ie}function ht(){const{currentType:R,offset:F,startLoc:ie,endLoc:fe}=l;return l.lastType=R,l.lastOffset=F,l.lastStartLoc=ie,l.lastEndLoc=fe,l.offset=i(),l.startLoc=s(),r.currentChar()===mi?f(l,13):yt(r,l)}return{nextToken:ht,currentOffset:i,currentPosition:s,context:c}}const WZ="parser",KZ=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,qZ=/\\([\\@{}|])/g;function GZ(t,e){return e}function YZ(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function XZ(t={}){const e=t.location!==!1,{onError:n}=t;function r(b,T,E,w,...M){const A=b.currentPosition();if(A.offset+=w,A.column+=w,n){const I=e?Pp(E,A):null,j=qd(T,I,{domain:WZ,args:M});n(j)}}function i(b,T,E){const w={type:b};return e&&(w.start=T,w.end=T,w.loc={start:E,end:E}),w}function s(b,T,E,w){e&&(b.end=T,b.loc&&(b.loc.end=E))}function o(b,T){const E=b.context(),w=i(3,E.offset,E.startLoc);return w.value=T.replace(qZ,GZ),s(w,b.currentOffset(),b.currentPosition()),w}function a(b,T){const E=b.context(),{lastOffset:w,lastStartLoc:M}=E,A=i(5,w,M);return A.index=parseInt(T,10),b.nextToken(),s(A,b.currentOffset(),b.currentPosition()),A}function l(b,T){const E=b.context(),{lastOffset:w,lastStartLoc:M}=E,A=i(4,w,M);return A.key=T,b.nextToken(),s(A,b.currentOffset(),b.currentPosition()),A}function c(b,T){const E=b.context(),{lastOffset:w,lastStartLoc:M}=E,A=i(9,w,M);return A.value=T.replace(KZ,YZ),b.nextToken(),s(A,b.currentOffset(),b.currentPosition()),A}function u(b){const T=b.nextToken(),E=b.context(),{lastOffset:w,lastStartLoc:M}=E,A=i(8,w,M);return T.type!==11?(r(b,Mt.UNEXPECTED_EMPTY_LINKED_MODIFIER,E.lastStartLoc,0),A.value="",s(A,w,M),{nextConsumeToken:T,node:A}):(T.value==null&&r(b,Mt.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,Ur(T)),A.value=T.value||"",s(A,b.currentOffset(),b.currentPosition()),{node:A})}function d(b,T){const E=b.context(),w=i(7,E.offset,E.startLoc);return w.value=T,s(w,b.currentOffset(),b.currentPosition()),w}function f(b){const T=b.context(),E=i(6,T.offset,T.startLoc);let w=b.nextToken();if(w.type===8){const M=u(b);E.modifier=M.node,w=M.nextConsumeToken||b.nextToken()}switch(w.type!==9&&r(b,Mt.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,Ur(w)),w=b.nextToken(),w.type===2&&(w=b.nextToken()),w.type){case 10:w.value==null&&r(b,Mt.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,Ur(w)),E.key=d(b,w.value||"");break;case 4:w.value==null&&r(b,Mt.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,Ur(w)),E.key=l(b,w.value||"");break;case 5:w.value==null&&r(b,Mt.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,Ur(w)),E.key=a(b,w.value||"");break;case 6:w.value==null&&r(b,Mt.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,Ur(w)),E.key=c(b,w.value||"");break;default:{r(b,Mt.UNEXPECTED_EMPTY_LINKED_KEY,T.lastStartLoc,0);const M=b.context(),A=i(7,M.offset,M.startLoc);return A.value="",s(A,M.offset,M.startLoc),E.key=A,s(E,M.offset,M.startLoc),{nextConsumeToken:w,node:E}}}return s(E,b.currentOffset(),b.currentPosition()),{node:E}}function p(b){const T=b.context(),E=T.currentType===1?b.currentOffset():T.offset,w=T.currentType===1?T.endLoc:T.startLoc,M=i(2,E,w);M.items=[];let A=null;do{const $=A||b.nextToken();switch(A=null,$.type){case 0:$.value==null&&r(b,Mt.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,Ur($)),M.items.push(o(b,$.value||""));break;case 5:$.value==null&&r(b,Mt.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,Ur($)),M.items.push(a(b,$.value||""));break;case 4:$.value==null&&r(b,Mt.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,Ur($)),M.items.push(l(b,$.value||""));break;case 6:$.value==null&&r(b,Mt.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,Ur($)),M.items.push(c(b,$.value||""));break;case 7:{const J=f(b);M.items.push(J.node),A=J.nextConsumeToken||null;break}}}while(T.currentType!==13&&T.currentType!==1);const I=T.currentType===1?T.lastOffset:b.currentOffset(),j=T.currentType===1?T.lastEndLoc:b.currentPosition();return s(M,I,j),M}function h(b,T,E,w){const M=b.context();let A=w.items.length===0;const I=i(1,T,E);I.cases=[],I.cases.push(w);do{const j=p(b);A||(A=j.items.length===0),I.cases.push(j)}while(M.currentType!==13);return A&&r(b,Mt.MUST_HAVE_MESSAGES_IN_PLURAL,E,0),s(I,b.currentOffset(),b.currentPosition()),I}function g(b){const T=b.context(),{offset:E,startLoc:w}=T,M=p(b);return T.currentType===13?M:h(b,E,w,M)}function m(b){const T=zZ(b,on({},t)),E=T.context(),w=i(0,E.offset,E.startLoc);return e&&w.loc&&(w.loc.source=b),w.body=g(T),t.onCacheKey&&(w.cacheKey=t.onCacheKey(b)),E.currentType!==13&&r(T,Mt.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,b[E.offset]||""),s(w,T.currentOffset(),T.currentPosition()),w}return{parse:m}}function Ur(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>
16410?e.slice(0,9)+"â¦":e}function JZ(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function v0(t,e){for(let n=0;n<t.length;n++)$g(t[n],e)}function $g(t,e){switch(t.type){case 1:v0(t.cases,e),e.helper("plural");break;case 2:v0(t.items,e);break;case 6:{$g(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function QZ(t,e={}){const n=JZ(t);n.helper("normalize"),t.body&&$g(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function ZZ(t){const e=t.body;return e.type===2?y0(e):e.cases.forEach(n=>y0(n)),t}function y0(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=Pg(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}function Io(t){switch(t.t=t.type,t.type){case 0:{const e=t;Io(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)Io(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)Io(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;Io(e.key),e.k=e.key,delete e.key,e.modifier&&(Io(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}}delete t.type}function eee(t,e){const{filename:n,breakLineCode:r,needIndent:i}=e,s=e.location!==!1,o={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:i,indentLevel:0};s&&t.loc&&(o.source=t.loc.source);const a=()=>o;function l(g,m){o.code+=g}function c(g,m=!0){const b=m?r:"";l(i?b+" ".repeat(g):b)}function u(g=!0){const m=++o.indentLevel;g&&c(m)}function d(g=!0){const m=--o.indentLevel;g&&c(m)}function f(){c(o.indentLevel)}return{context:a,push:l,indent:u,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>o.needIndent}}function tee(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),ua(t,e.key),e.modifier?(t.push(", "),ua(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function nee(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const i=e.items.length;for(let s=0;s<i&&(ua(t,e.items[s]),s!==i-1);s++)t.push(", ");t.deindent(r()),t.push("])")}function ree(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const i=e.cases.length;for(let s=0;s<i&&(ua(t,e.cases[s]),s!==i-1);s++)t.push(", ");t.deindent(r()),t.push("])")}}function iee(t,e){e.body?ua(t,e.body):t.push("null")}function ua(t,e){const{helper:n}=t;switch(e.type){case 0:iee(t,e);break;case 1:ree(t,e);break;case 2:nee(t,e);break;case 6:tee(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break}}const see=(t,e={})=>{const n=$e(e.mode)?e.mode:"normal",r=$e(e.filename)?e.filename:"message.intl";e.sourceMap;const i=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":` 165`,s=e.needIndent?e.needIndent:n!=="arrow",o=t.helpers||[],a=eee(t,{filename:r,breakLineCode:i,needIndent:s});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(s),o.length>0&&(a.push(`const { ${Pg(o.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),ua(a,t),a.deindent(s),a.push("}"),delete t.helpers;const{code:l,map:c}=a.context();return{ast:t,code:l,map:c?c.toJSON():void 0}};function oee(t,e={}){const n=on({},e),r=!!n.jit,i=!!n.minify,s=n.optimize==null?!0:n.optimize,a=XZ(n).parse(t);return r?(s&&ZZ(a),i&&Io(a),{ast:a,code:""}
165):(QZ(a,n),see(a,n))}/*! 166 * core-base v11.4.10 167 * (c) 2026 kazuya kawaguchi 168 * Released under the MIT License. 169 */function aee(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Qi().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Qi().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function ri(t){return Ct(t)&&Dg(t)===0&&(hr(t,"b")||hr(t,"body"))}const uT=["b","body"];function lee(t){return bs(t,uT)}const dT=["c","cases"];function cee(t){return bs(t,dT,[])}const fT=["s","static"];function uee(t){return bs(t,fT)}const hT=["i","items"];function dee(t){return bs(t,hT,[])}const pT=["t","type"];function Dg(t){return bs(t,pT)}const mT=["v","value"];function jc(t,e){const n=bs(t,mT);if(n!=null)return n;throw Nl(e)}const gT=["m","modifier"];function fee(t){return bs(t,gT)}const vT=["k","key"];function hee(t){const e=bs(t,vT);if(e)return e;throw Nl(6)}function bs(t,e,n){for(let r=0;r<e.length;r++){const i=e[r];if(hr(t,i)&&t[i]!=null)return t[i]}return n}const yT=[...uT,...dT,...fT,...hT,...vT,...gT,...mT,...pT];function Nl(t){return new Error(`unhandled node type: ${t}`)}function lh(t){return n=>pee(n,t)}function pee(t,e){const n=lee(e);if(n==null)throw Nl(0);if(Dg(n)===1){const s=cee(n);return t.plural(s.reduce((o,a)=>[...o,b0(t,a)],[]))}else return b0(t,n)}function b0(t,e){const n=uee(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=dee(e).reduce((i,s)=>[...i,Rp(t,s)],[]);return t.normalize(r)}}function Rp(t,e){const n=Dg(e);switch(n){case 3:return jc(e,n);case 9:return jc(e,n);case 4:{const r=e;if(hr(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(hr(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw Nl(n)}case 5:{const r=e;if(hr(r,"i")&&sn(r.i))return t.interpolate(t.list(r.i));if(hr(r,"index")&&sn(r.index))return t.interpolate(t.list(r.index));throw Nl(n)}case 6:{const r=e,i=fee(r),s=hee(r);return t.linked(Rp(t,s),i?Rp(t,i):void 0,t.type)}case 7:return jc(e,n);case 8:return jc(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const mee=t=>t;let Bc=Pt();function gee(t,e={}){let n=!1;const r=e.onError||NZ;return e.onError=i=>{n=!0,r(i)},{...oee(t,e),detectError:n}}function vee(t,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&$e(t)){Et(e.warnHtmlMessage)&&e.warnHtmlMessage;const r=(e.onCacheKey||mee)(t),i=Bc[r];if(i)return i;const{ast:s,detectError:o}=gee(t,{...e,location:!1,jit:!0}),a=lh(s);return o?a:Bc[r]=a}else{const n=t.cacheKey;if(n){const r=Bc[n];return r||(Bc[n]=lh(t))}else return lh(t)}}let Fl=null;function yee(t){Fl=t}function bee(t,e,n){Fl&&Fl.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const kee=wee("function:translate");function wee(t){return e=>Fl&&Fl.emit(t,e)}const Ti={INVALID_ARGUMENT:DZ,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},xee=24;function _i(t){return qd(t,null,void 0)}function Ng(t,e){return e.locale!=null?k0(e.locale):k0(t.locale)}let ch;function k0(t){if($e(t))return t;if(zt(t)){if(t.resolvedOnce&&ch!=null)return ch;if(t.constructor.name==="Function"){const e=t();if(bZ(e))throw _i(Ti.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return ch=e}else throw _i(Ti.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw _i(Ti.NOT_SUPPORT_LOCALE_TYPE)}function See(t,e,n){return[...new Set([n,...Ft(e)?e:Ct(e)?Object.keys(e).filter(r=>r!=="default"):$e(e)?[e]:[n]])]}function $p(t,e,n){const r=$e(n)?n:jl,i=t;i.__localeChainCache||(i.__localeChainCache=new Map);const s=aT(e);let o=i.__localeChainCache.get(r);o||(o=new Map,i.__localeChainCache.set(r,o));const a=o.get(s);if(a)return a;const l=[];let c=[n];for(;Ft(c);)c=w0(l,c,e);const u=Ft(e)||!It(e)?e:e.default?e.default:null;return c=$e(u)?[u]:u,Ft(c)&&w0(l,c,!1),o.set(s,l),l}function w0(t,e,n){let r=!0;for(let i=0;i<e.length&&Et(r);i++){const s=e[i];$e(s)&&(r=Tee(t,e[i],n))}return r}function Tee(t,e,n){let r;const i=e.split("-");do{const s=i.join("-");r=_ee(t,s,n),i.splice(-1,1)}while(i.length&&r===!0);return r}function _ee(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const i=e.replace(/!/g,"");t.push(i),(Ft(n)||It(n))&&n[i]&&(r=n[i])}return r}const ks=[];ks[0]={w:[0],i:[3,0],"[":[4],o:[7]};ks[1]={w:[1],".":[2],"[":[4],o:[7]};ks[2]={w:[2],i:[3,0],0:[3,0]};ks[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};ks[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};ks[5]={"'":[4,0],o:8,l:[5,0]};ks[6]={'"':[4,0],o:8,l:[6,0]};const Eee=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Cee(t){return Eee.test(t)}function Oee(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function Aee(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Mee(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:Cee(e)?Oee(e):"*"+e}function Iee(t){const e=[];let n=-1,r=0,i=0,s,o,a,l,c,u,d;const f=[];f[0]=()=>{o===void 0?o=a:o+=a},f[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},f[2]=()=>{f[0](),i++},f[3]=()=>
169{if(i>0)i--,r=4,f[0]();else{if(i=0,o===void 0||(o=Mee(o),o===!1))return!1;f[1]()}};function p(){const h=t[n+1];if(r===5&&h==="'"||r===6&&h==='"')return n++,a="\\"+h,f[0](),!0}for(;r!==null;)if(n++,s=t[n],!(s==="\\"&&p())){if(l=Aee(s),d=ks[r],c=d[l]||d.l||8,c===8||(r=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(a=s,u()===!1))))return;if(r===7)return e}}const x0=new Map;function Lee(t,e){return Ct(t)?t[e]:null}function Pee(t,e){if(!Ct(t))return null;let n=x0.get(e);if(n||(n=Iee(e),n&&x0.set(e,n)),!n)return null;const r=n.length;let i=t,s=0;for(;s<r;){const o=n[s];if(yT.includes(o)&&ri(i)||!Ct(i)||!hr(i,o))return null;const a=i[o];if(a===void 0||zt(i))return null;i=a,s++}return i}const Ree="11.4.10",Gd=-1,jl="en-US",ud="",S0=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function $ee(){return{upper:(t,e)=>e==="text"&&$e(t)?t.toUpperCase():e==="vnode"&&Ct(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&$e(t)?t.toLowerCase():e==="vnode"&&Ct(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&$e(t)?S0(t):e==="vnode"&&Ct(t)&&"__v_isVNode"in t?S0(t.children):t}}let bT;function Dee(t){bT=t}let kT;function Nee(t){kT=t}let wT;function Fee(t){wT=t}let xT=null;const jee=t=>{xT=t},Bee=()=>xT;let ST=null;const T0=t=>{ST=t},Hee=()=>ST;let _0=0;function Uee(t={}){const e=zt(t.onWarn)?t.onWarn:wZ,n=$e(t.version)?t.version:Ree,r=$e(t.locale)||zt(t.locale)?t.locale:jl,i=zt(r)?jl:r,s=Ft(t.fallbackLocale)||It(t.fallbackLocale)||$e(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:i,o=It(t.messages)?t.messages:uh(i),a=It(t.datetimeFormats)?t.datetimeFormats:uh(i),l=It(t.numberFormats)?t.numberFormats:uh(i),c=on(Pt(),t.modifiers,$ee()),u=t.pluralRules||Pt(),d=zt(t.missing)?t.missing:null,f=Et(t.missingWarn)||ca(t.missingWarn)?t.missingWarn:!0,p=Et(t.fallbackWarn)||ca(t.fallbackWarn)?t.fallbackWarn:!0,h=!!t.fallbackFormat,g=!!t.unresolving,m=zt(t.postTranslation)?t.postTranslation:null,b=It(t.processor)?t.processor:null,T=Et(t.warnHtmlMessage)?t.warnHtmlMessage:!0,E=!!t.escapeParameter,w=zt(t.messageCompiler)?t.messageCompiler:bT,M=zt(t.messageResolver)?t.messageResolver:kT||Lee,A=zt(t.localeFallbacker)?t.localeFallbacker:wT||See,I=Ct(t.fallbackContext)?t.fallbackContext:void 0,j=t,$=Ct(j.__datetimeFormatters)?j.__datetimeFormatters:new Map,J=Ct(j.__numberFormatters)?j.__numberFormatters:new Map,se=Ct(j.__meta)?j.__meta:{};_0++;const Q={version:n,cid:_0,locale:r,fallbackLocale:s,messages:o,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:g,postTranslation:m,processor:b,warnHtmlMessage:T,escapeParameter:E,messageCompiler:w,messageResolver:M,localeFallbacker:A,fallbackContext:I,onWarn:e,__meta:se};return Q.datetimeFormats=a,Q.numberFormats=l,Q.__datetimeFormatters=$,Q.__numberFormatters=J,__INTLIFY_PROD_DEVTOOLS__&&bee(Q,n,se),Q}const uh=t=>({[t]:Pt()});function TT(t,e,n,r,i){const{missing:s,onWarn:o}=t;if(s!==null){const a=s(t,n,e,i);return $e(a)?a:e}else return e}function Pa(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function Vee(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function zee(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(Vee(t,e[r]))return!0;return!1}function _T(t,e,n,r,i,s,o){const{fallbackLocale:a,localeFallbacker:l,onWarn:c}=t,u=l(t,a,n);for(let d=0;d<u.length;d++){const f=u[d],p=(r[f]||{})[e];if(It(p)&&$e(f))return f;TT(t,e,f,i,o)}return null}function ET(t,e,n){let r=`${t}__${e}`;return It(n)&&!Ig(n)&&(r=`${r}__${JSON.stringify(n)}`),r}function CT(t,e,n){for(const r in n){const i=`${e}__${r}`;for(const s of t.keys())(s===i||s.startsWith(`${i}__`))&&t.delete(s)}}function OT(t,e,n,r){const[,i,s,o]=t;let a=n;
169return $e(i)?e.key=i:It(i)&&Object.keys(i).forEach(l=>{r.includes(l)?a[l]=i[l]:e[l]=i[l]}),$e(s)?e.locale=s:It(s)&&(a=s),It(o)&&(a=o),a}function E0(t,...e){const{datetimeFormats:n,unresolving:r,onWarn:i}=t,{__datetimeFormatters:s}=t;if(!$e(e[0])&&!lT(e[0])&&!sn(e[0]))return ud;const[o,a,l,c]=Dp(...e),u=Et(l.missingWarn)?l.missingWarn:t.missingWarn,d=Et(l.fallbackWarn)?l.fallbackWarn:t.fallbackWarn,f=!!l.part,p=Ng(t,l);if(!$e(o)||o===""){const T=new Intl.DateTimeFormat(p.replace(/!/g,""),c);return f?T.formatToParts(a):T.format(a)}const h=_T(t,o,p,n,u,d,"datetime format");if(!$e(h))return r?Gd:o;const g=n[h][o],m=ET(h,o,c);let b=s.get(m);return b||(b=new Intl.DateTimeFormat(h,on({},g,c)),s.set(m,b)),f?b.formatToParts(a):b.format(a)}const AT=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Dp(...t){const[e]=t,n=Pt(),r=Pt();let i;if($e(e)){const o=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!o)throw _i(Ti.INVALID_ISO_DATE_ARGUMENT);const a=o[3]?o[3].trim().startsWith("T")?`${o[1].trim()}${o[3].trim()}`:`${o[1].trim()}T${o[3].trim()}`:o[1].trim();i=new Date(a);try{i.toISOString()}catch{throw _i(Ti.INVALID_ISO_DATE_ARGUMENT)}}else if(lT(e)){if(isNaN(e.getTime()))throw _i(Ti.INVALID_DATE_ARGUMENT);i=e}else if(sn(e))i=e;else throw _i(Ti.INVALID_ARGUMENT);const s=OT(t,n,r,AT);return[n.key||"",i,n,s]}function C0(t,e,n){CT(t.__datetimeFormatters,e,n)}function O0(t,...e){const{numberFormats:n,unresolving:r,onWarn:i}=t,{__numberFormatters:s}=t;if(!sn(e[0]))return ud;const[o,a,l,c]=Np(...e),u=Et(l.missingWarn)?l.missingWarn:t.missingWarn,d=Et(l.fallbackWarn)?l.fallbackWarn:t.fallbackWarn,f=!!l.part,p=Ng(t,l);if(!$e(o)||o===""){const T=new Intl.NumberFormat(p.replace(/!/g,""),c);return f?T.formatToParts(a):T.format(a)}const h=_T(t,o,p,n,u,d,"number format");if(!$e(h))return r?Gd:o;const g=n[h][o],m=ET(h,o,c);let b=s.get(m);return b||(b=new Intl.NumberFormat(h,on({},g,c)),s.set(m,b)),f?b.formatToParts(a):b.format(a)}const MT=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Np(...t){const[e]=t,n=Pt(),r=Pt();if(!sn(e))throw _i(Ti.INVALID_ARGUMENT);const i=e,s=OT(t,n,r,MT);return[n.key||"",i,n,s]}function A0(t,e,n){CT(t.__numberFormatters,e,n)}const Wee=t=>t,Kee=t=>"",qee="text",Gee=t=>t.length===0?"":Pg(t),Yee=kZ;function dh(t,e){return t=Math.abs(t),e===2?t===1?0:1:Math.min(t,2)}function Xee(t){var n,r;const e=sn(t.pluralIndex)?t.pluralIndex:-1;return sn((n=t.named)==null?void 0:n.count)?t.named.count:sn((r=t.named)==null?void 0:r.n)?t.named.n:e}function Jee(t={}){var b,T,E,w;const e=t.locale,n=Xee(t),r=$e(e)&&zt((b=t.pluralRules)==null?void 0:b[e])?t.pluralRules[e]:dh,i=r===dh?void 0:dh,s=M=>M[r(n,M.length,i)],o=t.list||[],a=M=>o[M],l=t.named||Pt();sn(t.pluralIndex)&&(l.count||(l.count=t.pluralIndex),l.n||(l.n=t.pluralIndex));const c=M=>l[M];function u(M,A){const I=zt(t.messages)?t.messages(M,!!A):Ct(t.messages)?t.messages[M]:!1;return I||(t.parent?t.parent.message(M):Kee)}const d=M=>t.modifiers?t.modifiers[M]:Wee,f=zt((T=t.processor)==null?void 0:T.normalize)?t.processor.normalize:Gee,p=zt((E=t.processor)==null?void 0:E.interpolate)?t.processor.interpolate:Yee,h=$e((w=t.processor)==null?void 0:w.type)?t.processor.type:qee,m={list:a,named:c,plural:s,linked:(M,...A)=>{const[I,j]=A;let $="text",J="";A.length===1?Ct(I)?(J=I.modifier||J,$=I.type||$):$e(I)&&(J=I||J):A.length===2&&($e(I)&&(J=I||J),$e(j)&&($=j||$));const se=u(M,!0)(m),Q=se===""||se===void 0?M:se,G=$==="vnode"&&Ft(Q)&&J?Q[0]:Q;return J?d(J)(G,$):G},message:u,type:h,interpolate:p,normalize:f,values:on(Pt(),o,l)};return m}const M0=()=>"",ur=t=>zt(t);function I0(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:s,fallbackLocale:o,messages:a}=t,[l,c]=Fp(...e),u=Et(c.missingWarn)?c.missingWarn:t.missingWarn,d=Et(c.fallbackWarn)?c.fallbackWarn:t.fallbackWarn,f=Et(c.escapeParameter)?c.escapeParameter:t.escapeParameter,p=!!c.resolvedMessage,h=$e(c.default)||Et(c.default)?Et(c.default)?s?l:()=>l:c.default:n?s?l:()=>l:null,g=n||h!=null&&($e(h)||zt(h)),m=Ng(t,c);f&&Qee(c);let[b,T,E]=p?[l,m,a[m]||Pt()]:IT(t,l,m,o,d,u),w=b,M=l;if(!p&&!($e(w)||ri(w)||ur(w))&&g&&(w=h,M=w),!p&&(!($e(w)||ri(w)||ur(w))||!$e(T)))return i?Gd:l;let A=!1;const I=()=>{A=!0},j=ur(w)?w:LT(t,l,T,w,M,I);if(A)return w;const $=tte(t,T,E,c),J=Jee($),se=Zee(t,j,J);let Q=r?r(se,l):se;if(f&&$e(Q)&&(Q=RZ(Q)),__INTLIFY_PROD_DEVTOOLS__){const G={timestamp:Date.now(),key:$e(l)?l:ur(w)?w.key:"",locale:T||(ur(w)?w.locale:""),format:$e(w)?w:ur(w)?w.source:"",message:Q};G.meta=on({},t.__meta,Bee()||{}),kee(G)}return Q}function Qee(t){Ft(t.list)?t.list=t.list.map(e=>
169$e(e)?h0(e):e):Ct(t.named)&&Object.keys(t.named).forEach(e=>{$e(t.named[e])&&(t.named[e]=h0(t.named[e]))})}function IT(t,e,n,r,i,s){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=t,u=c(t,r,n);let d=Pt(),f,p=null;const h="translate";for(let g=0;g<u.length&&(f=u[g],d=o[f]||Pt(),(p=l(d,e))===null&&(p=d[e]),!($e(p)||ri(p)||ur(p)));g++)if(!zee(f,u)){const m=TT(t,e,f,s,h);m!==e&&(p=m)}return[p,f,d]}function LT(t,e,n,r,i,s){const{messageCompiler:o,warnHtmlMessage:a}=t;if(ur(r)){const c=r;return c.locale=c.locale||n,c.key=c.key||e,c}if(o==null){const c=()=>r;return c.locale=n,c.key=e,c}const l=o(r,ete(t,n,i,r,a,s));return l.locale=n,l.key=e,l.source=r,l}function Zee(t,e,n){return e(n)}function Fp(...t){const[e,n,r]=t,i=Pt();if(!$e(e)&&!sn(e)&&!ur(e)&&!ri(e))throw _i(Ti.INVALID_ARGUMENT);const s=sn(e)?String(e):(ur(e),e);return sn(n)?i.plural=n:$e(n)?i.default=n:It(n)&&!Ig(n)?i.named=n:Ft(n)&&(i.list=n),sn(r)?i.plural=r:$e(r)?i.default=r:It(r)&&on(i,r),[s,i]}function ete(t,e,n,r,i,s){return{locale:e,key:n,warnHtmlMessage:i,onError:o=>{throw s&&s(o),o},onCacheKey:o=>gZ(e,n,o)}}function tte(t,e,n,r){const{modifiers:i,pluralRules:s,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=t,f={locale:e,modifiers:i,pluralRules:s,messages:(p,h)=>{let g=o(n,p);if(g==null&&(u||h)){const[m,,b]=IT(u||t,p,e,a,l,c);g=m??o(b,p)}if($e(g)||ri(g)){let m=!1;const T=LT(t,p,e,g,p,()=>{m=!0});return m?M0:T}else return ur(g)?g:M0}};return t.processor&&(f.processor=t.processor),r.list&&(f.list=r.list),r.named&&(f.named=r.named),sn(r.plural)&&(f.pluralIndex=r.plural),f}aee();/*! 170 * vue-i18n v11.4.10 171 * (c) 2026 kazuya kawaguchi 172 * Released under the MIT License. 173 */const nte="11.4.10";function rte(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Qi().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Qi().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Qi().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Qi().__INTLIFY_PROD_DEVTOOLS__=!1)}const Dn={UNEXPECTED_RETURN_TYPE:xee,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Kn(t,...e){return qd(t,null,void 0)}const jp=ys("__translateVNode"),Bp=ys("__datetimeParts"),Hp=ys("__numberParts"),PT=ys("__setPluralRules"),RT=ys("__injectWithOption"),$o=ys("__dispose");let $T=null;{const t=Qi().__VUE_INSTANCE_SETTERS__;Ft(t)&&t.push(e=>{$T=e})}function Bl(t){if(!Ct(t)||ri(t))return t;for(const e in t)if(hr(t,e))if(!e.includes("."))Ct(t[e])&&Bl(t[e]);else{const n=e.split("."),r=n.length-1;let i=t,s=!1;for(let o=0;o<r;o++){if(n[o]==="__proto__")throw new Error(`unsafe key: ${n[o]}`);if(n[o]in i||(i[n[o]]=Pt()),!Ct(i[n[o]])){s=!0;break}i=i[n[o]]}if(s||(ri(i)?yT.includes(n[r])||delete t[e]:(i[n[r]]=t[e],delete t[e])),!ri(i)){const o=i[n[r]];Ct(o)&&Bl(o)}}return t}function Fg(t,e){const{messages:n,__i18n:r,messageResolver:i,flatJson:s}=e,o=It(n)?n:Ft(r)?Pt():{[t]:Pt()};if(Ft(r)&&r.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||Pt(),iu(c,o[l])):iu(c,o)}else $e(a)&&iu(JSON.parse(a),o)}),i==null&&s)for(const a in o)hr(o,a)&&Bl(o[a]);return o}function DT(t){return t.type}function NT(t,e,n){let r=Ct(e.messages)?e.messages:Pt();"__i18nGlobal"in n&&(r=Fg(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(s=>{t.mergeLocaleMessage(s,r[s])});{if(Ct(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{t.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(Ct(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{t.mergeNumberFormat(o,e.numberFormats[o])})}}}function L0(t){return X(DC,null,t,0)}function Hl(){return $T??ak()}const P0="__INTLIFY_META__",R0=()=>[],ite=()=>!1;let $0=0;function D0(t){return(e,n,r,i)=>t(n,r,Hl()||void 0,i)}const ste=()=>{const t=Hl();let e=null;return t&&(e=DT(t)[P0])?{[P0]:e}:null};function dd(t={}){const{__root:e,__injectWithOption:n}=t,r=e===void 0,i=t.flatJson,s=cd?Yl:rk;let o=Et(t.inheritLocale)?t.inheritLocale:!0;const a=s(e&&o?e.locale.value:$e(t.locale)?t.locale:jl),l=s(e&&o?e.fallbackLocale.value:$e(t.fallbackLocale)||Ft(t.fallbackLocale)||It(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:a.value),
173c=s(Fg(a.value,t)),u=s(It(t.datetimeFormats)?t.datetimeFormats:{[a.value]:{}}),d=s(It(t.numberFormats)?t.numberFormats:{[a.value]:{}});let f=e?e.missingWarn:Et(t.missingWarn)||ca(t.missingWarn)?t.missingWarn:!0,p=e?e.fallbackWarn:Et(t.fallbackWarn)||ca(t.fallbackWarn)?t.fallbackWarn:!0,h=e?e.fallbackRoot:Et(t.fallbackRoot)?t.fallbackRoot:!0,g=!!t.fallbackFormat,m=zt(t.missing)?t.missing:null,b=zt(t.missing)?D0(t.missing):null,T=zt(t.postTranslation)?t.postTranslation:null,E=e?e.warnHtmlMessage:Et(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter;const M=e?e.modifiers:It(t.modifiers)?t.modifiers:{};let A=t.pluralRules||e&&e.pluralRules,I;I=(()=>{r&&T0(null);const D={version:nte,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:M,pluralRules:A,missing:b===null?void 0:b,missingWarn:f,fallbackWarn:p,fallbackFormat:g,unresolving:!0,postTranslation:T===null?void 0:T,warnHtmlMessage:E,escapeParameter:w,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};D.datetimeFormats=u.value,D.numberFormats=d.value,D.__datetimeFormatters=It(I)?I.__datetimeFormatters:void 0,D.__numberFormatters=It(I)?I.__numberFormatters:void 0;const U=Uee(D);return r&&T0(U),U})(),Pa(I,a.value,l.value);function $(){return[a.value,l.value,c.value,u.value,d.value]}const J=On({get:()=>a.value,set:D=>{I.locale=D,a.value=D}}),se=On({get:()=>l.value,set:D=>{I.fallbackLocale=D,l.value=D,Pa(I,a.value,D)}}),Q=On(()=>c.value),G=On(()=>u.value),ee=On(()=>d.value);function ge(){return zt(T)?T:null}function ae(D){T=D,I.postTranslation=D}function ke(){return m}function Le(D){D!==null&&(b=D0(D)),m=D,I.missing=b}const Ue=(D,U,le,Ie,Ke,H)=>{$();let V;try{__INTLIFY_PROD_DEVTOOLS__,r||(I.fallbackContext=e?Hee():void 0),V=D(I)}finally{__INTLIFY_PROD_DEVTOOLS__,r||(I.fallbackContext=void 0)}if(le!=="translate exists"&&sn(V)&&V===Gd||le==="translate exists"&&!V){const[Z,de]=U();return e&&h?Ie(e):Ke(Z)}else{if(H(V))return V;throw Kn(Dn.UNEXPECTED_RETURN_TYPE)}};function Ze(...D){return Ue(U=>Reflect.apply(I0,null,[U,...D]),()=>Fp(...D),"translate",U=>Reflect.apply(U.t,U,[...D]),U=>U,U=>$e(U))}function Je(...D){const[U,le,Ie]=D;if(Ie&&!Ct(Ie))throw Kn(Dn.INVALID_ARGUMENT);return Ze(U,le,on({resolvedMessage:!0},Ie||{}))}function Xe(...D){return Ue(U=>Reflect.apply(E0,null,[U,...D]),()=>Dp(...D),"datetime format",U=>Reflect.apply(U.d,U,[...D]),()=>ud,U=>$e(U)||Ft(U))}function We(...D){return Ue(U=>Reflect.apply(O0,null,[U,...D]),()=>Np(...D),"number format",U=>Reflect.apply(U.n,U,[...D]),()=>ud,U=>$e(U)||Ft(U))}function rt(D){return D.map(U=>$e(U)||sn(U)||Et(U)?L0(String(U)):U)}const Te={normalize:rt,interpolate:D=>D,type:"vnode"};function q(...D){return Ue(U=>{let le;const Ie=U;try{Ie.processor=Te,le=Reflect.apply(I0,null,[Ie,...D])}finally{Ie.processor=null}return le},()=>Fp(...D),"translate",U=>U[jp](...D),U=>[L0(U)],U=>Ft(U))}function pe(...D){return Ue(U=>Reflect.apply(O0,null,[U,...D]),()=>Np(...D),"number format",U=>U[Hp](...D),R0,U=>$e(U)||Ft(U))}function ce(...D){return Ue(U=>Reflect.apply(E0,null,[U,...D]),()=>Dp(...D),"datetime format",U=>U[Bp](...D),R0,U=>$e(U)||Ft(U))}function be(D){A=D,I.pluralRules=A}function He(D,U){return Ue(()=>{if(!D)return!1;const le=$e(U)?U:a.value,Ie=$e(U)?[le]:$p(I,l.value,le);for(let Ke=0;Ke<Ie.length;Ke++){const H=Oe(Ie[Ke]);let V=I.messageResolver(H,D);if(V===null&&(V=H[D]),ri(V)||ur(V)||$e(V))return!0}return!1},()=>[D],"translate exists",le=>Reflect.apply(le.te,le,[D,U]),ite,le=>Et(le))}function at(D){let U=null;const le=$p(I,l.value,a.value);for(let Ie=0;Ie<le.length;Ie++){const Ke=c.value[le[Ie]]||{},H=I.messageResolver(Ke,D);if(H!=null){U=H;break}}return U}function Ce(D){const U=at(D);return U??(e?e.tm(D)||{}:{})}function Oe(D){return c.value[D]||{}}function lt(D,U){if(i){const le={[D]:U};for(const Ie in le)hr(le,Ie)&&Bl(le[Ie]);U=le[D]}c.value[D]=U,I.messages=c.value}function yt(D,U){c.value[D]=c.value[D]||{};const le={[D]:U};if(i)for(const Ie in le)hr(le,Ie)&&Bl(le[Ie]);U=le[D],iu(U,c.value[D]),I.messages=c.value}function ht(D){return u.value[D]||{}}function R(D,U){u.value[D]=U,I.datetimeFormats=u.value,C0(I,D,U)}function F(D,U){u.value[D]=on(u.value[D]||{},U),I.datetimeFormats=u.value,C0(I,D,U)}function ie(D){return d.value[D]||{}}function fe(D,U){d.value[D]=U,I.numberFormats=d.value,A0(I,D,U)}function Ve(D,U){d.value[D]=on(d.value[D]||{},U),I.numberFormats=d.value,A0(I,D,U)}$0++,e&&cd&&(qo(e.locale,D=>{o&&(a.value=D,I.locale=D,Pa(I,a.value,l.value))}),qo(e.fallbackLocale,D=>{o&&(l.value=D,I.fallbackLocale=D,Pa(I,a.value,l.value))}));const B={id:$0,locale:J,fallbackLocale:se,get inheritLocale(){return o},set inheritLocale(D){o=D,D&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,Pa(I,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:Q,get modifiers(){return M},get pluralRules(){return A||{}},get isGlobal(){return r},get missingWarn(){return f},set missingWarn(D){f=D,I.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(D){p=D,I.fallbackWarn=p},get fallbackRoot(){return h},set fallbackRoot(D){h=D},get fallbackFormat(){return g},set fallbackFormat(D){g=D,I.fallbackFormat=g},get warnHtmlMessage(){return E},set warnHtmlMessage(D){E=D,I.warnHtmlMessage=D},get escapeParameter(){return w},set escapeParameter(D){w=D,I.escapeParameter=D},t:Ze,getLocaleMessage:Oe,setLocaleMessage:lt,mergeLocaleMessage:yt,getPostTranslationHandler:ge,setPostTranslationHandler:ae,getMissingHandler:ke,setMissingHandler:Le,[PT]:be};return B.datetimeFormats=G,B.numberFormats=ee,B.rt=Je,B.te=He,B.tm=Ce,B.d=Xe,B.n=We,B.getDateTimeFormat=ht,B.setDateTimeFormat=R,B.mergeDateTimeFormat=F,B.getNumberFormat=ie,B.setNumberFormat=fe,B.mergeNumberFormat=Ve,B[RT]=n,B[jp]=q,B[Bp]=ce,B[Hp]=pe,B}function ote(t){const e=$e(t.locale)?t.locale:jl,n=$e(t.fallbackLocale)||Ft(t.fallbackLocale)||It(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=zt(t.missing)?t.missing:void 0,i=Et(t.silentTranslationWarn)||ca(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=Et(t.silentFallbackWarn)||ca(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,o=Et(t.fallbackRoot)?t.fallbackRoot:!0,a=!!t.formatFallbackMessages,l=It(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,u=zt(t.postTranslation)?t.postTranslation:void 0,d=$e(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,f=!!t.escapeParameterHtml,p=Et(t.sync)?t.sync:!0;let h=t.messages;if(It(t.sharedMessages)){const M=t.sharedMessages;h=Object.keys(M).reduce((I,j)=>{const $=I[j]||(I[j]={});return on($,M[j]),I},h||{})}const{__i18n:g,__root:m,__injectWithOption:b}=t,T=t.datetimeFormats,E=t.numberFormats,w=t.flatJson;return{locale:e,fallbackLocale:n,messages:h,flatJson:w,datetimeFormats:T,numberFormats:E,missing:r,missingWarn:i,fallbackWarn:s,fallbackRoot:o,fallbackFormat:a,modifiers:l,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:t.messageResolver,inheritLocale:p,__i18n:g,__root:m,__injectWithOption:b}}function Up(t={}){const e=dd(ote(t)),{__extender:n}=t,r={id:e.id,get locale(){return e.locale.value},set locale(i){e.locale.value=i},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(i){e.fallbackLocale.value=i},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(i){e.setMissingHandler(i)},get silentTranslationWarn(){return Et(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(i){e.missingWarn=Et(i)?!i:i},get silentFallbackWarn(){return Et(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(i){e.fallbackWarn=Et(i)?!i:i},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(i){e.fallbackFormat=i},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(i){e.setPostTranslationHandler(i)},get sync(){return e.inheritLocale},set sync(i){e.inheritLocale=i},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(i){e.warnHtmlMessage=i!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(i){e.escapeParameter=i},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...i){return Reflect.apply(e.t,e,[...i])}
173,rt(...i){return Reflect.apply(e.rt,e,[...i])},te(i,s){return e.te(i,s)},tm(i){return e.tm(i)},getLocaleMessage(i){return e.getLocaleMessage(i)},setLocaleMessage(i,s){e.setLocaleMessage(i,s)},mergeLocaleMessage(i,s){e.mergeLocaleMessage(i,s)},d(...i){return Reflect.apply(e.d,e,[...i])},getDateTimeFormat(i){return e.getDateTimeFormat(i)},setDateTimeFormat(i,s){e.setDateTimeFormat(i,s)},mergeDateTimeFormat(i,s){e.mergeDateTimeFormat(i,s)},n(...i){return Reflect.apply(e.n,e,[...i])},getNumberFormat(i){return e.getNumberFormat(i)},setNumberFormat(i,s){e.setNumberFormat(i,s)},mergeNumberFormat(i,s){e.mergeNumberFormat(i,s)}};return r.__extender=n,r}function ate(t,e,n){return{beforeCreate(){const r=Hl();if(!r)throw Kn(Dn.UNEXPECTED_ERROR);const i=this.$options;if(i.i18n){const s=i.i18n;if(i.__i18n&&(s.__i18n=i.__i18n),s.__root=e,this===this.$root)this.$i18n=N0(t,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=Up(s);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(i.__i18n)if(this===this.$root)this.$i18n=N0(t,i);else{this.$i18n=Up({__i18n:i.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;i.__i18nGlobal&&NT(e,i,i),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$te=(s,o)=>this.$i18n.te(s,o),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(r,this.$i18n)},mounted(){},unmounted(){const r=Hl();if(!r)throw Kn(Dn.UNEXPECTED_ERROR);const i=this.$i18n;i&&(delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,i!=null&&i.__disposer&&(i.__disposer(),delete i.__disposer,delete i.__extender),n.__deleteInstance(r),delete this.$i18n)}}}function N0(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[PT](e.pluralizationRules||t.pluralizationRules);const n=Fg(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(r=>t.mergeLocaleMessage(r,n[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const jg={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function lte({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,i)=>[...r,...i.type===Fe?i.children:[i]],[]):e.reduce((n,r)=>{const i=t[r];return i&&(n[r]=i()),n},Pt())}function FT(){return Fe}const cte=Ri({name:"i18n-t",props:on({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>sn(t)||!isNaN(t)}},jg),setup(t,e){const{slots:n,attrs:r}=e,i=t.i18n||Bg({useScope:t.scope,__useComponent:!0});return()=>{const s=()=>{const l=Object.keys(n).filter(d=>d[0]!=="_"),c=Pt();t.locale&&(c.locale=t.locale),t.plural!==void 0&&(c.plural=$e(t.plural)?+t.plural:t.plural);const u=lte(e,l);return i[jp](t.keypath,u,c)},o=on(Pt(),r),a=$e(t.tag)||Ct(t.tag)?t.tag:FT();return Ct(a)?ii(a,o,{default:s}):ii(a,o,s())}}}),F0=cte;function ute(t){return Ft(t)&&!$e(t[0])}function jT(t,e,n,r){const{slots:i,attrs:s}=e;return()=>{const o=()=>{const c={part:!0};let u=Pt();t.locale&&(c.locale=t.locale),$e(t.format)?c.key=t.format:Ct(t.format)&&($e(t.format.key)&&(c.key=t.format.key),u=Object.keys(t.format).reduce((p,h)=>n.includes(h)?on(Pt(),p,{[h]:t.format[h]}):p,Pt()));const d=r(t.value,c,u);let f=[c.key];return Ft(d)?f=d.map((p,h)=>
173{const g=i[p.type],m=g?g({[p.type]:p.value,index:h,parts:d}):[p.value];return ute(m)&&(m[0].key=`${p.type}-${h}`),m}):$e(d)&&(f=[d]),f},a=on(Pt(),s),l=$e(t.tag)||Ct(t.tag)?t.tag:FT();return Ct(l)?ii(l,a,{default:o}):ii(l,a,o())}}const dte=Ri({name:"i18n-n",props:on({value:{type:Number,required:!0},format:{type:[String,Object]}},jg),setup(t,e){const n=t.i18n||Bg({useScope:t.scope,__useComponent:!0});return jT(t,e,MT,(...r)=>n[Hp](...r))}}),j0=dte;function fte(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const r=n.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function hte(t){const e=o=>{const{instance:a,value:l}=o;if(!a||!a.$)throw Kn(Dn.UNEXPECTED_ERROR);const c=fte(t,a.$),u=B0(l);return[Reflect.apply(c.t,c,[...H0(u)]),c]};return{created:(o,a)=>{const[l,c]=e(a);cd&&(o.__i18nWatcher=qo(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{cd&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,c=B0(a);o.textContent=Reflect.apply(l.t,l,[...H0(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function B0(t){if($e(t))return{path:t};if(It(t)){if(!("path"in t))throw Kn(Dn.REQUIRED_VALUE,"path");return t}else throw Kn(Dn.INVALID_VALUE)}function H0(t){const{path:e,locale:n,args:r,choice:i,plural:s}=t,o={},a=r||{};return $e(n)&&(o.locale=n),sn(i)&&(o.plural=i),sn(s)&&(o.plural=s),[e,a,o]}function pte(t,e,...n){const r=It(n[0])?n[0]:{};(Et(r.globalInstall)?r.globalInstall:!0)&&([F0.name,"I18nT"].forEach(s=>t.component(s,F0)),[j0.name,"I18nN"].forEach(s=>t.component(s,j0)),[z0.name,"I18nD"].forEach(s=>t.component(s,z0))),t.directive("t",hte(e))}const mte=ys("global-vue-i18n");function gte(t={}){const e=__VUE_I18N_LEGACY_API__&&Et(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,n=Et(t.globalInjection)?t.globalInjection:!0,r=new Map,[i,s]=vte(t,e),o=ys("");function a(d){return r.get(d)||null}function l(d,f){r.set(d,f)}function c(d){r.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=o,d.provide(d.__VUE_I18N_SYMBOL__,u),It(f[0])){const g=f[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let p=null;!e&&n&&(p=Tte(d,u.global)),__VUE_I18N_FULL_INSTALL__&&pte(d,u,...f),__VUE_I18N_LEGACY_API__&&e&&d.mixin(ate(s,s.__composer,u));const h=d.unmount;d.unmount=()=>{p&&p(),u.dispose(),h()}},get global(){return s},dispose(){i.stop()},__instances:r,__getInstance:a,__setInstance:l,__deleteInstance:c};return u}function Bg(t={}){const e=Hl();if(e==null)throw Kn(Dn.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Kn(Dn.NOT_INSTALLED);const n=yte(e),r=kte(n),i=DT(e),s=bte(t,i);if(s==="global")return NT(r,t,i),r;if(s==="parent"){let l=U0(n,e,t.__useComponent);return l==null&&(l=r),l}if(s==="isolated"){if(n.mode!=="composition")throw Kn(Dn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const l=n,c=on({},t),u=U0(n,e);c.__root=u||r;const d=dd(c);return l.__composerExtend&&(d[$o]=l.__composerExtend(d)),RC()&&PC(()=>{const p=d[$o];p&&(p(),delete d[$o])}),d}const o=n;let a=o.__getInstance(e);if(a==null){const l=on({},t);"__i18n"in i&&(l.__i18n=i.__i18n),r&&(l.__root=r),a=dd(l),o.__composerExtend&&(a[$o]=o.__composerExtend(a)),xte(o,e,a),o.__setInstance(e,a)}return a}function vte(t,e){const n=nk(),r=__VUE_I18N_LEGACY_API__&&e?n.run(()=>Up(t)):n.run(()=>dd(t));if(r==null)throw Kn(Dn.UNEXPECTED_ERROR);return[n,r]}function yte(t){const e=Qs(t.isCE?mte:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Kn(t.isCE?Dn.NOT_INSTALLED_WITH_PROVIDE:Dn.UNEXPECTED_ERROR);return e}function bte(t,e){return Ig(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function kte(t){return t.mode==="composition"?t.global:t.global.__composer}function U0(t,e,n=!1){let r=null;const i=e.root;let s=wte(e,n);for(;s!=null;){const o=t;if(t.mode==="composition")r=o.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const a=o.__getInstance(s);a!=null&&(r=a.__composer,n&&r&&!r[RT]&&(r=null))}if(r!=null||i===s)break;s=s.parent}return r}function wte(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function xte(t,e,n){lk(()=>{},e),$C(()=>{const r=n;t.__deleteInstance(e);const i=r[$o];i&&(i(),delete r[$o])},e)}const Ste=["locale","fallbackLocale","availableLocales"],V0=["t","rt","d","n","tm","te"];function Tte(t,e){const n=Object.create(null);return Ste.forEach(i=>
173{const s=Object.getOwnPropertyDescriptor(e,i);if(!s)throw Kn(Dn.UNEXPECTED_ERROR);const o=LC(s.value)?{get(){return s.value.value},set(a){s.value.value=a}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,i,o)}),t.config.globalProperties.$i18n=n,V0.forEach(i=>{const s=Object.getOwnPropertyDescriptor(e,i);if(!s||!s.value)throw Kn(Dn.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${i}`,s)}),()=>{delete t.config.globalProperties.$i18n,V0.forEach(i=>{delete t.config.globalProperties[`$${i}`]})}}const _te=Ri({name:"i18n-d",props:on({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},jg),setup(t,e){const n=t.i18n||Bg({useScope:t.scope,__useComponent:!0});return jT(t,e,AT,(...r)=>n[Bp](...r))}}),z0=_te;rte();Dee(vee);Nee(Pee);Fee($p);if(__INTLIFY_PROD_DEVTOOLS__){const t=Qi();t.__INTLIFY__=!0,yee(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Ete={en:{editor:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",style:"Style",bold:"Bold",italic:"Italic",blockquote:"Quote",alert:"Alert Box",horizontal_rule:"Horizontal Rule",underline:"Underline",strike:"Strike",list:"Bullet List",searchDocs:"Search Docs",orderedList:"Ordered List",table:"Table",tableDelete:"Delete Table",addColumnBefore:"Add Column Before",addColumnAfter:"Add Column After",deleteColumn:"Delete Column",addRowBefore:"Add Row Before",addRowAfter:"Add Row After",deleteRow:"Delete Row",toggleCellMerge:"Toggle Cell Merge",fontColor:"Font Color",addLink:"Add Link",mention:"Mention Someone",code:"Code Block",inlineCode:"Inline Code",addImage:"Add Image",dropFilesToUpload:"Drop files here to upload",uploadAttachment:"Upload Attachment",attachment:"Attachment | Attachments",removeFormat:"Remove Format",selectImage:"Upload Image",selectImageFromUrl:"By Url",linkName:"Link Name",quickReplies:"Quick Replies",quickRepliesModalTitle:"Quick replies",quickRepliesSearchPlaceholder:"Search by name or tagâ¦",quickRepliesTagFilter:"Filter by tags",quickRepliesTagsFilterButton:"Tags",quickRepliesClearTagFilters:"Clear tag filters",quickRepliesRemoveTagFilter:"Remove {tag} from filters",quickRepliesNoTagsHint:"No quick-reply tags yet. Create tags in Settings â Tags.",quickRepliesPreview:"Preview",quickRepliesPickHint:"Select a quick reply to preview.",quickRepliesEditQuickReply:"Edit quick reply",quickRepliesEmptyList:"No quick replies match your search or filters.",insertReply:"Insert",quickRepliesSaveThis:"Save current reply",ai:"AI",aiUpgradeToBusiness:"Upgrade to Business plan to use AI features.",improveWriting:"Improve writing",generateReply:"Generate reply",translateTo:"Translate toâ¦",aiLoadingSuggestedReply:"Generating replyâ¦",aiLoadingImproveWriting:"Improving writingâ¦",aiLoadingTranslate:"Translatingâ¦",embed:"Add Embed",sandbox:"Insert HTML",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignment:"Text Alignment",add:"Add",save:"Save",apply:"Apply",reset:"Reset",submit:"Send",cancel:"Cancel",fixMenu:"Pin Menu to top",unfixMenu:"Unpin Menu",backgroundColor:"Background Color",altText:"Alt text",addVideo:"Video",addIframe:"iFrame",newWindow:"Open in new Window",history:{undo:"Undo",redo:"Redo"},styles:{heading:"Heading",subheading:"Subheading",normal:"Normal",small:"Small"},errors:{server:"This file could not been uploaded",fileError:"Some of the files could not be uploaded due to errors",maxFileSizeMsg:"File size is bigger than {max}MB",maxFilesSelectMsg:"Max file selection of {max} exceeded",invalidExtensionMsg:"File must be one of {extensions}"}}},de:{editor:{h1:"H1",h2:"H2",h3:"H3",style:"Text Format",bold:"Fett",italic:"Kursiv",blockquote:"Zitat",alert:"Info Box",horizontal_rule:"Horizontale Linie",underline:"Unterstreichen",strike:"Durchstreichen",list:"Liste",searchDocs:"Docs durchsuchen",orderedList:"Sortierte Liste",table:"Tabelle",tableDelete:"Tabelle löschen",addColumnBefore:"Add column Before",addColumnAfter:"Add column after",deleteColumn:"Delete column",addRowBefore:"Add row before",addRowAfter:"Add row after",deleteRow:"Delete row",toggleCellMerge:"Toggle cell merge",fontColor:"Schriftfarbe",addLink:"Link hinzufügen",mention:"Jemanden erwähnen",code:"Quellcode",inlineCode:"Quellcode",addImage:"Bild hinzufügen",dropFilesToUpload:"Ziehe die Dateien hier hin, um sie hochzuladen.",uploadAttachment:"Anhang hochladen",attachment:"Anhang | Anhänge",removeFormat:"Formatierung entfernen",selectImage:"Bild auswählen",selectImageFromUrl:"Per URL",linkName:"Link Name",quickReplies:"Antwortvorlagen",quickRepliesModalTitle:"Antwortvorlagen",quickRepliesSearchPlaceholder:"Nach Name oder Tag suchenâ¦",quickRepliesTagFilter:"Nach Tags filtern",quickRepliesTagsFilterButton:"Tags",quickRepliesClearTagFilters:"Alle Tag-Filter entfernen",quickRepliesRemoveTagFilter:"â{tag}â aus den Filtern entfernen",quickRepliesNoTagsHint:"Noch keine Tags für Vorlagen. Tags unter Einstellungen â Tags anlegen.",quickRepliesPreview:"Vorschau",quickRepliesPickHint:"Wähle eine Vorlage für die Vorschau.",quickRepliesEditQuickReply:"Vorlage bearbeiten",quickRepliesEmptyList:"Keine Vorlagen passen zur Suche oder den Filtern.",insertReply:"Einfügen",quickRepliesSaveThis:"Aktuelle Antwort speichern",ai:"KI",aiUpgradeToBusiness:"Upgrade auf den Business-Plan, um KI-Funktionen zu nutzen.",improveWriting:"Text verbessern",generateReply:"Antwort generieren",translateTo:"Ãbersetzen nachâ¦",aiLoadingSuggestedReply:"Antwort wird generiertâ¦",aiLoadingImproveWriting:"Text wird verbessertâ¦",aiLoadingTranslate:"Wird übersetztâ¦",embed:"Einbetten",sandbox:"HTML hinzufügen",alignLeft:"Links ausrichten",alignCenter:"Zentrieren",alignRight:"Rechts ausrichten",alignment:"Text ausrichten",add:"Hinzufügen",apply:"Ãbernehmen",save:"Ãber
173nehmen",reset:"Zurücksetzen",submit:"Absenden",cancel:"Abbrechen",fixMenu:"Menü anheften",unfixMenu:"Menü abheften",backgroundColor:"Hintergrundfarbe",altText:"Alt Text",addVideo:"Video einfügen",addIframe:"Iframe einfügen",newWindow:"In neuem Fenster öffnen",history:{undo:"Rückgängig",redo:"Wiederholen"},styles:{heading:"Ãberschrift",subheading:"Zwischenüberschrift",normal:"Normal",small:"Klein"},errors:{server:"Diese Datei konnte nicht hochgeladen werden",fileError:"Beim hochladen sind Fehler aufgetreten",maxFileSizeMsg:"DateigröÃe überschreitet das Limit von {max}MB",maxFilesSelectMsg:"Das maximum an selektierten Dateien ({max}) wurde überschritten",invalidExtensionMsg:"Es sind nur Dateien vom Typ {extensions} erlaubt"}}}},Cte={compatConfig:{WATCH_ARRAY:!1},computed:{messages(){return this.$store.getters.notify}},watch:{messages:{deep:!0,handler(t){t.length>0&&!this.interval&&(this.interval=setInterval(()=>{this.$store.getters.notify.forEach((e,n)=>{e.createdAt!=0&&Date.now()-e.duration>e.createdAt&&this.$store.commit("removeNotifyMessage",n)})},1e3)),t.length==0&&this.interval&&(clearInterval(this.interval),this.interval=!1)}}},beforeUnmount(){clearInterval(this.interval),this.interval=!1},methods:{removeNotifyMessage(t,e){t.type!="reveal"&&this.$store.commit("removeNotifyMessage",e)},type(t){switch(t){case"success":case"reveal":return{icon:"feather-check",color:"green"};case"error":return{icon:"feather-x",color:"red"};default:return{icon:"feather-info",color:"blue"}}}}},Ote={class:"fixed z-50 right-0 bottom-0 m-4"},Ate=["onClick"],Mte={class:"flex w-10 h-full justify-center text-center rounded-l",style:{background:"#333b49"}},Ite=["innerHTML"],Lte={class:"flex h-full flex-1 rounded-r pr-4",style:{background:"#3e4858"}},Pte=["innerHTML"],Rte=["onClick"];function $te(t,e,n,r,i,s){return S(),C("div",Ote,[X($i,{tag:"div",class:"flex flex-col-reverse",name:"list"},{default:Y(()=>[(S(!0),C(Fe,null,nt(t.$store.getters.notify,(o,a)=>(S(),C("div",{key:a+o.createdAt,class:"flex ml-auto rounded-lg shadow h-10 min-w-60 mt-2",onClick:l=>s.removeNotifyMessage(o,a)},[x("div",Mte,[x("div",{class:K(["self-center leading-none",`text-${s.type(o.type).color}-500`]),innerHTML:t.svg(s.type(o.type).icon,"stroke-icon h-4")}
173,null,10,Ite)]),x("div",Lte,[x("div",{class:"self-center text-white text-sm font-medium pl-4 pr-2",innerHTML:o.message},null,8,Pte),o.type=="reveal"&&o.data.section!=t.$store.getters.section?(S(),C("button",{key:0,class:"self-center text-white text-sm font-medium pr-6 underline",onClick:l=>t.$store.dispatch("revealTicket",{ticket_id:o.data.id,section:o.data.section})},L(t.$trans.get("Reveal")),9,Rte)):P("",!0)])],8,Ate))),128))],void 0,!0),_:1})])}const Dte=Ae(Cte,[["render",$te]]),Nte={install(t,e,n){let r=n&&n.id?n.id:"app",i=(o,a,l,c)=>{e.commit("addNotifyMessage",{type:o,createdAt:Date.now(),message:a,duration:l||4e3,data:c||null})};t.config.globalProperties.$notify={success:(o,a,l)=>{i("success",o,a,l)},error:(o,a,l)=>{i("error",o,a,l)},warning:(o,a,l)=>{i("warning",o,a,l)},info:(o,a,l)=>{i("info",o,a,l)},reveal:(o,a,l)=>{i("reveal",o,a,l)}},t.component("SpmNotify",Dte);var s=document.createElement("spm-notify");document.getElementById(r).appendChild(s)}},BT=new Set,qn=new WeakMap,Bo=new WeakMap,ao=new WeakMap,Vp=new WeakMap,Fte=new WeakMap,da=new WeakMap,fd=new WeakMap,Wa=new WeakSet;let as;const Ei="__aa_tgt",zp="__aa_del",jte=t=>{const e=zte(t);e&&e.forEach(n=>Wte(n))},Bte=t=>{t.forEach(e=>{e.target===as&&Ute(),qn.has(e.target)&&po(e.target)})};function Hte(t){const e=Vp.get(t);e==null||e.disconnect();let n=qn.get(t),r=0;const i=5;n||(n=fa(t),qn.set(t,n));const{offsetWidth:s,offsetHeight:o}=as,l=[n.top-i,s-(n.left+i+n.width),o-(n.top+i+n.height),n.left-i].map(u=>`${-1*Math.floor(u)}px`).join(" "),c=new IntersectionObserver(()=>{++r>1&&po(t)},{root:as,threshold:1,rootMargin:l});c.observe(t),Vp.set(t,c)}function po(t){clearTimeout(fd.get(t));const e=Yd(t),n=typeof e=="function"?500:e.duration;fd.set(t,setTimeout(async()=>{const r=ao.get(t);(!r||await r.finished)&&(qn.set(t,fa(t)),Hte(t))},n))}function Ute(){clearTimeout(fd.get(as)),fd.set(as,setTimeout(()=>{BT.forEach(t=>zT(t,e=>HT(()=>po(e))))},100))}function Vte(t){setTimeout(()=>{Fte.set(t,setInterval(()=>HT(po.bind(null,t)),2e3))},Math.round(2e3*Math.random()))}function HT(t){typeof requestIdleCallback=="function"?requestIdleCallback(()=>t()):requestAnimationFrame(()=>t())}let Wp,Do;typeof window<"u"&&(as=document.documentElement,Wp=new MutationObserver(jte),Do=new ResizeObserver(Bte),Do.observe(as));function zte(t){return t.reduce((r,i)=>[...r,...Array.from(i.addedNodes),...Array.from(i.removedNodes)],[]).every(r=>r.nodeName==="#comment")?!1:t.reduce((r,i)=>{if(r===!1)return!1;if(i.target instanceof Element){if(fh(i.target),!r.has(i.target)){r.add(i.target);for(let s=0;s<i.target.children.length;s++){const o=i.target.children.item(s);if(o){if(zp in o)return!1;fh(i.target,o),r.add(o)}}}if(i.removedNodes.length)for(let s=0;s<i.removedNodes.length;s++){const o=i.removedNodes[s];if(zp in o)return!1;o instanceof Element&&(r.add(o),fh(i.target,o),Bo.set(o,[i.previousSibling,i.nextSibling]))}}return r},new Set)}function fh(t,e){!e&&!(Ei in t)?Object.defineProperty(t,Ei,{value:t}):e&&!(Ei in e)&&Object.defineProperty(e,Ei,{value:t})}function Wte(t){var e;const n=as.contains(t),r=qn.has(t);n&&Bo.has(t)&&Bo.delete(t),ao.has(t)&&((e=ao.get(t))===null||e===void 0||e.cancel()),r&&n?Kte(t):r&&!n?Gte(t):qte(t)}function Kr(t){return Number(t.replace(/[^0-9.\-]/g,""))}function fa(t){const e=t.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height}}function UT(t,e,n){let r=e.width,i=e.height,s=n.width,o=n.height;const a=getComputedStyle(t);if(a.getPropertyValue("box-sizing")==="content-box"){const c=Kr(a.paddingTop)+Kr(a.paddingBottom)+Kr(a.borderTopWidth)+Kr(a.borderBottomWidth),u=Kr(a.paddingLeft)+Kr(a.paddingRight)+Kr(a.borderRightWidth)+Kr(a.borderLeftWidth);r-=u,s-=u,i-=c,o-=c}return[r,s,i,o].map(Math.round)}function Yd(t){return Ei in t&&da.has(t[Ei])?da.get(t[Ei]):{duration:250,easing:"ease-in-out"}}function VT(t){if(Ei in t)return t[Ei]}function Hg(t){const e=VT(t);return e?Wa.has(e):!1}function zT(t,...e){e.forEach(n=>n(t,da.has(t)));for(let n=0;n<t.children.length;n++){const r=t.children.item(n);r&&e.forEach(i=>
173i(r,da.has(r)))}}function Kte(t){const e=qn.get(t),n=fa(t);if(!Hg(t))return qn.set(t,n);let r;if(!e)return;const i=Yd(t);if(typeof i!="function"){const s=e.left-n.left,o=e.top-n.top,[a,l,c,u]=UT(t,e,n),d={transform:`translate(${s}px, ${o}px)`},f={transform:"translate(0, 0)"};a!==l&&(d.width=`${a}px`,f.width=`${l}px`),c!==u&&(d.height=`${c}px`,f.height=`${u}px`),r=t.animate([d,f],{duration:i.duration,easing:i.easing})}else r=new Animation(i(t,"remain",e,n)),r.play();ao.set(t,r),qn.set(t,n),r.addEventListener("finish",po.bind(null,t))}function qte(t){const e=fa(t);qn.set(t,e);const n=Yd(t);if(!Hg(t))return;let r;typeof n!="function"?r=t.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"}):(r=new Animation(n(t,"add",e)),r.play()),ao.set(t,r),r.addEventListener("finish",po.bind(null,t))}function Gte(t){var e;if(!Bo.has(t)||!qn.has(t))return;const[n,r]=Bo.get(t);Object.defineProperty(t,zp,{value:!0}),r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(t,r):n&&n.parentNode?n.parentNode.appendChild(t):(e=VT(t))===null||e===void 0||e.appendChild(t);function i(){var f;t.remove(),qn.delete(t),Bo.delete(t),ao.delete(t),(f=Vp.get(t))===null||f===void 0||f.disconnect()}if(!Hg(t))return i();const[s,o,a,l]=Yte(t),c=Yd(t),u=qn.get(t);let d;Object.assign(t.style,{position:"absolute",top:`${s}px`,left:`${o}px`,width:`${a}px`,height:`${l}px`,margin:0,pointerEvents:"none",transformOrigin:"center",zIndex:100}),typeof c!="function"?d=t.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}
173],{duration:c.duration,easing:"ease-out"}):(d=new Animation(c(t,"remove",u)),d.play()),ao.set(t,d),d.addEventListener("finish",i)}function Yte(t){const e=qn.get(t),[n,,r]=UT(t,e,fa(t));let i=t.parentElement;for(;i&&(getComputedStyle(i).position==="static"||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const s=getComputedStyle(i),o=qn.get(i)||fa(i),a=Math.round(e.top-o.top)-Kr(s.borderTopWidth),l=Math.round(e.left-o.left)-Kr(s.borderLeftWidth);return[a,l,n,r]}function Xte(t,e={}){return Wp&&Do&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&typeof e!="function"&&!e.disrespectUserMotionPreference||(Wa.add(t),getComputedStyle(t).position==="static"&&Object.assign(t.style,{position:"relative"}),zT(t,po,Vte,i=>Do==null?void 0:Do.observe(i)),typeof e=="function"?da.set(t,e):da.set(t,{duration:250,easing:"ease-in-out",...e}),Wp.observe(t,{childList:!0}),BT.add(t))),Object.freeze({parent:t,enable:()=>{Wa.add(t)},disable:()=>{Wa.delete(t)},isEnabled:()=>Wa.has(t)})}class Kp extends Error{constructor(n,r=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.");te(this,"cause");te(this,"isNetworkError");te(this,"request");this.cause=n,this.isNetworkError=!0,this.request=r}}var Bs,Ho,Ul,Uo;class Jte{constructor(e,n){_t(this,Bs);_t(this,Ho,!1);_t(this,Ul);_t(this,Uo);mn(this,Uo,e),mn(this,Ul,()=>n(e))}progress(){ve(this,Ho)||ve(this,Uo)>0&&(clearTimeout(ve(this,Bs)),mn(this,Bs,setTimeout(ve(this,Ul),ve(this,Uo))))}done(){ve(this,Ho)||(clearTimeout(ve(this,Bs)),mn(this,Bs,void 0),mn(this,Ho,!0))}}Bs=new WeakMap,Ho=new WeakMap,Ul=new WeakMap,Uo=new WeakMap;const Hc=()=>{};function Qte(t,e={}){const{body:n=null,headers:r={},method:i="GET",onBeforeRequest:s=Hc,onUploadProgress:o=Hc,shouldRetry:a=()=>!0,onAfterResponse:l=Hc,onTimeout:c=Hc,responseType:u,retries:d=3,signal:f=null,timeout:p=3e4,withCredentials:h=!1}=e,g=T=>.3*2**(T-1)*1e3,m=new Jte(p,c);function b(T=0){return new Promise(async(E,w)=>{const M=new XMLHttpRequest,A=j=>{a(M)&&T<d?setTimeout(()=>{b(T+1).then(E,w)},g(T)):(m.done(),w(j))};M.open(i,t,!0),M.withCredentials=h,u&&(M.responseType=u),M.onload=async()=>{try{await l(M,T)}catch(j){j.request=M,A(j);return}M.status>=200&&M.status<300?(m.done(),E(M)):a(M)&&T<d?setTimeout(()=>{b(T+1).then(E,w)},g(T)):(m.done(),w(new Kp(M.statusText,M)))},M.onerror=()=>A(new Kp(M.statusText,M)),M.upload.onprogress=j=>{m.progress(),o(j)},r&&Object.keys(r).forEach(j=>{M.setRequestHeader(j,r[j])});function I(){M.abort(),w(new DOMException("Aborted","AbortError"))}if(f==null||f.addEventListener("abort",I),f!=null&&f.aborted){I();return}await s(M,T),M.send(n)})}return b()}const Zte=t=>"error"in t&&!!t.error,ene=t=>t.progress.uploadComplete;function tne(t){return t.filter(e=>!Zte(e)&&!ene(e))}function nne(t){return t.filter(e=>{var n;return!((n=e.progress)!=null&&n.uploadStarted)||!e.isRestored})}function WT(t){const e=t.lastIndexOf(".");return e===-1||e===t.length-1?{name:t,extension:void 0}:{name:t.slice(0,e),extension:t.slice(e+1)}}const W0={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function KT(t){var n;if(t.type)return t.type;const e=t.name?(n=WT(t.name).extension)==null?void 0:n.toLowerCase():null;return e&&e in W0?W0[e]:"application/octet-stream"}function rne(t){return t.charCodeAt(0).toString(32)}function K0(t){let e="";return t.replace(/[^A-Z0-9]/gi,n=>(e+=`-${rne(n)}`,"/"))+e}function ine(t,e){var r;let n=e||"uppy";return typeof t.name=="string"&&(n+=`-${K0(t.name.toLowerCase())}`),t.type!==void 0&&(n+=`-${t.type}`),t.meta&&typeof t.meta.relativePath=="string"&&(n+=`-${K0(t.meta.relativePath.toLowerCase())}`),((r=t.data)==null?void 0:r.size)!==void 0&&(n+=`-${t.data.size}`),t.data.lastModified!==void 0&&(n+=`-${t.data.lastModified}`),n}function sne(t){return!t.isRemote||!t.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(t.remote.provider)}function one(t,e){if(sne(t))return t.id;const n=KT(t);return ine({...t,type:n},e)}function q0(t,e){return t===!0?Object.keys(e):Array.isArray(t)?t:[]}function hh(t){return t<10?`0${t}`:t.toString()}function su(){const t=new Date,e=hh(t.getHours()),n=hh(t.getMinutes()),r=hh(t.getSeconds());return`${e}:${n}:${r}`}function ane(t){return t?t.readyState===4&&t.status===0:!1}var qr,Tr,Gr,bi,ei,qp,Ka;class lne{constructor(e){_t(this,ei);_t(this,qr,[]);_t(this,Tr,0);_t(this,Gr);_t(this,bi,!1);const n=e==null?void 0:e.concurrency;mn(this,Gr,typeof n!="number"||n===0?1/0:n)}add(e){const n=new AbortController;let r,i;const s=new Promise((a,l)=>{r=a,i=l}),o={run:()=>e(n.signal),resolve:r,reject:i,controller:n};return n.signal.addEventListener("abort",()=>{const a=ve(this,qr).indexOf(o);a!==-1&&(ve(this,qr).splice(a,1),i(n.signal.reason??new DOMException("Aborted","AbortError")))},{once:!0}),s.abort=a=>{n.abort(a??new DOMException("Aborted","AbortError"))},s.abortOn=a=>
173{if(a){const l=()=>s.abort(a.reason);a.addEventListener("abort",l,{once:!0}),s.then(()=>a.removeEventListener("abort",l),()=>a.removeEventListener("abort",l))}return s},!ve(this,bi)&&ve(this,Tr)<ve(this,Gr)?tt(this,ei,qp).call(this,o):ve(this,qr).push(o),s}pause(){mn(this,bi,!0)}resume(){mn(this,bi,!1);const e=ve(this,Gr)-ve(this,Tr);for(let n=0;n<e;n++)tt(this,ei,Ka).call(this)}clear(e){const n=ve(this,qr).splice(0),r=e??new DOMException("Cleared","AbortError");for(const i of n)i.controller.abort(r),i.reject(r)}get concurrency(){return ve(this,Gr)}set concurrency(e){if(mn(this,Gr,typeof e!="number"||e===0?1/0:e),!ve(this,bi)){const n=ve(this,Gr)-ve(this,Tr);for(let r=0;r<n;r++)tt(this,ei,Ka).call(this)}}get pending(){return ve(this,qr).length}get running(){return ve(this,Tr)}get isPaused(){return ve(this,bi)}wrapPromiseFunction(e){return(...n)=>this.add(r=>e(...n))}}qr=new WeakMap,Tr=new WeakMap,Gr=new WeakMap,bi=new WeakMap,ei=new WeakSet,qp=function(e){if(pc(this,Tr)._++,e.controller.signal.aborted){pc(this,Tr)._--,e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")),tt(this,ei,Ka).call(this);return}let n;try{n=e.run()}catch(r){n=Promise.reject(r)}n.then(r=>{e.controller.signal.aborted?e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")):e.resolve(r)},r=>{e.reject(r)}).finally(()=>{pc(this,Tr)._--,tt(this,ei,Ka).call(this)})},Ka=function(){queueMicrotask(()=>{if(!(ve(this,bi)||ve(this,Tr)>=ve(this,Gr)))for(;ve(this,qr).length>0;){const e=ve(this,qr).shift();if(!e.controller.signal.aborted){tt(this,ei,qp).call(this,e);return}}})};function cne(t,e,n){const r=[];return t.forEach(i=>
173{if(typeof i!="string"){r.push(i);return}e[Symbol.split](i).forEach((s,o,a)=>{s!==""&&r.push(s),o<a.length-1&&r.push(n)})}),r}/** 174 * Takes a string with placeholder variables like `%{smart_count} file selected` 175 * and replaces it with values from options `{smart_count: 5}` 176 * 177 * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE 178 * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299 179 * 180 * @param phrase that needs interpolation, with placeholders 181 * @param options with values that will be used to replace placeholders 182 */function G0(t,e){const n=/\$/g,r="$$$$";let i=[t];if(e==null)return i;for(const s of Object.keys(e))if(s!=="_"){let o=e[s];typeof o=="string"&&(o=n[Symbol.replace](o,r)),i=cne(i,new RegExp(`%\\{${s}\\}`,"g"),o)}return i}const une=t=>{throw new Error(`missing string: ${t}`)};var Vl,zl,Gp;class qT{constructor(e,{onMissingKey:n=une}={}){_t(this,zl);te(this,"locale");_t(this,Vl);this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(e)?e.forEach(tt(this,zl,Gp),this):tt(this,zl,Gp).call(this,e),mn(this,Vl,n)}translate(e,n){return this.translateArray(e,n).join("")}translateArray(e,n){let r=this.locale.strings[e];if(r==null&&(ve(this,Vl).call(this,e),r=e),typeof r=="object"){if(n&&typeof n.smart_count<"u"){const s=this.locale.pluralize(n.smart_count);return G0(r[s],n)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return G0(r,n)}}Vl=new WeakMap,zl=new WeakSet,Gp=function(e){if(!(e!=null&&e.strings))return;const n=this.locale;Object.assign(this.locale,{strings:{...n.strings,...e.strings},pluralize:e.pluralize||n.pluralize})};class dne{constructor(e,n){te(this,"uppy");te(this,"opts");te(this,"id");te(this,"defaultLocale");te(this,"i18n");te(this,"i18nArray");te(this,"type");te(this,"VERSION");this.uppy=e,this.opts=n??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return(e==null?void 0:e[this.id])||{}}setPluginState(e){const{plugins:n}=this.uppy.getState();this.uppy.setState({plugins:{...n,[this.id]:{...n[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new qT([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}var Yr,Wl;class fne{constructor(e){_t(this,Yr);_t(this,Wl,[]);mn(this,Yr,e)}on(e,n){return ve(this,Wl).push([e,n]),ve(this,Yr).on(e,n)}remove(){for(const[e,n]of ve(this,Wl).splice(0))ve(this,Yr).off(e,n)}onFilePause(e,n){this.on("upload-pause",(r,i)=>{e===(r==null?void 0:r.id)&&n(i)})}onFileRemove(e,n){this.on("file-removed",r=>{e===r.id&&n(r.id)})}onPause(e,n){this.on("upload-pause",(r,i)=>{e===(r==null?void 0:r.id)&&n(i)})}onRetry(e,n){this.on("upload-retry",r=>{e===(r==null?void 0:r.id)&&n()})}onRetryAll(e,n){this.on("retry-all",()=>{ve(this,Yr).getFile(e)&&n()})}onPauseAll(e,n){this.on("pause-all",()=>{ve(this,Yr).getFile(e)&&n()})}onCancelAll(e,n){this.on("cancel-all",(...r)=>{ve(this,Yr).getFile(e)&&n(...r)})}onResumeAll(e,n){this.on("resume-all",()=>{ve(this,Yr).getFile(e)&&n()})}}Yr=new WeakMap,Wl=new WeakMap;const hne={debug:()=>{},warn:()=>{},error:(...t)=>console.error(`[Uppy] [${su()}]`,...t)},pne={debug:(...t)=>console.debug(`[Uppy] [${su()}]`,...t),warn:(...t)=>console.warn(`[Uppy] [${su()}]`,...t),error:(...t)=>console.error(`[Uppy] [${su()}]`,...t)},Y0=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];function Uc(t,e){if(typeof t!="number"||Number.isNaN(t))throw new TypeError(`Expected a number, got ${typeof t}`);const n=t<0;let r=Math.abs(t);if(n&&(r=-r),r===0)return"0 B";const i=Math.min(Math.floor(Math.log(r)/Math.log(1024)),Y0.length-1),s=Number(r/1024**i),o=Y0[i];return i>=3?s%1===0?`${Math.round(s)} ${o}`:`${s.toFixed(2)} ${o}`:`${s>=10||s%1===0?Math.round(s):s.toFixed(1)} ${o}`}function GT(t,e){this.text=t=t||"",this.hasWild=~t.indexOf("*"),this.separator=e,this.parts=t.split(e)}GT.prototype.match=function(t){var e=!0,n=this.parts,r,i=n.length,s;if(typeof t=="string"||t instanceof String)if(!this.hasWild&&this.text!=t)e=!1;else{for(s=(t||"").split(this.separator),r=0;e&&r<i;r++)n[r]!=="*"&&(r<s.length?e=n[r]===s[r]:e=!1);e=e&&s}else if(typeof t.splice=="function")for(e=[],r=t.length;r--;)this.match(t[r])&&(e[e.length]=t[r]);else if(typeof t=="object"){e={};for(var o in t)this.match(o)&&(e[o]=t[o])}return e};var mne=function(t,e,n){var r=new GT(t,n||/[\/\.]/);return typeof e<"u"?r.match(e):r},gne=mne,vne=/[\/\+\.]/,yne=function(t,e){function n(r){var i=gne(r,t,vne);return i&&i.length>=2}return e?n(e.split(";")[0]):n};const bne=wn(yne),kne={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};
182class Or extends Error{constructor(n,r){super(n);te(this,"isUserFacing");te(this,"file");te(this,"isRestriction",!0);this.isUserFacing=(r==null?void 0:r.isUserFacing)??!0,r!=null&&r.file&&(this.file=r.file)}}class wne{constructor(e,n){te(this,"getI18n");te(this,"getOpts");this.getI18n=n,this.getOpts=()=>{var i;const r=e();if(((i=r.restrictions)==null?void 0:i.allowedFileTypes)!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(e,n){const{maxTotalFileSize:r,maxNumberOfFiles:i}=this.getOpts().restrictions;if(i&&e.filter(o=>!o.isGhost).length+n.length>i)throw new Or(`${this.getI18n()("youCanOnlyUploadX",{smart_count:i})}`);if(r){const s=[...e,...n].reduce((o,a)=>o+(a.size??0),0);if(s>r)throw new Or(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Uc(r),size:Uc(s)}))}}validateSingleFile(e){const{maxFileSize:n,minFileSize:r,allowedFileTypes:i}=this.getOpts().restrictions;if(i&&!i.some(o=>o.includes("/")?e.type?bne(e.type.replace(/;.*?$/,""),o):!1:o[0]==="."&&e.extension?e.extension.toLowerCase()===o.slice(1).toLowerCase():!1)){const o=i.join(", ");throw new Or(this.getI18n()("youCanOnlyUploadFileTypes",{types:o}),{file:e})}if(n&&e.size!=null&&e.size>n)throw new Or(this.getI18n()("exceedsSize",{size:Uc(n),file:e.name??this.getI18n()("unnamed")}),{file:e});if(r&&e.size!=null&&e.size<r)throw new Or(this.getI18n()("inferiorSize",{size:Uc(r)}),{file:e})}validate(e,n){n.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,n)}validateMinNumberOfFiles(e){const{minNumberOfFiles:n}=this.getOpts().restrictions;if(n&&Object.keys(e).length<n)throw new Or(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:n}))}getMissingRequiredMetaFields(e){const n=new Or(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:r}=this.getOpts().restrictions,i=[];for(const s of r)(!Object.hasOwn(e.meta,s)||e.meta[s]==="")&&i.push(s);return{missingFields:i,error:n}}}var xne=function(){var e={},n=e._fns={};e.emit=function(o,a,l,c,u,d,f){var p=r(o);p.length&&i(o,p,[a,l,c,u,d,f])},e.on=function(o,a){n[o]||(n[o]=[]),n[o].push(a)},e.once=function(o,a){function l(){a.apply(this,arguments),e.off(o,l)}this.on(o,l)},e.off=function(o,a){var l=[];if(o&&a){var c=this._fns[o],u=0,d=c?c.length:0;for(u;u<d;u++)c[u]!==a&&l.push(c[u])}l.length?this._fns[o]=l:delete this._fns[o]};function r(s){var o=n[s]?n[s]:[],a=s.indexOf(":"),l=a===-1?[s]:[s.substring(0,a),s.substring(a+1)],c=Object.keys(n),u=0,d=c.length;for(u;u<d;u++){var f=c[u];if(f==="*"&&(o=o.concat(n[f])),l.length===2&&l[0]===f){o=o.concat(n[f]);break}}return o}function i(s,o,a){var l=0,c=o.length;for(l;l<c&&o[l];l++)o[l].event=s,o[l].apply(o[l],a)}return e};const Sne=wn(xne);let Tne="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",_ne=(t=21)=>{let e="",n=t|0;for(;n-- >0;)e+=Tne[Math.random()*64|0];return e};const Ene="6.0.0",YT={version:Ene};function Cne(t,e){return e.name?e.name:t.split("/")[0]==="image"?`${t.split("/")[0]}.${t.split("/")[1]}`:"noname"}const One={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};var Vo,hd,JT;class XT{constructor(){_t(this,hd);te(this,"state",{});_t(this,Vo,new Set)}getState(){return this.state}setState(e){const n={...this.state},r={...this.state,...e};this.state=r,tt(this,hd,JT).call(this,n,r,e)}subscribe(e){return ve(this,Vo).add(e),()=>{ve(this,Vo).delete(e)}}}Vo=new WeakMap,hd=new WeakSet,JT=function(...e){ve(this,Vo).forEac
182h(n=>{n(...e)})},te(XT,"VERSION",YT.version);function Ane(t){if(t==null&&typeof navigator<"u"&&(t=navigator.userAgent),!t)return!0;const e=/Edge\/(\d+\.\d+)/.exec(t);if(!e)return!0;const r=e[1].split(".",2),i=parseInt(r[0],10),s=parseInt(r[1],10);return i<15||i===15&&s<15063||i>18||i===18&&s>=18218}const Vc={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var _r,Er,Kl,Hs,zo,Wo,Us,Qe,Ms,Xp,QT,ZT,e_,Jp,Qp,Zp,em,pd,tm,Vs,t_,n_,Gi,ql,qa,r_,nm,Ga;const md=class md{constructor(e){_t(this,Qe);_t(this,_r,Object.create(null));_t(this,Er);_t(this,Kl);_t(this,Hs,Sne());_t(this,zo,new Set);_t(this,Wo,new Set);_t(this,Us,new Set);te(this,"defaultLocale");te(this,"locale");te(this,"opts");te(this,"store");te(this,"i18n");te(this,"i18nArray");te(this,"scheduledAutoProceed",null);te(this,"wasOffline",!1);_t(this,pd,(e,n)=>{const r=e?this.getFile(e.id):void 0;if(e==null||!r){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}if(r.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);return}const i={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};r.progress.uploadStarted!=null?this.setFileState(e.id,{progress:{...r.progress,...i,bytesUploaded:n.bytesUploaded}}):this.setFileState(e.id,{progress:{...r.progress,...i}}),ve(this,Vs).call(this)});_t(this,Vs,Jr(()=>tt(this,Qe,tm).call(this),500,{leading:!0,trailing:!0}));_t(this,Gi,this.updateOnlineStatus.bind(this));_t(this,ql,new Map);this.defaultLocale=One;const n={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:kne,meta:{},onBeforeFileAdded:(i,s)=>!Object.hasOwn(s,i.id),onBeforeUpload:i=>i,store:new XT,logger:hne,infoTimeout:5e3},r={...n,...e};this.opts={...r,restrictions:{...n.restrictions,...e==null?void 0:e.restrictions}},e!=null&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e!=null&&e.debug&&(this.opts.logger=pne),this.log(`Using Core v${md.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Vc,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Ane(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),mn(this,Er,new wne(()=>this.opts,()=>this.i18n)),mn(this,Kl,this.store.subscribe((i,s,o)=>{this.emit("state-update",i,s,o),this.updateAll(s)})),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),tt(this,Qe,n_).call(this)}emit(e,...n){ve(this,Hs).emit(e,...n)}on(e,n){return ve(this,Hs).on(e,n),this}once(e,n){return ve(this,Hs).once(e,n),this}off(e,n){return ve(this,Hs).off(e,n),this}updateAll(e){this.iteratePlugins(n=>{n.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const n=this.getState().files;this.setState({files:{...n,...Object.fromEntries(Object.entries(e).map(([r,i])=>[r,{...n[r],...i}]))}})}setFileState(e,n){if(!this.getState().files[e])throw new Error(`Canât set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:n})}i18nInit(){const e=r=>this.log(`Missing i18n string: ${r}`,"error"),n=new qT([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=n.translate.bind(n),this.i18nArray=n.translateArray.bind(n),this.locale=n.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e==null?void 0:e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(n=>{n.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},n={...this.getState().files},r=Object.create(null);Object.keys(n).forEach(i=>{r[i]={...n[i],progress:{...n[i].progress,...e},tus:void 0,transloadit:void 0,s3Multipart:void 0}}),this.setState({files:r,...Vc})}clear(){const{capabilities:e,currentUploads:n}=this.getState();if(Object.keys(n).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Vc,files:{}})}addPreProcessor(e){ve(this,zo).add(e)}removePreProcessor(e){return ve(this,zo).delete(e)}addPostProcessor(e){ve(this,Us).add(e)}removePostProcessor(e){return ve(this,Us).delete(e)}addUploader(e){ve(this,Wo).add(e)}removeUploader(e){return ve(this,Wo).delete(e)}
182setMeta(e){const n={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(i=>{r[i]={...r[i],meta:{...r[i].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:n,files:r})}setFileMeta(e,n){const r={...this.getState().files};if(!r[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const i={...r[e].meta,...n};r[e]={...r[e],meta:i},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(n=>this.getFile(n))}getObjectOfFilesPerState(){const{files:e,totalProgress:n,error:r}=this.getState(),i=Object.values(e),s=[],o=[],a=[],l=[],c=[],u=[],d=[],f=[],p=[];for(const h of i){const{progress:g}=h;!g.uploadComplete&&g.uploadStarted&&(s.push(h),h.isPaused||f.push(h)),g.uploadStarted||o.push(h),(g.uploadStarted||g.preprocess||g.postprocess)&&a.push(h),g.uploadStarted&&l.push(h),h.isPaused&&c.push(h),g.uploadComplete&&u.push(h),h.error&&d.push(h),(g.preprocess||g.postprocess)&&p.push(h)}return{newFiles:o,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:u,erroredFiles:d,inProgressFiles:s,inProgressNotPausedFiles:f,processingFiles:p,isUploadStarted:l.length>0,isAllComplete:n===100&&u.length===i.length&&p.length===0,isAllErrored:!!r&&d.length===i.length,isAllPaused:s.length!==0&&c.length===s.length,isUploadInProgress:s.length>0,isSomeGhost:i.some(h=>h.isGhost)}}validateRestrictions(e,n=this.getFiles()){try{ve(this,Er).validate(n,[e])}catch(r){return r}return null}validateSingleFile(e){try{ve(this,Er).validateSingleFile(e)}catch(n){return n.message}return null}validateAggregateRestrictions(e){const n=this.getFiles();try{ve(this,Er).validateAggregateRestrictions(n,e)}catch(r){return r.message}return null}checkIfFileAlreadyExists(e){const{files:n}=this.getState();return!!(n[e]&&!n[e].isGhost)}addFile(e){const{nextFilesState:n,validFilesToAdd:r,errors:i}=tt(this,Qe,Qp).call(this,[e]),s=i.filter(a=>a.isRestriction);if(tt(this,Qe,Ms).call(this,s),i.length>0)throw i[0];this.setState({files:n});const[o]=r;return this.emit("file-added",o),this.emit("files-added",r),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),tt(this,Qe,Jp).call(this),o.id}addFiles(e){const{nextFilesState:n,validFilesToAdd:r,errors:i}=tt(this,Qe,Qp).call(this,e),s=i.filter(a=>a.isRestriction);tt(this,Qe,Ms).call(this,s);const o=i.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files: 183`;if(o.forEach(l=>{a+=` 184 * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(o,a);{const l=new Error(a);throw l.errors=o,l}}this.setState({files:n}),r.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(a=>{this.log(`Added file: ${a.name} 185 id: ${a.id} 186 type: ${a.type}`)}),r.length>0&&tt(this,Qe,Jp).call(this)}removeFiles(e){const{files:n,currentUploads:r}=this.getState(),i={...n},s={...r},o=Object.create(null);e.forEach(u=>{n[u]&&(o[u]=n[u],delete i[u])});function a(u){return o[u]===void 0}Object.keys(s).forEach(u=>{const d=r[u].fileIDs.filter(a);if(d.length===0){delete s[u];return}const{capabilities:f}=this.getState();if(d.length!==r[u].fileIDs.length&&!f.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");s[u]={...r[u],fileIDs:d}});const l={currentUploads:s,files:i};Object.keys(i).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),ve(this,Vs).call(this);const c=Object.keys(o);c.forEach(u=>{this.emit("file-removed",o[u])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const n=this.getFile(e),i=!(n.isPaused||!1);return this.setFileState(e,{isPaused:i}
186),this.emit("upload-pause",n,i),i}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{const i={...e[r],isPaused:!0};e[r]=i}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{const i={...e[r],isPaused:!1,error:null};e[r]=i}),this.setState({files:e}),this.emit("resume-all")}async retryAll(){const e=await tt(this,Qe,em).call(this);return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),n=Object.keys(e);n.length&&this.removeFiles(n),this.setState(Vc)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const n=tt(this,Qe,qa).call(this,[e],{forceAllowNewUpload:!0});return tt(this,Qe,Ga).call(this,n)}logout(){this.iteratePlugins(e=>{var n,r;(r=(n=e.provider)==null?void 0:n.logout)==null||r.call(n)})}[Symbol.for("uppy test: updateTotalProgress")](){return tt(this,Qe,tm).call(this)}updateOnlineStatus(){window.navigator.onLine??!0?(this.emit("is-online"),this.wasOffline&&(this.emit
186("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,...n){if(typeof e!="function"){const o=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(o)}const r=new e(this,...n),i=r.id;if(!i)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");const s=this.getPlugin(i);if(s){const o=`Already found a plugin named '${s.id}'. Tried to use: '${i}'. 187Uppy plugins must have unique \`id\` options.`;throw new Error(o)}return e.VERSION&&this.log(`Using ${i} v${e.VERSION}`),r.type in ve(this,_r)?ve(this,_r)[r.type].push(r):ve(this,_r)[r.type]=[r],r.install(),this.emit("plugin-added",r),this}getPlugin(e){for(const n of Object.values(ve(this,_r))){const r=n.find(i=>i.id===e);if(r!=null)return r}}[Symbol.for("uppy test: getPlugins")](e){return ve(this,_r)[e]}iteratePlugins(e){Object.values(ve(this,_r)).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const n=ve(this,_r)[e.type],r=n.findIndex(o=>o.id===e.id);r!==-1&&n.splice(r,1);const s={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(s)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),ve(this,Kl).call(this),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",ve(this,Gi)),window.removeEventListener("offline",ve(this,Gi)))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,n="info",r=3e3){const i=typeof e=="object";this.setState({info:[...this.getState().info,{type:n,message:i?e.message:e,details:i?e.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(e,n){const{logger:r}=this.opts;switch(n){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e);break}}registerRequestClient(e,n){ve(this,ql).set(e,n)}
187getRequestClientForFile(e){if(!("remote"in e&&e.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const n=ve(this,ql).get(e.remote.requestClientId);if(n==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return n}async restore(e){this.log(`Core: Running restored upload "${e}"`);const n=await tt(this,Qe,Ga).call(this,e);return this.emit("complete",n),n}[Symbol.for("uppy test: createUpload")](...e){return tt(this,Qe,qa).call(this,...e)}addResultData(e,n){if(!tt(this,Qe,r_).call(this,e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:r}=this.getState(),i={...r[e],result:{...r[e].result,...n}};this.setState({currentUploads:{...r,[e]:i}})}async upload(){var i;(i=ve(this,_r).uploader)!=null&&i.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(tt(this,Qe,Zp).call(this).length>0){const s=await tt(this,Qe,em).call(this);if(!(this.getFiles().filter(a=>a.progress.uploadStarted==null).length>0))return this.emit("complete",s),s;({files:e}=this.getState())}const r=this.opts.onBeforeUpload(e);if(r===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");r&&typeof r=="object"&&(e=r,this.setState({files:e}));try{if(ve(this,Er).validateMinNumberOfFiles(e),!tt(this,Qe,QT).call(this,e))throw new Or(this.i18n("missingRequiredMetaField"));const{currentUploads:s}=this.getState(),o=Object.values(s).flatMap(u=>u.fileIDs),a=Object.keys(e).filter(u=>{const d=this.getFile(u);return d&&!d.progress.uploadStarted&&!o.includes(u)}),l=tt(this,Qe,qa).call(this,a),c=await tt(this,Qe,Ga).call(this,l);return this.emit("complete",c),c}catch(s){throw tt(this,Qe,Ms).call(this,[s]),s}}};_r=new WeakMap,Er=new WeakMap,Kl=new WeakMap,Hs=new WeakMap,zo=new WeakMap,Wo=new WeakMap,Us=new WeakMap,Qe=new WeakSet,Ms=function(e){for(const o of e)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");const n=e.filter(o=>o.isUserFacing),r=4,i=n.slice(0,r),s=n.slice(r);i.forEach(({message:o,details:a=""})=>{this.info({message:o,details:a},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})},Xp=function(e){const{missingFields:n,error:r}=ve(this,Er).getMissingRequiredMetaFields(e);return n.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:n,error:r.message}),this.log(r.message),this.emit("restriction-failed",e,r),!1):(n.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)},QT=function(e){let n=!0;for(const r of Object.values(e))tt(this,Qe,Xp).call(this,r)||(n=!1);return n},ZT=function(e){const{allowNewUpload:n}=this.getState();if(n===!1){const r=new Or(this.i18n("noMoreFilesAllowed"),{file:e});throw tt(this,Qe,Ms).call(this,[r]),r}},e_=function(e){const n=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,r=KT(n),i=Cne(r,n),s=WT(i).extension,o=one(n,this.getID()),a={...n.meta,name:i,type:r},l=Number.isFinite(n.data.size)?n.data.size:null;return{source:n.source||"",id:o,name:i,extension:s||"",meta:{...this.getState().meta,...a},type:r,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,...n.isRemote?{isRemote:!0,remote:n.remote,data:n.data}:{isRemote:!1,data:n.data},preview:n.preview}},Jp=function(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))},Qp=function(e){let{files:n}=this.getState(),r={...n};const i=[],s=[];for(const o of e)try{let a=tt(this,Qe,e_).call(this,o);tt(this,Qe,ZT).call(this,a);const l=n[a.id],c=l==null?void 0:l.isGhost;if(c&&!a.isRemote){if(a.data==null)throw new Error("File data is missing");a={...l,isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${a.name}, ${a.id}`)}const u=this.opts.onBeforeFileAdded(a,r);if(n=this.getState().files,r={...n,...r},!u&&this.checkIfFileAlreadyExists(a.id))throw new Or(this.i18n("noDuplicates",{fileName:a.name??this.i18n("unnamed")}),{file:a});if(u===!1&&!c)throw new Or("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof u=="object"&&u!==null&&(a=u),ve(this,Er).validateSingleFile(a),r[a.id]=a,i.push(a)}catch(a){s.push(a)}try{ve(this,Er).validateAggregateRestrictions(Object.values(n),i)}catch(o){return s.push(o),{nextFilesState:n,validFilesToAdd:[],errors:s}}return{nextFilesState:r,validFilesToAdd:i,errors:s}},Zp=function(){const{files:e}=this.getState();return Object.keys(e).filter(n=>{const r=e[n];return r.error&&(!r.missingRequiredMetaFields||r.missingRequiredMetaFields.length===0)})},em=async function(){const e=tt(this,Qe,Zp).call(this),n={...this.get
187State().files};if(e.forEach(i=>{n[i]={...n[i],isPaused:!1,error:null}}),this.setState({files:n,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const r=tt(this,Qe,qa).call(this,e,{forceAllowNewUpload:!0});return tt(this,Qe,Ga).call(this,r)},pd=new WeakMap,tm=function(){const e=tt(this,Qe,t_).call(this);let n=null;e!=null&&(n=Math.round(e*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",n??0),this.setState({totalProgress:n??0})},Vs=new WeakMap,t_=function(){const n=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(n.length===0)return 0;if(n.every(l=>l.progress.uploadComplete))return 1;const r=l=>l.progress.bytesTotal!=null&&l.progress.bytesTotal!==0,i=n.filter(r),s=n.filter(l=>!r(l));if(i.every(l=>l.progress.uploadComplete)&&s.length>0&&!s.every(l=>l.progress.uploadComplete))return null;const o=i.reduce((l,c)=>l+(c.progress.bytesTotal??0),0),a=i.reduce((l,c)=>l+(c.progress.bytesUploaded||0),0);return o===0?0:a/o},n_=function(){const e=(i,s,o)=>{let a=i.message||"Unknown error";i.details&&(a+=` ${i.details}`),this.setState({error:a}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:a,response:o})};this.on("error",e),this.on("upload-error",(i,s,o)=>{if(e(s,i,o),typeof s=="object"&&s.message){this.log(s.message,"error");const a=new Error(this.i18n("failedToUpload",{file:(i==null?void 0:i.name)??""}));a.isUserFacing=!0,a.details=s.message,s.details&&(a.details+=` ${s.details}`),tt(this,Qe,Ms).call(this,[a])}else tt(this,Qe,Ms).call(this,[s])});let n=null;this.on("upload-stalled",(i,s)=>{const{message:o}=i,a=s.map(l=>l.meta.name).join(", ");n||(this.info({message:o,details:a},"warning",this.opts.infoTimeout),n=setTimeout(()=>{n=null},this.opts.infoTimeout)),this.log(`${o} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const r=i=>{const s=i.filter(a=>{const l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`),l}),o=Object.fromEntries(s.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(o)};this.on("upload-start",r),this.on("upload-progress",ve(this,pd)),this.on("upload-success",(i,s)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i==null?void 0:i.id}`);return}const o=this.getFile(i.id).progress,a=ve(this,Us).size>0;this.setFileState(i.id,{progress:{...o,postprocess:a?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!a&&{complete:!0},percentage:100,bytesUploaded:o.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),i.size==null&&this.setFileState(i.id,{size:s.bytesUploaded||o.bytesTotal}),ve(this,Vs).call(this)}),this.on("preprocess-progress",(i,s)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i==null?void 0:i.id}`);return}this.setFileState(i.id,{progress:{...this.getFile(i.id).progress,preprocess:s}})}),this.on("preprocess-complete",i=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i==null?void 0:i.id}`);return}const s={...this.getState().files};s[i.id]={...s[i.id],progress:{...s[i.id].progress}},delete s[i.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(i,s)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i==null?void 0:i.id}`);return}this.setFileState(i.id,{progress:{...this.getState().files[i.id].progress,postprocess:s}})}),this.on("postprocess-complete",i=>{const s=i&&this.getFile(i.id);if(s==null){this.log(`Not setting progress for a file that has been removed: ${i==null?void 0:i.id}`);return}const{postprocess:o,...a}=s.progress;this.patchFilesState({[s.id]:{progress:{...a,complete:!0}}})}),this.on("restored",()=>{ve(this,Vs).call(this)}),this.on("dashboard:file-edit-complete",i=>{i&&tt(this,Qe,Xp).call(this,i)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",ve(this,Gi)),window.addEventListener("offline",ve(this,Gi)),setTimeout(ve(this,Gi),3e3))},Gi=new WeakMap,ql=new WeakMap,qa=function(e,n={}){const{forceAllowNewUpload:r=!1}=n,{allowNewUpload:i,currentUploads:s}=this.getState();if(!i&&!r)throw new Error("Cannot create a new upload: already uploading.");const o=_ne();
187return this.emit("upload",o,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[o]:{fileIDs:e,step:0,result:{}}}}),o},r_=function(e){const{currentUploads:n}=this.getState();return n[e]},nm=function(e){const{[e]:n,...r}=this.getState().currentUploads;this.setState({currentUploads:r})},Ga=async function(e){const n=()=>{const{currentUploads:o}=this.getState();return o[e]};let r=n();if(!r)throw new Error("Nonexistent upload");const i=[...ve(this,zo),...ve(this,Wo),...ve(this,Us)];try{for(let o=r.step||0;o<i.length;o++){const a=i[o];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...r,step:o}}});const{fileIDs:l}=r;if(await a(l,e),r=n(),!r)break}}catch(o){throw tt(this,Qe,nm).call(this,e),o}if(r){r.fileIDs.forEach(c=>{const u=this.getFile(c);u!=null&&u.progress.postprocess&&this.emit("postprocess-complete",u)});const o=r.fileIDs.map(c=>this.getFile(c)),a=o.filter(c=>!c.error),l=o.filter(c=>c.error);this.addResultData(e,{successful:a,failed:l,uploadID:e}),r=n()}let s;return r&&(s=r.result,tt(this,Qe,nm).call(this,e)),s==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),s={successful:[],failed:[],uploadID:e}),s},te(md,"VERSION",YT.version);let Yp=md;const Mne="6.0.0",Ine={version:Mne},Lne={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Pne(t,e){let n=e;return n||(n=new Error("Upload error")),typeof n=="string"&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),ane(t)?(n=new Kp(n,t),n):(n.request=t,n)}function X0(t){return t.data.slice(0,t.data.size,t.meta.type)}const Rne={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};var Ko,zs,ci,s_,o_,a_,l_,Gl;class i_ extends dne{constructor(n,r){super(n,{...Rne,fieldName:r.bundle?"files[]":"file",...r});_t(this,ci);_t(this,Ko);_t(this,zs);te(this,"uploaderEvents");_t(this,Gl,async n=>{if(n.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const r=this.uppy.getFilesByIds(n),i=tne(r),s=nne(i);if(this.uppy.emit("upload-start",s),this.opts.bundle){if(i.some(a=>a.isRemote))throw new Error("Canât upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await tt(this,ci,o_).call(this,i)}else await tt(this,ci,l_).call(this,i)});if(this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=Lne,this.i18nInit(),mn(this,zs,new lne({concurrency:this.opts.limit})),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if((r==null?void 0:r.allowedMetaFields)===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),mn(this,Ko,i=>async(s,o)=>{var a,l;try{const c=await Qte(s,{...o,onBeforeRequest:(f,p)=>{var h,g;return(g=(h=this.opts).onBeforeRequest)==null?void 0:g.call(h,f,p,i)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:f=>{const p=Math.ceil(f/1e3),h=new Error(this.i18n("uploadStalled",{seconds:p}));this.uppy.emit("upload-stalled",h,i)},onUploadProgress:f=>{if(f.lengthComputable)for(const{id:p}of i){const h=this.uppy.getFile(p);h!=null&&this.uppy.emit("upload-progress",h,{uploadStarted:h.progress.uploadStarted??0,bytesUploaded:f.loaded/f.total*h.size,bytesTotal:h.size})}}});
187let u=await((l=(a=this.opts).getResponseData)==null?void 0:l.call(a,c));if(c.responseType==="json")u??(u=c.response);else try{u??(u=JSON.parse(c.responseText))}catch(f){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:f})}const d=typeof(u==null?void 0:u.url)=="string"?u.url:void 0;for(const{id:f}of i)this.uppy.emit("upload-success",this.uppy.getFile(f),{status:c.status,body:u,uploadURL:d});return c}catch(c){if(c.name==="AbortError")return;const u=c.request;for(const d of i)this.uppy.emit("upload-error",this.uppy.getFile(d.id),Pne(u,c),u);throw c}})}getOptions(n){const r=this.uppy.getState().xhrUpload,{headers:i}=this.opts,s={...this.opts,...r||{},...n.xhrUpload||{},headers:{}};return typeof i=="function"?s.headers=i(n):Object.assign(s.headers,this.opts.headers),r&&Object.assign(s.headers,r.headers),n.xhrUpload&&Object.assign(s.headers,n.xhrUpload.headers),s}addMetadata(n,r,i){q0(i.allowedMetaFields,r).forEach(o=>{const a=r[o];Array.isArray(a)?a.forEach(l=>{n.append(o,l)}):n.append(o,a)})}createFormDataUpload(n,r){const i=new FormData;this.addMetadata(i,n.meta,r);const s=X0(n);return n.name?i.append(r.fieldName,s,n.meta.name):i.append(r.fieldName,s),i}createBundledUpload(n,r){const i=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(i,s,r),n.forEach(o=>{const a=this.getOptions(o),l=X0(o);o.name?i.append(a.fieldName,l,o.name):i.append(a.fieldName,l)}),i}install(){if(this.opts.bundle){const{capabilities:n}=this.uppy.getState();this.uppy.setState({capabilities:{...n,individualCancellation:!1}})}this.uppy.addUploader(ve(this,Gl))}uninstall(){if(this.opts.bundle){const{capabilities:n}=this.uppy.getState();this.uppy.setState({capabilities:{...n,individualCancellation:!0}})}this.uppy.removeUploader(ve(this,Gl))}}Ko=new WeakMap,zs=new WeakMap,ci=new WeakSet,s_=async function(n){const r=new fne(this.uppy),i=new AbortController;r.onFileRemove(n.id,()=>i.abort()),r.onCancelAll(n.id,()=>i.abort());try{await ve(this,zs).add(async s=>{const o=this.getOptions(n),a=ve(this,Ko).call(this,[n]),l=o.formData?this.createFormDataUpload(n,o):n.data,c=typeof o.endpoint=="string"?o.endpoint:await o.endpoint(n);return a(c,{...o,body:l,signal:AbortSignal.any([s,i.signal])})})}catch(s){if(s.name==="AbortError")return;throw s}finally{r.remove()}},o_=async function(n){const r=new AbortController;function i(){r.abort()}this.uppy.once("cancel-all",i);try{await ve(this,zs).add(async s=>{const o=this.uppy.getState().xhrUpload??{},a=ve(this,Ko).call(this,n),l=this.createBundledUpload(n,{...this.opts,...o}),c=typeof this.opts.endpoint=="string"?this.opts.endpoint:await this.opts.endpoint(n);return a(c,{...this.opts,body:l,signal:AbortSignal.any([s,r.signal])})})}catch(s){if(s.name==="AbortError")return;throw s}finally{this.uppy.off("cancel-all",i)}},a_=function(n){var s;const r=this.getOptions(n),i=q0(r.allowedMetaFields,n.meta);return{...(s=n.remote)==null?void 0:s.body,protocol:"multipart",endpoint:r.endpoint,size:n.data.size,fieldname:r.fieldName,metadata:Object.fromEntries(i.map(o=>[o,n.meta[o]])),httpMethod:r.method,useFormData:r.formData,headers:r.headers}},l_=async function(n){await Promise.allSettled(n.map(r=>{if(r.isRemote){const i=()=>ve(this,zs),s=new AbortController,o=a=>{a.id===r.id&&s.abort()};
187return this.uppy.on("file-removed",o),this.uppy.getRequestClientForFile(r).uploadRemoteFile(r,tt(this,ci,a_).call(this,r),{signal:s.signal,getQueue:i}).finally(()=>{this.uppy.off("file-removed",o)})}return tt(this,ci,s_).call(this,r)}))},Gl=new WeakMap,te(i_,"VERSION",Ine.version);const J0=10*1e3*1e3;function Q0(t,e,n){return(t||"").replace(`{${e}}`,n)}function c_(t){if(!t.responseText)return{};try{return JSON.parse(t.responseText)}catch{return{message:t.responseText}}}function $ne(t){const e=t!=null&&t.request?c_(t.request):null;if(e!=null&&e.message)return e.message;if(e!=null&&e.errors){const n=Object.values(e.errors).flat()[0];if(n)return n}return(t==null?void 0:t.message)||"Upload failed"}function Dne(t){return(t.type||"application/octet-stream").split("/")[0]}function Nne(t){var n;const e=(t.type||"").split("/")[1];return e?e.split("+")[0]:(n=t.name)!=null&&n.includes(".")?t.name.split(".").pop().toLowerCase():"octet-stream"}function Ra(t,e){const n=t.indexOf(e);n!==-1&&t.splice(n,1)}class Fne{constructor({reactive:e=i=>i,documentRef:n=globalThis.document,uppyFactory:r}={}){this.reactive=e,this.document=n,this.uppyFactory=r||(i=>new Yp(i)),this.uploaders=new Map}forContext(e){return{on:(n,r)=>this.on(n,r,e),off:n=>this.off(n),option:(n,r,i)=>this.option(n,r,i),select:n=>this.select(n),files:n=>this.files(n),state:n=>this.state(n),errors:n=>this.errors(n),dropzone:n=>this.dropzone(n)}}ensure(e){return this.uploaders.has(e)||this.uploaders.set(e,{id:e,context:null,options:{},uppy:null,input:null,cleanup:[],filesById:new Map,reactive:this.reactive({files:{all:[],success:[],process:[]},errors:[],dropzone:{active:!1},status:"idle"})}),this.uploaders.get(e)}on(e,n,r){this.off(e);const i=this.ensure(e);return i.context=r,i.options=n,i.uppy=this.uppyFactory({id:e,autoProceed:n.startOnSelect!==!1,allowMultipleUploadBatches:!0,restrictions:{maxFileSize:n.maxSizePerFile||J0,maxNumberOfFiles:n.maxFiles||50,allowedFileTypes:Array.isArray(n.extensions)?n.extensions:null}}),i.uppy.use(i_,{endpoint:n.url||"",fieldName:"file",formData:!0,limit:n.maxFilesInProgress||5,withCredentials:!0,headers:()=>{var s,o,a;return{Accept:"application/json","X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":((a=(o=(s=this.document)==null?void 0:s.head)==null?void 0:o.querySelector('meta[name="csrf-token"]'))==null?void 0:a.content)||""}},getResponseData:c_}),this.bindUppyEvents(i),this.bindFileInput(i),this.bindDropzone(i),i}off(e){var r,i;const n=this.uploaders.get(e);n&&(n.cleanup.forEach(s=>s()),n.cleanup=[],(r=n.input)==null||r.remove(),n.input=null,(i=n.uppy)==null||i.destroy(),n.uppy=null,n.context=null)}option(e,n,r){var s;const i=this.ensure(e);i.options[n]=r,n==="url"&&i.uppy&&((s=i.uppy.getPlugin("XHRUpload"))==null||s.setOptions({endpoint:r}))}select(e){var n;(n=this.ensure(e).input)==null||n.click()}files(e){return this.ensure(e).reactive.files}state(e){return this.ensure(e).reactive.status}errors(e){return this.ensure(e).reactive.errors}dropzone(e){return this.ensure(e).reactive.dropzone}addFiles(e,n){const r=this.ensure(e),i=Array.from(n),s=r.options.maxFilesSelect||15;if(i.length>s){this.addError(r,"file-max-select",Q0(r.options.maxFilesSelectMsg,"max",s)||`A maximum of ${s} files can be selected at once.`);return}i.forEach(o=>{var a;try{(a=r.uppy)==null||a.addFile({source:e,name:o.name,type:o.type,data:o})}catch(l){const c=Math.round((r.options.maxSizePerFile||J0)/1e3/1e3),u=l.isRestriction&&Q0(r.options.maxFileSizeMsg,"max",c)||l.message;this.addError(r,l.isRestriction?"file-max-size":"file-error",u)}})}bindUppyEvents(e){e.uppy.on("file-added",n=>{const r=this.reactive({$id:n.id,id:void 0,name:n.name,size:n.size||0,type:Dne(n),extension:Nne(n),state:"queued",percentComplete:0,error:null,url:void 0,preview_url:void 0,created_at:void 0,clear:()=>{var i;return(i=e.uppy)==null?void 0:i.removeFile(n.id)}});e.filesById.set(n.id,r),e.reactive.files.all.push(r)}),e.uppy.on("upload-start",n=>{n.forEach(r=>{const i=e.filesById.get(r.id);i&&(i.state="uploading",this.addToProcess(e,i))}),e.reactive.status="uploading"}),e.uppy.on("upload-progress",(n,r)=>{const i=n?e.filesById.get(n.id):null;i&&r.bytesTotal&&(i.percentComplete=Math.round(r.bytesUploaded/r.bytesTotal*100))}),e.uppy.on("upload-success",(n,r)=>{var o,a;const i=n?e.filesById.get(n.id):null;if(!i)return;const s=((o=r.body)==null?void 0:o.data)||r.body||{};Object.assign(i,s,{state:"success",percentComplete:100}),Ra(e.reactive.files.process,i),e.reactive.files.success.includes(i)||e.reactive.files.success.push(i),this.updateStatus(e),(a=e.options.onSuccess)==null||a.call(e.context,i,{data:r.body})}),e.uppy.on("upload-error",(n,r)=>{var o;
187const i=n?e.filesById.get(n.id):null,s=$ne(r);i&&(i.state="error",i.error={code:"file-error",msg:s},Ra(e.reactive.files.process,i)),this.addError(e,"file-error",s),this.updateStatus(e),i&&((o=e.options.onError)==null||o.call(e.context,i))}),e.uppy.on("file-removed",n=>{const r=e.filesById.get(n.id);r&&(Ra(e.reactive.files.all,r),Ra(e.reactive.files.success,r),Ra(e.reactive.files.process,r),e.filesById.delete(n.id),this.updateStatus(e))})}bindFileInput(e){var i;if(!((i=this.document)!=null&&i.createElement))return;const n=this.document.createElement("input");n.type="file",n.hidden=!0,n.multiple=e.options.multiple!==!1,n.accept=e.options.accept||"*/*",n.dataset.test=`${e.id}-input`;const r=()=>{this.addFiles(e.id,n.files||[]),n.value=""};n.addEventListener("change",r),this.document.body.appendChild(n),e.input=n,e.cleanup.push(()=>n.removeEventListener("change",r))}bindDropzone(e){var l,c;const n=(c=(l=this.document)==null?void 0:l.getElementById)==null?void 0:c.call(l,e.options.dropzoneId);if(!n)return;let r=0;const i=u=>u.preventDefault(),s=u=>{u.preventDefault(),r+=1,e.reactive.dropzone.active=!0},o=u=>{u.preventDefault(),r=Math.max(0,r-1),e.reactive.dropzone.active=r>0},a=u=>{var d;u.preventDefault(),r=0,e.reactive.dropzone.active=!1,this.addFiles(e.id,((d=u.dataTransfer)==null?void 0:d.files)||[])};n.addEventListener("dragenter",s),n.addEventListener("dragover",i),n.addEventListener("dragleave",o),n.addEventListener("drop",a),e.cleanup.push(()=>{n.removeEventListener("dragenter",s),n.removeEventListener("dragover",i),n.removeEventListener("dragleave",o),n.removeEventListener("drop",a)})}addToProcess(e,n){e.reactive.files.process.includes(n)||e.reactive.files.process.push(n)}addError(e,n,r){e.reactive.errors.push({code:n,msg:r})}updateStatus(e){e.reactive.status=e.reactive.files.process.length?"uploading":"idle"}}function jne(t,e){Object.defineProperty(t.config.globalProperties,"$upload",{configurable:!0,get(){return e.forContext(this)}})}const Bne={components:{Modal:Di,SpmLoader:xn},data(){return{loading:!0}},computed:{componentLoader(){if(!this.$store.getters.formModal.component)return null;const t=this.$store.getters.formModal.component.replace(".vue",""),e=this.$modals[`./components/views/${t}.vue`];return e?wr({loader:()=>e().finally(()=>{this.loading=!1}),onError:(n,r,i)=>{this.$store.commit("hideFormModal"),i()}}):null}}},Hne={key:0,class:"p-8 text-center"};function Une(t,e,n,r,i,s){const o=z("spm-loader"),a=z("modal");return S(),re(a,{open:t.$store.getters.formModal.show,onClose:e[0]||(e[0]=l=>t.$store.commit("hideFormModal"))},{default:Y(()=>[x("div",{id:"spm-modal-center",class:K(["box-style relative py-8 px-4 md:p-8 w-full h-auto m-auto my-2 md:my-8 flex-col flex",[t.$isMobileOrTablet?"mb-20":"",t.$store.getters.formModal.params.modalWidth?t.$store.getters.formModal.params.modalWidth:"max-w-4xl",t.$store.getters.formModal.params.modalClass]])},[i.loading?(S(),C("div",Hne,[X(o)])):P("",!0),s.componentLoader?(S(),re(kr(s.componentLoader),{key:1})):P("",!0)],2)],void 0,!0),_:1},8,["open"])}const u_=Ae(Bne,[["render",Une]]),Vne={components:{Modal:Di,SpmLoader:xn},data(){return{component:null,loading:!0}},computed:{componentLoader(){if(!this.$store.getters.ticketModal.component)return null;const t=this.$store.getters.ticketModal.component.replace(".vue","");return this.$modals[`./components/views/${t}.vue`]}},mounted(){this.loading=!0,this.componentLoader().then(()=>{this.loading=!1,this.component=()=>this.componentLoader()}).catch(()=>{this.$store.commit("hideTicketModal")})}},zne={class:"box-style relative py-8 px-4 md:p-8 my-2 md:my-8 w-full max-w-3xl mx-auto flex-col flex bg-gray-200"},Wne={key:0,class:"p-8 text-center"};function Kne(t,e,n,r,i,s){const o=z("spm-loader"),a=z("modal");return S(),re(a,{open:t.$store.getters.ticketModal.show,onClose:e[0]||(e[0]=l=>t.$store.commit("hideTicketModal"))},{default:Y(()=>[x("div",zne,[i.loading?(S(),C("div",Wne,[X(o)])):P("",!0),(S(),re(lm,null,[s.componentLoader?(S(),re(kr(s.componentLoader),{key:0})):P("",!0)],1024))])],void 0,!0),_:1},8,["open"])}const qne=Ae(Vne,[["render",Kne]]),Gne={name:"TaskModal",components:{Modal:Di,SpmLoader:xn}
187,computed:{componentLoader(){if(!this.$store.getters.taskModal.component)return null;const t=this.$store.getters.taskModal.component.replace(".vue",""),e=this.$modals[`./components/views/${t}.vue`];return e?wr({loader:e,onError:(n,r,i)=>{this.$store.commit("hideTaskModal"),i()}}):null}}};function Yne(t,e,n,r,i,s){const o=z("spm-loader"),a=z("modal");return S(),re(a,{open:t.$store.getters.taskModal.show,onClose:e[0]||(e[0]=l=>{t.$store.commit("hideTaskModal"),t.$router.push({path:t.$route.path,query:null})})},{default:Y(()=>[x("div",{class:K(["box-style relative w-full h-auto min-h-128 max-w-6xl m-auto my-2 md:my-8 flex-col flex",[t.$isMobileOrTablet?"mb-20":""]])},[t.$store.getters.taskIsLoading?(S(),re(o,{key:0,class:"p-20 text-center self-center"})):P("",!0),(S(),re(lm,null,[s.componentLoader?(S(),re(kr(s.componentLoader),{key:0})):P("",!0)],1024))],2)],void 0,!0),_:1},8,["open"])}const Xne=Ae(Gne,[["render",Yne]]),Jne={components:{Modal:Di,SpmLoader:xn},data(){return{loading:!0}},computed:{componentLoader(){if(!this.$store.getters.docsArticleModal.component)return null;const t=this.$store.getters.docsArticleModal.component.replace(".vue",""),e=this.$modals[`./components/views/${t}.vue`];return e?wr({loader:()=>e().finally(()=>{this.loading=!1}),onError:(n,r,i)=>{this.$store.commit("hideDocsArticleModal"),i()}}):null}}},Qne={class:"box-style relative py-8 px-4 md:p-8 my-2 md:my-8 w-full max-w-4xl mx-auto flex-col flex"},Zne={key:0,class:"p-8 text-center"};function ere(t,e,n,r,i,s){const o=z("spm-loader"),a=z("modal");return S(),re(a,{open:t.$store.getters.docsArticleModal.show,onClose:e[0]||(e[0]=l=>t.$store.commit("hideDocsArticleModal"))},{default:Y(()=>[x("div",Qne,[i.loading?(S(),C("div",Zne,[X(o)])):P("",!0),(S(),re(lm,null,[s.componentLoader?(S(),re(kr(s.componentLoader),{key:0})):P("",!0)],1024))])],void 0,!0),_:1},8,["open"])}const tre=Ae(Jne,[["render",ere]]),nre={components:{Modal:Di},data(){return{component:null,loading:!1,defaultButtons:[{title:this.$trans.get("Close")}]}},computed:{componentLoader(){if(!this.$store.getters.dialogModal.component)return null;const t=this.$store.getters.dialogModal.component.replace(".vue",""),e=this.$modals[`./components/views/${t}.vue`];return e?wr(e):null},buttons(){return this.$store.getters.dialogModal.buttons||this.defaultButtons},buttonStyle(){return{flex:`1 1 ${100/this.buttons.length}%`}}}},rre={class:"box-style relative p-6 w-full max-w-[30rem] m-auto flex-col flex"},ire=["textContent"],sre=["innerHTML"],ore={key:3,class:"mt-6"},are=["onClick","innerHTML"];function lre(t,e,n,r,i,s){const o=z("modal");return S(),re(o,{open:t.$store.getters.dialogModal.show,"close-on-esc":t.$store.getters.dialogModal.closeOnEsc,"wrapper-class":"h-full",onClose:e[0]||(e[0]=a=>t.$store.commit("hideDialogModal"))},{default:Y(()=>[x("div",rre,[t.$store.getters.dialogModal.title?(S(),C("div",{key:0,class:"font-display text-xl font-bold text-primary-900",textContent:L(t.$store.getters.dialogModal.title)},null,8,ire)):P("",!0),t.$store.getters.dialogModal.text?(S(),C("div",{key:1,class:"mt-4 text-gray-700 leading-normal",innerHTML:t.$store.getters.dialogModal.text},null,8,sre)):P("",!0),s.componentLoader?(S(),re(kr(s.componentLoader),{key:2})):P("",!0),s.buttons.length?(S(),C("div",ore,[(S(!0),C(Fe,null,nt(s.buttons,(a,l)=>(S(),C("button",{key:l,class:K([a.class||"btn-gray-200","btn w-full md:w-auto mr-4 mt-2 md:mt-0 shadow-none"]),style:Ir(s.buttonStyle),type:"button",onClick:ct(c=>{a.handler&&a.handler(),t.$store.commit("hideDialogModal")},["stop"]),innerHTML:a.title},null,14,are))),128))])):P("",!0)])],void 0,!0),_:1},8,["open","close-on-esc"])}const d_=Ae(nre,[["render",lre]]),cre={name:"VueLoadImage",data(){return{isLoading:!0,hasError:!1}},methods:{handleError(){this.isLoading=!1,this.hasError=!0}}};function ure(t,e,n,r,i,s){return S(),C("div",{onLoadCapture:e[0]||(e[0]=o=>i.isLoading=!1),onErrorCapture:e[1]||(e[1]=(...o)=>s.handleError&&s.handleError(...o))},[Ye(x("div",null,[Tt(t.$slots,"image")],512),[[wt,!i.hasError]]),i.isLoading&&!i.hasError?Tt(t.$slots,"preloader",{},void 0,void 0,0):P("",!0),i.hasError?Tt(t.$slots,"error",{},void 0,void 0,1):P("",!0)],32)}const dre=Ae(cre,[["render",ure]]),fre={components:{Modal:Di,VueLoadImage:dre,SpmButton:tc,SpmLoader:xn},data(){return{params:{},zoom:!1}},computed:{zoomImage(){return this.zoom&&this.previewType==="image"},fitImage(){return!this.zoom&&this.previewType==="image"},canPrevious(){return this.currentIndex>0},canNext(){return this.currentIndex>=0&&this.currentIndex<(this.$store.getters.previewModal.list||[]).length-1},currentIndex(){return!this.$store.getters.previewModal.list||this.$store.getters.previewModal.list.length<1?0:un(this.$store.getters.previewModal.list,t=>t.src==this.$store.getters.previewModal.src,0)},previewType(){let t=this.$store.getters.previewModal,e=t.mime?t.mime.split("/")[0]:t.type;switch(t.mime=="application/pdf"&&(e="pdf"),e){case"image":return"image";case"video":return"video";case"audio":return"audio";case"pdf":return"pdf";default:return"download"}}},mounted(){this.mountKeydownListener()},beforeUnmount(){this.unMountKeydownListener()},methods:{beforeOpen(t){this.url=t.params.url},dismiss(){this.$store.commit("hidePreviewModal")},toggleZoom(){this.zoom=!this.zoom},download(){window.open(this.$store.getters.previewModal.src,"_blank")},next(){this.canNext&&this.showImage(this.currentIndex+1)},previous(){this.canPrevious&&this.showImage(this.currentIndex-1)},showImage(t){const e=this.$store.getters.previewModal.list||[];e[t]&&this.$store.commit("showPreviewModal",{...e[t],list:e})},bindKeys(t){var e,n;if(this.$store.getters.previewModal.show){if(["ArrowUp","ArrowDown"].includes(t.key)){t.stopPropagation();return}t.defaultPrevented||(n=(e=t.target)==null?void 0:e.closest)!=null&&n.call(e,'input, textarea, select, [contenteditable="true"]')||["ArrowRight","ArrowLeft"].includes(t.key)&&((this.$store.getters.previewModal.list||[]).length<2||(t.preventDefault(),t.stopPropagation(),t.key==="ArrowRight"&&this.next(),t.key==="ArrowLeft"&&this.previous()))}},mountKeydownListener(){window.document.addEventListener("keydown",this.bindKeys,!0)},unMountKeydownListener(){window.document.removeEventListener("keydown",this.bindKeys,!0)}}},hre=["innerHTML"],pre={key:0,class:"h-30",src:"https://cdn.helpspace.com/svg/file_icons/unknown.svg"},mre=["src"],gre=["innerHTML"],vre={key:2,class:"w-full my-10",controls:""},yre=["src","type"],bre={key:3,class:"w-full h-auto",controls:""},kre=["src"],wre=["src"];function xre(t,e,n,r,i,s){const o=z("spm-button"),a=z("spm-loader"),l=z("vue-load-image"),c=z("modal");return S(),re(c,{open:t.$store.getters.previewModal.show,onClose:e[3]||(e[3]=u=>t.$store.commit("hidePreviewModal"))},{default:Y(()=>[x("div",{class:K(["box-style relative py-8 px-4 md:p-8 m-auto flex-col flex",{"h-full":i.zoom&&!s.zoomImage,"my-2 md:my-8":!s.zoomImage,"h-dvh !m-0 rounded-none overflow-hidden":s.zoomImage,"w-full":!s.fitImage,"max-w-7xl":!i.zoom&&!s.fitImage,"h-[calc(100dvh-1rem)] w-[calc(100%-1rem)] md:h-[calc(100dvh-4rem)] md:w-[calc(100%-4rem)]":s.fitImage}])},[X(o,{tooltip:t.$trans.get("Toggle Zoom"),class:"absolute right-0 top-0 p-4 mr-8 text-gray-500 hover:text-gray-650",icon:i.zoom?"feather-minimize-2":"feather-maximize-2","icon-class":"flex h-5 text-gray-600 stroke-icon",onClicked:s.toggleZoom},null,8,["tooltip","icon","onClicked"]),x("button",{class:"absolute right-0 top-0 p-4 text-gray-500 hover:text-gray-650",onClick:e[0]||(e[0]=u=>t.$store.commit("hidePreviewModal")),innerHTML:t.svg("feather-x","flex h-5 text-gray-600 stroke-icon ")},null,8,hre),x("div",{class:K(["text-center mt-6",{"flex flex-col flex-1 min-h-0":s.previewType==="image"}])},[(S(),C("div",{key:t.$store.getters.previewModal.src,ref:"imageViewport",class:K(s.zoomImage?"flex-1 min-h-0 min-w-0 overflow-auto":["flex items-center justify-center",s.fitImage?"flex-1 min-h-0":"min-h-54"])},[s.previewType=="download"?(S(),C("img",pre)):P("",!0),s.previewType=="image"?(S(),re(l,{key:t.$store.getters.previewModal.src,class:K([i.zoom?"cursor-zoom-out":"cursor-zoom-in",s.fitImage?"relative h-full w-full min-h-0 [&>div]:h-full":"relative flex min-h-full w-max min-w-full [&>div]:m-auto [&>div]:shrink-0"])},{image:Y(()=>[x("img",{class:K(s.fitImage?"h-full w-full object-scale-down object-center":"h-auto w-auto max-w-none"),src:t.$store.getters.previewModal.src,onClick:e[1]||(e[1]=(...u)=>s.toggleZoom&&s.toggleZoom(...u))},null,10,mre)]),preloader:Y(()=>[X(a,{class:"absolute inset-0 m-auto"})]),error:Y(()=>[x("div",{class:K(["text-red-700 text-sm font-medium",s.fitImage?"flex items-center justify-center":"my-10"])},[x("span",{innerHTML:t.svg("feather-alert-circle","stroke-icon h-4")},null,8,gre),Me(" "+L(t.$trans.get("An error occurred, please try again later.")),1)],2)]),_:1},8,["class"])):P("",!0),s.previewType=="audio"?(S(),C("audio",vre,[x("source",{src:t.$store.getters.previewModal.src,type:t.$store.getters.previewModal.mime},null,8,yre),e[4]||(e[4]=Me(" Your browser does not support the audio playback. ",-1))])):P("",!0),s.previewType=="video"?(S(),C("video",bre,[x("source",{src:t.$store.getters.previewModal.src},null,8,kre),e[5]||(e[5]=Me(" Your browser does not support the video playback. ",-1))])):P("",!0),s.previewType=="pdf"?(S(),C("iframe",{key:4,src:t.$store.getters.previewModal.src+"/preview",type:"application/pdf",class:"w-full rounded-lg h-[calc(100vh-12rem)]"},null,8,wre)):P("",!0)],2)),x("div",{class:K(["mt-2 flex items-center justify-center",{"shrink-0 gap-2":s.previewType==="image","h-16":s.zoomImage}])},[t.$store.getters.previewModal.list&&t.$store.getters.previewModal.list.length>1?(S(),re(o,{key:0,tooltip:t.$trans.get("Previous"),class:K(["p-2 text-gray-500 group mr-auto rounded-lg hover:bg-gray-100",{"shrink-0":s.previewType==="image"}]),disabled:!s.canPrevious,"aria-label":t.$trans.get("Previous"),icon:"feather-chevron-left","icon-class":"flex h-5 text-gray-600 stroke-icon group-hover:text-primary-500",onClicked:s.previous},null,8,["tooltip","class","disabled","aria-label","onClicked"])):P("",!0),X(o,{tooltip:t.$trans.get("Download"),class:K(["text-gray-650 text-sm font-medium p-2 cursor-pointer rounded-lg hover:bg-gray-100",{"min-w-0
187whitespace-normal break-all":s.previewType==="image","h-full max-h-full overflow-y-auto":s.zoomImage}]),onClicked:e[2]||(e[2]=u=>s.download())},{default:Y(()=>[Me(L(t.$store.getters.previewModal.text),1)],void 0,!0),_:1},8,["tooltip","class"]),t.$store.getters.previewModal.list&&t.$store.getters.previewModal.list.length>1?(S(),re(o,{key:1,tooltip:t.$trans.get("Next"),class:K(["p-2 text-gray-500 group rounded-lg hover:bg-gray-100 ml-auto",{"shrink-0":s.previewType==="image"}]),disabled:!s.canNext,"aria-label":t.$trans.get("Next"),icon:"feather-chevron-right","icon-class":"flex h-5 text-gray-600 stroke-icon group-hover:text-primary-500",onClicked:s.next},null,8,["tooltip","class","disabled","aria-label","onClicked"])):P("",!0)],2)],2)],2)],void 0,!0),_:1},8,["open"])}const f_=Ae(fre,[["render",xre]]),Sre={components:{Modal:Di},data(){return{}},methods:{refresh(){location.reload(!0)}}},Tre={class:"box-style relative p-6 w-full max-w-sm m-auto flex-col flex"},_re={class:"font-display text-xl font-bold text-primary-900"},Ere={class:"mt-4 text-gray-700 leading-normal"},Cre={class:"mt-6"};function Ore(t,e,n,r,i,s){const o=z("modal");return S(),re(o,{open:t.$store.getters.refreshRequired,"wrapper-class":"h-full"},{default:Y(()=>[x("div",Tre,[x("div",_re,"⨠"+L(t.$trans.get("Update Available")),1),x("div",Ere,L(t.$trans.get("New version is available! Please reload the page in order to receive the latest updates.")),1),x("div",Cre,[x("button",{class:"btn btn-primary-500 mr-4 shadow-none",type:"button",onClick:e[0]||(e[0]=ct(a=>s.refresh(),["stop"]))},L(t.$trans.get("Reload Page")),1)])])],void 0,!0),_:1},8,["open"])}const Are=Ae(Sre,[["render",Ore]]),Mre={components:{TextHighlight:pa},props:{data:{type:Object,default:()=>{}},queries:{type:Array,default:()=>[]}}},Ire={class:"flex-grow"},Lre={class:"flex items-center"},Pre={class:"w-9 shrink-0 text-gray-600"},Rre=["src"],$re={class:"flex-grow text-sm font-medium text-gray-700"},Dre={class:"flex items-center w-full mb-1 text-gray-650"};function Nre(t,e,n,r,i,s){const o=z("text-highlight");return S(),C("div",Ire,[x("div",Lre,[x("div",Pre,[x("img",{src:n.data.avatar,class:"avatar h-5 w-5"},null,8,Rre)]),x("h4",$re,[x("small",Dre,L(n.data.email),1),X(o,{"highlight-class":"docs-search-hit",queries:n.queries},{default:Y(()=>[Me(L(n.data.name),1)],void 0,!0),_:1},8,["queries"])])])])}const Fre=Ae(Mre,[["render",Nre]]),jre={components:{TextHighlight:pa,SpmTag:va},props:{data:{type:Object,default:()=>{}},queries:{type:Array,default:()=>[]}}},Bre={class:"flex-grow"},Hre={class:"flex items-center mb-1"},Ure={class:"w-9 shrink-0 text-gray-600"},Vre=["innerHTML"],zre={class:"min-w-0 flex-1"},Wre={class:"text-sm font-medium text-gray-700 truncate"},Kre={key:0,class:"text-sm font-medium text-gray-650 truncate mt-0.5"},qre={key:1,class:"flex gap-1 flex-row flex-wrap mt-1"};function Gre(t,e,n,r,i,s){const o=z("text-highlight"),a=z("spm-tag");return S(),C("div",Bre,[x("div",Hre,[x("div",Ure,[x("span",{innerHTML:t.svg("feather-zap","stroke-icon h-5 w-5")},null,8,Vre)]),x("div",zre,[x("h4",Wre,[X(o,{"highlight-class":"docs-search-hit",queries:n.queries},{default:Y(()=>[Me(L(n.data.name),1)],void 0,!0),_:1},8,["queries"])]),n.data.excerpt?(S(),C("p",Kre,[X(o,{"highlight-class":"docs-search-hit",queries:n.queries},{default:Y(()=>[Me(L(n.data.excerpt),1)],void 0,!0),_:1},8,["queries"])])):P("",!0),n.data.tags&&n.data.tags.length?(S(),C("div",qre,[(S(!0),C(Fe,null,nt(n.data.tags,l=>(S(),re(a,{key:l.id,tag:l,light:!0,class:"max-w-xxs hover:max-w-full truncate"},null,8,["tag"]))),128))])):P("",!0)])])])}const Yre=Ae(jre,[["render",Gre]]),Xre={components:{Modal:Di,SpmLoader:xn,SpmDropdownTags:Om,SpmTag:va,Tickets:Bw,Tasks:Uw,Customers:Fre,Articles:Hw,QuickReplies:Yre},data(){return{query:"",highlightedIndex:-1,isLoading:!1,searchResults:[],searchResultsHits:0,sections:[],selectedTagIds:[],selectedTagCache:{},tagOptions:[],tagsLoading:!1,tagsLoaded:!1,resultType:null,defaultActions:[{id:2,name:"Go to Docs",icon:"feather-file-text",route:"docs"},{id:3,name:"Go to Tickets",icon:"feather-inbox",path:"/tickets/unassigned/0"},{id:4,name:"Go to Tasks",icon:"feather-check-square",route:"tasks"},{id:5,name:"Go to Customers",icon:"feather-users",route:"customers"},{id:6,name:"Go to Settings",icon:"feather-settings",route:"settings"}]}},computed:{actions(){return{all:[{id:1,name:"Create new Ticket",icon:"feather-send",action:()=>this.$store.commit("showFormModal",{component:"tickets/modals/_create-ticket.modal.vue"})},...this.defaultActions],tickets:[{id:1,name:"Create new Ticket",icon:"feather-send",action:()=>this.$store.commit("showFormModal",{component:"tickets/modals/_create-ticket.modal.vue"})},...this.defaultActions],tasks:[...this.defaultActions],customers:[...this.defaultActions],articles:[...this.defaultActions],quick_replies:[...this.defaultActions]}},hasSearchCriteria(){return!!this.query||this.selectedTagIds.length>0},tagsOptionsUrl(){const t=this.sections[0];return t==="tickets"?"/selectable/tags/ticket":t==="tasks"?"/selectable/tags/task":t==="articles"?"/selectable/tags/doc":t==="quick_replies"?"/selectable/tags/quick-reply":"/selectable/tags/all"},tagsTagFilterDisabled(){return this.tagsLoading||this.tagsLoaded&&!this.tagOptions.length},selectedTags(){return this.selectedTagIds.map(t=>this.selectedTagCache[t]||this.tagOptions.find(e=>
187e.id===t)).filter(Boolean)},defaultSections(){const t=["tickets","articles","tasks","customers"];return this.$userHasRole(["superadmin","admin","agent","team-agent"])&&t.push("quick_replies"),t},queries(){return this.query?this.query.split(" "):[]},list(){return this.searchResultsHits?this.mergedResults:this.actionsList},mergedResults(){return this.searchResults.length?this.searchResults.map(t=>t.results).flat():[]},highlightedItem(){return this.list[this.highlightedIndex]},actionsList(){return this.actions[this.sections[0]??"all"]}},mounted(){this.$refs.query.focus(),this.loadTags()},methods:{clearQuery(){this.query="",this.searchCommand()},setSection(t){this.sections=t?[t]:[],this.tagsLoaded=!1,this.loadTags(),this.searchCommand(!0),this.$refs.query.focus()},tagLabel(t){var n;const e=t==null?void 0:t.name;if(typeof e=="string")return e;if(e&&typeof e=="object"){const r=typeof((n=this.$i18n)==null?void 0:n.locale)=="string"?this.$i18n.locale.split("-")[0]:"";return e[r]||e.en||Object.values(e).find(Boolean)||""}return String((t==null?void 0:t.slug)||(t==null?void 0:t.id)||"")},displayTagBody(t){return{id:t.id,color:t.color||"#848484",name:this.tagLabel(t)}},onFilterTagsUpdated(t){this.selectedTagIds=Array.isArray(t)?t.slice():[],this.selectedTagIds.forEach(e=>{const n=this.tagOptions.find(r=>r.id===e);n&&(this.selectedTagCache[e]=n)}),this.searchCommand()},clearTagFilters(){this.selectedTagIds=[],this.selectedTagCache={},this.searchCommand()},loadTags(){this.tagsLoading=!0,axios.get(this.tagsOptionsUrl).then(t=>{var e;this.tagOptions=((e=t.data)==null?void 0:e.data)??[]}).catch(()=>{this.tagOptions=[]}).finally(()=>{this.tagsLoading=!1,this.tagsLoaded=!0})},searchCommand(t=!1){if(!this.hasSearchCriteria){this.isLoading=!1,this.highlightedIndex=-1,this.searchResults=[],this.searchResultsHits=0;return}this.isLoading=!0,this.searchResults=[],this.searchResultsHits=0,this.search(),t&&typeof this.search.flush=="function"&&this.search.flush()},search:Qt(function(){if(!this.hasSearchCriteria){this.isLoading=!1,this.highlightedIndex=-1,this.searchResults=[],this.searchResultsHits=0;return}this.isLoading=!0,this.highlightedIndex=-1,axios.post("/global/search",{sections:this.sections.length?this.sections:this.defaultSections,text:this.query,tags:this.selectedTagIds}).then(e=>{this.searchResults=e.data.data,this.searchResultsHits=e.data.hits}).catch(e=>{}).finally(()=>{this.isLoading=!1})},500),highlightNext(){this.highlightedIndex=this.highlightedIndex==this.list.length-1?this.list.length-1:this.highlightedIndex+1,this.searchResultsHits&&this.$refs.resultitem[this.highlightedIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})},highlightPrevious(){this.highlightedIndex=this.highlightedIndex==0?0:this.highlightedIndex-1,this.searchResultsHits&&this.$refs.resultitem[this.highlightedIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})},highlightResult(t){this.highlightedIndex=un(this.list,t)},select(t){if(t.action){t.action(),this.$store.commit("hideCommandBarModal");return}if(t.route||t.path){this.goTo(t);return}t.search_type=="Ticket"&&this.$router.push({path:"/tickets/all/"+t.id}),t.search_type=="Customer"&&this.$router.push({path:"/customers/"+t.id}),t.search_type=="Article"&&this.$router.push({path:"/docs/"+t.site_id+"/articles/"+t.id}),t.search_type=="Task"&&this.$store.dispatch("viewTask",t.id),t.search_type=="QuickReply"&&this.$store.commit("showFormModal",{component:"settings/quick-replies/_quick-reply.modal.vue",params:{id:t.id,name:t.name,body:t.body,tags:t.tags||[]}}),this.query=null,this.selectedTagIds=[],this.selectedTagCache={},this.$store.commit("hideCommandBarModal")},selectHighlighted(){this.select(this.highlightedItem)},goTo(t){this.$router.push(t.route?{name:t.route}:{path:t.path}),this.$store.commit("hideCommandBarModal")},title(t){return this.resultType==t?"":(this.resultType=t,t)}}},Jre={class:"box-style fixed w-full max-w-4xl mx-auto xl:mt-40"},Qre={class:"flex items-stretch gap-2 border-b px-2 pt-1"},Zre={class:"relative flex flex-1 min-w-0 items-center"},eie=["innerHTML"],tie=["placeholder"],nie=["innerHTML"],rie=["disabled","title","aria-label"],iie=["innerHTML"],sie={class:"ml-2 text-xs font-medium hidden sm:inline"},oie={key:0,class:"ml-2 min-h-[1.125rem] min-w-[1.125rem] px-1 flex items-center justify-center rounded-full bg-primary-600 text-white text-[0.625rem] font-semibold leading-none tabular-nums"},aie={key:0,class:"flex flex-wrap items-center gap-x-2 gap-y-1 px-4 py-2 border-b"},lie={class:"flex py-1 text-sm font-medium border-b text-gray-650"},cie={class:"max-h-100 overflow-y-auto hide-native-scrollbar"},uie={key:"results"},die={key:0,class:"sticky top-0 z-10 text-sm font-medium text-gray-650 mb-2 bg-gray-150 py-2 px-5"},fie={class:"px-3 py-1"},hie=["onClick","onMousemove"],pie={key:"no-results",class:"flex text-gray-650 text-sm font-medium h-40 items-center justify-center"},mie=["innerHTML"],gie={key:"default",class:"text-gray-650 text-sm font-medium"},vie={class:"text-sm font-medium text-gray-650 mb-2 bg-gray-150 py-2 px-5"},yie={class:"px-2 pb-2"},bie=["onClick","onMousemove"],kie=["innerHTML"],wie={key:"no-results",class:"flex text-gray-650 text-sm font-medium h-40 items-center justify-center"},xie=["innerHTML"],Sie={class:"border-t items-center flex p-2 px-4"},Tie={key:0,class:"text-sm font-semibold text-gray-600"},_ie={class:"spm-hotkey flex items-center text-sm font-semibold text-gray-600 ml-auto px-1"};function Eie(t,e,n,r,i,s){const o=z("spm-loader"),a=z("spm-dropdown-tags"),l=z("spm-tag"),c=z("modal"),u=ha("auto-animate");return S(),re(c,{open:t.$store.getters.commandBarModal.show,"close-on-esc":t.$store.getters.commandBarModal.closeOnEsc,"wrapper-class":"h-full justify-center",onClose:e[14]||(e[14]=d=>t.$store.commit("hideCommandBarModal"))},{default:Y(()=>[x("div",Jre,[x("div",Qre,[x("div",Zre,[x("span",{class:"absolute left-3 text-gray-650",innerHTML:t.svg("feather-search","stroke-icon h-[20px] w-[20px]")},null,8,eie),Ye(x("input",{ref:"query","onUpdate:modelValue":e[0]||(e[0]=d=>i.query=d),class:"rounded-t-lg w-full py-[1.15rem] pl-11 pr-10 text-grey-darker",placeholder:t.$trans.get("Search for anythingâ¦"),onInput:e[1]||(e[1]=(...d)=>s.searchCommand&&s.searchCommand(...d)),onKeydown:[e[2]||(e[2]=Lt(ct(d=>s.highlightNext(),["prevent"]),["down"])),e[3]||(e[3]=Lt(ct((...d)=>s.highlightPrevious&&s.highlightPrevious(...d),["prevent"]),["up"])),e[4]||(e[4]=Lt(ct((...d)=>s.selectHighlighted&&s.selectHighlighted(...d),["prevent"]),["enter"])),e[5]||(e[5]=Lt(ct(d=>t.$store.commit("hideCommandBarModal"),["meta","prevent","stop"]),["k"]))]},null,40,tie),[[ls,i.query]]),i.isLoading&&s.hasSearchCriteria?(S(),re(o,{key:0,class:"absolute right-2 self-center",size:"5","show-instant":""})):P("",!0),!i.isLoading&&i.query?(S(),C("button",{key:1,type:"button",class:"absolute right-2 self-center text-gray-600",onClick:e[6]||(e[6]=(...d)=>s.clearQuery&&s.clearQuery(...d)),innerHTML:t.svg("feather-x","stroke-icon h-[20px] w-[20px]")},null,8,nie)):P("",!0)]),X(a,{"options-url":s.tagsOptionsUrl,tags:s.selectedTags,disabled:s.tagsTagFilterDisabled,placement:"bottom-end",small:!0,"dropdown-class":"min-w-[16rem]",onUpdated:s.onFilterTagsUpdated},{default:Y(()=>[x("button",{type:"button",class:K(["inline-flex items-center shrink-0 mt-2 px-3 py-2 rounded-lg bg-gray-650/10 text-gray-800 hover:bg-gray-650/15 border border-transparent transition",{"ring-2 ring-primary-400 ring-inset border-primary-200 bg-gray-650/15":i.selectedTagIds.length>0}]),disabled:s.tagsTagFilterDisabled,title:t.$trans.get("Filter by tags"),"aria-label":t.$trans.get("Filter by tags")},[x("span",{class:"flex items-center shrink-0",innerHTML:t.svg("feather-tag","stroke-icon h-4 w-4")},null,8,iie),x("span",sie,L(t.$trans.get("Tags")),1),i.selectedTagIds.length>0?(S(),C("span",oie,L(i.selectedTagIds.length),1)):P("",!0)],10,rie)],void 0,!0),_:1},8,["options-url","tags","disabled","onUpdated"])]),s.selectedTags.length>0?(S(),C("div",aie,[(S(!0),C(Fe,null,nt(s.selectedTags,d=>(S(),C("div",{key:"chip-"+d.id,class:"inline-flex max-w-full items-center gap-1"},[X(l,{tag:s.displayTagBody(d),class:"mr-0 mb-0"},null,8,["tag"])]))),128)),x("button",{type:"button",class:"text-xs font-medium text-primary-700 hover:text-primary-900 py-1",onClick:e[7]||(e[7]=(...d)=>s.clearTagFilters&&s.clearTagFilters(...d))},L(t.$trans.get("Clear tag filters")),1)])):P("",!0),x("div",lie,[x("button",{class:K(["px-4 focus-visible:bg-gray-100 hover:bg-gray-100 rounded-lg py-1",{"font-bold text-primary-500":!i.sections.length}]),type:"button",onClick:e[8]||(e[8]=d=>s.setSection(null))},L(t.$trans.get("All")),3),x("button",{class:K(["px-4 focus-visible:bg-gray-100 hover:bg-gray-100 rounded-lg py-1",{"font-bold text-primary-500":i.sections.includes("tickets")}]),type:"button",onClick:e[9]||(e[9]=d=>s.setSection("tickets"))},L(t.$trans.get("Tickets")),3),x("button",{class:K(["px-4 focus-visible:bg-gray-100 hover:bg-gray-100 rounded-lg py-1",{"font-bold text-primary-500":i.sections.includes("tasks")}]),type:"button",onClick:e[10]||(e[10]=d=>s.setSection("tasks"))},L(t.$trans.get("Tasks")),3),x("button",{class:K(["px-4 focus-visible:bg-gray-100 hover:bg-gray-100 rounded-lg py-1",{"font-bold text-primary-500":i.sections.includes("customers")}]),type:"button",onClick:e[11]||(e[11]=d=>s.setSection("customers"))},L(t.$trans.get("Customers")),3),t.$userHasPermission(["docs-site-public-read","docs-site-private-read"])?(S(),C("button",{key:0,class:K(["px-4 focus-visible:bg-gray-100 hover:bg-gray-100 rounded-lg py-1",{"font-bold text-primary-500":i.sections.includes("articles")}]),type:"button",onClick:e[12]||(e[12]=d=>s.setSection("articles"))},L(t.$trans.get("Articles")),3)):P("",!0),t.$userHasRole(["superadmin","admin","agent","team-agent"])?(S(),C("button",{key:1,class:K(["px-4 focus-visible:bg-gray-100 hover:bg-gray-100 rounded-lg py-1",{"font-bold text-primary-500":i.sections.includes("quick_replies")}]),type:"button",onClick:e[13]||(e[13]=d=>s.setSection("quick_replies"))},L(t.$trans.get("Quick Replies")),3)):P("",!0)]),Ye((S(),C("div",cie,[!i.isLoading||i.searchResultsHits!=0?(S(),C("div",uie,[(S(!0),C(Fe,null,nt(i.searchResults,(d,f)=>(S(),C("div",{key:"cat"+f},[d.results.length?(S(),C("h5",die,L(d.category),1)):P("",!0),(S(!0),C(Fe,null,nt(d.results,(p,h)=>(S(),C("div",{key:p.id},[x("div",fie,[x("button",{ref_for:!0,ref:"resultitem",type:"button",class:K(["w-full flex text-left rounded-lg cursor-pointer",["px-2 py-2",p===s.highlightedItem?"bg-gray-150":""]]),style:{"word-break":"break-word"},onClick:g=>s.select(p),onMousemove:g=>s.highlightResult(p)},[(S(),re(kr(d.category),{data:p,queries:s.queries},null,8,["data","queries"]))],42,hie)])]))),128))]))),128))])):P("",!0),i.searchResultsHits===0&&!i.isLoading&&s.hasSearchCriteria?(S(),C("div",pie,[x("span",{innerHTML:t.$trans.get("Sorry, no results found for :query.",{query:"<span class='font-semibold'>"+(i.query||t.$trans.get("selected tags"))+"</span>"})},null,8,mie)])):P("",!0),!i.isLoading&&!s.hasSearchCriteria?(S(),C("div",gie,[x("h5",vie,L(t.$trans.get("Shortcuts")),1),Ye((S(),C("div",yie,[(S(!0),C(Fe,null,nt(s.actionsList,(d,f)=>(S(),C("button",{ref_for:!0,ref:"listitem",key:d.id,class:K(["flex items-center rounded-lg h-10 w-full px-3",[{"bg-gray-150":f===i.highlightedIndex}]]),type:"button",onClick:p=>d.action?s.select(d):s.goTo(d),onMousemove:p=>i.highlightedIndex=f},[x("span",{innerHTML:t.svg(d.icon,"stroke-icon text-gray-650 h-[18px] w-[18px] mr-4")},null,8,kie),x("span",null,L(t.$trans.get(d.name)),1)],42,bie))),128))])),[[u,{duration:120}]])])):P("",!0),i.isLoading?(S(),C("div",wie,[x("div",{innerHTML:t.$trans.get("Charging the flux capacitorâ¦")},null,8,xie)])):P("",!0)])),[[u,{duration:280}]]),x("div",Sie,[i.searchResultsHits?(S(),C("span",Tie,L(t.$trans.get(":value results",{value:i.searchResultsHits})),1)):P("",!0),x("span",_ie,L(t.$store.getters.commandKey+" K"),1)])])],void 0,!0),_:1},8,["open","close-on-esc"])}const Cie=Ae(Xre,[["render",Eie]]);var h_=6e4,p_=36e5;function Z0(t,e){var n;KC(1,arguments);var r=qC((n=void 0)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof t=="string"||Object.prototype.toString.call(t)==="[object String]"))return new Date(NaN);var i=Iie(t),s;if(i.date){var o=Lie(i.date,r);s=Pie(o.restDateString,o.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a=s.getTime(),l=0,c;if(i.time&&(l=Rie(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=$ie(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(a+l+c)}
187var zc={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Oie=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Aie=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Mie=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Iie(t){var e={},n=t.split(zc.dateTimeDelimiter),r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],zc.timeZoneDelimiter.test(e.date)&&(e.date=t.split(zc.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var i=zc.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function Lie(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,s=r[2]?parseInt(r[2]):null;return{year:s===null?i:s*100,restDateString:t.slice((r[1]||r[2]).length)}}function Pie(t,e){if(e===null)return new Date(NaN);var n=t.match(Oie);if(!n)return new Date(NaN);var r=!!n[4],i=$a(n[1]),s=$a(n[2])-1,o=$a(n[3]),a=$a(n[4]),l=$a(n[5])-1;if(r)return Bie(e,a,l)?Die(e,a,l):new Date(NaN);var c=new Date(0);return!Fie(e,s,o)||!jie(e,i)?new Date(NaN):(c.setUTCFullYear(e,s,Math.max(i,o)),c)}function $a(t){return t?parseInt(t):1}function Rie(t){var e=t.match(Aie);if(!e)return NaN;var n=ph(e[1]),r=ph(e[2]),i=ph(e[3]);return Hie(n,r,i)?n*p_+r*h_+i*1e3:NaN}function ph(t){return t&&parseFloat(t.replace(",","."))||0}function $ie(t){if(t==="Z")return 0;var e=t.match(Mie);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return Uie(r,i)?n*(r*p_+i*h_):NaN}function Die(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var i=r.getUTCDay()||7,s=(e-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+s),r}var Nie=[31,null,31,30,31,30,31,31,30,31,30,31];function m_(t){return t%400===0||t%4===0&&t%100!==0}function Fie(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(Nie[e]||(m_(t)?29:28))}function jie(t,e){return e>=1&&e<=(m_(t)?366:365)}function Bie(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function Hie(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function Uie(t,e){return e>=0&&e<=59}const Vie={props:{announcement:{type:Object,required:!0},dismissible:{type:Boolean,default:!1}},computed:{priorityColor(){switch(this.announcement.priority){case 1:return{text:"text-primary-500",border:"border-primary-500"};case 2:return{text:"text-yellow-700",border:"border-orange-400"};case 3:return{text:"text-red-700",border:"border-red-500"};default:return{text:"text-gray-700",border:"border-gray-400"}}},hasActions(){return!!(this.announcement.learn_more||this.announcement.action_text&&this.announcement.action_url)}}},zie=["innerHTML"],Wie=["src","alt"],Kie={class:"p-3"},qie={key:0,class:"mb-2 text-xs text-gray-600"},Gie={class:"text-sm leading-snug text-gray-700"},Yie={key:1,class:"mt-3 flex flex-wrap gap-2"},Xie=["href","textContent"];function Jie(t,e,n,r,i,s){return S(),C("div",{class:K(["relative overflow-hidden box-style border border-l-4 border-gray-500",s.priorityColor.border])},[n.dismissible?(S(),C("button",{key:0,type:"button","aria-label":"Dismiss",class:"absolute right-1 top-1 p-1 text-gray-700 hover:text-gray-700",onClick:e[0]||(e[0]=o=>t.$emit("dismiss",n.announcement)),innerHTML:t.svg("feather-x","stroke-icon h-4 w-4")},null,8,zie)):P("",!0),n.announcement.image_url?(S(),C("img",{key:1,src:n.announcement.image_url,alt:n.announcement.title,class:"h-28 w-full object-cover"},null,8,Wie)):P("",!0),x("div",Kie,[x("div",{class:K(["mb-1 text-xs font-bold uppercase",s.priorityColor.text])},L(n.announcement.title),3),n.announcement.created_at?(S(),C("div",qie,L(t.$filters.distanceInWordsToNow(n.announcement.created_at)),1)):P("",!0),x("p",Gie,L(n.announcement.body),1),s.hasActions?(S(),C("div",Yie,[n.announcement.learn_more?(S(),C("button",{key:0,type:"button",class:"btn btn-primary-500 text-white",onClick:e[1]||(e[1]=o=>t.$emit("learn-more",n.announcement))},L(t.$trans.get("Learn more")),1)):P("",!0),n.announcement.action_text&&n.announcement.action_url?(S(),C("a",{key:1,class:"btn btn-gray-200",href:n.announcement.action_url,target:"_blank",rel:"noopener",textContent:L(n.announcement.action_text)},null,8,Xie)):P("",!0)])):P("",!0)])],2)}
187const Qie=Ae(Vie,[["render",Jie]]),Zie={props:{announcement:{type:Object,default:null}}},ese={class:"relative z-10 flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden rounded-lg bg-white shadow-2xl"},tse=["innerHTML"],nse=["src","alt"],rse={class:"overflow-y-auto p-6"},ise={class:"mb-4 font-display text-2xl font-bold text-gray-900"},sse=["innerHTML"],ose={key:0,class:"mt-6"},ase=["href","textContent"];function lse(t,e,n,r,i,s){return S(),re(Ii,{name:"fade"},{default:Y(()=>[n.announcement?(S(),C("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:e[2]||(e[2]=ct(o=>t.$emit("close"),["self"]))},[x("div",{class:"absolute inset-0 bg-black bg-opacity-50",onClick:e[0]||(e[0]=o=>t.$emit("close"))}),x("div",ese,[x("button",{type:"button","aria-label":"Close",class:"absolute right-0 top-0 m-3 p-1 text-gray-600 hover:text-gray-900",onClick:e[1]||(e[1]=o=>t.$emit("close")),innerHTML:t.svg("feather-x","stroke-icon h-5 w-5")},null,8,tse),n.announcement.image_url?(S(),C("img",{key:0,src:n.announcement.image_url,alt:n.announcement.title,class:"max-h-56 w-full object-cover"},null,8,nse)):P("",!0),x("div",rse,[x("h2",ise,L(n.announcement.title),1),x("div",{class:"spm-rich-content leading-relaxed text-gray-700 mb-8",innerHTML:n.announcement.learn_more},null,8,sse),n.announcement.action_text&&n.announcement.action_url?(S(),C("div",ose,[x("a",{class:"btn btn-primary-500 text-white",href:n.announcement.action_url,target:"_blank",rel:"noopener",textContent:L(n.announcement.action_text)},null,8,ase)])):P("",!0)])])])):P("",!0)],void 0,!0),_:1})}const cse=Ae(Zie,[["render",lse]]),use={components:{AnnouncementCard:Qie,AnnouncementDetailsModal:cse},data(){return{dismissedIds:[],activeAnnouncement:null}},computed:{announcements(){return this.$store.getters.notifications.announcements||[]},unreadAnnouncements(){const t=this.$store.getters.user.last_read_notifications_at;return t?this.announcements.filter(e=>GC(Z0(e.created_at),Z0(t))===1):this.announcements},visibleAnnouncements(){return this.unreadAnnouncements.filter(t=>!this.dismissedIds.includes(t.id))},detailsFromStore(){return this.$store.getters.notifications.announcementDetails}},watch:{detailsFromStore(t){t&&(this.activeAnnouncement=t)}},methods:{dismiss(t){this.dismissedIds.push(t.id),this.visibleAnnouncements.length===0&&this.$store.dispatch("readNotifications")},openLearnMore(t){this.activeAnnouncement=t},closeLearnMore(){this.activeAnnouncement=null,this.$store.getters.notifications.announcementDetails&&this.$store.commit("showAnnouncementDetails",null)}}},dse={class:"fixed bottom-0 left-0 z-40 m-4 w-80 max-w-[calc(100vw-2rem)] space-y-3"};function fse(t,e,n,r,i,s){const o=z("announcement-card"),a=z("announcement-details-modal");return S(),C("div",null,[x("div",dse,[X($i,{name:"list",tag:"div",class:"space-y-3"},{default:Y(()=>[(S(!0),C(Fe,null,nt(s.visibleAnnouncements,l=>(S(),re(o,{key:l.id,announcement:l,dismissible:"",onDismiss:s.dismiss,onLearnMore:s.openLearnMore},null,8,["announcement","onDismiss","onLearnMore"]))),128))],void 0,!0),_:1})]),X(a,{announcement:i.activeAnnouncement,onClose:s.closeLearnMore},null,8,["announcement","onClose"])])}const hse=Ae(use,[["render",fse]]),pse={components:{SpmFormModal:u_,SpmTicketModal:qne,SpmTaskModal:Xne,SpmDialogModal:d_,SpmPreviewModal:f_,SpmDocsArticleModal:tre,SpmRefreshModal:Are,SpmCommandBarModal:Cie,SpmNavigationAnnouncements:hse},data(){return{}},mounted(){this.$router.beforeEach((e,n,r)=>{this.$store.getters.hasUnsavedChanges?this.$store.commit("showDialogModal",{title:this.$trans.get("Discard Changes"),text:this.$trans.get("Do you want to discard your unsaved changes?"),buttons:[{title:this.$trans.get("Discard Changes"),class:"btn-red-500",handler:()=>{this.$store.commit("setUnsavedChanges",!1),r()}},{title:this.$trans.get("Cancel"),default:!0}]}):r()});let t=this;window.Echo.connector.pusher.connection.bind("state_change",function(e){e.current=="connected"&&(t.$store.dispatch("checkAssetsVersion"),t.$route.name&&t.$route.name=="tickets-section"&&t.$store.dispatch("reloadTicketList")),e.current==="failed"&&window.Echo.connector.pusher.connect()}),window.Echo.private("notifications").listen("System\\NewVersionDeployed",()=>{t.$store.dispatch("checkAssetsVersion")}),t.$store.dispatch("initWidget"),this.mountCommandBarKeyListener()},methods:{mountCommandBarKeyListener(){const t=e=>{e.metaKey&&e.keyCode===75&&!e.shiftKey&&!e.ctrlKey&&!e.altKey&&
187(e.stopImmediatePropagation(),e.preventDefault(),this.$store.commit("showCommandBarModal"))};document.addEventListener("keydown",t,{capture:!1,passive:!1})}}},mse={class:"flex h-full"},gse={class:"flex spm-nav-left-bg rounded-r-lg"},vse={class:"flex-grow md:overflow-hidden"};function yse(t,e,n,r,i,s){const o=z("spm-refresh-modal"),a=z("spm-form-modal"),l=z("spm-task-modal"),c=z("spm-ticket-modal"),u=z("spm-docs-article-modal"),d=z("spm-preview-modal"),f=z("spm-dialog-modal"),p=z("spm-command-bar-modal"),h=z("spm-navigation-announcements"),g=z("spm-nav-left"),m=z("portal-target"),b=z("router-view");return S(),C("div",mse,[t.$store.getters.refreshRequired?(S(),re(o,{key:0})):P("",!0),t.$store.getters.formModal.show?(S(),re(a,{key:1,component:t.$store.getters.formModal.component,params:t.$store.getters.formModal.params},null,8,["component","params"])):P("",!0),t.$store.getters.taskModal.show?(S(),re(l,{key:2,component:t.$store.getters.taskModal.component,params:t.$store.getters.taskModal.params},null,8,["component","params"])):P("",!0),t.$store.getters.ticketModal.show?(S(),re(c,{key:3,component:t.$store.getters.ticketModal.component,params:t.$store.getters.ticketModal.params},null,8,["component","params"])):P("",!0),t.$store.getters.docsArticleModal.show?(S(),re(u,{key:4,component:t.$store.getters.docsArticleModal.component,params:t.$store.getters.docsArticleModal.params},null,8,["component","params"])):P("",!0),t.$store.getters.previewModal.show?(S(),re(d,{key:5})):P("",!0),t.$store.getters.dialogModal.show?(S(),re(f,{key:6})):P("",!0),t.$store.getters.commandBarModal.show?(S(),re(p,{key:7})):P("",!0),X(h),x("div",gse,[X(g),x("div",{class:K([t.$store.getters.showSubMenuLeft()?"w-60 md:w-56 3xl:w-56 m-1":"w-0 m-0","flex transition-all overflow-y-hidden flex-col spm-sidebar-bg ml-0 rounded-[0.3rem]"])},[X(m,{name:"submenuleft"})],2)]),x("div",vse,[X(b)])])}const bse=Ae(pse,[["render",yse]]),kse={BASE_URL:"/build/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_DEV_SERVER_URL:"https://std-vite.share.spacemates.io",VITE_ENABLE_BROWSER_SYNC:"false",VITE_PUSHER_APP_CLUSTER:"local",VITE_PUSHER_APP_HOST:"localhost",VITE_PUSHER_APP_KEY:"awe344uihzDRTzjh",VITE_PUSHER_APP_PORT:"6001"};NC({ATTR_ENUMERATED_COERCION:"suppress-warning",ATTR_FALSE_VALUE:!1,FILTERS:!1,RENDER_FUNCTION:!1,TRANSITION_GROUP_ROOT:!1,WATCH_ARRAY:!1});var ek;if(Array.isArray((ek=window.__pestBrowser)==null?void 0:ek.consoleLogs)&&!window.__pestBrowser.capturesConsoleWarnings){window.__pestBrowser.capturesConsoleWarnings=!0;for(const t of["warn","error"]){const e=console[t];console[t]=(...n)=>{window.__pestBrowser.consoleLogs.push({timestamp:Date.now(),message:`${t}: ${n.map(r=>{try{return String(r)}catch{return"[unprintable value]"}}).join(" ")}`}),e.apply(console,n)}}}nO(aO);Object.values(rO).forEach(t=>{t.compatConfig={...t.compatConfig,ATTR_FALSE_VALUE:!1,COMPONENT_V_MODEL:!1,WATCH_ARRAY:!1}});const Bt=FC({components:{FormModal:u_,PreviewModal:f_,DialogModal:d_,SpmRegister:sO,SpmCouponRegister:iO},created(){window.flash&&this.$notify[window.flash.type](window.flash.message)}});Bt.config.compilerOptions.whitespace="preserve";window.__pestBrowser&&(Bt.config.errorHandler=(t,e,n)=>{console.error(`Vue ${n}:`,(t==null?void 0:t.stack)??t)},Bt.config.warnHandler=(t,e,n)=>{console.warn(`Vue warning: ${t}${n}`)});const Bn=Bt.config.globalProperties,wse=document.querySelector("spm-onboard")?iZ():rZ(),xse=gte({legacy:!1,globalInjection:!0,locale:document.documentElement.lang.split("-")[0],fallbackLocale:"en",messages:Ete}),g_=()=>{if(!("serviceWorker"in navigator))throw alert("No Service Worker support!"),console.log(navigator),new Error("No Service Worker support!");if(!("PushManager"in window))throw alert("No Push API Support!"),new Error("No Push API Support!")},Sse=async()=>await navigator.serviceWorker.register("/service-worker.js",{scope:"/"});window.registerServiceWorkerWithPermission=async()=>{var e;if(g_(),Notification.permission!=="granted")return;const t=await Sse();if(await navigator.serviceWorker.ready,!window.VapidPublicKey)throw new Error("VAPID key not available");try{let n=await t.pushManager.getSubscription();n&&await n.unsubscribe(),n=await t.pushManager.subscribe({applicationServerKey:window.VapidPublicKey,userVisibleOnly:!0});const r=(e=document.head.querySelector('meta[name="csrf-token"]'))==null?void 0:e.content,i=await fetch("/auth/user/service-worker",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":r},credentials:"same-origin",body:JSON.stringify(n)});if(!i.ok){const s=await i.text();throw new Error(`Backend error: ${i.status} - ${s}`)}return navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"PUSH_SUBSCRIPTION_SUCCESS",success:!0}),n}catch(n){throw navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"PUSH_SUBSCRIPTION_SUCCESS",success:!1,error:n.message}),n}};window.installServiceWorker=async()=>
187{if(console.log("install service worker"),g_(),await Notification.requestPermission()!=="granted"){console.log("Notification permission denied");return}await window.registerServiceWorkerWithPermission()};window.Vue={prototype:Bn};Bn.$filters=YC;var tk;Object.entries(((tk=vd.options)==null?void 0:tk.directives)||{}).forEach(([t,e])=>Bt.directive(t,e));jne(Bt,new Fne({reactive:gd}));const Tse=Object.assign({
187"./components/views/auth/modals/_enable-2fa.modal.vue":()=>ne(()=>import("./_enable-2fa.modal-CogA8hU_.js"),__vite__mapDeps([80,6,1,2,4,7])),
187"./components/views/auth/profile/_edit.modal.vue":()=>ne(()=>import("./_edit.modal-pA6kOeKo.js"),__vite__mapDeps([81,6,1,2,4,7,82,32,5])),
187"./components/views/customers/_create.modal.vue":()=>ne(()=>import("./_create.modal-B_4q2QRH.js"),__vite__mapDeps([83,6,1,2,4,7,82,84,5])),
187"./components/views/customers/_edit.modal.vue":()=>ne(()=>import("./_edit.modal-BQvBy8Pe.js"),__vite__mapDeps([85,6,1,2,4,7,82,86,84,5])),
187"./components/views/customers/organizations/_create.modal.vue":()=>ne(()=>import("./_create.modal-BlMU7V8h.js"),__vite__mapDeps([87,6,1,2,4,7,82,5])),
187"./components/views/customers/organizations/_edit.modal.vue":()=>ne(()=>import("./_edit.modal-dY4WgtLu.js"),__vite__mapDeps([88,6,1,2,4,7,82,5])),
187"./components/views/docs/articles/_create.modal.vue":()=>ne(()=>import("./_create.modal-D6jj-jRQ.js"),__vite__mapDeps([89,6,1,2,4,7,82])),
187"./components/views/docs/articles/_edit-author.modal.vue":()=>ne(()=>import("./_edit-author.modal-CD4PXY66.js"),__vite__mapDeps([90,6,1,2,4,7,82])),
187"./components/views/docs/articles/_edit-redirects.modal.vue":()=>ne(()=>import("./_edit-redirects.modal-D90qWOUU.js"),__vite__mapDeps([91,4,6,1,2,7,82])),
187"./components/views/docs/articles/_edit.modal.vue":()=>ne(()=>import("./_edit.modal-Dpw2HoS1.js"),__vite__mapDeps([92,6,1,2,4,7,86,5])),
187"./components/views/docs/articles/_move.modal.vue":()=>ne(()=>import("./_move.modal-DC-1U8Wa.js"),__vite__mapDeps([93,6,1,2,4,7,82,94])),
187"./components/views/docs/articles/_show-docs-article.modal.vue":()=>ne(()=>import("./_show-docs-article.modal-BWuxukVm.js"),__vite__mapDeps([95,5,4,1,2,60,39,61,96,6,7])),
187"./components/views/docs/categories/_create.modal.vue":()=>ne(()=>import("./_create.modal-CKq010x-.js"),__vite__mapDeps([97,6,1,2,4,7,82,98])),
187"./components/views/docs/categories/_edit.modal.vue":()=>ne(()=>import("./_edit.modal-Ds3LRs9g.js"),__vite__mapDeps([99,6,1,2,4,7,82,98])),
187"./components/views/docs/categories/_move.modal.vue":()=>ne(()=>import("./_move.modal-Cds3Pln4.js"),__vite__mapDeps([100,6,1,2,4,7,82,94])),
187"./components/views/docs/settings/certificate.modal.vue":()=>ne(()=>import("./certificate.modal-B-nY7RzO.js"),__vite__mapDeps([101,6,1,2,4,7,82,5])),
187"./components/views/docs/sites/_create.modal.vue":()=>ne(()=>import("./_create.modal-DOXPY4RS.js"),__vite__mapDeps([102,6,1,2,4,7,82])),
187"./components/views/settings/access-tokens/_create-token.modal.vue":()=>ne(()=>import("./_create-token.modal-BZBheRIg.js"),__vite__mapDeps([103,6,1,2,4,7,82,5])),
187"./components/views/settings/channels/_edit-auto-reply.modal.vue":()=>ne(()=>import("./_edit-auto-reply.modal-qPTcWz62.js"),__vite__mapDeps([104,6,1,2,4,7,82,86,105,5])),
187"./components/views/settings/channels/_edit-reply-template.modal.vue":()=>ne(()=>import("./_edit-reply-template.modal-BsDksHON.js"),__vite__mapDeps([106,6,1,2,4,7,82,86,105,5])),
187"./components/views/settings/channels/_edit-signature.modal.vue":()=>ne(()=>import("./_edit-signature.modal-9Gxur1_1.js"),__vite__mapDeps([107,6,1,2,4,7,82,86,105,5])),
187"./components/views/settings/channels/_upgrade_plan.modal.vue":()=>ne(()=>import("./_upgrade_plan.modal-DGUHhARY.js"),__vite__mapDeps([108,82,1,2])),
187"./components/views/settings/event-logs/_details.modal.vue":()=>ne(()=>import("./_details.modal-BLwROfIo.js"),__vite__mapDeps([38,1,2,39,4,5,6,7,40])),
187"./components/views/settings/integrations/_custom-field-templates.modal.vue":()=>ne(()=>import("./_custom-field-templates.modal-DGOs4kHm.js"),__vite__mapDeps([109,4,1,2,82,6,7,110])),
187"./components/views/settings/integrations/_custom-ticket-sidebar.modal.vue":()=>ne(()=>import("./_custom-ticket-sidebar.modal-BpZ2LSTx.js"),__vite__mapDeps([111,5,4,1,2,6,7])),
187"./components/views/settings/integrations/_deepl-key.modal.vue":()=>ne(()=>import("./_deepl-key.modal-BK4isZ-H.js"),__vite__mapDeps([112,4,82,1,2,6,7])),
187"./components/views/settings/integrations/_shopify-sidebar.modal.vue":()=>ne(()=>import("./_shopify-sidebar.modal-CZCsQSrn.js"),__vite__mapDeps([113,5,4,1,2,82,6,7])),
187"./components/views/settings/integrations/_slack.modal.vue":()=>ne(()=>import("./_slack.modal-Bip7Mhv3.js"),__vite__mapDeps([114,82,1,2,6,4,7])),
187"./components/views/settings/integrations/_sso.modal.vue":()=>ne(()=>import("./_sso.modal-BYf898Zd.js"),__vite__mapDeps([115,82,1,2,6,4,7,5])),
187"./components/views/settings/integrations/_webhooks.modal.vue":()=>ne(()=>import("./_webhooks.modal-k2TSsL8W.js"),__vite__mapDeps([116,82,1,2,6,4,7])),
187"./components/views/settings/integrations/_xentral-sidebar.modal.vue":()=>ne(()=>import("./_xentral-sidebar.modal-CBzDmdN1.js"),__vite__mapDeps([117,5,4,1,2,82,6,7])),
187"./components/views/settings/integrations/_zapier.modal.vue":()=>ne(()=>import("./_zapier.modal-mJV1zDDX.js"),__vite__mapDeps([118,82,1,2,4,5,6,7])),
187"./components/views/settings/onboard-status/_video-product-demo.modal.vue":()=>ne(()=>import("./_video-product-demo.modal-CBVqpHzH.js"),__vite__mapDeps([119,1,2])),
187"./components/views/settings/quick-replies/_quick-reply.modal.vue":()=>ne(()=>import("./_quick-reply.modal-Cf3MJSV2.js"),__vite__mapDeps([120,6,1,2,4,7,82,86,105,5])),
187"./components/views/settings/rules/_create.modal.vue":()=>ne(()=>import("./_create.modal-BzL_Y3IZ.js"),__vite__mapDeps([121,6,1,2,4,7,82])),
187"./components/views/settings/rules/_edit.modal.vue":()=>ne(()=>import("./_edit.modal-BI92UbEk.js"),__vite__mapDeps([122,6,1,2,4,7,82])),
187"./components/views/settings/subscription/_add-coupon.modal.vue":()=>ne(()=>import("./_add-coupon.modal-Clymhuun.js"),__vite__mapDeps([123,6,1,2,4,7,82])),
187"./components/views/settings/subscription/_addon.modal.vue":()=>ne(()=>import("./_addon.modal-Cn4VIeXR.js"),__vite__mapDeps([124,6,1,2,4,7,82])),
187"./components/views/settings/subscription/_agents.modal.vue":()=>ne(()=>import("./_agents.modal-Dc63cYbQ.js"),__vite__mapDeps([125,82,1,2,126])),
187"./components/views/settings/subscription/_cancel.modal.vue":()=>ne(()=>import("./_cancel.modal-BHJtwqWp.js"),__vite__mapDeps([127,82,1,2,6,4,7])),
187"./components/views/settings/subscription/_checkout-window.modal.vue":()=>ne(()=>import("./_checkout-window.modal-CsJCOh0o.js"),__vite__mapDeps([128,82,1,2])),
187"./components/views/settings/subscription/_checkout.modal.vue":()=>ne(()=>import("./_checkout.modal-Du7RfiEH.js"),__vite__mapDeps([129,82,1,2])),
187"./components/views/settings/subscription/_plan-finder.modal.vue":()=>ne(()=>import("./_plan-finder.modal-x6ObAzar.js"),__vite__mapDeps([130,6,1,2,4,7,82,126,5])),
187"./components/views/settings/subscription/_single-addon.modal.vue":()=>ne(()=>import("./_single-addon.modal-C_eSgo9S.js"),__vite__mapDeps([131,82,1,2,126])),
187"./components/views/settings/subscription/_update-payment.modal.vue":()=>ne(()=>import("./_update-payment.modal-CJhtvbPt.js"),__vite__mapDeps([132,82,1,2])),
187"./components/views/settings/tags/_create.modal.vue":()=>ne(()=>import("./_create.modal-CVCDjSTJ.js"),__vite__mapDeps([133,6,1,2,4,7,82])),
187"./components/views/settings/tags/_edit.modal.vue":()=>ne(()=>import("./_edit.modal-lJOpYWv3.js"),__vite__mapDeps([134,6,1,2,4,7,82])),
187"./components/views/settings/teams/_create.modal.vue":()=>ne(()=>import("./_create.modal-CQ5AMbT2.js"),__vite__mapDeps([135,6,1,2,4,7,82])),
187"./components/views/settings/teams/_edit.modal.vue":()=>ne(()=>import("./_edit.modal-DGv6IUht.js"),__vite__mapDeps([136,6,1,2,4,7,82,5])),
187"./components/views/settings/users/_create.modal.vue":()=>ne(()=>import("./_create.modal-Hu0HLMIT.js"),__vite__mapDeps([137,6,1,2,4,7,82,138,5])),
187"./components/views/settings/users/_edit.modal.vue":()=>ne(()=>import("./_edit.modal-DiYYTJrt.js"),__vite__mapDeps([139,6,1,2,4,7,82,138,5])),
187"./components/views/settings/widgets/_create.modal.vue":()=>ne(()=>import("./_create.modal-wYt54ILe.js"),__vite__mapDeps([140,6,1,2,4,7,82])),
187"./components/views/tasks/modals/_create-board.modal.vue":()=>ne(()=>import("./_create-board.modal-CbKjZEgl.js"),__vite__mapDeps([141,6,1,2,4,7,82,32,86,142,5,143])),
187"./components/views/tasks/modals/_edit-status.modal.vue":()=>ne(()=>import("./_edit-status.modal-D0WtZ841.js"),__vite__mapDeps([144,6,1,2,4,7,82,32])),
187"./components/views/tasks/modals/_edit-task.modal.vue":()=>ne(()=>import("./_edit-task.modal-RxTIFTIH.js"),__vite__mapDeps([145,6,1,2,4,7,82,32,86,142,5,143])),
187"./components/views/tasks/modals/_template-picker.modal.vue":()=>ne(()=>import("./_template-picker.modal-xw_WxDmY.js"),__vite__mapDeps([146,4,1,2,5,6,7])),
187"./components/views/tasks/modals/_view-task.modal.vue":()=>ne(()=>import("./_view-task.modal-DZveDi_P.js"),__vite__mapDeps([147,142,5,4,1,2,86,6,7,143,11,148])),
187"./components/views/tickets/modals/_change-ticket-channel.modal.vue":()=>ne(()=>import("./_change-ticket-channel.modal-cKfi3Rzf.js"),__vite__mapDeps([149,6,1,2,4,7,82])),
187"./components/views/tickets/modals/_change-ticket-contact.modal.vue":()=>ne(()=>import("./_change-ticket-contact.modal-Bo7jm_H4.js"),__vite__mapDeps([150,6,1,2,4,7,82])),
187"./components/views/tickets/modals/_confirm-delete.modal.vue":()=>ne(()=>import("./_confirm-delete.modal-CLB3sr9r.js"),__vite__mapDeps([151,6,1,2,4,7])),
187"./components/views/tickets/modals/_create-ticket.modal.vue":()=>ne(()=>import("./_create-ticket.modal-l237QlSv.js"),__vite__mapDeps([152,6,1,2,4,7,82,86,5])),
187"./components/views/tickets/modals/_edit-custom-fields.modal.vue":()=>ne(()=>import("./_edit-custom-fields.modal-DYDZdsio.js"),__vite__mapDeps([153,84,6,1,2,4,7,82,5])),
187"./components/views/tickets/modals/_forward-message.modal.vue":()=>ne(()=>import("./_forward-message.modal-BhHhONLL.js"),__vite__mapDeps([154,6,1,2,4,7,82])),
187"./components/views/tickets/modals/_next-action-default.modal.vue":()=>ne(()=>import("./_next-action-default.modal-CXp1eaui.js"),__vite__mapDeps([155,6,1,2,4,7,82])),
187"./components/views/tickets/modals/_quick-reply.modal.vue":()=>ne(()=>import("./_quick-reply.modal-KtQRPv_c.js"),__vite__mapDeps([156,6,1,2,4,7,82,86,105,5])),
187"./components/views/tickets/modals/_show-docs-article.modal.vue":()=>ne(()=>import("./_show-docs-article.modal-BRD4orrB.js"),__vite__mapDeps([157,5,4,1,2,60,39,61,96,6,7])),
187"./components/views/tickets/modals/_show-raw-message.modal.vue":()=>ne(()=>import("./_show-raw-message.modal-CdYzyZpA.js"),__vite__mapDeps([158,82,1,2,39,61,5,4,6,7,40])),
187"./components/views/tickets/modals/_show-ticket.modal.vue":()=>ne(()=>import("./_show-ticket.modal-BXEG_gB2.js"),__vite__mapDeps([159,1,2,4,5,6,7])),
187"./components/views/tickets/modals/_split-message.modal.vue":()=>ne(()=>import("./_split-message.modal-ChKb20Uj.js"),__vite__mapDeps([160,6,1,2,4,7,82,5])),
187"./components/views/tickets/modals/_wait_until.modal.vue":()=>ne(()=>import("./_wait_until.modal-psnJTakp.js"),__vite__mapDeps([161,6,1,2,4,7]))
187});Bn.$modals=Tse;Bn.svg=jC;window.$trans=BC;window.$trans.setTranslation(window.translation);Bn.$trans=window.$trans;window.flatpickr&&d0&&window.flatpickr.localize(d0);gs.setDefaultProps({theme:"primary",arrow:!0,duration:0,touch:!1});Bn.$tippy=gs;Bt.use(gl);Bt.use(wse);Bt.use(oO);Bt.use(xse);Bt.use(Nte,gl);Bn.$bus=mZ();Bn.$loadScript=t=>new Promise((e,n)=>{const r=document.createElement("script");r.src=t,r.addEventListener("load",e,{once:!0}),r.addEventListener("error",n,{once:!0}),document.head.appendChild(r)});Bt.directive("auto-animate",{mounted(t,e){Xte(t,e.value)}});Bn.$clone=function(t){return JSON.parse(JSON.stringify(t))};Bn.$userHasRole=function(t,e){return e=e||gl.getters.user.roles,!!e.filter(n=>t.indexOf(n)!==-1).length};Bn.$userHasPermission=function(t,e){return gl.getters.user.roles.includes("superadmin")?!0:(e=e||gl.getters.user.permissions,!!e.filter(n=>t.indexOf(n)!==-1).length)};window.mobileCheck=function(){let t=!1;return function(e){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0)}(navigator.userAgent||navigator.vendor||window.opera),t};window.mobileAndTabletCheck=function(){let t=!1;return function(e){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
187sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0)}(navigator.userAgent||navigator.vendor||window.opera),t};Bn.$isMobile=window.mobileCheck();Bn.$isMobileOrTablet=window.mobileAndTabletCheck();const _se=wr(()=>ne(()=>import("./navigation-left-C2kcqwZs.js"),__vite__mapDeps([162,4,5,1,2,6,7,163]))),Ese=wr(()=>ne(()=>import("./_login-C5TiXknq.js"),__vite__mapDeps([164,6,1,2,4,7]))),Cse=wr(()=>ne(()=>import("./_forgotten-58cmM3za.js"),__vite__mapDeps([165,6,1,2,4,7]))),Ose=wr(()=>ne(()=>import("./_reset-JUwf1z_m.js"),__vite__mapDeps([166,6,1,2,4,7]))),Ase=wr(()=>ne(()=>import("./_centered-9GOsaJHA.js"),__vite__mapDeps([167,1,2]))),Mse=wr(()=>ne(()=>import("./index-D-ImWE9u.js"),__vite__mapDeps([168,6,1,2,4,7]))),Ise=wr(()=>ne(()=>import("./index-DfzwP_sC.js"),__vite__mapDeps([169,6,1,2,4,7,22,23])));Bt.component("SpmFindWorkspace",Mse);Bt.component("SpmLoginForm",Ese);Bt.component("SpmForgottenForm",Cse);Bt.component("SpmResetForm",Ose);Bt.component("SpmWrapperCentered",Ase);Bt.component("SpmNavLeft",_se);Bt.component("SpmApp",bse);Bt.component("SpmOnboard",Ise);Bt.component("Vuescroll",_d);Bt.directive("click-outside",{beforeMount(t,e){t.__clickOutside=n=>{t.contains(n.target)||e.value(n)},document.addEventListener("click",t.__clickOutside)},unmounted(t){document.removeEventListener("click",t.__clickOutside)}});Bt.directive("focus",{mounted(t){im(()=>t.focus())}});Bt.directive("observe-visibility",{mounted(t,e){var r;const n=typeof e.value=="function"?{callback:e.value}:e.value;t.__visibilityObserver=new IntersectionObserver(i=>n.callback(i[0].isIntersecting),{threshold:((r=n.intersection)==null?void 0:r.threshold)||0}),t.__visibilityObserver.observe(t)},unmounted(t){var e;(e=t.__visibilityObserver)==null||e.disconnect()}});window.$nodeEnv=kse;Bn.$nodeEnv=window.$nodeEnv;window.axios.interceptors.response.use(t=>{if(t&&t.data&&t.data.flash){const e=t.data.data?t.data.data:void 0,n=t.data.flash.type=="reveal"?6e3:void 0;window.Vue.prototype.$notify[t.data.flash.type](t.data.flash.message,n,e)}return t},t=>{if(typeof t.response<"u"){if(t&&t.response&&t.response.data&&t.response.data.flash&&window.Vue.prototype.$notify[t.response.data.flash.type](t.response.data.flash.message,5e3),t.response.status>=500,t.response.status===401&&location.reload(),t.response.status,t.response.status===419&&t.config&&t.response&&t.response.status===419)return window.axios.defaults.headers.common["X-CSRF-TOKEN"]=t.response.data.token,t.config.headers["X-CSRF-TOKEN"]=t.response.data.token,window.axios.request(t.config);t.response.status}return Promise.reject(t)});Bn.$formvuelar={interceptors:{response:{success:function(t){if(t&&t.data&&t.data.flash){const e=t.data.data?t.data.data:void 0;window.Vue.prototype.$notify[t.data.flash.type](t.data.flash.message,void 0,e)}return t},error:function(t){return t.config&&t.response&&t.response.status===419?(window.axios.defaults.headers.common["X-CSRF-TOKEN"]=t.response.data.token,window.axios.request(t.config)):(t&&t.response.data&&t.response.data.flash&&window.Vue.prototype.$notify[t.response.data.flash.type](t.response.data.flash.message),Promise.reject(t))}}}};Bt.mount("#app");export{he as $,WS as A,tQ as B,eQ as C,WX as D,AQ as E,us as F,Nse as G,ne as H,lQ as I,YP as J,RP as K,_m as L,UL as M,CL as N,Di as O,d$ as P,$A as Q,h_ as R,lN as S,M2 as T,an as U,Ln as V,lx as W,mt as X,tj as Y,ot as Z,UA as _,x7 as a,Re as a0,nn as a1,tr as a2,qe as a3,x1 as a4,Yn as a5,vt as a6,Ne as a7,jt as a8,T8 as a9,Iw as aA,pA as aB,kn as aa,oU as ab,Fse as ac,tg as ad,VH as ae,UH as af,WH as ag,js as ah,SW as ai,lW as aj,eW as ak,US as al,hW as am,Bse as an,HH as ao,BH as ap,WU as aq,kU as ar,k6 as as,b6 as at,w6 as au,v6 as av,Dz as aw,Am as ax,Ew as ay,Aw as az,tc as b,jw as c,lK as d,jk as e,$w as f,va as g,Om as h,AW as i,Wc as j,Gn as k,un as l,AN as m,p2 as n,TQ as o,Em as p,Fw as q,Cm as r,oG as s,BK as t,Qie as u,gs as v,Z0 as w,Bk as x,_d as y,nQ as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.