@veltdev/sdk-dev 4.6.4-beta.1 → 4.6.4-beta.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/velt.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/sdk-dev",
3
- "version": "4.6.4-beta.1",
3
+ "version": "4.6.4-beta.2",
4
4
  "description": "Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.",
5
5
  "homepage": "https://velt.dev",
6
6
  "keywords": [
package/velt.js CHANGED
@@ -1,4 +1,4 @@
1
- var SNIPPYLY_VERSION = '4.6.4-beta.1';
1
+ var SNIPPYLY_VERSION = '4.6.4-beta.2';
2
2
  (function(m,w){"use strict";function rt(){var e=K.splice(0,K.length);for(ie=0;e.length;)e.shift().call(null,e.shift())}function me(e,t){for(var n=0,r=e.length;n<r;n++)Te(e[n],t)}function ot(e){for(var t,n=0,r=e.length;n<r;n++)t=e[n],U(t,q[pe(t)])}function fe(e){return function(t){Lt(t)&&(Te(t,e),L.length&&me(t.querySelectorAll(L),e))}}function pe(e){var t=le.call(e,"is"),n=e.nodeName.toUpperCase(),r=v.call(D,t?Y+t.toUpperCase():x+n);return t&&-1<r&&!De(n,t)?-1:r}function De(e,t){return-1<L.indexOf(e+'[is="'+t+'"]')}function Ie(e){var t=e.currentTarget,n=e.attrChange,r=e.attrName,o=e.target,l=e[W]||2,a=e[He]||3;!ce||o&&o!==t||!t[y]||r==="style"||e.prevValue===e.newValue&&(e.newValue!==""||n!==l&&n!==a)||t[y](r,n===l?null:e.prevValue,n===a?null:e.newValue)}function Fe(e){var t=fe(e);return function(n){K.push(t,n.target),ie&&clearTimeout(ie),ie=setTimeout(rt,1)}}function de(e){nt&&(nt=!1,e.currentTarget.removeEventListener(Ze,de)),L.length&&me((e.target||u).querySelectorAll(L),e.detail===E?E:b),R&&at()}function lt(e,t){var n=this;Ye.call(n,e,t),Me.call(n,{target:n})}function Se(e,t,n){var r=t.apply(e,n),o=pe(r);return-1<o&&U(r,q[o]),n.pop()&&L.length&&ot(r.querySelectorAll(L)),r}function he(e,t){Tt(e,t),$?$.observe(e,gt):(ue&&(e.setAttribute=lt,e[H]=Ee(e),e[g](st,Me)),e[g](N,Ie)),e[k]&&ce&&(e.created=!0,e[k](),e.created=!1)}function at(){for(var e,t=0,n=G.length;t<n;t++)e=G[t],V.contains(e)||(n--,G.splice(t--,1),Te(e,E))}function Ve(e){throw new Error("A "+e+" type is already registered")}function Te(e,t){var n,r,o=pe(e);-1<o&&!Mt.call(e,"TEMPLATE")&&(Q(e,q[o]),o=0,t!==b||e[b]?t!==E||e[E]||(e[b]=!1,e[E]=!0,r="disconnected",o=1):(e[E]=!1,e[b]=!0,r="connected",o=1,R&&v.call(G,e)<0&&G.push(e)),o&&(n=e[t+O]||e[r+O])&&n.call(e))}function z(){}function Pe(e,t,n){var r=n&&n[_]||"",o=t.prototype,l=Ce(o),a=t.observedAttributes||ye,s={prototype:l};oe(l,k,{value:function(){if(te)te=!1;else if(!this[B]){this[B]=!0,new t(this),o[k]&&o[k].call(this);var i=j[ne.get(t)];(!Z||i.create.length>1)&&_e(this)}}}),oe(l,y,{value:function(i){-1<v.call(a,i)&&o[y]&&o[y].apply(this,arguments)}}),o[qe]&&oe(l,ut,{value:o[qe]}),o[Be]&&oe(l,ct,{value:o[Be]}),r&&(s[_]=r),e=e.toUpperCase(),j[e]={constructor:t,create:r?[r,re(e)]:[e]},ne.set(t,e),u[S](e.toLowerCase(),s),Le(e),P[e].r()}function Re(e){var t=j[e.toUpperCase()];return t&&t.constructor}function Ue(e){return typeof e=="string"?e:e&&e.is||""}function _e(e){for(var t,n=e[y],r=n?e.attributes:ye,o=r.length;o--;)t=r[o],n.call(e,t.name||t.nodeName,null,t.value||t.nodeValue)}function Le(e){return e=e.toUpperCase(),e in P||(P[e]={},P[e].p=new Xe(function(t){P[e].r=t})),P[e].p}function ke(){C&&delete m.customElements,I(m,"customElements",{configurable:!0,value:new z}),I(m,"CustomElementRegistry",{configurable:!0,value:z});for(var e=it.get(/^HTML[A-Z]*[a-z]/),t=e.length;t--;(function(n){var r=m[n];if(r){m[n]=function(o){var l,a;return o||(o=this),o[B]||(te=!0,l=j[ne.get(o.constructor)],a=Z&&l.create.length===1,o=a?Reflect.construct(r,ye,l.constructor):u.createElement.apply(u,l.create),o[B]=!0,te=!1,a||_e(o)),o},m[n].prototype=r.prototype;try{r.prototype.constructor=m[n]}catch{dt=!0,I(r,B,{value:m[n]})}}})(e[t]));u.createElement=function(n,r){var o=Ue(r);return o?Ae.call(this,n,re(o)):Ae.call(this,n)},et||(Oe=!0,u[S](""))}var u=m.document,T=m.Object,it=(function(e){var t,n,r,o,l=/^[A-Z]+[a-z]/,a=function(p){var f,h=[];for(f in i)p.test(f)&&h.push(f);return h},s=function(p,f){(f=f.toLowerCase())in i||(i[p]=(i[p]||[]).concat(f),i[f]=i[f.toUpperCase()]=p)},i=(T.create||T)(null),c={};for(n in e)for(o in e[n])for(r=e[n][o],i[o]=r,t=0;t<r.length;t++)i[r[t].toLowerCase()]=i[r[t].toUpperCase()]=o;return c.get=function(p){return typeof p=="string"?i[p]||(l.test(p)?[]:""):a(p)},c.set=function(p,f){return l.test(p)?s(p,f):s(f,p),c},c})({collections:{HTMLAllCollection:["all"],HTMLCollection:["forms"],HTMLFormControlsCollection:["elements"],HTMLOptionsCollection:["options"]},elements:{Element:["element"],HTMLAnchorElement:["a"],HTMLAppletElement:["applet"],HTMLAreaElement:["area"],HTMLAttachmentElement:["attachment"],HTMLAudioElement:["audio"],HTMLBRElement:["br"],HTMLBaseElement:["base"],HTMLBodyElement:["body"],HTMLButtonElement:["button"],HTMLCanvasElement:["canvas"],HTMLContentElement:["content"],HTMLDListElement:["dl"],HTMLDataElement:["data"],HTMLDataListElement:["datalist"],HTMLDetailsElement:["details"],HTMLDialogElement:["dialog"],HTMLDirectoryElement:["dir"],HTMLDivElement:["div"],HTMLDocument:["document"],HTMLElement:["element","abbr","address","article","aside","b","bdi","bdo","cite","code","command","dd","dfn","dt","em","figcaption","figure","footer","header","i","kbd","mark","nav","noscript","rp","rt","ruby","s","samp","section","small","strong","sub","summary","sup","u","var","wbr"],HTMLEmbedElement:["embed"],HTMLFieldSetElement:["fieldset"],HTMLFontElement:["font"],HTMLFormElement:["form"],HTMLFrameElement:["frame"],HTMLFrameSetElement:["frameset"],HTMLHRElement:["hr"],HTMLHeadElement:["head"],HTMLHeadingElement:["h1","h2","h3","h4","h5","h6"],HTMLHtmlElement:["html"],HTMLIFrameElement:["iframe"],HTMLImageElement:["img"],HTMLInputElement:["input"],HTMLKeygenElement:["keygen"],HTMLLIElement:["li"],HTMLLabelElement:["label"],HTMLLegendElement:["legend"],HTMLLinkElement:["link"],HTMLMapElement:["map"],HTMLMarqueeElement:["marquee"],HTMLMediaElement:["media"],HTMLMenuElement:["menu"],HTMLMenuItemElement:["menuitem"],HTMLMetaElement:["meta"],HTMLMeterElement:["meter"],HTMLModElement:["del","ins"],HTMLOListElement:["ol"],HTMLObjectElement:["object"],HTMLOptGroupElement:["optgroup"],HTMLOptionElement:["option"],HTMLOutputElement:["output"],HTMLParagraphElement:["p"],HTMLParamElement:["param"],HTMLPictureElement:["picture"],HTMLPreElement:["pre"],HTMLProgressElement:["progress"],HTMLQuoteElement:["blockquote","q","quote"],HTMLScriptElement:["script"],HTMLSelectElement:["select"],HTMLShadowElement:["shadow"],HTMLSlotElement:["slot"],HTMLSourceElement:["source"],HTMLSpanElement:["span"],HTMLStyleElement:["style"],HTMLTableCaptionElement:["caption"],HTMLTableCellElement:["td","th"],HTMLTableColElement:["col","colgroup"],HTMLTableElement:["table"],HTMLTableRowElement:["tr"],HTMLTableSectionElement:["thead","tbody","tfoot"],HTMLTemplateElement:["template"],HTMLTextAreaElement:["textarea"],HTMLTimeElement:["time"],HTMLTitleElement:["title"],HTMLTrackElement:["track"],HTMLUListElement:["ul"],HTMLUnknownElement:["unknown","vhgroupv","vkeygen"],HTMLVideoElement:["video"]},nodes:{Attr:["node"],Audio:["audio"],CDATASection:["node"],CharacterData:["node"],Comment:["#comment"],Document:["#document"],DocumentFragment:["#document-fragment"],DocumentType:["node"],HTMLDocument:["#document"],Image:["img"],Option:["option"],ProcessingInstruction:["node"],ShadowRoot:["#shadow-root"],Text:["#text"],XMLDocument:["xml"]}});typeof w!="object"&&(w={type:w||"auto"});var K,Me,X,Ee,$,ve,Q,U,A,S="registerElement",xe=1e5*m.Math.random()>>0,H="__"+S+xe,g="addEventListener",b="attached",O="Callback",E="detached",_="extends",y="attributeChanged"+O,ut=b+O,qe="connected"+O,Be="disconnected"+O,k="created"+O,ct=E+O,W="ADDITION",He="REMOVAL",N="DOMAttrModified",Ze="DOMContentLoaded",st="DOMSubtreeModified",x="<",Y="=",mt=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,ft=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],D=[],q=[],L="",V=u.documentElement,v=D.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},ge=T.prototype,be=ge.hasOwnProperty,J=ge.isPrototypeOf,I=T.defineProperty,ye=[],ee=T.getOwnPropertyDescriptor,je=T.getOwnPropertyNames,pt=T.getPrototypeOf,Ge=T.setPrototypeOf,ze=!!T.__proto__,dt=!1,B="__dreCEv1",C=m.customElements,Z=!/^force/.test(w.type)&&!!(C&&C.define&&C.get&&C.whenDefined),Ke=T.create||T,ht=m.Map||function(){var e,t=[],n=[];return{get:function(r){return n[v.call(t,r)]},set:function(r,o){e=v.call(t,r),e<0?n[t.push(r)-1]=o:n[e]=o}}},Xe=m.Promise||function(e){function t(l){for(r=!0;n.length;)n.shift()(l)}var n=[],r=!1,o={catch:function(){return o},then:function(l){return n.push(l),r&&setTimeout(t,1),o}};return e(t),o},te=!1,j=Ke(null),P=Ke(null),ne=new ht,re=function(e){return e.toLowerCase()},Ce=T.create||function e(t){return t?(e.prototype=t,new e):this},Tt=Ge||(ze?function(e,t){return e.__proto__=t,e}:je&&ee?(function(){function e(t,n){for(var r,o=je(n),l=0,a=o.length;l<a;l++)r=o[l],be.call(t,r)||I(t,r,ee(n,r))}return function(t,n){do e(t,n);while((n=pt(n))&&!J.call(n,t));return t}})():function(e,t){for(var n in t)e[n]=t[n];return e}),F=m.MutationObserver||m.WebKitMutationObserver,$e=m.HTMLAnchorElement,d=(m.HTMLElement||m.Element||m.Node).prototype,R=!J.call(d,V),oe=R?function(e,t,n){return e[t]=n.value,e}:I,Lt=R?function(e){return e.nodeType===1}:function(e){return J.call(d,e)},G=R&&[],Qe=d.attachShadow,We=d.cloneNode,Mt=d.closest||function(e){for(var t=this;t&&t.nodeName!==e;)t=t.parentNode;return t},we=d.dispatchEvent,le=d.getAttribute,Et=d.hasAttribute,vt=d.removeAttribute,Ye=d.setAttribute,ae=u.createElement,Ht=u.importNode,Ae=ae,gt=F&&{attributes:!0,characterData:!0,attributeOldValue:!0},Je=F||function(e){ue=!1,V.removeEventListener(N,Je)},ie=0,et=S in u&&!/^force-all/.test(w.type),tt=!0,Oe=!1,ue=!0,nt=!0,ce=!0;if(F&&(A=u.createElement("div"),A.innerHTML="<div><div></div></div>",new F(function(e,t){if(e[0]&&e[0].type=="childList"&&!e[0].removedNodes[0].childNodes.length){A=ee(d,"innerHTML");var n=A&&A.set;n&&I(d,"innerHTML",{set:function(r){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,r)}})}t.disconnect(),A=null}).observe(A,{childList:!0,subtree:!0}),A.innerHTML=""),et||(Ge||ze?(Q=function(e,t){J.call(t,e)||he(e,t)},U=he):(Q=function(e,t){e[H]||(e[H]=T(!0),he(e,t))},U=Q),R?(ue=!1,(function(){var e=ee(d,g),t=e.value,n=function(l){var a=new CustomEvent(N,{bubbles:!0});a.attrName=l,a.prevValue=le.call(this,l),a.newValue=null,a[He]=a.attrChange=2,vt.call(this,l),we.call(this,a)},r=function(l,a){var s=Et.call(this,l),i=s&&le.call(this,l),c=new CustomEvent(N,{bubbles:!0});Ye.call(this,l,a),c.attrName=l,c.prevValue=s?i:null,c.newValue=a,s?c.MODIFICATION=c.attrChange=1:c[W]=c.attrChange=0,we.call(this,c)},o=function(l){var a,s=l.currentTarget,i=s[H],c=l.propertyName;i.hasOwnProperty(c)&&(i=i[c],a=new CustomEvent(N,{bubbles:!0}),a.attrName=i.name,a.prevValue=i.value||null,a.newValue=i.value=s[c]||null,a.prevValue==null?a[W]=a.attrChange=0:a.MODIFICATION=a.attrChange=1,we.call(s,a))};e.value=function(l,a,s){l===N&&this[y]&&this.setAttribute!==r&&(this[H]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",o)),t.call(this,l,a,s)},I(d,g,e)})()):F||(V[g](N,Je),V.setAttribute(H,1),V.removeAttribute(H),ue&&(Me=function(e){var t,n,r,o=this;if(o===e.target){t=o[H],o[H]=n=Ee(o);for(r in n){if(!(r in t))return X(0,o,r,t[r],n[r],W);if(n[r]!==t[r])return X(1,o,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return X(2,o,r,t[r],n[r],He)}},X=function(e,t,n,r,o,l){var a={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:o};a[l]=e,Ie(a)},Ee=function(e){for(var t,n,r={},o=e.attributes,l=0,a=o.length;l<a;l++)t=o[l],(n=t.name)!=="setAttribute"&&(r[n]=t.value);return r})),u[S]=function(e,t){if(n=e.toUpperCase(),tt&&(tt=!1,F?($=(function(i,c){function p(f,h){for(var M=0,se=f.length;M<se;h(f[M++]));}return new F(function(f){for(var h,M,se,Ne=0,bt=f.length;Ne<bt;Ne++)h=f[Ne],h.type==="childList"?(p(h.addedNodes,i),p(h.removedNodes,c)):(M=h.target,ce&&M[y]&&h.attributeName!=="style"&&(se=le.call(M,h.attributeName))!==h.oldValue&&M[y](h.attributeName,h.oldValue,se))})})(fe(b),fe(E)),ve=function(i){return $.observe(i,{childList:!0,subtree:!0}),i},ve(u),Qe&&(d.attachShadow=function(){return ve(Qe.apply(this,arguments))})):(K=[],u[g]("DOMNodeInserted",Fe(b)),u[g]("DOMNodeRemoved",Fe(E))),u[g](Ze,de),u[g]("readystatechange",de),u.importNode=function(i,c){switch(i.nodeType){case 1:return Se(u,Ht,[i,!!c]);case 11:for(var p=u.createDocumentFragment(),f=i.childNodes,h=f.length,M=0;M<h;M++)p.appendChild(u.importNode(f[M],!!c));return p;default:return We.call(i,!!c)}},d.cloneNode=function(i){return Se(this,We,[!!i])}),Oe)return Oe=!1;if(-2<v.call(D,Y+n)+v.call(D,x+n)&&Ve(e),!mt.test(n)||-1<v.call(ft,n))throw new Error("The type "+e+" is invalid");var n,r,o=function(){return a?u.createElement(s,n):u.createElement(s)},l=t||ge,a=be.call(l,_),s=a?t[_].toUpperCase():n;return a&&-1<v.call(D,x+s)&&Ve(s),r=D.push((a?Y:x)+n)-1,L=L.concat(L.length?",":"",a?s+'[is="'+e.toLowerCase()+'"]':s),o.prototype=q[r]=be.call(l,"prototype")?l.prototype:Ce(d),L.length&&me(u.querySelectorAll(L),b),o},u.createElement=Ae=function(e,t){var n=Ue(t),r=n?ae.call(u,e,re(n)):ae.call(u,e),o=""+e,l=v.call(D,(n?Y:x)+(n||o).toUpperCase()),a=-1<l;return n&&(r.setAttribute("is",n=n.toLowerCase()),a&&(a=De(o.toUpperCase(),n))),ce=!u.createElement.innerHTMLHelper,a&&U(r,q[l]),r}),addEventListener("beforeunload",function(){delete u.createElement,delete u.importNode,delete u[S]},!1),z.prototype={constructor:z,define:Z?function(e,t,n){if(n)Pe(e,t,n);else{var r=e.toUpperCase();j[r]={constructor:t,create:[r]},ne.set(t,r),C.define(e,t)}}:Pe,get:Z?function(e){return C.get(e)||Re(e)}:Re,whenDefined:Z?function(e){return Xe.race([C.whenDefined(e),Le(e)])}:Le},!C||/^force/.test(w.type))ke();else if(!w.noBuiltIn)try{(function(e,t,n){var r=new RegExp(`^<a\\s+is=('|")`+n+"\\1></a>$");if(t[_]="a",e.prototype=Ce($e.prototype),e.prototype.constructor=e,m.customElements.define(n,e,t),!r.test(u.createElement("a",{is:n}).outerHTML)||!r.test(new e().outerHTML))throw t})(function e(){return Reflect.construct($e,[],e)},{},"document-register-element-a"+xe)}catch{ke()}if(!w.noBuiltIn)try{if(ae.call(u,"a","a").outerHTML.indexOf("is")<0)throw{}}catch{re=function(t){return{is:t.toLowerCase()}}}})(window);
3
3
 
4
4
  var PSe=Object.create;var KA=Object.defineProperty,MSe=Object.defineProperties,kSe=Object.getOwnPropertyDescriptor,RSe=Object.getOwnPropertyDescriptors,NSe=Object.getOwnPropertyNames,YA=Object.getOwnPropertySymbols,ZY=Object.getPrototypeOf,S8=Object.prototype.hasOwnProperty,XY=Object.prototype.propertyIsEnumerable,FSe=Reflect.get;var KY=(i,o,n)=>o in i?KA(i,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[o]=n,E=(i,o)=>{for(var n in o||={})S8.call(o,n)&&KY(i,n,o[n]);if(YA)for(var n of YA(o))XY.call(o,n)&&KY(i,n,o[n]);return i},T=(i,o)=>MSe(i,RSe(o));var py=(i,o)=>{var n={};for(var e in i)S8.call(i,e)&&o.indexOf(e)<0&&(n[e]=i[e]);if(i!=null&&YA)for(var e of YA(i))o.indexOf(e)<0&&XY.call(i,e)&&(n[e]=i[e]);return n};var LSe=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),ZA=(i,o)=>{for(var n in o)KA(i,n,{get:o[n],enumerable:!0})},BSe=(i,o,n,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of NSe(o))!S8.call(i,t)&&t!==n&&KA(i,t,{get:()=>o[t],enumerable:!(e=kSe(o,t))||e.enumerable});return i};var QY=(i,o,n)=>(n=i!=null?PSe(ZY(i)):{},BSe(o||!i||!i.__esModule?KA(n,"default",{value:i,enumerable:!0}):n,i));var Bp=(i,o,n)=>FSe(ZY(i),n,o);var Q=(i,o,n)=>new Promise((e,t)=>{var r=c=>{try{s(n.next(c))}catch(p){t(p)}},a=c=>{try{s(n.throw(c))}catch(p){t(p)}},s=c=>c.done?e(c.value):Promise.resolve(c.value).then(r,a);s((n=n.apply(i,o)).next())});var hY=LSe((V3o,uY)=>{"use strict";var Ot={};Ot.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)};Ot.localCName=Ot.generateIdentifier();Ot.splitLines=function(i){return i.trim().split(`
@@ -178,7 +178,7 @@ Content-Type: `+p.contentType+`\r
178
178
  />
179
179
  </svg>
180
180
  `},gt.CommentAnnotationPriorityMap={P0:{id:"P0",name:"P0",color:"var(--velt-error, #FF7162)",lightColor:"var(--velt-error-light, #F7E7E7) "},P1:{id:"P1",name:"P1",color:"var(--velt-warning, #ECB000)",lightColor:"var(--velt-warning-light, #FEFCEA)"},P2:{id:"P2",name:"P2",color:"var(--velt-text-7, #777E91)",lightColor:"var(--velt-background-1, #F3F3F5)"}},gt.WorkspaceRoles=[{id:lo.COMMENTER?.toLowerCase(),name:lo.COMMENTER,description:"Can comment on this project",permissions:[]},{id:lo.ADMIN?.toLowerCase(),name:lo.ADMIN,description:"Can comment on all projects and has access to the portal",permissions:[]}],gt.DocumentAccessTypeMap={[xi.PUBLIC]:{id:xi.PUBLIC,name:xi.PUBLIC,description:"Anyone with link can view"},[xi.RESTRICTED]:{id:xi.RESTRICTED,name:xi.RESTRICTED,description:"Only people with access can view"}},gt.DocumentAccessTypeMapSF={[xi.PUBLIC]:{id:xi.PUBLIC,name:xi.PUBLIC,description:"Anyone with the link can comment after logging in."},[xi.RESTRICTED]:{id:xi.RESTRICTED,name:xi.RESTRICTED,description:"Only people added to this project can comment."}},gt.CommentCategoryMap={bug:{id:"bug",name:"Bug",color:"#FF7162"},feedback:{id:"feedback",name:"Feedback",color:"#00C48C"},question:{id:"question",name:"Question",color:"#FFD166"}},gt.OVERLAY_POSITIONS=[{originX:"end",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"},{originX:"start",originY:"top",overlayX:"end",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"end",overlayY:"bottom"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"end",originY:"bottom",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"}],gt.OVERLAY_POSITIONS_FOR_POPOVER_MODE=[{originX:"end",originY:"top",overlayX:"start",overlayY:"top"},{originX:"end",originY:"center",overlayX:"start",overlayY:"center"},{originX:"end",originY:"bottom",overlayX:"start",overlayY:"bottom"},{originX:"start",originY:"top",overlayX:"end",overlayY:"top"},{originX:"start",originY:"center",overlayX:"end",overlayY:"center"},{originX:"start",originY:"bottom",overlayX:"end",overlayY:"bottom"}],gt.VIDEO_EDITOR={ZOOM_IN_DURATION:500,ZOOM_OUT_DURATION:500,DEFAULT_ZOOM_FACTOR:1.5,MAX_ZOOM_FACTOR:3,ZOOM_FACTOR_OPTIONS:[{value:2,label:"2x"},{value:1.7,label:"1.7x"},{value:1.5,label:"1.5x"},{value:1.2,label:"1.2x"}],MIN_DRAG_AREA_MULTIPLIER:.015,PREFERRED_SECTION_DURATION_MULTIPLIER:.15,SELECTION_MIN_DRAG_DISTANCE:2,MIN_DURATION_THRESHOLD:.01,TIME_BUFFER:.1,SHORT_VIDEO_THRESHOLD:3,SMALL_VIDEO_THRESHOLD:5,MILLISECOND_PRECISION_MULTIPLIER:1e3,TENTH_SECOND_PRECISION_MULTIPLIER:10,DEBOUNCE_DELAY:200,DECIMAL_PRECISION:2,MAX_MARKER_COUNT:10,MARKER_INTERVAL:5,FAST_TIMEOUT:50,STANDARD_TIMEOUT:100,RECTANGLE_POSITIONING:{FULL_PERCENT:100,HALF_PERCENT:50,QUARTER_PERCENT:25},EASING:{QUAD_IN_OUT_MULTIPLIER:2,QUAD_IN_OUT_POWER:2,HALF_THRESHOLD:.5},PERCENTAGE:{HALF:50,FULL:100},MILLISECONDS_TO_SECONDS:1e3};var U=gt;var Nn=(i,o=0)=>{try{let n=3735928559^o,e=1103547991^o;for(let t=0,r;t<i.length;t++)r=i.charCodeAt(t),n=Math.imul(n^r,2654435761),e=Math.imul(e^r,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(e^e>>>13,3266489909),e=Math.imul(e^e>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&e)+(n>>>0)}catch(n){return tt.catch("Error in cyrb53: ",n),0}},h7e=()=>{try{return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+i/4).toString(16))}catch(i){return tt.catch("Error in uuidv4: ",i),""}},Tt=i=>{try{return Ra.hashStr(i)}catch(o){return tt.catch("Error in hashStr: ",o),i}},Mle=i=>{try{return!i||i.trim().length===0?void 0:Ra.hashStr(i)}catch(o){tt.catch("Error in hashForAnchor: ",o);return}},Tr=i=>Nn(i).toString(),YH=i=>Tt(i),os=i=>Tt(i).toString(),$i=i=>Tt(i).toString(),sm=i=>{try{if(i)return typeof i=="string"?Ra.hashStr(i):Array.isArray(i)?Ra.hashStr(i.join("-")):"";{let o=h7e();return Ra.hashStr(o)}}catch(o){return tt.catch("Error in getMultiThreadAnnotationId: ",o),""}},to=(i,o,n)=>{try{if(i&&o){if(i.featureAllowList&&i.featureAllowList.length&&!i.featureAllowList.includes(n)||i.userIdAllowList&&i.userIdAllowList.length&&!i.userIdAllowList.includes(o.userId)||i.userGroupIdAllowList&&i.userGroupIdAllowList.length&&!i.userGroupIdAllowList.includes(o.groupId||"")||i.userPlanAllowList&&i.userPlanAllowList.length&&!i.userPlanAllowList.includes(o.plan||""))return!1;if(i.urlAllowList){let e=window.location.href;if(i.urlAllowList.length&&!i.urlAllowList.filter(t=>e.includes(t)).length)return!1}return!0}return!1}catch(e){return tt.catch("Error in isFeatureAllowed: ",e),!1}},vt=()=>{try{let i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o="";for(let n=0;n<20;n++)o+=i.charAt(Math.floor(Math.random()*i.length));return o}catch(i){return tt.catch("Error in utils generateId: ",i),""}},Lg=i=>{try{let o=0;if(i){let n=new Date().getTime();o=Math.abs(n-i)}return o}catch(o){return tt.catch("Error in utils getFirebaseTimeDiffInMins: ",o),0}};var kle=()=>{try{return wn.debugMode||!!sessionStorage.getItem("debugMode")||!!sessionStorage.getItem("forceDebugMode")}catch(i){return tt.catch("Error in showLogs: ",i),!1}},Rle=()=>{try{return!!sessionStorage.getItem("debugPerfMode")}catch(i){return tt.catch("Error in showPerfLogs: ",i),!1}},or=i=>{try{return typeof i!="object"?Object.assign({},...Object.keys(i).sort().map(o=>({[o]:i[o]&&typeof i[o]=="object"?or(i[o]):i[o]}))):i}catch(o){return tt.catch("Error in sortObjectByKeys: ",o),i}},qH=i=>{try{return i!==null&&typeof i=="object"&&!Array.isArray(i)}catch{return!1}},cc=i=>{try{return qH(i)?Object.fromEntries(Object.entries(i).sort(([o],[n])=>o.localeCompare(n)).map(([o,n])=>[o,qH(n)?cc(n):Array.isArray(n)?n.map(e=>qH(e)?cc(e):e):n])):i}catch{return i}},bk=(i,o)=>{try{return typeof o!="object"||o===null?i===o:typeof i!="object"||i===null?!1:Array.isArray(o)?Array.isArray(i)?o.every(n=>i.some(e=>bk(e,n))):!1:Object.keys(o).every(n=>Object.prototype.hasOwnProperty.call(i,n)?bk(i[n],o[n]):!1)}catch{return!1}},KH=(i,o,n)=>Q(null,null,function*(){try{let e=yield v7e(o),t=new Uint8Array(new TextEncoder().encode(n)).slice(0,16),r=new TextEncoder().encode(i),a=yield window.crypto.subtle.encrypt({name:"AES-CBC",iv:t},e,r);return btoa(String.fromCharCode(...new Uint8Array(a)))}catch(e){return tt.catch("Error in encrypt: ",e),i}}),ZH=(i,o,n)=>Q(null,null,function*(){try{let e=yield f7e(o),t=new Uint8Array(new TextEncoder().encode(n)).slice(0,16),r=new Uint8Array(atob(i).split("").map(s=>s.charCodeAt(0))),a=yield window.crypto.subtle.decrypt({name:"AES-CBC",iv:t},e,r);return new TextDecoder().decode(a)}catch(e){return tt.catch("Error in decrypt: ",e),i}}),f7e=i=>Q(null,null,function*(){try{let o=new TextEncoder().encode(i),n=new Uint8Array(32);return n.fill(0),n.set(o.slice(0,32)),yield window.crypto.subtle.importKey("raw",n,"AES-CBC",!1,["decrypt"])}catch(o){throw tt.catch("Error in importDecryptKey:",o),o}}),Dl=(i,o)=>Q(null,null,function*(){try{let n="Velt"+o;return yield KH(JSON.stringify(i),n,Tt(n))}catch(n){return tt.catch("Error in encryptData: ",n),i}}),W0=(i,o)=>Q(null,null,function*(){try{let n="Velt"+o,e=yield ZH(i,n,Tt(n));return JSON.parse(e)}catch(n){return tt.catch("Error in decryptData: ",n),null}}),xk=i=>{try{switch(i?.region){case"asiaSouthEast1":return"asiaSouthEast1";case"asiaNorthEast1":return"asiaNorthEast1";case"europeWest1":return"europeWest1";default:return"usCentral1"}}catch(o){return tt.catch("Error in getRegion: ",o),"usCentral1"}},v7e=i=>Q(null,null,function*(){try{let o=new TextEncoder().encode(i),n=new Uint8Array(32);return n.fill(0),n.set(o.slice(0,32)),yield window.crypto.subtle.importKey("raw",n,"AES-CBC",!1,["encrypt"])}catch(o){throw tt.catch("Error in importKey:",o),o}}),Nle=i=>{try{if(i&&typeof i=="object"){let o=or(i);return Nn(JSON.stringify(o))}else return null}catch(o){return tt.catch("Error in utils generateLocationId: ",o),null}},Wi=(i,o=[])=>(i?.tagName?.toLowerCase().indexOf("velt-")>=0&&![U.TAGS.VELT_VIDEO_PLAYER.toLowerCase()].includes(i?.tagName?.toLowerCase())||i?.tagName?.toLowerCase().indexOf("snippyly-")>=0||i?.className?.split&&(i?.className?.split(" ")?.indexOf("snippyly-overlay-panel")>=0||i?.className?.split(" ")?.indexOf("cdk-overlay-container")>=0))&&!o?.includes(i?.tagName?.toLowerCase())?!0:i?.parentNode&&Wi(i?.parentNode,o),wi=i=>{try{return!!document?.body?.contains(i)}catch(o){return tt.catch("Error in utils isElementInsideBody: ",o),!1}};var ui=(i,o)=>{try{return Object.prototype.toString.call(i)===Object.prototype.toString.call(o)?Object.prototype.toString.call(i)==="[object Object]"||Object.prototype.toString.call(i)==="[object Array]"?Object.keys(i).length!==Object.keys(o).length?!1:Object.keys(i).every(n=>ui(i[n],o[n])):i===o:!1}catch(n){return tt.catch("Error in utils deepCompare: ",n),!1}},q0=(i,o,n=1)=>{try{if(o){let e=C7e(o.textContent,i,n);if(e>=0){let t=(o?.ownerDocument).createNodeIterator(o,NodeFilter.SHOW_TEXT),r,a=[];for(;r=t.nextNode();)a.push(r);let s=[],c=e,p=i.length,g=c+p,f=0;for(let I=0;I<a.length;I++){let D=a[I],L=f;if(f+=D.textContent?.length,f>=c&&!s.length?s.push({textNode:D,startOffset:c-L}):f>=c&&f<g&&s.push({textNode:D}),f>=g){if(s.length===1&&s[0].textNode===D){s.push({textNode:D,endOffset:c-L+i.length});break}let G=p;s.forEach(z=>{G-=z.textNode.textContent?.length-(z.startOffset||0)}),s.push({textNode:D,endOffset:G});break}}return s}}return[]}catch(e){return tt.catch("Error in utils calculateNodes: ",e),[]}},C7e=(i,o,n=1)=>{try{if(i?.includes(o)){let e=i.split(o,n);return e.length===n?e.join(o).length:-1}else return-1}catch(e){return tt.catch("Error in utils getTextPosition: ",e),-1}},rf=(i,o,n,e,t)=>{try{let r=new Range;r.setStart(i,o),r.setEnd(n,e);let a=r.toString(),s=0;if(i.nodeType===Node.TEXT_NODE){let c=i,p="";if(c)for(;c=c.previousSibling;)p=(c.textContent||"")+p;if(p){let g=new RegExp(cd(t),"g");s=(p.match(g)||[]).length}}if(a){let c=new RegExp(cd(t),"g");return(a.match(c)||[]).length+s}else return s}catch(r){return tt.catch("Error in utils getSelectedTextOccurrenceInRange: ",r),0}},cd=i=>{try{return i&&typeof i=="string"?i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):i}catch(o){return tt.catch("Error in utils escapeRegExp: ",o),i}},Y0=i=>{try{return i==null?null:i.scrollHeight>i.clientHeight?i:Y0(i?.parentNode)}catch(o){return tt.catch("Error in utils getScrollableParent: ",o),null}},Fg=i=>{try{return i==null?[]:i.scrollHeight>i.clientHeight?[i,...Fg(i?.parentNode)]:Fg(i?.parentNode)}catch(o){return tt.catch("Error in utils getScrollableParents: ",o),[]}},XH=(i,o)=>{try{if(i&&o){let n=i.getBoundingClientRect(),e=o.getBoundingClientRect(),t=n.top-e.top+(o.tagName?.toLowerCase()==="html"?0:o.scrollTop),r=n.left-e.left;return{top:t,left:r}}else return null}catch(n){return tt.catch("Error in utils getRelativeTopLeftPosition: ",n),null}},K0=(i,o)=>`${Nn(i+"_"+o)}`,ki=()=>{try{let i=new mo;return i.url=window.location.href,i.path=window.location.pathname,i.queryParams=window.location.search,i.baseUrl=window.location.origin,i.title=document.title,i}catch(i){tt.catch("Error in utils getPageInfo: ",i);return}},Cp=i=>{try{return i?i?.hasAttribute&&i?.hasAttribute(U.ATTRIBUTES.VELT_COMMENT_DISABLED)?!0:Cp(i?.parentElement):!1}catch(o){return tt.catch("Error in utils isCommentDisabledOnElement: ",o),!1}},Tk=i=>{try{return i?i?.hasAttribute&&i?.hasAttribute(U.ATTRIBUTES.VELT_TAG_DISABLED)?!0:Tk(i?.parentElement):!1}catch(o){return tt.catch("Error in utils isTagDisabledOnElement: ",o),!1}},Dk=i=>{try{return i?i?.hasAttribute&&i?.hasAttribute(U.ATTRIBUTES.VELT_ARROW_DISABLED)?!0:Dk(i?.parentElement):!1}catch(o){return tt.catch("Error in utils isArrowDisabledOnElement: ",o),!1}},wk=i=>{try{return i?i?.hasAttribute&&i?.hasAttribute(U.ATTRIBUTES.VELT_AREA_DISABLED)?!0:wk(i?.parentElement):!1}catch(o){return tt.catch("Error in utils isAreaDisabledOnElement: ",o),!1}},Ok=i=>{try{return i?i?.hasAttribute&&i?.hasAttribute(U.ATTRIBUTES.VELT_RECORDER_DISABLED)?!0:Ok(i?.parentElement):!1}catch(o){return tt.catch("Error in utils isRecorderDisabledOnElement: ",o),!1}};var _a=()=>{try{return window?.Snippyly?.version}catch(i){return tt.catch("Error in utils getSdkVersion: ",i),null}},QH=i=>{try{return Object.fromEntries(Object.entries(i).filter(([o,n])=>n!==void 0))}catch(o){return tt.catch("Error in utils removeUndefinedKeys: ",o),i}},Ak=i=>{try{let o=new URL(i);return Object.values(U.URL_PARAMS).forEach(n=>{o.searchParams.delete(n)}),o.href}catch(o){return tt.catch("Error in utils excludeSnippylyParamsFromUrl: ",o),i}},Ks=i=>{try{navigator.clipboard.writeText(i)}catch(o){tt.catch("Error in copyToClipboard: ",o)}},rI=i=>{try{let o=Fle(i);return o&&typeof o=="string"&&o.includes("/svg")&&(o=o.split("/svg")[0]+"/*[name()='svg']"),o}catch(o){tt.catch("Error in utils getXPath:",o)}},Fle=i=>{try{if(i){if(typeof i=="string")return document.evaluate(i,document,null,0,null);if(!i||i.nodeType!=1)return"";if(i.id&&i?.tagName?.toLowerCase()!=="svg"&&document.querySelectorAll(`[id='${i.id}']`)?.length===1)return"//*[@id='"+i.id+"']";let o=[].filter.call(i.parentNode?.children?i.parentNode?.children:[],function(n){return n.tagName==i.tagName});return Fle(i.parentNode)+"/"+i.tagName.toLowerCase()+(o.length>1?"["+([].indexOf.call(o,i)+1)+"]":"")}}catch(o){tt.catch("Error in utils calculateXPath:",o)}},Lle=i=>{try{let o=[];return i.forEach(n=>{let e={};e.commonAncestorContainer=_7e(n.commonAncestorContainer),e.text=n.toString(),e.occurrence=rf(n.commonAncestorContainer,0,n.startContainer,n.startOffset,n.toString())+1,o.push(e)}),o}catch{return[]}},_7e=i=>{try{if(i.nodeType===Node.TEXT_NODE){let o=1,n=i.previousSibling;for(;n;)n.nodeType===Node.TEXT_NODE&&o++,n=n.previousSibling;return rI(i.parentElement)}else return rI(i)}catch(o){return tt.catch("Error in utils getXPathForText: ",o),rI(i)}},JH=(i,o)=>{try{return i?i?.hasAttribute&&(o&&i.hasAttribute("contenteditable")||i?.getAttribute(U.ATTRIBUTES.VELT_LIVE_SELECTION_ENABLED)==="true")?i:JH(i?.parentElement,o):null}catch(n){return tt.catch("Error in utils getSelectionEnabledElement: ",n),null}},Pk=i=>{try{let o,n=[],e=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);for(;o=e.nextNode();)n.push(o);return n}catch(o){return tt.catch("Error in utils getTextNodesInsideElement: ",o),[]}},Ble=i=>{try{return i<576||i>=576&&i<767?"Mobile":i>=768&&i<992?"Tablet":i>=992&&i<1520?"Desktop":"Monitor"}catch(o){return tt.catch("Error in utils getDeviceTypeFromDeviceWidth: ",o),""}},lm=i=>new Promise(o=>setTimeout(o,i)),Vle=(i,o=0)=>new Promise((n,e)=>{let t=document.createElement("video"),r=navigator.userAgent.includes("Firefox");r&&(t.preload="auto"),t.setAttribute("src",URL.createObjectURL(i)),t.load(),t.addEventListener("error",a=>{e("error when loading video file: "+a)}),t.addEventListener("loadedmetadata",()=>{let a=()=>{if(t.duration<o){e("video is too short.");return}setTimeout(()=>{t.currentTime=o},200),t.addEventListener("seeked",()=>{let s=document.createElement("canvas");s.width=t.videoWidth,s.height=t.videoHeight;let c=s.getContext("2d");c.drawImage(t,0,0,s.width,s.height),c.canvas.toBlob(p=>{t.remove(),n(p)},"image/jpeg",.75)})};if(r&&t.duration>0&&t.duration<10&&i.size>1e6){(()=>{setTimeout(()=>{t.duration<o&&(o=Math.max(.1,t.duration/2)),a()},1e3)})();return}a()})}),Ule=i=>{try{return new Promise((o,n)=>{let e=new FileReader;e.onloadend=()=>o(e.result),e.readAsDataURL(i)})}catch(o){return tt.catch("Error in utils blobToBase64: ",o),Promise.resolve("")}},ez=(i,o="image/jpeg")=>{try{let n=atob(i.split(",")[1]),e=new ArrayBuffer(n.length),t=new Uint8Array(e);for(let r=0;r<n.length;r++)t[r]=n.charCodeAt(r);return new Blob([e],{type:o})}catch(n){return tt.catch("Error in utils base64ToBlob: ",n),null}},jle=(i,o,n=20)=>new Promise((e,t)=>{let r=new Image;r.crossOrigin="Anonymous",r.onload=()=>{let a=r.width,s=r.height,c=600,p=s/a*c,g="http://www.w3.org/2000/svg",f=document.createElementNS(g,"svg");f.setAttribute("xmlns",g),f.setAttribute("width",c.toString()),f.setAttribute("height",p.toString()),f.setAttribute("viewBox",`0 0 ${c} ${p}`);let I=document.createElementNS(g,"circle"),D=document.createElementNS(g,"polygon"),L=16,G=L+16,z=c/2,J=p/2;if(I.setAttribute("cx",z.toString()),I.setAttribute("cy",J.toString()),I.setAttribute("r",G.toString()),I.setAttribute("fill","lightgrey"),D.setAttribute("points",`${z-L/2},${J-L} ${z-L/2},${J+L} ${z+L},${J}`),D.setAttribute("fill","#ffffff"),f.appendChild(I),f.appendChild(D),o){let be=o.length*16-10,Se=16*1.5,Ae=(c-be)/2,Ce=p-Se-10,he=document.createElementNS(g,"rect");he.setAttribute("x",Ae.toString()),he.setAttribute("y",Ce.toString()),he.setAttribute("width",be.toString()),he.setAttribute("height",Se.toString()),he.setAttribute("fill","#353945b3"),he.setAttribute("rx","12"),f.appendChild(he);let Oe=document.createElementNS(g,"text");Oe.textContent=o,Oe.setAttribute("x",(c/2).toString()),Oe.setAttribute("y",(Ce+16).toString()),Oe.setAttribute("font-size","16"),Oe.setAttribute("text-anchor","middle"),Oe.setAttribute("fill","white"),f.appendChild(Oe)}let le=new XMLSerializer().serializeToString(f),_e=new Image,Te=new Blob([le],{type:"image/svg+xml;charset=utf-8"}),Be=URL.createObjectURL(Te);_e.onload=()=>{let Ve=document.createElement("canvas");Ve.width=c,Ve.height=p;let be=Ve.getContext("2d");be.beginPath(),be.moveTo(n,0),be.lineTo(c-n,0),be.quadraticCurveTo(c,0,c,n),be.lineTo(c,p-n),be.quadraticCurveTo(c,p,c-n,p),be.lineTo(n,p),be.quadraticCurveTo(0,p,0,p-n),be.lineTo(0,n),be.quadraticCurveTo(0,0,n,0),be.closePath(),be.clip(),be.drawImage(r,0,0,c,p),be.drawImage(_e,0,0,c,p);let Se=Ve.toDataURL("image/png");e(Se)},_e.onerror=t,_e.src=Be},r.onerror=t,r.src=i});var Mk=i=>{try{return i?.replace(/[\n\t\u200D]/g,"")?.split(/\s+/)?.filter(e=>e?.trim()?.length)||[]}catch(o){return tt.catch("Error in utils getWords: ",o),[]}},ya=(i,o=[])=>{try{let n=o.map(e=>`[${e}="${i}"]`).join(",");return document.querySelector(n)}catch(n){return tt.catch("Error in utils getElementByAttributes: ",n),null}},$le=(i,o=[])=>{try{let n=o.map(e=>`[${e}="${i}"]`).join(",");return document.querySelectorAll(n)}catch(n){return tt.catch("Error in utils getElementsByAttributes: ",n),[]}},ld=i=>{try{let o=Math.floor(i/3600),n=Math.floor((i-o*3600)/60),e=Math.floor(i-o*3600-n*60);return o&&o<10&&(o="0"+o),n<10&&(n="0"+n),e<10&&(e="0"+e),(o?o+":":"")+n+":"+e}catch{return""}},Hle=(i,o=10)=>{try{if(!i||!i.currentTime)throw new Error("Invalid video element reference provided");let n=i.currentTime,e=Math.floor(n/o)*o,t=e+o;return{startSlot:ld(e),endSlot:ld(t),timeSlot:ld(e)+" - "+ld(t)}}catch{return null}},Z0=(i,o=["@"])=>{try{let n="",e,t=i.getRootNode();if(t instanceof ShadowRoot?e=t?.getSelection():e=window.getSelection(),e?.rangeCount){let r=e.getRangeAt(0),a=r.startOffset,s=r.endOffset,c=r?.commonAncestorContainer?.textContent;c?n=y7e(c,s,o):n=""}return n}catch(n){return tt.catch("Error in utils getWordAtCursor: ",n),""}};var y7e=(i,o,n=["@"])=>{try{let e=-1,t=!1;for(let r of n){let a=i.lastIndexOf(r,o),s=a>0?i.lastIndexOf(r,a-1):-1;if(a>e){let c=Ik(i,a,o),p=Ek(i,a,o);if(c||p){if(s!==-1){let g=Ik(i,s,a),f=Ek(i,s,a);!g&&!f&&(e=s,t=!0)}}else e=a,t=!0}}return e!==-1&&t?i.substring(e,o):""}catch(e){return tt.catch("Error in utils getStringFromLastAtSymbol: ",e),""}},Ik=(i,o,n)=>{try{if(o===0)return!1;let e=i.charAt(o-1);return!(e===" "||e==="\xA0"||e===`
181
- `||e===" "||[",",":",";"].includes(e))}catch(e){return tt.catch("Error in utils isHotkeyDisabledForAutocomplete: ",e),!1}},Ek=(i,o,n)=>{try{return!!i.substring(o+1,n).startsWith(" ")}catch(e){return tt.catch("Error in utils isHotkeyFollowedBySpace: ",e),!1}},kk=(i,o,n=["@"])=>{try{let e=S7e(i),t=null;try{e&&typeof e.getSelection=="function"&&(t=e.getSelection())}catch{}if(t||(t=window.getSelection()),t?.rangeCount){let r=t.getRangeAt(0),a=r.startOffset,s=r?.commonAncestorContainer?.textContent;if(s){let c=-1;for(let p of n){let g=s.lastIndexOf(p,a),f=g>0?s.lastIndexOf(p,g-1):-1;if(g>c){let I=Ik(s,g,a),D=Ek(s,g,a);if(I||D){if(f!==-1){let L=Ik(s,f,g),G=Ek(s,f,g);!L&&!G&&(c=f)}}else c=g}}if(c!==-1){let p=s.substring(0,c),g=s.substring(r.endOffset),f=document.createElement("span");f.textContent=o,f.style.color="var(--velt-accent)";let I=Date.now()+"_"+Math.random().toString(36).substr(2,9);f.setAttribute("data-recently-added",I),setTimeout(()=>{f.hasAttribute("data-recently-added")&&f.removeAttribute("data-recently-added")},5e3);let D=r.commonAncestorContainer;if(D.nodeType===Node.TEXT_NODE){let L=D.parentNode;if(L){let G=document.createTextNode(p),z=document.createTextNode(g);L.replaceChild(z,D),L.insertBefore(f,z),L.insertBefore(G,f);try{let J=document.createRange();J.setStartAfter(f),J.collapse(!0),t?.removeAllRanges(),t?.addRange(J)}catch(J){tt.catch("Error positioning cursor after span:",J);try{let le=document.createRange();le.selectNodeContents(i),le.collapse(!1),t?.removeAllRanges(),t?.addRange(le)}catch(le){tt.catch("Error with fallback cursor positioning:",le)}}}}}}}}catch(e){tt.catch("Error in utils replaceWordAtCursor: ",e)}},Rk=()=>{try{let o=window.getSelection()?.getRangeAt(0),n=o?.commonAncestorContainer,e=o?.startContainer,t=o?.endContainer,r=[];r.push(n),r.push(e),r.push(t);let a=!1;for(let s of r)if(s&&Wi(s,[U.TAGS.SNIPPYLY_TEXT_HIGHLIGHT,U.TAGS.SNIPPYLY_COMMENT_TEXT_PORTAL,U.TAGS.SNIPPYLY_HIGHLIGHT_USER_TEXT,U.TAGS.SNIPPYLY_COMMENT_TEXT])){a=!0;break}return a}catch(i){return tt.catch("Error in utils isTextSelectionIncludesSnippylyElement: ",i),!1}},zle=(i,o,n)=>{try{let e=document.querySelector(`[id=${i}]`);if(e)e.name=o,e.content=n;else{let t=document.createElement("meta");t.id=i,t.name=o,t.content=n,document.getElementsByTagName("head")[0].appendChild(t)}}catch{}},Gle=i=>{try{if(i){let o=document.querySelector(`[id=${i}]`);o&&o.remove()}}catch{}},Wle=()=>{try{let o=new Date().getTimezoneOffset(),n=Math.floor(Math.abs(o)/60),e=Math.abs(o)%60;return`UTC${o>0?"-":"+"}${n?.toString()?.padStart(2,"0")}:${e?.toString()?.padStart(2,"0")}`}catch(i){return tt.catch("Error in utils getTimezone: ",i),""}},qle=()=>{try{let i=[];return document.querySelectorAll("*").forEach(n=>{(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth||["auto","scroll"].includes(getComputedStyle(n).overflow))&&i.push(n)}),i}catch(i){return tt.catch("Error in utils getScrollableElements: ",i),[]}},Yle=(i,o)=>Math.sqrt((i.x-o.x)**2+(i.y-o.y)**2),tz=(i,o={x:window.innerWidth/2,y:window.innerHeight/2})=>{try{let n=i;for(;n.children.length>0;){let e=null,t=Number.MAX_SAFE_INTEGER;for(let r=0;r<n.children.length;r++){let a=n.children[r],s=a.getBoundingClientRect(),c={x:s.left+s.width/2,y:s.top+s.height/2},p=Yle(c,o);(s.top>=0||s.bottom<=window.innerHeight)&&s.width>0&&s.height>0&&p<=t&&(e=a,t=p)}if(e===null)break;n=e}return n}catch(n){return tt.catch("Error in utils getInnermostElement: ",n),null}},Kle=i=>{try{let{offsetWidth:o,offsetHeight:n,scrollTop:e}=i,t=i,r={x:o/2,y:e+n/2};for(;t.children.length>0;){let a=null,s=Number.MAX_SAFE_INTEGER;for(let c=0;c<t.children.length;c++){let p=t.children[c],g={x:p.offsetLeft+p.offsetWidth/2,y:p.offsetTop+p.offsetHeight/2},f=Yle(g,r);p.offsetTop>=0&&p.offsetWidth>0&&p.offsetHeight>0&&f<=s&&(a=p,s=f)}if(a===null)break;t=a}return t}catch(o){return tt.catch("Error in utils getNestedInnermostElement: ",o),null}},Zle=()=>{try{let i=window.innerWidth/2,o=window.innerHeight/2,n=document.elementFromPoint(i,o);for(;n&&n.tagName==="BODY";)o+=2,n=document.elementFromPoint(i,o);return n}catch(i){return tt.catch("Error in utils getCenteredBackgroundElement: ",i),null}},nz=(i,o,n=!1)=>{try{let e=i.getBoundingClientRect(),t=o.getBoundingClientRect(),r=o.offsetTop;n&&(r=r-e.height/2+t.height/2),i.scrollTo({top:r,behavior:"smooth"})}catch(e){tt.catch("Error in utils nestedScrollIntoView: ",e)}},Nk=(i,o=!0)=>{try{let n=document.body.getBoundingClientRect(),e=i.getBoundingClientRect(),t=e.top-n.top,r=window.innerHeight,a=t;o&&(a=a-r/2+e.height/2),window.scrollTo({top:a,behavior:"smooth"})}catch(n){tt.catch("Error in utils scrollIntoView: ",n)}},Xle=(i=!1)=>{try{let o=!0;return i&&(o=/\sChrome\/[\d.]+ Mobile\s/.test(navigator.userAgent)),"ontouchstart"in window||navigator.maxTouchPoints>0||o}catch(o){return tt.catch("Error in utils isTouchDevice: ",o),!1}},Qle=(i,o,n)=>{try{return(1-n)*i+n*o}catch(e){tt.catch("Error in utils lerp: ",e)}return 0},Jle=(i,o)=>{try{if(i===void 0)return i;if(i=i.replace("#",""),i.length===6){let n=parseInt(i,16),e=(n>>16)+o;e>255&&(e=255),e<0&&(e=0);let t=(n&255)+o;t>255&&(t=255),t<0&&(t=0);let r=(n>>8&255)+o;return r>255&&(r=255),r<0&&(r=0),`#${(t|r<<8|e<<16).toString(16)}`}else return i}catch(n){tt.catch("Error in utils multiplyColor: ",n)}return i},ece=i=>{try{return i in U.TEXT_COLOR_MAP?U.TEXT_COLOR_MAP[i]:"#141416"}catch(o){return tt.catch("Error in generateUserColor:",o),"#141416"}},dd=()=>{try{let i=localStorage.getItem(U.LOCAL_STORAGE.SNIPPYLY_DEFAULT_MEDIA_SOURCE_OPTIONS);if(i)return JSON.parse(i)}catch(i){return tt.catch("Error in getDefaultMediaStreamOptions:",i),{}}},Fk=(i,o)=>{try{let n=o*(Math.PI/180),e=Math.cos(n);return e?i/e:i}catch(n){return tt.catch("Error in calculateHypotenuse:",n),0}},iz=(i,o,n=!0)=>{try{let e=[],t=n?i:i.parentNode;for(;t;)e.push(t),t=t.parentNode;let r=n?o:o.parentNode;for(;r;){if(e.indexOf(r)!==-1)return r;r=r.parentNode}return null}catch(e){return tt.catch("Error in utils findCommonParent: ",e),null}},oz=(i,o,n,e)=>{let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),a=t.left+i,s=t.top+o,c=a-r.left,p=s-r.top;return{x:c,y:p}},Bg=i=>{try{let o={height:0,width:0};if(typeof i?.getBBox=="function"){let n=i?.getBBox(),e=i?.getBoundingClientRect();o.height=parseFloat(e?.height||n.height||0),o.width=parseFloat(e?.width||n.width||0)}else{let n=window.getComputedStyle(i);if(o.height=i?.clientHeight||parseFloat(n.getPropertyValue("height"))||0,o.width=i?.clientWidth||parseFloat(n.getPropertyValue("width"))||0,i?.getBoundingClientRect&&typeof i?.getBoundingClientRect=="function"){let e=i?.getBoundingClientRect();o?.height||(o.height=e?.height||i?.clientHeight||i?.offsetHeight||0),o?.width||(o.width=e?.width||i?.clientWidth||i?.offsetWidth||0)}}return o}catch(o){return tt.catch("Error in utils getElementDimensions: ",o),{height:0,width:0}}},cm=i=>{try{let o=i;for(;o;){if(window?.getComputedStyle(o)?.getPropertyValue("background-clip")=="text")return!0;o=o?.parentElement}return!1}catch(o){return tt.catch("Error in utils hasParentWithBackgroundClip: ",o),!1}},S7e=i=>{try{let o=i;for(;o;){if(o.toString()==="[object ShadowRoot]")return o;o=o.parentNode}}catch(o){tt.catch("Error in utils findShadowRoot: ",o)}return null};var X0=i=>i===null||typeof i>"u",Q0=(i,o)=>{try{return!!i?.closest(`[${o}]`)}catch(n){return tt.catch("Error in utils hasParentWithAttribute: ",n),!1}},rz=(i,o=!0)=>{try{let n=[];if(!i||!(i instanceof HTMLElement))return[];o&&n.push(i);for(let e=0;e<i.children.length;e++){let t=i.children[e];n=n.concat(rz(t))}return n}catch(n){return tt.catch("Error in utils getAllNestedChildren: ",n),[]}},tce=()=>{try{return document.visibilityState==="hidden"?!1:document.hasFocus()}catch(i){return tt.catch("Error in utils isTabActive: ",i),!1}},az=i=>{try{let o="",n=i?.getAttribute("src");if(n)o=`${Nn(n)}`;else{let e=i?.querySelectorAll("source");if(e&&e.length>0){let r=e[0]?.getAttribute("src");r&&(o=`${Nn(r)}`)}}return o}catch{return""}},qe=i=>{try{return!(i&&(i?.children?.length>0||i?.textContent?.trim()?.length>0))}catch(o){return tt.catch("Error in utils isTemplateEmpty: ",o),!0}},Na=(i,o)=>{try{if(!i||!o)return;let n=[],e="",t=0;for(let c=0;c<o.length;c++){let p=o[c];p==="["?(t++,t===1&&e&&(n.push(e),e=""),e+=p):p==="]"?(t--,e+=p,t===0&&(n.push(e),e="")):p==="."&&t===0?e&&(n.push(e),e=""):e+=p}e&&n.push(e);let r,a=E({},i),s=n.reduce((c,p)=>{if(c==null)return;Fi(c)&&(r=c,c=c());let g=p.match(/^\[([^\[\]]+|(\[[^\[\]]*\]))\]$/);if(g){let I=g[1];if(/^\d+$/.test(I)){let D=parseInt(I,10);return Array.isArray(c)?c[D]:void 0}if(I.startsWith("'")&&I.endsWith("'")||I.startsWith('"')&&I.endsWith('"')){let D=I.slice(1,-1);return c[D]}if(I.includes(".")||I.includes("[")){let D=Na(a,I);Fi(D)&&(D=D());let L=D?.toString()||"";return c[L]}if(a[I]!==void 0){let D=a[I];return Fi(D)&&(D=D()),c[D]}return c[I]}let f=p;return(p.startsWith("'")&&p.endsWith("'")||p.startsWith('"')&&p.endsWith('"'))&&(f=p.slice(1,-1)),f==="length"&&Array.isArray(c)?c.length:c[f]},i);return r?Ai(()=>{try{let c=E({},i);return n.reduce((p,g)=>{if(p==null)return;Fi(p)&&(p=p());let f=g.match(/^\[([^\[\]]+|(\[[^\[\]]*\]))\]$/);if(f){let D=f[1];if(/^\d+$/.test(D)){let L=parseInt(D,10);return Array.isArray(p)?p[L]:void 0}if(D.startsWith("'")&&D.endsWith("'")||D.startsWith('"')&&D.endsWith('"')){let L=D.slice(1,-1);return p[L]}if(D.includes(".")||D.includes("[")){let L=Na(c,D);Fi(L)&&(L=L());let G=L?.toString()||"";return p[G]}if(c[D]!==void 0){let L=c[D];return Fi(L)&&(L=L()),p[L]}return p[D]}let I=g;return(g.startsWith("'")&&g.endsWith("'")||g.startsWith('"')&&g.endsWith('"'))&&(I=g.slice(1,-1)),p[I]},i)}catch{return""}}):s}catch{return""}},af=(i,o)=>{try{return!!(i?.locationId&&(i.locationId===o?.locationId||o?.location?.id===String(i.locationId))||i?.location?.id&&(i.location.id===o?.location?.id||i.location.id===String(o?.locationId)))}catch(n){return tt.catch("Error in utils isLocationSame: ",n),!1}},nce=()=>{try{let i=document.activeElement,o=new Set,n=10,e=0;for(;i&&i.shadowRoot&&!(o.has(i)||(o.add(i),i=i.shadowRoot.activeElement,e++,e>n)););return i}catch(i){return tt.catch("Error in utils getActiveElement: ",i),null}},Xt=(i,o)=>{try{return typeof i=="object"&&typeof o=="object"?JSON.stringify(i)===JSON.stringify(o):i===o}catch{return!1}},J0=i=>{try{let o=JSON.parse(JSON.stringify(i));return i?.clientDocumentId&&(o.documentId=i.clientDocumentId),i?.clientOrganizationId&&(o.organizationId=i.clientOrganizationId),delete o?.clientDocumentId,delete o?.clientOrganizationId,delete o?.veltFolderId,delete o?.parentVeltFolderId,delete o?.pageInfo,o}catch{return i}},na=i=>{try{if(!i.some(a=>a?.value?.data))return{};let o=null,n=i.reduce((a,s)=>Math.max(a,s.timestamp),0),e=i.find(a=>a.timestamp===n);if(!e)return{};e?.value?.operation?.type==="removed"&&(o=e?.value?.operation);let r=i.map(a=>a.value).reduce((a,s)=>({data:E(E({},a?.data??{}),s?.data??{})}),{});return r.operation=o,r}catch{return{}}},md=(i,o,n)=>Q(null,null,function*(){try{let e=0;for(;e<=(n.retryCount||0);)try{let t=yield i();if(!t)return{success:!1,statusCode:400,message:`${o} failed: No response received`};if(t.statusCode===void 0)return{success:!1,statusCode:400,message:`${o} failed: Response missing statusCode`};if(t.statusCode!==200){if(e++,e>(n.retryCount||0))return{success:!1,statusCode:t.statusCode,message:`${o} failed after ${e} attempts with status code ${t.statusCode}`};n.retryDelay&&(yield new Promise(r=>setTimeout(r,n.retryDelay)));continue}return t}catch(t){if(e++,e>(n.retryCount||0))return{success:!1,statusCode:500,message:`${o} failed with error: ${t instanceof Error?t.message:"Unknown error"}`};n.retryDelay&&(yield new Promise(r=>setTimeout(r,n.retryDelay)))}return{success:!1,statusCode:500,message:`${o} failed: Maximum retry attempts exceeded`}}catch(e){return{success:!1,statusCode:500,message:`${o} failed with unexpected error: ${e instanceof Error?e.message:"Unknown error"}`}}}),ice=i=>{try{return!i||!i?.access?[]:Object.keys(i.access).sort().map(t=>i.access?.[t]?.map(r=>`${t}:${r}`)??[]).reduce((t,r)=>t.flatMap(a=>r.map(s=>[...a,s])),[[]]).map(t=>t.join("_"))}catch(o){return tt.catch("Error in utils generateProcessedContext: ",o),[]}},Lk=i=>{try{if(!i||!i?.access)return[];let o=Object.keys(i.access).sort(),e=(r=>{let a=[],s=Math.pow(2,r.length);for(let c=1;c<s;c++){let p=[];for(let g=0;g<r.length;g++)c&1<<g&&p.push(r[g]);a.push(p)}return a})(o),t=[];for(let r of e){let a=r.map(s=>{let c=i.access?.[s];return c==null?null:`${s}:${c}`}).filter(s=>s!==null);a.length>0&&t.push(a.join("_"))}return[...new Set(t)]}catch(o){return tt.catch("Error in utils generateAllContextCombos: ",o),[]}},oce=({input:i})=>{try{if(!i||!i?.access)return[];let o=i?.access,n=Object.keys(o).sort(),e=[];for(let r of n){let a=o[r];a!=null&&Array.isArray(a)&&a.length>0&&e.push({key:r,values:a})}return e.length===0?[]:e.reduce((r,{key:a,values:s})=>r.length===0?s.map(c=>[{key:a,value:c}]):r.flatMap(c=>s.map(p=>[...c,{key:a,value:p}])),[]).map(r=>{let a={};return r.forEach(({key:s,value:c})=>{a[s]=c}),{access:a}})}catch(o){return tt.catch("Error in utils expandContextArraysToSingleValues: ",o),[]}},rce=({input:i})=>{try{if(!i||i.length===0)return{access:{}};let o=new Set;i.forEach(e=>{e?.access&&Object.keys(e.access).forEach(t=>o.add(t))});let n={};for(let e of Array.from(o).sort()){let t=new Set;i.forEach(r=>{if(r?.access){let a=r.access[e];a!=null&&t.add(a)}}),n[e]=t.size>0?Array.from(t).sort():null}return{access:n}}catch(o){return tt.catch("Error in utils combineContextsToArrays: ",o),{access:{}}}},pd=t=>Q(null,[t],function*({data:i,getSdkProxy:o,userId:n,methodName:e}){try{let r="sdkproxyencryptionanddecryptiononsdk"+(n??""),a=yield b7e({data:i,key:r}),s=(yield o({veltData:a}))?.data?.data?.veltData||{};return yield W0(s,r)}catch(r){return tt.catch("Error in utils sdkProxyEncryptDecrypt: "+(e??""),r),i}}),b7e=n=>Q(null,[n],function*({data:i,key:o}){try{return yield Dl(i,o)}catch{return i}}),sz=(i,o)=>Q(null,null,function*(){try{let n=0;for(;n<=(o.retryCount||0);)try{let e=yield i();if(!e)throw new Error("No response received");return e}catch{if(n++,n>=(o.retryCount||0))return null;o.retryDelay&&(yield new Promise(t=>setTimeout(t,o.retryDelay)))}return null}catch{return null}}),Dr=i=>{try{if(i&&typeof i=="object"){let o=JSON.parse(JSON.stringify(i));return o?.clientOrganizationId&&(o.organizationId=o.clientOrganizationId,delete o.clientOrganizationId),o?.clientGroupId&&(o.groupId=o.clientGroupId,delete o.clientGroupId),o?.userSnippylyId&&delete o.userSnippylyId,o}else return null}catch(o){return tt.catch("Error in utils getUserForClient: ",o),null}},Xi=({url:i,apiProxyDomain:o})=>{try{if(o){let n=new URL(i);n.origin&&(i=i.replace(n.origin,o))}return i}catch(n){return tt.catch("Error in utils getResolvedApiUrl: ",n),i}},ace=(i,o)=>{try{if(!i||!(i instanceof Element))return!1;let n,e;if(o&&typeof o.x=="number"&&typeof o.y=="number")n=o.x,e=o.y;else{let r=i.getBoundingClientRect();n=r.left+r.width/2,e=r.top+r.height/2}let t=document.elementFromPoint(n,e);return!(!t||t===i||i.contains(t))}catch{return!1}};var et=(()=>{let o=class o{constructor(e){this.functions=e,this.sf=!1,this.defaultProperties={},this.draftEvents=[],this.liveStateSyncEvents=Object.values(Y.Events.LiveStateSync||{}),this.eventRateLimitCache={},this.EVENT_LIMIT=50,this.TIME_WINDOW_MS=60*1e3,this.analyticsQueue=[],this.batchTimer=null,this.BATCH_WINDOW_MS=5*1e3,this.MAX_BATCH_SIZE=20;try{this.updateDefaultProperties({sdkVersion:_a()}),window?.location?.href&&(this.defaultProperties.pageUrl=window.location.href)}catch(t){tt.catch("Error in AnalyticsService constructor: ",t)}}updateDefaultProperties(e={}){this.defaultProperties=E(E({},this.defaultProperties),e)}setInstalledFeature(e){try{this.defaultProperties?.installedFeatures||(this.defaultProperties.installedFeatures=[]),this.defaultProperties.installedFeatures.includes(e)||this.defaultProperties.installedFeatures.push(e)}catch(t){tt.catch("Error in AnalyticsService setInstalledFeature: ",t)}}setFeatureConfig({feature:e,config:t}){try{this.defaultProperties.featureConfigs||(this.defaultProperties.featureConfigs={}),this.defaultProperties.featureConfigs[e]||(this.defaultProperties.featureConfigs[e]={}),this.defaultProperties.featureConfigs[e]=E(E({},this.defaultProperties.featureConfigs[e]),t)}catch(r){tt.catch("Error in AnalyticsService setFeatureConfig: ",r)}}setSF(e){try{this.sf=e}catch(t){tt.catch("Error in AnalyticsService setSF: ",t)}}setAuthService(e){try{this.authService=e}catch(t){tt.catch("Error in AnalyticsService setAuthService: ",t)}}setCommentService(e){try{this.commentService=e}catch(t){tt.catch("Error in AnalyticsService setCommentService: ",t)}}setConfigService(e){try{this.configService=e}catch(t){tt.catch("Error in AnalyticsService setConfigService: ",t)}}setDomService(e){try{this.domService=e}catch(t){tt.catch("Error in AnalyticsService setDomService: ",t)}}setLiveStateService(e){try{this.liveStateService=e}catch(t){tt.catch("Error in AnalyticsService setLiveStateService: ",t)}}setAreaService(e){try{this.areaService=e}catch(t){tt.catch("Error in AnalyticsService setAreaService: ",t)}}setRecorderAnnotationService(e){try{this.recorderAnnotationService=e}catch(t){tt.catch("Error in AnalyticsService setRecorderAnnotationService: ",t)}}setReactionService(e){try{this.reactionService=e}catch(t){tt.catch("Error in AnalyticsService setReactionService: ",t)}}setUserService(e){try{this.userService=e}catch(t){tt.catch("Error in AnalyticsService setUserService: ",t)}}identifyUser(e,t,r={}){try{this.userId=e;let a=typeof t=="object"?JSON.parse(JSON.stringify(t)):t;this.userService?.userDataProviderAvailable()&&a?.userId&&(a={userId:a.userId}),this.user=a;let s=this.defaultProperties?this.defaultProperties.apiKey:null;if(wn.production||wn.staging){let c=Date.now(),p={userId:e,clientUserId:this.user?.userId,traits:T(E({},a),{apiKey:s,forceReset:r?.forceReset,eventTimestamp:c}),properties:T(E({},this.defaultProperties),{eventTimestamp:c}),sf:this.sf,context:this.getContext(),eventTimestamp:c};this.setAnalytics("identify",p)}if(this.userId&&this.draftEvents?.length){let c=this.draftEvents?.slice();this.draftEvents=[],c?.forEach(p=>{switch(p.type){case"track":p?.data?.eventName&&this.trackEvent(p.data.eventName,p.data.properties,p.data.mergeDefaultProperties,p.data.userId,p.data.clientUserId);break;default:break}})}}catch(a){tt.catch("Error in AnalyticsService identifyUser: ",a)}}trackPage(e,t="",r={}){try{if((wn.production||wn.staging)&&this.userId){let a={userId:this.userId,clientUserId:this.user?.userId,name:e,properties:r,sf:this.sf,context:this.getContext()};this.setAnalytics("page",a)}}catch(a){tt.catch("Error in AnalyticsService trackPage: ",a)}}trackEvent(c){return Q(this,arguments,function*(e,t={},r=!0,a,s){try{if(this.sf&&Ale.includes(e))return Promise.resolve();if(wn.production||wn.staging)if(this.userId||a){if(this.eventRateLimitCache[e]?.blockedForSession)return Promise.resolve();let p=Date.now();if(this.eventRateLimitCache[e]&&p-this.eventRateLimitCache[e].timestamp<this.TIME_WINDOW_MS){if(this.eventRateLimitCache[e].count>=this.EVENT_LIMIT){if(!this.eventRateLimitCache[e].rateLimitExceededEventTriggered){this.eventRateLimitCache[e].rateLimitExceededEventTriggered=!0,this.eventRateLimitCache[e].blockedForSession=!0;let g=E({eventName:e},t||{});this.triggerTrackEvent(Y.Events.Core.SDK_EVENT_RATE_LIMIT_EXCEEDED,g,r,a,s)}return Promise.resolve()}this.eventRateLimitCache[e].count++}else this.eventRateLimitCache[e]={count:1,timestamp:p,rateLimitExceededEventTriggered:!1,blockedForSession:!1};return this.triggerTrackEvent(e,t,r,a,s)}else return t?.eventTimestamp||(t.eventTimestamp=Date.now()),this.draftEvents.push({type:"track",data:{eventName:e,properties:t,mergeDefaultProperties:r,userId:a,clientUserId:s}}),Promise.resolve();return Promise.resolve()}catch(p){return tt.catch("Error in AnalyticsService trackEvent: ",p),Promise.resolve()}})}triggerTrackEvent(c){return Q(this,arguments,function*(e,t={},r=!0,a,s){try{r&&(t||(t={}),t=E(E({},t),this.defaultProperties));let p;if(t?.annotationId){let f=t.annotationId;if(!p&&this.commentService){let I=this.commentService.getAnnotationById(f);I?.metadata&&(p=I.metadata),I?.targetElementId&&(t.targetElementId=I.targetElementId);let D=this.commentService.getMultiThreadAnnotationById(f);D?.metadata&&(p=D.metadata),D?.targetElementId&&(t.targetElementId=D.targetElementId)}if(!p&&this.recorderAnnotationService){let I=this.recorderAnnotationService.getAnnotationById(f);I?.metadata&&(p=I.metadata)}if(!p&&this.reactionService){let I=this.reactionService.getAnnotationById(f);I?.metadata&&(p=I.metadata),I?.targetElementId&&(t.targetElementId=I.targetElementId)}if(!p&&this.areaService){let I=this.areaService.getAnnotationById(f);I?.metadata&&(p=I.metadata)}}if(p&&typeof p=="object"&&(t=E(E({},t),p)),t&&typeof t=="object"&&(t=T(E({},t),{userId:this.userId||a,clientUserId:this.user?.userId||s}),t?.eventTimestamp||(t.eventTimestamp=Date.now()),t?.sessionTabId||(t.sessionTabId=this.domService?.getTabId()),this.liveStateSyncEvents.includes(e))){let f=this.liveStateService?.getSemStats();f&&!t?.semStats&&(t.semStats=f)}let g={userId:this.userId||a,clientUserId:this.user?.userId||s,event:e,properties:t,sf:this.sf,context:this.getContext(),eventTimestamp:t?.eventTimestamp};return this.setAnalytics("track",g)}catch(p){return tt.catch("Error in AnalyticsService triggerTrackEvent: ",p),Promise.resolve()}})}setAnalytics(e,t){return Q(this,null,function*(){try{return navigator.onLine?new Promise((r,a)=>{this.analyticsQueue.push({type:e,body:t,resolve:r,reject:a}),this.analyticsQueue.length>=this.MAX_BATCH_SIZE?this.flushAnalyticsQueue():this.scheduleBatchFlush()}):void 0}catch(r){return tt.catch("Error in AnalyticsService setAnalytics: ",r),Promise.resolve()}})}scheduleBatchFlush(){this.batchTimer||(this.batchTimer=setTimeout(()=>{this.batchTimer=null,this.flushAnalyticsQueue()},this.BATCH_WINDOW_MS))}flushAnalyticsQueue(){return Q(this,null,function*(){if(this.batchTimer&&(clearTimeout(this.batchTimer),this.batchTimer=null),this.analyticsQueue.length===0)return;let e=[...this.analyticsQueue];if(this.analyticsQueue=[],!navigator.onLine){this.analyticsQueue.push(...e);return}try{let t=Zi(this.functions,Xi({url:wn.cloudFunction.sa,apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:12e5}),r=e.map(a=>({type:a.type,data:a.body}));try{yield t({type:"batch",data:{events:r}}),e.forEach(a=>{try{a.resolve&&a.resolve()}catch(s){tt.warn("Error resolving analytics promise: ",s)}})}catch(a){tt.warn("Error in AnalyticsService batch flush: ",a),e.forEach(s=>{try{s.reject&&s.reject(a)}catch(c){tt.warn("Error rejecting analytics promise: ",c)}})}}catch(t){tt.catch("Error in AnalyticsService flushAnalyticsQueue: ",t),e.forEach(r=>{try{r.reject&&r.reject(t)}catch(a){tt.warn("Error rejecting analytics promise: ",a)}})}})}trackAuthenticatedEvent(e,t={},r=!0){try{this.authService?.getUser$&&typeof this.authService?.getUser$()?.subscribe=="function"&&(this.authService.getUser()?this.trackEvent(e,t,r):((!t||typeof t!="object")&&(t={}),t?.eventTimestamp||(t.eventTimestamp=Date.now()),this.authService?.getUser$()?.pipe(Fe(a=>!!a),ot(1))?.subscribe(()=>{this.trackEvent(e,t,r)})))}catch(a){tt.catch("Error in AnalyticsService trackAuthenticatedEvent: ",a)}}getContext(){try{let e={},t=ki();return e.os={name:t?.deviceInfo?.osName,version:t?.deviceInfo?.osVersion},e.page={path:t?.path,title:t?.title,url:t?.url},e.screen={height:t?.deviceInfo?.screenHeight,width:t?.deviceInfo?.screenWidth},e.app={name:t?.deviceInfo?.browserName,version:t?.deviceInfo?.browserVersion},e.device={type:t?.deviceInfo?.deviceType},e.timezone=Wle(),e.userAgent=t?.deviceInfo?.userAgent,e}catch(e){tt.catch("Error in AnalyticsService getContext: ",e)}}};o.\u0275fac=function(t){return new(t||o)(ee(Eo))},o.\u0275prov=Pe({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var y=(()=>{let o=class o{get debugMode(){return kle()}get debugPerfMode(){return Rle()}get logsEnabled(){return this.logsEnabled$.value}constructor(e){this.analyticsService=e,this.logsEnabled$=new ve(!0),this.log("%c[WB] Creating SERVICE LoggingService","color: blue;")}enableLogs(){try{if(this.logsEnabled$.value===!0)return;this.logsEnabled$.next(!0)}catch(e){this.catch("Error in LoggingService enableLogs: ",e)}}disableLogs(){try{if(this.logsEnabled$.value===!1)return;this.logsEnabled$.next(!1)}catch(e){this.catch("Error in LoggingService disableLogs: ",e)}}log(e,...t){this.debugMode&&console.log(e,...t)}logPerf(e,...t){this.debugPerfMode&&console.log(e,...t)}warn(e,...t){this.debugMode&&console.warn(e,...t)}error(e,...t){this.debugMode&&console.error(e,...t)}debug(e,...t){this.debugMode&&console.debug(e,...t)}info(e,...t){this.debugMode&&console.info(e,...t)}catch(e,t,r,a=!1){try{let s=t?.message;this.logsEnabled$.value&&(s?.toLowerCase()?.includes("permission denied")||s?.toLowerCase()?.includes("permission_denied")||(t!==void 0?console.warn("Velt: ",e,t):console.warn("Velt: ",e))),a||this.analyticsService.trackEvent(Y.Events.Core.SDK_ERROR,E({sourceMethod:e,message:(t?.message?t?.message:t)||e,clientUserId:this.analyticsService?.user?.userId,snippylyUserId:this.analyticsService?.user?.userSnippylyId,source:"sdk"},r||{}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(ee(et))},o.\u0275prov=Pe({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var sce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},lce={};var _p,lz;(function(){var i;function o(be,Se){function Ae(){}Ae.prototype=Se.prototype,be.D=Se.prototype,be.prototype=new Ae,be.prototype.constructor=be,be.C=function(Ce,he,Oe){for(var Ne=Array(arguments.length-2),no=2;no<arguments.length;no++)Ne[no-2]=arguments[no];return Se.prototype[he].apply(Ce,Ne)}}function n(){this.blockSize=-1}function e(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}o(e,n),e.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function t(be,Se,Ae){Ae||(Ae=0);var Ce=Array(16);if(typeof Se=="string")for(var he=0;16>he;++he)Ce[he]=Se.charCodeAt(Ae++)|Se.charCodeAt(Ae++)<<8|Se.charCodeAt(Ae++)<<16|Se.charCodeAt(Ae++)<<24;else for(he=0;16>he;++he)Ce[he]=Se[Ae++]|Se[Ae++]<<8|Se[Ae++]<<16|Se[Ae++]<<24;Se=be.g[0],Ae=be.g[1],he=be.g[2];var Oe=be.g[3],Ne=Se+(Oe^Ae&(he^Oe))+Ce[0]+3614090360&4294967295;Se=Ae+(Ne<<7&4294967295|Ne>>>25),Ne=Oe+(he^Se&(Ae^he))+Ce[1]+3905402710&4294967295,Oe=Se+(Ne<<12&4294967295|Ne>>>20),Ne=he+(Ae^Oe&(Se^Ae))+Ce[2]+606105819&4294967295,he=Oe+(Ne<<17&4294967295|Ne>>>15),Ne=Ae+(Se^he&(Oe^Se))+Ce[3]+3250441966&4294967295,Ae=he+(Ne<<22&4294967295|Ne>>>10),Ne=Se+(Oe^Ae&(he^Oe))+Ce[4]+4118548399&4294967295,Se=Ae+(Ne<<7&4294967295|Ne>>>25),Ne=Oe+(he^Se&(Ae^he))+Ce[5]+1200080426&4294967295,Oe=Se+(Ne<<12&4294967295|Ne>>>20),Ne=he+(Ae^Oe&(Se^Ae))+Ce[6]+2821735955&4294967295,he=Oe+(Ne<<17&4294967295|Ne>>>15),Ne=Ae+(Se^he&(Oe^Se))+Ce[7]+4249261313&4294967295,Ae=he+(Ne<<22&4294967295|Ne>>>10),Ne=Se+(Oe^Ae&(he^Oe))+Ce[8]+1770035416&4294967295,Se=Ae+(Ne<<7&4294967295|Ne>>>25),Ne=Oe+(he^Se&(Ae^he))+Ce[9]+2336552879&4294967295,Oe=Se+(Ne<<12&4294967295|Ne>>>20),Ne=he+(Ae^Oe&(Se^Ae))+Ce[10]+4294925233&4294967295,he=Oe+(Ne<<17&4294967295|Ne>>>15),Ne=Ae+(Se^he&(Oe^Se))+Ce[11]+2304563134&4294967295,Ae=he+(Ne<<22&4294967295|Ne>>>10),Ne=Se+(Oe^Ae&(he^Oe))+Ce[12]+1804603682&4294967295,Se=Ae+(Ne<<7&4294967295|Ne>>>25),Ne=Oe+(he^Se&(Ae^he))+Ce[13]+4254626195&4294967295,Oe=Se+(Ne<<12&4294967295|Ne>>>20),Ne=he+(Ae^Oe&(Se^Ae))+Ce[14]+2792965006&4294967295,he=Oe+(Ne<<17&4294967295|Ne>>>15),Ne=Ae+(Se^he&(Oe^Se))+Ce[15]+1236535329&4294967295,Ae=he+(Ne<<22&4294967295|Ne>>>10),Ne=Se+(he^Oe&(Ae^he))+Ce[1]+4129170786&4294967295,Se=Ae+(Ne<<5&4294967295|Ne>>>27),Ne=Oe+(Ae^he&(Se^Ae))+Ce[6]+3225465664&4294967295,Oe=Se+(Ne<<9&4294967295|Ne>>>23),Ne=he+(Se^Ae&(Oe^Se))+Ce[11]+643717713&4294967295,he=Oe+(Ne<<14&4294967295|Ne>>>18),Ne=Ae+(Oe^Se&(he^Oe))+Ce[0]+3921069994&4294967295,Ae=he+(Ne<<20&4294967295|Ne>>>12),Ne=Se+(he^Oe&(Ae^he))+Ce[5]+3593408605&4294967295,Se=Ae+(Ne<<5&4294967295|Ne>>>27),Ne=Oe+(Ae^he&(Se^Ae))+Ce[10]+38016083&4294967295,Oe=Se+(Ne<<9&4294967295|Ne>>>23),Ne=he+(Se^Ae&(Oe^Se))+Ce[15]+3634488961&4294967295,he=Oe+(Ne<<14&4294967295|Ne>>>18),Ne=Ae+(Oe^Se&(he^Oe))+Ce[4]+3889429448&4294967295,Ae=he+(Ne<<20&4294967295|Ne>>>12),Ne=Se+(he^Oe&(Ae^he))+Ce[9]+568446438&4294967295,Se=Ae+(Ne<<5&4294967295|Ne>>>27),Ne=Oe+(Ae^he&(Se^Ae))+Ce[14]+3275163606&4294967295,Oe=Se+(Ne<<9&4294967295|Ne>>>23),Ne=he+(Se^Ae&(Oe^Se))+Ce[3]+4107603335&4294967295,he=Oe+(Ne<<14&4294967295|Ne>>>18),Ne=Ae+(Oe^Se&(he^Oe))+Ce[8]+1163531501&4294967295,Ae=he+(Ne<<20&4294967295|Ne>>>12),Ne=Se+(he^Oe&(Ae^he))+Ce[13]+2850285829&4294967295,Se=Ae+(Ne<<5&4294967295|Ne>>>27),Ne=Oe+(Ae^he&(Se^Ae))+Ce[2]+4243563512&4294967295,Oe=Se+(Ne<<9&4294967295|Ne>>>23),Ne=he+(Se^Ae&(Oe^Se))+Ce[7]+1735328473&4294967295,he=Oe+(Ne<<14&4294967295|Ne>>>18),Ne=Ae+(Oe^Se&(he^Oe))+Ce[12]+2368359562&4294967295,Ae=he+(Ne<<20&4294967295|Ne>>>12),Ne=Se+(Ae^he^Oe)+Ce[5]+4294588738&4294967295,Se=Ae+(Ne<<4&4294967295|Ne>>>28),Ne=Oe+(Se^Ae^he)+Ce[8]+2272392833&4294967295,Oe=Se+(Ne<<11&4294967295|Ne>>>21),Ne=he+(Oe^Se^Ae)+Ce[11]+1839030562&4294967295,he=Oe+(Ne<<16&4294967295|Ne>>>16),Ne=Ae+(he^Oe^Se)+Ce[14]+4259657740&4294967295,Ae=he+(Ne<<23&4294967295|Ne>>>9),Ne=Se+(Ae^he^Oe)+Ce[1]+2763975236&4294967295,Se=Ae+(Ne<<4&4294967295|Ne>>>28),Ne=Oe+(Se^Ae^he)+Ce[4]+1272893353&4294967295,Oe=Se+(Ne<<11&4294967295|Ne>>>21),Ne=he+(Oe^Se^Ae)+Ce[7]+4139469664&4294967295,he=Oe+(Ne<<16&4294967295|Ne>>>16),Ne=Ae+(he^Oe^Se)+Ce[10]+3200236656&4294967295,Ae=he+(Ne<<23&4294967295|Ne>>>9),Ne=Se+(Ae^he^Oe)+Ce[13]+681279174&4294967295,Se=Ae+(Ne<<4&4294967295|Ne>>>28),Ne=Oe+(Se^Ae^he)+Ce[0]+3936430074&4294967295,Oe=Se+(Ne<<11&4294967295|Ne>>>21),Ne=he+(Oe^Se^Ae)+Ce[3]+3572445317&4294967295,he=Oe+(Ne<<16&4294967295|Ne>>>16),Ne=Ae+(he^Oe^Se)+Ce[6]+76029189&4294967295,Ae=he+(Ne<<23&4294967295|Ne>>>9),Ne=Se+(Ae^he^Oe)+Ce[9]+3654602809&4294967295,Se=Ae+(Ne<<4&4294967295|Ne>>>28),Ne=Oe+(Se^Ae^he)+Ce[12]+3873151461&4294967295,Oe=Se+(Ne<<11&4294967295|Ne>>>21),Ne=he+(Oe^Se^Ae)+Ce[15]+530742520&4294967295,he=Oe+(Ne<<16&4294967295|Ne>>>16),Ne=Ae+(he^Oe^Se)+Ce[2]+3299628645&4294967295,Ae=he+(Ne<<23&4294967295|Ne>>>9),Ne=Se+(he^(Ae|~Oe))+Ce[0]+4096336452&4294967295,Se=Ae+(Ne<<6&4294967295|Ne>>>26),Ne=Oe+(Ae^(Se|~he))+Ce[7]+1126891415&4294967295,Oe=Se+(Ne<<10&4294967295|Ne>>>22),Ne=he+(Se^(Oe|~Ae))+Ce[14]+2878612391&4294967295,he=Oe+(Ne<<15&4294967295|Ne>>>17),Ne=Ae+(Oe^(he|~Se))+Ce[5]+4237533241&4294967295,Ae=he+(Ne<<21&4294967295|Ne>>>11),Ne=Se+(he^(Ae|~Oe))+Ce[12]+1700485571&4294967295,Se=Ae+(Ne<<6&4294967295|Ne>>>26),Ne=Oe+(Ae^(Se|~he))+Ce[3]+2399980690&4294967295,Oe=Se+(Ne<<10&4294967295|Ne>>>22),Ne=he+(Se^(Oe|~Ae))+Ce[10]+4293915773&4294967295,he=Oe+(Ne<<15&4294967295|Ne>>>17),Ne=Ae+(Oe^(he|~Se))+Ce[1]+2240044497&4294967295,Ae=he+(Ne<<21&4294967295|Ne>>>11),Ne=Se+(he^(Ae|~Oe))+Ce[8]+1873313359&4294967295,Se=Ae+(Ne<<6&4294967295|Ne>>>26),Ne=Oe+(Ae^(Se|~he))+Ce[15]+4264355552&4294967295,Oe=Se+(Ne<<10&4294967295|Ne>>>22),Ne=he+(Se^(Oe|~Ae))+Ce[6]+2734768916&4294967295,he=Oe+(Ne<<15&4294967295|Ne>>>17),Ne=Ae+(Oe^(he|~Se))+Ce[13]+1309151649&4294967295,Ae=he+(Ne<<21&4294967295|Ne>>>11),Ne=Se+(he^(Ae|~Oe))+Ce[4]+4149444226&4294967295,Se=Ae+(Ne<<6&4294967295|Ne>>>26),Ne=Oe+(Ae^(Se|~he))+Ce[11]+3174756917&4294967295,Oe=Se+(Ne<<10&4294967295|Ne>>>22),Ne=he+(Se^(Oe|~Ae))+Ce[2]+718787259&4294967295,he=Oe+(Ne<<15&4294967295|Ne>>>17),Ne=Ae+(Oe^(he|~Se))+Ce[9]+3951481745&4294967295,be.g[0]=be.g[0]+Se&4294967295,be.g[1]=be.g[1]+(he+(Ne<<21&4294967295|Ne>>>11))&4294967295,be.g[2]=be.g[2]+he&4294967295,be.g[3]=be.g[3]+Oe&4294967295}e.prototype.u=function(be,Se){Se===void 0&&(Se=be.length);for(var Ae=Se-this.blockSize,Ce=this.B,he=this.h,Oe=0;Oe<Se;){if(he==0)for(;Oe<=Ae;)t(this,be,Oe),Oe+=this.blockSize;if(typeof be=="string"){for(;Oe<Se;)if(Ce[he++]=be.charCodeAt(Oe++),he==this.blockSize){t(this,Ce),he=0;break}}else for(;Oe<Se;)if(Ce[he++]=be[Oe++],he==this.blockSize){t(this,Ce),he=0;break}}this.h=he,this.o+=Se},e.prototype.v=function(){var be=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);be[0]=128;for(var Se=1;Se<be.length-8;++Se)be[Se]=0;var Ae=8*this.o;for(Se=be.length-8;Se<be.length;++Se)be[Se]=Ae&255,Ae/=256;for(this.u(be),be=Array(16),Se=Ae=0;4>Se;++Se)for(var Ce=0;32>Ce;Ce+=8)be[Ae++]=this.g[Se]>>>Ce&255;return be};function r(be,Se){var Ae=s;return Object.prototype.hasOwnProperty.call(Ae,be)?Ae[be]:Ae[be]=Se(be)}function a(be,Se){this.h=Se;for(var Ae=[],Ce=!0,he=be.length-1;0<=he;he--){var Oe=be[he]|0;Ce&&Oe==Se||(Ae[he]=Oe,Ce=!1)}this.g=Ae}var s={};function c(be){return-128<=be&&128>be?r(be,function(Se){return new a([Se|0],0>Se?-1:0)}):new a([be|0],0>be?-1:0)}function p(be){if(isNaN(be)||!isFinite(be))return f;if(0>be)return z(p(-be));for(var Se=[],Ae=1,Ce=0;be>=Ae;Ce++)Se[Ce]=be/Ae|0,Ae*=4294967296;return new a(Se,0)}function g(be,Se){if(be.length==0)throw Error("number format error: empty string");if(Se=Se||10,2>Se||36<Se)throw Error("radix out of range: "+Se);if(be.charAt(0)=="-")return z(g(be.substring(1),Se));if(0<=be.indexOf("-"))throw Error('number format error: interior "-" character');for(var Ae=p(Math.pow(Se,8)),Ce=f,he=0;he<be.length;he+=8){var Oe=Math.min(8,be.length-he),Ne=parseInt(be.substring(he,he+Oe),Se);8>Oe?(Oe=p(Math.pow(Se,Oe)),Ce=Ce.j(Oe).add(p(Ne))):(Ce=Ce.j(Ae),Ce=Ce.add(p(Ne)))}return Ce}var f=c(0),I=c(1),D=c(16777216);i=a.prototype,i.m=function(){if(G(this))return-z(this).m();for(var be=0,Se=1,Ae=0;Ae<this.g.length;Ae++){var Ce=this.i(Ae);be+=(0<=Ce?Ce:4294967296+Ce)*Se,Se*=4294967296}return be},i.toString=function(be){if(be=be||10,2>be||36<be)throw Error("radix out of range: "+be);if(L(this))return"0";if(G(this))return"-"+z(this).toString(be);for(var Se=p(Math.pow(be,6)),Ae=this,Ce="";;){var he=Te(Ae,Se).g;Ae=J(Ae,he.j(Se));var Oe=((0<Ae.g.length?Ae.g[0]:Ae.h)>>>0).toString(be);if(Ae=he,L(Ae))return Oe+Ce;for(;6>Oe.length;)Oe="0"+Oe;Ce=Oe+Ce}},i.i=function(be){return 0>be?0:be<this.g.length?this.g[be]:this.h};function L(be){if(be.h!=0)return!1;for(var Se=0;Se<be.g.length;Se++)if(be.g[Se]!=0)return!1;return!0}function G(be){return be.h==-1}i.l=function(be){return be=J(this,be),G(be)?-1:L(be)?0:1};function z(be){for(var Se=be.g.length,Ae=[],Ce=0;Ce<Se;Ce++)Ae[Ce]=~be.g[Ce];return new a(Ae,~be.h).add(I)}i.abs=function(){return G(this)?z(this):this},i.add=function(be){for(var Se=Math.max(this.g.length,be.g.length),Ae=[],Ce=0,he=0;he<=Se;he++){var Oe=Ce+(this.i(he)&65535)+(be.i(he)&65535),Ne=(Oe>>>16)+(this.i(he)>>>16)+(be.i(he)>>>16);Ce=Ne>>>16,Oe&=65535,Ne&=65535,Ae[he]=Ne<<16|Oe}return new a(Ae,Ae[Ae.length-1]&-2147483648?-1:0)};function J(be,Se){return be.add(z(Se))}i.j=function(be){if(L(this)||L(be))return f;if(G(this))return G(be)?z(this).j(z(be)):z(z(this).j(be));if(G(be))return z(this.j(z(be)));if(0>this.l(D)&&0>be.l(D))return p(this.m()*be.m());for(var Se=this.g.length+be.g.length,Ae=[],Ce=0;Ce<2*Se;Ce++)Ae[Ce]=0;for(Ce=0;Ce<this.g.length;Ce++)for(var he=0;he<be.g.length;he++){var Oe=this.i(Ce)>>>16,Ne=this.i(Ce)&65535,no=be.i(he)>>>16,St=be.i(he)&65535;Ae[2*Ce+2*he]+=Ne*St,le(Ae,2*Ce+2*he),Ae[2*Ce+2*he+1]+=Oe*St,le(Ae,2*Ce+2*he+1),Ae[2*Ce+2*he+1]+=Ne*no,le(Ae,2*Ce+2*he+1),Ae[2*Ce+2*he+2]+=Oe*no,le(Ae,2*Ce+2*he+2)}for(Ce=0;Ce<Se;Ce++)Ae[Ce]=Ae[2*Ce+1]<<16|Ae[2*Ce];for(Ce=Se;Ce<2*Se;Ce++)Ae[Ce]=0;return new a(Ae,0)};function le(be,Se){for(;(be[Se]&65535)!=be[Se];)be[Se+1]+=be[Se]>>>16,be[Se]&=65535,Se++}function _e(be,Se){this.g=be,this.h=Se}function Te(be,Se){if(L(Se))throw Error("division by zero");if(L(be))return new _e(f,f);if(G(be))return Se=Te(z(be),Se),new _e(z(Se.g),z(Se.h));if(G(Se))return Se=Te(be,z(Se)),new _e(z(Se.g),Se.h);if(30<be.g.length){if(G(be)||G(Se))throw Error("slowDivide_ only works with positive integers.");for(var Ae=I,Ce=Se;0>=Ce.l(be);)Ae=Be(Ae),Ce=Be(Ce);var he=Ve(Ae,1),Oe=Ve(Ce,1);for(Ce=Ve(Ce,2),Ae=Ve(Ae,2);!L(Ce);){var Ne=Oe.add(Ce);0>=Ne.l(be)&&(he=he.add(Ae),Oe=Ne),Ce=Ve(Ce,1),Ae=Ve(Ae,1)}return Se=J(be,he.j(Se)),new _e(he,Se)}for(he=f;0<=be.l(Se);){for(Ae=Math.max(1,Math.floor(be.m()/Se.m())),Ce=Math.ceil(Math.log(Ae)/Math.LN2),Ce=48>=Ce?1:Math.pow(2,Ce-48),Oe=p(Ae),Ne=Oe.j(Se);G(Ne)||0<Ne.l(be);)Ae-=Ce,Oe=p(Ae),Ne=Oe.j(Se);L(Oe)&&(Oe=I),he=he.add(Oe),be=J(be,Ne)}return new _e(he,be)}i.A=function(be){return Te(this,be).h},i.and=function(be){for(var Se=Math.max(this.g.length,be.g.length),Ae=[],Ce=0;Ce<Se;Ce++)Ae[Ce]=this.i(Ce)&be.i(Ce);return new a(Ae,this.h&be.h)},i.or=function(be){for(var Se=Math.max(this.g.length,be.g.length),Ae=[],Ce=0;Ce<Se;Ce++)Ae[Ce]=this.i(Ce)|be.i(Ce);return new a(Ae,this.h|be.h)},i.xor=function(be){for(var Se=Math.max(this.g.length,be.g.length),Ae=[],Ce=0;Ce<Se;Ce++)Ae[Ce]=this.i(Ce)^be.i(Ce);return new a(Ae,this.h^be.h)};function Be(be){for(var Se=be.g.length+1,Ae=[],Ce=0;Ce<Se;Ce++)Ae[Ce]=be.i(Ce)<<1|be.i(Ce-1)>>>31;return new a(Ae,be.h)}function Ve(be,Se){var Ae=Se>>5;Se%=32;for(var Ce=be.g.length-Ae,he=[],Oe=0;Oe<Ce;Oe++)he[Oe]=0<Se?be.i(Oe+Ae)>>>Se|be.i(Oe+Ae+1)<<32-Se:be.i(Oe+Ae);return new a(he,be.h)}e.prototype.digest=e.prototype.v,e.prototype.reset=e.prototype.s,e.prototype.update=e.prototype.u,lz=lce.Md5=e,a.prototype.add=a.prototype.add,a.prototype.multiply=a.prototype.j,a.prototype.modulo=a.prototype.A,a.prototype.compare=a.prototype.l,a.prototype.toNumber=a.prototype.m,a.prototype.toString=a.prototype.toString,a.prototype.getBits=a.prototype.i,a.fromNumber=p,a.fromString=g,_p=lce.Integer=a}).apply(typeof sce<"u"?sce:typeof self<"u"?self:typeof window<"u"?window:{});var Bk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},yp={};var cz,I7e,eC,dz,aI,Vk,mz,pz,gz;(function(){var i,o=typeof Object.defineProperties=="function"?Object.defineProperty:function(j,ie,ge){return j==Array.prototype||j==Object.prototype||(j[ie]=ge.value),j};function n(j){j=[typeof globalThis=="object"&&globalThis,j,typeof window=="object"&&window,typeof self=="object"&&self,typeof Bk=="object"&&Bk];for(var ie=0;ie<j.length;++ie){var ge=j[ie];if(ge&&ge.Math==Math)return ge}throw Error("Cannot find global object")}var e=n(this);function t(j,ie){if(ie)e:{var ge=e;j=j.split(".");for(var De=0;De<j.length-1;De++){var We=j[De];if(!(We in ge))break e;ge=ge[We]}j=j[j.length-1],De=ge[j],ie=ie(De),ie!=De&&ie!=null&&o(ge,j,{configurable:!0,writable:!0,value:ie})}}function r(j,ie){j instanceof String&&(j+="");var ge=0,De=!1,We={next:function(){if(!De&&ge<j.length){var st=ge++;return{value:ie(st,j[st]),done:!1}}return De=!0,{done:!0,value:void 0}}};return We[Symbol.iterator]=function(){return We},We}t("Array.prototype.values",function(j){return j||function(){return r(this,function(ie,ge){return ge})}});var a=a||{},s=this||self;function c(j){var ie=typeof j;return ie=ie!="object"?ie:j?Array.isArray(j)?"array":ie:"null",ie=="array"||ie=="object"&&typeof j.length=="number"}function p(j){var ie=typeof j;return ie=="object"&&j!=null||ie=="function"}function g(j,ie,ge){return j.call.apply(j.bind,arguments)}function f(j,ie,ge){if(!j)throw Error();if(2<arguments.length){var De=Array.prototype.slice.call(arguments,2);return function(){var We=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(We,De),j.apply(ie,We)}}return function(){return j.apply(ie,arguments)}}function I(j,ie,ge){return I=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?g:f,I.apply(null,arguments)}function D(j,ie){var ge=Array.prototype.slice.call(arguments,1);return function(){var De=ge.slice();return De.push.apply(De,arguments),j.apply(this,De)}}function L(j,ie){function ge(){}ge.prototype=ie.prototype,j.aa=ie.prototype,j.prototype=new ge,j.prototype.constructor=j,j.Qb=function(De,We,st){for(var Vt=Array(arguments.length-2),fo=2;fo<arguments.length;fo++)Vt[fo-2]=arguments[fo];return ie.prototype[We].apply(De,Vt)}}function G(j){let ie=j.length;if(0<ie){let ge=Array(ie);for(let De=0;De<ie;De++)ge[De]=j[De];return ge}return[]}function z(j,ie){for(let ge=1;ge<arguments.length;ge++){let De=arguments[ge];if(c(De)){let We=j.length||0,st=De.length||0;j.length=We+st;for(let Vt=0;Vt<st;Vt++)j[We+Vt]=De[Vt]}else j.push(De)}}class J{constructor(ie,ge){this.i=ie,this.j=ge,this.h=0,this.g=null}get(){let ie;return 0<this.h?(this.h--,ie=this.g,this.g=ie.next,ie.next=null):ie=this.i(),ie}}function le(j){return/^[\s\xa0]*$/.test(j)}function _e(){var j=s.navigator;return j&&(j=j.userAgent)?j:""}function Te(j){return Te[" "](j),j}Te[" "]=function(){};var Be=_e().indexOf("Gecko")!=-1&&!(_e().toLowerCase().indexOf("webkit")!=-1&&_e().indexOf("Edge")==-1)&&!(_e().indexOf("Trident")!=-1||_e().indexOf("MSIE")!=-1)&&_e().indexOf("Edge")==-1;function Ve(j,ie,ge){for(let De in j)ie.call(ge,j[De],De,j)}function be(j,ie){for(let ge in j)ie.call(void 0,j[ge],ge,j)}function Se(j){let ie={};for(let ge in j)ie[ge]=j[ge];return ie}let Ae="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ce(j,ie){let ge,De;for(let We=1;We<arguments.length;We++){De=arguments[We];for(ge in De)j[ge]=De[ge];for(let st=0;st<Ae.length;st++)ge=Ae[st],Object.prototype.hasOwnProperty.call(De,ge)&&(j[ge]=De[ge])}}function he(j){var ie=1;j=j.split(":");let ge=[];for(;0<ie&&j.length;)ge.push(j.shift()),ie--;return j.length&&ge.push(j.join(":")),ge}function Oe(j){s.setTimeout(()=>{throw j},0)}function Ne(){var j=Yt;let ie=null;return j.g&&(ie=j.g,j.g=j.g.next,j.g||(j.h=null),ie.next=null),ie}class no{constructor(){this.h=this.g=null}add(ie,ge){let De=St.get();De.set(ie,ge),this.h?this.h.next=De:this.g=De,this.h=De}}var St=new J(()=>new It,j=>j.reset());class It{constructor(){this.next=this.g=this.h=null}set(ie,ge){this.h=ie,this.g=ge,this.next=null}reset(){this.next=this.g=this.h=null}}let bt,Lt=!1,Yt=new no,Gt=()=>{let j=s.Promise.resolve(void 0);bt=()=>{j.then(Qt)}};var Qt=()=>{for(var j;j=Ne();){try{j.h.call(j.g)}catch(ge){Oe(ge)}var ie=St;ie.j(j),100>ie.h&&(ie.h++,j.next=ie.g,ie.g=j)}Lt=!1};function Ii(){this.s=this.s,this.C=this.C}Ii.prototype.s=!1,Ii.prototype.ma=function(){this.s||(this.s=!0,this.N())},Ii.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function tn(j,ie){this.type=j,this.g=this.target=ie,this.defaultPrevented=!1}tn.prototype.h=function(){this.defaultPrevented=!0};var Jn=(function(){if(!s.addEventListener||!Object.defineProperty)return!1;var j=!1,ie=Object.defineProperty({},"passive",{get:function(){j=!0}});try{let ge=()=>{};s.addEventListener("test",ge,ie),s.removeEventListener("test",ge,ie)}catch{}return j})();function qi(j,ie){if(tn.call(this,j?j.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,j){var ge=this.type=j.type,De=j.changedTouches&&j.changedTouches.length?j.changedTouches[0]:null;if(this.target=j.target||j.srcElement,this.g=ie,ie=j.relatedTarget){if(Be){e:{try{Te(ie.nodeName);var We=!0;break e}catch{}We=!1}We||(ie=null)}}else ge=="mouseover"?ie=j.fromElement:ge=="mouseout"&&(ie=j.toElement);this.relatedTarget=ie,De?(this.clientX=De.clientX!==void 0?De.clientX:De.pageX,this.clientY=De.clientY!==void 0?De.clientY:De.pageY,this.screenX=De.screenX||0,this.screenY=De.screenY||0):(this.clientX=j.clientX!==void 0?j.clientX:j.pageX,this.clientY=j.clientY!==void 0?j.clientY:j.pageY,this.screenX=j.screenX||0,this.screenY=j.screenY||0),this.button=j.button,this.key=j.key||"",this.ctrlKey=j.ctrlKey,this.altKey=j.altKey,this.shiftKey=j.shiftKey,this.metaKey=j.metaKey,this.pointerId=j.pointerId||0,this.pointerType=typeof j.pointerType=="string"?j.pointerType:Am[j.pointerType]||"",this.state=j.state,this.i=j,j.defaultPrevented&&qi.aa.h.call(this)}}L(qi,tn);var Am={2:"touch",3:"pen",4:"mouse"};qi.prototype.h=function(){qi.aa.h.call(this);var j=this.i;j.preventDefault?j.preventDefault():j.returnValue=!1};var Do="closure_listenable_"+(1e6*Math.random()|0),Ua=0;function Ta(j,ie,ge,De,We){this.listener=j,this.proxy=null,this.src=ie,this.type=ge,this.capture=!!De,this.ha=We,this.key=++Ua,this.da=this.fa=!1}function sl(j){j.da=!0,j.listener=null,j.proxy=null,j.src=null,j.ha=null}function bc(j){this.src=j,this.g={},this.h=0}bc.prototype.add=function(j,ie,ge,De,We){var st=j.toString();j=this.g[st],j||(j=this.g[st]=[],this.h++);var Vt=Ed(j,ie,De,We);return-1<Vt?(ie=j[Vt],ge||(ie.fa=!1)):(ie=new Ta(ie,this.src,st,!!De,We),ie.fa=ge,j.push(ie)),ie};function Rf(j,ie){var ge=ie.type;if(ge in j.g){var De=j.g[ge],We=Array.prototype.indexOf.call(De,ie,void 0),st;(st=0<=We)&&Array.prototype.splice.call(De,We,1),st&&(sl(ie),j.g[ge].length==0&&(delete j.g[ge],j.h--))}}function Ed(j,ie,ge,De){for(var We=0;We<j.length;++We){var st=j[We];if(!st.da&&st.listener==ie&&st.capture==!!ge&&st.ha==De)return We}return-1}var kp="closure_lm_"+(1e6*Math.random()|0),Ic={};function Nf(j,ie,ge,De,We){if(De&&De.once)return Eu(j,ie,ge,De,We);if(Array.isArray(ie)){for(var st=0;st<ie.length;st++)Nf(j,ie[st],ge,De,We);return null}return ge=xd(ge),j&&j[Do]?j.K(ie,ge,p(De)?!!De.capture:!!De,We):Ff(j,ie,ge,!1,De,We)}function Ff(j,ie,ge,De,We,st){if(!ie)throw Error("Invalid event type");var Vt=p(We)?!!We.capture:!!We,fo=Tu(j);if(fo||(j[kp]=fo=new bc(j)),ge=fo.add(ie,ge,De,Vt,st),ge.proxy)return ge;if(De=Rp(),ge.proxy=De,De.src=j,De.listener=ge,j.addEventListener)Jn||(We=Vt),We===void 0&&(We=!1),j.addEventListener(ie.toString(),De,We);else if(j.attachEvent)j.attachEvent(Y1(ie.toString()),De);else if(j.addListener&&j.removeListener)j.addListener(De);else throw Error("addEventListener and attachEvent are unavailable.");return ge}function Rp(){function j(ge){return ie.call(j.src,j.listener,ge)}let ie=g8;return j}function Eu(j,ie,ge,De,We){if(Array.isArray(ie)){for(var st=0;st<ie.length;st++)Eu(j,ie[st],ge,De,We);return null}return ge=xd(ge),j&&j[Do]?j.L(ie,ge,p(De)?!!De.capture:!!De,We):Ff(j,ie,ge,!0,De,We)}function xu(j,ie,ge,De,We){if(Array.isArray(ie))for(var st=0;st<ie.length;st++)xu(j,ie[st],ge,De,We);else De=p(De)?!!De.capture:!!De,ge=xd(ge),j&&j[Do]?(j=j.i,ie=String(ie).toString(),ie in j.g&&(st=j.g[ie],ge=Ed(st,ge,De,We),-1<ge&&(sl(st[ge]),Array.prototype.splice.call(st,ge,1),st.length==0&&(delete j.g[ie],j.h--)))):j&&(j=Tu(j))&&(ie=j.g[ie.toString()],j=-1,ie&&(j=Ed(ie,ge,De,We)),(ge=-1<j?ie[j]:null)&&Lf(ge))}function Lf(j){if(typeof j!="number"&&j&&!j.da){var ie=j.src;if(ie&&ie[Do])Rf(ie.i,j);else{var ge=j.type,De=j.proxy;ie.removeEventListener?ie.removeEventListener(ge,De,j.capture):ie.detachEvent?ie.detachEvent(Y1(ge),De):ie.addListener&&ie.removeListener&&ie.removeListener(De),(ge=Tu(ie))?(Rf(ge,j),ge.h==0&&(ge.src=null,ie[kp]=null)):sl(j)}}}function Y1(j){return j in Ic?Ic[j]:Ic[j]="on"+j}function g8(j,ie){if(j.da)j=!0;else{ie=new qi(ie,this);var ge=j.listener,De=j.ha||j.src;j.fa&&Lf(j),j=ge.call(De,ie)}return j}function Tu(j){return j=j[kp],j instanceof bc?j:null}var Pm="__closure_events_fn_"+(1e9*Math.random()>>>0);function xd(j){return typeof j=="function"?j:(j[Pm]||(j[Pm]=function(ie){return j.handleEvent(ie)}),j[Pm])}function Jo(){Ii.call(this),this.i=new bc(this),this.M=this,this.F=null}L(Jo,Ii),Jo.prototype[Do]=!0,Jo.prototype.removeEventListener=function(j,ie,ge,De){xu(this,j,ie,ge,De)};function ra(j,ie){var ge,De=j.F;if(De)for(ge=[];De;De=De.F)ge.push(De);if(j=j.M,De=ie.type||ie,typeof ie=="string")ie=new tn(ie,j);else if(ie instanceof tn)ie.target=ie.target||j;else{var We=ie;ie=new tn(De,j),Ce(ie,We)}if(We=!0,ge)for(var st=ge.length-1;0<=st;st--){var Vt=ie.g=ge[st];We=Du(Vt,De,!0,ie)&&We}if(Vt=ie.g=j,We=Du(Vt,De,!0,ie)&&We,We=Du(Vt,De,!1,ie)&&We,ge)for(st=0;st<ge.length;st++)Vt=ie.g=ge[st],We=Du(Vt,De,!1,ie)&&We}Jo.prototype.N=function(){if(Jo.aa.N.call(this),this.i){var j=this.i,ie;for(ie in j.g){for(var ge=j.g[ie],De=0;De<ge.length;De++)sl(ge[De]);delete j.g[ie],j.h--}}this.F=null},Jo.prototype.K=function(j,ie,ge,De){return this.i.add(String(j),ie,!1,ge,De)},Jo.prototype.L=function(j,ie,ge,De){return this.i.add(String(j),ie,!0,ge,De)};function Du(j,ie,ge,De){if(ie=j.i.g[String(ie)],!ie)return!0;ie=ie.concat();for(var We=!0,st=0;st<ie.length;++st){var Vt=ie[st];if(Vt&&!Vt.da&&Vt.capture==ge){var fo=Vt.listener,wa=Vt.ha||Vt.src;Vt.fa&&Rf(j.i,Vt),We=fo.call(wa,De)!==!1&&We}}return We&&!De.defaultPrevented}function K1(j,ie,ge){if(typeof j=="function")ge&&(j=I(j,ge));else if(j&&typeof j.handleEvent=="function")j=I(j.handleEvent,j);else throw Error("Invalid listener argument");return 2147483647<Number(ie)?-1:s.setTimeout(j,ie||0)}function Bf(j){j.g=K1(()=>{j.g=null,j.i&&(j.i=!1,Bf(j))},j.l);let ie=j.h;j.h=null,j.m.apply(null,ie)}class MA extends Ii{constructor(ie,ge){super(),this.m=ie,this.l=ge,this.h=null,this.i=!1,this.g=null}j(ie){this.h=arguments,this.g?this.i=!0:Bf(this)}N(){super.N(),this.g&&(s.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Td(j){Ii.call(this),this.h=j,this.g={}}L(Td,Ii);var wu=[];function Bl(j){Ve(j.g,function(ie,ge){this.g.hasOwnProperty(ge)&&Lf(ie)},j),j.g={}}Td.prototype.N=function(){Td.aa.N.call(this),Bl(this)},Td.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Dd=s.JSON.stringify,Z1=s.JSON.parse,X1=class{stringify(j){return s.JSON.stringify(j,void 0)}parse(j){return s.JSON.parse(j,void 0)}};function Q1(){}Q1.prototype.h=null;function Ou(j){return j.h||(j.h=j.i())}function Au(){}var Pu={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Mm(){tn.call(this,"d")}L(Mm,tn);function J1(){tn.call(this,"c")}L(J1,tn);var km={},fr=null;function Ec(){return fr=fr||new Jo}km.La="serverreachability";function kA(j){tn.call(this,km.La,j)}L(kA,tn);function Np(j){let ie=Ec();ra(ie,new kA(ie))}km.STAT_EVENT="statevent";function Vf(j,ie){tn.call(this,km.STAT_EVENT,j),this.stat=ie}L(Vf,tn);function aa(j){let ie=Ec();ra(ie,new Vf(ie,j))}km.Ma="timingevent";function ey(j,ie){tn.call(this,km.Ma,j),this.size=ie}L(ey,tn);function Mu(j,ie){if(typeof j!="function")throw Error("Fn must not be null and must be a function");return s.setTimeout(function(){j()},ie)}function ja(){this.g=!0}ja.prototype.xa=function(){this.g=!1};function Rm(j,ie,ge,De,We,st){j.info(function(){if(j.g)if(st)for(var Vt="",fo=st.split("&"),wa=0;wa<fo.length;wa++){var Ni=fo[wa].split("=");if(1<Ni.length){var $a=Ni[0];Ni=Ni[1];var Ha=$a.split("_");Vt=2<=Ha.length&&Ha[1]=="type"?Vt+($a+"="+Ni+"&"):Vt+($a+"=redacted&")}}else Vt=null;else Vt=st;return"XMLHTTP REQ ("+De+") [attempt "+We+"]: "+ie+`
181
+ `||e===" "||[",",":",";"].includes(e))}catch(e){return tt.catch("Error in utils isHotkeyDisabledForAutocomplete: ",e),!1}},Ek=(i,o,n)=>{try{return!!i.substring(o+1,n).startsWith(" ")}catch(e){return tt.catch("Error in utils isHotkeyFollowedBySpace: ",e),!1}},kk=(i,o,n=["@"])=>{try{let e=S7e(i),t=null;try{e&&typeof e.getSelection=="function"&&(t=e.getSelection())}catch{}if(t||(t=window.getSelection()),t?.rangeCount){let r=t.getRangeAt(0),a=r.startOffset,s=r?.commonAncestorContainer?.textContent;if(s){let c=-1;for(let p of n){let g=s.lastIndexOf(p,a),f=g>0?s.lastIndexOf(p,g-1):-1;if(g>c){let I=Ik(s,g,a),D=Ek(s,g,a);if(I||D){if(f!==-1){let L=Ik(s,f,g),G=Ek(s,f,g);!L&&!G&&(c=f)}}else c=g}}if(c!==-1){let p=s.substring(0,c),g=s.substring(r.endOffset),f=document.createElement("span");f.textContent=o,f.style.color="var(--velt-accent)";let I=Date.now()+"_"+Math.random().toString(36).substr(2,9);f.setAttribute("data-recently-added",I),setTimeout(()=>{f.hasAttribute("data-recently-added")&&f.removeAttribute("data-recently-added")},5e3);let D=r.commonAncestorContainer;if(D.nodeType===Node.TEXT_NODE){let L=D.parentNode;if(L){let G=document.createTextNode(p),z=document.createTextNode(g);L.replaceChild(z,D),L.insertBefore(f,z),L.insertBefore(G,f);try{let J=document.createRange();J.setStartAfter(f),J.collapse(!0),t?.removeAllRanges(),t?.addRange(J)}catch(J){tt.catch("Error positioning cursor after span:",J);try{let le=document.createRange();le.selectNodeContents(i),le.collapse(!1),t?.removeAllRanges(),t?.addRange(le)}catch(le){tt.catch("Error with fallback cursor positioning:",le)}}}}}}}}catch(e){tt.catch("Error in utils replaceWordAtCursor: ",e)}},Rk=()=>{try{let o=window.getSelection()?.getRangeAt(0),n=o?.commonAncestorContainer,e=o?.startContainer,t=o?.endContainer,r=[];r.push(n),r.push(e),r.push(t);let a=!1;for(let s of r)if(s&&Wi(s,[U.TAGS.SNIPPYLY_TEXT_HIGHLIGHT,U.TAGS.SNIPPYLY_COMMENT_TEXT_PORTAL,U.TAGS.SNIPPYLY_HIGHLIGHT_USER_TEXT,U.TAGS.SNIPPYLY_COMMENT_TEXT])){a=!0;break}return a}catch(i){return tt.catch("Error in utils isTextSelectionIncludesSnippylyElement: ",i),!1}},zle=(i,o,n)=>{try{let e=document.querySelector(`[id=${i}]`);if(e)e.name=o,e.content=n;else{let t=document.createElement("meta");t.id=i,t.name=o,t.content=n,document.getElementsByTagName("head")[0].appendChild(t)}}catch{}},Gle=i=>{try{if(i){let o=document.querySelector(`[id=${i}]`);o&&o.remove()}}catch{}},Wle=()=>{try{let o=new Date().getTimezoneOffset(),n=Math.floor(Math.abs(o)/60),e=Math.abs(o)%60;return`UTC${o>0?"-":"+"}${n?.toString()?.padStart(2,"0")}:${e?.toString()?.padStart(2,"0")}`}catch(i){return tt.catch("Error in utils getTimezone: ",i),""}},qle=()=>{try{let i=[];return document.querySelectorAll("*").forEach(n=>{(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth||["auto","scroll"].includes(getComputedStyle(n).overflow))&&i.push(n)}),i}catch(i){return tt.catch("Error in utils getScrollableElements: ",i),[]}},Yle=(i,o)=>Math.sqrt((i.x-o.x)**2+(i.y-o.y)**2),tz=(i,o={x:window.innerWidth/2,y:window.innerHeight/2})=>{try{let n=i;for(;n.children.length>0;){let e=null,t=Number.MAX_SAFE_INTEGER;for(let r=0;r<n.children.length;r++){let a=n.children[r],s=a.getBoundingClientRect(),c={x:s.left+s.width/2,y:s.top+s.height/2},p=Yle(c,o);(s.top>=0||s.bottom<=window.innerHeight)&&s.width>0&&s.height>0&&p<=t&&(e=a,t=p)}if(e===null)break;n=e}return n}catch(n){return tt.catch("Error in utils getInnermostElement: ",n),null}},Kle=i=>{try{let{offsetWidth:o,offsetHeight:n,scrollTop:e}=i,t=i,r={x:o/2,y:e+n/2};for(;t.children.length>0;){let a=null,s=Number.MAX_SAFE_INTEGER;for(let c=0;c<t.children.length;c++){let p=t.children[c],g={x:p.offsetLeft+p.offsetWidth/2,y:p.offsetTop+p.offsetHeight/2},f=Yle(g,r);p.offsetTop>=0&&p.offsetWidth>0&&p.offsetHeight>0&&f<=s&&(a=p,s=f)}if(a===null)break;t=a}return t}catch(o){return tt.catch("Error in utils getNestedInnermostElement: ",o),null}},Zle=()=>{try{let i=window.innerWidth/2,o=window.innerHeight/2,n=document.elementFromPoint(i,o);for(;n&&n.tagName==="BODY";)o+=2,n=document.elementFromPoint(i,o);return n}catch(i){return tt.catch("Error in utils getCenteredBackgroundElement: ",i),null}},nz=(i,o,n=!1)=>{try{let e=i.getBoundingClientRect(),t=o.getBoundingClientRect(),r=o.offsetTop;n&&(r=r-e.height/2+t.height/2),i.scrollTo({top:r,behavior:"smooth"})}catch(e){tt.catch("Error in utils nestedScrollIntoView: ",e)}},Nk=(i,o=!0)=>{try{let n=document.body.getBoundingClientRect(),e=i.getBoundingClientRect(),t=e.top-n.top,r=window.innerHeight,a=t;o&&(a=a-r/2+e.height/2),window.scrollTo({top:a,behavior:"smooth"})}catch(n){tt.catch("Error in utils scrollIntoView: ",n)}},Xle=(i=!1)=>{try{let o=!0;return i&&(o=/\sChrome\/[\d.]+ Mobile\s/.test(navigator.userAgent)),"ontouchstart"in window||navigator.maxTouchPoints>0||o}catch(o){return tt.catch("Error in utils isTouchDevice: ",o),!1}},Qle=(i,o,n)=>{try{return(1-n)*i+n*o}catch(e){tt.catch("Error in utils lerp: ",e)}return 0},Jle=(i,o)=>{try{if(i===void 0)return i;if(i=i.replace("#",""),i.length===6){let n=parseInt(i,16),e=(n>>16)+o;e>255&&(e=255),e<0&&(e=0);let t=(n&255)+o;t>255&&(t=255),t<0&&(t=0);let r=(n>>8&255)+o;return r>255&&(r=255),r<0&&(r=0),`#${(t|r<<8|e<<16).toString(16)}`}else return i}catch(n){tt.catch("Error in utils multiplyColor: ",n)}return i},ece=i=>{try{return i in U.TEXT_COLOR_MAP?U.TEXT_COLOR_MAP[i]:"#141416"}catch(o){return tt.catch("Error in generateUserColor:",o),"#141416"}},dd=()=>{try{let i=localStorage.getItem(U.LOCAL_STORAGE.SNIPPYLY_DEFAULT_MEDIA_SOURCE_OPTIONS);if(i)return JSON.parse(i)}catch(i){return tt.catch("Error in getDefaultMediaStreamOptions:",i),{}}},Fk=(i,o)=>{try{let n=o*(Math.PI/180),e=Math.cos(n);return e?i/e:i}catch(n){return tt.catch("Error in calculateHypotenuse:",n),0}},iz=(i,o,n=!0)=>{try{let e=[],t=n?i:i.parentNode;for(;t;)e.push(t),t=t.parentNode;let r=n?o:o.parentNode;for(;r;){if(e.indexOf(r)!==-1)return r;r=r.parentNode}return null}catch(e){return tt.catch("Error in utils findCommonParent: ",e),null}},oz=(i,o,n,e)=>{let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),a=t.left+i,s=t.top+o,c=a-r.left,p=s-r.top;return{x:c,y:p}},Bg=i=>{try{let o={height:0,width:0};if(typeof i?.getBBox=="function"){let n=i?.getBBox(),e=i?.getBoundingClientRect();o.height=parseFloat(e?.height||n.height||0),o.width=parseFloat(e?.width||n.width||0)}else{let n=window.getComputedStyle(i);if(o.height=i?.clientHeight||parseFloat(n.getPropertyValue("height"))||0,o.width=i?.clientWidth||parseFloat(n.getPropertyValue("width"))||0,i?.getBoundingClientRect&&typeof i?.getBoundingClientRect=="function"){let e=i?.getBoundingClientRect();o?.height||(o.height=e?.height||i?.clientHeight||i?.offsetHeight||0),o?.width||(o.width=e?.width||i?.clientWidth||i?.offsetWidth||0)}}return o}catch(o){return tt.catch("Error in utils getElementDimensions: ",o),{height:0,width:0}}},cm=i=>{try{let o=i;for(;o;){if(window?.getComputedStyle(o)?.getPropertyValue("background-clip")=="text")return!0;o=o?.parentElement}return!1}catch(o){return tt.catch("Error in utils hasParentWithBackgroundClip: ",o),!1}},S7e=i=>{try{let o=i;for(;o;){if(o.toString()==="[object ShadowRoot]")return o;o=o.parentNode}}catch(o){tt.catch("Error in utils findShadowRoot: ",o)}return null};var X0=i=>i===null||typeof i>"u",Q0=(i,o)=>{try{return!!i?.closest(`[${o}]`)}catch(n){return tt.catch("Error in utils hasParentWithAttribute: ",n),!1}},rz=(i,o=!0)=>{try{let n=[];if(!i||!(i instanceof HTMLElement))return[];o&&n.push(i);for(let e=0;e<i.children.length;e++){let t=i.children[e];n=n.concat(rz(t))}return n}catch(n){return tt.catch("Error in utils getAllNestedChildren: ",n),[]}},tce=()=>{try{return document.visibilityState==="hidden"?!1:document.hasFocus()}catch(i){return tt.catch("Error in utils isTabActive: ",i),!1}},az=i=>{try{let o="",n=i?.getAttribute("src");if(n)o=`${Nn(n)}`;else{let e=i?.querySelectorAll("source");if(e&&e.length>0){let r=e[0]?.getAttribute("src");r&&(o=`${Nn(r)}`)}}return o}catch{return""}},qe=i=>{try{return!(i&&(i?.children?.length>0||i?.textContent?.trim()?.length>0))}catch(o){return tt.catch("Error in utils isTemplateEmpty: ",o),!0}},Na=(i,o)=>{try{if(!i||!o)return;let n=[],e="",t=0;for(let c=0;c<o.length;c++){let p=o[c];p==="["?(t++,t===1&&e&&(n.push(e),e=""),e+=p):p==="]"?(t--,e+=p,t===0&&(n.push(e),e="")):p==="."&&t===0?e&&(n.push(e),e=""):e+=p}e&&n.push(e);let r,a=E({},i),s=n.reduce((c,p)=>{if(c==null)return;Fi(c)&&(r=c,c=c());let g=p.match(/^\[([^\[\]]+|(\[[^\[\]]*\]))\]$/);if(g){let I=g[1];if(/^\d+$/.test(I)){let D=parseInt(I,10);return Array.isArray(c)?c[D]:void 0}if(I.startsWith("'")&&I.endsWith("'")||I.startsWith('"')&&I.endsWith('"')){let D=I.slice(1,-1);return c[D]}if(I.includes(".")||I.includes("[")){let D=Na(a,I);Fi(D)&&(D=D());let L=D?.toString()||"";return c[L]}if(a[I]!==void 0){let D=a[I];return Fi(D)&&(D=D()),c[D]}return c[I]}let f=p;return(p.startsWith("'")&&p.endsWith("'")||p.startsWith('"')&&p.endsWith('"'))&&(f=p.slice(1,-1)),f==="length"&&Array.isArray(c)?c.length:c[f]},i);return r?Ai(()=>{try{let c=E({},i);return n.reduce((p,g)=>{if(p==null)return;Fi(p)&&(p=p());let f=g.match(/^\[([^\[\]]+|(\[[^\[\]]*\]))\]$/);if(f){let D=f[1];if(/^\d+$/.test(D)){let L=parseInt(D,10);return Array.isArray(p)?p[L]:void 0}if(D.startsWith("'")&&D.endsWith("'")||D.startsWith('"')&&D.endsWith('"')){let L=D.slice(1,-1);return p[L]}if(D.includes(".")||D.includes("[")){let L=Na(c,D);Fi(L)&&(L=L());let G=L?.toString()||"";return p[G]}if(c[D]!==void 0){let L=c[D];return Fi(L)&&(L=L()),p[L]}return p[D]}let I=g;return(g.startsWith("'")&&g.endsWith("'")||g.startsWith('"')&&g.endsWith('"'))&&(I=g.slice(1,-1)),p[I]},i)}catch{return""}}):s}catch{return""}},af=(i,o)=>{try{return!!(i?.locationId&&(i.locationId===o?.locationId||o?.location?.id===String(i.locationId))||i?.location?.id&&(i.location.id===o?.location?.id||i.location.id===String(o?.locationId)))}catch(n){return tt.catch("Error in utils isLocationSame: ",n),!1}},nce=()=>{try{let i=document.activeElement,o=new Set,n=10,e=0;for(;i&&i.shadowRoot&&!(o.has(i)||(o.add(i),i=i.shadowRoot.activeElement,e++,e>n)););return i}catch(i){return tt.catch("Error in utils getActiveElement: ",i),null}},Xt=(i,o)=>{try{return typeof i=="object"&&typeof o=="object"?JSON.stringify(i)===JSON.stringify(o):i===o}catch{return!1}},J0=i=>{try{let o=JSON.parse(JSON.stringify(i));return i?.clientDocumentId&&(o.documentId=i.clientDocumentId),i?.clientOrganizationId&&(o.organizationId=i.clientOrganizationId),delete o?.clientDocumentId,delete o?.clientOrganizationId,delete o?.veltFolderId,delete o?.parentVeltFolderId,delete o?.pageInfo,o}catch{return i}},na=i=>{try{if(!i.some(a=>a?.value?.data))return{};let o=null,n=i.reduce((a,s)=>Math.max(a,s.timestamp),0),e=i.find(a=>a.timestamp===n);if(!e)return{};e?.value?.operation?.type==="removed"&&(o=e?.value?.operation);let r=i.map(a=>a.value).reduce((a,s)=>({data:E(E({},a?.data??{}),s?.data??{})}),{});return r.operation=o,r}catch{return{}}},md=(i,o,n)=>Q(null,null,function*(){try{let e=0;for(;e<=(n.retryCount||0);)try{let t=yield i();if(!t)return{success:!1,statusCode:400,message:`${o} failed: No response received`};if(t.statusCode===void 0)return{success:!1,statusCode:400,message:`${o} failed: Response missing statusCode`};if(t.statusCode!==200){if(e++,e>(n.retryCount||0))return{success:!1,statusCode:t.statusCode,message:`${o} failed after ${e} attempts with status code ${t.statusCode}`};n.retryDelay&&(yield new Promise(r=>setTimeout(r,n.retryDelay)));continue}return t}catch(t){if(e++,e>(n.retryCount||0))return{success:!1,statusCode:500,message:`${o} failed with error: ${t instanceof Error?t.message:"Unknown error"}`};n.retryDelay&&(yield new Promise(r=>setTimeout(r,n.retryDelay)))}return{success:!1,statusCode:500,message:`${o} failed: Maximum retry attempts exceeded`}}catch(e){return{success:!1,statusCode:500,message:`${o} failed with unexpected error: ${e instanceof Error?e.message:"Unknown error"}`}}}),ice=i=>{try{return!i||!i?.access?[]:Object.keys(i.access).sort().map(t=>i.access?.[t]?.map(r=>`${t}:${r}`)??[]).reduce((t,r)=>t.flatMap(a=>r.map(s=>[...a,s])),[[]]).map(t=>t.join("_"))}catch(o){return tt.catch("Error in utils generateProcessedContext: ",o),[]}},Lk=i=>{try{if(!i||!i?.access)return[];let o=Object.keys(i.access).sort(),e=(r=>{let a=[],s=Math.pow(2,r.length);for(let c=1;c<s;c++){let p=[];for(let g=0;g<r.length;g++)c&1<<g&&p.push(r[g]);a.push(p)}return a})(o),t=[];for(let r of e){let a=r.map(s=>{let c=i.access?.[s];return c==null?null:`${s}:${c}`}).filter(s=>s!==null);a.length>0&&t.push(a.join("_"))}return[...new Set(t)]}catch(o){return tt.catch("Error in utils generateAllContextCombos: ",o),[]}},oce=({input:i})=>{try{if(!i||!i?.access)return[];let o=i?.access,n=Object.keys(o).sort(),e=[];for(let r of n){let a=o[r];a!=null&&Array.isArray(a)&&a.length>0&&e.push({key:r,values:a})}return e.length===0?[]:e.reduce((r,{key:a,values:s})=>r.length===0?s.map(c=>[{key:a,value:c}]):r.flatMap(c=>s.map(p=>[...c,{key:a,value:p}])),[]).map(r=>{let a={};return r.forEach(({key:s,value:c})=>{a[s]=c}),{access:a}})}catch(o){return tt.catch("Error in utils expandContextArraysToSingleValues: ",o),[]}},rce=({input:i})=>{try{if(!i||i.length===0)return{access:{}};let o=new Set;i.forEach(e=>{e?.access&&Object.keys(e.access).forEach(t=>o.add(t))});let n={};for(let e of Array.from(o).sort()){let t=new Set;i.forEach(r=>{if(r?.access){let a=r.access[e];a!=null&&t.add(a)}}),n[e]=t.size>0?Array.from(t).sort():null}return{access:n}}catch(o){return tt.catch("Error in utils combineContextsToArrays: ",o),{access:{}}}},pd=t=>Q(null,[t],function*({data:i,getSdkProxy:o,userId:n,methodName:e}){try{let r="sdkproxyencryptionanddecryptiononsdk"+(n??""),a=yield b7e({data:i,key:r}),s=(yield o({veltData:a}))?.data?.data?.veltData||{};return yield W0(s,r)}catch(r){return tt.catch("Error in utils sdkProxyEncryptDecrypt: "+(e??""),r),i}}),b7e=n=>Q(null,[n],function*({data:i,key:o}){try{return yield Dl(i,o)}catch{return i}}),sz=(i,o)=>Q(null,null,function*(){try{let n=0;for(;n<=(o.retryCount||0);)try{let e=yield i();if(!e)throw new Error("No response received");return e}catch{if(n++,n>=(o.retryCount||0))return null;o.retryDelay&&(yield new Promise(t=>setTimeout(t,o.retryDelay)))}return null}catch{return null}}),Dr=i=>{try{if(i&&typeof i=="object"){let o=JSON.parse(JSON.stringify(i));return o?.clientOrganizationId&&(o.organizationId=o.clientOrganizationId,delete o.clientOrganizationId),o?.clientGroupId&&(o.groupId=o.clientGroupId,delete o.clientGroupId),o?.userSnippylyId&&delete o.userSnippylyId,o}else return null}catch(o){return tt.catch("Error in utils getUserForClient: ",o),null}},Xi=({url:i,apiProxyDomain:o})=>{try{if(o){let n=new URL(i);n.origin&&(i=i.replace(n.origin,o))}return i}catch(n){return tt.catch("Error in utils getResolvedApiUrl: ",n),i}},ace=(i,o)=>{try{if(!i||!(i instanceof Element))return!1;let n,e;if(o&&typeof o.x=="number"&&typeof o.y=="number")n=o.x,e=o.y;else{let r=i.getBoundingClientRect();n=r.left+r.width/2,e=r.top+r.height/2}let t=document.elementFromPoint(n,e);return!(!t||t===i||i.contains(t))}catch{return!1}};var et=(()=>{let o=class o{constructor(e){this.functions=e,this.sf=!1,this.defaultProperties={},this.draftEvents=[],this.liveStateSyncEvents=Object.values(Y.Events.LiveStateSync||{}),this.eventRateLimitCache={},this.EVENT_LIMIT=50,this.TIME_WINDOW_MS=60*1e3,this.analyticsQueue=[],this.batchTimer=null,this.BATCH_WINDOW_MS=5*1e3,this.MAX_BATCH_SIZE=50;try{this.updateDefaultProperties({sdkVersion:_a()}),window?.location?.href&&(this.defaultProperties.pageUrl=window.location.href)}catch(t){tt.catch("Error in AnalyticsService constructor: ",t)}}updateDefaultProperties(e={}){this.defaultProperties=E(E({},this.defaultProperties),e)}setInstalledFeature(e){try{this.defaultProperties?.installedFeatures||(this.defaultProperties.installedFeatures=[]),this.defaultProperties.installedFeatures.includes(e)||this.defaultProperties.installedFeatures.push(e)}catch(t){tt.catch("Error in AnalyticsService setInstalledFeature: ",t)}}setFeatureConfig({feature:e,config:t}){try{this.defaultProperties.featureConfigs||(this.defaultProperties.featureConfigs={}),this.defaultProperties.featureConfigs[e]||(this.defaultProperties.featureConfigs[e]={}),this.defaultProperties.featureConfigs[e]=E(E({},this.defaultProperties.featureConfigs[e]),t)}catch(r){tt.catch("Error in AnalyticsService setFeatureConfig: ",r)}}setSF(e){try{this.sf=e}catch(t){tt.catch("Error in AnalyticsService setSF: ",t)}}setAuthService(e){try{this.authService=e}catch(t){tt.catch("Error in AnalyticsService setAuthService: ",t)}}setCommentService(e){try{this.commentService=e}catch(t){tt.catch("Error in AnalyticsService setCommentService: ",t)}}setConfigService(e){try{this.configService=e}catch(t){tt.catch("Error in AnalyticsService setConfigService: ",t)}}setDomService(e){try{this.domService=e}catch(t){tt.catch("Error in AnalyticsService setDomService: ",t)}}setLiveStateService(e){try{this.liveStateService=e}catch(t){tt.catch("Error in AnalyticsService setLiveStateService: ",t)}}setAreaService(e){try{this.areaService=e}catch(t){tt.catch("Error in AnalyticsService setAreaService: ",t)}}setRecorderAnnotationService(e){try{this.recorderAnnotationService=e}catch(t){tt.catch("Error in AnalyticsService setRecorderAnnotationService: ",t)}}setReactionService(e){try{this.reactionService=e}catch(t){tt.catch("Error in AnalyticsService setReactionService: ",t)}}setUserService(e){try{this.userService=e}catch(t){tt.catch("Error in AnalyticsService setUserService: ",t)}}identifyUser(e,t,r={}){try{this.userId=e;let a=typeof t=="object"?JSON.parse(JSON.stringify(t)):t;this.userService?.userDataProviderAvailable()&&a?.userId&&(a={userId:a.userId}),this.user=a;let s=this.defaultProperties?this.defaultProperties.apiKey:null;if(wn.production||wn.staging){let c=Date.now(),p={userId:e,clientUserId:this.user?.userId,traits:T(E({},a),{apiKey:s,forceReset:r?.forceReset,eventTimestamp:c}),properties:T(E({},this.defaultProperties),{eventTimestamp:c}),sf:this.sf,context:this.getContext(),eventTimestamp:c};this.setAnalytics("identify",p)}if(this.userId&&this.draftEvents?.length){let c=this.draftEvents?.slice();this.draftEvents=[],c?.forEach(p=>{switch(p.type){case"track":p?.data?.eventName&&this.trackEvent(p.data.eventName,p.data.properties,p.data.mergeDefaultProperties,p.data.userId,p.data.clientUserId);break;default:break}})}}catch(a){tt.catch("Error in AnalyticsService identifyUser: ",a)}}trackPage(e,t="",r={}){try{if((wn.production||wn.staging)&&this.userId){let a={userId:this.userId,clientUserId:this.user?.userId,name:e,properties:r,sf:this.sf,context:this.getContext()};this.setAnalytics("page",a)}}catch(a){tt.catch("Error in AnalyticsService trackPage: ",a)}}trackEvent(c){return Q(this,arguments,function*(e,t={},r=!0,a,s){try{if(this.sf&&Ale.includes(e))return Promise.resolve();if(wn.production||wn.staging)if(this.userId||a){if(this.eventRateLimitCache[e]?.blockedForSession)return Promise.resolve();let p=Date.now();if(this.eventRateLimitCache[e]&&p-this.eventRateLimitCache[e].timestamp<this.TIME_WINDOW_MS){if(this.eventRateLimitCache[e].count>=this.EVENT_LIMIT){if(!this.eventRateLimitCache[e].rateLimitExceededEventTriggered){this.eventRateLimitCache[e].rateLimitExceededEventTriggered=!0,this.eventRateLimitCache[e].blockedForSession=!0;let g=E({eventName:e},t||{});this.triggerTrackEvent(Y.Events.Core.SDK_EVENT_RATE_LIMIT_EXCEEDED,g,r,a,s)}return Promise.resolve()}this.eventRateLimitCache[e].count++}else this.eventRateLimitCache[e]={count:1,timestamp:p,rateLimitExceededEventTriggered:!1,blockedForSession:!1};return this.triggerTrackEvent(e,t,r,a,s)}else return t?.eventTimestamp||(t.eventTimestamp=Date.now()),this.draftEvents.push({type:"track",data:{eventName:e,properties:t,mergeDefaultProperties:r,userId:a,clientUserId:s}}),Promise.resolve();return Promise.resolve()}catch(p){return tt.catch("Error in AnalyticsService trackEvent: ",p),Promise.resolve()}})}triggerTrackEvent(c){return Q(this,arguments,function*(e,t={},r=!0,a,s){try{r&&(t||(t={}),t=E(E({},t),this.defaultProperties));let p;if(t?.annotationId){let f=t.annotationId;if(!p&&this.commentService){let I=this.commentService.getAnnotationById(f);I?.metadata&&(p=I.metadata),I?.targetElementId&&(t.targetElementId=I.targetElementId);let D=this.commentService.getMultiThreadAnnotationById(f);D?.metadata&&(p=D.metadata),D?.targetElementId&&(t.targetElementId=D.targetElementId)}if(!p&&this.recorderAnnotationService){let I=this.recorderAnnotationService.getAnnotationById(f);I?.metadata&&(p=I.metadata)}if(!p&&this.reactionService){let I=this.reactionService.getAnnotationById(f);I?.metadata&&(p=I.metadata),I?.targetElementId&&(t.targetElementId=I.targetElementId)}if(!p&&this.areaService){let I=this.areaService.getAnnotationById(f);I?.metadata&&(p=I.metadata)}}if(p&&typeof p=="object"&&(t=E(E({},t),p)),t&&typeof t=="object"&&(t=T(E({},t),{userId:this.userId||a,clientUserId:this.user?.userId||s}),t?.eventTimestamp||(t.eventTimestamp=Date.now()),t?.sessionTabId||(t.sessionTabId=this.domService?.getTabId()),this.liveStateSyncEvents.includes(e))){let f=this.liveStateService?.getSemStats();f&&!t?.semStats&&(t.semStats=f)}let g={userId:this.userId||a,clientUserId:this.user?.userId||s,event:e,properties:t,sf:this.sf,context:this.getContext(),eventTimestamp:t?.eventTimestamp};return this.setAnalytics("track",g)}catch(p){return tt.catch("Error in AnalyticsService triggerTrackEvent: ",p),Promise.resolve()}})}setAnalytics(e,t){return Q(this,null,function*(){try{return navigator.onLine?new Promise((r,a)=>{this.analyticsQueue.push({type:e,body:t,resolve:r,reject:a}),this.analyticsQueue.length>=this.MAX_BATCH_SIZE?this.flushAnalyticsQueue():this.scheduleBatchFlush()}):void 0}catch(r){return tt.catch("Error in AnalyticsService setAnalytics: ",r),Promise.resolve()}})}scheduleBatchFlush(){this.batchTimer||(this.batchTimer=setTimeout(()=>{this.batchTimer=null,this.flushAnalyticsQueue()},this.BATCH_WINDOW_MS))}flushAnalyticsQueue(){return Q(this,null,function*(){if(this.batchTimer&&(clearTimeout(this.batchTimer),this.batchTimer=null),this.analyticsQueue.length===0)return;let e=[...this.analyticsQueue];if(this.analyticsQueue=[],!navigator.onLine){this.analyticsQueue.push(...e);return}try{let t=Zi(this.functions,Xi({url:wn.cloudFunction.sa,apiProxyDomain:this.configService?.getApiProxyDomain()}),{timeout:12e5}),r=e.map(a=>({type:a.type,data:a.body}));try{yield t({type:"batch",data:{events:r}}),e.forEach(a=>{try{a.resolve&&a.resolve()}catch(s){tt.warn("Error resolving analytics promise: ",s)}})}catch(a){tt.warn("Error in AnalyticsService batch flush: ",a),e.forEach(s=>{try{s.reject&&s.reject(a)}catch(c){tt.warn("Error rejecting analytics promise: ",c)}})}}catch(t){tt.catch("Error in AnalyticsService flushAnalyticsQueue: ",t),e.forEach(r=>{try{r.reject&&r.reject(t)}catch(a){tt.warn("Error rejecting analytics promise: ",a)}})}})}trackAuthenticatedEvent(e,t={},r=!0){try{this.authService?.getUser$&&typeof this.authService?.getUser$()?.subscribe=="function"&&(this.authService.getUser()?this.trackEvent(e,t,r):((!t||typeof t!="object")&&(t={}),t?.eventTimestamp||(t.eventTimestamp=Date.now()),this.authService?.getUser$()?.pipe(Fe(a=>!!a),ot(1))?.subscribe(()=>{this.trackEvent(e,t,r)})))}catch(a){tt.catch("Error in AnalyticsService trackAuthenticatedEvent: ",a)}}getContext(){try{let e={},t=ki();return e.os={name:t?.deviceInfo?.osName,version:t?.deviceInfo?.osVersion},e.page={path:t?.path,title:t?.title,url:t?.url},e.screen={height:t?.deviceInfo?.screenHeight,width:t?.deviceInfo?.screenWidth},e.app={name:t?.deviceInfo?.browserName,version:t?.deviceInfo?.browserVersion},e.device={type:t?.deviceInfo?.deviceType},e.timezone=Wle(),e.userAgent=t?.deviceInfo?.userAgent,e}catch(e){tt.catch("Error in AnalyticsService getContext: ",e)}}};o.\u0275fac=function(t){return new(t||o)(ee(Eo))},o.\u0275prov=Pe({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var y=(()=>{let o=class o{get debugMode(){return kle()}get debugPerfMode(){return Rle()}get logsEnabled(){return this.logsEnabled$.value}constructor(e){this.analyticsService=e,this.logsEnabled$=new ve(!0),this.log("%c[WB] Creating SERVICE LoggingService","color: blue;")}enableLogs(){try{if(this.logsEnabled$.value===!0)return;this.logsEnabled$.next(!0)}catch(e){this.catch("Error in LoggingService enableLogs: ",e)}}disableLogs(){try{if(this.logsEnabled$.value===!1)return;this.logsEnabled$.next(!1)}catch(e){this.catch("Error in LoggingService disableLogs: ",e)}}log(e,...t){this.debugMode&&console.log(e,...t)}logPerf(e,...t){this.debugPerfMode&&console.log(e,...t)}warn(e,...t){this.debugMode&&console.warn(e,...t)}error(e,...t){this.debugMode&&console.error(e,...t)}debug(e,...t){this.debugMode&&console.debug(e,...t)}info(e,...t){this.debugMode&&console.info(e,...t)}catch(e,t,r,a=!1){try{let s=t?.message;this.logsEnabled$.value&&(s?.toLowerCase()?.includes("permission denied")||s?.toLowerCase()?.includes("permission_denied")||(t!==void 0?console.warn("Velt: ",e,t):console.warn("Velt: ",e))),a||this.analyticsService.trackEvent(Y.Events.Core.SDK_ERROR,E({sourceMethod:e,message:(t?.message?t?.message:t)||e,clientUserId:this.analyticsService?.user?.userId,snippylyUserId:this.analyticsService?.user?.userSnippylyId,source:"sdk"},r||{}))}catch{}}};o.\u0275fac=function(t){return new(t||o)(ee(et))},o.\u0275prov=Pe({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var sce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},lce={};var _p,lz;(function(){var i;function o(be,Se){function Ae(){}Ae.prototype=Se.prototype,be.D=Se.prototype,be.prototype=new Ae,be.prototype.constructor=be,be.C=function(Ce,he,Oe){for(var Ne=Array(arguments.length-2),no=2;no<arguments.length;no++)Ne[no-2]=arguments[no];return Se.prototype[he].apply(Ce,Ne)}}function n(){this.blockSize=-1}function e(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}o(e,n),e.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function t(be,Se,Ae){Ae||(Ae=0);var Ce=Array(16);if(typeof Se=="string")for(var he=0;16>he;++he)Ce[he]=Se.charCodeAt(Ae++)|Se.charCodeAt(Ae++)<<8|Se.charCodeAt(Ae++)<<16|Se.charCodeAt(Ae++)<<24;else for(he=0;16>he;++he)Ce[he]=Se[Ae++]|Se[Ae++]<<8|Se[Ae++]<<16|Se[Ae++]<<24;Se=be.g[0],Ae=be.g[1],he=be.g[2];var Oe=be.g[3],Ne=Se+(Oe^Ae&(he^Oe))+Ce[0]+3614090360&4294967295;Se=Ae+(Ne<<7&4294967295|Ne>>>25),Ne=Oe+(he^Se&(Ae^he))+Ce[1]+3905402710&4294967295,Oe=Se+(Ne<<12&4294967295|Ne>>>20),Ne=he+(Ae^Oe&(Se^Ae))+Ce[2]+606105819&4294967295,he=Oe+(Ne<<17&4294967295|Ne>>>15),Ne=Ae+(Se^he&(Oe^Se))+Ce[3]+3250441966&4294967295,Ae=he+(Ne<<22&4294967295|Ne>>>10),Ne=Se+(Oe^Ae&(he^Oe))+Ce[4]+4118548399&4294967295,Se=Ae+(Ne<<7&4294967295|Ne>>>25),Ne=Oe+(he^Se&(Ae^he))+Ce[5]+1200080426&4294967295,Oe=Se+(Ne<<12&4294967295|Ne>>>20),Ne=he+(Ae^Oe&(Se^Ae))+Ce[6]+2821735955&4294967295,he=Oe+(Ne<<17&4294967295|Ne>>>15),Ne=Ae+(Se^he&(Oe^Se))+Ce[7]+4249261313&4294967295,Ae=he+(Ne<<22&4294967295|Ne>>>10),Ne=Se+(Oe^Ae&(he^Oe))+Ce[8]+1770035416&4294967295,Se=Ae+(Ne<<7&4294967295|Ne>>>25),Ne=Oe+(he^Se&(Ae^he))+Ce[9]+2336552879&4294967295,Oe=Se+(Ne<<12&4294967295|Ne>>>20),Ne=he+(Ae^Oe&(Se^Ae))+Ce[10]+4294925233&4294967295,he=Oe+(Ne<<17&4294967295|Ne>>>15),Ne=Ae+(Se^he&(Oe^Se))+Ce[11]+2304563134&4294967295,Ae=he+(Ne<<22&4294967295|Ne>>>10),Ne=Se+(Oe^Ae&(he^Oe))+Ce[12]+1804603682&4294967295,Se=Ae+(Ne<<7&4294967295|Ne>>>25),Ne=Oe+(he^Se&(Ae^he))+Ce[13]+4254626195&4294967295,Oe=Se+(Ne<<12&4294967295|Ne>>>20),Ne=he+(Ae^Oe&(Se^Ae))+Ce[14]+2792965006&4294967295,he=Oe+(Ne<<17&4294967295|Ne>>>15),Ne=Ae+(Se^he&(Oe^Se))+Ce[15]+1236535329&4294967295,Ae=he+(Ne<<22&4294967295|Ne>>>10),Ne=Se+(he^Oe&(Ae^he))+Ce[1]+4129170786&4294967295,Se=Ae+(Ne<<5&4294967295|Ne>>>27),Ne=Oe+(Ae^he&(Se^Ae))+Ce[6]+3225465664&4294967295,Oe=Se+(Ne<<9&4294967295|Ne>>>23),Ne=he+(Se^Ae&(Oe^Se))+Ce[11]+643717713&4294967295,he=Oe+(Ne<<14&4294967295|Ne>>>18),Ne=Ae+(Oe^Se&(he^Oe))+Ce[0]+3921069994&4294967295,Ae=he+(Ne<<20&4294967295|Ne>>>12),Ne=Se+(he^Oe&(Ae^he))+Ce[5]+3593408605&4294967295,Se=Ae+(Ne<<5&4294967295|Ne>>>27),Ne=Oe+(Ae^he&(Se^Ae))+Ce[10]+38016083&4294967295,Oe=Se+(Ne<<9&4294967295|Ne>>>23),Ne=he+(Se^Ae&(Oe^Se))+Ce[15]+3634488961&4294967295,he=Oe+(Ne<<14&4294967295|Ne>>>18),Ne=Ae+(Oe^Se&(he^Oe))+Ce[4]+3889429448&4294967295,Ae=he+(Ne<<20&4294967295|Ne>>>12),Ne=Se+(he^Oe&(Ae^he))+Ce[9]+568446438&4294967295,Se=Ae+(Ne<<5&4294967295|Ne>>>27),Ne=Oe+(Ae^he&(Se^Ae))+Ce[14]+3275163606&4294967295,Oe=Se+(Ne<<9&4294967295|Ne>>>23),Ne=he+(Se^Ae&(Oe^Se))+Ce[3]+4107603335&4294967295,he=Oe+(Ne<<14&4294967295|Ne>>>18),Ne=Ae+(Oe^Se&(he^Oe))+Ce[8]+1163531501&4294967295,Ae=he+(Ne<<20&4294967295|Ne>>>12),Ne=Se+(he^Oe&(Ae^he))+Ce[13]+2850285829&4294967295,Se=Ae+(Ne<<5&4294967295|Ne>>>27),Ne=Oe+(Ae^he&(Se^Ae))+Ce[2]+4243563512&4294967295,Oe=Se+(Ne<<9&4294967295|Ne>>>23),Ne=he+(Se^Ae&(Oe^Se))+Ce[7]+1735328473&4294967295,he=Oe+(Ne<<14&4294967295|Ne>>>18),Ne=Ae+(Oe^Se&(he^Oe))+Ce[12]+2368359562&4294967295,Ae=he+(Ne<<20&4294967295|Ne>>>12),Ne=Se+(Ae^he^Oe)+Ce[5]+4294588738&4294967295,Se=Ae+(Ne<<4&4294967295|Ne>>>28),Ne=Oe+(Se^Ae^he)+Ce[8]+2272392833&4294967295,Oe=Se+(Ne<<11&4294967295|Ne>>>21),Ne=he+(Oe^Se^Ae)+Ce[11]+1839030562&4294967295,he=Oe+(Ne<<16&4294967295|Ne>>>16),Ne=Ae+(he^Oe^Se)+Ce[14]+4259657740&4294967295,Ae=he+(Ne<<23&4294967295|Ne>>>9),Ne=Se+(Ae^he^Oe)+Ce[1]+2763975236&4294967295,Se=Ae+(Ne<<4&4294967295|Ne>>>28),Ne=Oe+(Se^Ae^he)+Ce[4]+1272893353&4294967295,Oe=Se+(Ne<<11&4294967295|Ne>>>21),Ne=he+(Oe^Se^Ae)+Ce[7]+4139469664&4294967295,he=Oe+(Ne<<16&4294967295|Ne>>>16),Ne=Ae+(he^Oe^Se)+Ce[10]+3200236656&4294967295,Ae=he+(Ne<<23&4294967295|Ne>>>9),Ne=Se+(Ae^he^Oe)+Ce[13]+681279174&4294967295,Se=Ae+(Ne<<4&4294967295|Ne>>>28),Ne=Oe+(Se^Ae^he)+Ce[0]+3936430074&4294967295,Oe=Se+(Ne<<11&4294967295|Ne>>>21),Ne=he+(Oe^Se^Ae)+Ce[3]+3572445317&4294967295,he=Oe+(Ne<<16&4294967295|Ne>>>16),Ne=Ae+(he^Oe^Se)+Ce[6]+76029189&4294967295,Ae=he+(Ne<<23&4294967295|Ne>>>9),Ne=Se+(Ae^he^Oe)+Ce[9]+3654602809&4294967295,Se=Ae+(Ne<<4&4294967295|Ne>>>28),Ne=Oe+(Se^Ae^he)+Ce[12]+3873151461&4294967295,Oe=Se+(Ne<<11&4294967295|Ne>>>21),Ne=he+(Oe^Se^Ae)+Ce[15]+530742520&4294967295,he=Oe+(Ne<<16&4294967295|Ne>>>16),Ne=Ae+(he^Oe^Se)+Ce[2]+3299628645&4294967295,Ae=he+(Ne<<23&4294967295|Ne>>>9),Ne=Se+(he^(Ae|~Oe))+Ce[0]+4096336452&4294967295,Se=Ae+(Ne<<6&4294967295|Ne>>>26),Ne=Oe+(Ae^(Se|~he))+Ce[7]+1126891415&4294967295,Oe=Se+(Ne<<10&4294967295|Ne>>>22),Ne=he+(Se^(Oe|~Ae))+Ce[14]+2878612391&4294967295,he=Oe+(Ne<<15&4294967295|Ne>>>17),Ne=Ae+(Oe^(he|~Se))+Ce[5]+4237533241&4294967295,Ae=he+(Ne<<21&4294967295|Ne>>>11),Ne=Se+(he^(Ae|~Oe))+Ce[12]+1700485571&4294967295,Se=Ae+(Ne<<6&4294967295|Ne>>>26),Ne=Oe+(Ae^(Se|~he))+Ce[3]+2399980690&4294967295,Oe=Se+(Ne<<10&4294967295|Ne>>>22),Ne=he+(Se^(Oe|~Ae))+Ce[10]+4293915773&4294967295,he=Oe+(Ne<<15&4294967295|Ne>>>17),Ne=Ae+(Oe^(he|~Se))+Ce[1]+2240044497&4294967295,Ae=he+(Ne<<21&4294967295|Ne>>>11),Ne=Se+(he^(Ae|~Oe))+Ce[8]+1873313359&4294967295,Se=Ae+(Ne<<6&4294967295|Ne>>>26),Ne=Oe+(Ae^(Se|~he))+Ce[15]+4264355552&4294967295,Oe=Se+(Ne<<10&4294967295|Ne>>>22),Ne=he+(Se^(Oe|~Ae))+Ce[6]+2734768916&4294967295,he=Oe+(Ne<<15&4294967295|Ne>>>17),Ne=Ae+(Oe^(he|~Se))+Ce[13]+1309151649&4294967295,Ae=he+(Ne<<21&4294967295|Ne>>>11),Ne=Se+(he^(Ae|~Oe))+Ce[4]+4149444226&4294967295,Se=Ae+(Ne<<6&4294967295|Ne>>>26),Ne=Oe+(Ae^(Se|~he))+Ce[11]+3174756917&4294967295,Oe=Se+(Ne<<10&4294967295|Ne>>>22),Ne=he+(Se^(Oe|~Ae))+Ce[2]+718787259&4294967295,he=Oe+(Ne<<15&4294967295|Ne>>>17),Ne=Ae+(Oe^(he|~Se))+Ce[9]+3951481745&4294967295,be.g[0]=be.g[0]+Se&4294967295,be.g[1]=be.g[1]+(he+(Ne<<21&4294967295|Ne>>>11))&4294967295,be.g[2]=be.g[2]+he&4294967295,be.g[3]=be.g[3]+Oe&4294967295}e.prototype.u=function(be,Se){Se===void 0&&(Se=be.length);for(var Ae=Se-this.blockSize,Ce=this.B,he=this.h,Oe=0;Oe<Se;){if(he==0)for(;Oe<=Ae;)t(this,be,Oe),Oe+=this.blockSize;if(typeof be=="string"){for(;Oe<Se;)if(Ce[he++]=be.charCodeAt(Oe++),he==this.blockSize){t(this,Ce),he=0;break}}else for(;Oe<Se;)if(Ce[he++]=be[Oe++],he==this.blockSize){t(this,Ce),he=0;break}}this.h=he,this.o+=Se},e.prototype.v=function(){var be=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);be[0]=128;for(var Se=1;Se<be.length-8;++Se)be[Se]=0;var Ae=8*this.o;for(Se=be.length-8;Se<be.length;++Se)be[Se]=Ae&255,Ae/=256;for(this.u(be),be=Array(16),Se=Ae=0;4>Se;++Se)for(var Ce=0;32>Ce;Ce+=8)be[Ae++]=this.g[Se]>>>Ce&255;return be};function r(be,Se){var Ae=s;return Object.prototype.hasOwnProperty.call(Ae,be)?Ae[be]:Ae[be]=Se(be)}function a(be,Se){this.h=Se;for(var Ae=[],Ce=!0,he=be.length-1;0<=he;he--){var Oe=be[he]|0;Ce&&Oe==Se||(Ae[he]=Oe,Ce=!1)}this.g=Ae}var s={};function c(be){return-128<=be&&128>be?r(be,function(Se){return new a([Se|0],0>Se?-1:0)}):new a([be|0],0>be?-1:0)}function p(be){if(isNaN(be)||!isFinite(be))return f;if(0>be)return z(p(-be));for(var Se=[],Ae=1,Ce=0;be>=Ae;Ce++)Se[Ce]=be/Ae|0,Ae*=4294967296;return new a(Se,0)}function g(be,Se){if(be.length==0)throw Error("number format error: empty string");if(Se=Se||10,2>Se||36<Se)throw Error("radix out of range: "+Se);if(be.charAt(0)=="-")return z(g(be.substring(1),Se));if(0<=be.indexOf("-"))throw Error('number format error: interior "-" character');for(var Ae=p(Math.pow(Se,8)),Ce=f,he=0;he<be.length;he+=8){var Oe=Math.min(8,be.length-he),Ne=parseInt(be.substring(he,he+Oe),Se);8>Oe?(Oe=p(Math.pow(Se,Oe)),Ce=Ce.j(Oe).add(p(Ne))):(Ce=Ce.j(Ae),Ce=Ce.add(p(Ne)))}return Ce}var f=c(0),I=c(1),D=c(16777216);i=a.prototype,i.m=function(){if(G(this))return-z(this).m();for(var be=0,Se=1,Ae=0;Ae<this.g.length;Ae++){var Ce=this.i(Ae);be+=(0<=Ce?Ce:4294967296+Ce)*Se,Se*=4294967296}return be},i.toString=function(be){if(be=be||10,2>be||36<be)throw Error("radix out of range: "+be);if(L(this))return"0";if(G(this))return"-"+z(this).toString(be);for(var Se=p(Math.pow(be,6)),Ae=this,Ce="";;){var he=Te(Ae,Se).g;Ae=J(Ae,he.j(Se));var Oe=((0<Ae.g.length?Ae.g[0]:Ae.h)>>>0).toString(be);if(Ae=he,L(Ae))return Oe+Ce;for(;6>Oe.length;)Oe="0"+Oe;Ce=Oe+Ce}},i.i=function(be){return 0>be?0:be<this.g.length?this.g[be]:this.h};function L(be){if(be.h!=0)return!1;for(var Se=0;Se<be.g.length;Se++)if(be.g[Se]!=0)return!1;return!0}function G(be){return be.h==-1}i.l=function(be){return be=J(this,be),G(be)?-1:L(be)?0:1};function z(be){for(var Se=be.g.length,Ae=[],Ce=0;Ce<Se;Ce++)Ae[Ce]=~be.g[Ce];return new a(Ae,~be.h).add(I)}i.abs=function(){return G(this)?z(this):this},i.add=function(be){for(var Se=Math.max(this.g.length,be.g.length),Ae=[],Ce=0,he=0;he<=Se;he++){var Oe=Ce+(this.i(he)&65535)+(be.i(he)&65535),Ne=(Oe>>>16)+(this.i(he)>>>16)+(be.i(he)>>>16);Ce=Ne>>>16,Oe&=65535,Ne&=65535,Ae[he]=Ne<<16|Oe}return new a(Ae,Ae[Ae.length-1]&-2147483648?-1:0)};function J(be,Se){return be.add(z(Se))}i.j=function(be){if(L(this)||L(be))return f;if(G(this))return G(be)?z(this).j(z(be)):z(z(this).j(be));if(G(be))return z(this.j(z(be)));if(0>this.l(D)&&0>be.l(D))return p(this.m()*be.m());for(var Se=this.g.length+be.g.length,Ae=[],Ce=0;Ce<2*Se;Ce++)Ae[Ce]=0;for(Ce=0;Ce<this.g.length;Ce++)for(var he=0;he<be.g.length;he++){var Oe=this.i(Ce)>>>16,Ne=this.i(Ce)&65535,no=be.i(he)>>>16,St=be.i(he)&65535;Ae[2*Ce+2*he]+=Ne*St,le(Ae,2*Ce+2*he),Ae[2*Ce+2*he+1]+=Oe*St,le(Ae,2*Ce+2*he+1),Ae[2*Ce+2*he+1]+=Ne*no,le(Ae,2*Ce+2*he+1),Ae[2*Ce+2*he+2]+=Oe*no,le(Ae,2*Ce+2*he+2)}for(Ce=0;Ce<Se;Ce++)Ae[Ce]=Ae[2*Ce+1]<<16|Ae[2*Ce];for(Ce=Se;Ce<2*Se;Ce++)Ae[Ce]=0;return new a(Ae,0)};function le(be,Se){for(;(be[Se]&65535)!=be[Se];)be[Se+1]+=be[Se]>>>16,be[Se]&=65535,Se++}function _e(be,Se){this.g=be,this.h=Se}function Te(be,Se){if(L(Se))throw Error("division by zero");if(L(be))return new _e(f,f);if(G(be))return Se=Te(z(be),Se),new _e(z(Se.g),z(Se.h));if(G(Se))return Se=Te(be,z(Se)),new _e(z(Se.g),Se.h);if(30<be.g.length){if(G(be)||G(Se))throw Error("slowDivide_ only works with positive integers.");for(var Ae=I,Ce=Se;0>=Ce.l(be);)Ae=Be(Ae),Ce=Be(Ce);var he=Ve(Ae,1),Oe=Ve(Ce,1);for(Ce=Ve(Ce,2),Ae=Ve(Ae,2);!L(Ce);){var Ne=Oe.add(Ce);0>=Ne.l(be)&&(he=he.add(Ae),Oe=Ne),Ce=Ve(Ce,1),Ae=Ve(Ae,1)}return Se=J(be,he.j(Se)),new _e(he,Se)}for(he=f;0<=be.l(Se);){for(Ae=Math.max(1,Math.floor(be.m()/Se.m())),Ce=Math.ceil(Math.log(Ae)/Math.LN2),Ce=48>=Ce?1:Math.pow(2,Ce-48),Oe=p(Ae),Ne=Oe.j(Se);G(Ne)||0<Ne.l(be);)Ae-=Ce,Oe=p(Ae),Ne=Oe.j(Se);L(Oe)&&(Oe=I),he=he.add(Oe),be=J(be,Ne)}return new _e(he,be)}i.A=function(be){return Te(this,be).h},i.and=function(be){for(var Se=Math.max(this.g.length,be.g.length),Ae=[],Ce=0;Ce<Se;Ce++)Ae[Ce]=this.i(Ce)&be.i(Ce);return new a(Ae,this.h&be.h)},i.or=function(be){for(var Se=Math.max(this.g.length,be.g.length),Ae=[],Ce=0;Ce<Se;Ce++)Ae[Ce]=this.i(Ce)|be.i(Ce);return new a(Ae,this.h|be.h)},i.xor=function(be){for(var Se=Math.max(this.g.length,be.g.length),Ae=[],Ce=0;Ce<Se;Ce++)Ae[Ce]=this.i(Ce)^be.i(Ce);return new a(Ae,this.h^be.h)};function Be(be){for(var Se=be.g.length+1,Ae=[],Ce=0;Ce<Se;Ce++)Ae[Ce]=be.i(Ce)<<1|be.i(Ce-1)>>>31;return new a(Ae,be.h)}function Ve(be,Se){var Ae=Se>>5;Se%=32;for(var Ce=be.g.length-Ae,he=[],Oe=0;Oe<Ce;Oe++)he[Oe]=0<Se?be.i(Oe+Ae)>>>Se|be.i(Oe+Ae+1)<<32-Se:be.i(Oe+Ae);return new a(he,be.h)}e.prototype.digest=e.prototype.v,e.prototype.reset=e.prototype.s,e.prototype.update=e.prototype.u,lz=lce.Md5=e,a.prototype.add=a.prototype.add,a.prototype.multiply=a.prototype.j,a.prototype.modulo=a.prototype.A,a.prototype.compare=a.prototype.l,a.prototype.toNumber=a.prototype.m,a.prototype.toString=a.prototype.toString,a.prototype.getBits=a.prototype.i,a.fromNumber=p,a.fromString=g,_p=lce.Integer=a}).apply(typeof sce<"u"?sce:typeof self<"u"?self:typeof window<"u"?window:{});var Bk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},yp={};var cz,I7e,eC,dz,aI,Vk,mz,pz,gz;(function(){var i,o=typeof Object.defineProperties=="function"?Object.defineProperty:function(j,ie,ge){return j==Array.prototype||j==Object.prototype||(j[ie]=ge.value),j};function n(j){j=[typeof globalThis=="object"&&globalThis,j,typeof window=="object"&&window,typeof self=="object"&&self,typeof Bk=="object"&&Bk];for(var ie=0;ie<j.length;++ie){var ge=j[ie];if(ge&&ge.Math==Math)return ge}throw Error("Cannot find global object")}var e=n(this);function t(j,ie){if(ie)e:{var ge=e;j=j.split(".");for(var De=0;De<j.length-1;De++){var We=j[De];if(!(We in ge))break e;ge=ge[We]}j=j[j.length-1],De=ge[j],ie=ie(De),ie!=De&&ie!=null&&o(ge,j,{configurable:!0,writable:!0,value:ie})}}function r(j,ie){j instanceof String&&(j+="");var ge=0,De=!1,We={next:function(){if(!De&&ge<j.length){var st=ge++;return{value:ie(st,j[st]),done:!1}}return De=!0,{done:!0,value:void 0}}};return We[Symbol.iterator]=function(){return We},We}t("Array.prototype.values",function(j){return j||function(){return r(this,function(ie,ge){return ge})}});var a=a||{},s=this||self;function c(j){var ie=typeof j;return ie=ie!="object"?ie:j?Array.isArray(j)?"array":ie:"null",ie=="array"||ie=="object"&&typeof j.length=="number"}function p(j){var ie=typeof j;return ie=="object"&&j!=null||ie=="function"}function g(j,ie,ge){return j.call.apply(j.bind,arguments)}function f(j,ie,ge){if(!j)throw Error();if(2<arguments.length){var De=Array.prototype.slice.call(arguments,2);return function(){var We=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(We,De),j.apply(ie,We)}}return function(){return j.apply(ie,arguments)}}function I(j,ie,ge){return I=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?g:f,I.apply(null,arguments)}function D(j,ie){var ge=Array.prototype.slice.call(arguments,1);return function(){var De=ge.slice();return De.push.apply(De,arguments),j.apply(this,De)}}function L(j,ie){function ge(){}ge.prototype=ie.prototype,j.aa=ie.prototype,j.prototype=new ge,j.prototype.constructor=j,j.Qb=function(De,We,st){for(var Vt=Array(arguments.length-2),fo=2;fo<arguments.length;fo++)Vt[fo-2]=arguments[fo];return ie.prototype[We].apply(De,Vt)}}function G(j){let ie=j.length;if(0<ie){let ge=Array(ie);for(let De=0;De<ie;De++)ge[De]=j[De];return ge}return[]}function z(j,ie){for(let ge=1;ge<arguments.length;ge++){let De=arguments[ge];if(c(De)){let We=j.length||0,st=De.length||0;j.length=We+st;for(let Vt=0;Vt<st;Vt++)j[We+Vt]=De[Vt]}else j.push(De)}}class J{constructor(ie,ge){this.i=ie,this.j=ge,this.h=0,this.g=null}get(){let ie;return 0<this.h?(this.h--,ie=this.g,this.g=ie.next,ie.next=null):ie=this.i(),ie}}function le(j){return/^[\s\xa0]*$/.test(j)}function _e(){var j=s.navigator;return j&&(j=j.userAgent)?j:""}function Te(j){return Te[" "](j),j}Te[" "]=function(){};var Be=_e().indexOf("Gecko")!=-1&&!(_e().toLowerCase().indexOf("webkit")!=-1&&_e().indexOf("Edge")==-1)&&!(_e().indexOf("Trident")!=-1||_e().indexOf("MSIE")!=-1)&&_e().indexOf("Edge")==-1;function Ve(j,ie,ge){for(let De in j)ie.call(ge,j[De],De,j)}function be(j,ie){for(let ge in j)ie.call(void 0,j[ge],ge,j)}function Se(j){let ie={};for(let ge in j)ie[ge]=j[ge];return ie}let Ae="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ce(j,ie){let ge,De;for(let We=1;We<arguments.length;We++){De=arguments[We];for(ge in De)j[ge]=De[ge];for(let st=0;st<Ae.length;st++)ge=Ae[st],Object.prototype.hasOwnProperty.call(De,ge)&&(j[ge]=De[ge])}}function he(j){var ie=1;j=j.split(":");let ge=[];for(;0<ie&&j.length;)ge.push(j.shift()),ie--;return j.length&&ge.push(j.join(":")),ge}function Oe(j){s.setTimeout(()=>{throw j},0)}function Ne(){var j=Yt;let ie=null;return j.g&&(ie=j.g,j.g=j.g.next,j.g||(j.h=null),ie.next=null),ie}class no{constructor(){this.h=this.g=null}add(ie,ge){let De=St.get();De.set(ie,ge),this.h?this.h.next=De:this.g=De,this.h=De}}var St=new J(()=>new It,j=>j.reset());class It{constructor(){this.next=this.g=this.h=null}set(ie,ge){this.h=ie,this.g=ge,this.next=null}reset(){this.next=this.g=this.h=null}}let bt,Lt=!1,Yt=new no,Gt=()=>{let j=s.Promise.resolve(void 0);bt=()=>{j.then(Qt)}};var Qt=()=>{for(var j;j=Ne();){try{j.h.call(j.g)}catch(ge){Oe(ge)}var ie=St;ie.j(j),100>ie.h&&(ie.h++,j.next=ie.g,ie.g=j)}Lt=!1};function Ii(){this.s=this.s,this.C=this.C}Ii.prototype.s=!1,Ii.prototype.ma=function(){this.s||(this.s=!0,this.N())},Ii.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function tn(j,ie){this.type=j,this.g=this.target=ie,this.defaultPrevented=!1}tn.prototype.h=function(){this.defaultPrevented=!0};var Jn=(function(){if(!s.addEventListener||!Object.defineProperty)return!1;var j=!1,ie=Object.defineProperty({},"passive",{get:function(){j=!0}});try{let ge=()=>{};s.addEventListener("test",ge,ie),s.removeEventListener("test",ge,ie)}catch{}return j})();function qi(j,ie){if(tn.call(this,j?j.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,j){var ge=this.type=j.type,De=j.changedTouches&&j.changedTouches.length?j.changedTouches[0]:null;if(this.target=j.target||j.srcElement,this.g=ie,ie=j.relatedTarget){if(Be){e:{try{Te(ie.nodeName);var We=!0;break e}catch{}We=!1}We||(ie=null)}}else ge=="mouseover"?ie=j.fromElement:ge=="mouseout"&&(ie=j.toElement);this.relatedTarget=ie,De?(this.clientX=De.clientX!==void 0?De.clientX:De.pageX,this.clientY=De.clientY!==void 0?De.clientY:De.pageY,this.screenX=De.screenX||0,this.screenY=De.screenY||0):(this.clientX=j.clientX!==void 0?j.clientX:j.pageX,this.clientY=j.clientY!==void 0?j.clientY:j.pageY,this.screenX=j.screenX||0,this.screenY=j.screenY||0),this.button=j.button,this.key=j.key||"",this.ctrlKey=j.ctrlKey,this.altKey=j.altKey,this.shiftKey=j.shiftKey,this.metaKey=j.metaKey,this.pointerId=j.pointerId||0,this.pointerType=typeof j.pointerType=="string"?j.pointerType:Am[j.pointerType]||"",this.state=j.state,this.i=j,j.defaultPrevented&&qi.aa.h.call(this)}}L(qi,tn);var Am={2:"touch",3:"pen",4:"mouse"};qi.prototype.h=function(){qi.aa.h.call(this);var j=this.i;j.preventDefault?j.preventDefault():j.returnValue=!1};var Do="closure_listenable_"+(1e6*Math.random()|0),Ua=0;function Ta(j,ie,ge,De,We){this.listener=j,this.proxy=null,this.src=ie,this.type=ge,this.capture=!!De,this.ha=We,this.key=++Ua,this.da=this.fa=!1}function sl(j){j.da=!0,j.listener=null,j.proxy=null,j.src=null,j.ha=null}function bc(j){this.src=j,this.g={},this.h=0}bc.prototype.add=function(j,ie,ge,De,We){var st=j.toString();j=this.g[st],j||(j=this.g[st]=[],this.h++);var Vt=Ed(j,ie,De,We);return-1<Vt?(ie=j[Vt],ge||(ie.fa=!1)):(ie=new Ta(ie,this.src,st,!!De,We),ie.fa=ge,j.push(ie)),ie};function Rf(j,ie){var ge=ie.type;if(ge in j.g){var De=j.g[ge],We=Array.prototype.indexOf.call(De,ie,void 0),st;(st=0<=We)&&Array.prototype.splice.call(De,We,1),st&&(sl(ie),j.g[ge].length==0&&(delete j.g[ge],j.h--))}}function Ed(j,ie,ge,De){for(var We=0;We<j.length;++We){var st=j[We];if(!st.da&&st.listener==ie&&st.capture==!!ge&&st.ha==De)return We}return-1}var kp="closure_lm_"+(1e6*Math.random()|0),Ic={};function Nf(j,ie,ge,De,We){if(De&&De.once)return Eu(j,ie,ge,De,We);if(Array.isArray(ie)){for(var st=0;st<ie.length;st++)Nf(j,ie[st],ge,De,We);return null}return ge=xd(ge),j&&j[Do]?j.K(ie,ge,p(De)?!!De.capture:!!De,We):Ff(j,ie,ge,!1,De,We)}function Ff(j,ie,ge,De,We,st){if(!ie)throw Error("Invalid event type");var Vt=p(We)?!!We.capture:!!We,fo=Tu(j);if(fo||(j[kp]=fo=new bc(j)),ge=fo.add(ie,ge,De,Vt,st),ge.proxy)return ge;if(De=Rp(),ge.proxy=De,De.src=j,De.listener=ge,j.addEventListener)Jn||(We=Vt),We===void 0&&(We=!1),j.addEventListener(ie.toString(),De,We);else if(j.attachEvent)j.attachEvent(Y1(ie.toString()),De);else if(j.addListener&&j.removeListener)j.addListener(De);else throw Error("addEventListener and attachEvent are unavailable.");return ge}function Rp(){function j(ge){return ie.call(j.src,j.listener,ge)}let ie=g8;return j}function Eu(j,ie,ge,De,We){if(Array.isArray(ie)){for(var st=0;st<ie.length;st++)Eu(j,ie[st],ge,De,We);return null}return ge=xd(ge),j&&j[Do]?j.L(ie,ge,p(De)?!!De.capture:!!De,We):Ff(j,ie,ge,!0,De,We)}function xu(j,ie,ge,De,We){if(Array.isArray(ie))for(var st=0;st<ie.length;st++)xu(j,ie[st],ge,De,We);else De=p(De)?!!De.capture:!!De,ge=xd(ge),j&&j[Do]?(j=j.i,ie=String(ie).toString(),ie in j.g&&(st=j.g[ie],ge=Ed(st,ge,De,We),-1<ge&&(sl(st[ge]),Array.prototype.splice.call(st,ge,1),st.length==0&&(delete j.g[ie],j.h--)))):j&&(j=Tu(j))&&(ie=j.g[ie.toString()],j=-1,ie&&(j=Ed(ie,ge,De,We)),(ge=-1<j?ie[j]:null)&&Lf(ge))}function Lf(j){if(typeof j!="number"&&j&&!j.da){var ie=j.src;if(ie&&ie[Do])Rf(ie.i,j);else{var ge=j.type,De=j.proxy;ie.removeEventListener?ie.removeEventListener(ge,De,j.capture):ie.detachEvent?ie.detachEvent(Y1(ge),De):ie.addListener&&ie.removeListener&&ie.removeListener(De),(ge=Tu(ie))?(Rf(ge,j),ge.h==0&&(ge.src=null,ie[kp]=null)):sl(j)}}}function Y1(j){return j in Ic?Ic[j]:Ic[j]="on"+j}function g8(j,ie){if(j.da)j=!0;else{ie=new qi(ie,this);var ge=j.listener,De=j.ha||j.src;j.fa&&Lf(j),j=ge.call(De,ie)}return j}function Tu(j){return j=j[kp],j instanceof bc?j:null}var Pm="__closure_events_fn_"+(1e9*Math.random()>>>0);function xd(j){return typeof j=="function"?j:(j[Pm]||(j[Pm]=function(ie){return j.handleEvent(ie)}),j[Pm])}function Jo(){Ii.call(this),this.i=new bc(this),this.M=this,this.F=null}L(Jo,Ii),Jo.prototype[Do]=!0,Jo.prototype.removeEventListener=function(j,ie,ge,De){xu(this,j,ie,ge,De)};function ra(j,ie){var ge,De=j.F;if(De)for(ge=[];De;De=De.F)ge.push(De);if(j=j.M,De=ie.type||ie,typeof ie=="string")ie=new tn(ie,j);else if(ie instanceof tn)ie.target=ie.target||j;else{var We=ie;ie=new tn(De,j),Ce(ie,We)}if(We=!0,ge)for(var st=ge.length-1;0<=st;st--){var Vt=ie.g=ge[st];We=Du(Vt,De,!0,ie)&&We}if(Vt=ie.g=j,We=Du(Vt,De,!0,ie)&&We,We=Du(Vt,De,!1,ie)&&We,ge)for(st=0;st<ge.length;st++)Vt=ie.g=ge[st],We=Du(Vt,De,!1,ie)&&We}Jo.prototype.N=function(){if(Jo.aa.N.call(this),this.i){var j=this.i,ie;for(ie in j.g){for(var ge=j.g[ie],De=0;De<ge.length;De++)sl(ge[De]);delete j.g[ie],j.h--}}this.F=null},Jo.prototype.K=function(j,ie,ge,De){return this.i.add(String(j),ie,!1,ge,De)},Jo.prototype.L=function(j,ie,ge,De){return this.i.add(String(j),ie,!0,ge,De)};function Du(j,ie,ge,De){if(ie=j.i.g[String(ie)],!ie)return!0;ie=ie.concat();for(var We=!0,st=0;st<ie.length;++st){var Vt=ie[st];if(Vt&&!Vt.da&&Vt.capture==ge){var fo=Vt.listener,wa=Vt.ha||Vt.src;Vt.fa&&Rf(j.i,Vt),We=fo.call(wa,De)!==!1&&We}}return We&&!De.defaultPrevented}function K1(j,ie,ge){if(typeof j=="function")ge&&(j=I(j,ge));else if(j&&typeof j.handleEvent=="function")j=I(j.handleEvent,j);else throw Error("Invalid listener argument");return 2147483647<Number(ie)?-1:s.setTimeout(j,ie||0)}function Bf(j){j.g=K1(()=>{j.g=null,j.i&&(j.i=!1,Bf(j))},j.l);let ie=j.h;j.h=null,j.m.apply(null,ie)}class MA extends Ii{constructor(ie,ge){super(),this.m=ie,this.l=ge,this.h=null,this.i=!1,this.g=null}j(ie){this.h=arguments,this.g?this.i=!0:Bf(this)}N(){super.N(),this.g&&(s.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Td(j){Ii.call(this),this.h=j,this.g={}}L(Td,Ii);var wu=[];function Bl(j){Ve(j.g,function(ie,ge){this.g.hasOwnProperty(ge)&&Lf(ie)},j),j.g={}}Td.prototype.N=function(){Td.aa.N.call(this),Bl(this)},Td.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Dd=s.JSON.stringify,Z1=s.JSON.parse,X1=class{stringify(j){return s.JSON.stringify(j,void 0)}parse(j){return s.JSON.parse(j,void 0)}};function Q1(){}Q1.prototype.h=null;function Ou(j){return j.h||(j.h=j.i())}function Au(){}var Pu={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Mm(){tn.call(this,"d")}L(Mm,tn);function J1(){tn.call(this,"c")}L(J1,tn);var km={},fr=null;function Ec(){return fr=fr||new Jo}km.La="serverreachability";function kA(j){tn.call(this,km.La,j)}L(kA,tn);function Np(j){let ie=Ec();ra(ie,new kA(ie))}km.STAT_EVENT="statevent";function Vf(j,ie){tn.call(this,km.STAT_EVENT,j),this.stat=ie}L(Vf,tn);function aa(j){let ie=Ec();ra(ie,new Vf(ie,j))}km.Ma="timingevent";function ey(j,ie){tn.call(this,km.Ma,j),this.size=ie}L(ey,tn);function Mu(j,ie){if(typeof j!="function")throw Error("Fn must not be null and must be a function");return s.setTimeout(function(){j()},ie)}function ja(){this.g=!0}ja.prototype.xa=function(){this.g=!1};function Rm(j,ie,ge,De,We,st){j.info(function(){if(j.g)if(st)for(var Vt="",fo=st.split("&"),wa=0;wa<fo.length;wa++){var Ni=fo[wa].split("=");if(1<Ni.length){var $a=Ni[0];Ni=Ni[1];var Ha=$a.split("_");Vt=2<=Ha.length&&Ha[1]=="type"?Vt+($a+"="+Ni+"&"):Vt+($a+"=redacted&")}}else Vt=null;else Vt=st;return"XMLHTTP REQ ("+De+") [attempt "+We+"]: "+ie+`
182
182
  `+ge+`
183
183
  `+Vt})}function RA(j,ie,ge,De,We,st,Vt){j.info(function(){return"XMLHTTP RESP ("+De+") [ attempt "+We+"]: "+ie+`
184
184
  `+ge+`