@subiz/widget-v4 4.1.42 → 4.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled_src/chatbox/PoweredBy.js +1 -1
- package/compiled_src/chatbox/TextMessage.js +0 -56
- package/compiled_src/store/api.js +0 -2
- package/compiled_src/util/common.js +1 -1
- package/dist/{18a3a577516.362.js → 18b1ceaf2e0.362.js} +1 -1
- package/dist/{18a3a577516.782.js → 18b1ceaf2e0.782.js} +1 -1
- package/dist/18b1ceaf2e0.841.js +1 -0
- package/dist/18b1ceaf2e0.app.js +1 -0
- package/dist/{18a3a577516.index.html → 18b1ceaf2e0.index.html} +1 -1
- package/dist/{18a3a577516.library.html → 18b1ceaf2e0.library.html} +1 -1
- package/dist/18b1ceaf2e0.library.js +1 -0
- package/dist/{18a3a577516.preview.html → 18b1ceaf2e0.preview.html} +1 -1
- package/dist/18b1ceaf2e0.preview.js +1 -0
- package/dist/18b1ceaf2e0.screenshoot.js +1 -0
- package/dist/18b1ceaf2e0.webview.js +1 -0
- package/dist/362.js +1 -1
- package/dist/782.js +1 -1
- package/dist/{132.js → 841.js} +3 -93
- package/dist/HASH +1 -1
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +38 -18
- package/package.json +2 -3
- package/src/chatbox/PoweredBy.js +3 -1
- package/src/chatbox/TextMessage.js +0 -68
- package/src/store/api.js +1 -1
- package/src/util/common.js +1 -1
- package/dist/18a3a577516.132.js +0 -1
- package/dist/18a3a577516.441.js +0 -1
- package/dist/18a3a577516.app.js +0 -1
- package/dist/18a3a577516.library.js +0 -1
- package/dist/18a3a577516.preview.js +0 -1
- package/dist/18a3a577516.screenshoot.js +0 -1
- package/dist/18a3a577516.webview.js +0 -1
- package/dist/441.js +0 -2699
- /package/dist/{18a3a577516.178.js → 18b1ceaf2e0.178.js} +0 -0
- /package/dist/{18a3a577516.213.js → 18b1ceaf2e0.213.js} +0 -0
- /package/dist/{18a3a577516.335.js → 18b1ceaf2e0.335.js} +0 -0
- /package/dist/{18a3a577516.605.js → 18b1ceaf2e0.605.js} +0 -0
- /package/dist/{18a3a577516.678.js → 18b1ceaf2e0.678.js} +0 -0
package/dist/screenshoot.js
CHANGED
|
@@ -1751,7 +1751,7 @@ function setUserAttr(user, attr) {
|
|
|
1751
1751
|
if (!user) return;
|
|
1752
1752
|
if (!op.get(attr, 'key')) return;
|
|
1753
1753
|
user.attributes = user.attributes || [];
|
|
1754
|
-
var index = findIndex(user.attributes, a => a.key === attr.key);
|
|
1754
|
+
var index = findIndex(user.attributes, a => a && a.key === attr.key);
|
|
1755
1755
|
if (index === -1) {
|
|
1756
1756
|
user.attributes.push(attr);
|
|
1757
1757
|
return;
|
|
@@ -3774,11 +3774,11 @@ class Pubsub {
|
|
|
3774
3774
|
/* harmony export */ HY: () => (/* binding */ k),
|
|
3775
3775
|
/* harmony export */ Vf: () => (/* binding */ _),
|
|
3776
3776
|
/* harmony export */ h: () => (/* binding */ y),
|
|
3777
|
-
/* harmony export */ sY: () => (/* binding */
|
|
3777
|
+
/* harmony export */ sY: () => (/* binding */ B),
|
|
3778
3778
|
/* harmony export */ wA: () => (/* binding */ b)
|
|
3779
3779
|
/* harmony export */ });
|
|
3780
3780
|
/* unused harmony exports cloneElement, createContext, createElement, hydrate, isValidElement, options, toChildArray */
|
|
3781
|
-
var n,l,u,t,i,o,r,f,e,c={},s=[],a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h=Array.isArray;function v(n,l){for(var u in l)n[u]=l[u];return n}function p(n){var l=n.parentNode;l&&l.removeChild(n)}function y(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d(l,f,i,o,null)}function d(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function _(){return{current:null}}function k(n){return n.children}function b(n,l){this.props=n,this.context=l}function g(n,l){if(null==l)return n.__?g(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?g(n):null}function m(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return m(n)}}function w(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!x.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(x)}function x(){var n,l,u,t,o,r,e,c,s;for(i.sort(f);n=i.shift();)n.__d&&(l=i.length,t=void 0,o=void 0,r=void 0,c=(e=(u=n).__v).__e,(s=u.__P)&&(t=[],o=[],(r=v({},e)).__v=e.__v+1,L(s,e,r,u.__n,void 0!==s.ownerSVGElement,null!=e.__h?[c]:null,t,null==c?g(e):c,e.__h,o),M(t,e,o),e.__e!=c&&m(e)),i.length>l&&i.sort(f));x.__r=0}function P(n,l,u,t,i,o,r,f,e,a,v){var p,y,_,b,m,w,x,P,C,H=0,I=t&&t.__k||s,T=I.length,j=T,z=l.length;for(u.__k=[],p=0;p<z;p++)null!=(b=u.__k[p]=null==(b=l[p])||"boolean"==typeof b||"function"==typeof b?null:"string"==typeof b||"number"==typeof b||"bigint"==typeof b?d(null,b,null,null,b):h(b)?d(k,{children:b},null,null,null):b.__b>0?d(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)?(b.__=u,b.__b=u.__b+1,-1===(P=A(b,I,x=p+H,j))?_=c:(_=I[P]||c,I[P]=void 0,j--),L(n,b,_,i,o,r,f,e,a,v),m=b.__e,(y=b.ref)&&_.ref!=y&&(_.ref&&O(_.ref,null,b),v.push(y,b.__c||m,b)),null!=m&&(null==w&&(w=m),(C=_===c||null===_.__v)?-1==P&&H--:P!==x&&(P===x+1?H++:P>x?j>z-x?H+=P-x:H--:H=P<x&&P==x-1?P-x:0),x=p+H,"function"!=typeof b.type||P===x&&_.__k!==b.__k?"function"==typeof b.type||P===x&&!C?void 0!==b.__d?(e=b.__d,b.__d=void 0):e=m.nextSibling:e=S(n,m,e):e=$(b,e,n),"function"==typeof u.type&&(u.__d=e))):(_=I[p])&&null==_.key&&_.__e&&(_.__e==e&&(e=g(_)),q(_,_,!1),I[p]=null);for(u.__e=w,p=T;p--;)null!=I[p]&&("function"==typeof u.type&&null!=I[p].__e&&I[p].__e==u.__d&&(u.__d=I[p].__e.nextSibling),q(I[p],I[p]))}function $(n,l,u){for(var t,i=n.__k,o=0;i&&o<i.length;o++)(t=i[o])&&(t.__=n,l="function"==typeof t.type?$(t,l,u):S(u,t.__e,l));return l}function C(n,l){return l=l||[],null==n||"boolean"==typeof n||(h(n)?n.some(function(n){C(n,l)}):l.push(n)),l}function S(n,l,u){return null==u||u.parentNode!==n?n.insertBefore(l,null):l==u&&null!=l.parentNode||n.insertBefore(l,u),l.nextSibling}function A(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type)return u;if(t>(null!=e?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&i==e.key&&o===e.type)return r;r--}if(f<l.length){if((e=l[f])&&i==e.key&&o===e.type)return f;f++}}return-1}function H(n,l,u,t,i){var o;for(o in u)"children"===o||"key"===o||o in l||T(n,o,null,u[o],t);for(o in l)i&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||T(n,o,l[o],u[o],t)}function I(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a.test(l)?u:u+"px"}function T(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||I(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||I(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t||n.addEventListener(l,o?z:j,o):n.removeEventListener(l,o?z:j,o);else if("dangerouslySetInnerHTML"!==l){if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u))}}function j(n){return this.l[n.type+!1](l.event?l.event(n):n)}function z(n){return this.l[n.type+!0](l.event?l.event(n):n)}function L(n,u,t,i,o,r,f,e,c,s){var a,p,y,d,_,g,m,w,x,$,C,S,A,H,I,T=u.type;if(void 0!==u.constructor)return null;null!=t.__h&&(c=t.__h,e=u.__e=t.__e,u.__h=null,r=[e]),(a=l.__b)&&a(u);n:if("function"==typeof T)try{if(w=u.props,x=(a=T.contextType)&&i[a.__c],$=a?x?x.props.value:a.__:i,t.__c?m=(p=u.__c=t.__c).__=p.__E:("prototype"in T&&T.prototype.render?u.__c=p=new T(w,$):(u.__c=p=new b(w,$),p.constructor=T,p.render=B),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=$,p.__n=i,y=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=T.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=v({},p.__s)),v(p.__s,T.getDerivedStateFromProps(w,p.__s))),d=p.props,_=p.state,p.__v=u,y)null==T.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==T.getDerivedStateFromProps&&w!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,$),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,$)||u.__v===t.__v)){for(u.__v!==t.__v&&(p.props=w,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u)}),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[],p.__h.length&&f.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,$),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,_,g)})}if(p.context=$,p.props=w,p.__P=n,p.__e=!1,S=l.__r,A=0,"prototype"in T&&T.prototype.render){for(p.state=p.__s,p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),H=0;H<p._sb.length;H++)p.__h.push(p._sb[H]);p._sb=[]}else do{p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++A<25);p.state=p.__s,null!=p.getChildContext&&(i=v(v({},i),p.getChildContext())),y||null==p.getSnapshotBeforeUpdate||(g=p.getSnapshotBeforeUpdate(d,_)),P(n,h(I=null!=a&&a.type===k&&null==a.key?a.props.children:a)?I:[I],u,t,i,o,r,f,e,c,s),p.base=u.__e,u.__h=null,p.__h.length&&f.push(p),m&&(p.__E=p.__=null)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,t)}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=N(t.__e,u,t,i,o,r,f,c,s);(a=l.diffed)&&a(u)}function M(n,u,t){for(var i=0;i<t.length;i++)O(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function N(l,u,t,i,o,r,f,e,s){var a,v,y,d=t.props,_=u.props,k=u.type,b=0;if("svg"===k&&(o=!0),null!=r)for(;b<r.length;b++)if((a=r[b])&&"setAttribute"in a==!!k&&(k?a.localName===k:3===a.nodeType)){l=a,r[b]=null;break}if(null==l){if(null===k)return document.createTextNode(_);l=o?document.createElementNS("http://www.w3.org/2000/svg",k):document.createElement(k,_.is&&_),r=null,e=!1}if(null===k)d===_||e&&l.data===_||(l.data=_);else{if(r=r&&n.call(l.childNodes),v=(d=t.props||c).dangerouslySetInnerHTML,y=_.dangerouslySetInnerHTML,!e){if(null!=r)for(d={},b=0;b<l.attributes.length;b++)d[l.attributes[b].name]=l.attributes[b].value;(y||v)&&(y&&(v&&y.__html==v.__html||y.__html===l.innerHTML)||(l.innerHTML=y&&y.__html||""))}if(H(l,_,d,o,e),y)u.__k=[];else if(P(l,h(b=u.props.children)?b:[b],u,t,i,o&&"foreignObject"!==k,r,f,r?r[0]:t.__k&&g(t,0),e,s),null!=r)for(b=r.length;b--;)null!=r[b]&&p(r[b]);e||("value"in _&&void 0!==(b=_.value)&&(b!==l.value||"progress"===k&&!b||"option"===k&&b!==d.value)&&T(l,"value",b,d.value,!1),"checked"in _&&void 0!==(b=_.checked)&&b!==l.checked&&T(l,"checked",b,d.checked,!1))}return l}function O(n,u,t){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,t)}}function q(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||O(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&q(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||p(n.__e),n.__=n.__e=n.__d=void 0}function B(n,l,u){return this.constructor(n,u)}function D(u,t,i){var o,r,f,e;l.__&&l.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],L(t,u=(!o&&i||t).__k=y(k,null,[u]),r||c,c,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),M(f,u,e)}function E(n,l){D(n,l,E)}function F(l,u,t){var i,o,r,f,e=v({},l.props);for(r in l.type&&l.type.defaultProps&&(f=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=void 0===u[r]&&void 0!==f?f[r]:u[r];return arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),d(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l="__cC"+e++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,w(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=s.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&void 0===n.constructor},b.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof n&&(n=n(v({},u),this.props)),n&&v(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w(this))},b.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w(this))},b.prototype.render=k,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},x.__r=0,e=0;
|
|
3781
|
+
var n,l,u,t,i,o,r,f,e,c={},s=[],a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function h(n,l){for(var u in l)n[u]=l[u];return n}function p(n){var l=n.parentNode;l&&l.removeChild(n)}function y(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d(l,f,i,o,null)}function d(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function _(){return{current:null}}function k(n){return n.children}function b(n,l){this.props=n,this.context=l}function g(n,l){if(null==l)return n.__?g(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__d||u.__e;return"function"==typeof n.type?g(n):null}function m(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return m(n)}}function w(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!x.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(x)}function x(){var n,l,u,t,o,r,e,c,s;for(i.sort(f);n=i.shift();)n.__d&&(l=i.length,t=void 0,o=void 0,r=void 0,c=(e=(u=n).__v).__e,(s=u.__P)&&(t=[],o=[],(r=h({},e)).__v=e.__v+1,z(s,e,r,u.__n,void 0!==s.ownerSVGElement,null!=e.__h?[c]:null,t,null==c?g(e):c,e.__h,o),L(t,e,o),e.__e!=c&&m(e)),i.length>l&&i.sort(f));x.__r=0}function P(n,l,u,t,i,o,r,f,e,a,h){var p,y,_,b,m,w,x,P,C,D=0,H=t&&t.__k||s,I=H.length,T=I,j=l.length;for(u.__k=[],p=0;p<j;p++)null!=(b=u.__k[p]=null==(b=l[p])||"boolean"==typeof b||"function"==typeof b?null:"string"==typeof b||"number"==typeof b||"bigint"==typeof b?d(null,b,null,null,b):v(b)?d(k,{children:b},null,null,null):b.__b>0?d(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)?(b.__=u,b.__b=u.__b+1,-1===(P=A(b,H,x=p+D,T))?_=c:(_=H[P]||c,H[P]=void 0,T--),z(n,b,_,i,o,r,f,e,a,h),m=b.__e,(y=b.ref)&&_.ref!=y&&(_.ref&&N(_.ref,null,b),h.push(y,b.__c||m,b)),null!=m&&(null==w&&(w=m),(C=_===c||null===_.__v)?-1==P&&D--:P!==x&&(P===x+1?D++:P>x?T>j-x?D+=P-x:D--:D=P<x&&P==x-1?P-x:0),x=p+D,"function"!=typeof b.type||P===x&&_.__k!==b.__k?"function"==typeof b.type||P===x&&!C?void 0!==b.__d?(e=b.__d,b.__d=void 0):e=m.nextSibling:e=S(n,m,e):e=$(b,e,n),"function"==typeof u.type&&(u.__d=e))):(_=H[p])&&null==_.key&&_.__e&&(_.__e==e&&(_.__=t,e=g(_)),O(_,_,!1),H[p]=null);for(u.__e=w,p=I;p--;)null!=H[p]&&("function"==typeof u.type&&null!=H[p].__e&&H[p].__e==u.__d&&(u.__d=H[p].__e.nextSibling),O(H[p],H[p]))}function $(n,l,u){for(var t,i=n.__k,o=0;i&&o<i.length;o++)(t=i[o])&&(t.__=n,l="function"==typeof t.type?$(t,l,u):S(u,t.__e,l));return l}function C(n,l){return l=l||[],null==n||"boolean"==typeof n||(v(n)?n.some(function(n){C(n,l)}):l.push(n)),l}function S(n,l,u){return null==u||u.parentNode!==n?n.insertBefore(l,null):l==u&&null!=l.parentNode||n.insertBefore(l,u),l.nextSibling}function A(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type)return u;if(t>(null!=e?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&i==e.key&&o===e.type)return r;r--}if(f<l.length){if((e=l[f])&&i==e.key&&o===e.type)return f;f++}}return-1}function D(n,l,u,t,i){var o;for(o in u)"children"===o||"key"===o||o in l||I(n,o,null,u[o],t);for(o in l)i&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||I(n,o,l[o],u[o],t)}function H(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a.test(l)?u:u+"px"}function I(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||H(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||H(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=Date.now(),n.addEventListener(l,o?j:T,o)):n.removeEventListener(l,o?j:T,o);else if("dangerouslySetInnerHTML"!==l){if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&"role"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u))}}function T(n){var u=this.l[n.type+!1];if(n.t){if(n.t<=u.u)return}else n.t=Date.now();return u(l.event?l.event(n):n)}function j(n){return this.l[n.type+!0](l.event?l.event(n):n)}function z(n,u,t,i,o,r,f,e,c,s){var a,p,y,d,_,g,m,w,x,$,C,S,A,D,H,I=u.type;if(void 0!==u.constructor)return null;null!=t.__h&&(c=t.__h,e=u.__e=t.__e,u.__h=null,r=[e]),(a=l.__b)&&a(u);n:if("function"==typeof I)try{if(w=u.props,x=(a=I.contextType)&&i[a.__c],$=a?x?x.props.value:a.__:i,t.__c?m=(p=u.__c=t.__c).__=p.__E:("prototype"in I&&I.prototype.render?u.__c=p=new I(w,$):(u.__c=p=new b(w,$),p.constructor=I,p.render=q),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=$,p.__n=i,y=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=h({},p.__s)),h(p.__s,I.getDerivedStateFromProps(w,p.__s))),d=p.props,_=p.state,p.__v=u,y)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==I.getDerivedStateFromProps&&w!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,$),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,$)||u.__v===t.__v)){for(u.__v!==t.__v&&(p.props=w,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u)}),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[],p.__h.length&&f.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,$),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,_,g)})}if(p.context=$,p.props=w,p.__P=n,p.__e=!1,S=l.__r,A=0,"prototype"in I&&I.prototype.render){for(p.state=p.__s,p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),D=0;D<p._sb.length;D++)p.__h.push(p._sb[D]);p._sb=[]}else do{p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++A<25);p.state=p.__s,null!=p.getChildContext&&(i=h(h({},i),p.getChildContext())),y||null==p.getSnapshotBeforeUpdate||(g=p.getSnapshotBeforeUpdate(d,_)),P(n,v(H=null!=a&&a.type===k&&null==a.key?a.props.children:a)?H:[H],u,t,i,o,r,f,e,c,s),p.base=u.__e,u.__h=null,p.__h.length&&f.push(p),m&&(p.__E=p.__=null)}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,t)}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=M(t.__e,u,t,i,o,r,f,c,s);(a=l.diffed)&&a(u)}function L(n,u,t){for(var i=0;i<t.length;i++)N(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function M(l,u,t,i,o,r,f,e,s){var a,h,y,d=t.props,_=u.props,k=u.type,b=0;if("svg"===k&&(o=!0),null!=r)for(;b<r.length;b++)if((a=r[b])&&"setAttribute"in a==!!k&&(k?a.localName===k:3===a.nodeType)){l=a,r[b]=null;break}if(null==l){if(null===k)return document.createTextNode(_);l=o?document.createElementNS("http://www.w3.org/2000/svg",k):document.createElement(k,_.is&&_),r=null,e=!1}if(null===k)d===_||e&&l.data===_||(l.data=_);else{if(r=r&&n.call(l.childNodes),h=(d=t.props||c).dangerouslySetInnerHTML,y=_.dangerouslySetInnerHTML,!e){if(null!=r)for(d={},b=0;b<l.attributes.length;b++)d[l.attributes[b].name]=l.attributes[b].value;(y||h)&&(y&&(h&&y.__html==h.__html||y.__html===l.innerHTML)||(l.innerHTML=y&&y.__html||""))}if(D(l,_,d,o,e),y)u.__k=[];else if(P(l,v(b=u.props.children)?b:[b],u,t,i,o&&"foreignObject"!==k,r,f,r?r[0]:t.__k&&g(t,0),e,s),null!=r)for(b=r.length;b--;)null!=r[b]&&p(r[b]);e||("value"in _&&void 0!==(b=_.value)&&(b!==l.value||"progress"===k&&!b||"option"===k&&b!==d.value)&&I(l,"value",b,d.value,!1),"checked"in _&&void 0!==(b=_.checked)&&b!==l.checked&&I(l,"checked",b,d.checked,!1))}return l}function N(n,u,t){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,t)}}function O(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||N(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&O(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||p(n.__e),n.__=n.__e=n.__d=void 0}function q(n,l,u){return this.constructor(n,u)}function B(u,t,i){var o,r,f,e;l.__&&l.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],z(t,u=(!o&&i||t).__k=y(k,null,[u]),r||c,c,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),L(f,u,e)}function E(n,l){B(n,l,E)}function F(l,u,t){var i,o,r,f,e=h({},l.props);for(r in l.type&&l.type.defaultProps&&(f=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=void 0===u[r]&&void 0!==f?f[r]:u[r];return arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),d(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l="__cC"+e++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,w(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=s.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&void 0===n.constructor},b.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof n&&(n=n(h({},u),this.props)),n&&h(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w(this))},b.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w(this))},b.prototype.render=k,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},x.__r=0,e=0;
|
|
3782
3782
|
//# sourceMappingURL=preact.module.js.map
|
|
3783
3783
|
|
|
3784
3784
|
|
|
@@ -4055,8 +4055,6 @@ function jsonifyTextPlain(param, done) {
|
|
|
4055
4055
|
_defineProperty(this, "ajax", ajax);
|
|
4056
4056
|
_defineProperty(this, "start", extraData => {
|
|
4057
4057
|
let data = {
|
|
4058
|
-
starter_id: this.uid,
|
|
4059
|
-
starter_type: 'user',
|
|
4060
4058
|
touchpoint: {
|
|
4061
4059
|
channel: 'subiz',
|
|
4062
4060
|
source: 'web'
|
|
@@ -4177,8 +4175,9 @@ function jsonifyTextPlain(param, done) {
|
|
|
4177
4175
|
let outuser;
|
|
4178
4176
|
for (let i = 0; true; i++) {
|
|
4179
4177
|
outuser = await ajax.setBaseUrl(this.ApiURL).withCredentials(true).addQuery('v', '6').addQuery('x-user-ref', this.ref).setParser('json').get(`/accounts/${this.accid}/users/${this.ref}`);
|
|
4178
|
+
if (outuser.error && util/* default */.Z.get(outuser, 'body.code', '').indexOf('locked_account') != -1) break;
|
|
4180
4179
|
if (!util/* default */.Z.get(outuser, 'body.id')) {
|
|
4181
|
-
let sleeptime = Math.min(2000 + i *
|
|
4180
|
+
let sleeptime = Math.min(2000 + i * 400, 60000);
|
|
4182
4181
|
await util/* default */.Z.sleep(sleeptime);
|
|
4183
4182
|
continue;
|
|
4184
4183
|
}
|
|
@@ -4780,6 +4779,7 @@ class Store {
|
|
|
4780
4779
|
return this.cache.match('convo_' + id);
|
|
4781
4780
|
});
|
|
4782
4781
|
store_defineProperty(this, "fetchConvo", async cid => {
|
|
4782
|
+
if (this._die) return dieErr;
|
|
4783
4783
|
await this.readyGate.entry();
|
|
4784
4784
|
await this.reconnectGate.entry(undefined, true);
|
|
4785
4785
|
if (this.isInsync(cid)) return this.reconnectGate.open();
|
|
@@ -4835,6 +4835,7 @@ class Store {
|
|
|
4835
4835
|
store_defineProperty(this, "matchHasManuallyClosed", () => !!this.kv.match('hasManuallyClosed'));
|
|
4836
4836
|
store_defineProperty(this, "matchClosePreviewAt", () => this.kv.match('close_preview_at') || 0);
|
|
4837
4837
|
store_defineProperty(this, "sendPresence", util/* default */.Z.throttle(async () => {
|
|
4838
|
+
if (this._die) return dieErr;
|
|
4838
4839
|
await this.readyGate.entry();
|
|
4839
4840
|
if (!util/* default */.Z.get(this.cache.match('user'), 'id')) return;
|
|
4840
4841
|
if (util/* default */.Z.isUserBanned(this.cache.match('user'))) return;
|
|
@@ -4881,6 +4882,7 @@ class Store {
|
|
|
4881
4882
|
});
|
|
4882
4883
|
store_defineProperty(this, "timeDiff", 0);
|
|
4883
4884
|
this.g_sync = {};
|
|
4885
|
+
this._die = false;
|
|
4884
4886
|
this.forceDevice = null;
|
|
4885
4887
|
this.forcePlugins = {};
|
|
4886
4888
|
this.forceAcc = {};
|
|
@@ -4908,11 +4910,18 @@ class Store {
|
|
|
4908
4910
|
this.chain = new storage.chain(new storage.lsdb('cbz2023', true), 'ch');
|
|
4909
4911
|
this.getLocaleContent = this.api.getLocaleContent;
|
|
4910
4912
|
this.g_haveSentSeenM = {};
|
|
4911
|
-
window.addEventListener('blur',
|
|
4912
|
-
window.addEventListener('focus',
|
|
4913
|
-
util/* default */.Z.setInterval(() =>
|
|
4914
|
-
|
|
4913
|
+
window.addEventListener('blur', this.sendPresence);
|
|
4914
|
+
window.addEventListener('focus', this.sendPresence);
|
|
4915
|
+
this._presenceInterval1 = util/* default */.Z.setInterval(() => {
|
|
4916
|
+
if (this._die) return util/* default */.Z.clearInterval(this._presenceInterval1);
|
|
4917
|
+
if (this.browserVisibility === 'visible' && document.hasFocus()) this.sendPresence();
|
|
4918
|
+
}, 20000);
|
|
4919
|
+
this._presenceInterval2 = util/* default */.Z.setInterval(() => {
|
|
4920
|
+
if (this._die) return util/* default */.Z.clearInterval(this._presenceInterval2);
|
|
4921
|
+
if (this.browserVisibility !== 'visible' || document.hasFocus()) this.sendPresence();
|
|
4922
|
+
}, 60000);
|
|
4915
4923
|
onVisibilityChange(val => {
|
|
4924
|
+
if (this._die) return;
|
|
4916
4925
|
this.browserVisibility = val;
|
|
4917
4926
|
this.sendPresence();
|
|
4918
4927
|
});
|
|
@@ -5020,6 +5029,7 @@ class Store {
|
|
|
5020
5029
|
return page_loaded;
|
|
5021
5030
|
}
|
|
5022
5031
|
overridePlugin(plugins) {
|
|
5032
|
+
if (this._die) return dieErr;
|
|
5023
5033
|
if (!Array.isArray(plugins)) throw 'plugins must be be an array';
|
|
5024
5034
|
let pluginM = {};
|
|
5025
5035
|
util/* default */.Z.map(plugins, function (plugin) {
|
|
@@ -5065,9 +5075,7 @@ class Store {
|
|
|
5065
5075
|
}
|
|
5066
5076
|
}
|
|
5067
5077
|
}
|
|
5068
|
-
if (this.cookie.get('__sbref', userRef) != userRef)
|
|
5069
|
-
cleanMyLocalStorage();
|
|
5070
|
-
}
|
|
5078
|
+
if (this.cookie.get('__sbref', userRef) != userRef) cleanMyLocalStorage();
|
|
5071
5079
|
this.api.setAuth({
|
|
5072
5080
|
accid: accid
|
|
5073
5081
|
});
|
|
@@ -5077,7 +5085,7 @@ class Store {
|
|
|
5077
5085
|
mask: mask,
|
|
5078
5086
|
ref: userRef
|
|
5079
5087
|
});
|
|
5080
|
-
if (user.error) return;
|
|
5088
|
+
if (user.error) return console.error(user);
|
|
5081
5089
|
if (this.realtime) this.realtime.stop();
|
|
5082
5090
|
if (this.fake) this.realtime = new realtime_fake();else this.realtime = new Realtime(this.RealtimeURL, {
|
|
5083
5091
|
account_id: accid,
|
|
@@ -5093,6 +5101,7 @@ class Store {
|
|
|
5093
5101
|
return user;
|
|
5094
5102
|
}
|
|
5095
5103
|
async login(accid, user_id, tokenGenerator) {
|
|
5104
|
+
if (this._die) return dieErr;
|
|
5096
5105
|
let user = await this.api.setAuth({
|
|
5097
5106
|
accid: accid,
|
|
5098
5107
|
profile_id: user_id,
|
|
@@ -5125,6 +5134,7 @@ class Store {
|
|
|
5125
5134
|
this.seenQueue = [];
|
|
5126
5135
|
util/* default */.Z.clearInterval(this._seenInterval);
|
|
5127
5136
|
this._seenInterval = util/* default */.Z.setInterval(() => {
|
|
5137
|
+
if (this._die) return util/* default */.Z.clearInterval(this._seenInterval);
|
|
5128
5138
|
this.seenQueue = [...new Set(this.seenQueue)];
|
|
5129
5139
|
let user = this.cache.match('user') || {};
|
|
5130
5140
|
util/* default */.Z.map(this.seenQueue, id => {
|
|
@@ -5274,6 +5284,7 @@ class Store {
|
|
|
5274
5284
|
this.wsGate.open();
|
|
5275
5285
|
}
|
|
5276
5286
|
async _onWs(ev) {
|
|
5287
|
+
if (this._die) return;
|
|
5277
5288
|
if (!ev || !ev.type) return;
|
|
5278
5289
|
ev.created = util/* default */.Z.getMs(ev.created);
|
|
5279
5290
|
if (ev.type === 'user_info_updated') {
|
|
@@ -5617,6 +5628,7 @@ class Store {
|
|
|
5617
5628
|
return [events, anchor];
|
|
5618
5629
|
}
|
|
5619
5630
|
async loopTime() {
|
|
5631
|
+
if (this._die) return;
|
|
5620
5632
|
let startms = util/* default */.Z.Date.now();
|
|
5621
5633
|
if (!util/* default */.Z.get(this.cache.match('user'), 'id')) return util/* default */.Z.setTimeout(() => this.loopTime(), 240000);
|
|
5622
5634
|
let {
|
|
@@ -5662,9 +5674,13 @@ class Store {
|
|
|
5662
5674
|
}
|
|
5663
5675
|
destroy() {
|
|
5664
5676
|
this._die = true;
|
|
5665
|
-
this.
|
|
5677
|
+
if (this.kv) this.kv.destroy();
|
|
5678
|
+
if (this.chain) this.chain.destroy();
|
|
5679
|
+
util/* default */.Z.clearInterval(this._seenInterval);
|
|
5666
5680
|
if (this.realtime) this.realtime.stop();
|
|
5667
5681
|
this.readyGate.close();
|
|
5682
|
+
window.removeEventListener('blur', this.sendPresence);
|
|
5683
|
+
window.removeEventListener('focus', this.sendPresence);
|
|
5668
5684
|
}
|
|
5669
5685
|
}
|
|
5670
5686
|
function loadImage(file) {
|
|
@@ -5829,6 +5845,7 @@ var xhrsend = function (method, url, body, cb) {
|
|
|
5829
5845
|
if (body) request.setRequestHeader('content-type', 'text/plain');
|
|
5830
5846
|
request.send(body);
|
|
5831
5847
|
};
|
|
5848
|
+
const dieErr = new Error('sdk unloaded');
|
|
5832
5849
|
// EXTERNAL MODULE: ./src/common.js
|
|
5833
5850
|
var common = __webpack_require__(2493);
|
|
5834
5851
|
// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
|
|
@@ -5837,7 +5854,7 @@ var preact_module = __webpack_require__(6400);
|
|
|
5837
5854
|
|
|
5838
5855
|
|
|
5839
5856
|
|
|
5840
|
-
const LoadChatbox = () => __webpack_require__.e(/* import() */
|
|
5857
|
+
const LoadChatbox = () => __webpack_require__.e(/* import() */ 841).then(__webpack_require__.bind(__webpack_require__, 8841));
|
|
5841
5858
|
const LoadContact = () => __webpack_require__.e(/* import() */ 335).then(__webpack_require__.bind(__webpack_require__, 2335));
|
|
5842
5859
|
const LoadPopup = () => __webpack_require__.e(/* import() */ 213).then(__webpack_require__.bind(__webpack_require__, 8213));
|
|
5843
5860
|
const LoadNotif = () => __webpack_require__.e(/* import() */ 605).then(__webpack_require__.bind(__webpack_require__, 9605));
|
|
@@ -6122,8 +6139,7 @@ class PluginMgr {
|
|
|
6122
6139
|
}
|
|
6123
6140
|
destroy() {
|
|
6124
6141
|
util/* default */.Z.map(this.pluginM, (conf, id) => {
|
|
6125
|
-
|
|
6126
|
-
this.pluginM[id].destroy();
|
|
6142
|
+
conf.destroy();
|
|
6127
6143
|
delete this.pluginM[id];
|
|
6128
6144
|
});
|
|
6129
6145
|
this._destroy = true;
|
|
@@ -6330,6 +6346,10 @@ class Widget {
|
|
|
6330
6346
|
_overrideDeviceType(type) {
|
|
6331
6347
|
this.store.overrideDeviceType(type);
|
|
6332
6348
|
}
|
|
6349
|
+
unload() {
|
|
6350
|
+
if (this.pluginMgr) this.pluginMgr.destroy();
|
|
6351
|
+
this.store.destroy();
|
|
6352
|
+
}
|
|
6333
6353
|
_overridePlugin(plugins) {
|
|
6334
6354
|
this.store.overridePlugin(plugins);
|
|
6335
6355
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subiz/widget-v4",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.44",
|
|
4
4
|
"main": "./compiled_src/lib.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "npx webpack serve --config webpack.dev.js",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"file-loader": "^6.2.0",
|
|
20
20
|
"less": "^4.2.0",
|
|
21
21
|
"less-loader": "^11.1.3",
|
|
22
|
-
"marked": "^9.0.3",
|
|
23
22
|
"preact": "^10.18.1"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
@@ -32,7 +31,7 @@
|
|
|
32
31
|
"babel-plugin-syntax-jsx": "^6.18.0",
|
|
33
32
|
"html-webpack-plugin": "^5.5.3",
|
|
34
33
|
"prettier": "^3.0.3",
|
|
35
|
-
"puppeteer": "^21.3.
|
|
34
|
+
"puppeteer": "^21.3.8",
|
|
36
35
|
"webpack": "^5.88.2",
|
|
37
36
|
"webpack-bundle-analyzer": "^4.9.1",
|
|
38
37
|
"webpack-cli": "^5.1.4",
|
package/src/chatbox/PoweredBy.js
CHANGED
|
@@ -11,7 +11,9 @@ export default class PoweredBy extends Com {
|
|
|
11
11
|
// dont render onmobile
|
|
12
12
|
if (this.props.store.isMobile()) return null
|
|
13
13
|
let user = this.props.store.matchUser() || {}
|
|
14
|
-
var link = `https://subiz.com.vn/?utm_source
|
|
14
|
+
var link = `https://subiz.com.vn/?utm_source=${
|
|
15
|
+
window.location.host || `id-${user.account_id}`
|
|
16
|
+
}&utm_medium=widget&utm_campaign=widget_referral`
|
|
15
17
|
|
|
16
18
|
return (
|
|
17
19
|
<div class='poweredby'>
|
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
import sb from '../util/index.js'
|
|
2
|
-
let mustrerender = []
|
|
3
|
-
let marked = (obj, text) => {
|
|
4
|
-
mustrerender.push(obj)
|
|
5
|
-
return ''
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const loadMarked = () => import(/*webpackChunkName: "marked" */ 'marked')
|
|
9
|
-
;(async () => {
|
|
10
|
-
let markedf = (await loadMarked()).marked
|
|
11
|
-
marked = (obj, text) => markedf(text)
|
|
12
|
-
sb.map(mustrerender, (obj) => obj.forceUpdate())
|
|
13
|
-
mustrerender = []
|
|
14
|
-
})()
|
|
15
2
|
|
|
16
3
|
import {Com} from '../common.js'
|
|
17
4
|
import {h} from 'preact'
|
|
18
5
|
import Emoji from './Emoji.js'
|
|
19
|
-
import ShadowDomRoot from './ShadowDomRoot.js'
|
|
20
6
|
|
|
21
7
|
export default class TextMessage extends Com {
|
|
22
8
|
render() {
|
|
23
9
|
var format = sb.get(this.props.ev, 'data.message.format', 'plaintext')
|
|
24
|
-
if (format === 'markdown') return this.renderMarkdown()
|
|
25
10
|
if (format === 'delta') return this.renderDelta()
|
|
26
11
|
return this.renderPlainText()
|
|
27
12
|
}
|
|
@@ -122,59 +107,6 @@ export default class TextMessage extends Com {
|
|
|
122
107
|
}
|
|
123
108
|
return <div class='message-user message-text--user'>{$deltas}</div>
|
|
124
109
|
}
|
|
125
|
-
|
|
126
|
-
renderMarkdown(text) {
|
|
127
|
-
if (!text) text = sb.get(this.props.ev, 'data.message.text')
|
|
128
|
-
if (sb.size(text) === 0) return null
|
|
129
|
-
|
|
130
|
-
let byType = sb.get(this.props.ev, 'by.type')
|
|
131
|
-
|
|
132
|
-
text = sb.trim(text)
|
|
133
|
-
if (sb.size(text) === 0) return null
|
|
134
|
-
|
|
135
|
-
if (byType === 'agent') {
|
|
136
|
-
return (
|
|
137
|
-
<div class='markdown-message message-agent message-text--agent'>
|
|
138
|
-
<ShadowDomRoot html={marked(this, text)} />
|
|
139
|
-
</div>
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return (
|
|
144
|
-
<div class='d-flex flex-column align-items-end'>
|
|
145
|
-
<div class='markdown-message message-user message-text--user'>
|
|
146
|
-
<ShadowDomRoot html={marked(this, text)} />
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
)
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function deltaToMarkdown(deltas) {
|
|
154
|
-
let output = ''
|
|
155
|
-
sb.each(deltas, (delta, idx) => {
|
|
156
|
-
let text = ''
|
|
157
|
-
let insert = delta.insert
|
|
158
|
-
let attributes = delta.attributes
|
|
159
|
-
// emoji
|
|
160
|
-
if (insert.emoji) text = emojiCodes[insert.emoji] || ''
|
|
161
|
-
// insert bold, italic, underline
|
|
162
|
-
if (attributes) {
|
|
163
|
-
if (attributes.italic && attributes.bold) text = `*__${insert}__*`
|
|
164
|
-
else if (attributes.italic) text = `*${insert}*`
|
|
165
|
-
else if (attributes.bold) text = `**${insert}**`
|
|
166
|
-
else text = insert
|
|
167
|
-
}
|
|
168
|
-
if (insert.dynamicField) text = `${sb.get(insert, 'dynamicField.text', '')}`
|
|
169
|
-
if (!insert.emoji && !attributes && !insert.dynamicField) {
|
|
170
|
-
text = insert || ''
|
|
171
|
-
// markdown need newline to <br/> characters to newline
|
|
172
|
-
text = text.replace(/\n/g, '<br/>')
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
output += text
|
|
176
|
-
})
|
|
177
|
-
return output
|
|
178
110
|
}
|
|
179
111
|
|
|
180
112
|
const emojiCodes = {
|
package/src/store/api.js
CHANGED
|
@@ -201,7 +201,7 @@ export default class {
|
|
|
201
201
|
ajax = ajax
|
|
202
202
|
|
|
203
203
|
start = (extraData) => {
|
|
204
|
-
let data = {
|
|
204
|
+
let data = {touchpoint: {channel: 'subiz', source: 'web'}}
|
|
205
205
|
sb.each(extraData, (v, k) => {
|
|
206
206
|
data[k] = v
|
|
207
207
|
})
|
package/src/util/common.js
CHANGED
|
@@ -366,7 +366,7 @@ export function setUserAttr(user, attr) {
|
|
|
366
366
|
if (!op.get(attr, 'key')) return
|
|
367
367
|
|
|
368
368
|
user.attributes = user.attributes || []
|
|
369
|
-
var index = findIndex(user.attributes, (a) => a.key === attr.key)
|
|
369
|
+
var index = findIndex(user.attributes, (a) => a && a.key === attr.key)
|
|
370
370
|
if (index === -1) {
|
|
371
371
|
user.attributes.push(attr)
|
|
372
372
|
return
|