ysyt-react-agent-lib 1.2.22 → 1.2.23

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BSJJAI7K.js"),s=require("react"),i=require("./index-Dev0_tt5.js"),c=s.memo(({open:n,onCallBack:r,queryFetch:x})=>{const[o,a]=s.useState([]);return s.useEffect(()=>{(async()=>{try{await x({success:t=>{a(t.data||[])}})}catch(t){console.log(t)}})()},[n]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(i.Modal,{open:n,title:"咨询",footer:!1,onCancel:()=>r(),children:e.jsxRuntimeExports.jsx(e.ModelBody,{children:o.length===0?e.jsxRuntimeExports.jsx(e.Empty,{image:e.Empty.PRESENTED_IMAGE_SIMPLE,description:"暂无咨询坐席"}):e.jsxRuntimeExports.jsx(e.Space,{wrap:!0,children:o.map(t=>e.jsxRuntimeExports.jsx(i.Tag,{color:"processing",onClick:()=>r(t.agent_no),children:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"zixun"}),e.jsxRuntimeExports.jsxs("span",{style:{marginLeft:10},children:["咨询坐席: ",t.agent_name]})]})},t.agent_no))})})})})});exports.default=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-D50bW92-.js"),s=require("react"),i=require("./index-BY2TV2hZ.js"),c=s.memo(({open:n,onCallBack:r,queryFetch:x})=>{const[o,a]=s.useState([]);return s.useEffect(()=>{(async()=>{try{await x({success:t=>{a(t.data||[])}})}catch(t){console.log(t)}})()},[n]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(i.Modal,{open:n,title:"咨询",footer:!1,onCancel:()=>r(),children:e.jsxRuntimeExports.jsx(e.ModelBody,{children:o.length===0?e.jsxRuntimeExports.jsx(e.Empty,{image:e.Empty.PRESENTED_IMAGE_SIMPLE,description:"暂无咨询坐席"}):e.jsxRuntimeExports.jsx(e.Space,{wrap:!0,children:o.map(t=>e.jsxRuntimeExports.jsx(i.Tag,{color:"processing",onClick:()=>r(t.agent_no),children:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"zixun"}),e.jsxRuntimeExports.jsxs("span",{style:{marginLeft:10},children:["咨询坐席: ",t.agent_name]})]})},t.agent_no))})})})})});exports.default=c;
@@ -1,6 +1,6 @@
1
- import { j as e, M as l, E as r, S as i, Y as d } from "./index-CyAAnwN2.mjs";
1
+ import { j as e, M as l, E as r, S as i, Y as d } from "./index-C0zVL8Ds.mjs";
2
2
  import { memo as m, useState as g, useEffect as x } from "react";
3
- import { M as p, T as j } from "./index-DCHu5DBN.mjs";
3
+ import { M as p, T as j } from "./index-Dv5Ck8CL.mjs";
4
4
  const E = m(({ open: t, onCallBack: a, queryFetch: o }) => {
5
5
  const [n, c] = g([]);
6
6
  return x(() => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BSJJAI7K.js"),t=require("react"),l=require("./index-Dev0_tt5.js"),m=t.memo(({open:o,onCallBack:n,queryFetch:u})=>{const[x,p]=t.useState([]),[r,c]=t.useState(0),[i,d]=t.useState(""),[j,a]=t.useState(!1);return t.useEffect(()=>{(async()=>{a(!0);try{await u({success:s=>{p(s.data||[])}})}catch(s){console.log(s)}a(!1)})()},[o]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(l.Modal,{open:o,title:"转接",footer:!1,onCancel:()=>n(),children:e.jsxRuntimeExports.jsxs(e.ModelBody,{children:[e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(e.Radio.Group,{options:[{label:"转接坐席",value:0},{label:"转接外线",value:1}],value:r,onChange:s=>c(s.target.value)})}),e.jsxRuntimeExports.jsx(e.Spin,{spinning:j,children:e.jsxRuntimeExports.jsxs("div",{style:{borderTop:"1px solid #eee",marginTop:10,paddingTop:10},children:[r===0&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:x.length===0?e.jsxRuntimeExports.jsx(e.Empty,{image:e.Empty.PRESENTED_IMAGE_SIMPLE,description:"暂无转接坐席"}):e.jsxRuntimeExports.jsx(e.Space,{wrap:!0,children:x.map(s=>e.jsxRuntimeExports.jsx(l.Tag,{color:"processing",onClick:()=>n(s.agent_no,0),children:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"zixun"}),e.jsxRuntimeExports.jsxs("span",{style:{marginRight:10},children:["转接坐席: ",s.agent_name]})]})},s.agent_no))})}),r===1&&e.jsxRuntimeExports.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center",gap:"0 5px"},children:[e.jsxRuntimeExports.jsx(e.Input,{style:{flex:1},value:i,onChange:s=>d(s.target.value),placeholder:"请输入外线号码, 回车转接",onPressEnter:()=>{n(i,1)}}),e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"boda",color:"#1D92E9",size:25,onClick:()=>{n(i,1)}})]})]})})]})})})});exports.default=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-D50bW92-.js"),t=require("react"),l=require("./index-BY2TV2hZ.js"),m=t.memo(({open:o,onCallBack:n,queryFetch:u})=>{const[x,p]=t.useState([]),[r,c]=t.useState(0),[i,d]=t.useState(""),[j,a]=t.useState(!1);return t.useEffect(()=>{(async()=>{a(!0);try{await u({success:s=>{p(s.data||[])}})}catch(s){console.log(s)}a(!1)})()},[o]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(l.Modal,{open:o,title:"转接",footer:!1,onCancel:()=>n(),children:e.jsxRuntimeExports.jsxs(e.ModelBody,{children:[e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(e.Radio.Group,{options:[{label:"转接坐席",value:0},{label:"转接外线",value:1}],value:r,onChange:s=>c(s.target.value)})}),e.jsxRuntimeExports.jsx(e.Spin,{spinning:j,children:e.jsxRuntimeExports.jsxs("div",{style:{borderTop:"1px solid #eee",marginTop:10,paddingTop:10},children:[r===0&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:x.length===0?e.jsxRuntimeExports.jsx(e.Empty,{image:e.Empty.PRESENTED_IMAGE_SIMPLE,description:"暂无转接坐席"}):e.jsxRuntimeExports.jsx(e.Space,{wrap:!0,children:x.map(s=>e.jsxRuntimeExports.jsx(l.Tag,{color:"processing",onClick:()=>n(s.agent_no,0),children:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"zixun"}),e.jsxRuntimeExports.jsxs("span",{style:{marginRight:10},children:["转接坐席: ",s.agent_name]})]})},s.agent_no))})}),r===1&&e.jsxRuntimeExports.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center",gap:"0 5px"},children:[e.jsxRuntimeExports.jsx(e.Input,{style:{flex:1},value:i,onChange:s=>d(s.target.value),placeholder:"请输入外线号码, 回车转接",onPressEnter:()=>{n(i,1)}}),e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"boda",color:"#1D92E9",size:25,onClick:()=>{n(i,1)}})]})]})})]})})})});exports.default=m;
@@ -1,6 +1,6 @@
1
- import { j as e, M as h, R as j, a as f, E as d, S as y, Y as c, I as v } from "./index-CyAAnwN2.mjs";
1
+ import { j as e, M as h, R as j, a as f, E as d, S as y, Y as c, I as v } from "./index-C0zVL8Ds.mjs";
2
2
  import { memo as E, useState as n, useEffect as T } from "react";
3
- import { M as I, T as M } from "./index-DCHu5DBN.mjs";
3
+ import { M as I, T as M } from "./index-Dv5Ck8CL.mjs";
4
4
  const _ = E(({ open: l, onCallBack: a, queryFetch: p }) => {
5
5
  const [o, g] = n([]), [t, x] = n(0), [r, m] = n(""), [u, i] = n(!1);
6
6
  return T(() => {
@@ -1,4 +1,4 @@
1
- "use strict";const b=require("react"),a=require("./index-BSJJAI7K.js");function st(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=st(b),it=new a.Keyframe("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),ct=new a.Keyframe("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),dt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{antCls:o}=e,n=`${o}-fade`,r=t?"&":"";return[a.initMotion(n,it,ct,e.motionDurationMid,t),{[`
1
+ "use strict";const b=require("react"),a=require("./index-D50bW92-.js");function st(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const s=st(b),it=new a.Keyframe("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),ct=new a.Keyframe("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),dt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{antCls:o}=e,n=`${o}-fade`,r=t?"&":"";return[a.initMotion(n,it,ct,e.motionDurationMid,t),{[`
2
2
  ${r}${n}-enter,
3
3
  ${r}${n}-appear
4
4
  `]:{opacity:0,animationTimingFunction:"linear"},[`${r}${n}-leave`]:{animationTimingFunction:"linear"}}]},ut=e=>{const{paddingXXS:t,lineWidth:o,tagPaddingHorizontal:n,componentCls:r,calc:l}=e,i=l(n).sub(o).equal(),u=l(t).sub(o).equal();return{[r]:Object.assign(Object.assign({},a.resetComponent(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:i,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${a.unit(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${r}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${r}-close-icon`]:{marginInlineStart:u,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${r}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${r}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:i}}),[`${r}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},Ce=e=>{const{lineWidth:t,fontSizeIcon:o,calc:n}=e,r=e.fontSizeSM;return a.merge(e,{tagFontSize:r,tagLineHeight:a.unit(n(e.lineHeightSM).mul(r).equal()),tagIconSize:n(o).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},pe=e=>({defaultBg:new a.FastColor(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText}),Re=a.genStyleHooks("Tag",e=>{const t=Ce(e);return ut(t)},pe);function oe(e){if(e)return{closable:e.closable,closeIcon:e.closeIcon}}function $e(e){const{closable:t,closeIcon:o}=e||{};return b.useMemo(()=>{if(!t&&(t===!1||o===!1||o===null))return!1;if(t===void 0&&o===void 0)return null;let n={closeIcon:typeof o!="boolean"&&o!==null?o:void 0};return t&&typeof t=="object"&&(n=Object.assign(Object.assign({},n),t)),n},[t,o])}function xe(){const e={};for(var t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return o.forEach(r=>{r&&Object.keys(r).forEach(l=>{r[l]!==void 0&&(e[l]=r[l])})}),e}const mt={};function Be(e,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mt;const n=$e(e),r=$e(t),l=typeof n!="boolean"?!!(n!=null&&n.disabled):!1,i=b.useMemo(()=>Object.assign({closeIcon:b.createElement(a.RefIcon,null)},o),[o]),u=b.useMemo(()=>n===!1?!1:n?xe(i,r,n):r===!1?!1:r?xe(i,r):i.closable?i:!1,[n,r,i]);return b.useMemo(()=>{if(u===!1)return[!1,null,l];const{closeIconRender:c}=i,{closeIcon:g}=u;let d=g;if(d!=null){c&&(d=c(g));const m=a.pickAttrs(u,!0);Object.keys(m).length&&(d=b.isValidElement(d)?b.cloneElement(d,m):b.createElement("span",Object.assign({},m),d))}return[!0,d,l]},[u,i])}var ft=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]]);return o};const gt=s.forwardRef((e,t)=>{const{prefixCls:o,style:n,className:r,checked:l,onChange:i,onClick:u}=e,c=ft(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:g,tag:d}=s.useContext(a.ConfigContext),m=y=>{i==null||i(!l),u==null||u(y)},f=g("tag",o),[v,x,C]=Re(f),p=a.classNames(f,`${f}-checkable`,{[`${f}-checkable-checked`]:l},d==null?void 0:d.className,r,x,C);return v(s.createElement("span",Object.assign({},c,{ref:t,style:Object.assign(Object.assign({},n),d==null?void 0:d.style),className:p,onClick:m})))}),Ct=e=>a.genPresetColor(e,(t,o)=>{let{textColor:n,lightBorderColor:r,lightColor:l,darkColor:i}=o;return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:n,background:l,borderColor:r,"&-inverse":{color:e.colorTextLightSolid,background:i,borderColor:i},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}}),pt=a.genSubStyleComponent(["Tag","preset"],e=>{const t=Ce(e);return Ct(t)},pe);function bt(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const ne=(e,t,o)=>{const n=bt(o);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${o}`],background:e[`color${n}Bg`],borderColor:e[`color${n}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},vt=a.genSubStyleComponent(["Tag","status"],e=>{const t=Ce(e);return[ne(t,"success","Success"),ne(t,"processing","Info"),ne(t,"error","Error"),ne(t,"warning","Warning")]},pe);var ht=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]]);return o};const yt=s.forwardRef((e,t)=>{const{prefixCls:o,className:n,rootClassName:r,style:l,children:i,icon:u,color:c,onClose:g,bordered:d=!0,visible:m}=e,f=ht(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:v,direction:x,tag:C}=s.useContext(a.ConfigContext),[p,y]=s.useState(!0),h=a.omit(f,["closeIcon","closable"]);process.env.NODE_ENV!=="production"&&a.devUseWarning("Tag").deprecated(!("visible"in e),"visible","visible && <Tag />"),s.useEffect(()=>{m!==void 0&&y(m)},[m]);const S=a.isPresetColor(c),N=a.isPresetStatusColor(c),E=S||N,O=Object.assign(Object.assign({backgroundColor:c&&!E?c:void 0},C==null?void 0:C.style),l),$=v("tag",o),[P,j,H]=Re($),B=a.classNames($,C==null?void 0:C.className,{[`${$}-${c}`]:E,[`${$}-has-color`]:c&&!E,[`${$}-hidden`]:!p,[`${$}-rtl`]:x==="rtl",[`${$}-borderless`]:!d},n,r,j,H),_=I=>{I.stopPropagation(),g==null||g(I),!I.defaultPrevented&&y(!1)},[,V]=Be(oe(e),oe(C),{closable:!1,closeIconRender:I=>{const X=s.createElement("span",{className:`${$}-close-icon`,onClick:_},I);return a.replaceElement(I,X,M=>({onClick:q=>{var R;(R=M==null?void 0:M.onClick)===null||R===void 0||R.call(M,q),_(q)},className:a.classNames(M==null?void 0:M.className,`${$}-close-icon`)}))}}),A=typeof f.onClick=="function"||i&&i.type==="a",z=u||null,W=z?s.createElement(s.Fragment,null,z,i&&s.createElement("span",null,i)):i,L=s.createElement("span",Object.assign({},h,{ref:t,className:B,style:O}),W,V,S&&s.createElement(pt,{key:"preset",prefixCls:$}),N&&s.createElement(vt,{key:"status",prefixCls:$}));return P(A?s.createElement(a.Wave,{component:"Tag"},L):L)}),be=yt;process.env.NODE_ENV!=="production"&&(be.displayName="Tag");be.CheckableTag=gt;function ie(e){return!!(e!=null&&e.then)}const _e=e=>{const{type:t,children:o,prefixCls:n,buttonProps:r,close:l,autoFocus:i,emitEvent:u,isSilent:c,quitOnNullishReturnValue:g,actionFn:d}=e,m=s.useRef(!1),f=s.useRef(null),[v,x]=a.useSafeState(!1),C=function(){l==null||l.apply(void 0,arguments)};s.useEffect(()=>{let h=null;return i&&(h=setTimeout(()=>{var S;(S=f.current)===null||S===void 0||S.focus({preventScroll:!0})})),()=>{h&&clearTimeout(h)}},[]);const p=h=>{ie(h)&&(x(!0),h.then(function(){x(!1,!0),C.apply(void 0,arguments),m.current=!1},S=>{if(x(!1,!0),m.current=!1,!(c!=null&&c()))return Promise.reject(S)}))},y=h=>{if(m.current)return;if(m.current=!0,!d){C();return}let S;if(u){if(S=d(h),g&&!ie(S)){m.current=!1,C(h);return}}else if(d.length)S=d(l),m.current=!1;else if(S=d(),!ie(S)){C();return}p(S)};return s.createElement(a.Button,Object.assign({},a.convertLegacyProps(t),{onClick:y,loading:v,prefixCls:n},r,{ref:f}),o)},ee=b.createContext({}),{Provider:He}=ee,Se=()=>{const{autoFocusButton:e,cancelButtonProps:t,cancelTextLocale:o,isSilent:n,mergedOkCancel:r,rootPrefixCls:l,close:i,onCancel:u,onConfirm:c}=b.useContext(ee);return r?b.createElement(_e,{isSilent:n,actionFn:u,close:function(){i==null||i.apply(void 0,arguments),c==null||c(!1)},autoFocus:e==="cancel",buttonProps:t,prefixCls:`${l}-btn`},o):null},Oe=()=>{const{autoFocusButton:e,close:t,isSilent:o,okButtonProps:n,rootPrefixCls:r,okTextLocale:l,okType:i,onConfirm:u,onOk:c}=b.useContext(ee);return b.createElement(_e,{isSilent:o,type:i||"primary",actionFn:c,close:function(){t==null||t.apply(void 0,arguments),u==null||u(!0)},autoFocus:e==="ok",buttonProps:n,prefixCls:`${r}-btn`},l)};var ze=s.createContext({});function Ne(e,t,o){var n=t;return!n&&o&&(n="".concat(e,"-").concat(o)),n}function Ee(e,t){var o=e["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if(typeof o!="number"){var r=e.document;o=r.documentElement[n],typeof o!="number"&&(o=r.body[n])}return o}function $t(e){var t=e.getBoundingClientRect(),o={left:t.left,top:t.top},n=e.ownerDocument,r=n.defaultView||n.parentWindow;return o.left+=Ee(r),o.top+=Ee(r,!0),o}const xt=s.memo(function(e){var t=e.children;return t},function(e,t){var o=t.shouldUpdate;return!o});var St={width:0,height:0,overflow:"hidden",outline:"none"},Ot={outline:"none"},ve=b.forwardRef(function(e,t){var o=e.prefixCls,n=e.className,r=e.style,l=e.title,i=e.ariaId,u=e.footer,c=e.closable,g=e.closeIcon,d=e.onClose,m=e.children,f=e.bodyStyle,v=e.bodyProps,x=e.modalRender,C=e.onMouseDown,p=e.onMouseUp,y=e.holderRef,h=e.visible,S=e.forceRender,N=e.width,E=e.height,O=e.classNames,$=e.styles,P=b.useContext(ze),j=P.panel,H=a.useComposeRef(y,j),B=b.useRef(),_=b.useRef();b.useImperativeHandle(t,function(){return{focus:function(){var R;(R=B.current)===null||R===void 0||R.focus({preventScroll:!0})},changeActive:function(R){var Y=document,G=Y.activeElement;R&&G===_.current?B.current.focus({preventScroll:!0}):!R&&G===B.current&&_.current.focus({preventScroll:!0})}}});var V={};N!==void 0&&(V.width=N),E!==void 0&&(V.height=E);var A=u?b.createElement("div",{className:a.classNames("".concat(o,"-footer"),O==null?void 0:O.footer),style:a._objectSpread2({},$==null?void 0:$.footer)},u):null,z=l?b.createElement("div",{className:a.classNames("".concat(o,"-header"),O==null?void 0:O.header),style:a._objectSpread2({},$==null?void 0:$.header)},b.createElement("div",{className:"".concat(o,"-title"),id:i},l)):null,W=b.useMemo(function(){return a._typeof(c)==="object"&&c!==null?c:c?{closeIcon:g??b.createElement("span",{className:"".concat(o,"-close-x")})}:{}},[c,g,o]),L=a.pickAttrs(W,!0),I=a._typeof(c)==="object"&&c.disabled,X=c?b.createElement("button",a._extends({type:"button",onClick:d,"aria-label":"Close"},L,{className:"".concat(o,"-close"),disabled:I}),W.closeIcon):null,M=b.createElement("div",{className:a.classNames("".concat(o,"-content"),O==null?void 0:O.content),style:$==null?void 0:$.content},X,z,b.createElement("div",a._extends({className:a.classNames("".concat(o,"-body"),O==null?void 0:O.body),style:a._objectSpread2(a._objectSpread2({},f),$==null?void 0:$.body)},v),m),A);return b.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":l?i:null,"aria-modal":"true",ref:H,style:a._objectSpread2(a._objectSpread2({},r),V),className:a.classNames(o,n),onMouseDown:C,onMouseUp:p},b.createElement("div",{ref:B,tabIndex:0,style:Ot},b.createElement(xt,{shouldUpdate:h||S},x?x(M):M)),b.createElement("div",{tabIndex:0,ref:_,style:St}))});process.env.NODE_ENV!=="production"&&(ve.displayName="Panel");var Ae=s.forwardRef(function(e,t){var o=e.prefixCls,n=e.title,r=e.style,l=e.className,i=e.visible,u=e.forceRender,c=e.destroyOnClose,g=e.motionName,d=e.ariaId,m=e.onVisibleChanged,f=e.mousePosition,v=b.useRef(),x=s.useState(),C=a._slicedToArray(x,2),p=C[0],y=C[1],h={};p&&(h.transformOrigin=p);function S(){var N=$t(v.current);y(f&&(f.x||f.y)?"".concat(f.x-N.left,"px ").concat(f.y-N.top,"px"):"")}return s.createElement(a.CSSMotion,{visible:i,onVisibleChanged:m,onAppearPrepare:S,onEnterPrepare:S,forceRender:u,motionName:g,removeOnLeave:c,ref:v},function(N,E){var O=N.className,$=N.style;return s.createElement(ve,a._extends({},e,{ref:t,title:n,ariaId:d,prefixCls:o,holderRef:E,style:a._objectSpread2(a._objectSpread2(a._objectSpread2({},$),r),h),className:a.classNames(l,O)}))})});Ae.displayName="Content";var Nt=function(t){var o=t.prefixCls,n=t.style,r=t.visible,l=t.maskProps,i=t.motionName,u=t.className;return s.createElement(a.CSSMotion,{key:"mask",visible:r,motionName:i,leavedClassName:"".concat(o,"-mask-hidden")},function(c,g){var d=c.className,m=c.style;return s.createElement("div",a._extends({ref:g,style:a._objectSpread2(a._objectSpread2({},m),n),className:a.classNames("".concat(o,"-mask"),d,u)},l))})},Et=function(t){var o=t.prefixCls,n=o===void 0?"rc-dialog":o,r=t.zIndex,l=t.visible,i=l===void 0?!1:l,u=t.keyboard,c=u===void 0?!0:u,g=t.focusTriggerAfterClose,d=g===void 0?!0:g,m=t.wrapStyle,f=t.wrapClassName,v=t.wrapProps,x=t.onClose,C=t.afterOpenChange,p=t.afterClose,y=t.transitionName,h=t.animation,S=t.closable,N=S===void 0?!0:S,E=t.mask,O=E===void 0?!0:E,$=t.maskTransitionName,P=t.maskAnimation,j=t.maskClosable,H=j===void 0?!0:j,B=t.maskStyle,_=t.maskProps,V=t.rootClassName,A=t.classNames,z=t.styles;process.env.NODE_ENV!=="production"&&(["wrapStyle","bodyStyle","maskStyle"].forEach(function(w){a.warning(!(w in t),"".concat(w," is deprecated, please use styles instead."))}),"wrapClassName"in t&&a.warning(!1,"wrapClassName is deprecated, please use classNames instead."));var W=b.useRef(),L=b.useRef(),I=b.useRef(),X=s.useState(i),M=a._slicedToArray(X,2),q=M[0],R=M[1],Y=a.useId();function G(){a.contains(L.current,document.activeElement)||(W.current=document.activeElement)}function le(){if(!a.contains(L.current,document.activeElement)){var w;(w=I.current)===null||w===void 0||w.focus()}}function k(w){if(w)le();else{if(R(!1),O&&W.current&&d){try{W.current.focus({preventScroll:!0})}catch{}W.current=null}q&&(p==null||p())}C==null||C(w)}function T(w){x==null||x(w)}var D=b.useRef(!1),J=b.useRef(),ot=function(){clearTimeout(J.current),D.current=!0},at=function(){J.current=setTimeout(function(){D.current=!1})},ye=null;H&&(ye=function(se){D.current?D.current=!1:L.current===se.target&&T(se)});function rt(w){if(c&&w.keyCode===a.KeyCode.ESC){w.stopPropagation(),T(w);return}i&&w.keyCode===a.KeyCode.TAB&&I.current.changeActive(!w.shiftKey)}b.useEffect(function(){i&&(R(!0),G())},[i]),b.useEffect(function(){return function(){clearTimeout(J.current)}},[]);var lt=a._objectSpread2(a._objectSpread2(a._objectSpread2({zIndex:r},m),z==null?void 0:z.wrapper),{},{display:q?null:"none"});return s.createElement("div",a._extends({className:a.classNames("".concat(n,"-root"),V)},a.pickAttrs(t,{data:!0})),s.createElement(Nt,{prefixCls:n,visible:O&&i,motionName:Ne(n,$,P),style:a._objectSpread2(a._objectSpread2({zIndex:r},B),z==null?void 0:z.mask),maskProps:_,className:A==null?void 0:A.mask}),s.createElement("div",a._extends({tabIndex:-1,onKeyDown:rt,className:a.classNames("".concat(n,"-wrap"),f,A==null?void 0:A.wrapper),ref:L,onClick:ye,style:lt},v),s.createElement(Ae,a._extends({},t,{onMouseDown:ot,onMouseUp:at,ref:I,closable:N,ariaId:Y,prefixCls:n,visible:i&&q,onClose:T,onVisibleChanged:k,motionName:Ne(n,y,h)}))))},Le=function(t){var o=t.visible,n=t.getContainer,r=t.forceRender,l=t.destroyOnClose,i=l===void 0?!1:l,u=t.afterClose,c=t.panelRef,g=s.useState(o),d=a._slicedToArray(g,2),m=d[0],f=d[1],v=s.useMemo(function(){return{panel:c}},[c]);return s.useEffect(function(){o&&f(!0)},[o]),!r&&i&&!m?null:s.createElement(ze.Provider,{value:v},s.createElement(a.Portal,{open:o||r||m,autoDestroy:!1,getContainer:n,autoLock:o||m},s.createElement(Et,a._extends({},t,{destroyOnClose:i,afterClose:function(){u==null||u(),f(!1)}}))))};Le.displayName="Dialog";const wt=()=>a.canUseDom()&&window.document.documentElement,ae=e=>{const{prefixCls:t,className:o,style:n,size:r,shape:l}=e,i=a.classNames({[`${t}-lg`]:r==="large",[`${t}-sm`]:r==="small"}),u=a.classNames({[`${t}-circle`]:l==="circle",[`${t}-square`]:l==="square",[`${t}-round`]:l==="round"}),c=s.useMemo(()=>typeof r=="number"?{width:r,height:r,lineHeight:`${r}px`}:{},[r]);return s.createElement("span",{className:a.classNames(t,i,u,o),style:Object.assign(Object.assign({},c),n)})},jt=new a.Keyframe("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),re=e=>({height:e,lineHeight:a.unit(e)}),Q=e=>Object.assign({width:e},re(e)),Pt=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:jt,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),ce=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},re(e)),It=e=>{const{skeletonAvatarCls:t,gradientFromColor:o,controlHeight:n,controlHeightLG:r,controlHeightSM:l}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:o},Q(n)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},Q(r)),[`${t}${t}-sm`]:Object.assign({},Q(l))}},Tt=e=>{const{controlHeight:t,borderRadiusSM:o,skeletonInputCls:n,controlHeightLG:r,controlHeightSM:l,gradientFromColor:i,calc:u}=e;return{[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:o},ce(t,u)),[`${n}-lg`]:Object.assign({},ce(r,u)),[`${n}-sm`]:Object.assign({},ce(l,u))}},we=e=>Object.assign({width:e},re(e)),Mt=e=>{const{skeletonImageCls:t,imageSizeBase:o,gradientFromColor:n,borderRadiusSM:r,calc:l}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:n,borderRadius:r},we(l(o).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},we(o)),{maxWidth:l(o).mul(4).equal(),maxHeight:l(o).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}},de=(e,t,o)=>{const{skeletonButtonCls:n}=e;return{[`${o}${n}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${o}${n}-round`]:{borderRadius:t}}},ue=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},re(e)),Rt=e=>{const{borderRadiusSM:t,skeletonButtonCls:o,controlHeight:n,controlHeightLG:r,controlHeightSM:l,gradientFromColor:i,calc:u}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[o]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:t,width:u(n).mul(2).equal(),minWidth:u(n).mul(2).equal()},ue(n,u))},de(e,n,o)),{[`${o}-lg`]:Object.assign({},ue(r,u))}),de(e,r,`${o}-lg`)),{[`${o}-sm`]:Object.assign({},ue(l,u))}),de(e,l,`${o}-sm`))},Bt=e=>{const{componentCls:t,skeletonAvatarCls:o,skeletonTitleCls:n,skeletonParagraphCls:r,skeletonButtonCls:l,skeletonInputCls:i,skeletonImageCls:u,controlHeight:c,controlHeightLG:g,controlHeightSM:d,gradientFromColor:m,padding:f,marginSM:v,borderRadius:x,titleHeight:C,blockRadius:p,paragraphLiHeight:y,controlHeightXS:h,paragraphMarginTop:S}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:f,verticalAlign:"top",[o]:Object.assign({display:"inline-block",verticalAlign:"top",background:m},Q(c)),[`${o}-circle`]:{borderRadius:"50%"},[`${o}-lg`]:Object.assign({},Q(g)),[`${o}-sm`]:Object.assign({},Q(d))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[n]:{width:"100%",height:C,background:m,borderRadius:p,[`+ ${r}`]:{marginBlockStart:d}},[r]:{padding:0,"> li":{width:"100%",height:y,listStyle:"none",background:m,borderRadius:p,"+ li":{marginBlockStart:h}}},[`${r}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${n}, ${r} > li`]:{borderRadius:x}}},[`${t}-with-avatar ${t}-content`]:{[n]:{marginBlockStart:v,[`+ ${r}`]:{marginBlockStart:S}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},Rt(e)),It(e)),Tt(e)),Mt(e)),[`${t}${t}-block`]:{width:"100%",[l]:{width:"100%"},[i]:{width:"100%"}},[`${t}${t}-active`]:{[`
@@ -11268,7 +11268,7 @@ class s2 {
11268
11268
  async hangup() {
11269
11269
  if (!H.get("isCalling")) throw an.error("当前没有通话", "call-api.ts 178 hangup"), new Error(JSON.stringify({ code: 1, msg: "当前没有通话" }));
11270
11270
  const e = z.sessionId;
11271
- un.__internalSend({ type: rt.AGENT_HANGUP, data: { session_id: e } });
11271
+ un.__internalSend({ type: rt.AGENT_HANGUP, data: { session_id: e } }), H.updateActionConfigs([]);
11272
11272
  }
11273
11273
  mute() {
11274
11274
  this.roleMute();
@@ -32889,7 +32889,7 @@ const HN = {
32889
32889
  空闲: 1,
32890
32890
  离线: 0,
32891
32891
  未注册: 4
32892
- }, ZN = nv(() => import("./ConsultModel-CK6ragRl.mjs")), KN = nv(() => import("./TransferModel-Br0GEsBP.mjs")), mc = An.div`
32892
+ }, ZN = nv(() => import("./ConsultModel-Crz2bWDZ.mjs")), KN = nv(() => import("./TransferModel-T-ICfWE8.mjs")), mc = An.div`
32893
32893
  width: 25px;
32894
32894
  height: 25px;
32895
32895
  background: ${({
@@ -171,7 +171,7 @@ React keys must be passed directly to JSX without using spread:
171
171
  clearInterval(timer);
172
172
  }
173
173
  };
174
- `],{type:"application/javascript"}),n=URL.createObjectURL(e);this.heartbeatWorker=new Worker(n),this.heartbeatWorker.onmessage=()=>{const r=new Date().getTime();this.sendMessage({type:0,msg_id:r}),this.pendingMessages.set(r,performance.now())},this.heartbeatWorker.postMessage("start")}stopHeartbeat(){this.heartbeatWorker&&(this.heartbeatWorker.postMessage("stop"),this.heartbeatWorker.terminate(),this.heartbeatWorker=null)}sendMessage(e){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN?(this.ws.send(JSON.stringify(e)),e.type!==0&&qg("%cWebSocket 发送消息:","color: green; font-weight: bold;",e)):console.warn("WebSocket 未连接,消息未发送")}close(){var e;this.manualClose=!0,this.stopHeartbeat(),(e=this.ws)==null||e.close()}reconnect(){this.initWebSocket()}static __internalClose(){ni&&(ni.close(),ni=null)}static __internalSend(e){if(!ni)throw new Error("WebSocket 尚未初始化");ni.sendMessage(e)}}class qw{constructor(e){this.sipClient=null,this.sipClient=e}roleMute(){const e=G.get("isCalling"),n=Y.sessionId;if(!e)throw new Error(JSON.stringify({code:1,msg:"当前没有通话"}));if(!n)throw new Error(JSON.stringify({code:1,msg:"当前没有通话"}))}holdCall(){this.roleMute();const e=G.get("isHold"),{sessionId:n}=Y;if(n){if(!G.get("actionConfigs").includes("hold"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿保持"}));if(e)throw new Error(JSON.stringify({code:1,msg:"当前已处于保持状态"}));An.__internalSend({type:nt.CALL_HOLD,data:{session_id:n}})}}unholdCall(){this.roleMute();const{isHold:e}=G.getState(),{sessionId:n}=Y;if(!G.get("actionConfigs").includes("unhold"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿取消保持"}));if(n){if(!e)throw new Error(JSON.stringify({code:1,msg:"当前未处于保持状态"}));An.__internalSend({type:nt.CALL_UNHOLD,data:{session_id:n}})}}sendDTMF(e){if(G.get("answerDevice")!==1)throw new Error(JSON.stringify({code:1,msg:"当前设备不支持此功能"}));if(!G.get("actionConfigs").includes("dtmf"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿发送按键"}));const{isCalling:n}=G.getState();if(!n)throw new Error(JSON.stringify({code:1,msg:"当前没有通话"}));this.sipClient.sendDTMF(e)}cancelCall(){if(!G.get("isCalling"))throw nn.error("当前没有通话","call-api.ts 81 cancelCall"),new Error(JSON.stringify({code:1,msg:"当前没有通话"}));const e=Y.sessionId;de.emit(ae.REJECT,{session_id:e}),An.__internalSend({type:nt.AGENT_HANGUP,data:{session_id:e}})}async consultCall(e){this.roleMute();const{isCalling:n,outCallIsAnswer:r,consultIsAnswer:i,incomingIsAnswer:o}=G.getState(),a=Y.sessionId;if(!G.get("actionConfigs").includes("consult"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿调用咨询"}));if(i)throw new Error(JSON.stringify({code:1,msg:"当前正在咨询"}));if(!(n||r||o))throw new Error(JSON.stringify({code:1,msg:"当前没有通话"}));if(!a)throw new Error(JSON.stringify({code:1,msg:"sessionId不存在"}));An.__internalSend({type:nt.CONSULT_REQUEST,data:{session_id:a,consultation_agent_no:e}})}async answerCall(){const e=G.get("answerDevice");if(e!==1)throw nn.error(`当前设备不支持此功能;answerDevice: ${e}`,"call-api.ts 119 answerCall"),new Error(JSON.stringify({code:1,msg:"当前设备不支持此功能"}));await this.sipClient.answerCall()}makeCall(e){if(typeof e!="string"||e.trim()==="")throw nn.warn(`外呼号码非法;号码: ${e}`,"call-api.ts 126 makeCall"),new Error(JSON.stringify({code:1,msg:"外呼号码非法"}));const n={};iu(e)?n.trace_id=e:n.customer_phone=e.replace(/[\s\r\n-]+/g,"");const r=G.get("isCalling"),i=G.get("selectOutNumber")||"";if(r)throw nn.error(`正在呼叫中,请勿重复点击;session id: ${Y.sessionId}`,"call-api.ts 142 makeCall"),new Error(JSON.stringify({code:1,msg:"正在呼叫中,请勿重复点击"}));G.updateDirection(xn.OUTGOING),An.__internalSend({type:nt.OUT_CALL,data:{...n,caller:i.replace(/[\s\r\n-]+/g,"")}})}previewCall(e,n){const r={};iu(e)?r.trace_id=e:r.customer_phone=e.replace(/[\s\r\n-]+/g,"");const i=G.get("isCalling"),o=G.get("selectOutNumber")||"";if(i)throw nn.error(`正在呼叫中,请勿重复点击;session id: ${Y.sessionId}`,"call-api.ts 162 previewCall"),new Error(JSON.stringify({code:1,msg:"正在呼叫中,请勿重复点击"}));if(typeof e!="string"||e.trim()==="")throw new Error(JSON.stringify({code:1,msg:"外呼号码非法"}));G.updateDirection(xn.OUTGOING),An.__internalSend({type:nt.PREVIEW_OUT_CALL,data:{...r,caller:o,preview_task_id:n}})}async hangup(){if(!G.get("isCalling"))throw nn.error("当前没有通话","call-api.ts 178 hangup"),new Error(JSON.stringify({code:1,msg:"当前没有通话"}));const e=Y.sessionId;An.__internalSend({type:nt.AGENT_HANGUP,data:{session_id:e}})}mute(){this.roleMute();const e=G.get("actionConfigs"),n=G.get("isMuted"),r=Y.sessionId;if(n)throw new Error(JSON.stringify({code:1,msg:"当前未处于静音状态"}));if(!e.includes("mute"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿调用静音"}));An.__internalSend({type:nt.MUTE,data:{session_id:r}})}unmute(){this.roleMute();const e=G.get("actionConfigs"),n=G.get("isMuted"),r=Y.sessionId;if(!n)throw new Error(JSON.stringify({code:1,msg:"当前未处于未静音状态"}));if(!e.includes("unmute"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿调用静音"}));An.__internalSend({type:nt.UNMUTE,data:{session_id:r}})}consultTransfer(){this.roleMute();const e=G.get("consultIsAnswer"),n=Y.sessionId,r=G.get("actionConfigs");if(!r.includes("consult_transfer"))throw nn.error(`当前状态请勿调用咨询转移; actionConfigs:${r.join(",")}; consultIsAnswer: ${e}; session id: ${n}`,"call-api.ts 228 consultTransfer"),new Error(JSON.stringify({code:1,msg:"当前状态请勿调用咨询转移"}));if(!e)throw new Error(JSON.stringify({code:1,msg:"当前未处于咨询中"}));An.__internalSend({type:nt.CONSULT_TRANSFER,data:{session_id:n}})}satisfactionEvaluation(){this.roleMute();const e=Y.sessionId,n=G.get("actionConfigs");if(!n.includes("satisfaction"))throw nn.error(`当前状态请勿调用满意度评价; actionConfigs:${n.join(",")}; session id: ${e}`,"call-api.ts 243 satisfactionEvaluation"),new Error(JSON.stringify({code:1,msg:"当前状态请勿调用满意度评价"}));An.__internalSend({type:nt.SATISFACTION_EVALUATION,data:{session_id:e}})}startConference(){this.roleMute();const e=Y.sessionId,n=G.get("actionConfigs");if(!n.includes("conference"))throw nn.error(`当前状态请勿调用三方会议; actionConfigs:${n.join(",")}; session id: ${e}`,"call-api.ts 264 startConference"),new Error(JSON.stringify({code:1,msg:"当前状态请勿调用三方会议"}));if(!G.get("consultIsAnswer"))throw new Error(JSON.stringify({code:1,msg:"当前未处于咨询中"}));An.__internalSend({type:nt.CONSULT_THREE_WAY,data:{session_id:e}})}consultRetrieve(){this.roleMute();const e=G.get("actionConfigs"),n=Y.sessionId;if(!e.includes("consult_retrieve"))throw nn.error(`当前状态请勿取回通话; actionConfigs:${e.join(",")}; session id: ${n}`,"call-api.ts 285 consultRetrieve"),new Error(JSON.stringify({code:1,msg:"当前状态请勿取回通话"}));if(!G.get("consultIsAnswer"))throw new Error(JSON.stringify({code:1,msg:"当前未处于咨询中"}));An.__internalSend({type:nt.CONSULT_RETURN_CALL,data:{session_id:n}})}async transferAgent(e){this.roleMute();const n=G.get("actionConfigs"),r=Y.sessionId;if(!n.includes("transfer"))throw nn.error(`当前状态请勿转接; actionConfigs:${n.join(",")}; session id: ${r}`,"call-api.ts 306 transferAgent"),new Error(JSON.stringify({code:1,msg:"当前状态请勿转接"}));const{transferIsAnswer:i}=G.getState();if(i)throw new Error(JSON.stringify({code:1,msg:"当前正在转接"}));An.__internalSend({type:nt.TRANSFER,data:{session_id:r,transfer_type:0,transfer_dest:e}})}async transferOutline(e){this.roleMute();const n=Y.sessionId,r=G.get("actionConfigs");if(!r.includes("transfer"))throw nn.error(`当前状态请勿转接; actionConfigs:${r.join(",")}; session id: ${n}`,"call-api.ts 330 transferOutline"),new Error(JSON.stringify({code:1,msg:"当前状态请勿转接"}));if(!e)throw new Error(JSON.stringify({code:1,msg:"号码不能为空"}));if(!/^\d+$/.test(e))throw nn.error(`当前状态请勿转接; 转接号码:${e}; session id: ${n}`,"call-api.ts 339 transferOutline"),new Error(JSON.stringify({code:1,msg:"号码格式错误"}));const{transferIsAnswer:i}=G.getState();if(i)throw new Error(JSON.stringify({code:1,msg:"当前正在转接"}));An.__internalSend({type:nt.TRANSFER,data:{session_id:n,transfer_type:2,transfer_dest:e}})}}var sr,Bn,fn,un,_i,Fo,Xi,ko,Ka,Va,$i,za,Ya,Pi,j0,L0,Wa,U0;const kA=class kA{constructor(){Kn(this,Pi);Kn(this,Bn);Kn(this,fn);Kn(this,un);Kn(this,_i);Kn(this,Fo);Kn(this,Xi);Kn(this,ko);Kn(this,Ka);Kn(this,Va);Kn(this,$i);Kn(this,za);Kn(this,Ya);Kn(this,Wa);if(sn(this,Bn,null),sn(this,fn,new ja),sn(this,_i,null),sn(this,Fo,{sounds_url:"",recordings_url:""}),sn(this,Xi,{soft_device_ring_switch:0,soft_device_ring_audio_id:""}),sn(this,ko,[]),sn(this,$i,!1),sn(this,za,()=>{}),sn(this,Ya,()=>{}),this.initWebRtc=async()=>{if(it(this,Bn))return;const e=Y.agentInfo.sip_account_list.find(n=>n.device_type===1);if(!e)throw new Error(JSON.stringify({code:1,msg:"未找到 sip_account_list"}));{const n=e.sip_register_addr;sn(this,Bn,new Bw({server:n.split(":")[0],user:e.sip_account,password:e.sip_password,webSocket:`wss://${n}`,callTimeout:3e4},it(this,Wa))),await it(this,Bn).start()}},sn(this,Wa,e=>{const{type:n,data:r}=e;de.emit(n,r)}),!sr._creatingInstance)throw new Error("请使用 YSYTAgentSdk.getInstance() 获取实例");clearInterval(it(this,_i)),sn(this,_i,setInterval(async()=>{const e=await ps(this,Pi,U0).call(this);T0.updateRttObject(e)},2e3)),Oo.requestMediaPermissions(),sn(this,Va,G.subscribeKey("isNextState",async e=>{if(nn.warn(`网络连接状态改变, ${e}`,"index.ts"),e){G.get("answerDevice")===1&&await it(this,Bn).reconnect();let n="";const r=new URL(Si).host;n=Si.includes("https")?`wss://${r}`:`ws://${r}`;const{agent_no:i}=Y.agentInfo;An.getInstance({url:`${n}/ccs-ws/api/v1/ws/call/${i}?Authorization=`,sipClient:it(this,Bn)}),setTimeout(()=>{it(this,fn)._changeState({data:{state:Rt.BUSY,state_name:"忙碌"},success:()=>{G.updateDisplayText(""),de.emit(ae.AGENT_STATE,{state:Rt.BUSY,state_name:"忙碌"})}},"d")},10)}else An.__internalClose(),G.updateIsCalling(!1),G.updateOutCallIsAnswer(!1),G.updateIncomingIsAnswer(!1),G.updateIsMuted(!1),G.updateConsultIsAnswer(!1),G.updateIsHold(!1),G.updateCustomerInfo(void 0),G.updateDisplayText("离线")})),sn(this,Ka,G.subscribeKey("answerDevice",async e=>{e===1?Y.stateObject.state===Rt.UNREGISTERED&&await it(this,fn)._changeState({data:{...Y.stateBeforeChange,state_name:Y.stateBeforeChange.state===Rt.IDLE?"空闲":"忙碌"}},"qq"):await this.destroyRtc()})),this.on(Le.KICK_OFF,()=>{this.destroy()}),window.addEventListener("beforeunload",e=>{e.returnValue="",nn.info("beforeunload","index.ts"),this.destroy()}),window.addEventListener("online",it(this,za)),window.addEventListener("offline",it(this,Ya))}static get instance(){return this._instance}static async destroyInstance(){this._instance&&(await this._instance.destroy(),this._instance=null)}static getInstance(e){if(!this._instance){if(!e)throw new Error("首次调用必须传入配置参数");const{url:n,appKey:r,appSecret:i,agentNo:o}=e;Si=n||"https://aicc-api.yescloudy.com",Kd=r,Vd=i,zl=o,sr._creatingInstance=!0,this._instance=new sr,delete sr._creatingInstance}return this._instance}getInit(){return it(this,$i)}async init({enableBrowserAlert:e,logBuiltinEnabled:n,browserAlertTime:r,onCallBack:i}){try{let o="";const a=new URL(Si).host;o=Si.includes("https")?`wss://${a}`:`ws://${a}`;const s=An.getInstance({url:`${o}/ccs-ws/api/v1/ws/call/${zl}?Authorization=`,sipClient:null,onOpen:async()=>{const A=await yn(`${zi}/config/swiftms`,{});sn(this,Fo,A.data);const l=await yn(`${zi}/ring/query`,{});sn(this,Xi,l.data);const u=await yn(`${zi}/audio/list`,{});sn(this,ko,u.data),Y.logBuiltinEnabled=n||!1,Y.browserAlertTime=r||5e3,await it(this,fn)._agentLogin(zl),nn.info("初始化成功","index.ts");const{current_answer_device:d,current_state:f,out_display_number:p,out_display_select_switch:v}=Y.agentInfo;f===Rt.IDLE?(G.updateActionConfigs(Vn),Y.stateObject={state:f,state_name:"空闲"},Y.stateBeforeChange=Y.stateObject):f===Rt.BUSY?(G.updateActionConfigs(gA),Y.stateObject={state:f,state_name:"忙碌"},Y.stateBeforeChange=Y.stateObject):f===Rt.UNREGISTERED&&(G.updateActionConfigs(gA),Y.stateObject={state:f,state_name:"未注册"}),v===1?G.updateSelectOutNumber(p):G.updateSelectOutNumber(""),G.updateAnswerDevice(d),ja.setInitRtcFn(this.initWebRtc),d===1&&(await this.initWebRtc(),s.setSipClient(it(this,Bn))),sn(this,un,new qw(it(this,Bn))),Y.enableBrowserAlert=e,e&&Oo.requestPermission(),de.emit(Le.AGENT_INIT_STATUS,!0),sn(this,$i,!0),clearInterval(sr._timer),sr._timer=null,ps(this,Pi,L0).call(this),i==null||i()}})}catch{de.emit(Le.AGENT_INIT_STATUS,!1),sn(this,$i,!1)}}on(e,n){return de.on(e,n),this}off(e,n){de.off(e,n)}offAll(){de.clearAllListeners()}async destroyRtc(){var e;await((e=it(this,Bn))==null?void 0:e.destroy()),sn(this,Bn,null)}async destroy(){var e,n;sr._instance&&(await this.destroyRtc(),(e=it(this,Ka))==null||e.call(this),(n=it(this,Va))==null||n.call(this),clearInterval(it(this,_i)),An.__internalClose(),de.emit(Le.DESTROY),this.offAll(),sr._instance=null,G.reset(),G.updateSelectOutNumber(""),clearInterval(sr._timer),clearTimeout(Y.autoStateTimer),Y.autoStateTimer=null,sr._timer=null)}get call_api(){const e=n=>(...r)=>n.apply(this,r);return{answerCall:e(()=>it(this,un).answerCall()),makeCall:n=>it(this,un).makeCall(n),previewMakeCall:(n,r)=>it(this,un).previewCall(n,r),cancelCall:e(()=>it(this,un).cancelCall()),hangup:e(()=>it(this,un).hangup()),sendDTMF:e(n=>it(this,un).sendDTMF(n)),holdCall:e(()=>it(this,un).holdCall()),unholdCall:e(()=>it(this,un).unholdCall()),consultCall:e(async n=>{try{await it(this,un).consultCall(n)}catch(r){throw console.warn(r),r}}),consultRetrieve:e(()=>it(this,un).consultRetrieve()),consultTransfer:e(()=>it(this,un).consultTransfer()),mute:e(()=>it(this,un).mute()),unmute:e(()=>it(this,un).unmute()),satisfactionEvaluation:e(()=>it(this,un).satisfactionEvaluation()),startConference:e(()=>it(this,un).startConference()),transferAgent:e(n=>it(this,un).transferAgent(n)),transferOutline:e(n=>it(this,un).transferOutline(n)),earSpeakStart:e(n=>it(this,fn).earCall(n)),earSpeakStop:e(n=>it(this,fn).stopEarCall(n)),forceInsert:e(n=>it(this,fn).forceInsert(n)),forceDisconnect:e(n=>it(this,fn).forceDisconnect(n))}}get agent_api(){const e=n=>(...r)=>n.apply(this,r);return{changeDevice:e(n=>it(this,fn).changeDevice(n)),changeState:e(async n=>{const r=G.get("answerDevice");if(Y.stateObject.state===Rt.UNREGISTERED&&r===1){await it(this,Bn).reconnect();let i="";const o=new URL(Si).host;i=Si.includes("https")?`wss://${o}`:`ws://${o}`;const{agent_no:a}=Y.agentInfo;An.getInstance({url:`${i}/ccs-ws/api/v1/ws/call/${a}?Authorization=`,sipClient:it(this,Bn)})}await it(this,fn).changeState(n,"c")}),getIdleAgentList:e(n=>it(this,fn).getIdleAgentList(n)),getAgentState:e(n=>it(this,fn).getAgentState(n)),setAgentExplicit:e(n=>it(this,fn).setAgentExplicit(n)),checkAgentLogin:n=>it(this,fn).checkAgentLogin(n),getCallRecord:n=>it(this,fn).getCallRecord(n),agentLogout:async(n,r)=>{try{await it(this,fn).logout(n),await this.destroy(),r==null||r({code:0,msg:""})}catch{}},listenAgentCall:n=>it(this,fn).listenCall(n)}}getAgentData(){const{agent_no:e,agent_name:n,answer_devices:r,out_display_data:i,out_display_select_switch:o,current_state:a}=Y.agentInfo,{stateObject:s}=Y,{soft_device_ring_switch:A}=it(this,Xi),l={1:"软电话",2:"手机模式",3:"SIP话机"};return{agent_no:e,agent_name:n,init_state:a,default_device:G.get("answerDevice"),out_display_data:i,out_display_select_switch:o,answer_devices:(r||"").split(",").map(u=>({value:Number(u),label:l[Number(u)]})),stateObject:s,soft_device_ring_switch:A===1}}async getRealTimeCustomerInfo(){return G.get("customerObject")}setBrowserAlert(e){if(typeof e!="boolean")throw new Error(JSON.stringify({code:1,msg:"参数类型错误"}));Y.logBuiltinEnabled=e||!1}setBrowserAlertTime(e){if(typeof e!="number")throw new Error(JSON.stringify({code:1,msg:"参数类型错误"}));Y.browserAlertTime=e||3e3}getEarSpeakAgent(){const{sounds_url:e}=it(this,Fo),{soft_device_ring_audio_id:n}=it(this,Xi),r=it(this,ko).find(({audio_id:i})=>i===n);if(r!=null&&r.app_id){let i="";return i=r.app_id==="-1"?`/ivr/${r.object}`:`/${r.app_id}/ivr/${r.object}`,`${e}${i}`}return""}};Bn=new WeakMap,fn=new WeakMap,un=new WeakMap,_i=new WeakMap,Fo=new WeakMap,Xi=new WeakMap,ko=new WeakMap,Ka=new WeakMap,Va=new WeakMap,$i=new WeakMap,za=new WeakMap,Ya=new WeakMap,Pi=new WeakSet,j0=async function(){const e=G.get("isNextState");try{await Dw(),e||G.updateIsNextState(!0)}catch{de.emit(Le.FAIL_NOTIFICATION,"网络断开,请检查网络"),e&&G.updateIsNextState(!1)}},L0=function(){sr._timer||(sr._timer=setInterval(()=>ps(this,Pi,j0).call(this),3e3))},Wa=new WeakMap,U0=async function(){return it(this,Bn)?it(this,Bn).getNetworkStats():{}},kA._instance=null,kA._timer=null;let kn=kA;sr=kn;var er=function(){return er=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},er.apply(this,arguments)};function io(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function Zw(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var Kw=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Vw=Zw(function(t){return Kw.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),Xt="-ms-",ba="-moz-",Ht="-webkit-",H0="comm",KA="rule",zd="decl",zw="@import",G0="@keyframes",Yw="@layer",q0=Math.abs,Yd=String.fromCharCode,ou=Object.assign;function Ww(t,e){return Rn(t,0)^45?(((e<<2^Rn(t,0))<<2^Rn(t,1))<<2^Rn(t,2))<<2^Rn(t,3):0}function Z0(t){return t.trim()}function oi(t,e){return(t=e.exec(t))?t[0]:t}function xt(t,e,n){return t.replace(e,n)}function _s(t,e,n){return t.indexOf(e,n)}function Rn(t,e){return t.charCodeAt(e)|0}function Go(t,e,n){return t.slice(e,n)}function Vr(t){return t.length}function K0(t){return t.length}function ma(t,e){return e.push(t),t}function Jw(t,e){return t.map(e).join("")}function Zg(t,e){return t.filter(function(n){return!oi(n,e)})}var VA=1,qo=1,V0=0,Ir=0,hn=0,_o="";function zA(t,e,n,r,i,o,a,s){return{value:t,root:e,parent:n,type:r,props:i,children:o,line:VA,column:qo,length:a,return:"",siblings:s}}function wi(t,e){return ou(zA("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function ho(t){for(;t.root;)t=wi(t.root,{children:[t]});ma(t,t.siblings)}function _w(){return hn}function Xw(){return hn=Ir>0?Rn(_o,--Ir):0,qo--,hn===10&&(qo=1,VA--),hn}function Fr(){return hn=Ir<V0?Rn(_o,Ir++):0,qo++,hn===10&&(qo=1,VA++),hn}function to(){return Rn(_o,Ir)}function Xs(){return Ir}function YA(t,e){return Go(_o,t,e)}function au(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $w(t){return VA=qo=1,V0=Vr(_o=t),Ir=0,[]}function eI(t){return _o="",t}function Wl(t){return Z0(YA(Ir-1,su(t===91?t+2:t===40?t+1:t)))}function tI(t){for(;(hn=to())&&hn<33;)Fr();return au(t)>2||au(hn)>3?"":" "}function nI(t,e){for(;--e&&Fr()&&!(hn<48||hn>102||hn>57&&hn<65||hn>70&&hn<97););return YA(t,Xs()+(e<6&&to()==32&&Fr()==32))}function su(t){for(;Fr();)switch(hn){case t:return Ir;case 34:case 39:t!==34&&t!==39&&su(hn);break;case 40:t===41&&su(t);break;case 92:Fr();break}return Ir}function rI(t,e){for(;Fr()&&t+hn!==57;)if(t+hn===84&&to()===47)break;return"/*"+YA(e,Ir-1)+"*"+Yd(t===47?t:Fr())}function iI(t){for(;!au(to());)Fr();return YA(t,Ir)}function oI(t){return eI($s("",null,null,null,[""],t=$w(t),0,[0],t))}function $s(t,e,n,r,i,o,a,s,A){for(var l=0,u=0,d=a,f=0,p=0,v=0,C=1,m=1,y=1,S=0,I="",O=i,x=o,g=r,M=I;m;)switch(v=S,S=Fr()){case 40:if(v!=108&&Rn(M,d-1)==58){_s(M+=xt(Wl(S),"&","&\f"),"&\f",q0(l?s[l-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:M+=Wl(S);break;case 9:case 10:case 13:case 32:M+=tI(v);break;case 92:M+=nI(Xs()-1,7);continue;case 47:switch(to()){case 42:case 47:ma(aI(rI(Fr(),Xs()),e,n,A),A);break;default:M+="/"}break;case 123*C:s[l++]=Vr(M)*y;case 125*C:case 59:case 0:switch(S){case 0:case 125:m=0;case 59+u:y==-1&&(M=xt(M,/\f/g,"")),p>0&&Vr(M)-d&&ma(p>32?Vg(M+";",r,n,d-1,A):Vg(xt(M," ","")+";",r,n,d-2,A),A);break;case 59:M+=";";default:if(ma(g=Kg(M,e,n,l,u,i,s,I,O=[],x=[],d,o),o),S===123)if(u===0)$s(M,e,g,g,O,o,d,s,x);else switch(f===99&&Rn(M,3)===110?100:f){case 100:case 108:case 109:case 115:$s(t,g,g,r&&ma(Kg(t,g,g,0,0,i,s,I,i,O=[],d,x),x),i,x,d,s,r?O:x);break;default:$s(M,g,g,g,[""],x,0,s,x)}}l=u=p=0,C=y=1,I=M="",d=a;break;case 58:d=1+Vr(M),p=v;default:if(C<1){if(S==123)--C;else if(S==125&&C++==0&&Xw()==125)continue}switch(M+=Yd(S),S*C){case 38:y=u>0?1:(M+="\f",-1);break;case 44:s[l++]=(Vr(M)-1)*y,y=1;break;case 64:to()===45&&(M+=Wl(Fr())),f=to(),u=d=Vr(I=M+=iI(Xs())),S++;break;case 45:v===45&&Vr(M)==2&&(C=0)}}return o}function Kg(t,e,n,r,i,o,a,s,A,l,u,d){for(var f=i-1,p=i===0?o:[""],v=K0(p),C=0,m=0,y=0;C<r;++C)for(var S=0,I=Go(t,f+1,f=q0(m=a[C])),O=t;S<v;++S)(O=Z0(m>0?p[S]+" "+I:xt(I,/&\f/g,p[S])))&&(A[y++]=O);return zA(t,e,n,i===0?KA:s,A,l,u,d)}function aI(t,e,n,r){return zA(t,e,n,H0,Yd(_w()),Go(t,2,-2),0,r)}function Vg(t,e,n,r,i){return zA(t,e,n,zd,Go(t,0,r),Go(t,r+1,-1),r,i)}function z0(t,e,n){switch(Ww(t,e)){case 5103:return Ht+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ht+t+t;case 4789:return ba+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Ht+t+ba+t+Xt+t+t;case 5936:switch(Rn(t,e+11)){case 114:return Ht+t+Xt+xt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Ht+t+Xt+xt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Ht+t+Xt+xt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return Ht+t+Xt+t+t;case 6165:return Ht+t+Xt+"flex-"+t+t;case 5187:return Ht+t+xt(t,/(\w+).+(:[^]+)/,Ht+"box-$1$2"+Xt+"flex-$1$2")+t;case 5443:return Ht+t+Xt+"flex-item-"+xt(t,/flex-|-self/g,"")+(oi(t,/flex-|baseline/)?"":Xt+"grid-row-"+xt(t,/flex-|-self/g,""))+t;case 4675:return Ht+t+Xt+"flex-line-pack"+xt(t,/align-content|flex-|-self/g,"")+t;case 5548:return Ht+t+Xt+xt(t,"shrink","negative")+t;case 5292:return Ht+t+Xt+xt(t,"basis","preferred-size")+t;case 6060:return Ht+"box-"+xt(t,"-grow","")+Ht+t+Xt+xt(t,"grow","positive")+t;case 4554:return Ht+xt(t,/([^-])(transform)/g,"$1"+Ht+"$2")+t;case 6187:return xt(xt(xt(t,/(zoom-|grab)/,Ht+"$1"),/(image-set)/,Ht+"$1"),t,"")+t;case 5495:case 3959:return xt(t,/(image-set\([^]*)/,Ht+"$1$`$1");case 4968:return xt(xt(t,/(.+:)(flex-)?(.*)/,Ht+"box-pack:$3"+Xt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ht+t+t;case 4200:if(!oi(t,/flex-|baseline/))return Xt+"grid-column-align"+Go(t,e)+t;break;case 2592:case 3360:return Xt+xt(t,"template-","")+t;case 4384:case 3616:return n&&n.some(function(r,i){return e=i,oi(r.props,/grid-\w+-end/)})?~_s(t+(n=n[e].value),"span",0)?t:Xt+xt(t,"-start","")+t+Xt+"grid-row-span:"+(~_s(n,"span",0)?oi(n,/\d+/):+oi(n,/\d+/)-+oi(t,/\d+/))+";":Xt+xt(t,"-start","")+t;case 4896:case 4128:return n&&n.some(function(r){return oi(r.props,/grid-\w+-start/)})?t:Xt+xt(xt(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return xt(t,/(.+)-inline(.+)/,Ht+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Vr(t)-1-e>6)switch(Rn(t,e+1)){case 109:if(Rn(t,e+4)!==45)break;case 102:return xt(t,/(.+:)(.+)-([^]+)/,"$1"+Ht+"$2-$3$1"+ba+(Rn(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~_s(t,"stretch",0)?z0(xt(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return xt(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,A,l){return Xt+i+":"+o+l+(a?Xt+i+"-span:"+(s?A:+A-+o)+l:"")+t});case 4949:if(Rn(t,e+6)===121)return xt(t,":",":"+Ht)+t;break;case 6444:switch(Rn(t,Rn(t,14)===45?18:11)){case 120:return xt(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ht+(Rn(t,14)===45?"inline-":"")+"box$3$1"+Ht+"$2$3$1"+Xt+"$2box$3")+t;case 100:return xt(t,":",":"+Xt)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return xt(t,"scroll-","scroll-snap-")+t}return t}function hA(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function sI(t,e,n,r){switch(t.type){case Yw:if(t.children.length)break;case zw:case zd:return t.return=t.return||t.value;case H0:return"";case G0:return t.return=t.value+"{"+hA(t.children,r)+"}";case KA:if(!Vr(t.value=t.props.join(",")))return""}return Vr(n=hA(t.children,r))?t.return=t.value+"{"+n+"}":""}function AI(t){var e=K0(t);return function(n,r,i,o){for(var a="",s=0;s<e;s++)a+=t[s](n,r,i,o)||"";return a}}function lI(t){return function(e){e.root||(e=e.return)&&t(e)}}function cI(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case zd:t.return=z0(t.value,t.length,n);return;case G0:return hA([wi(t,{value:xt(t.value,"@","@"+Ht)})],r);case KA:if(t.length)return Jw(n=t.props,function(i){switch(oi(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":ho(wi(t,{props:[xt(i,/:(read-\w+)/,":"+ba+"$1")]})),ho(wi(t,{props:[i]})),ou(t,{props:Zg(n,r)});break;case"::placeholder":ho(wi(t,{props:[xt(i,/:(plac\w+)/,":"+Ht+"input-$1")]})),ho(wi(t,{props:[xt(i,/:(plac\w+)/,":"+ba+"$1")]})),ho(wi(t,{props:[xt(i,/:(plac\w+)/,Xt+"input-$1")]})),ho(wi(t,{props:[i]})),ou(t,{props:Zg(n,r)});break}return""})}}var uI={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},oo=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Y0="active",W0="data-styled-version",WA="6.1.19",Wd=`/*!sc*/
174
+ `],{type:"application/javascript"}),n=URL.createObjectURL(e);this.heartbeatWorker=new Worker(n),this.heartbeatWorker.onmessage=()=>{const r=new Date().getTime();this.sendMessage({type:0,msg_id:r}),this.pendingMessages.set(r,performance.now())},this.heartbeatWorker.postMessage("start")}stopHeartbeat(){this.heartbeatWorker&&(this.heartbeatWorker.postMessage("stop"),this.heartbeatWorker.terminate(),this.heartbeatWorker=null)}sendMessage(e){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN?(this.ws.send(JSON.stringify(e)),e.type!==0&&qg("%cWebSocket 发送消息:","color: green; font-weight: bold;",e)):console.warn("WebSocket 未连接,消息未发送")}close(){var e;this.manualClose=!0,this.stopHeartbeat(),(e=this.ws)==null||e.close()}reconnect(){this.initWebSocket()}static __internalClose(){ni&&(ni.close(),ni=null)}static __internalSend(e){if(!ni)throw new Error("WebSocket 尚未初始化");ni.sendMessage(e)}}class qw{constructor(e){this.sipClient=null,this.sipClient=e}roleMute(){const e=G.get("isCalling"),n=Y.sessionId;if(!e)throw new Error(JSON.stringify({code:1,msg:"当前没有通话"}));if(!n)throw new Error(JSON.stringify({code:1,msg:"当前没有通话"}))}holdCall(){this.roleMute();const e=G.get("isHold"),{sessionId:n}=Y;if(n){if(!G.get("actionConfigs").includes("hold"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿保持"}));if(e)throw new Error(JSON.stringify({code:1,msg:"当前已处于保持状态"}));An.__internalSend({type:nt.CALL_HOLD,data:{session_id:n}})}}unholdCall(){this.roleMute();const{isHold:e}=G.getState(),{sessionId:n}=Y;if(!G.get("actionConfigs").includes("unhold"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿取消保持"}));if(n){if(!e)throw new Error(JSON.stringify({code:1,msg:"当前未处于保持状态"}));An.__internalSend({type:nt.CALL_UNHOLD,data:{session_id:n}})}}sendDTMF(e){if(G.get("answerDevice")!==1)throw new Error(JSON.stringify({code:1,msg:"当前设备不支持此功能"}));if(!G.get("actionConfigs").includes("dtmf"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿发送按键"}));const{isCalling:n}=G.getState();if(!n)throw new Error(JSON.stringify({code:1,msg:"当前没有通话"}));this.sipClient.sendDTMF(e)}cancelCall(){if(!G.get("isCalling"))throw nn.error("当前没有通话","call-api.ts 81 cancelCall"),new Error(JSON.stringify({code:1,msg:"当前没有通话"}));const e=Y.sessionId;de.emit(ae.REJECT,{session_id:e}),An.__internalSend({type:nt.AGENT_HANGUP,data:{session_id:e}})}async consultCall(e){this.roleMute();const{isCalling:n,outCallIsAnswer:r,consultIsAnswer:i,incomingIsAnswer:o}=G.getState(),a=Y.sessionId;if(!G.get("actionConfigs").includes("consult"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿调用咨询"}));if(i)throw new Error(JSON.stringify({code:1,msg:"当前正在咨询"}));if(!(n||r||o))throw new Error(JSON.stringify({code:1,msg:"当前没有通话"}));if(!a)throw new Error(JSON.stringify({code:1,msg:"sessionId不存在"}));An.__internalSend({type:nt.CONSULT_REQUEST,data:{session_id:a,consultation_agent_no:e}})}async answerCall(){const e=G.get("answerDevice");if(e!==1)throw nn.error(`当前设备不支持此功能;answerDevice: ${e}`,"call-api.ts 119 answerCall"),new Error(JSON.stringify({code:1,msg:"当前设备不支持此功能"}));await this.sipClient.answerCall()}makeCall(e){if(typeof e!="string"||e.trim()==="")throw nn.warn(`外呼号码非法;号码: ${e}`,"call-api.ts 126 makeCall"),new Error(JSON.stringify({code:1,msg:"外呼号码非法"}));const n={};iu(e)?n.trace_id=e:n.customer_phone=e.replace(/[\s\r\n-]+/g,"");const r=G.get("isCalling"),i=G.get("selectOutNumber")||"";if(r)throw nn.error(`正在呼叫中,请勿重复点击;session id: ${Y.sessionId}`,"call-api.ts 142 makeCall"),new Error(JSON.stringify({code:1,msg:"正在呼叫中,请勿重复点击"}));G.updateDirection(xn.OUTGOING),An.__internalSend({type:nt.OUT_CALL,data:{...n,caller:i.replace(/[\s\r\n-]+/g,"")}})}previewCall(e,n){const r={};iu(e)?r.trace_id=e:r.customer_phone=e.replace(/[\s\r\n-]+/g,"");const i=G.get("isCalling"),o=G.get("selectOutNumber")||"";if(i)throw nn.error(`正在呼叫中,请勿重复点击;session id: ${Y.sessionId}`,"call-api.ts 162 previewCall"),new Error(JSON.stringify({code:1,msg:"正在呼叫中,请勿重复点击"}));if(typeof e!="string"||e.trim()==="")throw new Error(JSON.stringify({code:1,msg:"外呼号码非法"}));G.updateDirection(xn.OUTGOING),An.__internalSend({type:nt.PREVIEW_OUT_CALL,data:{...r,caller:o,preview_task_id:n}})}async hangup(){if(!G.get("isCalling"))throw nn.error("当前没有通话","call-api.ts 178 hangup"),new Error(JSON.stringify({code:1,msg:"当前没有通话"}));const e=Y.sessionId;An.__internalSend({type:nt.AGENT_HANGUP,data:{session_id:e}}),G.updateActionConfigs([])}mute(){this.roleMute();const e=G.get("actionConfigs"),n=G.get("isMuted"),r=Y.sessionId;if(n)throw new Error(JSON.stringify({code:1,msg:"当前未处于静音状态"}));if(!e.includes("mute"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿调用静音"}));An.__internalSend({type:nt.MUTE,data:{session_id:r}})}unmute(){this.roleMute();const e=G.get("actionConfigs"),n=G.get("isMuted"),r=Y.sessionId;if(!n)throw new Error(JSON.stringify({code:1,msg:"当前未处于未静音状态"}));if(!e.includes("unmute"))throw new Error(JSON.stringify({code:1,msg:"当前状态请勿调用静音"}));An.__internalSend({type:nt.UNMUTE,data:{session_id:r}})}consultTransfer(){this.roleMute();const e=G.get("consultIsAnswer"),n=Y.sessionId,r=G.get("actionConfigs");if(!r.includes("consult_transfer"))throw nn.error(`当前状态请勿调用咨询转移; actionConfigs:${r.join(",")}; consultIsAnswer: ${e}; session id: ${n}`,"call-api.ts 228 consultTransfer"),new Error(JSON.stringify({code:1,msg:"当前状态请勿调用咨询转移"}));if(!e)throw new Error(JSON.stringify({code:1,msg:"当前未处于咨询中"}));An.__internalSend({type:nt.CONSULT_TRANSFER,data:{session_id:n}})}satisfactionEvaluation(){this.roleMute();const e=Y.sessionId,n=G.get("actionConfigs");if(!n.includes("satisfaction"))throw nn.error(`当前状态请勿调用满意度评价; actionConfigs:${n.join(",")}; session id: ${e}`,"call-api.ts 243 satisfactionEvaluation"),new Error(JSON.stringify({code:1,msg:"当前状态请勿调用满意度评价"}));An.__internalSend({type:nt.SATISFACTION_EVALUATION,data:{session_id:e}})}startConference(){this.roleMute();const e=Y.sessionId,n=G.get("actionConfigs");if(!n.includes("conference"))throw nn.error(`当前状态请勿调用三方会议; actionConfigs:${n.join(",")}; session id: ${e}`,"call-api.ts 264 startConference"),new Error(JSON.stringify({code:1,msg:"当前状态请勿调用三方会议"}));if(!G.get("consultIsAnswer"))throw new Error(JSON.stringify({code:1,msg:"当前未处于咨询中"}));An.__internalSend({type:nt.CONSULT_THREE_WAY,data:{session_id:e}})}consultRetrieve(){this.roleMute();const e=G.get("actionConfigs"),n=Y.sessionId;if(!e.includes("consult_retrieve"))throw nn.error(`当前状态请勿取回通话; actionConfigs:${e.join(",")}; session id: ${n}`,"call-api.ts 285 consultRetrieve"),new Error(JSON.stringify({code:1,msg:"当前状态请勿取回通话"}));if(!G.get("consultIsAnswer"))throw new Error(JSON.stringify({code:1,msg:"当前未处于咨询中"}));An.__internalSend({type:nt.CONSULT_RETURN_CALL,data:{session_id:n}})}async transferAgent(e){this.roleMute();const n=G.get("actionConfigs"),r=Y.sessionId;if(!n.includes("transfer"))throw nn.error(`当前状态请勿转接; actionConfigs:${n.join(",")}; session id: ${r}`,"call-api.ts 306 transferAgent"),new Error(JSON.stringify({code:1,msg:"当前状态请勿转接"}));const{transferIsAnswer:i}=G.getState();if(i)throw new Error(JSON.stringify({code:1,msg:"当前正在转接"}));An.__internalSend({type:nt.TRANSFER,data:{session_id:r,transfer_type:0,transfer_dest:e}})}async transferOutline(e){this.roleMute();const n=Y.sessionId,r=G.get("actionConfigs");if(!r.includes("transfer"))throw nn.error(`当前状态请勿转接; actionConfigs:${r.join(",")}; session id: ${n}`,"call-api.ts 330 transferOutline"),new Error(JSON.stringify({code:1,msg:"当前状态请勿转接"}));if(!e)throw new Error(JSON.stringify({code:1,msg:"号码不能为空"}));if(!/^\d+$/.test(e))throw nn.error(`当前状态请勿转接; 转接号码:${e}; session id: ${n}`,"call-api.ts 339 transferOutline"),new Error(JSON.stringify({code:1,msg:"号码格式错误"}));const{transferIsAnswer:i}=G.getState();if(i)throw new Error(JSON.stringify({code:1,msg:"当前正在转接"}));An.__internalSend({type:nt.TRANSFER,data:{session_id:n,transfer_type:2,transfer_dest:e}})}}var sr,Bn,fn,un,_i,Fo,Xi,ko,Ka,Va,$i,za,Ya,Pi,j0,L0,Wa,U0;const kA=class kA{constructor(){Kn(this,Pi);Kn(this,Bn);Kn(this,fn);Kn(this,un);Kn(this,_i);Kn(this,Fo);Kn(this,Xi);Kn(this,ko);Kn(this,Ka);Kn(this,Va);Kn(this,$i);Kn(this,za);Kn(this,Ya);Kn(this,Wa);if(sn(this,Bn,null),sn(this,fn,new ja),sn(this,_i,null),sn(this,Fo,{sounds_url:"",recordings_url:""}),sn(this,Xi,{soft_device_ring_switch:0,soft_device_ring_audio_id:""}),sn(this,ko,[]),sn(this,$i,!1),sn(this,za,()=>{}),sn(this,Ya,()=>{}),this.initWebRtc=async()=>{if(it(this,Bn))return;const e=Y.agentInfo.sip_account_list.find(n=>n.device_type===1);if(!e)throw new Error(JSON.stringify({code:1,msg:"未找到 sip_account_list"}));{const n=e.sip_register_addr;sn(this,Bn,new Bw({server:n.split(":")[0],user:e.sip_account,password:e.sip_password,webSocket:`wss://${n}`,callTimeout:3e4},it(this,Wa))),await it(this,Bn).start()}},sn(this,Wa,e=>{const{type:n,data:r}=e;de.emit(n,r)}),!sr._creatingInstance)throw new Error("请使用 YSYTAgentSdk.getInstance() 获取实例");clearInterval(it(this,_i)),sn(this,_i,setInterval(async()=>{const e=await ps(this,Pi,U0).call(this);T0.updateRttObject(e)},2e3)),Oo.requestMediaPermissions(),sn(this,Va,G.subscribeKey("isNextState",async e=>{if(nn.warn(`网络连接状态改变, ${e}`,"index.ts"),e){G.get("answerDevice")===1&&await it(this,Bn).reconnect();let n="";const r=new URL(Si).host;n=Si.includes("https")?`wss://${r}`:`ws://${r}`;const{agent_no:i}=Y.agentInfo;An.getInstance({url:`${n}/ccs-ws/api/v1/ws/call/${i}?Authorization=`,sipClient:it(this,Bn)}),setTimeout(()=>{it(this,fn)._changeState({data:{state:Rt.BUSY,state_name:"忙碌"},success:()=>{G.updateDisplayText(""),de.emit(ae.AGENT_STATE,{state:Rt.BUSY,state_name:"忙碌"})}},"d")},10)}else An.__internalClose(),G.updateIsCalling(!1),G.updateOutCallIsAnswer(!1),G.updateIncomingIsAnswer(!1),G.updateIsMuted(!1),G.updateConsultIsAnswer(!1),G.updateIsHold(!1),G.updateCustomerInfo(void 0),G.updateDisplayText("离线")})),sn(this,Ka,G.subscribeKey("answerDevice",async e=>{e===1?Y.stateObject.state===Rt.UNREGISTERED&&await it(this,fn)._changeState({data:{...Y.stateBeforeChange,state_name:Y.stateBeforeChange.state===Rt.IDLE?"空闲":"忙碌"}},"qq"):await this.destroyRtc()})),this.on(Le.KICK_OFF,()=>{this.destroy()}),window.addEventListener("beforeunload",e=>{e.returnValue="",nn.info("beforeunload","index.ts"),this.destroy()}),window.addEventListener("online",it(this,za)),window.addEventListener("offline",it(this,Ya))}static get instance(){return this._instance}static async destroyInstance(){this._instance&&(await this._instance.destroy(),this._instance=null)}static getInstance(e){if(!this._instance){if(!e)throw new Error("首次调用必须传入配置参数");const{url:n,appKey:r,appSecret:i,agentNo:o}=e;Si=n||"https://aicc-api.yescloudy.com",Kd=r,Vd=i,zl=o,sr._creatingInstance=!0,this._instance=new sr,delete sr._creatingInstance}return this._instance}getInit(){return it(this,$i)}async init({enableBrowserAlert:e,logBuiltinEnabled:n,browserAlertTime:r,onCallBack:i}){try{let o="";const a=new URL(Si).host;o=Si.includes("https")?`wss://${a}`:`ws://${a}`;const s=An.getInstance({url:`${o}/ccs-ws/api/v1/ws/call/${zl}?Authorization=`,sipClient:null,onOpen:async()=>{const A=await yn(`${zi}/config/swiftms`,{});sn(this,Fo,A.data);const l=await yn(`${zi}/ring/query`,{});sn(this,Xi,l.data);const u=await yn(`${zi}/audio/list`,{});sn(this,ko,u.data),Y.logBuiltinEnabled=n||!1,Y.browserAlertTime=r||5e3,await it(this,fn)._agentLogin(zl),nn.info("初始化成功","index.ts");const{current_answer_device:d,current_state:f,out_display_number:p,out_display_select_switch:v}=Y.agentInfo;f===Rt.IDLE?(G.updateActionConfigs(Vn),Y.stateObject={state:f,state_name:"空闲"},Y.stateBeforeChange=Y.stateObject):f===Rt.BUSY?(G.updateActionConfigs(gA),Y.stateObject={state:f,state_name:"忙碌"},Y.stateBeforeChange=Y.stateObject):f===Rt.UNREGISTERED&&(G.updateActionConfigs(gA),Y.stateObject={state:f,state_name:"未注册"}),v===1?G.updateSelectOutNumber(p):G.updateSelectOutNumber(""),G.updateAnswerDevice(d),ja.setInitRtcFn(this.initWebRtc),d===1&&(await this.initWebRtc(),s.setSipClient(it(this,Bn))),sn(this,un,new qw(it(this,Bn))),Y.enableBrowserAlert=e,e&&Oo.requestPermission(),de.emit(Le.AGENT_INIT_STATUS,!0),sn(this,$i,!0),clearInterval(sr._timer),sr._timer=null,ps(this,Pi,L0).call(this),i==null||i()}})}catch{de.emit(Le.AGENT_INIT_STATUS,!1),sn(this,$i,!1)}}on(e,n){return de.on(e,n),this}off(e,n){de.off(e,n)}offAll(){de.clearAllListeners()}async destroyRtc(){var e;await((e=it(this,Bn))==null?void 0:e.destroy()),sn(this,Bn,null)}async destroy(){var e,n;sr._instance&&(await this.destroyRtc(),(e=it(this,Ka))==null||e.call(this),(n=it(this,Va))==null||n.call(this),clearInterval(it(this,_i)),An.__internalClose(),de.emit(Le.DESTROY),this.offAll(),sr._instance=null,G.reset(),G.updateSelectOutNumber(""),clearInterval(sr._timer),clearTimeout(Y.autoStateTimer),Y.autoStateTimer=null,sr._timer=null)}get call_api(){const e=n=>(...r)=>n.apply(this,r);return{answerCall:e(()=>it(this,un).answerCall()),makeCall:n=>it(this,un).makeCall(n),previewMakeCall:(n,r)=>it(this,un).previewCall(n,r),cancelCall:e(()=>it(this,un).cancelCall()),hangup:e(()=>it(this,un).hangup()),sendDTMF:e(n=>it(this,un).sendDTMF(n)),holdCall:e(()=>it(this,un).holdCall()),unholdCall:e(()=>it(this,un).unholdCall()),consultCall:e(async n=>{try{await it(this,un).consultCall(n)}catch(r){throw console.warn(r),r}}),consultRetrieve:e(()=>it(this,un).consultRetrieve()),consultTransfer:e(()=>it(this,un).consultTransfer()),mute:e(()=>it(this,un).mute()),unmute:e(()=>it(this,un).unmute()),satisfactionEvaluation:e(()=>it(this,un).satisfactionEvaluation()),startConference:e(()=>it(this,un).startConference()),transferAgent:e(n=>it(this,un).transferAgent(n)),transferOutline:e(n=>it(this,un).transferOutline(n)),earSpeakStart:e(n=>it(this,fn).earCall(n)),earSpeakStop:e(n=>it(this,fn).stopEarCall(n)),forceInsert:e(n=>it(this,fn).forceInsert(n)),forceDisconnect:e(n=>it(this,fn).forceDisconnect(n))}}get agent_api(){const e=n=>(...r)=>n.apply(this,r);return{changeDevice:e(n=>it(this,fn).changeDevice(n)),changeState:e(async n=>{const r=G.get("answerDevice");if(Y.stateObject.state===Rt.UNREGISTERED&&r===1){await it(this,Bn).reconnect();let i="";const o=new URL(Si).host;i=Si.includes("https")?`wss://${o}`:`ws://${o}`;const{agent_no:a}=Y.agentInfo;An.getInstance({url:`${i}/ccs-ws/api/v1/ws/call/${a}?Authorization=`,sipClient:it(this,Bn)})}await it(this,fn).changeState(n,"c")}),getIdleAgentList:e(n=>it(this,fn).getIdleAgentList(n)),getAgentState:e(n=>it(this,fn).getAgentState(n)),setAgentExplicit:e(n=>it(this,fn).setAgentExplicit(n)),checkAgentLogin:n=>it(this,fn).checkAgentLogin(n),getCallRecord:n=>it(this,fn).getCallRecord(n),agentLogout:async(n,r)=>{try{await it(this,fn).logout(n),await this.destroy(),r==null||r({code:0,msg:""})}catch{}},listenAgentCall:n=>it(this,fn).listenCall(n)}}getAgentData(){const{agent_no:e,agent_name:n,answer_devices:r,out_display_data:i,out_display_select_switch:o,current_state:a}=Y.agentInfo,{stateObject:s}=Y,{soft_device_ring_switch:A}=it(this,Xi),l={1:"软电话",2:"手机模式",3:"SIP话机"};return{agent_no:e,agent_name:n,init_state:a,default_device:G.get("answerDevice"),out_display_data:i,out_display_select_switch:o,answer_devices:(r||"").split(",").map(u=>({value:Number(u),label:l[Number(u)]})),stateObject:s,soft_device_ring_switch:A===1}}async getRealTimeCustomerInfo(){return G.get("customerObject")}setBrowserAlert(e){if(typeof e!="boolean")throw new Error(JSON.stringify({code:1,msg:"参数类型错误"}));Y.logBuiltinEnabled=e||!1}setBrowserAlertTime(e){if(typeof e!="number")throw new Error(JSON.stringify({code:1,msg:"参数类型错误"}));Y.browserAlertTime=e||3e3}getEarSpeakAgent(){const{sounds_url:e}=it(this,Fo),{soft_device_ring_audio_id:n}=it(this,Xi),r=it(this,ko).find(({audio_id:i})=>i===n);if(r!=null&&r.app_id){let i="";return i=r.app_id==="-1"?`/ivr/${r.object}`:`/${r.app_id}/ivr/${r.object}`,`${e}${i}`}return""}};Bn=new WeakMap,fn=new WeakMap,un=new WeakMap,_i=new WeakMap,Fo=new WeakMap,Xi=new WeakMap,ko=new WeakMap,Ka=new WeakMap,Va=new WeakMap,$i=new WeakMap,za=new WeakMap,Ya=new WeakMap,Pi=new WeakSet,j0=async function(){const e=G.get("isNextState");try{await Dw(),e||G.updateIsNextState(!0)}catch{de.emit(Le.FAIL_NOTIFICATION,"网络断开,请检查网络"),e&&G.updateIsNextState(!1)}},L0=function(){sr._timer||(sr._timer=setInterval(()=>ps(this,Pi,j0).call(this),3e3))},Wa=new WeakMap,U0=async function(){return it(this,Bn)?it(this,Bn).getNetworkStats():{}},kA._instance=null,kA._timer=null;let kn=kA;sr=kn;var er=function(){return er=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},er.apply(this,arguments)};function io(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function Zw(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var Kw=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Vw=Zw(function(t){return Kw.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),Xt="-ms-",ba="-moz-",Ht="-webkit-",H0="comm",KA="rule",zd="decl",zw="@import",G0="@keyframes",Yw="@layer",q0=Math.abs,Yd=String.fromCharCode,ou=Object.assign;function Ww(t,e){return Rn(t,0)^45?(((e<<2^Rn(t,0))<<2^Rn(t,1))<<2^Rn(t,2))<<2^Rn(t,3):0}function Z0(t){return t.trim()}function oi(t,e){return(t=e.exec(t))?t[0]:t}function xt(t,e,n){return t.replace(e,n)}function _s(t,e,n){return t.indexOf(e,n)}function Rn(t,e){return t.charCodeAt(e)|0}function Go(t,e,n){return t.slice(e,n)}function Vr(t){return t.length}function K0(t){return t.length}function ma(t,e){return e.push(t),t}function Jw(t,e){return t.map(e).join("")}function Zg(t,e){return t.filter(function(n){return!oi(n,e)})}var VA=1,qo=1,V0=0,Ir=0,hn=0,_o="";function zA(t,e,n,r,i,o,a,s){return{value:t,root:e,parent:n,type:r,props:i,children:o,line:VA,column:qo,length:a,return:"",siblings:s}}function wi(t,e){return ou(zA("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function ho(t){for(;t.root;)t=wi(t.root,{children:[t]});ma(t,t.siblings)}function _w(){return hn}function Xw(){return hn=Ir>0?Rn(_o,--Ir):0,qo--,hn===10&&(qo=1,VA--),hn}function Fr(){return hn=Ir<V0?Rn(_o,Ir++):0,qo++,hn===10&&(qo=1,VA++),hn}function to(){return Rn(_o,Ir)}function Xs(){return Ir}function YA(t,e){return Go(_o,t,e)}function au(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $w(t){return VA=qo=1,V0=Vr(_o=t),Ir=0,[]}function eI(t){return _o="",t}function Wl(t){return Z0(YA(Ir-1,su(t===91?t+2:t===40?t+1:t)))}function tI(t){for(;(hn=to())&&hn<33;)Fr();return au(t)>2||au(hn)>3?"":" "}function nI(t,e){for(;--e&&Fr()&&!(hn<48||hn>102||hn>57&&hn<65||hn>70&&hn<97););return YA(t,Xs()+(e<6&&to()==32&&Fr()==32))}function su(t){for(;Fr();)switch(hn){case t:return Ir;case 34:case 39:t!==34&&t!==39&&su(hn);break;case 40:t===41&&su(t);break;case 92:Fr();break}return Ir}function rI(t,e){for(;Fr()&&t+hn!==57;)if(t+hn===84&&to()===47)break;return"/*"+YA(e,Ir-1)+"*"+Yd(t===47?t:Fr())}function iI(t){for(;!au(to());)Fr();return YA(t,Ir)}function oI(t){return eI($s("",null,null,null,[""],t=$w(t),0,[0],t))}function $s(t,e,n,r,i,o,a,s,A){for(var l=0,u=0,d=a,f=0,p=0,v=0,C=1,m=1,y=1,S=0,I="",O=i,x=o,g=r,M=I;m;)switch(v=S,S=Fr()){case 40:if(v!=108&&Rn(M,d-1)==58){_s(M+=xt(Wl(S),"&","&\f"),"&\f",q0(l?s[l-1]:0))!=-1&&(y=-1);break}case 34:case 39:case 91:M+=Wl(S);break;case 9:case 10:case 13:case 32:M+=tI(v);break;case 92:M+=nI(Xs()-1,7);continue;case 47:switch(to()){case 42:case 47:ma(aI(rI(Fr(),Xs()),e,n,A),A);break;default:M+="/"}break;case 123*C:s[l++]=Vr(M)*y;case 125*C:case 59:case 0:switch(S){case 0:case 125:m=0;case 59+u:y==-1&&(M=xt(M,/\f/g,"")),p>0&&Vr(M)-d&&ma(p>32?Vg(M+";",r,n,d-1,A):Vg(xt(M," ","")+";",r,n,d-2,A),A);break;case 59:M+=";";default:if(ma(g=Kg(M,e,n,l,u,i,s,I,O=[],x=[],d,o),o),S===123)if(u===0)$s(M,e,g,g,O,o,d,s,x);else switch(f===99&&Rn(M,3)===110?100:f){case 100:case 108:case 109:case 115:$s(t,g,g,r&&ma(Kg(t,g,g,0,0,i,s,I,i,O=[],d,x),x),i,x,d,s,r?O:x);break;default:$s(M,g,g,g,[""],x,0,s,x)}}l=u=p=0,C=y=1,I=M="",d=a;break;case 58:d=1+Vr(M),p=v;default:if(C<1){if(S==123)--C;else if(S==125&&C++==0&&Xw()==125)continue}switch(M+=Yd(S),S*C){case 38:y=u>0?1:(M+="\f",-1);break;case 44:s[l++]=(Vr(M)-1)*y,y=1;break;case 64:to()===45&&(M+=Wl(Fr())),f=to(),u=d=Vr(I=M+=iI(Xs())),S++;break;case 45:v===45&&Vr(M)==2&&(C=0)}}return o}function Kg(t,e,n,r,i,o,a,s,A,l,u,d){for(var f=i-1,p=i===0?o:[""],v=K0(p),C=0,m=0,y=0;C<r;++C)for(var S=0,I=Go(t,f+1,f=q0(m=a[C])),O=t;S<v;++S)(O=Z0(m>0?p[S]+" "+I:xt(I,/&\f/g,p[S])))&&(A[y++]=O);return zA(t,e,n,i===0?KA:s,A,l,u,d)}function aI(t,e,n,r){return zA(t,e,n,H0,Yd(_w()),Go(t,2,-2),0,r)}function Vg(t,e,n,r,i){return zA(t,e,n,zd,Go(t,0,r),Go(t,r+1,-1),r,i)}function z0(t,e,n){switch(Ww(t,e)){case 5103:return Ht+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ht+t+t;case 4789:return ba+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Ht+t+ba+t+Xt+t+t;case 5936:switch(Rn(t,e+11)){case 114:return Ht+t+Xt+xt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Ht+t+Xt+xt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Ht+t+Xt+xt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return Ht+t+Xt+t+t;case 6165:return Ht+t+Xt+"flex-"+t+t;case 5187:return Ht+t+xt(t,/(\w+).+(:[^]+)/,Ht+"box-$1$2"+Xt+"flex-$1$2")+t;case 5443:return Ht+t+Xt+"flex-item-"+xt(t,/flex-|-self/g,"")+(oi(t,/flex-|baseline/)?"":Xt+"grid-row-"+xt(t,/flex-|-self/g,""))+t;case 4675:return Ht+t+Xt+"flex-line-pack"+xt(t,/align-content|flex-|-self/g,"")+t;case 5548:return Ht+t+Xt+xt(t,"shrink","negative")+t;case 5292:return Ht+t+Xt+xt(t,"basis","preferred-size")+t;case 6060:return Ht+"box-"+xt(t,"-grow","")+Ht+t+Xt+xt(t,"grow","positive")+t;case 4554:return Ht+xt(t,/([^-])(transform)/g,"$1"+Ht+"$2")+t;case 6187:return xt(xt(xt(t,/(zoom-|grab)/,Ht+"$1"),/(image-set)/,Ht+"$1"),t,"")+t;case 5495:case 3959:return xt(t,/(image-set\([^]*)/,Ht+"$1$`$1");case 4968:return xt(xt(t,/(.+:)(flex-)?(.*)/,Ht+"box-pack:$3"+Xt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ht+t+t;case 4200:if(!oi(t,/flex-|baseline/))return Xt+"grid-column-align"+Go(t,e)+t;break;case 2592:case 3360:return Xt+xt(t,"template-","")+t;case 4384:case 3616:return n&&n.some(function(r,i){return e=i,oi(r.props,/grid-\w+-end/)})?~_s(t+(n=n[e].value),"span",0)?t:Xt+xt(t,"-start","")+t+Xt+"grid-row-span:"+(~_s(n,"span",0)?oi(n,/\d+/):+oi(n,/\d+/)-+oi(t,/\d+/))+";":Xt+xt(t,"-start","")+t;case 4896:case 4128:return n&&n.some(function(r){return oi(r.props,/grid-\w+-start/)})?t:Xt+xt(xt(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return xt(t,/(.+)-inline(.+)/,Ht+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Vr(t)-1-e>6)switch(Rn(t,e+1)){case 109:if(Rn(t,e+4)!==45)break;case 102:return xt(t,/(.+:)(.+)-([^]+)/,"$1"+Ht+"$2-$3$1"+ba+(Rn(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~_s(t,"stretch",0)?z0(xt(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return xt(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,A,l){return Xt+i+":"+o+l+(a?Xt+i+"-span:"+(s?A:+A-+o)+l:"")+t});case 4949:if(Rn(t,e+6)===121)return xt(t,":",":"+Ht)+t;break;case 6444:switch(Rn(t,Rn(t,14)===45?18:11)){case 120:return xt(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ht+(Rn(t,14)===45?"inline-":"")+"box$3$1"+Ht+"$2$3$1"+Xt+"$2box$3")+t;case 100:return xt(t,":",":"+Xt)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return xt(t,"scroll-","scroll-snap-")+t}return t}function hA(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function sI(t,e,n,r){switch(t.type){case Yw:if(t.children.length)break;case zw:case zd:return t.return=t.return||t.value;case H0:return"";case G0:return t.return=t.value+"{"+hA(t.children,r)+"}";case KA:if(!Vr(t.value=t.props.join(",")))return""}return Vr(n=hA(t.children,r))?t.return=t.value+"{"+n+"}":""}function AI(t){var e=K0(t);return function(n,r,i,o){for(var a="",s=0;s<e;s++)a+=t[s](n,r,i,o)||"";return a}}function lI(t){return function(e){e.root||(e=e.return)&&t(e)}}function cI(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case zd:t.return=z0(t.value,t.length,n);return;case G0:return hA([wi(t,{value:xt(t.value,"@","@"+Ht)})],r);case KA:if(t.length)return Jw(n=t.props,function(i){switch(oi(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":ho(wi(t,{props:[xt(i,/:(read-\w+)/,":"+ba+"$1")]})),ho(wi(t,{props:[i]})),ou(t,{props:Zg(n,r)});break;case"::placeholder":ho(wi(t,{props:[xt(i,/:(plac\w+)/,":"+Ht+"input-$1")]})),ho(wi(t,{props:[xt(i,/:(plac\w+)/,":"+ba+"$1")]})),ho(wi(t,{props:[xt(i,/:(plac\w+)/,Xt+"input-$1")]})),ho(wi(t,{props:[i]})),ou(t,{props:Zg(n,r)});break}return""})}}var uI={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},oo=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Y0="active",W0="data-styled-version",WA="6.1.19",Wd=`/*!sc*/
175
175
  `,pA=typeof window<"u"&&typeof document<"u",dI=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production"),zg=/invalid hook call/i,Ms=new Set,fI=function(t,e){if(process.env.NODE_ENV!=="production"){var n=e?' with the id of "'.concat(e,'"'):"",r="The component ".concat(t).concat(n,` has been created dynamically.
176
176
  `)+`You may see this warning because you've called styled inside another component.
177
177
  To resolve this only create new StyledComponents outside of any render method and function component.
@@ -683,7 +683,7 @@ html body {
683
683
  &:hover {
684
684
  opacity: 0.9;
685
685
  }
686
- `;function bN({title:t,content:e,icon:n,onOk:r,onCancel:i}){const o=document.createElement("div");document.body.appendChild(o);const a=hN.createRoot(o),s=()=>{a.unmount(),o.remove()},A=async()=>{r&&await r(),s()},l=()=>{i==null||i(),s()};a.render(oe.jsx(pN,{children:oe.jsxs(mN,{children:[oe.jsxs(vN,{children:[n&&oe.jsx(CN,{children:n}),t]}),oe.jsx(yN,{children:e}),oe.jsxs(EN,{children:[oe.jsx(Ym,{onClick:l,children:"取消"}),oe.jsx(Ym,{primary:!0,onClick:A,children:"确定"})]})]})}))}const SN={1:oe.jsx(vt,{name:"ruandianhua"}),2:oe.jsx(vt,{name:"pnhone"}),3:oe.jsx(vt,{name:"sip-phone"})},wN={call_number:"",answer:"接听",reject:"拒接",hangup:"挂机",dtmf:"DTMF",unhold:"取消保持",hold:"保持",mute:"静音",unmute:"取消静音",satisfaction:"满意度",consult:"咨询",consult_transfer:"咨询转接",consult_retrieve:"取回通话",conference:"三方会议",whisper:"耳语",cancel_whisper:"取消耳语",force_insert:"强插",force_disconnect:"强拆"},IN={空闲:1,离线:0,未注册:4},xN=N.lazy(()=>Promise.resolve().then(()=>require("./ConsultModel-CJG6jt_N.js"))),RN=N.lazy(()=>Promise.resolve().then(()=>require("./TransferModel-GEZgTHCS.js"))),Cc=on.div`
686
+ `;function bN({title:t,content:e,icon:n,onOk:r,onCancel:i}){const o=document.createElement("div");document.body.appendChild(o);const a=hN.createRoot(o),s=()=>{a.unmount(),o.remove()},A=async()=>{r&&await r(),s()},l=()=>{i==null||i(),s()};a.render(oe.jsx(pN,{children:oe.jsxs(mN,{children:[oe.jsxs(vN,{children:[n&&oe.jsx(CN,{children:n}),t]}),oe.jsx(yN,{children:e}),oe.jsxs(EN,{children:[oe.jsx(Ym,{onClick:l,children:"取消"}),oe.jsx(Ym,{primary:!0,onClick:A,children:"确定"})]})]})}))}const SN={1:oe.jsx(vt,{name:"ruandianhua"}),2:oe.jsx(vt,{name:"pnhone"}),3:oe.jsx(vt,{name:"sip-phone"})},wN={call_number:"",answer:"接听",reject:"拒接",hangup:"挂机",dtmf:"DTMF",unhold:"取消保持",hold:"保持",mute:"静音",unmute:"取消静音",satisfaction:"满意度",consult:"咨询",consult_transfer:"咨询转接",consult_retrieve:"取回通话",conference:"三方会议",whisper:"耳语",cancel_whisper:"取消耳语",force_insert:"强插",force_disconnect:"强拆"},IN={空闲:1,离线:0,未注册:4},xN=N.lazy(()=>Promise.resolve().then(()=>require("./ConsultModel-CFCn6Dvi.js"))),RN=N.lazy(()=>Promise.resolve().then(()=>require("./TransferModel-BVWm7MRw.js"))),Cc=on.div`
687
687
  width: 25px;
688
688
  height: 25px;
689
689
  background: ${({bg:t})=>t};
@@ -1,6 +1,6 @@
1
1
  import * as r from "react";
2
2
  import $, { useContext as re, useRef as Z, useMemo as Lt, useEffect as De } from "react";
3
- import { i as Dt, K as Ne, g as se, F as kt, m as fe, u as N, r as nt, b as Pe, p as je, C as q, c as O, d as Ie, e as At, o as ge, f as Ce, h as _t, k as Vt, l as Wt, W as qt, n as Gt, B as Te, q as ot, s as Xt, _ as R, t as ke, v as Y, w as Me, x as at, y as Ae, z as Ut, A as _e, D as Ve, P as Kt, G as Qt, H as K, J as Zt, L as Yt, N as Re, O as Jt, Q as lt, T as en, U as tn, V as rt, X as nn, Z as on, $ as an, a0 as ue, a1 as ln, a2 as st, a3 as rn, a4 as sn, a5 as cn, a6 as dn, a7 as un, a8 as mn, a9 as fn, aa as gn, ab as Cn, ac as it, ad as pn, ae as vn } from "./index-CyAAnwN2.mjs";
3
+ import { i as Dt, K as Ne, g as se, F as kt, m as fe, u as N, r as nt, b as Pe, p as je, C as q, c as O, d as Ie, e as At, o as ge, f as Ce, h as _t, k as Vt, l as Wt, W as qt, n as Gt, B as Te, q as ot, s as Xt, _ as R, t as ke, v as Y, w as Me, x as at, y as Ae, z as Ut, A as _e, D as Ve, P as Kt, G as Qt, H as K, J as Zt, L as Yt, N as Re, O as Jt, Q as lt, T as en, U as tn, V as rt, X as nn, Z as on, $ as an, a0 as ue, a1 as ln, a2 as st, a3 as rn, a4 as sn, a5 as cn, a6 as dn, a7 as un, a8 as mn, a9 as fn, aa as gn, ab as Cn, ac as it, ad as pn, ae as vn } from "./index-C0zVL8Ds.mjs";
4
4
  const bn = new Ne("antFadeIn", {
5
5
  "0%": {
6
6
  opacity: 0
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-BSJJAI7K.js");exports.YsytAgentLogout=e.agentLogout;exports.YsytCallForceInsert=e.callForceInsert;exports.YsytCallForceSplit=e.callForceSplit;exports.YsytGetCustomerInfo=e.getCustomerInfo;exports.YsytListenCall=e.listenCall;exports.YsytMakeCall=e.makeCall;exports.YsytPreviewMakeCall=e.previewMakeCall;exports.YsytSetAgentDevice=e.setAgentDevice;exports.YsytSetAgentInitState=e.setAgentInitState;exports.YsytStartEarSpeak=e.startEarSpeak;exports.YsytStopEarSpeak=e.stopEarSpeak;exports.default=e.YsytBarPhone;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-D50bW92-.js");exports.YsytAgentLogout=e.agentLogout;exports.YsytCallForceInsert=e.callForceInsert;exports.YsytCallForceSplit=e.callForceSplit;exports.YsytGetCustomerInfo=e.getCustomerInfo;exports.YsytListenCall=e.listenCall;exports.YsytMakeCall=e.makeCall;exports.YsytPreviewMakeCall=e.previewMakeCall;exports.YsytSetAgentDevice=e.setAgentDevice;exports.YsytSetAgentInitState=e.setAgentInitState;exports.YsytStartEarSpeak=e.startEarSpeak;exports.YsytStopEarSpeak=e.stopEarSpeak;exports.default=e.YsytBarPhone;
@@ -1,4 +1,4 @@
1
- import { ak as s, ap as e, aq as l, ah as y, am as Y, ag as o, al as r, aj as n, ai as S, an as i, ao as p, af as C } from "./index-CyAAnwN2.mjs";
1
+ import { ak as s, ap as e, aq as l, ah as y, am as Y, ag as o, al as r, aj as n, ai as S, an as i, ao as p, af as C } from "./index-C0zVL8Ds.mjs";
2
2
  export {
3
3
  s as YsytAgentLogout,
4
4
  e as YsytCallForceInsert,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ysyt-react-agent-lib",
3
- "version": "1.2.22",
3
+ "version": "1.2.23",
4
4
  "description": "",
5
5
  "main": "dist/ysyt-react-agent-lib.cjs.js",
6
6
  "module": "dist/ysyt-react-agent-lib.es.js",
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "antd": "5.24.0",
31
31
  "styled-components": "^6.1.13",
32
- "ysyt-agent-sdk": "2.0.33"
32
+ "ysyt-agent-sdk": "2.0.34"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^18.2.0",