@qualityunit/liveagent-ticket-grid 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,4 +10,4 @@ Note: there are at least one loader still registered to this locale that wasn't
10
10
  "checkbox importance";border-radius:12px;box-shadow:0 0 5px 2px rgb(0 0 0 / 0.2);padding-top:6px;padding-bottom:6px}.Row.svelte-1cy1emj:hover{background-color:var(--menu-hover-bg)}.Row.Selected.svelte-1cy1emj{background-color:var(--menu-selected-bg) !important}.UserColumn.svelte-1cy1emj{grid-area:user}.StatusColumn.svelte-1cy1emj{grid-area:status;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ImportanceColumn.svelte-1cy1emj{grid-area:importance}.Checkbox.svelte-1cy1emj{grid-area:checkbox;position:relative}.StatusBar.svelte-1cy1emj{position:absolute;left:0;top:10%;content:"";width:6px;height:80%;margin-left:8px;border-radius:69px}input.svelte-1cy1emj{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(min-width: 768px){.Row.svelte-1cy1emj{display:grid;grid-template-areas:"checkbox user importance"
11
11
  "checkbox status importance";grid-template-columns:60px 3fr 1fr;height:110px;padding-bottom:5px;padding-top:5px}}@media(min-width: 900px){.Row.svelte-1cy1emj{grid-template-areas:"checkbox user status importance";grid-template-columns:60px 170px auto 190px;height:80px}}@media(min-width: 1300px){.Row.svelte-1cy1emj{grid-template-columns:60px 260px auto 230px}}`)}function Bt(e,t,i){const n=e.slice();return n[9]=t[i],n[10]=t,n[11]=i,n}function Jt(e){let t,i,n,r,s,o,l,u,a,c,f,d,g,h,_,p,T,O,M;function v(){e[6].call(s,e[11])}a=new fn({props:{row:e[9]}}),d=new _n({props:{row:e[9]}}),_=new pn({props:{row:e[9]}});function y(){return e[7](e[9])}function R(...W){return e[8](e[9],...W)}return{c(){t=A("div"),i=A("div"),n=A("div"),r=V(),s=A("input"),l=V(),u=A("div"),H(a.$$.fragment),c=V(),f=A("div"),H(d.$$.fragment),g=V(),h=A("div"),H(_.$$.fragment),L(n,"class","StatusBar svelte-1cy1emj"),lt(n,"background-color",nt(e[9].status)),L(s,"type","checkbox"),s.__value=o=e[9].conversationid,s.value=s.__value,L(s,"class","svelte-1cy1emj"),L(i,"class","Checkbox svelte-1cy1emj"),lt(i,"position","relative"),L(u,"class","UserColumn svelte-1cy1emj"),L(f,"class","StatusColumn svelte-1cy1emj"),L(h,"class","ImportanceColumn svelte-1cy1emj"),L(t,"class",p="Row "+(e[2][e[11]].__selected?"Selected":"")+" svelte-1cy1emj")},m(W,P){z(W,t,P),S(t,i),S(i,n),S(i,r),S(i,s),s.checked=e[2][e[11]].__selected,S(t,l),S(t,u),J(a,u,null),S(t,c),S(t,f),J(d,f,null),S(t,g),S(t,h),J(_,h,null),T=!0,O||(M=[fe(s,"change",v),fe(s,"click",At($r)),fe(i,"click",At(Ir)),fe(t,"click",y),fe(t,"mousedown",R)],O=!0)},p(W,P){e=W,(!T||P&4)&&lt(n,"background-color",nt(e[9].status)),(!T||P&4&&o!==(o=e[9].conversationid))&&(s.__value=o,s.value=s.__value),P&4&&(s.checked=e[2][e[11]].__selected);const U={};P&4&&(U.row=e[9]),a.$set(U);const K={};P&4&&(K.row=e[9]),d.$set(K);const ae={};P&4&&(ae.row=e[9]),_.$set(ae),(!T||P&4&&p!==(p="Row "+(e[2][e[11]].__selected?"Selected":"")+" svelte-1cy1emj"))&&L(t,"class",p)},i(W){T||(N(a.$$.fragment,W),N(d.$$.fragment,W),N(_.$$.fragment,W),T=!0)},o(W){D(a.$$.fragment,W),D(d.$$.fragment,W),D(_.$$.fragment,W),T=!1},d(W){W&&G(t),B(a),B(d),B(_),O=!1,_e(M)}}}function Er(e){let t,i,n,r=e[2],s=[];for(let a=0;a<r.length;a+=1)s[a]=Jt(Bt(e,r,a));const o=a=>D(s[a],1,1,()=>{s[a]=null}),l=e[5].default,u=Me(l,e,e[4],null);return{c(){t=A("div");for(let a=0;a<s.length;a+=1)s[a].c();i=V(),u&&u.c(),L(t,"class","Body")},m(a,c){z(a,t,c);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(t,null);S(t,i),u&&u.m(t,null),n=!0},p(a,[c]){if(c&6){r=a[2];let f;for(f=0;f<r.length;f+=1){const d=Bt(a,r,f);s[f]?(s[f].p(d,c),N(s[f],1)):(s[f]=Jt(d),s[f].c(),N(s[f],1),s[f].m(t,i))}for(he(),f=r.length;f<s.length;f+=1)o(f);pe()}u&&u.p&&(!n||c&16)&&$e(u,l,a,a[4],n?Ee(l,a[4],c,null):Ie(a[4]),null)},i(a){if(!n){for(let c=0;c<r.length;c+=1)N(s[c]);N(u,a),n=!0}},o(a){s=s.filter(Boolean);for(let c=0;c<s.length;c+=1)D(s[c]);D(u,a),n=!1},d(a){a&&G(t),en(s,a),u&&u.d(a)}}}const $r=()=>{},Ir=()=>{};function xr(e,t,i){let n,r=Y,s=()=>(r(),r=ve(a,h=>i(2,n=h)),a);e.$$.on_destroy.push(()=>r());let{$$slots:o={},$$scope:l}=t,{columns:u}=t,{data:a}=t;s();let{middleclickhandler:c}=t;function f(h){n[h].__selected=this.checked,a.set(n)}const d=h=>location.assign("#Conversation;id="+h.conversationid),g=(h,_)=>{_.button===1&&c&&(c(h.conversationid),_.preventDefault(),_.stopPropagation())};return e.$$set=h=>{"columns"in h&&i(3,u=h.columns),"data"in h&&s(i(0,a=h.data)),"middleclickhandler"in h&&i(1,c=h.middleclickhandler),"$$scope"in h&&i(4,l=h.$$scope)},[a,c,n,u,l,o,f,d,g]}class Kr extends te{constructor(t){super(),j(this,t,xr,Er,X,{columns:3,data:0,middleclickhandler:1},Mr)}}function Br(e){re(e,"svelte-7bt636","div.svelte-7bt636{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:auto}")}function Jr(e){let t,i,n;return{c(){t=A("div"),i=A("p"),n=ee(e[0]),L(t,"class","svelte-7bt636")},m(r,s){z(r,t,s),S(t,i),S(i,n)},p(r,[s]){s&1&&se(n,r[0])},i:Y,o:Y,d(r){r&&G(t)}}}function Hr(e,t,i){let n,r,s,o,l;ie(e,Ke,h=>i(8,o=h));let u,a=Te("loading");ie(e,a,h=>i(7,s=h));let c=Te("cursor");ie(e,c,h=>i(6,r=h));let f=Te("data");ie(e,f,h=>i(5,n=h));let d=Te("error");ie(e,d,h=>i(9,l=h));function g(h,_,p){return l?o("Loading failed. Please try again later."):h?"Loading...":_==null?p.length===0?o("No results match your filter. Try broadening the search criteria."):"All data loaded":"Load more data"}return e.$$.update=()=>{e.$$.dirty&224&&i(0,u=g(s,r,n))},[u,a,c,f,d,n,r,s]}class Ur extends te{constructor(t){super(),j(this,t,Hr,Jr,X,{},Br)}}function Wr(e){re(e,"svelte-1fwehqj",".load.svelte-1fwehqj{display:block}.container.svelte-1fwehqj{width:calc(100% - 16px);flex-grow:1;flex-basis:0;padding:8px;overflow-y:scroll;overflow-x:hidden;border-spacing:4px 5px;border:none}@media screen and (min-width: 768px){.load.svelte-1fwehqj{width:100%}}")}function Yr(e){let t,i,n,r,s,o;return n=new Ur({}),{c(){t=A("div"),i=A("div"),H(n.$$.fragment),L(i,"class","load svelte-1fwehqj"),L(t,"class","load svelte-1fwehqj")},m(l,u){z(l,t,u),S(t,i),J(n,i,null),e[9](i),r=!0,s||(o=fe(i,"click",function(){Ge(e[2])&&e[2].apply(this,arguments)}),s=!0)},p(l,u){e=l},i(l){r||(N(n.$$.fragment,l),r=!0)},o(l){D(n.$$.fragment,l),r=!1},d(l){l&&G(t),B(n),e[9](null),s=!1,o()}}}function Vr(e){let t,i,n,r,s;return i=new _i({props:{importanceColumn:e[5],data:e[0],selectedAll:e[4]}}),r=new Kr({props:{columns:e[8],data:e[0],middleclickhandler:e[3],$$slots:{default:[Yr]},$$scope:{ctx:e}}}),{c(){t=A("div"),H(i.$$.fragment),n=V(),H(r.$$.fragment),L(t,"class","container svelte-1fwehqj")},m(o,l){z(o,t,l),J(i,t,null),S(t,n),J(r,t,null),e[10](t),s=!0},p(o,[l]){const u={};l&32&&(u.importanceColumn=o[5]),l&1&&(u.data=o[0]),l&16&&(u.selectedAll=o[4]),i.$set(u);const a={};l&256&&(a.columns=o[8]),l&1&&(a.data=o[0]),l&8&&(a.middleclickhandler=o[3]),l&2116&&(a.$$scope={dirty:l,ctx:o}),r.$set(a)},i(o){s||(N(i.$$.fragment,o),N(r.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),D(r.$$.fragment,o),s=!1},d(o){o&&G(t),B(i),B(r),e[10](null)}}}function Qr(e,t,i){let n,r=Y,s=()=>(r(),r=ve(l,p=>i(8,n=p)),l);e.$$.on_destroy.push(()=>r());let{data:o}=t,{columns:l}=t;s();let{loadMore:u}=t,{middleclickhandler:a}=t,{selectedAll:c}=t,{sortingColumn:f}=t,d,g;tn(()=>{const p=new IntersectionObserver(T=>{T[0].isIntersecting&&u()},{root:g,threshold:.5});return p.observe(d),()=>p.unobserve(d)});function h(p){et[p?"unshift":"push"](()=>{d=p,i(6,d)})}function _(p){et[p?"unshift":"push"](()=>{g=p,i(7,g)})}return e.$$set=p=>{"data"in p&&i(0,o=p.data),"columns"in p&&s(i(1,l=p.columns)),"loadMore"in p&&i(2,u=p.loadMore),"middleclickhandler"in p&&i(3,a=p.middleclickhandler),"selectedAll"in p&&i(4,c=p.selectedAll),"sortingColumn"in p&&i(5,f=p.sortingColumn)},[o,l,u,a,c,f,d,g,n,h,_]}class Pr extends te{constructor(t){super(),j(this,t,Qr,Vr,X,{data:0,columns:1,loadMore:2,middleclickhandler:3,selectedAll:4,sortingColumn:5},Wr)}}class ct{constructor(t,i,n){qe(this,"renderer");qe(this,"name");qe(this,"sortable");this.name=t,this.renderer=i,this.sortable=n}}var Fe=globalThis&&globalThis.__awaiter||function(e,t,i,n){function r(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(c){try{a(n.next(c))}catch(f){o(f)}}function u(c){try{a(n.throw(c))}catch(f){o(f)}}function a(c){c.done?s(c.value):r(c.value).then(l,u)}a((n=n.apply(e,t||[])).next())})};const Zr="https://localhost/api/v3".replace(/\/+$/,"");class Nt{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:Zr}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||yn}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const t=this.configuration.apiKey;if(t)return typeof t=="function"?t:()=>t}get accessToken(){const t=this.configuration.accessToken;if(t)return typeof t=="function"?t:()=>Fe(this,void 0,void 0,function*(){return t})}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const qr=new Nt;class ot{constructor(t=qr){this.configuration=t,this.fetchApi=(i,n)=>Fe(this,void 0,void 0,function*(){let r={url:i,init:n};for(const o of this.middleware)o.pre&&(r=(yield o.pre(Object.assign({fetch:this.fetchApi},r)))||r);let s;try{s=yield(this.configuration.fetchApi||fetch)(r.url,r.init)}catch(o){for(const l of this.middleware)l.onError&&(s=(yield l.onError({fetch:this.fetchApi,url:r.url,init:r.init,error:o,response:s?s.clone():void 0}))||s);if(s===void 0)throw o instanceof Error?new ts(o,"The request failed and the interceptors did not return an alternative response"):o}for(const o of this.middleware)o.post&&(s=(yield o.post({fetch:this.fetchApi,url:r.url,init:r.init,response:s.clone()}))||s);return s}),this.middleware=t.middleware}withMiddleware(...t){const i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(...t){const i=t.map(n=>({pre:n}));return this.withMiddleware(...i)}withPostMiddleware(...t){const i=t.map(n=>({post:n}));return this.withMiddleware(...i)}isJsonMime(t){return t?ot.jsonRegex.test(t):!1}request(t,i){return Fe(this,void 0,void 0,function*(){const{url:n,init:r}=yield this.createFetchParams(t,i),s=yield this.fetchApi(n,r);if(s&&s.status>=200&&s.status<300)return s;throw new es(s,"Response returned an error code")})}createFetchParams(t,i){return Fe(this,void 0,void 0,function*(){let n=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(n+="?"+this.configuration.queryParamsStringify(t.query));const r=Object.assign({},this.configuration.headers,t.headers);Object.keys(r).forEach(a=>r[a]===void 0?delete r[a]:{});const s=typeof i=="function"?i:()=>Fe(this,void 0,void 0,function*(){return i}),o={method:t.method,headers:r,body:t.body,credentials:this.configuration.credentials},l=Object.assign(Object.assign({},o),yield s({init:o,context:t})),u=Object.assign(Object.assign({},l),{body:jr(l.body)||l.body instanceof URLSearchParams||Xr(l.body)?l.body:JSON.stringify(l.body)});return{url:n,init:u}})}clone(){const t=this.constructor,i=new t(this.configuration);return i.middleware=this.middleware.slice(),i}}ot.jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");function Xr(e){return typeof Blob<"u"&&e instanceof Blob}function jr(e){return typeof FormData<"u"&&e instanceof FormData}class es extends Error{constructor(t,i){super(i),this.response=t,this.name="ResponseError"}}class ts extends Error{constructor(t,i){super(i),this.cause=t,this.name="FetchError"}}class Ht extends Error{constructor(t,i){super(i),this.field=t,this.name="RequiredError"}}function m(e,t){const i=e[t];return i!=null}function yn(e,t=""){return Object.keys(e).map(i=>vn(i,e[i],t)).filter(i=>i.length>0).join("&")}function vn(e,t,i=""){const n=i+(i.length?`[${e}]`:e);if(t instanceof Array){const r=t.map(s=>encodeURIComponent(String(s))).join(`&${encodeURIComponent(n)}=`);return`${encodeURIComponent(n)}=${r}`}if(t instanceof Set){const r=Array.from(t);return vn(e,r,i)}return t instanceof Date?`${encodeURIComponent(n)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?yn(t,n):`${encodeURIComponent(n)}=${encodeURIComponent(String(t))}`}class q{constructor(t,i=n=>n){this.raw=t,this.transformer=i}value(){return Fe(this,void 0,void 0,function*(){return this.transformer(yield this.raw.json())})}}function ns(e){return is(e)}function is(e,t){return e==null?e:{departmentid:m(e,"departmentid")?e.departmentid:void 0,onlineStatus:m(e,"online_status")?e.online_status:void 0,presetStatus:m(e,"preset_status")?e.preset_status:void 0}}function rs(e){return ss(e)}function ss(e,t){return e==null?e:{agentid:m(e,"agentid")?e.agentid:void 0,firstname:m(e,"firstname")?e.firstname:void 0,lastname:m(e,"lastname")?e.lastname:void 0,systemName:m(e,"system_name")?e.system_name:void 0,username:m(e,"username")?e.username:void 0,countrycode:m(e,"countrycode")?e.countrycode:void 0,avatarUrl:m(e,"avatar_url")?e.avatar_url:void 0,roleid:m(e,"roleid")?e.roleid:void 0,departmentsStatuses:m(e,"departments_statuses")?e.departments_statuses.map(ns):void 0,twofa:m(e,"twofa")?e.twofa:void 0,lastPswdChange:m(e,"last_pswd_change")?new Date(e.last_pswd_change):void 0,userstatus:m(e,"userstatus")?e.userstatus:void 0}}function os(e){return as(e)}function as(e,t){return e==null?e:{conversationid:m(e,"conversationid")?e.conversationid:void 0,datechanged:m(e,"datechanged")?new Date(e.datechanged):void 0,status:m(e,"status")?e.status:void 0,preview:m(e,"preview")?e.preview:void 0,subject:m(e,"subject")?e.subject:void 0,departmentname:m(e,"departmentname")?e.departmentname:void 0,agentname:m(e,"agentname")?e.agentname:void 0,tags:m(e,"tags")?e.tags:void 0,firstname:m(e,"firstname")?e.firstname:void 0,lastname:m(e,"lastname")?e.lastname:void 0,systemName:m(e,"system_name")?e.system_name:void 0,emails:m(e,"emails")?e.emails:void 0,city:m(e,"city")?e.city:void 0,countrycode:m(e,"countrycode")?e.countrycode:void 0,avatarUrl:m(e,"avatar_url")?e.avatar_url:void 0,rstatus:m(e,"rstatus")?e.rstatus:void 0,statusdatestarted:m(e,"statusdatestarted")?new Date(e.statusdatestarted):void 0,chatOrder:m(e,"chat_order")?e.chat_order:void 0}}function ls(e){return us(e)}function us(e,t){return e==null?e:{id:m(e,"id")?e.id:void 0,name:m(e,"name")?e.name:void 0,type:m(e,"type")?e.type:void 0,onlineCode:m(e,"online_code")?e.online_code:void 0,offlineCode:m(e,"offline_code")?e.offline_code:void 0,onlineCodeCss:m(e,"online_code_css")?e.online_code_css:void 0,offlineCodeCss:m(e,"offline_code_css")?e.offline_code_css:void 0,provide:m(e,"provide")?e.provide:void 0,impressions:m(e,"impressions")?e.impressions:void 0,tickets:m(e,"tickets")?e.tickets:void 0,status:m(e,"status")?e.status:void 0,lastDisplayTime:m(e,"last_display_time")?e.last_display_time:void 0,lastDisplayUrl:m(e,"last_display_url")?e.last_display_url:void 0}}function ge(e){return cs(e)}function cs(e,t){return e==null?e:{count:m(e,"count")?e.count:void 0}}function fs(e){return ds(e)}function ds(e,t){return e==null?e:{id:m(e,"id")?e.id:void 0,name:m(e,"name")?e.name:void 0,agentCount:m(e,"agent_count")?e.agent_count:void 0}}function gs(e){return ms(e)}function ms(e,t){return e==null?e:{id:m(e,"id")?e.id:void 0,logid:m(e,"logid")?e.logid:void 0,line:m(e,"line")?e.line:void 0,filename:m(e,"filename")?e.filename:void 0,created:m(e,"created")?e.created:void 0,level:m(e,"level")?e.level:void 0,type:m(e,"type")?e.type:void 0,message:m(e,"message")?e.message:void 0,ip:m(e,"ip")?e.ip:void 0,groupid:m(e,"groupid")?e.groupid:void 0}}function hs(e){return ps(e)}function ps(e,t){return e==null?e:{agentid:m(e,"agentid")?e.agentid:void 0,firstname:m(e,"firstname")?e.firstname:void 0,lastname:m(e,"lastname")?e.lastname:void 0,systemName:m(e,"system_name")?e.system_name:void 0,avatarUrl:m(e,"avatar_url")?e.avatar_url:void 0,chats:m(e,"chats")?e.chats:void 0}}function _s(e){return ys(e)}function ys(e,t){return e==null?e:{name:m(e,"name")?e.name:void 0,code:m(e,"code")?e.code:void 0,engName:m(e,"eng_name")?e.eng_name:void 0,translated:m(e,"translated")?e.translated:void 0,isDefault:m(e,"is_default")?e.is_default:void 0,active:m(e,"active")?e.active:void 0,isCustom:m(e,"is_custom")?e.is_custom:void 0,isBuiltIn:m(e,"is_builtIn")?e.is_builtIn:void 0}}function vs(e){return bs(e)}function bs(e,t){return e==null?e:{codeName:m(e,"code_name")?e.code_name:void 0,name:m(e,"name")?e.name:void 0,description:m(e,"description")?e.description:void 0,active:m(e,"active")?e.active:void 0,help:m(e,"help")?e.help:void 0,multiple:m(e,"multiple")?e.multiple:void 0,configFile:m(e,"config_file")?e.config_file:void 0,price:m(e,"price")?e.price:void 0,legacyIntegration:m(e,"legacy_integration")?e.legacy_integration:void 0}}function ft(e){return ws(e)}function ws(e,t){return e==null?e:{id:m(e,"id")?e.id:void 0,conversationid:m(e,"conversationid")?e.conversationid:void 0,code:m(e,"code")?e.code:void 0,slaTicketId:m(e,"sla_ticket_id")?e.sla_ticket_id:void 0,departmentid:m(e,"departmentid")?e.departmentid:void 0,departmentName:m(e,"department_name")?e.department_name:void 0,levelid:m(e,"levelid")?e.levelid:void 0,slaLevelName:m(e,"sla_level_name")?e.sla_level_name:void 0,sla:m(e,"sla")?e.sla:void 0,dateCreated:m(e,"date_created")?e.date_created:void 0,dateClosed:m(e,"date_closed")?e.date_closed:void 0,dateDue:m(e,"date_due")?e.date_due:void 0,slaLevelId:m(e,"sla_level_id")?e.sla_level_id:void 0,slaType:m(e,"sla_type")?new Date(e.sla_type):void 0,agentid:m(e,"agentid")?e.agentid:void 0,agentFirstname:m(e,"agent_firstname")?e.agent_firstname:void 0,agentLastname:m(e,"agent_lastname")?e.agent_lastname:void 0,agentAvatarUrl:m(e,"agent_avatar_url")?e.agent_avatar_url:void 0,reqContactid:m(e,"req_contactid")?e.req_contactid:void 0,reqFirstname:m(e,"req_firstname")?e.req_firstname:void 0,reqLastname:m(e,"req_lastname")?e.req_lastname:void 0,reqSystemname:m(e,"req_systemname")?e.req_systemname:void 0,reqContactName:m(e,"req_contactName")?e.req_contactName:void 0,reqAvatarUrl:m(e,"req_avatar_url")?e.req_avatar_url:void 0}}function Ut(e){return ks(e)}function ks(e,t){return e==null?e:{tagid:m(e,"tagid")?e.tagid:void 0,name:m(e,"name")?e.name:void 0,type:m(e,"type")?e.type:void 0,color:m(e,"color")?e.color:void 0,backgroundcolor:m(e,"backgroundcolor")?e.backgroundcolor:void 0,isPublic:m(e,"is_public")?e.is_public:void 0}}function bn(e){return Ts(e)}function Ts(e,t){return e==null?e:{conversationid:m(e,"conversationid")?e.conversationid:void 0,code:m(e,"code")?e.code:void 0,datecreated:m(e,"datecreated")?new Date(e.datecreated):void 0,datechanged:m(e,"datechanged")?new Date(e.datechanged):void 0,dateresolved:m(e,"dateresolved")?new Date(e.dateresolved):void 0,statuschanged:m(e,"statuschanged")?new Date(e.statuschanged):void 0,rorder:m(e,"rorder")?e.rorder:void 0,datedue:m(e,"datedue")?new Date(e.datedue):void 0,datereopen:m(e,"datereopen")?new Date(e.datereopen):void 0,status:m(e,"status")?e.status:void 0,channelType:m(e,"channel_type")?e.channel_type:void 0,departmentid:m(e,"departmentid")?e.departmentid:void 0,agentid:m(e,"agentid")?e.agentid:void 0,preview:m(e,"preview")?e.preview:void 0,subject:m(e,"subject")?e.subject:void 0,departmentname:m(e,"departmentname")?e.departmentname:void 0,agentname:m(e,"agentname")?e.agentname:void 0,tags:m(e,"tags")?e.tags:void 0,messagegroupsIn:m(e,"messagegroups_in")?e.messagegroups_in:void 0,messagegroupsOut:m(e,"messagegroups_out")?e.messagegroups_out:void 0,contactid:m(e,"contactid")?e.contactid:void 0,parentContactid:m(e,"parent_contactid")?e.parent_contactid:void 0,firstname:m(e,"firstname")?e.firstname:void 0,lastname:m(e,"lastname")?e.lastname:void 0,systemName:m(e,"system_name")?e.system_name:void 0,emails:m(e,"emails")?e.emails:void 0,phones:m(e,"phones")?e.phones:void 0,jobPosition:m(e,"job_position")?e.job_position:void 0,contactType:m(e,"contact_type")?e.contact_type:void 0,city:m(e,"city")?e.city:void 0,countrycode:m(e,"countrycode")?e.countrycode:void 0,timeOffset:m(e,"time_offset")?e.time_offset:void 0,gender:m(e,"gender")?e.gender:void 0,levelid:m(e,"levelid")?e.levelid:void 0,groups:m(e,"groups")?e.groups:void 0,contactStatus:m(e,"contact_status")?e.contact_status:void 0,company:m(e,"company")?e.company:void 0,avatarUrl:m(e,"avatar_url")?e.avatar_url:void 0,userid:m(e,"userid")?e.userid:void 0,roleid:m(e,"roleid")?e.roleid:void 0,userstatus:m(e,"userstatus")?e.userstatus:void 0,accountuserstatus:m(e,"accountuserstatus")?e.accountuserstatus:void 0,description:m(e,"description")?e.description:void 0,note:m(e,"note")?e.note:void 0,lastActivity:m(e,"last_activity")?new Date(e.last_activity):void 0,tagnames:m(e,"tagnames")?e.tagnames:void 0,groupnames:m(e,"groupnames")?e.groupnames:void 0}}function Cs(e){return Ls(e)}function Ls(e,t){return e==null?e:{cursor:m(e,"cursor")?e.cursor:void 0,rows:m(e,"rows")?e.rows.map(bn):void 0}}function Ns(e){return Ss(e)}function Ss(e,t){return e==null?e:{id:m(e,"id")?e.id:void 0,agentid:m(e,"agentid")?e.agentid:void 0,agent:m(e,"agent")?e.agent:void 0,conversationid:m(e,"conversationid")?e.conversationid:void 0,ticket:m(e,"ticket")?e.ticket:void 0,parentContactid:m(e,"parent_contactid")?e.parent_contactid:void 0,company:m(e,"company")?e.company:void 0,contactid:m(e,"contactid")?e.contactid:void 0,customer:m(e,"customer")?e.customer:void 0,customerFirstname:m(e,"customer_firstname")?e.customer_firstname:void 0,customerLastname:m(e,"customer_lastname")?e.customer_lastname:void 0,customerSystemname:m(e,"customer_systemname")?e.customer_systemname:void 0,agentTicket:m(e,"agent_ticket")?e.agent_ticket:void 0,reportdate:m(e,"reportdate")?e.reportdate:void 0,reportedtime:m(e,"reportedtime")?e.reportedtime:void 0,reportedtimeHhmmss:m(e,"reportedtime_hhmmss")?e.reportedtime_hhmmss:void 0,spenttime:m(e,"spenttime")?e.spenttime:void 0,dateinvoiced:m(e,"dateinvoiced")?e.dateinvoiced:void 0,note:m(e,"note")?e.note:void 0,type:m(e,"type")?e.type:void 0}}var F=globalThis&&globalThis.__awaiter||function(e,t,i,n){function r(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(c){try{a(n.next(c))}catch(f){o(f)}}function u(c){try{a(n.throw(c))}catch(f){o(f)}}function a(c){c.done?s(c.value):r(c.value).then(l,u)}a((n=n.apply(e,t||[])).next())})};class wn extends ot{getAgentsGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor),t.sortField!==void 0&&(n._sortField=t.sortField);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["agent.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/agents",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(rs))})}getAgentsGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getAgentsGridListRaw(t,i)).value()})}getAgentsGridListCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["agent.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/agents/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getAgentsGridListCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getAgentsGridListCountRaw(t,i)).value()})}getCallsSlaLogGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor),t.sortField!==void 0&&(n._sortField=t.sortField);const r={};t.timezoneOffset!==void 0&&t.timezoneOffset!==null&&(r["Timezone-Offset"]=String(t.timezoneOffset)),this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["sla.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/calls/sla",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(ft))})}getCallsSlaLogGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getCallsSlaLogGridListRaw(t,i)).value()})}getCallsSlaLogGridListCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["sla.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/calls/sla/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getCallsSlaLogGridListCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getCallsSlaLogGridListCountRaw(t,i)).value()})}getChatsGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor);const r={};t.timezoneOffset!==void 0&&t.timezoneOffset!==null&&(r["Timezone-Offset"]=String(t.timezoneOffset)),this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["ticket.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/chats",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(os))})}getChatsGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getChatsGridListRaw(t,i)).value()})}getChatsGridListCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["ticket.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/chats/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getChatsGridListCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getChatsGridListCountRaw(t,i)).value()})}getChatsSlaLogGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor),t.sortField!==void 0&&(n._sortField=t.sortField);const r={};t.timezoneOffset!==void 0&&t.timezoneOffset!==null&&(r["Timezone-Offset"]=String(t.timezoneOffset)),this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["sla.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/chats/sla",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(ft))})}getChatsSlaLogGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getChatsSlaLogGridListRaw(t,i)).value()})}getChatsSlaLogGridListCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["sla.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/chats/sla/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getChatsSlaLogGridListCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getChatsSlaLogGridListCountRaw(t,i)).value()})}getContactWidgetsCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["button.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/contact-widgets/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getContactWidgetsCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getContactWidgetsCountRaw(t,i)).value()})}getContactWidgetsListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["button.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/contact-widgets",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(ls))})}getContactWidgetsList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getContactWidgetsListRaw(t,i)).value()})}getCustomerGroupsGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["tag.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/customer_groups",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(Ut))})}getCustomerGroupsGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getCustomerGroupsGridListRaw(t,i)).value()})}getDepartmensGridListCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["user.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/departments/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getDepartmensGridListCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getDepartmensGridListCountRaw(t,i)).value()})}getDepartmentsGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor),t.sortField!==void 0&&(n._sortField=t.sortField);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["user.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/departments",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(fs))})}getDepartmentsGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getDepartmentsGridListRaw(t,i)).value()})}getEventLogsGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor),t.sortField!==void 0&&(n._sortField=t.sortField);const r={};t.timezoneOffset!==void 0&&t.timezoneOffset!==null&&(r["Timezone-Offset"]=String(t.timezoneOffset)),this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["eventlogs.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/eventlogs",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(gs))})}getEventLogsGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getEventLogsGridListRaw(t,i)).value()})}getEventLogsGridListCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["eventlogs.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/eventlogs/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getEventLogsGridListCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getEventLogsGridListCountRaw(t,i)).value()})}getInviteAgentsGridListRaw(t,i){return F(this,void 0,void 0,function*(){if(t.departmentId===null||t.departmentId===void 0)throw new Ht("departmentId","Required parameter requestParameters.departmentId was null or undefined when calling getInviteAgentsGridList.");const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["user.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/{departmentId}/invite/agents".replace("{departmentId}",encodeURIComponent(String(t.departmentId))),method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(hs))})}getInviteAgentsGridList(t,i){return F(this,void 0,void 0,function*(){return yield(yield this.getInviteAgentsGridListRaw(t,i)).value()})}getLanguagesGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor),t.sortField!==void 0&&(n._sortField=t.sortField);const r={};this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/languages",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(_s))})}getLanguagesGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getLanguagesGridListRaw(t,i)).value()})}getLanguagesGridListCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/languages/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getLanguagesGridListCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getLanguagesGridListCountRaw(t,i)).value()})}getPlugindGridListRaw(t,i){return F(this,void 0,void 0,function*(){if(t.pluginPurpose===null||t.pluginPurpose===void 0)throw new Ht("pluginPurpose","Required parameter requestParameters.pluginPurpose was null or undefined when calling getPlugindGridList.");const n={};t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters),t.pluginPurpose!==void 0&&(n.pluginPurpose=t.pluginPurpose);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["plugin_settings.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/plugins",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(vs))})}getPlugindGridList(t,i){return F(this,void 0,void 0,function*(){return yield(yield this.getPlugindGridListRaw(t,i)).value()})}getTagsGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["tag.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/tags",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(Ut))})}getTagsGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getTagsGridListRaw(t,i)).value()})}getTicketsGridDatasetRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor),t.sortField!==void 0&&(n._sortField=t.sortField);const r={};t.timezoneOffset!==void 0&&t.timezoneOffset!==null&&(r["Timezone-Offset"]=String(t.timezoneOffset)),this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["ticket.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/tickets_new",method:"GET",headers:r,query:n},i);return new q(s,o=>Cs(o))})}getTicketsGridDataset(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getTicketsGridDatasetRaw(t,i)).value()})}getTicketsGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor),t.sortField!==void 0&&(n._sortField=t.sortField);const r={};t.timezoneOffset!==void 0&&t.timezoneOffset!==null&&(r["Timezone-Offset"]=String(t.timezoneOffset)),this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["ticket.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/tickets",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(bn))})}getTicketsGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getTicketsGridListRaw(t,i)).value()})}getTicketsGridListCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};t.timezoneOffset!==void 0&&t.timezoneOffset!==null&&(r["Timezone-Offset"]=String(t.timezoneOffset)),this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["ticket.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/tickets/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getTicketsGridListCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getTicketsGridListCountRaw(t,i)).value()})}getTicketsSlaLogGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor),t.sortField!==void 0&&(n._sortField=t.sortField);const r={};t.timezoneOffset!==void 0&&t.timezoneOffset!==null&&(r["Timezone-Offset"]=String(t.timezoneOffset)),this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["sla.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/tickets/sla",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(ft))})}getTicketsSlaLogGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getTicketsSlaLogGridListRaw(t,i)).value()})}getTicketsSlaLogGridListCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["sla.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/tickets/sla/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getTicketsSlaLogGridListCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getTicketsSlaLogGridListCountRaw(t,i)).value()})}getTimeReportsGridListRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.perPage!==void 0&&(n._perPage=t.perPage),t.sortDir!==void 0&&(n._sortDir=t.sortDir),t.sortField!==void 0&&(n._sortField=t.sortField),t.filters!==void 0&&(n._filters=t.filters),t.cursor!==void 0&&(n._cursor=t.cursor);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["time_report.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/reports/time",method:"GET",headers:r,query:n},i);return new q(s,o=>o.map(Ns))})}getTimeReportsGridList(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getTimeReportsGridListRaw(t,i)).value()})}getTimeReportsGridListCountRaw(t,i){return F(this,void 0,void 0,function*(){const n={};t.filters!==void 0&&(n._filters=t.filters);const r={};this.configuration&&this.configuration.accessToken&&(r.Authorization=yield this.configuration.accessToken("privileges",["time_report.read"])),this.configuration&&this.configuration.apiKey&&(r.apikey=this.configuration.apiKey("apikey"));const s=yield this.request({path:"/grid/reports/time/count",method:"GET",headers:r,query:n},i);return new q(s,o=>ge(o))})}getTimeReportsGridListCount(t={},i){return F(this,void 0,void 0,function*(){return yield(yield this.getTimeReportsGridListCountRaw(t,i)).value()})}}const Wt={Asc:"ASC",Desc:"DESC"},Yt={Conversationid:"conversationid",Code:"code",Datecreated:"datecreated",Datechanged:"datechanged",Dateresolved:"dateresolved",Statuschanged:"statuschanged",Rorder:"rorder",Datedue:"datedue",Datereopen:"datereopen",Status:"status",ChannelType:"channel_type",Departmentid:"departmentid",Agentid:"agentid",Subject:"subject",Departmentname:"departmentname",Agentname:"agentname",Tags:"tags",MessagegroupsIn:"messagegroups_in",MessagegroupsOut:"messagegroups_out",Rstatus:"rstatus",LastActivity:"last_activity"};class Ds{constructor(t,i){const n=new Nt({apiKey:t,basePath:i+"/api/v3"});this.api=new wn(n),this.tags=ue({})}async load(){let t=await this.api.getTagsGridList();t=t.reduce((i,n)=>(i[n.tagid]=n,i),{}),this.tags.set(t)}}function As(e){re(e,"svelte-xoajdi","span.svelte-xoajdi{margin-right:10px}")}function Vt(e){let t,i=(e[2]??"many")+"",n;return{c(){t=ee("of "),n=ee(i)},m(r,s){z(r,t,s),z(r,n,s)},p(r,s){s&4&&i!==(i=(r[2]??"many")+"")&&se(n,i)},d(r){r&&G(t),r&&G(n)}}}function Rs(e){let t,i,n=e[3].length+"",r,s,o,l,u,a=e[4]&&Vt(e);return{c(){t=A("span"),i=ee("Showing "),r=ee(n),s=V(),a&&a.c(),o=ee(`
12
12
  results
13
- `),L(t,"class","svelte-xoajdi")},m(c,f){z(c,t,f),S(t,i),S(t,r),S(t,s),a&&a.m(t,null),S(t,o),l||(u=fe(t,"click",e[5]),l=!0)},p(c,[f]){f&8&&n!==(n=c[3].length+"")&&se(r,n),c[4]?a?a.p(c,f):(a=Vt(c),a.c(),a.m(t,o)):a&&(a.d(1),a=null)},i:Y,o:Y,d(c){c&&G(t),a&&a.d(),l=!1,u()}}}function Os(e,t,i){let n,r=Y,s=()=>(r(),r=ve(a,_=>i(3,n=_)),a),o,l=Y,u=()=>(l(),l=ve(c,_=>i(4,o=_)),c);e.$$.on_destroy.push(()=>r()),e.$$.on_destroy.push(()=>l());let{data:a}=t;s();let{cursor:c}=t;u();let{filter:f}=t,d=null;function g(){i(2,d=null)}async function h(){let p=await Te("api").getTicketsGridListCount({filters:f,timezoneOffset:new Date().getTimezoneOffset()});i(2,d=p.count)}return e.$$set=_=>{"data"in _&&s(i(0,a=_.data)),"cursor"in _&&u(i(1,c=_.cursor)),"filter"in _&&i(6,f=_.filter)},e.$$.update=()=>{e.$$.dirty&64&&f&&g()},[a,c,d,n,o,h,f]}class Fs extends te{constructor(t){super(),j(this,t,Os,Rs,X,{data:0,cursor:1,filter:6},As)}}function zs(e){re(e,"svelte-10fvxzv","button.svelte-10fvxzv{padding:10px;margin:5px;border:none;border-radius:5px;cursor:pointer;font-size:13px;font-weight:600}")}function Gs(e){let t,i,n,r,s;const o=e[4].default,l=Me(o,e,e[3],null);return{c(){t=A("button"),l&&l.c(),L(t,"class",i=Ce(e[0])+" svelte-10fvxzv")},m(u,a){z(u,t,a),l&&l.m(t,null),n=!0,r||(s=fe(t,"click",e[1]),r=!0)},p(u,[a]){l&&l.p&&(!n||a&8)&&$e(l,o,u,u[3],n?Ee(o,u[3],a,null):Ie(u[3]),null),(!n||a&1&&i!==(i=Ce(u[0])+" svelte-10fvxzv"))&&L(t,"class",i)},i(u){n||(N(l,u),n=!0)},o(u){D(l,u),n=!1},d(u){u&&G(t),l&&l.d(u),r=!1,s()}}}function Ms(e,t,i){let{$$slots:n={},$$scope:r}=t,{onAction:s=()=>{}}=t,{className:o=""}=t;function l(){s()}return e.$$set=u=>{"onAction"in u&&i(2,s=u.onAction),"className"in u&&i(0,o=u.className),"$$scope"in u&&i(3,r=u.$$scope)},[o,l,s,r,n]}class Qt extends te{constructor(t){super(),j(this,t,Ms,Gs,X,{onAction:2,className:0},zs)}}function Es(e){re(e,"svelte-19qi61t",".NoTickets.svelte-19qi61t{width:100%;height:100%;display:flex;flex-direction:column;align-items:center}p.svelte-19qi61t{max-width:450px;font-size:13px;font-weight:400;text-align:center}h1.svelte-19qi61t{font-size:20px;font-weight:600;margin:50px auto 0 auto}img.svelte-19qi61t{max-width:300px}")}function $s(e){let t,i,n=e[0]("Change filter")+"",r,s;return t=new be({props:{className:"FilterIcon",iconLaClassName:"la-tune"}}),{c(){H(t.$$.fragment),i=V(),r=ee(n)},m(o,l){J(t,o,l),z(o,i,l),z(o,r,l),s=!0},p(o,l){(!s||l&1)&&n!==(n=o[0]("Change filter")+"")&&se(r,n)},i(o){s||(N(t.$$.fragment,o),s=!0)},o(o){D(t.$$.fragment,o),s=!1},d(o){B(t,o),o&&G(i),o&&G(r)}}}function Is(e){let t,i,n=e[0]("Configure chat button")+"",r,s;return t=new be({props:{className:"ConfigureIcon",iconLaClassName:"la-configuration"}}),{c(){H(t.$$.fragment),i=V(),r=ee(n)},m(o,l){J(t,o,l),z(o,i,l),z(o,r,l),s=!0},p(o,l){(!s||l&1)&&n!==(n=o[0]("Configure chat button")+"")&&se(r,n)},i(o){s||(N(t.$$.fragment,o),s=!0)},o(o){D(t.$$.fragment,o),s=!1},d(o){B(t,o),o&&G(i),o&&G(r)}}}function xs(e){let t,i,n,r,s,o=e[0]("No tickets found")+"",l,u,a,c=e[0]("There is no tickets to be displayed. Change filter or place chat widget on your website to reach customers.")+"",f,d,g,h,_,p,T;return h=new Qt({props:{className:"Filter",$$slots:{default:[$s]},$$scope:{ctx:e}}}),p=new Qt({props:{className:"Configure",$$slots:{default:[Is]},$$scope:{ctx:e}}}),{c(){t=A("div"),i=A("img"),r=V(),s=A("h1"),l=ee(o),u=V(),a=A("p"),f=ee(c),d=V(),g=A("div"),H(h.$$.fragment),_=V(),H(p.$$.fragment),L(i,"alt","No results placeholder"),dt(i.src,n="https://support.qualityunit.com/themes/agent/obsidian/img/no-result.svg")||L(i,"src",n),L(i,"class","svelte-19qi61t"),L(s,"class","svelte-19qi61t"),L(a,"class","svelte-19qi61t"),L(g,"class","Buttons"),L(t,"class","NoTickets svelte-19qi61t")},m(O,M){z(O,t,M),S(t,i),S(t,r),S(t,s),S(s,l),S(t,u),S(t,a),S(a,f),S(t,d),S(t,g),J(h,g,null),S(g,_),J(p,g,null),T=!0},p(O,[M]){(!T||M&1)&&o!==(o=O[0]("No tickets found")+"")&&se(l,o),(!T||M&1)&&c!==(c=O[0]("There is no tickets to be displayed. Change filter or place chat widget on your website to reach customers.")+"")&&se(f,c);const v={};M&3&&(v.$$scope={dirty:M,ctx:O}),h.$set(v);const y={};M&3&&(y.$$scope={dirty:M,ctx:O}),p.$set(y)},i(O){T||(N(h.$$.fragment,O),N(p.$$.fragment,O),T=!0)},o(O){D(h.$$.fragment,O),D(p.$$.fragment,O),T=!1},d(O){O&&G(t),B(h),B(p)}}}function Ks(e,t,i){let n;return ie(e,Ke,r=>i(0,n=r)),[n]}class Bs extends te{constructor(t){super(),j(this,t,Ks,xs,X,{},Es)}}function Js(e){re(e,"svelte-150fgq2","main.svelte-150fgq2{height:100%;display:flex;flex-direction:column}.tools.svelte-150fgq2{display:flex;align-items:center;justify-content:right;padding:0 30px}button.svelte-150fgq2{border:none;background:none;padding:0;margin:0;height:20px;width:20px}.loading.svelte-150fgq2{animation-name:svelte-150fgq2-rotate;animation-duration:1s;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes svelte-150fgq2-rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}")}function Hs(e){let t,i;return t=new Pr({props:{columns:e[3],sortingColumn:e[4],data:e[9],loadMore:e[15],middleclickhandler:e[1],selectedAll:e[8]}}),{c(){H(t.$$.fragment)},m(n,r){J(t,n,r),i=!0},p(n,r){const s={};r[0]&8&&(s.columns=n[3]),r[0]&16&&(s.sortingColumn=n[4]),r[0]&2&&(s.middleclickhandler=n[1]),t.$set(s)},i(n){i||(N(t.$$.fragment,n),i=!0)},o(n){D(t.$$.fragment,n),i=!1},d(n){B(t,n)}}}function Us(e){let t,i;return t=new Bs({}),{c(){H(t.$$.fragment)},m(n,r){J(t,n,r),i=!0},p:Y,i(n){i||(N(t.$$.fragment,n),i=!0)},o(n){D(t.$$.fragment,n),i=!1},d(n){B(t,n)}}}function Ws(e){let t,i,n,r,s,o,l,u,a,c,f,d,g,h;const _=e[23].default,p=Me(_,e,e[22],null);r=new Fs({props:{cursor:e[14],data:e[9],filter:e[0]}}),l=new be({props:{iconLaClassName:"la-refresh"}});const T=[Us,Hs],O=[];function M(v,y){return!v[6]&&!v[5]?0:1}return c=M(e),f=O[c]=T[c](e),{c(){t=A("main"),i=A("div"),p&&p.c(),n=V(),H(r.$$.fragment),s=V(),o=A("button"),H(l.$$.fragment),a=V(),f.c(),L(o,"title",u=e[2]("Reload")),L(o,"class","svelte-150fgq2"),Ft(o,"loading",e[5]),L(i,"class","tools svelte-150fgq2"),L(t,"class","svelte-150fgq2")},m(v,y){z(v,t,y),S(t,i),p&&p.m(i,null),S(i,n),J(r,i,null),S(i,s),S(i,o),J(l,o,null),S(t,a),O[c].m(t,null),d=!0,g||(h=fe(o,"click",e[24]),g=!0)},p(v,y){p&&p.p&&(!d||y[0]&4194304)&&$e(p,_,v,v[22],d?Ee(_,v[22],y,null):Ie(v[22]),null);const R={};y[0]&1&&(R.filter=v[0]),r.$set(R),(!d||y[0]&4&&u!==(u=v[2]("Reload")))&&L(o,"title",u),(!d||y[0]&32)&&Ft(o,"loading",v[5]);let W=c;c=M(v),c===W?O[c].p(v,y):(he(),D(O[W],1,1,()=>{O[W]=null}),pe(),f=O[c],f?f.p(v,y):(f=O[c]=T[c](v),f.c()),N(f,1),f.m(t,null))},i(v){d||(N(p,v),N(r.$$.fragment,v),N(l.$$.fragment,v),N(f),d=!0)},o(v){D(p,v),D(r.$$.fragment,v),D(l.$$.fragment,v),D(f),d=!1},d(v){v&&G(t),p&&p.d(v),B(r),B(l),O[c].d(),g=!1,h()}}}function Ys(e,t,i){let n,r,s,o,l,u,a,c,f=Y,d=()=>(f(),f=ve(T,I=>i(21,c=I)),T),g,h;ie(e,Ke,I=>i(2,g=I)),e.$$.on_destroy.push(()=>f());let{$$slots:_={},$$scope:p}=t,T,O,{apikey:M}=t,{filters:v}=t,{middleclickhandler:y}=t,{selectionHandler:R}=t,{basePath:W}=t,P=ue({});ie(e,P,I=>i(20,a=I));let U=ue(!1);ie(e,U,I=>i(19,u=I));let K=new Ds(M,W);K.load(),ke("tagsMap",K.tags);let ae=ue(null);ke("error",ae);const de=new Nt({apiKey:M,basePath:W+"/api/v3"}),x=new wn(de);ke("api",x);const k=ue([]);ie(e,k,I=>i(27,s=I));const C=ue(!1);ie(e,C,I=>i(6,h=I)),ke("data",k);const w=ue(Yt.Rorder);ie(e,w,I=>i(28,o=I));const b=ue(!0);ie(e,b,I=>i(29,l=I));const $=ue(!1);ie(e,$,I=>i(5,n=I)),ke("loading",$);const E=ue(null);ie(e,E,I=>i(26,r=I)),ke("cursor",E);let Q=!1,ne=()=>{const I={perPage:20,sortDir:l?Wt.Asc:Wt.Desc,filters:v,sortField:o,cursor:r||""};return console.log("createOptions",I),I},Z=async(I=!1)=>{if(!n&&!(!r&&Q&&!I)){Le($,n=!0,n),I===!0&&(Le(E,r=null,r),Q=!1);try{const ye=await(await x.getTicketsGridDatasetRaw(ne())).value();I===!0&&Le(k,s=[],s),Le(k,s=s.concat(ye.rows),s),ye.rows.length>0&&C.set(!0),Le(E,r=ye.cursor,r),Q=!0}catch(le){ae.set(le.toString())}Le($,n=!1,n)}};b.subscribe(async()=>{await Z(!0)}),w.subscribe(async()=>{await Z(!0)}),ke("direction",b),ke("sort",w),k.subscribe(I=>{P.set(I.filter(le=>le.__selected??!1).map(le=>le.conversationid))});const oe=()=>Z(!0);return e.$$set=I=>{"apikey"in I&&i(16,M=I.apikey),"filters"in I&&i(0,v=I.filters),"middleclickhandler"in I&&i(1,y=I.middleclickhandler),"selectionHandler"in I&&i(17,R=I.selectionHandler),"basePath"in I&&i(18,W=I.basePath),"$$scope"in I&&i(22,p=I.$$scope)},e.$$.update=()=>{e.$$.dirty[0]&4&&d(i(3,T=ue([new ct(g("User"),fn,!1),new ct(g("Status"),_n,!1),new ct(g("Importance"),pn,Yt.Rorder)]))),e.$$.dirty[0]&2097152&&i(4,O=c[c.length-1]),e.$$.dirty[0]&1703936&&R(a,u),e.$$.dirty[0]&1&&v&&Z(!0)},[v,y,g,T,O,n,h,P,U,k,C,w,b,$,E,Z,M,R,W,u,a,c,p,_,oe]}class Vs extends te{constructor(t){super(),j(this,t,Ys,Ws,X,{apikey:16,filters:0,middleclickhandler:1,selectionHandler:17,basePath:18},Js,[-1,-1])}}const Qs="modulepreload",Ps=function(e){return"/"+e},Pt={},Zt=function(t,i,n){if(!i||i.length===0)return t();const r=document.getElementsByTagName("link");return Promise.all(i.map(s=>{if(s=Ps(s),s in Pt)return;Pt[s]=!0;const o=s.endsWith(".css"),l=o?'[rel="stylesheet"]':"";if(!!n)for(let c=r.length-1;c>=0;c--){const f=r[c];if(f.href===s&&(!o||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${l}`))return;const a=document.createElement("link");if(a.rel=o?"stylesheet":Qs,o||(a.as="script",a.crossOrigin=""),a.href=s,document.head.appendChild(a),o)return new Promise((c,f)=>{a.addEventListener("load",c),a.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t())};function Zs(){Et("en",()=>Zt(()=>import("./en.js"),[])),Et("sk",()=>Zt(()=>import("./sk.js"),[]))}function qt(e){let t,i;return t=new Vs({props:{apikey:e[0],basePath:e[3],filters:e[1],middleclickhandler:e[2],selectionHandler:e[4],$$slots:{default:[qs]},$$scope:{ctx:e}}}),{c(){H(t.$$.fragment)},m(n,r){J(t,n,r),i=!0},p(n,r){const s={};r&1&&(s.apikey=n[0]),r&8&&(s.basePath=n[3]),r&2&&(s.filters=n[1]),r&4&&(s.middleclickhandler=n[2]),r&512&&(s.$$scope={dirty:r,ctx:n}),t.$set(s)},i(n){i||(N(t.$$.fragment,n),i=!0)},o(n){D(t.$$.fragment,n),i=!1},d(n){B(t,n)}}}function qs(e){let t;return{c(){t=A("slot")},m(i,n){z(i,t,n)},p:Y,d(i){i&&G(t)}}}function Xs(e){let t,i,n,r,s=e[0]&&e[3]&&qt(e);return{c(){s&&s.c(),t=V(),i=A("link"),this.c=Y,L(i,"rel","stylesheet"),L(i,"href",n=e[3]+"/themes/agent/_common_templates/icons_mapping.css")},m(o,l){s&&s.m(o,l),z(o,t,l),z(o,i,l),r=!0},p(o,[l]){o[0]&&o[3]?s?(s.p(o,l),l&9&&N(s,1)):(s=qt(o),s.c(),N(s,1),s.m(t.parentNode,t)):s&&(he(),D(s,1,1,()=>{s=null}),pe()),(!r||l&8&&n!==(n=o[3]+"/themes/agent/_common_templates/icons_mapping.css"))&&L(i,"href",n)},i(o){r||(N(s),r=!0)},o(o){D(s),r=!1},d(o){s&&s.d(o),o&&G(t),o&&G(i)}}}function js(e,t,i){Zs();let{lang:n="sk"}=t,{apikey:r}=t,{filters:s='[["rstatus","IN","A,P,T,N,C,R,W"],["channel_type","IN","B,M,E,F,A,I,Q,S,C,W,T,V"]]'}=t,{middleclickhandler:o}=t,{selectionhandler:l}=t,{selectionMap:u={}}=t,{selectedAll:a=!1}=t,{basepath:c}=t;si({initialLocale:n,fallbackLocale:"en"}),ui();function f(d,g){i(5,u=d),i(6,a=g),l&&l(d,g)}return e.$$set=d=>{"lang"in d&&i(7,n=d.lang),"apikey"in d&&i(0,r=d.apikey),"filters"in d&&i(1,s=d.filters),"middleclickhandler"in d&&i(2,o=d.middleclickhandler),"selectionhandler"in d&&i(8,l=d.selectionhandler),"selectionMap"in d&&i(5,u=d.selectionMap),"selectedAll"in d&&i(6,a=d.selectedAll),"basepath"in d&&i(3,c=d.basepath)},[r,s,o,c,f,u,a,n,l]}class eo extends rn{constructor(t){super(),j(this,{target:this.shadowRoot,props:zn(this.attributes),customElement:!0},js,Xs,X,{lang:7,apikey:0,filters:1,middleclickhandler:2,selectionhandler:8,selectionMap:5,selectedAll:6,basepath:3},null),t&&(t.target&&z(t.target,this,t.anchor),t.props&&(this.$set(t.props),me()))}static get observedAttributes(){return["lang","apikey","filters","middleclickhandler","selectionhandler","selectionMap","selectedAll","basepath"]}get lang(){return this.$$.ctx[7]}set lang(t){this.$$set({lang:t}),me()}get apikey(){return this.$$.ctx[0]}set apikey(t){this.$$set({apikey:t}),me()}get filters(){return this.$$.ctx[1]}set filters(t){this.$$set({filters:t}),me()}get middleclickhandler(){return this.$$.ctx[2]}set middleclickhandler(t){this.$$set({middleclickhandler:t}),me()}get selectionhandler(){return this.$$.ctx[8]}set selectionhandler(t){this.$$set({selectionhandler:t}),me()}get selectionMap(){return this.$$.ctx[5]}set selectionMap(t){this.$$set({selectionMap:t}),me()}get selectedAll(){return this.$$.ctx[6]}set selectedAll(t){this.$$set({selectedAll:t}),me()}get basepath(){return this.$$.ctx[3]}set basepath(t){this.$$set({basepath:t}),me()}}customElements.define("tickets-table",eo);
13
+ `),L(t,"class","svelte-xoajdi")},m(c,f){z(c,t,f),S(t,i),S(t,r),S(t,s),a&&a.m(t,null),S(t,o),l||(u=fe(t,"click",e[5]),l=!0)},p(c,[f]){f&8&&n!==(n=c[3].length+"")&&se(r,n),c[4]?a?a.p(c,f):(a=Vt(c),a.c(),a.m(t,o)):a&&(a.d(1),a=null)},i:Y,o:Y,d(c){c&&G(t),a&&a.d(),l=!1,u()}}}function Os(e,t,i){let n,r=Y,s=()=>(r(),r=ve(a,_=>i(3,n=_)),a),o,l=Y,u=()=>(l(),l=ve(c,_=>i(4,o=_)),c);e.$$.on_destroy.push(()=>r()),e.$$.on_destroy.push(()=>l());let{data:a}=t;s();let{cursor:c}=t;u();let{filter:f}=t,d=null;function g(){i(2,d=null)}async function h(){let p=await Te("api").getTicketsGridListCount({filters:f,timezoneOffset:new Date().getTimezoneOffset()});i(2,d=p.count)}return e.$$set=_=>{"data"in _&&s(i(0,a=_.data)),"cursor"in _&&u(i(1,c=_.cursor)),"filter"in _&&i(6,f=_.filter)},e.$$.update=()=>{e.$$.dirty&64&&f&&g()},[a,c,d,n,o,h,f]}class Fs extends te{constructor(t){super(),j(this,t,Os,Rs,X,{data:0,cursor:1,filter:6},As)}}function zs(e){re(e,"svelte-10fvxzv","button.svelte-10fvxzv{padding:10px;margin:5px;border:none;border-radius:5px;cursor:pointer;font-size:13px;font-weight:600}")}function Gs(e){let t,i,n,r,s;const o=e[4].default,l=Me(o,e,e[3],null);return{c(){t=A("button"),l&&l.c(),L(t,"class",i=Ce(e[0])+" svelte-10fvxzv")},m(u,a){z(u,t,a),l&&l.m(t,null),n=!0,r||(s=fe(t,"click",e[1]),r=!0)},p(u,[a]){l&&l.p&&(!n||a&8)&&$e(l,o,u,u[3],n?Ee(o,u[3],a,null):Ie(u[3]),null),(!n||a&1&&i!==(i=Ce(u[0])+" svelte-10fvxzv"))&&L(t,"class",i)},i(u){n||(N(l,u),n=!0)},o(u){D(l,u),n=!1},d(u){u&&G(t),l&&l.d(u),r=!1,s()}}}function Ms(e,t,i){let{$$slots:n={},$$scope:r}=t,{onAction:s=()=>{}}=t,{className:o=""}=t;function l(){s()}return e.$$set=u=>{"onAction"in u&&i(2,s=u.onAction),"className"in u&&i(0,o=u.className),"$$scope"in u&&i(3,r=u.$$scope)},[o,l,s,r,n]}class Qt extends te{constructor(t){super(),j(this,t,Ms,Gs,X,{onAction:2,className:0},zs)}}function Es(e){re(e,"svelte-19qi61t",".NoTickets.svelte-19qi61t{width:100%;height:100%;display:flex;flex-direction:column;align-items:center}p.svelte-19qi61t{max-width:450px;font-size:13px;font-weight:400;text-align:center}h1.svelte-19qi61t{font-size:20px;font-weight:600;margin:50px auto 0 auto}img.svelte-19qi61t{max-width:300px}")}function $s(e){let t,i,n=e[0]("Change filter")+"",r,s;return t=new be({props:{className:"FilterIcon",iconLaClassName:"la-tune"}}),{c(){H(t.$$.fragment),i=V(),r=ee(n)},m(o,l){J(t,o,l),z(o,i,l),z(o,r,l),s=!0},p(o,l){(!s||l&1)&&n!==(n=o[0]("Change filter")+"")&&se(r,n)},i(o){s||(N(t.$$.fragment,o),s=!0)},o(o){D(t.$$.fragment,o),s=!1},d(o){B(t,o),o&&G(i),o&&G(r)}}}function Is(e){let t,i,n=e[0]("Configure chat button")+"",r,s;return t=new be({props:{className:"ConfigureIcon",iconLaClassName:"la-configuration"}}),{c(){H(t.$$.fragment),i=V(),r=ee(n)},m(o,l){J(t,o,l),z(o,i,l),z(o,r,l),s=!0},p(o,l){(!s||l&1)&&n!==(n=o[0]("Configure chat button")+"")&&se(r,n)},i(o){s||(N(t.$$.fragment,o),s=!0)},o(o){D(t.$$.fragment,o),s=!1},d(o){B(t,o),o&&G(i),o&&G(r)}}}function xs(e){let t,i,n,r,s,o=e[0]("No tickets found")+"",l,u,a,c=e[0]("There is no tickets to be displayed. Change filter or place chat widget on your website to reach customers.")+"",f,d,g,h,_,p,T;return h=new Qt({props:{className:"Filter",$$slots:{default:[$s]},$$scope:{ctx:e}}}),p=new Qt({props:{className:"Configure",$$slots:{default:[Is]},$$scope:{ctx:e}}}),{c(){t=A("div"),i=A("img"),r=V(),s=A("h1"),l=ee(o),u=V(),a=A("p"),f=ee(c),d=V(),g=A("div"),H(h.$$.fragment),_=V(),H(p.$$.fragment),L(i,"alt","No results placeholder"),dt(i.src,n="https://support.qualityunit.com/themes/agent/obsidian/img/no-result.svg")||L(i,"src",n),L(i,"class","svelte-19qi61t"),L(s,"class","svelte-19qi61t"),L(a,"class","svelte-19qi61t"),L(g,"class","Buttons"),L(t,"class","NoTickets svelte-19qi61t")},m(O,M){z(O,t,M),S(t,i),S(t,r),S(t,s),S(s,l),S(t,u),S(t,a),S(a,f),S(t,d),S(t,g),J(h,g,null),S(g,_),J(p,g,null),T=!0},p(O,[M]){(!T||M&1)&&o!==(o=O[0]("No tickets found")+"")&&se(l,o),(!T||M&1)&&c!==(c=O[0]("There is no tickets to be displayed. Change filter or place chat widget on your website to reach customers.")+"")&&se(f,c);const v={};M&3&&(v.$$scope={dirty:M,ctx:O}),h.$set(v);const y={};M&3&&(y.$$scope={dirty:M,ctx:O}),p.$set(y)},i(O){T||(N(h.$$.fragment,O),N(p.$$.fragment,O),T=!0)},o(O){D(h.$$.fragment,O),D(p.$$.fragment,O),T=!1},d(O){O&&G(t),B(h),B(p)}}}function Ks(e,t,i){let n;return ie(e,Ke,r=>i(0,n=r)),[n]}class Bs extends te{constructor(t){super(),j(this,t,Ks,xs,X,{},Es)}}function Js(e){re(e,"svelte-150fgq2","main.svelte-150fgq2{height:100%;display:flex;flex-direction:column}.tools.svelte-150fgq2{display:flex;align-items:center;justify-content:right;padding:0 30px}button.svelte-150fgq2{border:none;background:none;padding:0;margin:0;height:20px;width:20px}.loading.svelte-150fgq2{animation-name:svelte-150fgq2-rotate;animation-duration:1s;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes svelte-150fgq2-rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}")}function Hs(e){let t,i;return t=new Pr({props:{columns:e[3],sortingColumn:e[4],data:e[9],loadMore:e[15],middleclickhandler:e[1],selectedAll:e[8]}}),{c(){H(t.$$.fragment)},m(n,r){J(t,n,r),i=!0},p(n,r){const s={};r[0]&8&&(s.columns=n[3]),r[0]&16&&(s.sortingColumn=n[4]),r[0]&2&&(s.middleclickhandler=n[1]),t.$set(s)},i(n){i||(N(t.$$.fragment,n),i=!0)},o(n){D(t.$$.fragment,n),i=!1},d(n){B(t,n)}}}function Us(e){let t,i;return t=new Bs({}),{c(){H(t.$$.fragment)},m(n,r){J(t,n,r),i=!0},p:Y,i(n){i||(N(t.$$.fragment,n),i=!0)},o(n){D(t.$$.fragment,n),i=!1},d(n){B(t,n)}}}function Ws(e){let t,i,n,r,s,o,l,u,a,c,f,d,g,h;const _=e[23].default,p=Me(_,e,e[22],null);r=new Fs({props:{cursor:e[14],data:e[9],filter:e[0]}}),l=new be({props:{iconLaClassName:"la-refresh"}});const T=[Us,Hs],O=[];function M(v,y){return!v[6]&&!v[5]?0:1}return c=M(e),f=O[c]=T[c](e),{c(){t=A("main"),i=A("div"),p&&p.c(),n=V(),H(r.$$.fragment),s=V(),o=A("button"),H(l.$$.fragment),a=V(),f.c(),L(o,"title",u=e[2]("Reload")),L(o,"class","svelte-150fgq2"),Ft(o,"loading",e[5]),L(i,"class","tools svelte-150fgq2"),L(t,"class","svelte-150fgq2")},m(v,y){z(v,t,y),S(t,i),p&&p.m(i,null),S(i,n),J(r,i,null),S(i,s),S(i,o),J(l,o,null),S(t,a),O[c].m(t,null),d=!0,g||(h=fe(o,"click",e[24]),g=!0)},p(v,y){p&&p.p&&(!d||y[0]&4194304)&&$e(p,_,v,v[22],d?Ee(_,v[22],y,null):Ie(v[22]),null);const R={};y[0]&1&&(R.filter=v[0]),r.$set(R),(!d||y[0]&4&&u!==(u=v[2]("Reload")))&&L(o,"title",u),(!d||y[0]&32)&&Ft(o,"loading",v[5]);let W=c;c=M(v),c===W?O[c].p(v,y):(he(),D(O[W],1,1,()=>{O[W]=null}),pe(),f=O[c],f?f.p(v,y):(f=O[c]=T[c](v),f.c()),N(f,1),f.m(t,null))},i(v){d||(N(p,v),N(r.$$.fragment,v),N(l.$$.fragment,v),N(f),d=!0)},o(v){D(p,v),D(r.$$.fragment,v),D(l.$$.fragment,v),D(f),d=!1},d(v){v&&G(t),p&&p.d(v),B(r),B(l),O[c].d(),g=!1,h()}}}function Ys(e,t,i){let n,r,s,o,l,u,a,c,f=Y,d=()=>(f(),f=ve(T,I=>i(21,c=I)),T),g,h;ie(e,Ke,I=>i(2,g=I)),e.$$.on_destroy.push(()=>f());let{$$slots:_={},$$scope:p}=t,T,O,{apikey:M}=t,{filters:v}=t,{middleclickhandler:y}=t,{selectionHandler:R}=t,{basePath:W}=t,P=ue({});ie(e,P,I=>i(20,a=I));let U=ue(!1);ie(e,U,I=>i(19,u=I));let K=new Ds(M,W);K.load(),ke("tagsMap",K.tags);let ae=ue(null);ke("error",ae);const de=new Nt({apiKey:M,basePath:W+"/api/v3"}),x=new wn(de);ke("api",x);const k=ue([]);ie(e,k,I=>i(27,s=I));const C=ue(!1);ie(e,C,I=>i(6,h=I)),ke("data",k);const w=ue(Yt.Rorder);ie(e,w,I=>i(28,o=I));const b=ue(!0);ie(e,b,I=>i(29,l=I));const $=ue(!1);ie(e,$,I=>i(5,n=I)),ke("loading",$);const E=ue(null);ie(e,E,I=>i(26,r=I)),ke("cursor",E);let Q=!1,ne=()=>{const I={perPage:20,sortDir:l?Wt.Asc:Wt.Desc,filters:v,sortField:o,cursor:r||""};return console.log("createOptions",I),I},Z=async(I=!1)=>{if(!n&&!(!r&&Q&&!I)){Le($,n=!0,n),I===!0&&(Le(E,r=null,r),Q=!1);try{const ye=await(await x.getTicketsGridDatasetRaw(ne())).value();I===!0&&Le(k,s=[],s),Le(k,s=s.concat(ye.rows),s),ye.rows.length>0&&C.set(!0),Le(E,r=ye.cursor,r),Q=!0}catch(le){ae.set(le.toString())}Le($,n=!1,n)}};b.subscribe(async()=>{await Z(!0)}),w.subscribe(async()=>{await Z(!0)}),ke("direction",b),ke("sort",w),k.subscribe(I=>{P.set(I.filter(le=>le.__selected??!1).map(le=>le.conversationid))});const oe=()=>Z(!0);return e.$$set=I=>{"apikey"in I&&i(16,M=I.apikey),"filters"in I&&i(0,v=I.filters),"middleclickhandler"in I&&i(1,y=I.middleclickhandler),"selectionHandler"in I&&i(17,R=I.selectionHandler),"basePath"in I&&i(18,W=I.basePath),"$$scope"in I&&i(22,p=I.$$scope)},e.$$.update=()=>{e.$$.dirty[0]&4&&d(i(3,T=ue([new ct(g("User"),fn,!1),new ct(g("Status"),_n,!1),new ct(g("Importance"),pn,Yt.Rorder)]))),e.$$.dirty[0]&2097152&&i(4,O=c[c.length-1]),e.$$.dirty[0]&1703936&&R(a,u),e.$$.dirty[0]&1&&v&&Z(!0)},[v,y,g,T,O,n,h,P,U,k,C,w,b,$,E,Z,M,R,W,u,a,c,p,_,oe]}class Vs extends te{constructor(t){super(),j(this,t,Ys,Ws,X,{apikey:16,filters:0,middleclickhandler:1,selectionHandler:17,basePath:18},Js,[-1,-1])}}const Qs="modulepreload",Ps=function(e){return"/"+e},Pt={},Zt=function(t,i,n){if(!i||i.length===0)return t();const r=document.getElementsByTagName("link");return Promise.all(i.map(s=>{if(s=Ps(s),s in Pt)return;Pt[s]=!0;const o=s.endsWith(".css"),l=o?'[rel="stylesheet"]':"";if(!!n)for(let c=r.length-1;c>=0;c--){const f=r[c];if(f.href===s&&(!o||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${l}`))return;const a=document.createElement("link");if(a.rel=o?"stylesheet":Qs,o||(a.as="script",a.crossOrigin=""),a.href=s,document.head.appendChild(a),o)return new Promise((c,f)=>{a.addEventListener("load",c),a.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t())};function Zs(){Et("en",()=>Zt(()=>import("./en.js"),[])),Et("sk",()=>Zt(()=>import("./sk.js"),[]))}function qt(e){let t,i;return t=new Vs({props:{apikey:e[0],basePath:e[3],filters:e[1],middleclickhandler:e[2],selectionHandler:e[4],$$slots:{default:[qs]},$$scope:{ctx:e}}}),{c(){H(t.$$.fragment)},m(n,r){J(t,n,r),i=!0},p(n,r){const s={};r&1&&(s.apikey=n[0]),r&8&&(s.basePath=n[3]),r&2&&(s.filters=n[1]),r&4&&(s.middleclickhandler=n[2]),r&512&&(s.$$scope={dirty:r,ctx:n}),t.$set(s)},i(n){i||(N(t.$$.fragment,n),i=!0)},o(n){D(t.$$.fragment,n),i=!1},d(n){B(t,n)}}}function qs(e){let t;return{c(){t=A("slot")},m(i,n){z(i,t,n)},p:Y,d(i){i&&G(t)}}}function Xs(e){let t,i,n,r,s=e[0]&&qt(e);return{c(){s&&s.c(),t=V(),i=A("link"),this.c=Y,L(i,"rel","stylesheet"),L(i,"href",n=e[3]+"/themes/agent/_common_templates/icons_mapping.css")},m(o,l){s&&s.m(o,l),z(o,t,l),z(o,i,l),r=!0},p(o,[l]){o[0]?s?(s.p(o,l),l&1&&N(s,1)):(s=qt(o),s.c(),N(s,1),s.m(t.parentNode,t)):s&&(he(),D(s,1,1,()=>{s=null}),pe()),(!r||l&8&&n!==(n=o[3]+"/themes/agent/_common_templates/icons_mapping.css"))&&L(i,"href",n)},i(o){r||(N(s),r=!0)},o(o){D(s),r=!1},d(o){s&&s.d(o),o&&G(t),o&&G(i)}}}function js(e,t,i){Zs();let{lang:n="sk"}=t,{apikey:r}=t,{filters:s='[["rstatus","IN","A,P,T,N,C,R,W"],["channel_type","IN","B,M,E,F,A,I,Q,S,C,W,T,V"]]'}=t,{middleclickhandler:o}=t,{selectionhandler:l}=t,{selectionMap:u={}}=t,{selectedAll:a=!1}=t,{basepath:c}=t;si({initialLocale:n,fallbackLocale:"en"}),ui();function f(d,g){i(5,u=d),i(6,a=g),l&&l(d,g)}return e.$$set=d=>{"lang"in d&&i(7,n=d.lang),"apikey"in d&&i(0,r=d.apikey),"filters"in d&&i(1,s=d.filters),"middleclickhandler"in d&&i(2,o=d.middleclickhandler),"selectionhandler"in d&&i(8,l=d.selectionhandler),"selectionMap"in d&&i(5,u=d.selectionMap),"selectedAll"in d&&i(6,a=d.selectedAll),"basepath"in d&&i(3,c=d.basepath)},[r,s,o,c,f,u,a,n,l]}class eo extends rn{constructor(t){super(),j(this,{target:this.shadowRoot,props:zn(this.attributes),customElement:!0},js,Xs,X,{lang:7,apikey:0,filters:1,middleclickhandler:2,selectionhandler:8,selectionMap:5,selectedAll:6,basepath:3},null),t&&(t.target&&z(t.target,this,t.anchor),t.props&&(this.$set(t.props),me()))}static get observedAttributes(){return["lang","apikey","filters","middleclickhandler","selectionhandler","selectionMap","selectedAll","basepath"]}get lang(){return this.$$.ctx[7]}set lang(t){this.$$set({lang:t}),me()}get apikey(){return this.$$.ctx[0]}set apikey(t){this.$$set({apikey:t}),me()}get filters(){return this.$$.ctx[1]}set filters(t){this.$$set({filters:t}),me()}get middleclickhandler(){return this.$$.ctx[2]}set middleclickhandler(t){this.$$set({middleclickhandler:t}),me()}get selectionhandler(){return this.$$.ctx[8]}set selectionhandler(t){this.$$set({selectionhandler:t}),me()}get selectionMap(){return this.$$.ctx[5]}set selectionMap(t){this.$$set({selectionMap:t}),me()}get selectedAll(){return this.$$.ctx[6]}set selectedAll(t){this.$$set({selectedAll:t}),me()}get basepath(){return this.$$.ctx[3]}set basepath(t){this.$$set({basepath:t}),me()}}customElements.define("tickets-table",eo);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qualityunit/liveagent-ticket-grid",
3
3
  "private": false,
4
- "version": "0.0.10",
4
+ "version": "0.0.12",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",