@whereby.com/browser-sdk 1.10.0 → 1.11.1

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/README.md CHANGED
@@ -12,6 +12,12 @@ commands to the room from the host application.
12
12
 
13
13
  ## Usage
14
14
 
15
+ ### React Hooks (Beta)
16
+
17
+ We're currently working on a library for use within React applications for a more customizable experience. Take a look at [the development branch](https://github.com/whereby/browser-sdk/tree/development) if you'd like to test it out.
18
+
19
+ Disclaimer: This is a beta release, and we recommend using it with caution in production environments. Your feedback and contributions are greatly appreciated.
20
+
15
21
  ### React + a bundler (webpack, rollup, parcel etc)
16
22
 
17
23
  ```js
@@ -45,3 +51,4 @@ export default MyComponent
45
51
  Although we have just higlighted two combinations of how to load and use the
46
52
  web component, it should be possible to use this library with all the major
47
53
  frontend frameworks.
54
+
package/dist/lib.cjs.js CHANGED
@@ -73,6 +73,8 @@ heresy.define("WherebyEmbed", {
73
73
  "groups",
74
74
  "virtualBackgroundUrl",
75
75
  "avatarUrl",
76
+ "externalId",
77
+ "title",
76
78
  ...boolAttrs,
77
79
  ].map((a) => a.toLowerCase()),
78
80
  onattributechanged({ attributeName, oldValue }) {
@@ -134,10 +136,12 @@ heresy.define("WherebyEmbed", {
134
136
  displayname: displayName,
135
137
  lang,
136
138
  metadata,
139
+ externalid: externalId,
137
140
  minimal,
138
141
  room,
139
142
  groups,
140
143
  virtualbackgroundurl: virtualBackgroundUrl,
144
+ title,
141
145
  } = this;
142
146
  let roomUrl, subdomain;
143
147
 
@@ -151,11 +155,12 @@ heresy.define("WherebyEmbed", {
151
155
 
152
156
  Object.entries({
153
157
  jsApi: true,
154
- we: "1.10.0",
158
+ we: "1.11.1",
155
159
  iframeSource: subdomain,
156
160
  ...(displayName && { displayName }),
157
161
  ...(lang && { lang: lang }),
158
162
  ...(metadata && { metadata: metadata }),
163
+ ...(externalId && { externalId }),
159
164
  ...(groups && { groups: groups }),
160
165
  ...(virtualBackgroundUrl && { virtualBackgroundUrl: virtualBackgroundUrl }),
161
166
  ...(avatarUrl && { avatarUrl: avatarUrl }),
@@ -173,6 +178,7 @@ heresy.define("WherebyEmbed", {
173
178
  });
174
179
  this.html`
175
180
  <iframe
181
+ title=${title || "Video calling component"}
176
182
  ref=${this.iframe}
177
183
  src=${this.roomUrl}
178
184
  allow="autoplay; camera; microphone; fullscreen; speaker; display-capture" />
@@ -180,6 +186,6 @@ heresy.define("WherebyEmbed", {
180
186
  },
181
187
  });
182
188
 
183
- var index = { sdkVersion: "1.10.0" };
189
+ var index = { sdkVersion: "1.11.1" };
184
190
 
185
191
  module.exports = index;
package/dist/lib.esm.js CHANGED
@@ -71,6 +71,8 @@ define("WherebyEmbed", {
71
71
  "groups",
72
72
  "virtualBackgroundUrl",
73
73
  "avatarUrl",
74
+ "externalId",
75
+ "title",
74
76
  ...boolAttrs,
75
77
  ].map((a) => a.toLowerCase()),
76
78
  onattributechanged({ attributeName, oldValue }) {
@@ -132,10 +134,12 @@ define("WherebyEmbed", {
132
134
  displayname: displayName,
133
135
  lang,
134
136
  metadata,
137
+ externalid: externalId,
135
138
  minimal,
136
139
  room,
137
140
  groups,
138
141
  virtualbackgroundurl: virtualBackgroundUrl,
142
+ title,
139
143
  } = this;
140
144
  let roomUrl, subdomain;
141
145
 
@@ -149,11 +153,12 @@ define("WherebyEmbed", {
149
153
 
150
154
  Object.entries({
151
155
  jsApi: true,
152
- we: "1.10.0",
156
+ we: "1.11.1",
153
157
  iframeSource: subdomain,
154
158
  ...(displayName && { displayName }),
155
159
  ...(lang && { lang: lang }),
156
160
  ...(metadata && { metadata: metadata }),
161
+ ...(externalId && { externalId }),
157
162
  ...(groups && { groups: groups }),
158
163
  ...(virtualBackgroundUrl && { virtualBackgroundUrl: virtualBackgroundUrl }),
159
164
  ...(avatarUrl && { avatarUrl: avatarUrl }),
@@ -171,6 +176,7 @@ define("WherebyEmbed", {
171
176
  });
172
177
  this.html`
173
178
  <iframe
179
+ title=${title || "Video calling component"}
174
180
  ref=${this.iframe}
175
181
  src=${this.roomUrl}
176
182
  allow="autoplay; camera; microphone; fullscreen; speaker; display-capture" />
@@ -178,6 +184,6 @@ define("WherebyEmbed", {
178
184
  },
179
185
  });
180
186
 
181
- var index = { sdkVersion: "1.10.0" };
187
+ var index = { sdkVersion: "1.11.1" };
182
188
 
183
189
  export { index as default };
package/dist/v1.js CHANGED
@@ -3,13 +3,14 @@ var e={};try{e.WeakMap=WeakMap}catch(t){e.WeakMap=function(e,t){var n=t.definePr
3
3
  /*! (c) Andrea Giammarchi - ISC */try{o.WeakSet=WeakSet}catch(e){!function(e){var t=new e,n=r.prototype;function r(n){t.set(this,new e),n&&n.forEach(this.add,this)}n.add=function(e){return t.get(this).set(e,1),this},n.delete=function(e){return t.get(this).delete(e)},n.has=function(e){return t.get(this).has(e)},o.WeakSet=r}(WeakMap)}var s,a,i=o.WeakSet,c="-"+Math.random().toFixed(6)+"%",l=!1;
4
4
  /*! (c) Andrea Giammarchi - ISC */try{s=document.createElement("template"),a="tabindex","content"in s&&(s.innerHTML='<p tabindex="'+c+'"></p>',s.content.childNodes[0].getAttribute(a)==c)||(c="_dt: "+c.slice(1,-1)+";",l=!0)}catch(e){}var u="\x3c!--"+c+"--\x3e",h=/^(?:plaintext|script|style|textarea|title|xmp)$/i,f=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
5
5
  /*! (c) Andrea Giammarchi - ISC */
6
- function p(e){return e.join(u).replace(w,N).replace(y,C)}var d=" \\f\\n\\r\\t",m="[^ \\f\\n\\r\\t\\/>\"'=]+",g="[ \\f\\n\\r\\t]+"+m,v="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",b="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+m.replace("\\/","")+"))?)",y=new RegExp(v+g+b+"+)(["+d+"]*/?>)","g"),w=new RegExp(v+g+b+"*)(["+d+"]*/>)","g"),E=new RegExp("("+g+"\\s*=\\s*)(['\"]?)"+u+"\\2","gi");function C(e,t,n,r){return"<"+t+n.replace(E,x)+r}function x(e,t,n){return t+(n||'"')+c+(n||'"')}function N(e,t,n){return f.test(t)?e:"<"+t+n+"></"+t+">"}const{isArray:k}=Array,{indexOf:A,slice:$}=[];var _=e=>({get:t=>e.get(t),set:(t,n)=>(e.set(t,n),n)});const S=(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,L=e=>{const{childNodes:t}=e,{length:n}=t;if(n<2)return n?t[0]:e;const r=$.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}}};
6
+ function d(e){return e.join(u).replace(w,N).replace(y,C)}var p=" \\f\\n\\r\\t",m="[^ \\f\\n\\r\\t\\/>\"'=]+",g="[ \\f\\n\\r\\t]+"+m,v="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",b="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+m.replace("\\/","")+"))?)",y=new RegExp(v+g+b+"+)(["+p+"]*/?>)","g"),w=new RegExp(v+g+b+"*)(["+p+"]*/>)","g"),E=new RegExp("("+g+"\\s*=\\s*)(['\"]?)"+u+"\\2","gi");function C(e,t,n,r){return"<"+t+n.replace(E,x)+r}function x(e,t,n){return t+(n||'"')+c+(n||'"')}function N(e,t,n){return f.test(t)?e:"<"+t+n+"></"+t+">"}const{isArray:k}=Array,{indexOf:A,slice:$}=[];var _=e=>({get:t=>e.get(t),set:(t,n)=>(e.set(t,n),n)});const S=(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,L=e=>{const{childNodes:t}=e,{length:n}=t;if(n<2)return n?t[0]:e;const r=$.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
- var j=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),M=(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},O=function(e,t,n,r,o){var s=o in e,a=e.createDocumentFragment();return a.appendChild(e.createTextNode("g")),a.appendChild(e.createTextNode("")),(s?e.importNode(a,!0):a.cloneNode(!0)).childNodes.length<2?function e(t,n){for(var r=t.cloneNode(),o=t.childNodes||[],s=o.length,a=0;n&&a<s;a++)r.appendChild(e(o[a],n));return r}:s?e.importNode:function(e,t){return e.cloneNode(!!t)}}(document,0,0,0,"importNode"),T="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},R=l?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 U(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}function W(e,t,n,r){for(var o=e.childNodes,s=o.length,a=0;a<s;){var i=o[a];switch(i.nodeType){case 1:var l=r.concat(a);P(i,t,n,l),W(i,t,n,l);break;case 8:var f=i.textContent;if(f===c)n.shift(),t.push(h.test(e.nodeName)?z(e,r):Z(i,r.concat(a)));else switch(f.slice(0,2)){case"/*":if("*/"!==f.slice(-2))break;case"👻":e.removeChild(i),a--,s--}break;case 3:h.test(e.nodeName)&&T.call(i.textContent)===u&&(n.shift(),t.push(z(e,r)))}a++}}function P(e,t,n,r){for(var o=e.attributes,s=[],a=[],i=R(o,n),h=i.length,f=0;f<h;){var p,d=i[f++],m=d.value===c;if(m||1<(p=d.value.split(u)).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(B(b,r,v,null));else{for(var y=p.length-2;y--;)n.shift();t.push(B(b,r,v,p))}}a.push(d)}}f=0;for(var w=(0<(h=a.length)&&l&&!("ownerSVGElement"in e));f<h;){var E=a[f++];w&&(E.value=""),e.removeAttribute(E.name)}var C=e.nodeName;if(/^script$/i.test(C)){var x=document.createElement(C);for(h=o.length,f=0;f<h;)x.setAttributeNode(o[f++].cloneNode(!0));x.textContent=e.textContent,e.parentNode.replaceChild(x,e)}}function Z(e,t){return{type:"any",node:e,path:t}}function B(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function z(e,t){return{type:"text",node:e,path:t}}var D=_(new t);function F(e,t){var n=(e.convert||p)(t),r=e.transform;r&&(n=r(n));var o=j(n,e.type);q(o);var s=[];return W(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=U(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}}}}function H(e,t){var n=D.get(t)||D.set(t,F(e,t));return n.updates(O.call(document,n.content,!0))}var V=[];function q(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===T.call(r.textContent).length&&e.removeChild(r)}}
9
- /*! (c) Andrea Giammarchi - ISC */var I=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 G=(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)))}},J=({dataset:e})=>t=>{for(const n in t){const r=t[n];null==r?delete e[n]:e[n]=r}},K=(e,t)=>"dataset"===t?J(e):n=>{e[t]=n},Q=/^(?:form|list)$/i,X=(e,t)=>e.ownerDocument.createTextNode(t);function Y(e){return this.type=e,function(e){var t=V,n=q;return function(r){return t!==r&&(n=H(e,t=r)),n.apply(null,arguments)}}(this)}function ee(e){return e(this)}Y.prototype={attribute(e,t,n){const r="svg"===this.type;switch(t){case"class":if(r)return G(e,t);t="className";case"props":return K(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 I(e,n,r);case"ref":return(e=>t=>{"function"==typeof t?t(e):t.current=e})(e);case".dataset":return J(e);default:return"."===t.slice(0,1)?K(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=k(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||Q.test(t)?G(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=M(e.parentNode,t,[X(e,a)],S,e));break;case"function":s(a(e));break;case"object":case"undefined":if(null==a){o=!1,t=M(e.parentNode,t,[],S,e);break}default:if(o=!1,r=a,k(a))if(0===a.length)t.length&&(t=M(e.parentNode,t,[],S,e));else switch(typeof a[0]){case"string":case"number":case"boolean":s(String(a));break;case"function":s(a.map(ee,e));break;case"object":k(a[0])&&(a=a.concat.apply([],a));default:t=M(e.parentNode,t,a,S,e)}else"ELEMENT_NODE"in a?t=M(e.parentNode,t,11===a.nodeType?$.call(a.childNodes):[a],S,e):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=M(e.parentNode,t,$.call(j([].concat(a.html).join(""),n).childNodes),S,e):"length"in a&&s($.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($.call(r).join("")):"function"===o?n(r(e)):e.textContent=null==r?"":r}};return n}};const{create:te,freeze:ne,keys:re}=Object,oe=Y.prototype,se=_(new t),ae=e=>({html:ce("html",e),svg:ce("svg",e),render(t,n){const r="function"==typeof n?n():n,o=se.get(t)||se.set(t,ie()),s=r instanceof he?le(e,o,r):r;return s!==o.wire&&(o.wire=s,t.textContent="",t.appendChild(s.valueOf())),t}}),ie=()=>({stack:[],entry:null,wire:null}),ce=(e,n)=>{const r=_(new t);return o.for=(e,t)=>{const s=r.get(e)||r.set(e,te(null));return s[t]||(s[t]=(e=>function(){return le(n,e,o.apply(null,arguments))})(ie()))},o.node=function(){return le(n,ie(),o.apply(null,arguments)).valueOf()},o;function o(){return new he(e,pe.apply(null,arguments))}},le=(e,t,{type:n,template:r,values:o})=>{const{length:s}=o;ue(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:L(s(r,...o))}}return a.wire},ue=(e,{stack:t},n,r)=>{for(let o=0;o<r;o++){const r=n[o];r instanceof fe?n[o]=le(e,t[o]||(t[o]=ie()),r):k(r)?ue(e,t[o]||(t[o]=ie()),r,r.length):t[o]=null}r<t.length&&t.splice(r)};function he(e,t){this.type=e,this.template=t.shift(),this.values=t}ne(he);const fe=he;function pe(){let e=[],t=0,{length:n}=arguments;for(;t<n;)e.push(arguments[t++]);return e}ae(Y);var de="function"==typeof cancelAnimationFrame,me=de?cancelAnimationFrame:clearTimeout,ge=de?requestAnimationFrame:setTimeout;function ve(e){var t,n,r,o,s;return i(),function(e,i,l){return r=e,o=i,s=l,n||(n=ge(a)),--t<0&&c(!0),c};function a(){i(),r.apply(o,s||[])}function i(){t=e||1/0,n=de?0:null}function c(e){var t=!!n;return t&&(me(n),e&&a()),t}}
10
- /*! (c) Andrea Giammarchi - ISC */let be=null;const ye=_(new WeakMap),we=(e,t,n)=>{e.apply(t,n)},Ee={async:!1,always:!1},Ce=(e,t)=>"function"==typeof t?t(e):t,xe=(e,t,n,r)=>{const o=be.i++,{hook:s,args:a,stack:i,length:c}=be;o===c&&(be.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||Ee;l.$=o?n(t):Ce(void 0,t),l._=a?ye.get(s)||ye.set(s,ve()):we,l.f=t=>{const n=e(l.$,t);(i||l.$!==n)&&(l.$=n,l._(s,null,l.args))}}return[l.$,l.f]},Ne=new WeakMap;function ke({hook:e}){return e===this.hook}const Ae=new WeakMap,$e=_(Ae),_e=()=>{},Se=e=>(t,n)=>{const r=be.i++,{hook:o,after:s,stack:a,length:i}=be;if(r<i){const o=a[r],{update:i,values:c,stop:l}=o;if(!n||n.some(Te,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?ve():_e,i={clean:null,update:r,values:n,stop:_e};be.length=a.push(i),($e.get(o)||$e.set(o,[])).push(i);const c=()=>{i.clean=t()};e?i.stop=r(c):s.push(c)}},Le=e=>{(Ae.get(e)||[]).forEach((e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())}))};Ae.has.bind(Ae);const je=Se(!0),Me=Se(!1),Oe=(e,t)=>{const n=be.i++,{stack:r,length:o}=be;return n===o?be.length=r.push({$:e(),_:t}):t&&!t.some(Te,r[n]._)||(r[n]={$:e(),_:t}),r[n].$};function Te(e,t){return e!==this[t]}let Re=null;try{Re=new{o(){}}.o}catch(Ot){}let Ue=e=>class extends e{};if(Re){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)}};Ue=function(r,o){function s(){return n(o?e(r):r,arguments,s)}return t(s.prototype,r.prototype),t(s,r)}}const We={map:{},re:null},Pe=e=>new RegExp(`<(/)?(${e.join("|")})([^A-Za-z0-9:._-])`,"g");let Ze=null;const Be=(e,t)=>{const{map:n,re:r}=Ze||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}`}))},ze=({tagName:e,is:t,element:n})=>n?t:`${e}[is="${t}"]`,De=()=>Ze,Fe=e=>{Ze=e},He={useCallback:(e,t)=>Oe((()=>e),t),useContext:e=>{const{hook:t,args:n}=be,r=Ne.get(e),o={hook:t,args:n};return r.some(ke,o)||r.push(o),e.value},useEffect:je,useLayoutEffect:Me,useMemo:Oe,useReducer:xe,useRef:e=>{const t=be.i++,{stack:n,length:r}=be;return t===r&&(be.length=n.push({current:e})),n[t]},useState:(e,t)=>xe(Ce,e,void 0,t)},{render:Ve,html:qe,svg:Ie}=(e=>{const t=te(oe);return re(e).forEach((n=>{t[n]=e[n](t[n]||("convert"===n?p:String))})),n.prototype=t,ae(n);function n(){return Y.apply(this,arguments)}})({transform:()=>e=>Be(e,We)}),{defineProperties:Ge}=Object,Je=new t,Ke=new t,Qe=new t,Xe=new i,Ye="attributeChangedCallback",et="connectedCallback",tt=`dis${et}`,nt=(e,t,n)=>{if(n in e){const r=e[n];t[n]={configurable:true,value(){return dt.call(this),r.apply(this,arguments)}}}else t[n]={configurable:true,value:dt}},rt=e=>{const{prototype:n}=e,r=[],o={html:{configurable:true,get:ht},svg:{configurable:true,get:ft}};if(o["_🔥"]={value:{events:r,info:null}},"handleEvent"in n||(o.handleEvent={configurable:true,value:pt}),"render"in n&&n.render.length){const{oninit:e}=n;Ge(n,{oninit:{configurable:true,value(){const t=(e=>{const t=[];return function n(){const r=be,o=[];be={hook:n,args:arguments,stack:t,i:0,length:t.length,after:o};try{return e.apply(null,arguments)}finally{be=r;for(let e=0,{length:t}=o;e<t;e++)o[e]()}}})(this.render.bind(this,He));Ge(this,{render:{configurable:true,value:t}}),this.addEventListener("disconnected",Le.bind(null,t),!1),e&&e.apply(this,arguments)}}})}"oninit"in n&&(r.push("init"),nt(n,o,"render")),nt(n,o,Ye),nt(n,o,et),nt(n,o,tt),[[Ye,"onattributechanged",mt],[et,"onconnected",gt],[tt,"ondisconnected",bt],[et,"render",vt]].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:true,value(){return t.apply(this,arguments),s.apply(this,arguments)}}}else o[e]={configurable:true,value:s}}));const s=e.booleanAttributes||[];s.forEach((e=>{e in n||(o[e]={configurable:true,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:true,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:true,get(){return s.get(this)},set(t){if(s.set(this,t),a){const n=ot(e);if(n.detail=t,Xe.has(this))this.dispatchEvent(n);else{const e=Qe.get(this);e?e.push(n):Qe.set(this,[n])}}}}})),Ge(n,o);const i=s.concat(a);return i.length?Ge(e,{observedAttributes:{configurable:true,get:()=>i}}):e},ot=e=>new r(e),st=(...e)=>new fe("html",e);st.for=qe.for;const at=(...e)=>new fe("svg",e);at.for=Ie.for;const it=(e,n,r)=>{const o=ct(e,n,new t);return r.set(e,o),o},ct=(e,t,n)=>(r,...o)=>{const s=n.get(r)||((e,t,{info:n})=>{const r=n?Be(t.join("_🔥"),n).split("_🔥"):t;return e.set(t,r),r})(n,r,e["_🔥"]);return Ve(e,(()=>t(s,...o)))};function lt(e){this.addEventListener(e,this)}function ut(e){this.dispatchEvent(e)}function ht(){return Je.get(this)||it(this,st,Je)}function ft(){return Ke.get(this)||it(this,at,Ke)}function pt(e){this[`on${e.type}`](e)}function dt(){if(!Xe.has(this)){Xe.add(this),this["_🔥"].events.forEach(lt,this),this.dispatchEvent(ot("init"));const e=Qe.get(this);e&&(Qe.delete(this),e.forEach(ut,this))}}function mt(e,t,n){const r=ot("attributechanged");r.attributeName=e,r.oldValue=t,r.newValue=n,this.dispatchEvent(r)}function gt(){this.dispatchEvent(ot("connected"))}function vt(){this.render()}function bt(){this.dispatchEvent(ot("disconnected"))}const{create:yt,defineProperty:wt,defineProperties:Et,getOwnPropertyNames:Ct,getOwnPropertySymbols:xt,getOwnPropertyDescriptor:Nt,keys:kt}=Object,At={element:HTMLElement},$t=new t;new t;const _t=new t;new t;const St=e=>{const t=yt(null),n=yt(null),r={prototype:n,statics:t};return Ct(e).concat(xt(e)).forEach((r=>{const o=Nt(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},Lt=(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=Ue("object"==typeof t?_t.get(t)||((e,t)=>{const{statics:n,prototype:r}=St(e),o=Ue(At[t]||(At[t]=document.createElement(t).constructor),!1);return Et(o.prototype,r),Et(o,n),_t.set(e,rt(o)),o})(t,a):$t.get(t)||(e=>{const t=Ue(e,!1);return $t.set(e,rt(t)),t})(t),!0),f="element"===a;if(wt(h,"new",{value:f?()=>document.createElement(u):()=>document.createElement(a,{is:u})}),wt(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());We.map[r]=jt(h,a,u,{id:e,i:0}),We.re=Pe(kt(We.map))}if(i){const{render:e}=h.prototype;wt(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 p=[u,h];return f||p.push({extends:a}),customElements.define(...p),{Class:h,is:u,name:r,tagName:a}},jt=(e,t,n,r)=>{const{prototype:o}=e,s=((e,t)=>({tagName:e,is:t,element:"element"===e}))(t,n),a=[ze(s)],i=e.includes||e.contains;if(i){const e={};kt(i).forEach((t=>{const n=`-${r.id}-${r.i++}`,{Class:o,is:s,name:c,tagName:l}=Lt(t,i[t],n);a.push(ze(e[c]=jt(o,l,s,r)))}));const t=Pe(kt(e)),{events:n}=o["_🔥"],s={events:n,info:{map:e,re:t}};if(wt(o,"_🔥",{value:s}),"render"in o){const{render:e}=o,{info:t}=s;wt(o,"render",{configurable:!0,value(){const n=De();Fe(t);const r=e.apply(this,arguments);return Fe(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 Mt=["audio","background","cameraAccess","chat","people","embed","emptyRoomInvitation","help","leaveButton","precallReview","screenshare","video","floatSelf","recording","logo","locking","participantCount","settingsButton","pipButton","moreButton","personality","subgridLabels","lowData","breakout"];var Ot,Tt;Ot="WherebyEmbed",Tt={oninit(){this.iframe=((e,t)=>e?e[t]||(e[t]={current:null}):{current:null})()},onconnected(){window.addEventListener("message",this)},ondisconnected(){window.removeEventListener("message",this)},observedAttributes:["displayName","minimal","room","subdomain","lang","metadata","groups","virtualBackgroundUrl","avatarUrl",...Mt].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)},startRecording(){this._postCommand("start_recording")},stopRecording(){this._postCommand("stop_recording")},startStreaming(){this._postCommand("start_streaming")},stopStreaming(){this._postCommand("stop_streaming")},toggleCamera(e){this._postCommand("toggle_camera",[e])},toggleMicrophone(e){this._postCommand("toggle_microphone",[e])},toggleScreenshare(e){this._postCommand("toggle_screenshare",[e])},toggleChat(e){this._postCommand("toggle_chat",[e])},onmessage({origin:e,data:t}){if(e!==this.roomUrl.origin)return;const{type:n,payload:r}=t;this.dispatchEvent(new CustomEvent(n,{detail:r}))},render(){const{avatarurl:e,displayname:t,lang:n,metadata:r,minimal:o,room:s,groups:a,virtualbackgroundurl:i}=this;let c,l;try{({roomUrl:c,subdomain:l}=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)}}(s,this.subdomain))}catch(e){return this.html`Whereby: ${e.message}`}this.roomUrl=c,Object.entries({jsApi:!0,we:"1.10.0",iframeSource:l,...t&&{displayName:t},...n&&{lang:n},...r&&{metadata:r},...a&&{groups:a},...i&&{virtualBackgroundUrl:i},...e&&{avatarUrl:e},...null!=o&&{embed:o},...Mt.reduce(((e,t)=>null!=this[t.toLowerCase()]?{...e,[t]:this[t.toLowerCase()]}:e),{})}).forEach((([e,t])=>{this.roomUrl.searchParams.has(e)||this.roomUrl.searchParams.set(e,t)})),this.html`
8
+ var j=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),M=(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},O=function(e,t,n,r,o){var s=o in e,a=e.createDocumentFragment();return a.appendChild(e.createTextNode("g")),a.appendChild(e.createTextNode("")),(s?e.importNode(a,!0):a.cloneNode(!0)).childNodes.length<2?function e(t,n){for(var r=t.cloneNode(),o=t.childNodes||[],s=o.length,a=0;n&&a<s;a++)r.appendChild(e(o[a],n));return r}:s?e.importNode:function(e,t){return e.cloneNode(!!t)}}(document,0,0,0,"importNode"),T="".trim||function(){return String(this).replace(/^\s+|\s+/g,"")},R=l?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 U(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}function W(e,t,n,r){for(var o=e.childNodes,s=o.length,a=0;a<s;){var i=o[a];switch(i.nodeType){case 1:var l=r.concat(a);P(i,t,n,l),W(i,t,n,l);break;case 8:var f=i.textContent;if(f===c)n.shift(),t.push(h.test(e.nodeName)?z(e,r):Z(i,r.concat(a)));else switch(f.slice(0,2)){case"/*":if("*/"!==f.slice(-2))break;case"👻":e.removeChild(i),a--,s--}break;case 3:h.test(e.nodeName)&&T.call(i.textContent)===u&&(n.shift(),t.push(z(e,r)))}a++}}function P(e,t,n,r){for(var o=e.attributes,s=[],a=[],i=R(o,n),h=i.length,f=0;f<h;){var d,p=i[f++],m=p.value===c;if(m||1<(d=p.value.split(u)).length){var g=p.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(B(b,r,v,null));else{for(var y=d.length-2;y--;)n.shift();t.push(B(b,r,v,d))}}a.push(p)}}f=0;for(var w=(0<(h=a.length)&&l&&!("ownerSVGElement"in e));f<h;){var E=a[f++];w&&(E.value=""),e.removeAttribute(E.name)}var C=e.nodeName;if(/^script$/i.test(C)){var x=document.createElement(C);for(h=o.length,f=0;f<h;)x.setAttributeNode(o[f++].cloneNode(!0));x.textContent=e.textContent,e.parentNode.replaceChild(x,e)}}function Z(e,t){return{type:"any",node:e,path:t}}function B(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function z(e,t){return{type:"text",node:e,path:t}}var D=_(new t);function V(e,t){var n=(e.convert||d)(t),r=e.transform;r&&(n=r(n));var o=j(n,e.type);I(o);var s=[];return W(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=U(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}}}}function F(e,t){var n=D.get(t)||D.set(t,V(e,t));return n.updates(O.call(document,n.content,!0))}var H=[];function I(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===T.call(r.textContent).length&&e.removeChild(r)}}
9
+ /*! (c) Andrea Giammarchi - ISC */var q=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 G=(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)))}},J=({dataset:e})=>t=>{for(const n in t){const r=t[n];null==r?delete e[n]:e[n]=r}},K=(e,t)=>"dataset"===t?J(e):n=>{e[t]=n},Q=/^(?:form|list)$/i,X=(e,t)=>e.ownerDocument.createTextNode(t);function Y(e){return this.type=e,function(e){var t=H,n=I;return function(r){return t!==r&&(n=F(e,t=r)),n.apply(null,arguments)}}(this)}function ee(e){return e(this)}Y.prototype={attribute(e,t,n){const r="svg"===this.type;switch(t){case"class":if(r)return G(e,t);t="className";case"props":return K(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 q(e,n,r);case"ref":return(e=>t=>{"function"==typeof t?t(e):t.current=e})(e);case".dataset":return J(e);default:return"."===t.slice(0,1)?K(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=k(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||Q.test(t)?G(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=M(e.parentNode,t,[X(e,a)],S,e));break;case"function":s(a(e));break;case"object":case"undefined":if(null==a){o=!1,t=M(e.parentNode,t,[],S,e);break}default:if(o=!1,r=a,k(a))if(0===a.length)t.length&&(t=M(e.parentNode,t,[],S,e));else switch(typeof a[0]){case"string":case"number":case"boolean":s(String(a));break;case"function":s(a.map(ee,e));break;case"object":k(a[0])&&(a=a.concat.apply([],a));default:t=M(e.parentNode,t,a,S,e)}else"ELEMENT_NODE"in a?t=M(e.parentNode,t,11===a.nodeType?$.call(a.childNodes):[a],S,e):"text"in a?s(String(a.text)):"any"in a?s(a.any):"html"in a?t=M(e.parentNode,t,$.call(j([].concat(a.html).join(""),n).childNodes),S,e):"length"in a&&s($.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($.call(r).join("")):"function"===o?n(r(e)):e.textContent=null==r?"":r}};return n}};const{create:te,freeze:ne,keys:re}=Object,oe=Y.prototype,se=_(new t),ae=e=>({html:ce("html",e),svg:ce("svg",e),render(t,n){const r="function"==typeof n?n():n,o=se.get(t)||se.set(t,ie()),s=r instanceof he?le(e,o,r):r;return s!==o.wire&&(o.wire=s,t.textContent="",t.appendChild(s.valueOf())),t}}),ie=()=>({stack:[],entry:null,wire:null}),ce=(e,n)=>{const r=_(new t);return o.for=(e,t)=>{const s=r.get(e)||r.set(e,te(null));return s[t]||(s[t]=(e=>function(){return le(n,e,o.apply(null,arguments))})(ie()))},o.node=function(){return le(n,ie(),o.apply(null,arguments)).valueOf()},o;function o(){return new he(e,de.apply(null,arguments))}},le=(e,t,{type:n,template:r,values:o})=>{const{length:s}=o;ue(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:L(s(r,...o))}}return a.wire},ue=(e,{stack:t},n,r)=>{for(let o=0;o<r;o++){const r=n[o];r instanceof fe?n[o]=le(e,t[o]||(t[o]=ie()),r):k(r)?ue(e,t[o]||(t[o]=ie()),r,r.length):t[o]=null}r<t.length&&t.splice(r)};function he(e,t){this.type=e,this.template=t.shift(),this.values=t}ne(he);const fe=he;function de(){let e=[],t=0,{length:n}=arguments;for(;t<n;)e.push(arguments[t++]);return e}ae(Y);var pe="function"==typeof cancelAnimationFrame,me=pe?cancelAnimationFrame:clearTimeout,ge=pe?requestAnimationFrame:setTimeout;function ve(e){var t,n,r,o,s;return i(),function(e,i,l){return r=e,o=i,s=l,n||(n=ge(a)),--t<0&&c(!0),c};function a(){i(),r.apply(o,s||[])}function i(){t=e||1/0,n=pe?0:null}function c(e){var t=!!n;return t&&(me(n),e&&a()),t}}
10
+ /*! (c) Andrea Giammarchi - ISC */let be=null;const ye=_(new WeakMap),we=(e,t,n)=>{e.apply(t,n)},Ee={async:!1,always:!1},Ce=(e,t)=>"function"==typeof t?t(e):t,xe=(e,t,n,r)=>{const o=be.i++,{hook:s,args:a,stack:i,length:c}=be;o===c&&(be.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||Ee;l.$=o?n(t):Ce(void 0,t),l._=a?ye.get(s)||ye.set(s,ve()):we,l.f=t=>{const n=e(l.$,t);(i||l.$!==n)&&(l.$=n,l._(s,null,l.args))}}return[l.$,l.f]},Ne=new WeakMap;function ke({hook:e}){return e===this.hook}const Ae=new WeakMap,$e=_(Ae),_e=()=>{},Se=e=>(t,n)=>{const r=be.i++,{hook:o,after:s,stack:a,length:i}=be;if(r<i){const o=a[r],{update:i,values:c,stop:l}=o;if(!n||n.some(Te,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?ve():_e,i={clean:null,update:r,values:n,stop:_e};be.length=a.push(i),($e.get(o)||$e.set(o,[])).push(i);const c=()=>{i.clean=t()};e?i.stop=r(c):s.push(c)}},Le=e=>{(Ae.get(e)||[]).forEach((e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())}))};Ae.has.bind(Ae);const je=Se(!0),Me=Se(!1),Oe=(e,t)=>{const n=be.i++,{stack:r,length:o}=be;return n===o?be.length=r.push({$:e(),_:t}):t&&!t.some(Te,r[n]._)||(r[n]={$:e(),_:t}),r[n].$};function Te(e,t){return e!==this[t]}let Re=null;try{Re=new{o(){}}.o}catch(Ot){}let Ue=e=>class extends e{};if(Re){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)}};Ue=function(r,o){function s(){return n(o?e(r):r,arguments,s)}return t(s.prototype,r.prototype),t(s,r)}}const We={map:{},re:null},Pe=e=>new RegExp(`<(/)?(${e.join("|")})([^A-Za-z0-9:._-])`,"g");let Ze=null;const Be=(e,t)=>{const{map:n,re:r}=Ze||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}`}))},ze=({tagName:e,is:t,element:n})=>n?t:`${e}[is="${t}"]`,De=()=>Ze,Ve=e=>{Ze=e},Fe={useCallback:(e,t)=>Oe((()=>e),t),useContext:e=>{const{hook:t,args:n}=be,r=Ne.get(e),o={hook:t,args:n};return r.some(ke,o)||r.push(o),e.value},useEffect:je,useLayoutEffect:Me,useMemo:Oe,useReducer:xe,useRef:e=>{const t=be.i++,{stack:n,length:r}=be;return t===r&&(be.length=n.push({current:e})),n[t]},useState:(e,t)=>xe(Ce,e,void 0,t)},{render:He,html:Ie,svg:qe}=(e=>{const t=te(oe);return re(e).forEach((n=>{t[n]=e[n](t[n]||("convert"===n?d:String))})),n.prototype=t,ae(n);function n(){return Y.apply(this,arguments)}})({transform:()=>e=>Be(e,We)}),{defineProperties:Ge}=Object,Je=new t,Ke=new t,Qe=new t,Xe=new i,Ye="attributeChangedCallback",et="connectedCallback",tt=`dis${et}`,nt=(e,t,n)=>{if(n in e){const r=e[n];t[n]={configurable:true,value(){return pt.call(this),r.apply(this,arguments)}}}else t[n]={configurable:true,value:pt}},rt=e=>{const{prototype:n}=e,r=[],o={html:{configurable:true,get:ht},svg:{configurable:true,get:ft}};if(o["_🔥"]={value:{events:r,info:null}},"handleEvent"in n||(o.handleEvent={configurable:true,value:dt}),"render"in n&&n.render.length){const{oninit:e}=n;Ge(n,{oninit:{configurable:true,value(){const t=(e=>{const t=[];return function n(){const r=be,o=[];be={hook:n,args:arguments,stack:t,i:0,length:t.length,after:o};try{return e.apply(null,arguments)}finally{be=r;for(let e=0,{length:t}=o;e<t;e++)o[e]()}}})(this.render.bind(this,Fe));Ge(this,{render:{configurable:true,value:t}}),this.addEventListener("disconnected",Le.bind(null,t),!1),e&&e.apply(this,arguments)}}})}"oninit"in n&&(r.push("init"),nt(n,o,"render")),nt(n,o,Ye),nt(n,o,et),nt(n,o,tt),[[Ye,"onattributechanged",mt],[et,"onconnected",gt],[tt,"ondisconnected",bt],[et,"render",vt]].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:true,value(){return t.apply(this,arguments),s.apply(this,arguments)}}}else o[e]={configurable:true,value:s}}));const s=e.booleanAttributes||[];s.forEach((e=>{e in n||(o[e]={configurable:true,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:true,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:true,get(){return s.get(this)},set(t){if(s.set(this,t),a){const n=ot(e);if(n.detail=t,Xe.has(this))this.dispatchEvent(n);else{const e=Qe.get(this);e?e.push(n):Qe.set(this,[n])}}}}})),Ge(n,o);const i=s.concat(a);return i.length?Ge(e,{observedAttributes:{configurable:true,get:()=>i}}):e},ot=e=>new r(e),st=(...e)=>new fe("html",e);st.for=Ie.for;const at=(...e)=>new fe("svg",e);at.for=qe.for;const it=(e,n,r)=>{const o=ct(e,n,new t);return r.set(e,o),o},ct=(e,t,n)=>(r,...o)=>{const s=n.get(r)||((e,t,{info:n})=>{const r=n?Be(t.join("_🔥"),n).split("_🔥"):t;return e.set(t,r),r})(n,r,e["_🔥"]);return He(e,(()=>t(s,...o)))};function lt(e){this.addEventListener(e,this)}function ut(e){this.dispatchEvent(e)}function ht(){return Je.get(this)||it(this,st,Je)}function ft(){return Ke.get(this)||it(this,at,Ke)}function dt(e){this[`on${e.type}`](e)}function pt(){if(!Xe.has(this)){Xe.add(this),this["_🔥"].events.forEach(lt,this),this.dispatchEvent(ot("init"));const e=Qe.get(this);e&&(Qe.delete(this),e.forEach(ut,this))}}function mt(e,t,n){const r=ot("attributechanged");r.attributeName=e,r.oldValue=t,r.newValue=n,this.dispatchEvent(r)}function gt(){this.dispatchEvent(ot("connected"))}function vt(){this.render()}function bt(){this.dispatchEvent(ot("disconnected"))}const{create:yt,defineProperty:wt,defineProperties:Et,getOwnPropertyNames:Ct,getOwnPropertySymbols:xt,getOwnPropertyDescriptor:Nt,keys:kt}=Object,At={element:HTMLElement},$t=new t;new t;const _t=new t;new t;const St=e=>{const t=yt(null),n=yt(null),r={prototype:n,statics:t};return Ct(e).concat(xt(e)).forEach((r=>{const o=Nt(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},Lt=(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=Ue("object"==typeof t?_t.get(t)||((e,t)=>{const{statics:n,prototype:r}=St(e),o=Ue(At[t]||(At[t]=document.createElement(t).constructor),!1);return Et(o.prototype,r),Et(o,n),_t.set(e,rt(o)),o})(t,a):$t.get(t)||(e=>{const t=Ue(e,!1);return $t.set(e,rt(t)),t})(t),!0),f="element"===a;if(wt(h,"new",{value:f?()=>document.createElement(u):()=>document.createElement(a,{is:u})}),wt(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());We.map[r]=jt(h,a,u,{id:e,i:0}),We.re=Pe(kt(We.map))}if(i){const{render:e}=h.prototype;wt(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 d=[u,h];return f||d.push({extends:a}),customElements.define(...d),{Class:h,is:u,name:r,tagName:a}},jt=(e,t,n,r)=>{const{prototype:o}=e,s=((e,t)=>({tagName:e,is:t,element:"element"===e}))(t,n),a=[ze(s)],i=e.includes||e.contains;if(i){const e={};kt(i).forEach((t=>{const n=`-${r.id}-${r.i++}`,{Class:o,is:s,name:c,tagName:l}=Lt(t,i[t],n);a.push(ze(e[c]=jt(o,l,s,r)))}));const t=Pe(kt(e)),{events:n}=o["_🔥"],s={events:n,info:{map:e,re:t}};if(wt(o,"_🔥",{value:s}),"render"in o){const{render:e}=o,{info:t}=s;wt(o,"render",{configurable:!0,value(){const n=De();Ve(t);const r=e.apply(this,arguments);return Ve(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 Mt=["audio","background","cameraAccess","chat","people","embed","emptyRoomInvitation","help","leaveButton","precallReview","screenshare","video","floatSelf","recording","logo","locking","participantCount","settingsButton","pipButton","moreButton","personality","subgridLabels","lowData","breakout"];var Ot,Tt;Ot="WherebyEmbed",Tt={oninit(){this.iframe=((e,t)=>e?e[t]||(e[t]={current:null}):{current:null})()},onconnected(){window.addEventListener("message",this)},ondisconnected(){window.removeEventListener("message",this)},observedAttributes:["displayName","minimal","room","subdomain","lang","metadata","groups","virtualBackgroundUrl","avatarUrl","externalId","title",...Mt].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)},startRecording(){this._postCommand("start_recording")},stopRecording(){this._postCommand("stop_recording")},startStreaming(){this._postCommand("start_streaming")},stopStreaming(){this._postCommand("stop_streaming")},toggleCamera(e){this._postCommand("toggle_camera",[e])},toggleMicrophone(e){this._postCommand("toggle_microphone",[e])},toggleScreenshare(e){this._postCommand("toggle_screenshare",[e])},toggleChat(e){this._postCommand("toggle_chat",[e])},onmessage({origin:e,data:t}){if(e!==this.roomUrl.origin)return;const{type:n,payload:r}=t;this.dispatchEvent(new CustomEvent(n,{detail:r}))},render(){const{avatarurl:e,displayname:t,lang:n,metadata:r,externalid:o,minimal:s,room:a,groups:i,virtualbackgroundurl:c,title:l}=this;let u,h;try{({roomUrl:u,subdomain:h}=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)}}(a,this.subdomain))}catch(e){return this.html`Whereby: ${e.message}`}this.roomUrl=u,Object.entries({jsApi:!0,we:"1.11.1",iframeSource:h,...t&&{displayName:t},...n&&{lang:n},...r&&{metadata:r},...o&&{externalId:o},...i&&{groups:i},...c&&{virtualBackgroundUrl:c},...e&&{avatarUrl:e},...null!=s&&{embed:s},...Mt.reduce(((e,t)=>null!=this[t.toLowerCase()]?{...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
+ title=${l||"Video calling component"}
12
13
  ref=${this.iframe}
13
14
  src=${this.roomUrl}
14
15
  allow="autoplay; camera; microphone; fullscreen; speaker; display-capture" />
15
- `}},("string"==typeof Ot?Lt(Ot,Tt,""):Lt(Ot.name,Ot,"")).Class;var Rt={sdkVersion:"1.10.0"};export{Rt as default};
16
+ `}},("string"==typeof Ot?Lt(Ot,Tt,""):Lt(Ot.name,Ot,"")).Class;var Rt={sdkVersion:"1.11.1"};export{Rt as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whereby.com/browser-sdk",
3
- "version": "1.10.0",
3
+ "version": "1.11.1",
4
4
  "description": "Configurable web component for embedding Whereby video rooms in web applications",
5
5
  "author": "Whereby AS",
6
6
  "license": "MIT",