@whereby.com/browser-sdk 3.12.11 → 3.12.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/v3-embed.js +2 -2
- package/dist/cdn/v3-react.js +2 -2
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.esm.js +1 -1
- package/package.json +2 -2
package/dist/cdn/v3-embed.js
CHANGED
|
@@ -6,11 +6,11 @@ var whereby=function(){"use strict";
|
|
|
6
6
|
function v(e){return e.join(h).replace(x,$).replace(k,_)}var b=" \\f\\n\\r\\t",y="[^"+b+"\\/>\"'=]+",w="["+b+"]+"+y,C="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",E="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+y.replace("\\/","")+"))?)",k=new RegExp(C+w+E+"+)(["+b+"]*/?>)","g"),x=new RegExp(C+w+E+"*)(["+b+"]*/>)","g"),N=new RegExp("("+w+"\\s*=\\s*)(['\"]?)"+h+"\\2","gi");function _(e,t,n,r){return"<"+t+n.replace(N,A)+r}function A(e,t,n){return t+(n||'"')+l+(n||'"')}function $(e,t,n){return g.test(t)?e:"<"+t+n+"></"+t+">"}const{isArray:S}=Array,{indexOf:j,slice:O}=[];var L=e=>({get:t=>e.get(t),set:(t,n)=>(e.set(t,n),n)});const T=(e,t)=>111===e.nodeType?1/t<0?t?(({firstChild:e,lastChild:t})=>{const n=document.createRange();return n.setStartAfter(e),n.setEndAfter(t),n.deleteContents(),e})(e):e.lastChild:t?e.valueOf():e.firstChild:e,M=e=>{const{childNodes:t}=e,{length:n}=t;if(n<2)return n?t[0]:e;const r=O.call(t,0);return{ELEMENT_NODE:1,nodeType:111,firstChild:r[0],lastChild:r[n-1],valueOf(){if(t.length!==n){let t=0;for(;t<n;)e.appendChild(r[t++])}return e}}};
|
|
7
7
|
/*! (c) Andrea Giammarchi - ISC */
|
|
8
8
|
var R=function(e){var t="fragment",n="template",r="content"in s(n)?function(e){var t=s(n);return t.innerHTML=e,t.content}:function(e){var r=s(t),a=s(n),i=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var c=RegExp.$1;a.innerHTML="<table>"+e+"</table>",i=a.querySelectorAll(c)}else a.innerHTML=e,i=a.childNodes;return o(r,i),r};return function(e,t){return("svg"===t?a:r)(e)};function o(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function s(n){return n===t?e.createDocumentFragment():e.createElementNS("http://www.w3.org/1999/xhtml",n)}function a(e){var n=s(t),r=s("div");return r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",o(n,r.firstChild.childNodes),n}}(document),P=(e,t,n,r,o)=>{const s=n.length;let a=t.length,i=s,c=0,l=0,u=null;for(;c<a||l<i;)if(a===c){const t=i<s?l?r(n[l-1],-0).nextSibling:r(n[i-l],0):o;for(;l<i;)e.insertBefore(r(n[l++],1),t)}else if(i===l)for(;c<a;)u&&u.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[l])c++,l++;else if(t[a-1]===n[i-1])a--,i--;else if(t[c]===n[i-1]&&n[l]===t[a-1]){const o=r(t[--a],-1).nextSibling;e.insertBefore(r(n[l++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--i],1),o),t[a]=n[i]}else{if(!u){u=new Map;let e=l;for(;e<i;)u.set(n[e],e++)}if(u.has(t[c])){const o=u.get(t[c]);if(l<o&&o<i){let s=c,h=1;for(;++s<a&&s<i&&u.get(t[s])===o+h;)h++;if(h>o-l){const s=r(t[c],0);for(;l<o;)e.insertBefore(r(n[l++],1),s)}else e.replaceChild(r(n[l++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n},U=function(e,t,n,r,o){var s=o in e,a=e.createDocumentFragment();return a[t](e[r]("g")),a[t](e[r]("")),(s?e[o](a,!0):a[n](!0)).childNodes.length<2?function e(r,o){for(var s=r[n](),a=r.childNodes||[],i=a.length,c=0;o&&c<i;c++)s[t](e(a[c],o));return s}:s?e[o]:function(e,t){return e[n](!!t)}}(document,"appendChild","cloneNode","createTextNode","importNode"),W="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},B=u?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function Z(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}function z(e,t,n,r){for(var o=e.childNodes,s=o.length,a=0;a<s;){var i=o[a];switch(i.nodeType){case f:var c=r.concat(a);D(i,t,n,c),z(i,t,n,c);break;case p:var u=i.textContent;if(u===l)n.shift(),t.push(m.test(e.nodeName)?F(e,r):H(i,r.concat(a)));else switch(u.slice(0,2)){case"/*":if("*/"!==u.slice(-2))break;case"👻":e.removeChild(i),a--,s--}break;case d:m.test(e.nodeName)&&W.call(i.textContent)===h&&(n.shift(),t.push(F(e,r)))}a++}}function D(e,t,n,r){for(var o=e.attributes,s=[],a=[],i=B(o,n),c=i.length,p=0;p<c;){var f,d=i[p++],m=d.value===l;if(m||1<(f=d.value.split(h)).length){var g=d.name;if(s.indexOf(g)<0){s.push(g);var v=n.shift().replace(m?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+g+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),b=o[v]||o[v.toLowerCase()];if(m)t.push(V(b,r,v,null));else{for(var y=f.length-2;y--;)n.shift();t.push(V(b,r,v,f))}}a.push(d)}}p=0;for(var w=(0<(c=a.length)&&u&&!("ownerSVGElement"in e));p<c;){var C=a[p++];w&&(C.value=""),e.removeAttribute(C.name)}var E=e.nodeName;if(/^script$/i.test(E)){var k=document.createElement(E);for(c=o.length,p=0;p<c;)k.setAttributeNode(o[p++].cloneNode(!0));k.textContent=e.textContent,e.parentNode.replaceChild(k,e)}}function H(e,t){return{type:"any",node:e,path:t}}function V(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function F(e,t){return{type:"text",node:e,path:t}}var I=L(new t);function q(e,t){var n=(e.convert||v)(t),r=e.transform;r&&(n=r(n));var o=R(n,e.type);J(o);var s=[];return z(o,s,t.slice(0),[]),{content:o,updates:function(n){for(var r=[],o=s.length,a=0,i=0;a<o;){var c=s[a++],l=Z(n,c.path);switch(c.type){case"any":r.push({fn:e.any(l,[]),sparse:!1});break;case"attr":var u=c.sparse,h=e.attribute(l,c.name,c.node);null===u?r.push({fn:h,sparse:!1}):(i+=u.length-2,r.push({fn:h,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(l),sparse:!1}),l.textContent=""}}return o+=i,function(){var e=arguments.length;if(o!==e-1)throw new Error(e-1+" values instead of "+o+"\n"+t.join("${value}"));for(var s=1,a=1;s<e;){var i=r[s-a];if(i.sparse){var c=i.values,l=c[0],u=1,h=c.length;for(a+=h-2;u<h;)l+=arguments[s++]+c[u++];i.fn(l)}else i.fn(arguments[s++])}return n}}}}var G=[];function Q(e){var t=G,n=J;return function(r){return t!==r&&(n=function(e,t){var n=I.get(t)||I.set(t,q(e,t));return n.updates(U.call(document,n.content,!0))}(e,t=r)),n.apply(null,arguments)}}function J(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===W.call(r.textContent).length&&e.removeChild(r)}}
|
|
9
|
-
/*! (c) Andrea Giammarchi - ISC */var K=function(){var e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,t=/([^A-Z])([A-Z]+)/g;return function(e,t){return"ownerSVGElement"in e?function(e,t){var n;t?n=t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),n=e.getAttributeNode("style"));return n.value="",e.setAttributeNode(n),r(n,!0)}(e,t):r(e.style,!1)};function n(e,t,n){return t+"-"+n.toLowerCase()}function r(r,o){var s,a;return function(i){var c,l,u,h;switch(typeof i){case"object":if(i){if("object"===s){if(!o&&a!==i)for(l in a)l in i||(r[l]="")}else o?r.value="":r.cssText="";for(l in c=o?{}:r,i)u="number"!=typeof(h=i[l])||e.test(l)?h:h+"px",!o&&/^--/.test(l)?c.setProperty(l,u):c[l]=u;s="object",o?r.value=function(e){var r,o=[];for(r in e)o.push(r.replace(t,n),":",e[r],";");return o.join("")}(a=c):a=i;break}default:a!=i&&(s="string",a=i,o?r.value=i||"":r.cssText=i||"")}}}}();const X=(e,t)=>{let n,r=!0;const o=document.createAttributeNS(null,t);return t=>{n!==t&&(n=t,null==n?r||(e.removeAttributeNode(o),r=!0):(o.value=t,r&&(e.setAttributeNodeNS(o),r=!1)))}},Y=({dataset:e})=>t=>{for(const n in t){const r=t[n];null==r?delete e[n]:e[n]=r}},ee=(e,t)=>"dataset"===t?Y(e):n=>{e[t]=n},te=/^(?:form|list)$/i,ne=(e,t)=>e.ownerDocument.createTextNode(t);function re(e){return this.type=e,Q(this)}function oe(e){return e(this)}re.prototype={attribute(e,t,n){const r="svg"===this.type;switch(t){case"class":if(r)return X(e,t);t="className";case"props":return ee(e,t);case"aria":return(e=>t=>{for(const n in t){const r="role"===n?n:`aria-${n}`,o=t[n];null==o?e.removeAttribute(r):e.setAttribute(r,o)}})(e);case"style":return K(e,n,r);case"ref":return(e=>t=>{"function"==typeof t?t(e):t.current=e})(e);case".dataset":return Y(e);default:return"."===t.slice(0,1)?ee(e,t.slice(1)):"?"===t.slice(0,1)?((e,t,n)=>r=>{n!==!!r&&((n=!!r)?e.setAttribute(t,""):e.removeAttribute(t))})(e,t.slice(1)):"on"===t.slice(0,2)?((e,t)=>{let n,r=t.slice(2);return!(t in e)&&t.toLowerCase()in e&&(r=r.toLowerCase()),t=>{const o=S(t)?t:[t,!1];n!==o[0]&&(n&&e.removeEventListener(r,n,o[1]),(n=o[0])&&e.addEventListener(r,n,o[1]))}})(e,t):!(t in e)||r||te.test(t)?X(e,t):((e,t)=>{let n;return r=>{n!==r&&(n=r,e[t]!==r&&(null==r?(e[t]="",e.removeAttribute(t)):e[t]=r))}})(e,t)}},any(e,t){const{type:n}=this;let r,o=!1;const s=a=>{switch(typeof a){case"string":case"number":case"boolean":o?r!==a&&(r=a,t[0].textContent=a):(o=!0,r=a,t=P(e.parentNode,t,[ne(e,a)],T,e));break;case"function":s(a(e));break;case"object":case"undefined":if(null==a){o=!1,t=P(e.parentNode,t,[],T,e);break}default:if(o=!1,r=a,S(a))if(0===a.length)t.length&&(t=P(e.parentNode,t,[],T,e));else switch(typeof a[0]){case"string":case"number":case"boolean":s(String(a));break;case"function":s(a.map(oe,e));break;case"object":S(a[0])&&(a=a.concat.apply([],a));default:t=P(e.parentNode,t,a,T,e)}else"ELEMENT_NODE"in a?t=P(e.parentNode,t,11===a.nodeType?O.call(a.childNodes):[a],T,e):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=P(e.parentNode,t,O.call(R([].concat(a.html).join(""),n).childNodes),T,e):"length"in a&&s(O.call(a))}};return s},text(e){let t;const n=r=>{if(t!==r){t=r;const o=typeof r;"object"===o&&r?"text"in r?n(String(r.text)):"any"in r?n(r.any):"html"in r?n([].concat(r.html).join("")):"length"in r&&n(O.call(r).join("")):"function"===o?n(r(e)):e.textContent=null==r?"":r}};return n}};const{create:se,freeze:ae,keys:ie}=Object,ce=re.prototype,le=L(new t),ue=e=>({html:pe("html",e),svg:pe("svg",e),render(t,n){const r="function"==typeof n?n():n,o=le.get(t)||le.set(t,he()),s=r instanceof me?fe(e,o,r):r;return s!==o.wire&&(o.wire=s,t.textContent="",t.appendChild(s.valueOf())),t}}),he=()=>({stack:[],entry:null,wire:null}),pe=(e,n)=>{const r=L(new t);return o.for=(e,t)=>{const s=r.get(e)||r.set(e,se(null));return s[t]||(s[t]=(e=>function(){return fe(n,e,o.apply(null,arguments))})(he()))},o.node=function(){return fe(n,he(),o.apply(null,arguments)).valueOf()},o;function o(){return new me(e,ve.apply(null,arguments))}},fe=(e,t,{type:n,template:r,values:o})=>{const{length:s}=o;de(e,t,o,s);let{entry:a}=t;if(a&&a.template===r&&a.type===n)a.tag(r,...o);else{const s=new e(n);t.entry=a={type:n,template:r,tag:s,wire:M(s(r,...o))}}return a.wire},de=(e,{stack:t},n,r)=>{for(let o=0;o<r;o++){const r=n[o];r instanceof ge?n[o]=fe(e,t[o]||(t[o]=he()),r):S(r)?de(e,t[o]||(t[o]=he()),r,r.length):t[o]=null}r<t.length&&t.splice(r)};function me(e,t){this.type=e,this.template=t.shift(),this.values=t}ae(me);const ge=me;function ve(){let e=[],t=0,{length:n}=arguments;for(;t<n;)e.push(arguments[t++]);return e}ue(re);var be="function"==typeof cancelAnimationFrame,ye=be?cancelAnimationFrame:clearTimeout,we=be?requestAnimationFrame:setTimeout;function Ce(e){var t,n,r,o,s;return i(),function(e,i,l){return r=e,o=i,s=l,n||(n=we(a)),--t<0&&c(!0),c};function a(){i(),r.apply(o,s||[])}function i(){t=
|
|
9
|
+
/*! (c) Andrea Giammarchi - ISC */var K=function(){var e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,t=/([^A-Z])([A-Z]+)/g;return function(e,t){return"ownerSVGElement"in e?function(e,t){var n;t?n=t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),n=e.getAttributeNode("style"));return n.value="",e.setAttributeNode(n),r(n,!0)}(e,t):r(e.style,!1)};function n(e,t,n){return t+"-"+n.toLowerCase()}function r(r,o){var s,a;return function(i){var c,l,u,h;switch(typeof i){case"object":if(i){if("object"===s){if(!o&&a!==i)for(l in a)l in i||(r[l]="")}else o?r.value="":r.cssText="";for(l in c=o?{}:r,i)u="number"!=typeof(h=i[l])||e.test(l)?h:h+"px",!o&&/^--/.test(l)?c.setProperty(l,u):c[l]=u;s="object",o?r.value=function(e){var r,o=[];for(r in e)o.push(r.replace(t,n),":",e[r],";");return o.join("")}(a=c):a=i;break}default:a!=i&&(s="string",a=i,o?r.value=i||"":r.cssText=i||"")}}}}();const X=(e,t)=>{let n,r=!0;const o=document.createAttributeNS(null,t);return t=>{n!==t&&(n=t,null==n?r||(e.removeAttributeNode(o),r=!0):(o.value=t,r&&(e.setAttributeNodeNS(o),r=!1)))}},Y=({dataset:e})=>t=>{for(const n in t){const r=t[n];null==r?delete e[n]:e[n]=r}},ee=(e,t)=>"dataset"===t?Y(e):n=>{e[t]=n},te=/^(?:form|list)$/i,ne=(e,t)=>e.ownerDocument.createTextNode(t);function re(e){return this.type=e,Q(this)}function oe(e){return e(this)}re.prototype={attribute(e,t,n){const r="svg"===this.type;switch(t){case"class":if(r)return X(e,t);t="className";case"props":return ee(e,t);case"aria":return(e=>t=>{for(const n in t){const r="role"===n?n:`aria-${n}`,o=t[n];null==o?e.removeAttribute(r):e.setAttribute(r,o)}})(e);case"style":return K(e,n,r);case"ref":return(e=>t=>{"function"==typeof t?t(e):t.current=e})(e);case".dataset":return Y(e);default:return"."===t.slice(0,1)?ee(e,t.slice(1)):"?"===t.slice(0,1)?((e,t,n)=>r=>{n!==!!r&&((n=!!r)?e.setAttribute(t,""):e.removeAttribute(t))})(e,t.slice(1)):"on"===t.slice(0,2)?((e,t)=>{let n,r=t.slice(2);return!(t in e)&&t.toLowerCase()in e&&(r=r.toLowerCase()),t=>{const o=S(t)?t:[t,!1];n!==o[0]&&(n&&e.removeEventListener(r,n,o[1]),(n=o[0])&&e.addEventListener(r,n,o[1]))}})(e,t):!(t in e)||r||te.test(t)?X(e,t):((e,t)=>{let n;return r=>{n!==r&&(n=r,e[t]!==r&&(null==r?(e[t]="",e.removeAttribute(t)):e[t]=r))}})(e,t)}},any(e,t){const{type:n}=this;let r,o=!1;const s=a=>{switch(typeof a){case"string":case"number":case"boolean":o?r!==a&&(r=a,t[0].textContent=a):(o=!0,r=a,t=P(e.parentNode,t,[ne(e,a)],T,e));break;case"function":s(a(e));break;case"object":case"undefined":if(null==a){o=!1,t=P(e.parentNode,t,[],T,e);break}default:if(o=!1,r=a,S(a))if(0===a.length)t.length&&(t=P(e.parentNode,t,[],T,e));else switch(typeof a[0]){case"string":case"number":case"boolean":s(String(a));break;case"function":s(a.map(oe,e));break;case"object":S(a[0])&&(a=a.concat.apply([],a));default:t=P(e.parentNode,t,a,T,e)}else"ELEMENT_NODE"in a?t=P(e.parentNode,t,11===a.nodeType?O.call(a.childNodes):[a],T,e):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=P(e.parentNode,t,O.call(R([].concat(a.html).join(""),n).childNodes),T,e):"length"in a&&s(O.call(a))}};return s},text(e){let t;const n=r=>{if(t!==r){t=r;const o=typeof r;"object"===o&&r?"text"in r?n(String(r.text)):"any"in r?n(r.any):"html"in r?n([].concat(r.html).join("")):"length"in r&&n(O.call(r).join("")):"function"===o?n(r(e)):e.textContent=null==r?"":r}};return n}};const{create:se,freeze:ae,keys:ie}=Object,ce=re.prototype,le=L(new t),ue=e=>({html:pe("html",e),svg:pe("svg",e),render(t,n){const r="function"==typeof n?n():n,o=le.get(t)||le.set(t,he()),s=r instanceof me?fe(e,o,r):r;return s!==o.wire&&(o.wire=s,t.textContent="",t.appendChild(s.valueOf())),t}}),he=()=>({stack:[],entry:null,wire:null}),pe=(e,n)=>{const r=L(new t);return o.for=(e,t)=>{const s=r.get(e)||r.set(e,se(null));return s[t]||(s[t]=(e=>function(){return fe(n,e,o.apply(null,arguments))})(he()))},o.node=function(){return fe(n,he(),o.apply(null,arguments)).valueOf()},o;function o(){return new me(e,ve.apply(null,arguments))}},fe=(e,t,{type:n,template:r,values:o})=>{const{length:s}=o;de(e,t,o,s);let{entry:a}=t;if(a&&a.template===r&&a.type===n)a.tag(r,...o);else{const s=new e(n);t.entry=a={type:n,template:r,tag:s,wire:M(s(r,...o))}}return a.wire},de=(e,{stack:t},n,r)=>{for(let o=0;o<r;o++){const r=n[o];r instanceof ge?n[o]=fe(e,t[o]||(t[o]=he()),r):S(r)?de(e,t[o]||(t[o]=he()),r,r.length):t[o]=null}r<t.length&&t.splice(r)};function me(e,t){this.type=e,this.template=t.shift(),this.values=t}ae(me);const ge=me;function ve(){let e=[],t=0,{length:n}=arguments;for(;t<n;)e.push(arguments[t++]);return e}ue(re);var be="function"==typeof cancelAnimationFrame,ye=be?cancelAnimationFrame:clearTimeout,we=be?requestAnimationFrame:setTimeout;function Ce(e){var t,n,r,o,s;return i(),function(e,i,l){return r=e,o=i,s=l,n||(n=we(a)),--t<0&&c(!0),c};function a(){i(),r.apply(o,s||[])}function i(){t=1/0,n=be?0:null}function c(e){var t=!!n;return t&&(ye(n),e&&a()),t}}
|
|
10
10
|
/*! (c) Andrea Giammarchi - ISC */let Ee=null;const ke=L(new WeakMap),xe=(e,t,n)=>{e.apply(t,n)},Ne={async:!1,always:!1},_e=(e,t)=>"function"==typeof t?t(e):t,Ae=(e,t,n,r)=>{const o=Ee.i++,{hook:s,args:a,stack:i,length:c}=Ee;o===c&&(Ee.length=i.push({}));const l=i[o];if(l.args=a,o===c){const o="function"==typeof n,{async:a,always:i}=(o?r:n)||r||Ne;l.$=o?n(t):_e(void 0,t),l._=a?ke.get(s)||ke.set(s,Ce()):xe,l.f=t=>{const n=e(l.$,t);(i||l.$!==n)&&(l.$=n,l._(s,null,l.args))}}return[l.$,l.f]},$e=new WeakMap;function Se({hook:e}){return e===this.hook}const je=new WeakMap,Oe=L(je),Le=()=>{},Te=e=>(t,n)=>{const r=Ee.i++,{hook:o,after:s,stack:a,length:i}=Ee;if(r<i){const o=a[r],{update:i,values:c,stop:l}=o;if(!n||n.some(We,c)){o.values=n,e&&l(e);const{clean:r}=o;r&&(o.clean=null,r());const a=()=>{o.clean=t()};e?i(a):s.push(a)}}else{const r=e?Ce():Le,i={clean:null,update:r,values:n,stop:Le};Ee.length=a.push(i),(Oe.get(o)||Oe.set(o,[])).push(i);const c=()=>{i.clean=t()};e?i.stop=r(c):s.push(c)}},Me=e=>{(je.get(e)||[]).forEach((e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())}))};je.has.bind(je);const Re=Te(!0),Pe=Te(!1),Ue=(e,t)=>{const n=Ee.i++,{stack:r,length:o}=Ee;return n===o?Ee.length=r.push({$:e(),_:t}):t&&!t.some(We,r[n]._)||(r[n]={$:e(),_:t}),r[n].$};function We(e,t){return e!==this[t]}let Be=null;try{Be=new{o(){}}.o}catch(Bt){}let Ze=e=>class extends e{};if(Be){const{getPrototypeOf:e,setPrototypeOf:t}=Object,{construct:n}="object"==typeof Reflect?Reflect:{construct(e,n,r){const o=[null];for(let e=0;e<n.length;e++)o.push(n[e]);const s=e.bind.apply(e,o);return t(new s,r.prototype)}};Ze=function(r,o){function s(){return n(o?e(r):r,arguments,s)}return t(s.prototype,r.prototype),t(s,r)}}const ze={map:{},re:null},De=e=>new RegExp(`<(/)?(${e.join("|")})([^A-Za-z0-9:._-])`,"g");let He=null;const Ve=(e,t)=>{const{map:n,re:r}=He||t;return e.replace(r,((e,t,r,o)=>{const{tagName:s,is:a,element:i}=n[r];return i?t?`</${a}>`:`<${a}${o}`:t?`</${s}>`:`<${s} is="${a}"${o}`}))},Fe=({tagName:e,is:t,element:n})=>n?t:`${e}[is="${t}"]`,Ie=()=>He,qe=e=>{He=e},Ge={useCallback:(e,t)=>Ue((()=>e),t),useContext:e=>{const{hook:t,args:n}=Ee,r=$e.get(e),o={hook:t,args:n};return r.some(Se,o)||r.push(o),e.value},useEffect:Re,useLayoutEffect:Pe,useMemo:Ue,useReducer:Ae,useRef:e=>{const t=Ee.i++,{stack:n,length:r}=Ee;return t===r&&(Ee.length=n.push({current:e})),n[t]},useState:(e,t)=>Ae(_e,e,void 0,t)},{render:Qe,html:Je,svg:Ke}=(e=>{const t=se(ce);return ie(e).forEach((n=>{t[n]=e[n](t[n]||("convert"===n?v:String))})),n.prototype=t,ue(n);function n(){return re.apply(this,arguments)}})({transform:()=>e=>Ve(e,ze)}),Xe="_🔥",{defineProperties:Ye}=Object,et=new t,tt=new t,nt=new t,rt=new c,ot=!0,st="attributeChangedCallback",at="connectedCallback",it=`dis${at}`,ct=(e,t,n)=>{if(n in e){const r=e[n];t[n]={configurable:ot,value(){return wt.call(this),r.apply(this,arguments)}}}else t[n]={configurable:ot,value:wt}},lt=e=>{const{prototype:n}=e,r=[],o={html:{configurable:ot,get:vt},svg:{configurable:ot,get:bt}};if(o[Xe]={value:{events:r,info:null}},"handleEvent"in n||(o.handleEvent={configurable:ot,value:yt}),"render"in n&&n.render.length){const{oninit:e}=n;Ye(n,{oninit:{configurable:ot,value(){const t=(e=>{const t=[];return function n(){const r=Ee,o=[];Ee={hook:n,args:arguments,stack:t,i:0,length:t.length,after:o};try{return e.apply(null,arguments)}finally{Ee=r;for(let e=0,{length:t}=o;e<t;e++)o[e]()}}})(this.render.bind(this,Ge));Ye(this,{render:{configurable:ot,value:t}}),this.addEventListener("disconnected",Me.bind(null,t),!1),e&&e.apply(this,arguments)}}})}"oninit"in n&&(r.push("init"),ct(n,o,"render")),ct(n,o,st),ct(n,o,at),ct(n,o,it),[[st,"onattributechanged",Ct],[at,"onconnected",Et],[it,"ondisconnected",xt],[at,"render",kt]].forEach((([e,t,s])=>{if(!(e in n)&&t in n)if("render"!==t&&r.push(t.slice(2)),e in o){const t=o[e].value;o[e]={configurable:ot,value(){return t.apply(this,arguments),s.apply(this,arguments)}}}else o[e]={configurable:ot,value:s}}));const s=e.booleanAttributes||[];s.forEach((e=>{e in n||(o[e]={configurable:ot,get(){return this.hasAttribute(e)},set(t){t&&"false"!==t?this.setAttribute(e,t):this.removeAttribute(e)}})}));const a=e.observedAttributes||[];a.forEach((e=>{e in n||(o[e]={configurable:ot,get(){return this.getAttribute(e)},set(t){null==t?this.removeAttribute(e):this.setAttribute(e,t)}})}));(e.mappedAttributes||[]).forEach((e=>{const s=new t,a="on"+e in n;a&&r.push(e),o[e]={configurable:ot,get(){return s.get(this)},set(t){if(s.set(this,t),a){const n=ut(e);if(n.detail=t,rt.has(this))this.dispatchEvent(n);else{const e=nt.get(this);e?e.push(n):nt.set(this,[n])}}}}})),Ye(n,o);const i=s.concat(a);return i.length?Ye(e,{observedAttributes:{configurable:ot,get:()=>i}}):e},ut=e=>new r(e),ht=(...e)=>new ge("html",e);ht.for=Je.for;const pt=(...e)=>new ge("svg",e);pt.for=Ke.for;const ft=(e,n,r)=>{const o=dt(e,n,new t);return r.set(e,o),o},dt=(e,t,n)=>(r,...o)=>{const s=n.get(r)||((e,t,{info:n})=>{const r=n?Ve(t.join(Xe),n).split(Xe):t;return e.set(t,r),r})(n,r,e[Xe]);return Qe(e,(()=>t(s,...o)))};function mt(e){this.addEventListener(e,this)}function gt(e){this.dispatchEvent(e)}function vt(){return et.get(this)||ft(this,ht,et)}function bt(){return tt.get(this)||ft(this,pt,tt)}function yt(e){this[`on${e.type}`](e)}function wt(){if(!rt.has(this)){rt.add(this),this[Xe].events.forEach(mt,this),this.dispatchEvent(ut("init"));const e=nt.get(this);e&&(nt.delete(this),e.forEach(gt,this))}}function Ct(e,t,n){const r=ut("attributechanged");r.attributeName=e,r.oldValue=t,r.newValue=n,this.dispatchEvent(r)}function Et(){this.dispatchEvent(ut("connected"))}function kt(){this.render()}function xt(){this.dispatchEvent(ut("disconnected"))}const{create:Nt,defineProperty:_t,defineProperties:At,getOwnPropertyNames:$t,getOwnPropertySymbols:St,getOwnPropertyDescriptor:jt,keys:Ot}=Object,Lt={element:HTMLElement},Tt=new t;new t;const Mt=new t;new t;const Rt=e=>{const t=Nt(null),n=Nt(null),r={prototype:n,statics:t};return $t(e).concat(St(e)).forEach((r=>{const o=jt(e,r);switch(o.enumerable=!1,r){case"extends":r="tagName";case"contains":case"includes":case"name":case"booleanAttributes":case"mappedAttributes":case"observedAttributes":case"style":case"tagName":t[r]=o;break;default:n[r]=o}})),r},Pt=(e,t,n)=>{if(!/^([A-Z][A-Za-z0-9_]*)(<([A-Za-z0-9:._-]+)>|:([A-Za-z0-9:._-]+))?$/.test(e))throw"Invalid name";const{$1:r,$3:o,$4:s}=RegExp;let a=o||s||t.tagName||t.extends||"element";const i="fragment"===a;if(i)a="element";else if(!/^[A-Za-z0-9:._-]+$/.test(a))throw"Invalid tag";let c="",l="";a.indexOf("-")<0?(c=r.replace(/(([A-Z0-9])([A-Z0-9][a-z]))|(([a-z])([A-Z]))/g,"$2$5-$3$6").toLowerCase()+n,c.indexOf("-")<0&&(l="-heresy")):(c=a+n,a="element");const u=c+l;if(customElements.get(u))throw`Duplicated ${u} definition`;const h=Ze("object"==typeof t?Mt.get(t)||((e,t)=>{const{statics:n,prototype:r}=Rt(e),o=Ze(Lt[t]||(Lt[t]=document.createElement(t).constructor),!1);return At(o.prototype,r),At(o,n),Mt.set(e,lt(o)),o})(t,a):Tt.get(t)||(e=>{const t=Ze(e,!1);return Tt.set(e,lt(t)),t})(t),!0),p="element"===a;if(_t(h,"new",{value:p?()=>document.createElement(u):()=>document.createElement(a,{is:u})}),_t(h.prototype,"is",{value:u}),""===n){const e=(e=>{const{length:t}=e;let n=0,r=0;for(;r<t;)n=(n<<5)-n+e.charCodeAt(r++),n&=n;return n.toString(36)})(c.toUpperCase());ze.map[r]=Ut(h,a,u,{id:e,i:0}),ze.re=De(Ot(ze.map))}if(i){const{render:e}=h.prototype;_t(h.prototype,"render",{configurable:!0,value(){if(e&&e.apply(this,arguments),this.parentNode){const{firstChild:e}=this;let t=null;if(e){const n=document.createRange();n.setStartBefore(e),n.setEndAfter(this.lastChild),t=n.extractContents(),this.parentNode.replaceChild(t,this)}}}})}const f=[u,h];return p||f.push({extends:a}),customElements.define(...f),{Class:h,is:u,name:r,tagName:a}},Ut=(e,t,n,r)=>{const{prototype:o}=e,s=((e,t)=>({tagName:e,is:t,element:"element"===e}))(t,n),a=[Fe(s)],i=e.includes||e.contains;if(i){const e={};Ot(i).forEach((t=>{const n=`-${r.id}-${r.i++}`,{Class:o,is:s,name:c,tagName:l}=Pt(t,i[t],n);a.push(Fe(e[c]=Ut(o,l,s,r)))}));const t=De(Ot(e)),{events:n}=o[Xe],s={events:n,info:{map:e,re:t}};if(_t(o,Xe,{value:s}),"render"in o){const{render:e}=o,{info:t}=s;_t(o,"render",{configurable:!0,value(){const n=Ie();qe(t);const r=e.apply(this,arguments);return qe(n),r}})}}return"style"in e&&(e=>{if((e||"").length){const t=document.createElement("style");t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e));const n=document.head||document.querySelector("head");n.insertBefore(t,n.lastChild)}})(e.style(...a)),s};const Wt=["aec","agc","audio","audioDenoiser","autoHideSelfView","autoSpotlight","background","bottomToolbar","breakout","callQualityMonitoring","cameraAccess","chat","embed","emptyRoomInvitation","floatSelf","help","leaveButton","locking","localization","logo","lowData","moreButton","participantCount","personality","pipButton","precallCeremony","precallCeremonyCanSkip","precallPermissionsHelpLink","precallReview","people","reactions","recording","roomIntegrations","screenshare","settingsButton","skipMediaPermissionPrompt","subgridLabels","timer","toolbarDarkText","topToolbar","video"];var Bt,Zt;Bt="WherebyEmbed",Zt={oninit(){this.iframe=((e,t)=>e?e[t]||(e[t]={current:null}):{current:null})()},onconnected(){window.addEventListener("message",this.onmessage.bind(this))},ondisconnected(){window.removeEventListener("message",this.onmessage.bind(this))},observedAttributes:["displayName","minimal","room","subdomain","lang","metadata","groups","virtualBackgroundUrl","avatarUrl","externalId","title","cameraEffect","emojiSkinTone",...Wt].map((e=>e.toLowerCase())),onattributechanged({attributeName:e,oldValue:t}){["room","subdomain"].includes(e)&&null==t||this.render()},style:e=>`\n ${e} {\n display: block;\n }\n ${e} iframe {\n border: none;\n height: 100%;\n width: 100%;\n }\n `,_postCommand(e,t=[]){this.iframe.current&&this.iframe.current.contentWindow.postMessage({command:e,args:t},this.roomUrl.origin)},endMeeting(){this._postCommand("end_meeting")},knock(){this._postCommand("knock")},leaveRoom(){this._postCommand("leave_room")},openSettings(e="media"){this._postCommand("open_settings",[e])},startRecording(){this._postCommand("start_recording")},stopRecording(){this._postCommand("stop_recording")},startStreaming(){this._postCommand("start_streaming")},stopStreaming(){this._postCommand("stop_streaming")},startLiveTranscription(){this._postCommand("start_live_transcription")},stopLiveTranscription(){this._postCommand("stop_live_transcription")},toggleBreakout(e){this._postCommand("toggle_breakout",[e])},toggleCamera(e){this._postCommand("toggle_camera",[e])},toggleMicrophone(e){this._postCommand("toggle_microphone",[e])},togglePeople(e){this._postCommand("toggle_people",[e])},toggleScreenshare(e){this._postCommand("toggle_screenshare",[e])},toggleChat(e){this._postCommand("toggle_chat",[e])},onmessage({origin:e,data:t}){if(!this.roomUrl||e!==this.roomUrl.origin)return;const{type:n,payload:r}=t;this.dispatchEvent(new CustomEvent(n,{detail:r}))},render(){const{avatarurl:e,displayname:t,cameraeffect:n,emojiskintone:r,lang:o,metadata:s,externalid:a,minimal:i,room:c,groups:l,virtualbackgroundurl:u,title:h}=this;let p,f;try{({roomUrl:p,subdomain:f}=function(e,t){if(!e)throw new Error("Missing room attribute");const n=/https:\/\/([^.]+)(\.whereby\.com|-ip-\d+-\d+-\d+-\d+.hereby.dev:4443)\/.+/.exec(e),r=n&&n[1]||t;if(!r)throw new Error("Missing subdomain attribute");if(!n)throw new Error("Could not parse room URL");return{subdomain:r,roomUrl:new URL(e)}}(c,this.subdomain))}catch(e){return this.html`Whereby: ${e instanceof Error?e.message:"unknown error"}`}this.roomUrl=p,Object.entries(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({jsApi:!0,we:"1",iframeSource:f},t&&{displayName:t}),o&&{lang:o}),s&&{metadata:s}),r&&{emojiSkinTone:r}),a&&{externalId:a}),l&&{groups:l}),u&&{virtualBackgroundUrl:u}),e&&{avatarUrl:e}),n&&{cameraEffect:n}),null!=i&&{embed:i}),Wt.reduce(((e,t)=>null!=this[t.toLowerCase()]?Object.assign(Object.assign({},e),{[t]:this[t.toLowerCase()]}):e),{}))).forEach((([e,t])=>{this.roomUrl.searchParams.has(e)||this.roomUrl.searchParams.set(e,t)})),this.html`
|
|
11
11
|
<iframe
|
|
12
12
|
title=${h||"Video calling component"}
|
|
13
13
|
ref=${this.iframe}
|
|
14
14
|
src=${this.roomUrl}
|
|
15
15
|
allow="autoplay; camera; microphone; fullscreen; speaker; display-capture; media-capture" />
|
|
16
|
-
`}},
|
|
16
|
+
`}},Pt(Bt,Zt,"").Class;return{sdkVersion:"1"}}();
|