@snippyly/plugin-staging 1.0.710 → 1.0.712

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snippyly/plugin-staging",
3
- "version": "1.0.710",
3
+ "version": "1.0.712",
4
4
  "description": "",
5
5
  "main": "snippyly.js",
6
6
  "scripts": {
package/snippyly.js CHANGED
@@ -3946,7 +3946,7 @@ class Bl extends Is{}Bl.Encryptor=class extends Bl{processBlock(t,e){const i=t,o
3946
3946
  </div>
3947
3947
  </div>
3948
3948
  </div>
3949
- `}};Lc.styles=Ic,Oc([et({type:String})],Lc.prototype,"apiKey",void 0),Oc([et({type:String})],Lc.prototype,"documentId",void 0),Oc([et({type:Boolean})],Lc.prototype,"disableInvite",void 0),Oc([et({type:Boolean})],Lc.prototype,"hasInviteAccess",void 0),Oc([it()],Lc.prototype,"userType",void 0),Oc([it()],Lc.prototype,"showCheckIcon",void 0),Oc([it()],Lc.prototype,"contactListIsHovered",void 0),Oc([it()],Lc.prototype,"invalidEmail",void 0),Oc([it()],Lc.prototype,"isEmailValid",void 0),Oc([it()],Lc.prototype,"inviting",void 0),Oc([it()],Lc.prototype,"searchingUsers",void 0),Oc([it()],Lc.prototype,"emailInput",void 0),Oc([it()],Lc.prototype,"emailTags",void 0),Oc([it()],Lc.prototype,"editingTag",void 0),Oc([it()],Lc.prototype,"editingInput",void 0),Oc([it()],Lc.prototype,"duplicateEmail",void 0),Oc([it()],Lc.prototype,"filteredContacts",void 0),Oc([ot("#mainInput")],Lc.prototype,"mainInput",void 0),Oc([ot("#editInput")],Lc.prototype,"editInput",void 0),Lc=Oc([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:o}=e;return{kind:i,elements:o,finisher(e){window.customElements.define(t,e)}}})(t,e))("superflow-invite-modal")],Lc);var Ac=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class $c extends Q{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.allFeatureDisabled=!1,this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.staging=Xt,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.showInviteModal=!1,this.subscriptions=[],this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),bc("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t,e;try{const i=await(e=this.apiKey,fo(pc,ne,{timeout:12e5})({eventType:"customLoginEnabled",apiKey:e}));this.customLoginEnabled=!!(null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),bc("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(rc(kt),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),bc("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),bc("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),bc("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),bc("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),bc("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(Ct)&&oc(wt,"true",!1),(null==e?void 0:e.has(It))&&!nc(It)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Nt))if(nc(Nt,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(Ot))if(nc(Ot,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Ot),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;if(e.has(Et)||e.has("snippyly_google_token")){if(e.has(Et)){const t=decodeURIComponent(e.get(Et)),i=lc(t,ee,ie),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=ac(e,ee,ie);oc(kt,i,!0),rc(At)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,oc(xt,JSON.stringify(i),!0)}e.delete(Et),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(wt)?(oc(wt,"true",!1),rc(bt),e.delete(wt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(bt)||nc(wt,!1)&&this.loadPluginUI(),e.has(bt)?(oc(bt,"true",!1),rc(wt),e.delete(bt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(wt)||nc(bt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),bc("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(wt)||t.searchParams.set(wt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),bc("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&oc(_t,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(wt)||t.has(bt))&&t.has(Tt)&&(oc(Mt,Tt,!1,"sessionStorage"),this.projectVersion=t.get(Tt),this.projectVersion&&oc(_t,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),bc("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||nc(Mt,!1,"sessionStorage"),e=this.projectVersion||nc(_t,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),bc("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3);if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;gt.includes(this.apiKey)&&this.listenToDocumentTitleChange();const l=cc();l&&!(null==l?void 0:l.isAnonymous)&&(this.loading=!0);try{this.customerMetadata=await this.getCustomerMetadata()}catch(t){console.warn("Error in getCustomerMetadata: ",t),bc("Error in getCustomerMetadata: ",t)}if(ic(jt)&&(this.isPasswordValid=ic(jt)),nc($t,!0)&&nc(Rt,!0)&&nc(Dt,!0)&&nc(Ft,!0)&&nc(Vt,!0)?(this.guestMode="true"===nc($t,!0),this.allowGuestModeSignIn="true"===nc(Rt,!0),this.passwordProtected="true"===nc(Dt,!0),this.queryParamsComments="true"===nc(Ft,!0),this.usePageTitleAsLocationName="true"===nc(Vt,!0)):(this.projectConfig=await Ec(this.apiKey,this.projectId),this.guestMode=!!(null===(t=this.projectConfig)||void 0===t?void 0:t.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(i=null===(e=this.projectConfig)||void 0===e?void 0:e.guestModeConfig)||void 0===i?void 0:i.allowSignIn),this.queryParamsComments=!!(null===(o=this.projectConfig)||void 0===o?void 0:o.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.usePageTitleAsLocationName),(null===(r=this.projectConfig)||void 0===r?void 0:r.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(a=null===(s=this.projectConfig)||void 0===s?void 0:s.passwordProtected)||void 0===a?void 0:a.enabled),oc($t,this.guestMode+"",!0),oc(Rt,this.allowGuestModeSignIn+"",!0),oc(Dt,this.passwordProtected+"",!0),oc(Ft,this.queryParamsComments+"",!0),oc(Vt,this.usePageTitleAsLocationName+"",!0)),this.loadPlugin=!0,!document.querySelector(Kt.VELT_COMMENTS)){const t=document.createElement(Kt.VELT_COMMENTS);null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(()=>{this.addCommentCount++})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_CURSOR)){const t=document.createElement(Kt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_HUDDLE)){const t=document.createElement(Kt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_RECORDER_NOTES)){const t=document.createElement(Kt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Kt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_ARROWS)){const t=document.createElement(Kt.VELT_ARROWS);window.document.body.appendChild(t)}try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}if(this.staging&&"true"===sessionStorage.getItem("velt-wireframe")){const t=document.createElement("velt-wireframe");t.innerHTML='\n <style>\n .dialog-header-container {\n padding: 12px;\n background: lightcyan;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .dialog-all-comment-container app-comment-dialog-all-comment > div {\n padding: 12px;\n background: lightpink;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-container {\n padding: 12px;\n background: lightgreen;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-block {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n </style>\n\t\t\t\t\t\t<velt-comment-pin-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-pin-container">\n\t\t\t\t\t\t\t\t\t<div style="width: 35px; height: 35px; background-color: blue; border-radius: 12px; border-width: 3px; border-style: solid; border-color: #f00;"></div>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div class="custom-indicator"></div>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>P</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>G</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-index-wireframe></velt-comment-pin-index-wireframe>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-pin-wireframe>\n\n\t\t\t\t\t\t<velt-comment-bubble-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-bubble">\n\t\t\t\t\t\t\t\t<velt-comment-bubble-avatar-wireframe></velt-comment-bubble-avatar-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-bubble-comments-count-wireframe></velt-comment-bubble-comments-count-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-bubble-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-tool-wireframe>\n\t\t\t\t\t\t\t<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t\t<circle cx="50" cy="50" r="40" fill="red" />\n\t\t\t\t\t\t\t\t<rect x="5" y="5" width="90" height="90" fill="blue" fill-opacity="0.5" />\n\t\t\t\t\t\t\t\t<polygon points="50,5 95,95 5,95" fill="yellow" fill-opacity="0.7" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</velt-text-comment-tool-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:violet; display: flex; gap: 8px; border-radius: 12px; padding: 8px; align-items: center;">\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-generic-wireframe><p>GPT</p></velt-text-comment-toolbar-generic-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-seperator-wireframe><p>Seperator</p></velt-text-comment-toolbar-seperator-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-comment-annotation-wireframe><p>Comment</p></velt-text-comment-toolbar-comment-annotation-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-copywriter-wireframe><p>Copywriter</p></velt-text-comment-toolbar-copywriter-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t<velt-comment-sidebar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:lightblue; width: 100%; height: 100%;">\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Header</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Close Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-search-wireframe></velt-comment-sidebar-search-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-status-wireframe></velt-comment-sidebar-status-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Filter Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Filter</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-title-wireframe></velt-comment-sidebar-filter-title-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom CLose filter</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-close-button-wireframe>\n\n\t\t\t\t\t\t\t\t\t<div style="background-color: yellow">\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-location-wireframe></velt-comment-sidebar-filter-location-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-people-wireframe></velt-comment-sidebar-filter-people-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-category-wireframe></velt-comment-sidebar-filter-category-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-priority-wireframe></velt-comment-sidebar-filter-priority-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-comment-type-wireframe></velt-comment-sidebar-filter-comment-type-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-versions-wireframe></velt-comment-sidebar-filter-versions-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-group-by-wireframe></velt-comment-sidebar-filter-group-by-wireframe>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom Done Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-list-wireframe></velt-comment-sidebar-list-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Empty Placeholder</div>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-page-mode-wireframe></velt-comment-sidebar-page-mode-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-sidebar-wireframe>\n <velt-comment-dialog-wireframe variant="dialog">\n <div class="dialog-all-comment-container">\n <velt-comment-dialog-all-comment-wireframe></velt-comment-dialog-all-comment-wireframe>\n </div>\n <div class="dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n <div class="dialog-header-container">\n <velt-comment-dialog-header-wireframe></velt-comment-dialog-header-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n <velt-comment-dialog-wireframe variant="sidebar">\n <div class="sidebar-dialog-header-container">\n <velt-comment-dialog-header-wireframe>\n <div class="sidebar-dialog-header-block">\n <velt-comment-dialog-comment-count-wireframe></velt-comment-dialog-comment-count-wireframe>\n <velt-comment-dialog-status-wireframe></velt-comment-dialog-status-wireframe>\n <div style="flex-grow: 1"></div>\n <velt-comment-dialog-comment-category-wireframe></velt-comment-dialog-comment-category-wireframe>\n <velt-comment-dialog-priority-wireframe></velt-comment-dialog-priority-wireframe>\n </div>\n </velt-comment-dialog-header-wireframe>\n </div>\n <div class="sidebar-dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="sidebar-dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n ',window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),bc("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),2e3))}catch(t){bc("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,i,o,n,r,s,a,l,c,d,h,u,p,v,m,f,g,w,b,y,C,x,E,k,S,M,_,T;try{let I=this.staging?vt:mt;this.staging||ft.includes(this.apiKey)||(I="latest"),this.veltVersion&&(I=this.veltVersion);let N=this.staging,O=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(I=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(N=!1,O=!0)}if(await e(this.apiKey,{options:{develop:N,staging:O,version:I,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Velt)return;if(this.autoTranslation&&(null===Velt||void 0===Velt?void 0:Velt.enableAutoTranslation)&&(null===Velt||void 0===Velt||Velt.enableAutoTranslation()),!document.querySelector(Kt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Kt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Jt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Jt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Velt){null===Velt||void 0===Velt||Velt.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Velt))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/fonts%2Fpoppins%2Fpoppins.css?alt=media&token=5f31a0f2-5f67-4974-bf56-78ae655f2b68",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),bc("Error in loadPoppinsFont: ",t)}})()}if(Velt&&gc({sdkVersion:null===Velt||void 0===Velt?void 0:Velt.version,sdkType:"client"}),this.generateDocumentId(),(null===Velt||void 0===Velt?void 0:Velt.on)&&"function"==typeof(null===Velt||void 0===Velt?void 0:Velt.on)?Velt.on("userUpdate").subscribe((async t=>{t&&await this.setDocumentAndLocation()})):await this.setDocumentAndLocation(),setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3),this.commentElement=null===Velt||void 0===Velt?void 0:Velt.getCommentElement(),this.contactElement=null===Velt||void 0===Velt?void 0:Velt.getContactElement(),this.rewriterElement=null===Velt||void 0===Velt?void 0:Velt.getRewriterElement(),this.presenceElement=null===Velt||void 0===Velt?void 0:Velt.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(i=this.commentElement)||void 0===i?void 0:i.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t,this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!nc(Ut)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),oc(Ut,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!nc(Bt,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),oc(Bt,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(r=this.commentElement)||void 0===r?void 0:r.enableGhostComments)&&this.commentElement.enableGhostComments();const e=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;e&&"object"==typeof e&&(null===(s=this.commentElement)||void 0===s?void 0:s.setCustomStatus)&&this.commentElement.setCustomStatus(e),(null===(a=this.commentElement)||void 0===a?void 0:a.enableMinimap)&&this.commentElement.enableMinimap(),(null===(l=this.commentElement)||void 0===l?void 0:l.setDStrategy)&&(null===(c=this.commentElement)||void 0===c||c.setDStrategy("dynamicId")),(null===(d=this.commentElement)||void 0===d?void 0:d.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(h=this.commentElement)||void 0===h?void 0:h.enableHotkey)&&this.commentElement.enableHotkey(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins(),(null===(m=null===(v=null===(p=this.customerMetadata)||void 0===p?void 0:p.superflow)||void 0===v?void 0:v.advancedFeatures)||void 0===m?void 0:m.takeScreenshotOnComments)?this.commentElement.enableScreenshot&&this.commentElement.enableScreenshot():this.commentElement.disableScreenshot&&this.commentElement.disableScreenshot(),(null===(w=null===(g=null===(f=this.customerMetadata)||void 0===f?void 0:f.superflow)||void 0===g?void 0:g.advancedFeatures)||void 0===w?void 0:w.hasCustomStatus)&&this.setCustomStatuses()}this.selectionElement=Velt.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(b=this.rewriterElement)||void 0===b||b.enableRewriter()),this.presenceElement&&(null===(y=this.presenceElement)||void 0===y?void 0:y.enableFlockMode)&&(null===(C=this.presenceElement)||void 0===C||C.enableFlockMode(!0)),(null===Velt||void 0===Velt?void 0:Velt.getDocElement)&&(this.docElement=Velt.getDocElement()),null===(S=(null===(x=this.docElement)||void 0===x?void 0:x.getDocumentMetadata)?null===(E=this.docElement)||void 0===E?void 0:E.getDocumentMetadata():null===(k=null===Velt||void 0===Velt?void 0:Velt.docService)||void 0===k?void 0:k.getDocumentMetadata$())||void 0===S||S.subscribe((t=>{var e,i;const o=(null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.versions)?Object.values(null===(i=null==t?void 0:t.superflow)||void 0===i?void 0:i.versions):[],n=new URL(document.location).searchParams.get("version");if(n){const t=o.find((t=>t.id===n));t&&(this.version={id:t.id,name:t.versionName||t.id},this.setLocation())}})),(null===Velt||void 0===Velt?void 0:Velt.getViewsElement)&&(this.viewsElement=Velt.getViewsElement()),(null===(M=this.viewsElement)||void 0===M?void 0:M.getUniqueViewsByUser)&&(null===(T=null===(_=this.viewsElement)||void 0===_?void 0:_.getUniqueViewsByUser())||void 0===T||T.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),bc("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=Xl(ec(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=(t=this.documentId+"")?`${Xl(t)}`:void 0}catch(t){console.warn("Error in generateDocumentId: ",t),bc("Error in generateDocumentId: ",t)}var t},this.setDocumentAndLocation=async()=>{try{this.generateDocumentId(),this.previousLocation=null,await(null===Velt||void 0===Velt?void 0:Velt.setDocumentId(this.documentId+"")),gc({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),bc("Error in setDocumentAndLocation: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),bc("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{const t=await(async t=>{try{const e=fo(pc,ne,{timeout:12e5}),i=await e({eventType:"getCustomerMetadata",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey);return(t=>{try{const e=t?JSON.stringify(t):"false";oc(Ht,e)}catch(t){console.warn("Error in setCustomerMetadataToStorage: ",t),bc("Error in setCustomerMetadataToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),bc("Error in getCustomerMetadata: ",t);const e=(()=>{try{const t=nc(Ht);return t?"false"===t?JSON.parse(JSON.stringify(Yt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),bc("Error in getCustomerMetadataFromStorage: ",t),null}})();if(e)return e}},this.setCustomStatuses=async()=>{var t;try{const e=await(async t=>{try{const e=fo(pc,ne,{timeout:12e5}),i=await e({eventType:"customStatus",subEventType:"getOrgStatuses",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getOrgStatuses: ",t),null}})(this.apiKey);if((null==e?void 0:e.success)&&(null==e?void 0:e.data)){const i=Object.values(e.data),o=this.sortCustomStatuses(i);o.length>0&&(null===(t=this.commentElement)||void 0===t?void 0:t.setCustomStatus)&&this.commentElement.setCustomStatus(o)}}catch(t){console.warn("Error in setCustomStatuses: ",t),bc("Error in setCustomStatuses: ",t)}},this.sortCustomStatuses=t=>{try{const e=[...t].sort(((t,e)=>("number"==typeof t.order?t.order:Number.MAX_SAFE_INTEGER)-("number"==typeof e.order?e.order:Number.MAX_SAFE_INTEGER)));return e}catch(e){return console.warn("Error in sortCustomStatuses: ",e),bc("Error in sortCustomStatuses: ",e),t}},this.getSamlConfig=async()=>{try{const t=await(async t=>{var e;try{const i=fo(pc,ne,{timeout:12e5}),o=await i({eventType:"saml",samlEventType:"getPublicConfig",apiKey:t});return null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.publicConfig}catch(t){return console.warn("Error in getSamlPublicConfig: ",t),null}})(this.apiKey);return(t=>{try{if(t){const e=JSON.stringify(t);oc(Gt,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),bc("Error in setSamlConfigToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getSamlConfig: ",t),bc("Error in getSamlConfig: ",t);const e=(()=>{try{const t=nc(Gt,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),bc("Error in getSamlConfigFromStorage: ",t),null}})();if(e)return e}},this.setLogos=()=>{var t,e,i,o,n,r,s,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.customBranding)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==Qt?void 0:Yt)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===r?void 0:r.logoMark,m=null===(l=null===(a=null===(s=this.customerMetadata)||void 0===s?void 0:s.superflow)||void 0===a?void 0:a.customBranding)||void 0===l?void 0:l.wordMark,f=null===(h=null===(d=null===(c=null==Qt?void 0:Yt)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==f?void 0:f.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==f?void 0:f.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),bc("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?A`
3949
+ `}};Lc.styles=Ic,Oc([et({type:String})],Lc.prototype,"apiKey",void 0),Oc([et({type:String})],Lc.prototype,"documentId",void 0),Oc([et({type:Boolean})],Lc.prototype,"disableInvite",void 0),Oc([et({type:Boolean})],Lc.prototype,"hasInviteAccess",void 0),Oc([it()],Lc.prototype,"userType",void 0),Oc([it()],Lc.prototype,"showCheckIcon",void 0),Oc([it()],Lc.prototype,"contactListIsHovered",void 0),Oc([it()],Lc.prototype,"invalidEmail",void 0),Oc([it()],Lc.prototype,"isEmailValid",void 0),Oc([it()],Lc.prototype,"inviting",void 0),Oc([it()],Lc.prototype,"searchingUsers",void 0),Oc([it()],Lc.prototype,"emailInput",void 0),Oc([it()],Lc.prototype,"emailTags",void 0),Oc([it()],Lc.prototype,"editingTag",void 0),Oc([it()],Lc.prototype,"editingInput",void 0),Oc([it()],Lc.prototype,"duplicateEmail",void 0),Oc([it()],Lc.prototype,"filteredContacts",void 0),Oc([ot("#mainInput")],Lc.prototype,"mainInput",void 0),Oc([ot("#editInput")],Lc.prototype,"editInput",void 0),Lc=Oc([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:o}=e;return{kind:i,elements:o,finisher(e){window.customElements.define(t,e)}}})(t,e))("superflow-invite-modal")],Lc);var Ac=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class $c extends Q{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.allFeatureDisabled=!1,this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.staging=Xt,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.showInviteModal=!1,this.subscriptions=[],this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),bc("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t,e;try{const i=await(e=this.apiKey,fo(pc,ne,{timeout:12e5})({eventType:"customLoginEnabled",apiKey:e}));this.customLoginEnabled=!!(null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),bc("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(rc(kt),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),bc("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),bc("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),bc("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),bc("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),bc("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(Ct)&&oc(wt,"true",!1),(null==e?void 0:e.has(It))&&!nc(It)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Nt))if(nc(Nt,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(Ot))if(nc(Ot,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Ot),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;if(e.has(Et)||e.has("snippyly_google_token")){if(e.has(Et)){const t=decodeURIComponent(e.get(Et)),i=lc(t,ee,ie),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=ac(e,ee,ie);oc(kt,i,!0),rc(At)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,oc(xt,JSON.stringify(i),!0)}e.delete(Et),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(wt)?(oc(wt,"true",!1),rc(bt),e.delete(wt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(bt)||nc(wt,!1)&&this.loadPluginUI(),e.has(bt)?(oc(bt,"true",!1),rc(wt),e.delete(bt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(wt)||nc(bt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),bc("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(wt)||t.searchParams.set(wt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),bc("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&oc(_t,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(wt)||t.has(bt))&&t.has(Tt)&&(oc(Mt,Tt,!1,"sessionStorage"),this.projectVersion=t.get(Tt),this.projectVersion&&oc(_t,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),bc("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||nc(Mt,!1,"sessionStorage"),e=this.projectVersion||nc(_t,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),bc("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0})),console.log("Location name changed")}}),4e3);if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;gt.includes(this.apiKey)&&this.listenToDocumentTitleChange();const a=cc();a&&!(null==a?void 0:a.isAnonymous)&&(this.loading=!0);try{this.customerMetadata=await this.getCustomerMetadata()}catch(t){console.warn("Error in getCustomerMetadata: ",t),bc("Error in getCustomerMetadata: ",t)}if(ic(jt)&&(this.isPasswordValid=ic(jt)),nc($t,!0)&&nc(Rt,!0)&&nc(Dt,!0)&&nc(Ft,!0)&&nc(Vt,!0)?(this.guestMode="true"===nc($t,!0),this.allowGuestModeSignIn="true"===nc(Rt,!0),this.passwordProtected="true"===nc(Dt,!0),this.queryParamsComments="true"===nc(Ft,!0)):(this.projectConfig=await Ec(this.apiKey,this.projectId),this.guestMode=!!(null===(t=this.projectConfig)||void 0===t?void 0:t.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(i=null===(e=this.projectConfig)||void 0===e?void 0:e.guestModeConfig)||void 0===i?void 0:i.allowSignIn),this.queryParamsComments=!!(null===(o=this.projectConfig)||void 0===o?void 0:o.queryParamsComments),(null===(n=this.projectConfig)||void 0===n?void 0:n.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(s=null===(r=this.projectConfig)||void 0===r?void 0:r.passwordProtected)||void 0===s?void 0:s.enabled),oc($t,this.guestMode+"",!0),oc(Rt,this.allowGuestModeSignIn+"",!0),oc(Dt,this.passwordProtected+"",!0),oc(Ft,this.queryParamsComments+"",!0)),this.loadPlugin=!0,!document.querySelector(Kt.VELT_COMMENTS)){const t=document.createElement(Kt.VELT_COMMENTS);null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(()=>{this.addCommentCount++})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_CURSOR)){const t=document.createElement(Kt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_HUDDLE)){const t=document.createElement(Kt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_RECORDER_NOTES)){const t=document.createElement(Kt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Kt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_ARROWS)){const t=document.createElement(Kt.VELT_ARROWS);window.document.body.appendChild(t)}try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}if(this.staging&&"true"===sessionStorage.getItem("velt-wireframe")){const t=document.createElement("velt-wireframe");t.innerHTML='\n <style>\n .dialog-header-container {\n padding: 12px;\n background: lightcyan;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .dialog-all-comment-container app-comment-dialog-all-comment > div {\n padding: 12px;\n background: lightpink;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-container {\n padding: 12px;\n background: lightgreen;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-block {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n </style>\n\t\t\t\t\t\t<velt-comment-pin-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-pin-container">\n\t\t\t\t\t\t\t\t\t<div style="width: 35px; height: 35px; background-color: blue; border-radius: 12px; border-width: 3px; border-style: solid; border-color: #f00;"></div>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div class="custom-indicator"></div>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>P</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>G</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-index-wireframe></velt-comment-pin-index-wireframe>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-pin-wireframe>\n\n\t\t\t\t\t\t<velt-comment-bubble-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-bubble">\n\t\t\t\t\t\t\t\t<velt-comment-bubble-avatar-wireframe></velt-comment-bubble-avatar-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-bubble-comments-count-wireframe></velt-comment-bubble-comments-count-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-bubble-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-tool-wireframe>\n\t\t\t\t\t\t\t<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t\t<circle cx="50" cy="50" r="40" fill="red" />\n\t\t\t\t\t\t\t\t<rect x="5" y="5" width="90" height="90" fill="blue" fill-opacity="0.5" />\n\t\t\t\t\t\t\t\t<polygon points="50,5 95,95 5,95" fill="yellow" fill-opacity="0.7" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</velt-text-comment-tool-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:violet; display: flex; gap: 8px; border-radius: 12px; padding: 8px; align-items: center;">\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-generic-wireframe><p>GPT</p></velt-text-comment-toolbar-generic-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-seperator-wireframe><p>Seperator</p></velt-text-comment-toolbar-seperator-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-comment-annotation-wireframe><p>Comment</p></velt-text-comment-toolbar-comment-annotation-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-copywriter-wireframe><p>Copywriter</p></velt-text-comment-toolbar-copywriter-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t<velt-comment-sidebar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:lightblue; width: 100%; height: 100%;">\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Header</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Close Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-search-wireframe></velt-comment-sidebar-search-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-status-wireframe></velt-comment-sidebar-status-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Filter Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Filter</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-title-wireframe></velt-comment-sidebar-filter-title-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom CLose filter</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-close-button-wireframe>\n\n\t\t\t\t\t\t\t\t\t<div style="background-color: yellow">\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-location-wireframe></velt-comment-sidebar-filter-location-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-people-wireframe></velt-comment-sidebar-filter-people-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-category-wireframe></velt-comment-sidebar-filter-category-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-priority-wireframe></velt-comment-sidebar-filter-priority-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-comment-type-wireframe></velt-comment-sidebar-filter-comment-type-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-versions-wireframe></velt-comment-sidebar-filter-versions-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-group-by-wireframe></velt-comment-sidebar-filter-group-by-wireframe>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom Done Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-list-wireframe></velt-comment-sidebar-list-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Empty Placeholder</div>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-page-mode-wireframe></velt-comment-sidebar-page-mode-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-sidebar-wireframe>\n <velt-comment-dialog-wireframe variant="dialog">\n <div class="dialog-all-comment-container">\n <velt-comment-dialog-all-comment-wireframe></velt-comment-dialog-all-comment-wireframe>\n </div>\n <div class="dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n <div class="dialog-header-container">\n <velt-comment-dialog-header-wireframe></velt-comment-dialog-header-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n <velt-comment-dialog-wireframe variant="sidebar">\n <div class="sidebar-dialog-header-container">\n <velt-comment-dialog-header-wireframe>\n <div class="sidebar-dialog-header-block">\n <velt-comment-dialog-comment-count-wireframe></velt-comment-dialog-comment-count-wireframe>\n <velt-comment-dialog-status-wireframe></velt-comment-dialog-status-wireframe>\n <div style="flex-grow: 1"></div>\n <velt-comment-dialog-comment-category-wireframe></velt-comment-dialog-comment-category-wireframe>\n <velt-comment-dialog-priority-wireframe></velt-comment-dialog-priority-wireframe>\n </div>\n </velt-comment-dialog-header-wireframe>\n </div>\n <div class="sidebar-dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="sidebar-dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n ',window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),bc("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),2e3))}catch(t){bc("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,i,o,n,r,s,a,l,c,d,h,u,p,v,m,f,g,w,b,y,C,x,E,k,S,M,_,T;try{let I=this.staging?vt:mt;this.staging||ft.includes(this.apiKey)||(I="latest"),this.veltVersion&&(I=this.veltVersion);let N=this.staging,O=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(I=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(N=!1,O=!0)}if(await e(this.apiKey,{options:{develop:N,staging:O,version:I,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Velt)return;if(this.autoTranslation&&(null===Velt||void 0===Velt?void 0:Velt.enableAutoTranslation)&&(null===Velt||void 0===Velt||Velt.enableAutoTranslation()),!document.querySelector(Kt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Kt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Jt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Jt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Velt){null===Velt||void 0===Velt||Velt.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Velt))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/fonts%2Fpoppins%2Fpoppins.css?alt=media&token=5f31a0f2-5f67-4974-bf56-78ae655f2b68",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),bc("Error in loadPoppinsFont: ",t)}})()}if(Velt&&gc({sdkVersion:null===Velt||void 0===Velt?void 0:Velt.version,sdkType:"client"}),this.generateDocumentId(),(null===Velt||void 0===Velt?void 0:Velt.on)&&"function"==typeof(null===Velt||void 0===Velt?void 0:Velt.on)?Velt.on("userUpdate").subscribe((async t=>{t&&await this.setDocumentAndLocation()})):await this.setDocumentAndLocation(),setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3),this.commentElement=null===Velt||void 0===Velt?void 0:Velt.getCommentElement(),this.contactElement=null===Velt||void 0===Velt?void 0:Velt.getContactElement(),this.rewriterElement=null===Velt||void 0===Velt?void 0:Velt.getRewriterElement(),this.presenceElement=null===Velt||void 0===Velt?void 0:Velt.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(i=this.commentElement)||void 0===i?void 0:i.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t,this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!nc(Ut)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),oc(Ut,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!nc(Bt,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),oc(Bt,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(r=this.commentElement)||void 0===r?void 0:r.enableGhostComments)&&this.commentElement.enableGhostComments();const e=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;e&&"object"==typeof e&&(null===(s=this.commentElement)||void 0===s?void 0:s.setCustomStatus)&&this.commentElement.setCustomStatus(e),(null===(a=this.commentElement)||void 0===a?void 0:a.enableMinimap)&&this.commentElement.enableMinimap(),(null===(l=this.commentElement)||void 0===l?void 0:l.setDStrategy)&&(null===(c=this.commentElement)||void 0===c||c.setDStrategy("dynamicId")),(null===(d=this.commentElement)||void 0===d?void 0:d.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(h=this.commentElement)||void 0===h?void 0:h.enableHotkey)&&this.commentElement.enableHotkey(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins(),(null===(m=null===(v=null===(p=this.customerMetadata)||void 0===p?void 0:p.superflow)||void 0===v?void 0:v.advancedFeatures)||void 0===m?void 0:m.takeScreenshotOnComments)?this.commentElement.enableScreenshot&&this.commentElement.enableScreenshot():this.commentElement.disableScreenshot&&this.commentElement.disableScreenshot(),(null===(w=null===(g=null===(f=this.customerMetadata)||void 0===f?void 0:f.superflow)||void 0===g?void 0:g.advancedFeatures)||void 0===w?void 0:w.hasCustomStatus)&&this.setCustomStatuses(),this.setQueryParamsCommentsInSdk(),this.checkToEnableUpgradeButton()}this.selectionElement=Velt.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(b=this.rewriterElement)||void 0===b||b.enableRewriter()),this.presenceElement&&(null===(y=this.presenceElement)||void 0===y?void 0:y.enableFlockMode)&&(null===(C=this.presenceElement)||void 0===C||C.enableFlockMode(!0)),(null===Velt||void 0===Velt?void 0:Velt.getDocElement)&&(this.docElement=Velt.getDocElement()),null===(S=(null===(x=this.docElement)||void 0===x?void 0:x.getDocumentMetadata)?null===(E=this.docElement)||void 0===E?void 0:E.getDocumentMetadata():null===(k=null===Velt||void 0===Velt?void 0:Velt.docService)||void 0===k?void 0:k.getDocumentMetadata$())||void 0===S||S.subscribe((t=>{var e,i;const o=(null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.versions)?Object.values(null===(i=null==t?void 0:t.superflow)||void 0===i?void 0:i.versions):[],n=new URL(document.location).searchParams.get("version");if(n){const t=o.find((t=>t.id===n));t&&(this.version={id:t.id,name:t.versionName||t.id},this.setLocation())}})),(null===Velt||void 0===Velt?void 0:Velt.getViewsElement)&&(this.viewsElement=Velt.getViewsElement()),(null===(M=this.viewsElement)||void 0===M?void 0:M.getUniqueViewsByUser)&&(null===(T=null===(_=this.viewsElement)||void 0===_?void 0:_.getUniqueViewsByUser())||void 0===T||T.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),bc("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=Xl(ec(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=(t=this.documentId+"")?`${Xl(t)}`:void 0}catch(t){console.warn("Error in generateDocumentId: ",t),bc("Error in generateDocumentId: ",t)}var t},this.setDocumentAndLocation=async()=>{try{this.generateDocumentId(),this.previousLocation=null,await(null===Velt||void 0===Velt?void 0:Velt.setDocumentId(this.documentId+"")),gc({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),bc("Error in setDocumentAndLocation: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),bc("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{const t=await(async t=>{try{const e=fo(pc,ne,{timeout:12e5}),i=await e({eventType:"getCustomerMetadata",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey);return(t=>{try{const e=t?JSON.stringify(t):"false";oc(Ht,e)}catch(t){console.warn("Error in setCustomerMetadataToStorage: ",t),bc("Error in setCustomerMetadataToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),bc("Error in getCustomerMetadata: ",t);const e=(()=>{try{const t=nc(Ht);return t?"false"===t?JSON.parse(JSON.stringify(Yt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),bc("Error in getCustomerMetadataFromStorage: ",t),null}})();if(e)return e}},this.setCustomStatuses=async()=>{var t;try{const e=await(async t=>{try{const e=fo(pc,ne,{timeout:12e5}),i=await e({eventType:"customStatus",subEventType:"getOrgStatuses",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getOrgStatuses: ",t),null}})(this.apiKey);if((null==e?void 0:e.success)&&(null==e?void 0:e.data)){const i=Object.values(e.data),o=this.sortCustomStatuses(i);o.length>0&&(null===(t=this.commentElement)||void 0===t?void 0:t.setCustomStatus)&&this.commentElement.setCustomStatus(o)}}catch(t){console.warn("Error in setCustomStatuses: ",t),bc("Error in setCustomStatuses: ",t)}},this.sortCustomStatuses=t=>{try{const e=[...t].sort(((t,e)=>("number"==typeof t.order?t.order:Number.MAX_SAFE_INTEGER)-("number"==typeof e.order?e.order:Number.MAX_SAFE_INTEGER)));return e}catch(e){return console.warn("Error in sortCustomStatuses: ",e),bc("Error in sortCustomStatuses: ",e),t}},this.getSamlConfig=async()=>{try{const t=await(async t=>{var e;try{const i=fo(pc,ne,{timeout:12e5}),o=await i({eventType:"saml",samlEventType:"getPublicConfig",apiKey:t});return null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.publicConfig}catch(t){return console.warn("Error in getSamlPublicConfig: ",t),null}})(this.apiKey);return(t=>{try{if(t){const e=JSON.stringify(t);oc(Gt,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),bc("Error in setSamlConfigToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getSamlConfig: ",t),bc("Error in getSamlConfig: ",t);const e=(()=>{try{const t=nc(Gt,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),bc("Error in getSamlConfigFromStorage: ",t),null}})();if(e)return e}},this.setLogos=()=>{var t,e,i,o,n,r,s,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.customBranding)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==Qt?void 0:Yt)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===r?void 0:r.logoMark,m=null===(l=null===(a=null===(s=this.customerMetadata)||void 0===s?void 0:s.superflow)||void 0===a?void 0:a.customBranding)||void 0===l?void 0:l.wordMark,f=null===(h=null===(d=null===(c=null==Qt?void 0:Yt)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==f?void 0:f.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==f?void 0:f.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),bc("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?A`
3950
3950
  ${ht(this.logoMark)}
3951
3951
  `:A`
3952
3952
  <img src=${this.logoMark} />
@@ -3954,7 +3954,7 @@ class Bl extends Is{}Bl.Encryptor=class extends Bl{processBlock(t,e){const i=t,o
3954
3954
  ${ht(this.wordMark)}
3955
3955
  `:A`
3956
3956
  <img src=${this.wordMark} />
3957
- `}catch(t){return console.warn("Error in getWordMark: ",t),A``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(wt),e.searchParams.delete(bt),e.searchParams.delete(yt),e.searchParams.delete(Ct),e.searchParams.delete(It),e.searchParams.delete(Nt);const i=t.get(Tt)||this.projectVersion;this.queryParamsComments||(e.search="");let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),bc("Error in removeHashFromUrl: ",e),t}})(e.href);this.projectId&&(o=null==o?void 0:o.replace(window.location.origin,"")),this.location={url:o,version:i}}}catch(t){console.warn("Error in generateLocation: ",t),bc("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Velt&&(null===Velt||void 0===Velt?void 0:Velt.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,!(null==t?void 0:t.forceSetLocation)&&this.previousLocation&&(null===(e=this.previousLocation)||void 0===e?void 0:e.url)===(null===(i=this.location)||void 0===i?void 0:i.url)&&(null===(o=this.previousLocation)||void 0===o?void 0:o.version)===(null===(n=this.location)||void 0===n?void 0:n.version))return;const r=(t=>{try{const e=tc(t);return Xl(JSON.stringify(e))}catch(t){return}})(JSON.parse(JSON.stringify(this.location)));if(r?this.location.id=`${r}`:delete this.location.id,this.usePageTitleAsLocationName){const t=document.title;t&&(this.location.locationName=t)}null===Velt||void 0===Velt||Velt.setLocation(JSON.parse(JSON.stringify(this.location))),gc({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),bc("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),bc("Error in onVeltLocationChange: ",t)}},this.identifySnippyly=async()=>{var t,e;let i="",o="";try{this.invalidApiKey=!1;let e,n={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0,organizationId:this.apiKey};e=this.customLoginEnabled&&this.providedUser?this.providedUser:cc();const r=await this.getSamlConfig(),s=new URL(document.location);if(s.searchParams.has(Et)&&s.searchParams.delete(Et),r&&(this.signInUrl=`${te}saml/${r.slug}/login?redirect_url=${encodeURIComponent(null==s?void 0:s.toString())}&source=sf`,window.Superflow.signInUrl=this.signInUrl),(null==e?void 0:e.email)&&(n=e),n.isAnonymous)delete n.groupId;else{const t=Velt.getDocumentId()||this.serverDocumentId;t&&(n.groupId=t+"")}if(this.customLoginEnabledLocally||(null===(t=null==n?void 0:n.contacts)||void 0===t?void 0:t.length)&&(n.contacts=[]),i=null==n?void 0:n.email,o=null==n?void 0:n.userId,(null==n?void 0:n.isAnonymous)&&this.projectId&&this.guestMode){const t=hc(!0,this.apiKey);t&&(n=JSON.parse(JSON.stringify(t)))}(null==n?void 0:n.isAnonymous)||(this.loading=!0);let a={};(null==n?void 0:n.groupId)&&(a.groupId=null==n?void 0:n.groupId),n.organizationId=this.apiKey;const l=await xc(this.apiKey,this.projectId||"",null==n?void 0:n.email,null==n?void 0:n.userId),c=null==l?void 0:l.isAdmin;this.snippylyUserRole=c?"Admin":"Commenter",c&&(a.isAdmin=c,c&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1));const d=await Velt.setVeltAuthProvider({user:n,options:{throwError:!0},retryConfig:{retryCount:3,retryDelay:1e3},generateToken:async()=>{const t=await(async(t,e,i)=>{var o,n;try{const r=fo(pc,ne,{timeout:12e5}),s=await r({eventType:"generateSuperflowAuthToken",apiKey:t,userId:e,userProperties:i});return null===(n=null===(o=null==s?void 0:s.data)||void 0===o?void 0:o.data)||void 0===n?void 0:n.token}catch(t){return console.warn("Error in generateSuperflowAuthToken: ",t),null}})(this.apiKey,null==n?void 0:n.userId,a);return t},onError:t=>{console.log("Error signing to velt - ",t),this.invalidApiKey=!0}});if(this.invalidApiKey)throw"Invalid Api Key - Domain Not Whitelisted";wc(JSON.parse(JSON.stringify(d||{}))),(null==n?void 0:n.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(n)));const h=JSON.parse(JSON.stringify(d||{}));if((null==h?void 0:h.userSnippylyId)&&!(null==h?void 0:h.isGuest)&&this.checkToMigrateGuestUser(h),Velt.getUserRole$().subscribe((t=>{var e;t&&(this.loading=!1,null===(e=this.commentElement)||void 0===e||e.enablePriority())})),this.contactListSubscription=Velt.getContactElement().getContactList().subscribe((t=>{var e;this.loading=!1,(null===(e=null==t?void 0:t.organizationUsers)||void 0===e?void 0:e.length)>0&&(this.checkPrivateCommentModeFromStorage(),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null))})),(null===Velt||void 0===Velt?void 0:Velt.isPlanExpired$)&&(null===Velt||void 0===Velt||Velt.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),bc("Error in isPlanExpired$: ",t)}))),null===Velt||void 0===Velt?void 0:Velt.on){let t;null===Velt||void 0===Velt||Velt.on("initUpdate").subscribe((e=>{"setDocumentsSuccess"===e.event&&(t&&(t.unsubscribe(),t=null),t=null===Velt||void 0===Velt?void 0:Velt.getDocumentMetadata().subscribe((async t=>{var e,i,o,n;if(t){const r=await Ec(this.apiKey,null==t?void 0:t.clientDocumentId);this.handleFeaturesAccessLevelWithProjectConfig(r),this.queryParamsComments=!!(null===(i=null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.settings)||void 0===i?void 0:i.queryParamsComments),oc(Ft,this.queryParamsComments+"",!0),this.usePageTitleAsLocationName=!!(null===(n=null===(o=null==t?void 0:t.superflow)||void 0===o?void 0:o.settings)||void 0===n?void 0:n.usePageTitleAsLocationName),oc(Vt,this.usePageTitleAsLocationName+"",!0)}}),(t=>{console.warn("Error in getDocumentMetadata: ",t),bc("Error in getDocumentMetadata: ",t)})))}))}gc({clientUserId:null==n?void 0:n.userId});try{(t=>{var e,i,o,n,r,s,a,l,c,d,h,u;const p={properties:{apiKey:null!==(e=null==mc?void 0:mc.apiKey)&&void 0!==e?e:"",name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"",firstName:(null==t?void 0:t.name)?null===(o=null==t?void 0:t.name)||void 0===o?void 0:o.split(" ")[0]:"",lastName:(null==t?void 0:t.name)?null===(n=null==t?void 0:t.name)||void 0===n?void 0:n.split(" ")[1]:"",email:null!==(r=null==t?void 0:t.email)&&void 0!==r?r:"",clientUserId:null!==(s=null==t?void 0:t.userId)&&void 0!==s?s:"",snippylyUserId:null!==(a=null==t?void 0:t.userSnippylyId)&&void 0!==a?a:"",groupId:null!==(l=null==t?void 0:t.groupId)&&void 0!==l?l:"",isOwner:"",plan:"",sdkVersion:null!==(c=null==mc?void 0:mc.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==mc?void 0:mc.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==mc?void 0:mc.sourcePlatform)&&void 0!==h?h:"",website:null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.href},context:{userAgent:null===navigator||void 0===navigator?void 0:navigator.userAgent},userId:null==t?void 0:t.userSnippylyId,sf:!0};Cc("identify",p)})(n)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{nc(Lt)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(console.log("Error",t),this.loading=!1,this.signInError=!0,t&&"string"==typeof t&&(null===(e=null==t?void 0:t.toLowerCase())||void 0===e?void 0:e.includes("invalid"))){this.invalidApiKey=!0,yc(ut.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&(async(t,e)=>{try{const i=fo(pc,ne,{timeout:12e5});await i({eventType:"checkDomainWhitelisted",apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}})(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(It))this.isSigningInUserAdmin=!0;else if(nc(At))this.isSigningInUserAdmin="true"===nc(At,!0);else{const t=await xc(this.apiKey,this.projectId||"",i,o);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),oc(At,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),bc("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=hc(!1,this.apiKey);e&&(await kc(this.apiKey,this.projectId||"",e,t,!0),rc(St))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),bc("Error in checkToMigrationGuestUser: ",t)}},this.getComments=()=>{try{this.commentElement&&(this.commentSubscription&&this.commentSubscription.unsubscribe(),this.commentSubscription=this.commentElement.getAllCommentAnnotations(this.documentId).subscribe((t=>{this.comments=null==t?void 0:t.filter((t=>{var e;return["open","inProgress"].includes(null==t?void 0:t.status)||["default","ongoing"].includes(null===(e=null==t?void 0:t.status)||void 0===e?void 0:e.type)}))})))}catch(t){console.warn("Error in getComments: ",t),bc("Error in getComments: ",t)}},this.setQueryParamsCommentsInSdk=()=>{var t,e,i,o;try{this.commentElement&&(this.queryParamsComments&&(null===(t=this.commentElement)||void 0===t?void 0:t.enableQueryParamsComments)?null===(e=this.commentElement)||void 0===e||e.enableQueryParamsComments():!this.queryParamsComments&&(null===(i=this.commentElement)||void 0===i?void 0:i.disableQueryParamsComments)&&(null===(o=this.commentElement)||void 0===o||o.disableQueryParamsComments()))}catch(t){console.warn("Error in setQueryParamsCommentsInSdk: ",t),bc("Error in setQueryParamsCommentsInSdk: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),bc("Error in checkGlobalUserContact: ",t)}},this.handleFeaturesAccessLevelWithProjectConfig=t=>{var e,i,o,n,r;try{const s="Admin"===this.snippylyUserRole;this.allFeatureDisabled=!s&&(null!==(e=null==t?void 0:t.disabled)&&void 0!==e&&e),this.allFeatureRestricted=null!==(i=null==t?void 0:t.restricted)&&void 0!==i&&i,this.guestMode=null!==(o=null==t?void 0:t.guestMode)&&void 0!==o&&o,this.allowGuestModeSignIn=null!==(r=null===(n=null==t?void 0:t.guestModeConfig)||void 0===n?void 0:n.allowSignIn)&&void 0!==r&&r,this.guestMode&&yc(ut.Events.GUEST_MODE_PRESENT),this.passwordProtected=!1,Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),oc($t,this.guestMode+"",!0),oc(Rt,this.allowGuestModeSignIn+"",!0),oc(Dt,this.passwordProtected+"",!0)}catch(t){console.warn("Error in handleFeaturesAccessLevelWithProjectConfig: ",t),bc("Error in handleFeaturesAccessLevelWithProjectConfig: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?yc(ut.Events.TOOLBAR_EXPANDED):yc(ut.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),bc("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,yc(ut.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,yc(ut.Events.PRIVATE_MODE_ENABLED)),oc(Pt,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),bc("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{this.allFeatureDisabled||"Admin"!==this.snippylyUserRole||nc(Pt)&&(this.privateCommentModeEnabled="true"===nc(Pt),this.privateCommentModeEnabled&&this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),bc("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(yc(ut.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;const t=this.buildSignInUrlWithParams(this.signInUrl||"");window.open(t,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),bc("Error in loginWithGoogle: ",t)}},this.buildSignInUrlWithParams=t=>{try{const e=new URL(t);return this.apiKey&&e.searchParams.set("apiKey",this.apiKey),this.projectId&&e.searchParams.set("projectId",this.projectId),e.toString()}catch(e){return console.warn("Error in buildSignInUrlWithParams: ",e),bc("Error in buildSignInUrlWithParams: ",e),t}},this.getQRCode=async()=>{try{const t=new URL(window.location.href);null==t||t.searchParams.set("review","true");const e=null==t?void 0:t.toString();if(e){const t=ac(e,ee,ie),i=await fetch(`https://us-central1-snipply-sdk-staging.cloudfunctions.net/getqrcode?text=${encodeURIComponent(t)}`),o=await i.json();(null==o?void 0:o.qrcode)&&(this.qrCode=null==o?void 0:o.qrcode)}}catch(t){console.warn("Error in getQRCode: ",t),bc("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{yc(ut.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),bc("Error in toggleQRCodeVisibility: ",t)}},this.onUserInviteToolClick=()=>{var t;(null===(t=this.snippylyUser)||void 0===t?void 0:t.isGuest)?(this.guestModeSignInModalConfig.title="Sign in to invite others.",this.guestModeSignInModalConfig.description="Invite team members to comment on this project.",this.guestModeSignInModalConfig.showLeaveCommentButton=!1,this.guestModeSignInModalConfig.closeOnClickOutside=!0,this.openGuestModeSignInModal()):this.openInviteModal()},this.openInviteModal=()=>{this.showInviteModal=!0,yc(ut.Events.INVITE_MODAL_OPENED)},this.closeInviteModal=()=>{this.showInviteModal=!1},this.onInviteSuccess=()=>{this.closeInviteModal(),yc(ut.Events.INVITE_SENT)},this.removeSnippyly=async()=>{try{yc(ut.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,rc(wt),rc(bt),rc(yt),rc(Mt,"sessionStorage"),rc(_t,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(yt),e.delete(wt),e.delete(Ct),e.delete(bt),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(Tt),e.delete(It),e.delete(Nt),this.projectVersion=void 0,this.projectVersionKey=void 0,delete window.snippylyInitialLoadUrl,window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t),bc("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{yc(ut.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null),await Velt.signOutUser(),rc(xt),rc(kt),rc(At),rc(Pt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),bc("Error in signOutUser: ",t)}},this.toggleMenu=(t,e)=>{try{t.stopPropagation(),this.menuOpenedId===e?this.menuOpenedId=void 0:this.menuOpenedId=e}catch(t){console.warn("Error in toggleMenu: ",t),bc("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t),bc("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${te}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${te}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),yc(ut.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),bc("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${te}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${te}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),bc("Error in goToAdminPortalDashboard: ",t)}},this.joinCommunity=()=>{try{window.open("https://join.slack.com/t/superflowusers/shared_invite/zt-1q3jzsddt-NEb~uu9RXscLfxOIDGQXJw","_blank")}catch(t){console.warn("Error in joinCommunity: ",t),bc("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,oc(It,"true");const t=new URL(document.location);t.searchParams.delete(It),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),bc("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,oc(Nt,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),bc("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Ot),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),bc("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open("https://superflow-portal-staging-2023.web.app/dashboard/billing","_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),bc("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,oc(Lt,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),bc("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{yc(ut.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),bc("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,yc(ut.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),bc("Error in openGuestModeSignInModal: ",t)}},this.closeGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!1,this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig))}catch(t){console.warn("Error in closeGuestModeSignInModal: ",t),bc("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{yc(ut.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),bc("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,yc(ut.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),bc("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),bc("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{yc(ut.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),bc("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{yc(ut.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),bc("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{yc(ut.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),bc("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,yc(ut.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),bc("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),bc("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{yc(ut.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),bc("Error in onGuestModeBannerSignInButtonClick: ",t)}},this.updateGuestUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;const e=hc(!0,this.apiKey);if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,(t=>{try{const e=JSON.stringify(t),i=ac(e,ee,ie);oc(St,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),bc("Error in updateGuestUser: ",t)}})(e),await Velt.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await kc(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,oc(zt,"true"),yc(ut.Events.GUEST_MODE_NAME_ADDED,{oldName:null==t?void 0:t.name,newName:null==e?void 0:e.name})}this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateGuestUserName: ",t),bc("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(yc(ut.Events.REVIEW_PASSWORD_ADDED),!(null===(t=this.password)||void 0===t?void 0:t.trim()))return;if(this.validatingPasswordLoading)return;this.validatingPasswordLoading=!0,this.isPasswordValid=await(async(t,e,i)=>{var o;try{const n=fo(pc,ne,{timeout:12e5}),r=await n({eventType:"validatePassword",apiKey:t,projectId:e,password:i});return null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in validatePassword: ",t),null}})(this.apiKey,this.projectId,this.password),function(t,e){try{const i="object"==typeof e?JSON.stringify(e):e;localStorage.setItem(t,i)}catch(t){console.warn("Error in setLocalStorage: ",t)}}(jt,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),yc(ut.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,yc(ut.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),bc("Error in submitPassword: ",t)}},this.updateUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;this.guestUserNameUpdateLoading=!0;const e=JSON.parse(JSON.stringify(this.snippylyUser)),i=JSON.parse(JSON.stringify(this.snippylyUser));i.name=this.guestUserNameInput,await kc(this.apiKey,this.projectId||"",e,i),await Velt.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=cc();o.name=i.name;const n=JSON.stringify(o),r=ac(n,ee,ie);oc(kt,r,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),bc("Error in updateUserName: ",t)}},this.disableCommentMode=()=>{var t;try{(null===(t=this.commentElement)||void 0===t?void 0:t.disableCommentMode)&&this.commentElement.disableCommentMode()}catch(t){console.warn("Error in disableAddCommentMode: ",t),bc("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?A`
3957
+ `}catch(t){return console.warn("Error in getWordMark: ",t),A``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(wt),e.searchParams.delete(bt),e.searchParams.delete(yt),e.searchParams.delete(Ct),e.searchParams.delete(It),e.searchParams.delete(Nt);const i=t.get(Tt)||this.projectVersion;this.queryParamsComments||(e.search="");let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),bc("Error in removeHashFromUrl: ",e),t}})(e.href);this.projectId&&(o=null==o?void 0:o.replace(window.location.origin,"")),this.location={url:o,version:i}}}catch(t){console.warn("Error in generateLocation: ",t),bc("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Velt&&(null===Velt||void 0===Velt?void 0:Velt.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,!(null==t?void 0:t.forceSetLocation)&&this.previousLocation&&(null===(e=this.previousLocation)||void 0===e?void 0:e.url)===(null===(i=this.location)||void 0===i?void 0:i.url)&&(null===(o=this.previousLocation)||void 0===o?void 0:o.version)===(null===(n=this.location)||void 0===n?void 0:n.version))return;const r=(t=>{try{const e=tc(t);return Xl(JSON.stringify(e))}catch(t){return}})(JSON.parse(JSON.stringify(this.location)));if(r?this.location.id=`${r}`:delete this.location.id,this.usePageTitleAsLocationName){const t=document.title;t&&(this.location.locationName=t)}null===Velt||void 0===Velt||Velt.setLocation(JSON.parse(JSON.stringify(this.location))),gc({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),bc("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),bc("Error in onVeltLocationChange: ",t)}},this.identifySnippyly=async()=>{var t,e;let i="",o="";try{this.invalidApiKey=!1;let e,n={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0,organizationId:this.apiKey};e=this.customLoginEnabled&&this.providedUser?this.providedUser:cc();const r=await this.getSamlConfig(),s=new URL(document.location);if(s.searchParams.has(Et)&&s.searchParams.delete(Et),r&&(this.signInUrl=`${te}saml/${r.slug}/login?redirect_url=${encodeURIComponent(null==s?void 0:s.toString())}&source=sf`,window.Superflow.signInUrl=this.signInUrl),(null==e?void 0:e.email)&&(n=e),n.isAnonymous)delete n.groupId;else{const t=Velt.getDocumentId()||this.serverDocumentId;t&&(n.groupId=t+"")}if(this.customLoginEnabledLocally||(null===(t=null==n?void 0:n.contacts)||void 0===t?void 0:t.length)&&(n.contacts=[]),i=null==n?void 0:n.email,o=null==n?void 0:n.userId,(null==n?void 0:n.isAnonymous)&&this.projectId&&this.guestMode){const t=hc(!0,this.apiKey);t&&(n=JSON.parse(JSON.stringify(t)))}(null==n?void 0:n.isAnonymous)||(this.loading=!0);let a={};(null==n?void 0:n.groupId)&&(a.groupId=null==n?void 0:n.groupId),n.organizationId=this.apiKey;const l=await xc(this.apiKey,this.projectId||"",null==n?void 0:n.email,null==n?void 0:n.userId),c=null==l?void 0:l.isAdmin;this.snippylyUserRole=c?"Admin":"Commenter",c&&(a.isAdmin=c,c&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1));const d=await Velt.setVeltAuthProvider({user:n,options:{throwError:!0},retryConfig:{retryCount:3,retryDelay:1e3},generateToken:async()=>{const t=await(async(t,e,i)=>{var o,n;try{const r=fo(pc,ne,{timeout:12e5}),s=await r({eventType:"generateSuperflowAuthToken",apiKey:t,userId:e,userProperties:i});return null===(n=null===(o=null==s?void 0:s.data)||void 0===o?void 0:o.data)||void 0===n?void 0:n.token}catch(t){return console.warn("Error in generateSuperflowAuthToken: ",t),null}})(this.apiKey,null==n?void 0:n.userId,a);return t},onError:t=>{console.log("Error signing to velt - ",t),this.invalidApiKey=!0}});if(this.invalidApiKey)throw"Invalid Api Key - Domain Not Whitelisted";wc(JSON.parse(JSON.stringify(d||{}))),(null==n?void 0:n.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(n)));const h=JSON.parse(JSON.stringify(d||{}));if((null==h?void 0:h.userSnippylyId)&&!(null==h?void 0:h.isGuest)&&this.checkToMigrateGuestUser(h),Velt.getUserRole$().subscribe((t=>{var e;t&&(this.loading=!1,null===(e=this.commentElement)||void 0===e||e.enablePriority())})),this.contactListSubscription=Velt.getContactElement().getContactList().subscribe((t=>{var e;this.loading=!1,(null===(e=null==t?void 0:t.organizationUsers)||void 0===e?void 0:e.length)>0&&(this.checkPrivateCommentModeFromStorage(),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null))})),(null===Velt||void 0===Velt?void 0:Velt.isPlanExpired$)&&(null===Velt||void 0===Velt||Velt.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),bc("Error in isPlanExpired$: ",t)}))),null===Velt||void 0===Velt?void 0:Velt.on){let t;null===Velt||void 0===Velt||Velt.on("initUpdate").subscribe((e=>{"setDocumentsSuccess"===e.event&&(t&&(t.unsubscribe(),t=null),t=null===Velt||void 0===Velt?void 0:Velt.getDocumentMetadata().subscribe((async t=>{var e,i,o,n;if(t){const r=await Ec(this.apiKey,null==t?void 0:t.clientDocumentId);this.handleFeaturesAccessLevelWithProjectConfig(r),this.queryParamsComments=!!(null===(i=null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.settings)||void 0===i?void 0:i.queryParamsComments),oc(Ft,this.queryParamsComments+"",!0),this.usePageTitleAsLocationName=!!(null===(n=null===(o=null==t?void 0:t.superflow)||void 0===o?void 0:o.settings)||void 0===n?void 0:n.usePageTitleAsLocationName),console.log("usePageTitleAsLocationName",this.usePageTitleAsLocationName),oc(Vt,this.usePageTitleAsLocationName+"",!0)}}),(t=>{console.warn("Error in getDocumentMetadata: ",t),bc("Error in getDocumentMetadata: ",t)})))}))}gc({clientUserId:null==n?void 0:n.userId});try{(t=>{var e,i,o,n,r,s,a,l,c,d,h,u;const p={properties:{apiKey:null!==(e=null==mc?void 0:mc.apiKey)&&void 0!==e?e:"",name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"",firstName:(null==t?void 0:t.name)?null===(o=null==t?void 0:t.name)||void 0===o?void 0:o.split(" ")[0]:"",lastName:(null==t?void 0:t.name)?null===(n=null==t?void 0:t.name)||void 0===n?void 0:n.split(" ")[1]:"",email:null!==(r=null==t?void 0:t.email)&&void 0!==r?r:"",clientUserId:null!==(s=null==t?void 0:t.userId)&&void 0!==s?s:"",snippylyUserId:null!==(a=null==t?void 0:t.userSnippylyId)&&void 0!==a?a:"",groupId:null!==(l=null==t?void 0:t.groupId)&&void 0!==l?l:"",isOwner:"",plan:"",sdkVersion:null!==(c=null==mc?void 0:mc.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==mc?void 0:mc.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==mc?void 0:mc.sourcePlatform)&&void 0!==h?h:"",website:null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.href},context:{userAgent:null===navigator||void 0===navigator?void 0:navigator.userAgent},userId:null==t?void 0:t.userSnippylyId,sf:!0};Cc("identify",p)})(n)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{nc(Lt)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(console.log("Error",t),this.loading=!1,this.signInError=!0,t&&"string"==typeof t&&(null===(e=null==t?void 0:t.toLowerCase())||void 0===e?void 0:e.includes("invalid"))){this.invalidApiKey=!0,yc(ut.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&(async(t,e)=>{try{const i=fo(pc,ne,{timeout:12e5});await i({eventType:"checkDomainWhitelisted",apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}})(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(It))this.isSigningInUserAdmin=!0;else if(nc(At))this.isSigningInUserAdmin="true"===nc(At,!0);else{const t=await xc(this.apiKey,this.projectId||"",i,o);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),oc(At,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),bc("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=hc(!1,this.apiKey);e&&(await kc(this.apiKey,this.projectId||"",e,t,!0),rc(St))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),bc("Error in checkToMigrationGuestUser: ",t)}},this.getComments=()=>{try{this.commentElement&&(this.commentSubscription&&this.commentSubscription.unsubscribe(),this.commentSubscription=this.commentElement.getAllCommentAnnotations(this.documentId).subscribe((t=>{this.comments=null==t?void 0:t.filter((t=>{var e;return["open","inProgress"].includes(null==t?void 0:t.status)||["default","ongoing"].includes(null===(e=null==t?void 0:t.status)||void 0===e?void 0:e.type)}))})))}catch(t){console.warn("Error in getComments: ",t),bc("Error in getComments: ",t)}},this.setQueryParamsCommentsInSdk=()=>{var t,e,i,o,n;try{console.log("setQueryParamsCommentsInSdk commentElement",this.commentElement),this.commentElement&&(console.log("setQueryParamsCommentsInSdk queryParamsComments",this.queryParamsComments),this.queryParamsComments&&(null===(t=this.commentElement)||void 0===t?void 0:t.enableQueryParamsComments)?(console.log("enableQueryParamsComments this.commentElement?.enableQueryParamsComments",null===(e=this.commentElement)||void 0===e?void 0:e.enableQueryParamsComments),null===(i=this.commentElement)||void 0===i||i.enableQueryParamsComments()):!this.queryParamsComments&&(null===(o=this.commentElement)||void 0===o?void 0:o.disableQueryParamsComments)&&(console.log("disableQueryParamsComments"),null===(n=this.commentElement)||void 0===n||n.disableQueryParamsComments()))}catch(t){console.warn("Error in setQueryParamsCommentsInSdk: ",t),bc("Error in setQueryParamsCommentsInSdk: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),bc("Error in checkGlobalUserContact: ",t)}},this.handleFeaturesAccessLevelWithProjectConfig=t=>{var e,i,o,n,r;try{const s="Admin"===this.snippylyUserRole;this.allFeatureDisabled=!s&&(null!==(e=null==t?void 0:t.disabled)&&void 0!==e&&e),this.allFeatureRestricted=null!==(i=null==t?void 0:t.restricted)&&void 0!==i&&i,this.guestMode=null!==(o=null==t?void 0:t.guestMode)&&void 0!==o&&o,this.allowGuestModeSignIn=null!==(r=null===(n=null==t?void 0:t.guestModeConfig)||void 0===n?void 0:n.allowSignIn)&&void 0!==r&&r,this.guestMode&&yc(ut.Events.GUEST_MODE_PRESENT),this.passwordProtected=!1,Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),oc($t,this.guestMode+"",!0),oc(Rt,this.allowGuestModeSignIn+"",!0),oc(Dt,this.passwordProtected+"",!0)}catch(t){console.warn("Error in handleFeaturesAccessLevelWithProjectConfig: ",t),bc("Error in handleFeaturesAccessLevelWithProjectConfig: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?yc(ut.Events.TOOLBAR_EXPANDED):yc(ut.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),bc("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,yc(ut.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,yc(ut.Events.PRIVATE_MODE_ENABLED)),oc(Pt,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),bc("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{this.allFeatureDisabled||"Admin"!==this.snippylyUserRole||nc(Pt)&&(this.privateCommentModeEnabled="true"===nc(Pt),this.privateCommentModeEnabled&&this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),bc("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(yc(ut.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;const t=this.buildSignInUrlWithParams(this.signInUrl||"");window.open(t,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),bc("Error in loginWithGoogle: ",t)}},this.buildSignInUrlWithParams=t=>{try{const e=new URL(t);return this.apiKey&&e.searchParams.set("apiKey",this.apiKey),this.projectId&&e.searchParams.set("projectId",this.projectId),e.toString()}catch(e){return console.warn("Error in buildSignInUrlWithParams: ",e),bc("Error in buildSignInUrlWithParams: ",e),t}},this.getQRCode=async()=>{try{const t=new URL(window.location.href);null==t||t.searchParams.set("review","true");const e=null==t?void 0:t.toString();if(e){const t=ac(e,ee,ie),i=await fetch(`https://us-central1-snipply-sdk-staging.cloudfunctions.net/getqrcode?text=${encodeURIComponent(t)}`),o=await i.json();(null==o?void 0:o.qrcode)&&(this.qrCode=null==o?void 0:o.qrcode)}}catch(t){console.warn("Error in getQRCode: ",t),bc("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{yc(ut.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),bc("Error in toggleQRCodeVisibility: ",t)}},this.onUserInviteToolClick=()=>{var t;(null===(t=this.snippylyUser)||void 0===t?void 0:t.isGuest)?(this.guestModeSignInModalConfig.title="Sign in to invite others.",this.guestModeSignInModalConfig.description="Invite team members to comment on this project.",this.guestModeSignInModalConfig.showLeaveCommentButton=!1,this.guestModeSignInModalConfig.closeOnClickOutside=!0,this.openGuestModeSignInModal()):this.openInviteModal()},this.openInviteModal=()=>{this.showInviteModal=!0,yc(ut.Events.INVITE_MODAL_OPENED)},this.closeInviteModal=()=>{this.showInviteModal=!1},this.onInviteSuccess=()=>{this.closeInviteModal(),yc(ut.Events.INVITE_SENT)},this.removeSnippyly=async()=>{try{yc(ut.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,rc(wt),rc(bt),rc(yt),rc(Mt,"sessionStorage"),rc(_t,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(yt),e.delete(wt),e.delete(Ct),e.delete(bt),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(Tt),e.delete(It),e.delete(Nt),this.projectVersion=void 0,this.projectVersionKey=void 0,delete window.snippylyInitialLoadUrl,window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t),bc("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{yc(ut.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null),await Velt.signOutUser(),rc(xt),rc(kt),rc(At),rc(Pt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),bc("Error in signOutUser: ",t)}},this.toggleMenu=(t,e)=>{try{t.stopPropagation(),this.menuOpenedId===e?this.menuOpenedId=void 0:this.menuOpenedId=e}catch(t){console.warn("Error in toggleMenu: ",t),bc("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t),bc("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${te}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${te}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),yc(ut.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),bc("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${te}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${te}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),bc("Error in goToAdminPortalDashboard: ",t)}},this.joinCommunity=()=>{try{window.open("https://join.slack.com/t/superflowusers/shared_invite/zt-1q3jzsddt-NEb~uu9RXscLfxOIDGQXJw","_blank")}catch(t){console.warn("Error in joinCommunity: ",t),bc("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,oc(It,"true");const t=new URL(document.location);t.searchParams.delete(It),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),bc("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,oc(Nt,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),bc("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Ot),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),bc("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open("https://superflow-portal-staging-2023.web.app/dashboard/billing","_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),bc("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,oc(Lt,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),bc("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{yc(ut.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),bc("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,yc(ut.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),bc("Error in openGuestModeSignInModal: ",t)}},this.closeGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!1,this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig))}catch(t){console.warn("Error in closeGuestModeSignInModal: ",t),bc("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{yc(ut.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),bc("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,yc(ut.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),bc("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),bc("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{yc(ut.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),bc("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{yc(ut.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),bc("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{yc(ut.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),bc("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,yc(ut.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),bc("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),bc("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{yc(ut.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),bc("Error in onGuestModeBannerSignInButtonClick: ",t)}},this.updateGuestUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;const e=hc(!0,this.apiKey);if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,(t=>{try{const e=JSON.stringify(t),i=ac(e,ee,ie);oc(St,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),bc("Error in updateGuestUser: ",t)}})(e),await Velt.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await kc(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,oc(zt,"true"),yc(ut.Events.GUEST_MODE_NAME_ADDED,{oldName:null==t?void 0:t.name,newName:null==e?void 0:e.name})}this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateGuestUserName: ",t),bc("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(yc(ut.Events.REVIEW_PASSWORD_ADDED),!(null===(t=this.password)||void 0===t?void 0:t.trim()))return;if(this.validatingPasswordLoading)return;this.validatingPasswordLoading=!0,this.isPasswordValid=await(async(t,e,i)=>{var o;try{const n=fo(pc,ne,{timeout:12e5}),r=await n({eventType:"validatePassword",apiKey:t,projectId:e,password:i});return null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in validatePassword: ",t),null}})(this.apiKey,this.projectId,this.password),function(t,e){try{const i="object"==typeof e?JSON.stringify(e):e;localStorage.setItem(t,i)}catch(t){console.warn("Error in setLocalStorage: ",t)}}(jt,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),yc(ut.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,yc(ut.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),bc("Error in submitPassword: ",t)}},this.updateUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;this.guestUserNameUpdateLoading=!0;const e=JSON.parse(JSON.stringify(this.snippylyUser)),i=JSON.parse(JSON.stringify(this.snippylyUser));i.name=this.guestUserNameInput,await kc(this.apiKey,this.projectId||"",e,i),await Velt.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=cc();o.name=i.name;const n=JSON.stringify(o),r=ac(n,ee,ie);oc(kt,r,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),bc("Error in updateUserName: ",t)}},this.disableCommentMode=()=>{var t;try{(null===(t=this.commentElement)||void 0===t?void 0:t.disableCommentMode)&&this.commentElement.disableCommentMode()}catch(t){console.warn("Error in disableAddCommentMode: ",t),bc("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?A`
3958
3958
  <div class="disable-add-comment-button" @click=${()=>this.disableCommentMode()}>
3959
3959
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
3960
3960
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3.52861 3.52858C3.78896 3.26823 4.21107 3.26823 4.47141 3.52858L8.00001 7.05717L11.5286 3.52858C11.789 3.26823 12.2111 3.26823 12.4714 3.52858C12.7318 3.78892 12.7318 4.21103 12.4714 4.47138L8.94282 7.99998L12.4714 11.5286C12.7318 11.7889 12.7318 12.211 12.4714 12.4714C12.2111 12.7317 11.789 12.7317 11.5286 12.4714L8.00001 8.94279L4.47141 12.4714C4.21107 12.7317 3.78896 12.7317 3.52861 12.4714C3.26826 12.211 3.26826 11.7889 3.52861 11.5286L7.0572 7.99998L3.52861 4.47138C3.26826 4.21103 3.26826 3.78892 3.52861 3.52858Z" fill="#FAFBFF"/>
package/snippyly.min.js CHANGED
@@ -3946,7 +3946,7 @@ class Hl extends Ns{}Hl.Encryptor=class extends Hl{processBlock(t,e){const i=t,o
3946
3946
  </div>
3947
3947
  </div>
3948
3948
  </div>
3949
- `}};Ac.styles=Nc,Lc([it({type:String})],Ac.prototype,"apiKey",void 0),Lc([it({type:String})],Ac.prototype,"documentId",void 0),Lc([it({type:Boolean})],Ac.prototype,"disableInvite",void 0),Lc([it({type:Boolean})],Ac.prototype,"hasInviteAccess",void 0),Lc([ot()],Ac.prototype,"userType",void 0),Lc([ot()],Ac.prototype,"showCheckIcon",void 0),Lc([ot()],Ac.prototype,"contactListIsHovered",void 0),Lc([ot()],Ac.prototype,"invalidEmail",void 0),Lc([ot()],Ac.prototype,"isEmailValid",void 0),Lc([ot()],Ac.prototype,"inviting",void 0),Lc([ot()],Ac.prototype,"searchingUsers",void 0),Lc([ot()],Ac.prototype,"emailInput",void 0),Lc([ot()],Ac.prototype,"emailTags",void 0),Lc([ot()],Ac.prototype,"editingTag",void 0),Lc([ot()],Ac.prototype,"editingInput",void 0),Lc([ot()],Ac.prototype,"duplicateEmail",void 0),Lc([ot()],Ac.prototype,"filteredContacts",void 0),Lc([nt("#mainInput")],Ac.prototype,"mainInput",void 0),Lc([nt("#editInput")],Ac.prototype,"editInput",void 0),Ac=Lc([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:o}=e;return{kind:i,elements:o,finisher(e){window.customElements.define(t,e)}}})(t,e))("superflow-invite-modal")],Ac);var $c=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Dc extends X{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.allFeatureDisabled=!1,this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.staging=te,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.showInviteModal=!1,this.subscriptions=[],this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),yc("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t,e;try{const i=await(e=this.apiKey,go(vc,re,{timeout:12e5})({eventType:"customLoginEnabled",apiKey:e}));this.customLoginEnabled=!!(null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),yc("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(sc(St),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),yc("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),yc("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),yc("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),yc("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),yc("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(xt)&&nc(bt,"true",!1),(null==e?void 0:e.has(Nt))&&!rc(Nt)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Ot))if(rc(Ot,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Ot),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(Lt))if(rc(Lt,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Lt),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;if(e.has(kt)||e.has("snippyly_google_token")){if(e.has(kt)){const t=decodeURIComponent(e.get(kt)),i=cc(t,ie,oe),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=lc(e,ie,oe);nc(St,i,!0),sc($t)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,nc(Et,JSON.stringify(i),!0)}e.delete(kt),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(bt)?(nc(bt,"true",!1),sc(yt),e.delete(bt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(yt)||rc(bt,!1)&&this.loadPluginUI(),e.has(yt)?(nc(yt,"true",!1),sc(bt),e.delete(yt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(bt)||rc(yt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),yc("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(bt)||t.searchParams.set(bt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),yc("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&nc(Tt,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(bt)||t.has(yt))&&t.has(It)&&(nc(_t,It,!1,"sessionStorage"),this.projectVersion=t.get(It),this.projectVersion&&nc(Tt,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),yc("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||rc(_t,!1,"sessionStorage"),e=this.projectVersion||rc(Tt,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),yc("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3);if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;wt.includes(this.apiKey)&&this.listenToDocumentTitleChange();const l=dc();l&&!(null==l?void 0:l.isAnonymous)&&(this.loading=!0);try{this.customerMetadata=await this.getCustomerMetadata()}catch(t){console.warn("Error in getCustomerMetadata: ",t),yc("Error in getCustomerMetadata: ",t)}if(oc(Pt)&&(this.isPasswordValid=oc(Pt)),rc(Dt,!0)&&rc(Ut,!0)&&rc(Ft,!0)&&rc(Vt,!0)&&rc(jt,!0)?(this.guestMode="true"===rc(Dt,!0),this.allowGuestModeSignIn="true"===rc(Ut,!0),this.passwordProtected="true"===rc(Ft,!0),this.queryParamsComments="true"===rc(Vt,!0),this.usePageTitleAsLocationName="true"===rc(jt,!0)):(this.projectConfig=await kc(this.apiKey,this.projectId),this.guestMode=!!(null===(t=this.projectConfig)||void 0===t?void 0:t.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(i=null===(e=this.projectConfig)||void 0===e?void 0:e.guestModeConfig)||void 0===i?void 0:i.allowSignIn),this.queryParamsComments=!!(null===(o=this.projectConfig)||void 0===o?void 0:o.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.usePageTitleAsLocationName),(null===(r=this.projectConfig)||void 0===r?void 0:r.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(a=null===(s=this.projectConfig)||void 0===s?void 0:s.passwordProtected)||void 0===a?void 0:a.enabled),nc(Dt,this.guestMode+"",!0),nc(Ut,this.allowGuestModeSignIn+"",!0),nc(Ft,this.passwordProtected+"",!0),nc(Vt,this.queryParamsComments+"",!0),nc(jt,this.usePageTitleAsLocationName+"",!0)),this.loadPlugin=!0,!document.querySelector(Jt.VELT_COMMENTS)){const t=document.createElement(Jt.VELT_COMMENTS);null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(()=>{this.addCommentCount++})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!document.querySelector(Jt.VELT_CURSOR)){const t=document.createElement(Jt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Jt.VELT_HUDDLE)){const t=document.createElement(Jt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Jt.VELT_RECORDER_NOTES)){const t=document.createElement(Jt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Jt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Jt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Jt.VELT_ARROWS)){const t=document.createElement(Jt.VELT_ARROWS);window.document.body.appendChild(t)}try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}if(this.staging&&"true"===sessionStorage.getItem("velt-wireframe")){const t=document.createElement("velt-wireframe");t.innerHTML='\n <style>\n .dialog-header-container {\n padding: 12px;\n background: lightcyan;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .dialog-all-comment-container app-comment-dialog-all-comment > div {\n padding: 12px;\n background: lightpink;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-container {\n padding: 12px;\n background: lightgreen;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-block {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n </style>\n\t\t\t\t\t\t<velt-comment-pin-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-pin-container">\n\t\t\t\t\t\t\t\t\t<div style="width: 35px; height: 35px; background-color: blue; border-radius: 12px; border-width: 3px; border-style: solid; border-color: #f00;"></div>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div class="custom-indicator"></div>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>P</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>G</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-index-wireframe></velt-comment-pin-index-wireframe>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-pin-wireframe>\n\n\t\t\t\t\t\t<velt-comment-bubble-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-bubble">\n\t\t\t\t\t\t\t\t<velt-comment-bubble-avatar-wireframe></velt-comment-bubble-avatar-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-bubble-comments-count-wireframe></velt-comment-bubble-comments-count-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-bubble-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-tool-wireframe>\n\t\t\t\t\t\t\t<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t\t<circle cx="50" cy="50" r="40" fill="red" />\n\t\t\t\t\t\t\t\t<rect x="5" y="5" width="90" height="90" fill="blue" fill-opacity="0.5" />\n\t\t\t\t\t\t\t\t<polygon points="50,5 95,95 5,95" fill="yellow" fill-opacity="0.7" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</velt-text-comment-tool-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:violet; display: flex; gap: 8px; border-radius: 12px; padding: 8px; align-items: center;">\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-generic-wireframe><p>GPT</p></velt-text-comment-toolbar-generic-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-seperator-wireframe><p>Seperator</p></velt-text-comment-toolbar-seperator-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-comment-annotation-wireframe><p>Comment</p></velt-text-comment-toolbar-comment-annotation-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-copywriter-wireframe><p>Copywriter</p></velt-text-comment-toolbar-copywriter-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t<velt-comment-sidebar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:lightblue; width: 100%; height: 100%;">\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Header</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Close Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-search-wireframe></velt-comment-sidebar-search-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-status-wireframe></velt-comment-sidebar-status-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Filter Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Filter</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-title-wireframe></velt-comment-sidebar-filter-title-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom CLose filter</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-close-button-wireframe>\n\n\t\t\t\t\t\t\t\t\t<div style="background-color: yellow">\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-location-wireframe></velt-comment-sidebar-filter-location-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-people-wireframe></velt-comment-sidebar-filter-people-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-category-wireframe></velt-comment-sidebar-filter-category-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-priority-wireframe></velt-comment-sidebar-filter-priority-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-comment-type-wireframe></velt-comment-sidebar-filter-comment-type-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-versions-wireframe></velt-comment-sidebar-filter-versions-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-group-by-wireframe></velt-comment-sidebar-filter-group-by-wireframe>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom Done Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-list-wireframe></velt-comment-sidebar-list-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Empty Placeholder</div>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-page-mode-wireframe></velt-comment-sidebar-page-mode-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-sidebar-wireframe>\n <velt-comment-dialog-wireframe variant="dialog">\n <div class="dialog-all-comment-container">\n <velt-comment-dialog-all-comment-wireframe></velt-comment-dialog-all-comment-wireframe>\n </div>\n <div class="dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n <div class="dialog-header-container">\n <velt-comment-dialog-header-wireframe></velt-comment-dialog-header-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n <velt-comment-dialog-wireframe variant="sidebar">\n <div class="sidebar-dialog-header-container">\n <velt-comment-dialog-header-wireframe>\n <div class="sidebar-dialog-header-block">\n <velt-comment-dialog-comment-count-wireframe></velt-comment-dialog-comment-count-wireframe>\n <velt-comment-dialog-status-wireframe></velt-comment-dialog-status-wireframe>\n <div style="flex-grow: 1"></div>\n <velt-comment-dialog-comment-category-wireframe></velt-comment-dialog-comment-category-wireframe>\n <velt-comment-dialog-priority-wireframe></velt-comment-dialog-priority-wireframe>\n </div>\n </velt-comment-dialog-header-wireframe>\n </div>\n <div class="sidebar-dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="sidebar-dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n ',window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),yc("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),2e3))}catch(t){yc("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,e,o,n,r,s,a,l,c,d,h,u,p,v,m,f,g,w,b,y,C,x,E,k,S,M,_,T;try{let I=this.staging?mt:ft;this.staging||gt.includes(this.apiKey)||(I="latest"),this.veltVersion&&(I=this.veltVersion);let N=this.staging,O=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(I=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(N=!1,O=!0)}if(await i(this.apiKey,{options:{develop:N,staging:O,version:I,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Velt)return;if(this.autoTranslation&&(null===Velt||void 0===Velt?void 0:Velt.enableAutoTranslation)&&(null===Velt||void 0===Velt||Velt.enableAutoTranslation()),!document.querySelector(Jt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Jt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Yt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Yt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Velt){null===Velt||void 0===Velt||Velt.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Velt))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/fonts%2Fpoppins%2Fpoppins.css?alt=media&token=5f31a0f2-5f67-4974-bf56-78ae655f2b68",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),yc("Error in loadPoppinsFont: ",t)}})()}if(Velt&&wc({sdkVersion:null===Velt||void 0===Velt?void 0:Velt.version,sdkType:"client"}),this.generateDocumentId(),(null===Velt||void 0===Velt?void 0:Velt.on)&&"function"==typeof(null===Velt||void 0===Velt?void 0:Velt.on)?Velt.on("userUpdate").subscribe((async t=>{t&&await this.setDocumentAndLocation()})):await this.setDocumentAndLocation(),setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3),this.commentElement=null===Velt||void 0===Velt?void 0:Velt.getCommentElement(),this.contactElement=null===Velt||void 0===Velt?void 0:Velt.getContactElement(),this.rewriterElement=null===Velt||void 0===Velt?void 0:Velt.getRewriterElement(),this.presenceElement=null===Velt||void 0===Velt?void 0:Velt.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(e=this.commentElement)||void 0===e?void 0:e.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t,this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!rc(zt)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),nc(zt,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!rc(Ht,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),nc(Ht,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(r=this.commentElement)||void 0===r?void 0:r.enableGhostComments)&&this.commentElement.enableGhostComments();const i=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;i&&"object"==typeof i&&(null===(s=this.commentElement)||void 0===s?void 0:s.setCustomStatus)&&this.commentElement.setCustomStatus(i),(null===(a=this.commentElement)||void 0===a?void 0:a.enableMinimap)&&this.commentElement.enableMinimap(),(null===(l=this.commentElement)||void 0===l?void 0:l.setDStrategy)&&(null===(c=this.commentElement)||void 0===c||c.setDStrategy("dynamicId")),(null===(d=this.commentElement)||void 0===d?void 0:d.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(h=this.commentElement)||void 0===h?void 0:h.enableHotkey)&&this.commentElement.enableHotkey(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins(),(null===(m=null===(v=null===(p=this.customerMetadata)||void 0===p?void 0:p.superflow)||void 0===v?void 0:v.advancedFeatures)||void 0===m?void 0:m.takeScreenshotOnComments)?this.commentElement.enableScreenshot&&this.commentElement.enableScreenshot():this.commentElement.disableScreenshot&&this.commentElement.disableScreenshot(),(null===(w=null===(g=null===(f=this.customerMetadata)||void 0===f?void 0:f.superflow)||void 0===g?void 0:g.advancedFeatures)||void 0===w?void 0:w.hasCustomStatus)&&this.setCustomStatuses()}this.selectionElement=Velt.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(b=this.rewriterElement)||void 0===b||b.enableRewriter()),this.presenceElement&&(null===(y=this.presenceElement)||void 0===y?void 0:y.enableFlockMode)&&(null===(C=this.presenceElement)||void 0===C||C.enableFlockMode(!0)),(null===Velt||void 0===Velt?void 0:Velt.getDocElement)&&(this.docElement=Velt.getDocElement()),null===(S=(null===(x=this.docElement)||void 0===x?void 0:x.getDocumentMetadata)?null===(E=this.docElement)||void 0===E?void 0:E.getDocumentMetadata():null===(k=null===Velt||void 0===Velt?void 0:Velt.docService)||void 0===k?void 0:k.getDocumentMetadata$())||void 0===S||S.subscribe((t=>{var e,i;const o=(null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.versions)?Object.values(null===(i=null==t?void 0:t.superflow)||void 0===i?void 0:i.versions):[],n=new URL(document.location).searchParams.get("version");if(n){const t=o.find((t=>t.id===n));t&&(this.version={id:t.id,name:t.versionName||t.id},this.setLocation())}})),(null===Velt||void 0===Velt?void 0:Velt.getViewsElement)&&(this.viewsElement=Velt.getViewsElement()),(null===(M=this.viewsElement)||void 0===M?void 0:M.getUniqueViewsByUser)&&(null===(T=null===(_=this.viewsElement)||void 0===_?void 0:_.getUniqueViewsByUser())||void 0===T||T.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),yc("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=tc(ic(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=(t=this.documentId+"")?`${tc(t)}`:void 0}catch(t){console.warn("Error in generateDocumentId: ",t),yc("Error in generateDocumentId: ",t)}var t},this.setDocumentAndLocation=async()=>{try{this.generateDocumentId(),this.previousLocation=null,await(null===Velt||void 0===Velt?void 0:Velt.setDocumentId(this.documentId+"")),wc({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),yc("Error in setDocumentAndLocation: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),yc("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{const t=await(async t=>{try{const e=go(vc,re,{timeout:12e5}),i=await e({eventType:"getCustomerMetadata",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey);return(t=>{try{const e=t?JSON.stringify(t):"false";nc(Gt,e)}catch(t){console.warn("Error in setCustomerMetadataToStorage: ",t),yc("Error in setCustomerMetadataToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),yc("Error in getCustomerMetadata: ",t);const e=(()=>{try{const t=rc(Gt);return t?"false"===t?JSON.parse(JSON.stringify(qt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),yc("Error in getCustomerMetadataFromStorage: ",t),null}})();if(e)return e}},this.setCustomStatuses=async()=>{var t;try{const e=await(async t=>{try{const e=go(vc,re,{timeout:12e5}),i=await e({eventType:"customStatus",subEventType:"getOrgStatuses",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getOrgStatuses: ",t),null}})(this.apiKey);if((null==e?void 0:e.success)&&(null==e?void 0:e.data)){const i=Object.values(e.data),o=this.sortCustomStatuses(i);o.length>0&&(null===(t=this.commentElement)||void 0===t?void 0:t.setCustomStatus)&&this.commentElement.setCustomStatus(o)}}catch(t){console.warn("Error in setCustomStatuses: ",t),yc("Error in setCustomStatuses: ",t)}},this.sortCustomStatuses=t=>{try{const e=[...t].sort(((t,e)=>("number"==typeof t.order?t.order:Number.MAX_SAFE_INTEGER)-("number"==typeof e.order?e.order:Number.MAX_SAFE_INTEGER)));return e}catch(e){return console.warn("Error in sortCustomStatuses: ",e),yc("Error in sortCustomStatuses: ",e),t}},this.getSamlConfig=async()=>{try{const t=await(async t=>{var e;try{const i=go(vc,re,{timeout:12e5}),o=await i({eventType:"saml",samlEventType:"getPublicConfig",apiKey:t});return null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.publicConfig}catch(t){return console.warn("Error in getSamlPublicConfig: ",t),null}})(this.apiKey);return(t=>{try{if(t){const e=JSON.stringify(t);nc(Wt,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),yc("Error in setSamlConfigToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getSamlConfig: ",t),yc("Error in getSamlConfig: ",t);const e=(()=>{try{const t=rc(Wt,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),yc("Error in getSamlConfigFromStorage: ",t),null}})();if(e)return e}},this.setLogos=()=>{var t,e,i,o,n,r,s,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.customBranding)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==Xt?void 0:qt)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===r?void 0:r.logoMark,m=null===(l=null===(a=null===(s=this.customerMetadata)||void 0===s?void 0:s.superflow)||void 0===a?void 0:a.customBranding)||void 0===l?void 0:l.wordMark,f=null===(h=null===(d=null===(c=null==Xt?void 0:qt)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==f?void 0:f.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==f?void 0:f.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),yc("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?$`
3949
+ `}};Ac.styles=Nc,Lc([it({type:String})],Ac.prototype,"apiKey",void 0),Lc([it({type:String})],Ac.prototype,"documentId",void 0),Lc([it({type:Boolean})],Ac.prototype,"disableInvite",void 0),Lc([it({type:Boolean})],Ac.prototype,"hasInviteAccess",void 0),Lc([ot()],Ac.prototype,"userType",void 0),Lc([ot()],Ac.prototype,"showCheckIcon",void 0),Lc([ot()],Ac.prototype,"contactListIsHovered",void 0),Lc([ot()],Ac.prototype,"invalidEmail",void 0),Lc([ot()],Ac.prototype,"isEmailValid",void 0),Lc([ot()],Ac.prototype,"inviting",void 0),Lc([ot()],Ac.prototype,"searchingUsers",void 0),Lc([ot()],Ac.prototype,"emailInput",void 0),Lc([ot()],Ac.prototype,"emailTags",void 0),Lc([ot()],Ac.prototype,"editingTag",void 0),Lc([ot()],Ac.prototype,"editingInput",void 0),Lc([ot()],Ac.prototype,"duplicateEmail",void 0),Lc([ot()],Ac.prototype,"filteredContacts",void 0),Lc([nt("#mainInput")],Ac.prototype,"mainInput",void 0),Lc([nt("#editInput")],Ac.prototype,"editInput",void 0),Ac=Lc([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:o}=e;return{kind:i,elements:o,finisher(e){window.customElements.define(t,e)}}})(t,e))("superflow-invite-modal")],Ac);var $c=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Dc extends X{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.allFeatureDisabled=!1,this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.staging=te,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.showInviteModal=!1,this.subscriptions=[],this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),yc("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t,e;try{const i=await(e=this.apiKey,go(vc,re,{timeout:12e5})({eventType:"customLoginEnabled",apiKey:e}));this.customLoginEnabled=!!(null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),yc("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(sc(St),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),yc("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),yc("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),yc("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),yc("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),yc("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(xt)&&nc(bt,"true",!1),(null==e?void 0:e.has(Nt))&&!rc(Nt)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Ot))if(rc(Ot,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Ot),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(Lt))if(rc(Lt,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Lt),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;if(e.has(kt)||e.has("snippyly_google_token")){if(e.has(kt)){const t=decodeURIComponent(e.get(kt)),i=cc(t,ie,oe),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=lc(e,ie,oe);nc(St,i,!0),sc($t)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,nc(Et,JSON.stringify(i),!0)}e.delete(kt),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(bt)?(nc(bt,"true",!1),sc(yt),e.delete(bt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(yt)||rc(bt,!1)&&this.loadPluginUI(),e.has(yt)?(nc(yt,"true",!1),sc(bt),e.delete(yt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(bt)||rc(yt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),yc("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(bt)||t.searchParams.set(bt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),yc("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&nc(Tt,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(bt)||t.has(yt))&&t.has(It)&&(nc(_t,It,!1,"sessionStorage"),this.projectVersion=t.get(It),this.projectVersion&&nc(Tt,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),yc("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||rc(_t,!1,"sessionStorage"),e=this.projectVersion||rc(Tt,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),yc("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0})),console.log("Location name changed")}}),4e3);if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;wt.includes(this.apiKey)&&this.listenToDocumentTitleChange();const a=dc();a&&!(null==a?void 0:a.isAnonymous)&&(this.loading=!0);try{this.customerMetadata=await this.getCustomerMetadata()}catch(t){console.warn("Error in getCustomerMetadata: ",t),yc("Error in getCustomerMetadata: ",t)}if(oc(Pt)&&(this.isPasswordValid=oc(Pt)),rc(Dt,!0)&&rc(Ut,!0)&&rc(Ft,!0)&&rc(Vt,!0)&&rc(jt,!0)?(this.guestMode="true"===rc(Dt,!0),this.allowGuestModeSignIn="true"===rc(Ut,!0),this.passwordProtected="true"===rc(Ft,!0),this.queryParamsComments="true"===rc(Vt,!0)):(this.projectConfig=await kc(this.apiKey,this.projectId),this.guestMode=!!(null===(t=this.projectConfig)||void 0===t?void 0:t.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(i=null===(e=this.projectConfig)||void 0===e?void 0:e.guestModeConfig)||void 0===i?void 0:i.allowSignIn),this.queryParamsComments=!!(null===(o=this.projectConfig)||void 0===o?void 0:o.queryParamsComments),(null===(n=this.projectConfig)||void 0===n?void 0:n.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(s=null===(r=this.projectConfig)||void 0===r?void 0:r.passwordProtected)||void 0===s?void 0:s.enabled),nc(Dt,this.guestMode+"",!0),nc(Ut,this.allowGuestModeSignIn+"",!0),nc(Ft,this.passwordProtected+"",!0),nc(Vt,this.queryParamsComments+"",!0)),this.loadPlugin=!0,!document.querySelector(Jt.VELT_COMMENTS)){const t=document.createElement(Jt.VELT_COMMENTS);null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(()=>{this.addCommentCount++})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!document.querySelector(Jt.VELT_CURSOR)){const t=document.createElement(Jt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Jt.VELT_HUDDLE)){const t=document.createElement(Jt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Jt.VELT_RECORDER_NOTES)){const t=document.createElement(Jt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Jt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Jt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Jt.VELT_ARROWS)){const t=document.createElement(Jt.VELT_ARROWS);window.document.body.appendChild(t)}try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}if(this.staging&&"true"===sessionStorage.getItem("velt-wireframe")){const t=document.createElement("velt-wireframe");t.innerHTML='\n <style>\n .dialog-header-container {\n padding: 12px;\n background: lightcyan;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .dialog-all-comment-container app-comment-dialog-all-comment > div {\n padding: 12px;\n background: lightpink;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-container {\n padding: 12px;\n background: lightgreen;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-block {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n </style>\n\t\t\t\t\t\t<velt-comment-pin-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-pin-container">\n\t\t\t\t\t\t\t\t\t<div style="width: 35px; height: 35px; background-color: blue; border-radius: 12px; border-width: 3px; border-style: solid; border-color: #f00;"></div>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div class="custom-indicator"></div>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>P</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>G</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-index-wireframe></velt-comment-pin-index-wireframe>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-pin-wireframe>\n\n\t\t\t\t\t\t<velt-comment-bubble-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-bubble">\n\t\t\t\t\t\t\t\t<velt-comment-bubble-avatar-wireframe></velt-comment-bubble-avatar-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-bubble-comments-count-wireframe></velt-comment-bubble-comments-count-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-bubble-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-tool-wireframe>\n\t\t\t\t\t\t\t<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t\t<circle cx="50" cy="50" r="40" fill="red" />\n\t\t\t\t\t\t\t\t<rect x="5" y="5" width="90" height="90" fill="blue" fill-opacity="0.5" />\n\t\t\t\t\t\t\t\t<polygon points="50,5 95,95 5,95" fill="yellow" fill-opacity="0.7" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</velt-text-comment-tool-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:violet; display: flex; gap: 8px; border-radius: 12px; padding: 8px; align-items: center;">\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-generic-wireframe><p>GPT</p></velt-text-comment-toolbar-generic-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-seperator-wireframe><p>Seperator</p></velt-text-comment-toolbar-seperator-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-comment-annotation-wireframe><p>Comment</p></velt-text-comment-toolbar-comment-annotation-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-copywriter-wireframe><p>Copywriter</p></velt-text-comment-toolbar-copywriter-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t<velt-comment-sidebar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:lightblue; width: 100%; height: 100%;">\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Header</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Close Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-search-wireframe></velt-comment-sidebar-search-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-status-wireframe></velt-comment-sidebar-status-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Filter Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Filter</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-title-wireframe></velt-comment-sidebar-filter-title-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom CLose filter</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-close-button-wireframe>\n\n\t\t\t\t\t\t\t\t\t<div style="background-color: yellow">\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-location-wireframe></velt-comment-sidebar-filter-location-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-people-wireframe></velt-comment-sidebar-filter-people-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-category-wireframe></velt-comment-sidebar-filter-category-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-priority-wireframe></velt-comment-sidebar-filter-priority-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-comment-type-wireframe></velt-comment-sidebar-filter-comment-type-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-versions-wireframe></velt-comment-sidebar-filter-versions-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-group-by-wireframe></velt-comment-sidebar-filter-group-by-wireframe>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom Done Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-list-wireframe></velt-comment-sidebar-list-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Empty Placeholder</div>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-page-mode-wireframe></velt-comment-sidebar-page-mode-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-sidebar-wireframe>\n <velt-comment-dialog-wireframe variant="dialog">\n <div class="dialog-all-comment-container">\n <velt-comment-dialog-all-comment-wireframe></velt-comment-dialog-all-comment-wireframe>\n </div>\n <div class="dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n <div class="dialog-header-container">\n <velt-comment-dialog-header-wireframe></velt-comment-dialog-header-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n <velt-comment-dialog-wireframe variant="sidebar">\n <div class="sidebar-dialog-header-container">\n <velt-comment-dialog-header-wireframe>\n <div class="sidebar-dialog-header-block">\n <velt-comment-dialog-comment-count-wireframe></velt-comment-dialog-comment-count-wireframe>\n <velt-comment-dialog-status-wireframe></velt-comment-dialog-status-wireframe>\n <div style="flex-grow: 1"></div>\n <velt-comment-dialog-comment-category-wireframe></velt-comment-dialog-comment-category-wireframe>\n <velt-comment-dialog-priority-wireframe></velt-comment-dialog-priority-wireframe>\n </div>\n </velt-comment-dialog-header-wireframe>\n </div>\n <div class="sidebar-dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="sidebar-dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n ',window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),yc("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),2e3))}catch(t){yc("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,e,o,n,r,s,a,l,c,d,h,u,p,v,m,f,g,w,b,y,C,x,E,k,S,M,_,T;try{let I=this.staging?mt:ft;this.staging||gt.includes(this.apiKey)||(I="latest"),this.veltVersion&&(I=this.veltVersion);let N=this.staging,O=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(I=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(N=!1,O=!0)}if(await i(this.apiKey,{options:{develop:N,staging:O,version:I,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Velt)return;if(this.autoTranslation&&(null===Velt||void 0===Velt?void 0:Velt.enableAutoTranslation)&&(null===Velt||void 0===Velt||Velt.enableAutoTranslation()),!document.querySelector(Jt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Jt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Yt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Yt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Velt){null===Velt||void 0===Velt||Velt.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Velt))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/fonts%2Fpoppins%2Fpoppins.css?alt=media&token=5f31a0f2-5f67-4974-bf56-78ae655f2b68",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),yc("Error in loadPoppinsFont: ",t)}})()}if(Velt&&wc({sdkVersion:null===Velt||void 0===Velt?void 0:Velt.version,sdkType:"client"}),this.generateDocumentId(),(null===Velt||void 0===Velt?void 0:Velt.on)&&"function"==typeof(null===Velt||void 0===Velt?void 0:Velt.on)?Velt.on("userUpdate").subscribe((async t=>{t&&await this.setDocumentAndLocation()})):await this.setDocumentAndLocation(),setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3),this.commentElement=null===Velt||void 0===Velt?void 0:Velt.getCommentElement(),this.contactElement=null===Velt||void 0===Velt?void 0:Velt.getContactElement(),this.rewriterElement=null===Velt||void 0===Velt?void 0:Velt.getRewriterElement(),this.presenceElement=null===Velt||void 0===Velt?void 0:Velt.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(e=this.commentElement)||void 0===e?void 0:e.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t,this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!rc(zt)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),nc(zt,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!rc(Ht,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),nc(Ht,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(r=this.commentElement)||void 0===r?void 0:r.enableGhostComments)&&this.commentElement.enableGhostComments();const i=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;i&&"object"==typeof i&&(null===(s=this.commentElement)||void 0===s?void 0:s.setCustomStatus)&&this.commentElement.setCustomStatus(i),(null===(a=this.commentElement)||void 0===a?void 0:a.enableMinimap)&&this.commentElement.enableMinimap(),(null===(l=this.commentElement)||void 0===l?void 0:l.setDStrategy)&&(null===(c=this.commentElement)||void 0===c||c.setDStrategy("dynamicId")),(null===(d=this.commentElement)||void 0===d?void 0:d.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(h=this.commentElement)||void 0===h?void 0:h.enableHotkey)&&this.commentElement.enableHotkey(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins(),(null===(m=null===(v=null===(p=this.customerMetadata)||void 0===p?void 0:p.superflow)||void 0===v?void 0:v.advancedFeatures)||void 0===m?void 0:m.takeScreenshotOnComments)?this.commentElement.enableScreenshot&&this.commentElement.enableScreenshot():this.commentElement.disableScreenshot&&this.commentElement.disableScreenshot(),(null===(w=null===(g=null===(f=this.customerMetadata)||void 0===f?void 0:f.superflow)||void 0===g?void 0:g.advancedFeatures)||void 0===w?void 0:w.hasCustomStatus)&&this.setCustomStatuses(),this.setQueryParamsCommentsInSdk(),this.checkToEnableUpgradeButton()}this.selectionElement=Velt.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(b=this.rewriterElement)||void 0===b||b.enableRewriter()),this.presenceElement&&(null===(y=this.presenceElement)||void 0===y?void 0:y.enableFlockMode)&&(null===(C=this.presenceElement)||void 0===C||C.enableFlockMode(!0)),(null===Velt||void 0===Velt?void 0:Velt.getDocElement)&&(this.docElement=Velt.getDocElement()),null===(S=(null===(x=this.docElement)||void 0===x?void 0:x.getDocumentMetadata)?null===(E=this.docElement)||void 0===E?void 0:E.getDocumentMetadata():null===(k=null===Velt||void 0===Velt?void 0:Velt.docService)||void 0===k?void 0:k.getDocumentMetadata$())||void 0===S||S.subscribe((t=>{var e,i;const o=(null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.versions)?Object.values(null===(i=null==t?void 0:t.superflow)||void 0===i?void 0:i.versions):[],n=new URL(document.location).searchParams.get("version");if(n){const t=o.find((t=>t.id===n));t&&(this.version={id:t.id,name:t.versionName||t.id},this.setLocation())}})),(null===Velt||void 0===Velt?void 0:Velt.getViewsElement)&&(this.viewsElement=Velt.getViewsElement()),(null===(M=this.viewsElement)||void 0===M?void 0:M.getUniqueViewsByUser)&&(null===(T=null===(_=this.viewsElement)||void 0===_?void 0:_.getUniqueViewsByUser())||void 0===T||T.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),yc("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=tc(ic(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=(t=this.documentId+"")?`${tc(t)}`:void 0}catch(t){console.warn("Error in generateDocumentId: ",t),yc("Error in generateDocumentId: ",t)}var t},this.setDocumentAndLocation=async()=>{try{this.generateDocumentId(),this.previousLocation=null,await(null===Velt||void 0===Velt?void 0:Velt.setDocumentId(this.documentId+"")),wc({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),yc("Error in setDocumentAndLocation: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),yc("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{const t=await(async t=>{try{const e=go(vc,re,{timeout:12e5}),i=await e({eventType:"getCustomerMetadata",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey);return(t=>{try{const e=t?JSON.stringify(t):"false";nc(Gt,e)}catch(t){console.warn("Error in setCustomerMetadataToStorage: ",t),yc("Error in setCustomerMetadataToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),yc("Error in getCustomerMetadata: ",t);const e=(()=>{try{const t=rc(Gt);return t?"false"===t?JSON.parse(JSON.stringify(qt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),yc("Error in getCustomerMetadataFromStorage: ",t),null}})();if(e)return e}},this.setCustomStatuses=async()=>{var t;try{const e=await(async t=>{try{const e=go(vc,re,{timeout:12e5}),i=await e({eventType:"customStatus",subEventType:"getOrgStatuses",apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getOrgStatuses: ",t),null}})(this.apiKey);if((null==e?void 0:e.success)&&(null==e?void 0:e.data)){const i=Object.values(e.data),o=this.sortCustomStatuses(i);o.length>0&&(null===(t=this.commentElement)||void 0===t?void 0:t.setCustomStatus)&&this.commentElement.setCustomStatus(o)}}catch(t){console.warn("Error in setCustomStatuses: ",t),yc("Error in setCustomStatuses: ",t)}},this.sortCustomStatuses=t=>{try{const e=[...t].sort(((t,e)=>("number"==typeof t.order?t.order:Number.MAX_SAFE_INTEGER)-("number"==typeof e.order?e.order:Number.MAX_SAFE_INTEGER)));return e}catch(e){return console.warn("Error in sortCustomStatuses: ",e),yc("Error in sortCustomStatuses: ",e),t}},this.getSamlConfig=async()=>{try{const t=await(async t=>{var e;try{const i=go(vc,re,{timeout:12e5}),o=await i({eventType:"saml",samlEventType:"getPublicConfig",apiKey:t});return null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.publicConfig}catch(t){return console.warn("Error in getSamlPublicConfig: ",t),null}})(this.apiKey);return(t=>{try{if(t){const e=JSON.stringify(t);nc(Wt,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),yc("Error in setSamlConfigToStorage: ",t)}})(t),t}catch(t){console.warn("Error in getSamlConfig: ",t),yc("Error in getSamlConfig: ",t);const e=(()=>{try{const t=rc(Wt,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),yc("Error in getSamlConfigFromStorage: ",t),null}})();if(e)return e}},this.setLogos=()=>{var t,e,i,o,n,r,s,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.customBranding)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==Xt?void 0:qt)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===r?void 0:r.logoMark,m=null===(l=null===(a=null===(s=this.customerMetadata)||void 0===s?void 0:s.superflow)||void 0===a?void 0:a.customBranding)||void 0===l?void 0:l.wordMark,f=null===(h=null===(d=null===(c=null==Xt?void 0:qt)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==f?void 0:f.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==f?void 0:f.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),yc("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?$`
3950
3950
  ${ut(this.logoMark)}
3951
3951
  `:$`
3952
3952
  <img src=${this.logoMark} />
@@ -3954,7 +3954,7 @@ class Hl extends Ns{}Hl.Encryptor=class extends Hl{processBlock(t,e){const i=t,o
3954
3954
  ${ut(this.wordMark)}
3955
3955
  `:$`
3956
3956
  <img src=${this.wordMark} />
3957
- `}catch(t){return console.warn("Error in getWordMark: ",t),$``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(bt),e.searchParams.delete(yt),e.searchParams.delete(Ct),e.searchParams.delete(xt),e.searchParams.delete(Nt),e.searchParams.delete(Ot);const i=t.get(It)||this.projectVersion;this.queryParamsComments||(e.search="");let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),yc("Error in removeHashFromUrl: ",e),t}})(e.href);this.projectId&&(o=null==o?void 0:o.replace(window.location.origin,"")),this.location={url:o,version:i}}}catch(t){console.warn("Error in generateLocation: ",t),yc("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Velt&&(null===Velt||void 0===Velt?void 0:Velt.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,!(null==t?void 0:t.forceSetLocation)&&this.previousLocation&&(null===(e=this.previousLocation)||void 0===e?void 0:e.url)===(null===(i=this.location)||void 0===i?void 0:i.url)&&(null===(o=this.previousLocation)||void 0===o?void 0:o.version)===(null===(n=this.location)||void 0===n?void 0:n.version))return;const r=(t=>{try{const e=ec(t);return tc(JSON.stringify(e))}catch(t){return}})(JSON.parse(JSON.stringify(this.location)));if(r?this.location.id=`${r}`:delete this.location.id,this.usePageTitleAsLocationName){const t=document.title;t&&(this.location.locationName=t)}null===Velt||void 0===Velt||Velt.setLocation(JSON.parse(JSON.stringify(this.location))),wc({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),yc("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),yc("Error in onVeltLocationChange: ",t)}},this.identifySnippyly=async()=>{var t,e;let i="",o="";try{this.invalidApiKey=!1;let e,n={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0,organizationId:this.apiKey};e=this.customLoginEnabled&&this.providedUser?this.providedUser:dc();const r=await this.getSamlConfig(),s=new URL(document.location);if(s.searchParams.has(kt)&&s.searchParams.delete(kt),r&&(this.signInUrl=`${ee}saml/${r.slug}/login?redirect_url=${encodeURIComponent(null==s?void 0:s.toString())}&source=sf`,window.Superflow.signInUrl=this.signInUrl),(null==e?void 0:e.email)&&(n=e),n.isAnonymous)delete n.groupId;else{const t=Velt.getDocumentId()||this.serverDocumentId;t&&(n.groupId=t+"")}if(this.customLoginEnabledLocally||(null===(t=null==n?void 0:n.contacts)||void 0===t?void 0:t.length)&&(n.contacts=[]),i=null==n?void 0:n.email,o=null==n?void 0:n.userId,(null==n?void 0:n.isAnonymous)&&this.projectId&&this.guestMode){const t=uc(!0,this.apiKey);t&&(n=JSON.parse(JSON.stringify(t)))}(null==n?void 0:n.isAnonymous)||(this.loading=!0);let a={};(null==n?void 0:n.groupId)&&(a.groupId=null==n?void 0:n.groupId),n.organizationId=this.apiKey;const l=await Ec(this.apiKey,this.projectId||"",null==n?void 0:n.email,null==n?void 0:n.userId),c=null==l?void 0:l.isAdmin;this.snippylyUserRole=c?"Admin":"Commenter",c&&(a.isAdmin=c,c&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1));const d=await Velt.setVeltAuthProvider({user:n,options:{throwError:!0},retryConfig:{retryCount:3,retryDelay:1e3},generateToken:async()=>{const t=await(async(t,e,i)=>{var o,n;try{const r=go(vc,re,{timeout:12e5}),s=await r({eventType:"generateSuperflowAuthToken",apiKey:t,userId:e,userProperties:i});return null===(n=null===(o=null==s?void 0:s.data)||void 0===o?void 0:o.data)||void 0===n?void 0:n.token}catch(t){return console.warn("Error in generateSuperflowAuthToken: ",t),null}})(this.apiKey,null==n?void 0:n.userId,a);return t},onError:t=>{console.log("Error signing to velt - ",t),this.invalidApiKey=!0}});if(this.invalidApiKey)throw"Invalid Api Key - Domain Not Whitelisted";bc(JSON.parse(JSON.stringify(d||{}))),(null==n?void 0:n.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(n)));const h=JSON.parse(JSON.stringify(d||{}));if((null==h?void 0:h.userSnippylyId)&&!(null==h?void 0:h.isGuest)&&this.checkToMigrateGuestUser(h),Velt.getUserRole$().subscribe((t=>{var e;t&&(this.loading=!1,null===(e=this.commentElement)||void 0===e||e.enablePriority())})),this.contactListSubscription=Velt.getContactElement().getContactList().subscribe((t=>{var e;this.loading=!1,(null===(e=null==t?void 0:t.organizationUsers)||void 0===e?void 0:e.length)>0&&(this.checkPrivateCommentModeFromStorage(),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null))})),(null===Velt||void 0===Velt?void 0:Velt.isPlanExpired$)&&(null===Velt||void 0===Velt||Velt.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),yc("Error in isPlanExpired$: ",t)}))),null===Velt||void 0===Velt?void 0:Velt.on){let t;null===Velt||void 0===Velt||Velt.on("initUpdate").subscribe((e=>{"setDocumentsSuccess"===e.event&&(t&&(t.unsubscribe(),t=null),t=null===Velt||void 0===Velt?void 0:Velt.getDocumentMetadata().subscribe((async t=>{var e,i,o,n;if(t){const r=await kc(this.apiKey,null==t?void 0:t.clientDocumentId);this.handleFeaturesAccessLevelWithProjectConfig(r),this.queryParamsComments=!!(null===(i=null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.settings)||void 0===i?void 0:i.queryParamsComments),nc(Vt,this.queryParamsComments+"",!0),this.usePageTitleAsLocationName=!!(null===(n=null===(o=null==t?void 0:t.superflow)||void 0===o?void 0:o.settings)||void 0===n?void 0:n.usePageTitleAsLocationName),nc(jt,this.usePageTitleAsLocationName+"",!0)}}),(t=>{console.warn("Error in getDocumentMetadata: ",t),yc("Error in getDocumentMetadata: ",t)})))}))}wc({clientUserId:null==n?void 0:n.userId});try{(t=>{var e,i,o,n,r,s,a,l,c,d,h,u;const p={properties:{apiKey:null!==(e=null==fc?void 0:fc.apiKey)&&void 0!==e?e:"",name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"",firstName:(null==t?void 0:t.name)?null===(o=null==t?void 0:t.name)||void 0===o?void 0:o.split(" ")[0]:"",lastName:(null==t?void 0:t.name)?null===(n=null==t?void 0:t.name)||void 0===n?void 0:n.split(" ")[1]:"",email:null!==(r=null==t?void 0:t.email)&&void 0!==r?r:"",clientUserId:null!==(s=null==t?void 0:t.userId)&&void 0!==s?s:"",snippylyUserId:null!==(a=null==t?void 0:t.userSnippylyId)&&void 0!==a?a:"",groupId:null!==(l=null==t?void 0:t.groupId)&&void 0!==l?l:"",isOwner:"",plan:"",sdkVersion:null!==(c=null==fc?void 0:fc.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==fc?void 0:fc.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==fc?void 0:fc.sourcePlatform)&&void 0!==h?h:"",website:null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.href},context:{userAgent:null===navigator||void 0===navigator?void 0:navigator.userAgent},userId:null==t?void 0:t.userSnippylyId,sf:!0};xc("identify",p)})(n)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{rc(At)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(console.log("Error",t),this.loading=!1,this.signInError=!0,t&&"string"==typeof t&&(null===(e=null==t?void 0:t.toLowerCase())||void 0===e?void 0:e.includes("invalid"))){this.invalidApiKey=!0,Cc(pt.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&(async(t,e)=>{try{const i=go(vc,re,{timeout:12e5});await i({eventType:"checkDomainWhitelisted",apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}})(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(Nt))this.isSigningInUserAdmin=!0;else if(rc($t))this.isSigningInUserAdmin="true"===rc($t,!0);else{const t=await Ec(this.apiKey,this.projectId||"",i,o);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),nc($t,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),yc("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=uc(!1,this.apiKey);e&&(await Sc(this.apiKey,this.projectId||"",e,t,!0),sc(Mt))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),yc("Error in checkToMigrationGuestUser: ",t)}},this.getComments=()=>{try{this.commentElement&&(this.commentSubscription&&this.commentSubscription.unsubscribe(),this.commentSubscription=this.commentElement.getAllCommentAnnotations(this.documentId).subscribe((t=>{this.comments=null==t?void 0:t.filter((t=>{var e;return["open","inProgress"].includes(null==t?void 0:t.status)||["default","ongoing"].includes(null===(e=null==t?void 0:t.status)||void 0===e?void 0:e.type)}))})))}catch(t){console.warn("Error in getComments: ",t),yc("Error in getComments: ",t)}},this.setQueryParamsCommentsInSdk=()=>{var t,e,i,o;try{this.commentElement&&(this.queryParamsComments&&(null===(t=this.commentElement)||void 0===t?void 0:t.enableQueryParamsComments)?null===(e=this.commentElement)||void 0===e||e.enableQueryParamsComments():!this.queryParamsComments&&(null===(i=this.commentElement)||void 0===i?void 0:i.disableQueryParamsComments)&&(null===(o=this.commentElement)||void 0===o||o.disableQueryParamsComments()))}catch(t){console.warn("Error in setQueryParamsCommentsInSdk: ",t),yc("Error in setQueryParamsCommentsInSdk: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),yc("Error in checkGlobalUserContact: ",t)}},this.handleFeaturesAccessLevelWithProjectConfig=t=>{var e,i,o,n,r;try{const s="Admin"===this.snippylyUserRole;this.allFeatureDisabled=!s&&(null!==(e=null==t?void 0:t.disabled)&&void 0!==e&&e),this.allFeatureRestricted=null!==(i=null==t?void 0:t.restricted)&&void 0!==i&&i,this.guestMode=null!==(o=null==t?void 0:t.guestMode)&&void 0!==o&&o,this.allowGuestModeSignIn=null!==(r=null===(n=null==t?void 0:t.guestModeConfig)||void 0===n?void 0:n.allowSignIn)&&void 0!==r&&r,this.guestMode&&Cc(pt.Events.GUEST_MODE_PRESENT),this.passwordProtected=!1,Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),nc(Dt,this.guestMode+"",!0),nc(Ut,this.allowGuestModeSignIn+"",!0),nc(Ft,this.passwordProtected+"",!0)}catch(t){console.warn("Error in handleFeaturesAccessLevelWithProjectConfig: ",t),yc("Error in handleFeaturesAccessLevelWithProjectConfig: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Cc(pt.Events.TOOLBAR_EXPANDED):Cc(pt.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),yc("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Cc(pt.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Cc(pt.Events.PRIVATE_MODE_ENABLED)),nc(Rt,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),yc("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{this.allFeatureDisabled||"Admin"!==this.snippylyUserRole||rc(Rt)&&(this.privateCommentModeEnabled="true"===rc(Rt),this.privateCommentModeEnabled&&this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),yc("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(Cc(pt.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;const t=this.buildSignInUrlWithParams(this.signInUrl||"");window.open(t,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),yc("Error in loginWithGoogle: ",t)}},this.buildSignInUrlWithParams=t=>{try{const e=new URL(t);return this.apiKey&&e.searchParams.set("apiKey",this.apiKey),this.projectId&&e.searchParams.set("projectId",this.projectId),e.toString()}catch(e){return console.warn("Error in buildSignInUrlWithParams: ",e),yc("Error in buildSignInUrlWithParams: ",e),t}},this.getQRCode=async()=>{try{const t=new URL(window.location.href);null==t||t.searchParams.set("review","true");const e=null==t?void 0:t.toString();if(e){const t=lc(e,ie,oe),i=await fetch(`https://us-central1-snipply-sdk-staging.cloudfunctions.net/getqrcode?text=${encodeURIComponent(t)}`),o=await i.json();(null==o?void 0:o.qrcode)&&(this.qrCode=null==o?void 0:o.qrcode)}}catch(t){console.warn("Error in getQRCode: ",t),yc("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Cc(pt.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),yc("Error in toggleQRCodeVisibility: ",t)}},this.onUserInviteToolClick=()=>{var t;(null===(t=this.snippylyUser)||void 0===t?void 0:t.isGuest)?(this.guestModeSignInModalConfig.title="Sign in to invite others.",this.guestModeSignInModalConfig.description="Invite team members to comment on this project.",this.guestModeSignInModalConfig.showLeaveCommentButton=!1,this.guestModeSignInModalConfig.closeOnClickOutside=!0,this.openGuestModeSignInModal()):this.openInviteModal()},this.openInviteModal=()=>{this.showInviteModal=!0,Cc(pt.Events.INVITE_MODAL_OPENED)},this.closeInviteModal=()=>{this.showInviteModal=!1},this.onInviteSuccess=()=>{this.closeInviteModal(),Cc(pt.Events.INVITE_SENT)},this.removeSnippyly=async()=>{try{Cc(pt.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,sc(bt),sc(yt),sc(Ct),sc(_t,"sessionStorage"),sc(Tt,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(Ct),e.delete(bt),e.delete(xt),e.delete(yt),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(It),e.delete(Nt),e.delete(Ot),this.projectVersion=void 0,this.projectVersionKey=void 0,delete window.snippylyInitialLoadUrl,window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t),yc("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Cc(pt.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null),await Velt.signOutUser(),sc(Et),sc(St),sc($t),sc(Rt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),yc("Error in signOutUser: ",t)}},this.toggleMenu=(t,e)=>{try{t.stopPropagation(),this.menuOpenedId===e?this.menuOpenedId=void 0:this.menuOpenedId=e}catch(t){console.warn("Error in toggleMenu: ",t),yc("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t),yc("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${ee}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${ee}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),Cc(pt.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),yc("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${ee}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${ee}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),yc("Error in goToAdminPortalDashboard: ",t)}},this.joinCommunity=()=>{try{window.open("https://join.slack.com/t/superflowusers/shared_invite/zt-1q3jzsddt-NEb~uu9RXscLfxOIDGQXJw","_blank")}catch(t){console.warn("Error in joinCommunity: ",t),yc("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,nc(Nt,"true");const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),yc("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,nc(Ot,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(Ot),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),yc("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Lt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),yc("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open("https://superflow-portal-staging-2023.web.app/dashboard/billing","_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),yc("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,nc(At,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),yc("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Cc(pt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),yc("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Cc(pt.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),yc("Error in openGuestModeSignInModal: ",t)}},this.closeGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!1,this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig))}catch(t){console.warn("Error in closeGuestModeSignInModal: ",t),yc("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Cc(pt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),yc("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Cc(pt.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),yc("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),yc("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Cc(pt.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),yc("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Cc(pt.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),yc("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Cc(pt.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),yc("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Cc(pt.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),yc("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),yc("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Cc(pt.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),yc("Error in onGuestModeBannerSignInButtonClick: ",t)}},this.updateGuestUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;const e=uc(!0,this.apiKey);if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,(t=>{try{const e=JSON.stringify(t),i=lc(e,ie,oe);nc(Mt,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),yc("Error in updateGuestUser: ",t)}})(e),await Velt.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await Sc(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,nc(Bt,"true"),Cc(pt.Events.GUEST_MODE_NAME_ADDED,{oldName:null==t?void 0:t.name,newName:null==e?void 0:e.name})}this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateGuestUserName: ",t),yc("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Cc(pt.Events.REVIEW_PASSWORD_ADDED),!(null===(t=this.password)||void 0===t?void 0:t.trim()))return;if(this.validatingPasswordLoading)return;this.validatingPasswordLoading=!0,this.isPasswordValid=await(async(t,e,i)=>{var o;try{const n=go(vc,re,{timeout:12e5}),r=await n({eventType:"validatePassword",apiKey:t,projectId:e,password:i});return null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in validatePassword: ",t),null}})(this.apiKey,this.projectId,this.password),function(t,e){try{const i="object"==typeof e?JSON.stringify(e):e;localStorage.setItem(t,i)}catch(t){console.warn("Error in setLocalStorage: ",t)}}(Pt,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),Cc(pt.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Cc(pt.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),yc("Error in submitPassword: ",t)}},this.updateUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;this.guestUserNameUpdateLoading=!0;const e=JSON.parse(JSON.stringify(this.snippylyUser)),i=JSON.parse(JSON.stringify(this.snippylyUser));i.name=this.guestUserNameInput,await Sc(this.apiKey,this.projectId||"",e,i),await Velt.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=dc();o.name=i.name;const n=JSON.stringify(o),r=lc(n,ie,oe);nc(St,r,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),yc("Error in updateUserName: ",t)}},this.disableCommentMode=()=>{var t;try{(null===(t=this.commentElement)||void 0===t?void 0:t.disableCommentMode)&&this.commentElement.disableCommentMode()}catch(t){console.warn("Error in disableAddCommentMode: ",t),yc("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?$`
3957
+ `}catch(t){return console.warn("Error in getWordMark: ",t),$``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(bt),e.searchParams.delete(yt),e.searchParams.delete(Ct),e.searchParams.delete(xt),e.searchParams.delete(Nt),e.searchParams.delete(Ot);const i=t.get(It)||this.projectVersion;this.queryParamsComments||(e.search="");let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),yc("Error in removeHashFromUrl: ",e),t}})(e.href);this.projectId&&(o=null==o?void 0:o.replace(window.location.origin,"")),this.location={url:o,version:i}}}catch(t){console.warn("Error in generateLocation: ",t),yc("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Velt&&(null===Velt||void 0===Velt?void 0:Velt.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,!(null==t?void 0:t.forceSetLocation)&&this.previousLocation&&(null===(e=this.previousLocation)||void 0===e?void 0:e.url)===(null===(i=this.location)||void 0===i?void 0:i.url)&&(null===(o=this.previousLocation)||void 0===o?void 0:o.version)===(null===(n=this.location)||void 0===n?void 0:n.version))return;const r=(t=>{try{const e=ec(t);return tc(JSON.stringify(e))}catch(t){return}})(JSON.parse(JSON.stringify(this.location)));if(r?this.location.id=`${r}`:delete this.location.id,this.usePageTitleAsLocationName){const t=document.title;t&&(this.location.locationName=t)}null===Velt||void 0===Velt||Velt.setLocation(JSON.parse(JSON.stringify(this.location))),wc({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),yc("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),yc("Error in onVeltLocationChange: ",t)}},this.identifySnippyly=async()=>{var t,e;let i="",o="";try{this.invalidApiKey=!1;let e,n={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0,organizationId:this.apiKey};e=this.customLoginEnabled&&this.providedUser?this.providedUser:dc();const r=await this.getSamlConfig(),s=new URL(document.location);if(s.searchParams.has(kt)&&s.searchParams.delete(kt),r&&(this.signInUrl=`${ee}saml/${r.slug}/login?redirect_url=${encodeURIComponent(null==s?void 0:s.toString())}&source=sf`,window.Superflow.signInUrl=this.signInUrl),(null==e?void 0:e.email)&&(n=e),n.isAnonymous)delete n.groupId;else{const t=Velt.getDocumentId()||this.serverDocumentId;t&&(n.groupId=t+"")}if(this.customLoginEnabledLocally||(null===(t=null==n?void 0:n.contacts)||void 0===t?void 0:t.length)&&(n.contacts=[]),i=null==n?void 0:n.email,o=null==n?void 0:n.userId,(null==n?void 0:n.isAnonymous)&&this.projectId&&this.guestMode){const t=uc(!0,this.apiKey);t&&(n=JSON.parse(JSON.stringify(t)))}(null==n?void 0:n.isAnonymous)||(this.loading=!0);let a={};(null==n?void 0:n.groupId)&&(a.groupId=null==n?void 0:n.groupId),n.organizationId=this.apiKey;const l=await Ec(this.apiKey,this.projectId||"",null==n?void 0:n.email,null==n?void 0:n.userId),c=null==l?void 0:l.isAdmin;this.snippylyUserRole=c?"Admin":"Commenter",c&&(a.isAdmin=c,c&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1));const d=await Velt.setVeltAuthProvider({user:n,options:{throwError:!0},retryConfig:{retryCount:3,retryDelay:1e3},generateToken:async()=>{const t=await(async(t,e,i)=>{var o,n;try{const r=go(vc,re,{timeout:12e5}),s=await r({eventType:"generateSuperflowAuthToken",apiKey:t,userId:e,userProperties:i});return null===(n=null===(o=null==s?void 0:s.data)||void 0===o?void 0:o.data)||void 0===n?void 0:n.token}catch(t){return console.warn("Error in generateSuperflowAuthToken: ",t),null}})(this.apiKey,null==n?void 0:n.userId,a);return t},onError:t=>{console.log("Error signing to velt - ",t),this.invalidApiKey=!0}});if(this.invalidApiKey)throw"Invalid Api Key - Domain Not Whitelisted";bc(JSON.parse(JSON.stringify(d||{}))),(null==n?void 0:n.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(n)));const h=JSON.parse(JSON.stringify(d||{}));if((null==h?void 0:h.userSnippylyId)&&!(null==h?void 0:h.isGuest)&&this.checkToMigrateGuestUser(h),Velt.getUserRole$().subscribe((t=>{var e;t&&(this.loading=!1,null===(e=this.commentElement)||void 0===e||e.enablePriority())})),this.contactListSubscription=Velt.getContactElement().getContactList().subscribe((t=>{var e;this.loading=!1,(null===(e=null==t?void 0:t.organizationUsers)||void 0===e?void 0:e.length)>0&&(this.checkPrivateCommentModeFromStorage(),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null))})),(null===Velt||void 0===Velt?void 0:Velt.isPlanExpired$)&&(null===Velt||void 0===Velt||Velt.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),yc("Error in isPlanExpired$: ",t)}))),null===Velt||void 0===Velt?void 0:Velt.on){let t;null===Velt||void 0===Velt||Velt.on("initUpdate").subscribe((e=>{"setDocumentsSuccess"===e.event&&(t&&(t.unsubscribe(),t=null),t=null===Velt||void 0===Velt?void 0:Velt.getDocumentMetadata().subscribe((async t=>{var e,i,o,n;if(t){const r=await kc(this.apiKey,null==t?void 0:t.clientDocumentId);this.handleFeaturesAccessLevelWithProjectConfig(r),this.queryParamsComments=!!(null===(i=null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.settings)||void 0===i?void 0:i.queryParamsComments),nc(Vt,this.queryParamsComments+"",!0),this.usePageTitleAsLocationName=!!(null===(n=null===(o=null==t?void 0:t.superflow)||void 0===o?void 0:o.settings)||void 0===n?void 0:n.usePageTitleAsLocationName),console.log("usePageTitleAsLocationName",this.usePageTitleAsLocationName),nc(jt,this.usePageTitleAsLocationName+"",!0)}}),(t=>{console.warn("Error in getDocumentMetadata: ",t),yc("Error in getDocumentMetadata: ",t)})))}))}wc({clientUserId:null==n?void 0:n.userId});try{(t=>{var e,i,o,n,r,s,a,l,c,d,h,u;const p={properties:{apiKey:null!==(e=null==fc?void 0:fc.apiKey)&&void 0!==e?e:"",name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"",firstName:(null==t?void 0:t.name)?null===(o=null==t?void 0:t.name)||void 0===o?void 0:o.split(" ")[0]:"",lastName:(null==t?void 0:t.name)?null===(n=null==t?void 0:t.name)||void 0===n?void 0:n.split(" ")[1]:"",email:null!==(r=null==t?void 0:t.email)&&void 0!==r?r:"",clientUserId:null!==(s=null==t?void 0:t.userId)&&void 0!==s?s:"",snippylyUserId:null!==(a=null==t?void 0:t.userSnippylyId)&&void 0!==a?a:"",groupId:null!==(l=null==t?void 0:t.groupId)&&void 0!==l?l:"",isOwner:"",plan:"",sdkVersion:null!==(c=null==fc?void 0:fc.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==fc?void 0:fc.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==fc?void 0:fc.sourcePlatform)&&void 0!==h?h:"",website:null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.href},context:{userAgent:null===navigator||void 0===navigator?void 0:navigator.userAgent},userId:null==t?void 0:t.userSnippylyId,sf:!0};xc("identify",p)})(n)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{rc(At)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(console.log("Error",t),this.loading=!1,this.signInError=!0,t&&"string"==typeof t&&(null===(e=null==t?void 0:t.toLowerCase())||void 0===e?void 0:e.includes("invalid"))){this.invalidApiKey=!0,Cc(pt.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&(async(t,e)=>{try{const i=go(vc,re,{timeout:12e5});await i({eventType:"checkDomainWhitelisted",apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}})(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(Nt))this.isSigningInUserAdmin=!0;else if(rc($t))this.isSigningInUserAdmin="true"===rc($t,!0);else{const t=await Ec(this.apiKey,this.projectId||"",i,o);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),nc($t,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),yc("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=uc(!1,this.apiKey);e&&(await Sc(this.apiKey,this.projectId||"",e,t,!0),sc(Mt))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),yc("Error in checkToMigrationGuestUser: ",t)}},this.getComments=()=>{try{this.commentElement&&(this.commentSubscription&&this.commentSubscription.unsubscribe(),this.commentSubscription=this.commentElement.getAllCommentAnnotations(this.documentId).subscribe((t=>{this.comments=null==t?void 0:t.filter((t=>{var e;return["open","inProgress"].includes(null==t?void 0:t.status)||["default","ongoing"].includes(null===(e=null==t?void 0:t.status)||void 0===e?void 0:e.type)}))})))}catch(t){console.warn("Error in getComments: ",t),yc("Error in getComments: ",t)}},this.setQueryParamsCommentsInSdk=()=>{var t,e,i,o,n;try{console.log("setQueryParamsCommentsInSdk commentElement",this.commentElement),this.commentElement&&(console.log("setQueryParamsCommentsInSdk queryParamsComments",this.queryParamsComments),this.queryParamsComments&&(null===(t=this.commentElement)||void 0===t?void 0:t.enableQueryParamsComments)?(console.log("enableQueryParamsComments this.commentElement?.enableQueryParamsComments",null===(e=this.commentElement)||void 0===e?void 0:e.enableQueryParamsComments),null===(i=this.commentElement)||void 0===i||i.enableQueryParamsComments()):!this.queryParamsComments&&(null===(o=this.commentElement)||void 0===o?void 0:o.disableQueryParamsComments)&&(console.log("disableQueryParamsComments"),null===(n=this.commentElement)||void 0===n||n.disableQueryParamsComments()))}catch(t){console.warn("Error in setQueryParamsCommentsInSdk: ",t),yc("Error in setQueryParamsCommentsInSdk: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),yc("Error in checkGlobalUserContact: ",t)}},this.handleFeaturesAccessLevelWithProjectConfig=t=>{var e,i,o,n,r;try{const s="Admin"===this.snippylyUserRole;this.allFeatureDisabled=!s&&(null!==(e=null==t?void 0:t.disabled)&&void 0!==e&&e),this.allFeatureRestricted=null!==(i=null==t?void 0:t.restricted)&&void 0!==i&&i,this.guestMode=null!==(o=null==t?void 0:t.guestMode)&&void 0!==o&&o,this.allowGuestModeSignIn=null!==(r=null===(n=null==t?void 0:t.guestModeConfig)||void 0===n?void 0:n.allowSignIn)&&void 0!==r&&r,this.guestMode&&Cc(pt.Events.GUEST_MODE_PRESENT),this.passwordProtected=!1,Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),nc(Dt,this.guestMode+"",!0),nc(Ut,this.allowGuestModeSignIn+"",!0),nc(Ft,this.passwordProtected+"",!0)}catch(t){console.warn("Error in handleFeaturesAccessLevelWithProjectConfig: ",t),yc("Error in handleFeaturesAccessLevelWithProjectConfig: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Cc(pt.Events.TOOLBAR_EXPANDED):Cc(pt.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),yc("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Cc(pt.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Cc(pt.Events.PRIVATE_MODE_ENABLED)),nc(Rt,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),yc("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{this.allFeatureDisabled||"Admin"!==this.snippylyUserRole||rc(Rt)&&(this.privateCommentModeEnabled="true"===rc(Rt),this.privateCommentModeEnabled&&this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),yc("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(Cc(pt.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;const t=this.buildSignInUrlWithParams(this.signInUrl||"");window.open(t,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),yc("Error in loginWithGoogle: ",t)}},this.buildSignInUrlWithParams=t=>{try{const e=new URL(t);return this.apiKey&&e.searchParams.set("apiKey",this.apiKey),this.projectId&&e.searchParams.set("projectId",this.projectId),e.toString()}catch(e){return console.warn("Error in buildSignInUrlWithParams: ",e),yc("Error in buildSignInUrlWithParams: ",e),t}},this.getQRCode=async()=>{try{const t=new URL(window.location.href);null==t||t.searchParams.set("review","true");const e=null==t?void 0:t.toString();if(e){const t=lc(e,ie,oe),i=await fetch(`https://us-central1-snipply-sdk-staging.cloudfunctions.net/getqrcode?text=${encodeURIComponent(t)}`),o=await i.json();(null==o?void 0:o.qrcode)&&(this.qrCode=null==o?void 0:o.qrcode)}}catch(t){console.warn("Error in getQRCode: ",t),yc("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Cc(pt.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),yc("Error in toggleQRCodeVisibility: ",t)}},this.onUserInviteToolClick=()=>{var t;(null===(t=this.snippylyUser)||void 0===t?void 0:t.isGuest)?(this.guestModeSignInModalConfig.title="Sign in to invite others.",this.guestModeSignInModalConfig.description="Invite team members to comment on this project.",this.guestModeSignInModalConfig.showLeaveCommentButton=!1,this.guestModeSignInModalConfig.closeOnClickOutside=!0,this.openGuestModeSignInModal()):this.openInviteModal()},this.openInviteModal=()=>{this.showInviteModal=!0,Cc(pt.Events.INVITE_MODAL_OPENED)},this.closeInviteModal=()=>{this.showInviteModal=!1},this.onInviteSuccess=()=>{this.closeInviteModal(),Cc(pt.Events.INVITE_SENT)},this.removeSnippyly=async()=>{try{Cc(pt.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,sc(bt),sc(yt),sc(Ct),sc(_t,"sessionStorage"),sc(Tt,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(Ct),e.delete(bt),e.delete(xt),e.delete(yt),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(It),e.delete(Nt),e.delete(Ot),this.projectVersion=void 0,this.projectVersionKey=void 0,delete window.snippylyInitialLoadUrl,window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t),yc("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Cc(pt.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null),await Velt.signOutUser(),sc(Et),sc(St),sc($t),sc(Rt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),yc("Error in signOutUser: ",t)}},this.toggleMenu=(t,e)=>{try{t.stopPropagation(),this.menuOpenedId===e?this.menuOpenedId=void 0:this.menuOpenedId=e}catch(t){console.warn("Error in toggleMenu: ",t),yc("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t),yc("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${ee}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${ee}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),Cc(pt.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),yc("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${ee}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${ee}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),yc("Error in goToAdminPortalDashboard: ",t)}},this.joinCommunity=()=>{try{window.open("https://join.slack.com/t/superflowusers/shared_invite/zt-1q3jzsddt-NEb~uu9RXscLfxOIDGQXJw","_blank")}catch(t){console.warn("Error in joinCommunity: ",t),yc("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,nc(Nt,"true");const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),yc("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,nc(Ot,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(Ot),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),yc("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Lt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),yc("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open("https://superflow-portal-staging-2023.web.app/dashboard/billing","_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),yc("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,nc(At,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),yc("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Cc(pt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),yc("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Cc(pt.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),yc("Error in openGuestModeSignInModal: ",t)}},this.closeGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!1,this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig))}catch(t){console.warn("Error in closeGuestModeSignInModal: ",t),yc("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Cc(pt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),yc("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Cc(pt.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),yc("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),yc("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Cc(pt.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),yc("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Cc(pt.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),yc("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Cc(pt.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),yc("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Cc(pt.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),yc("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),yc("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Cc(pt.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),yc("Error in onGuestModeBannerSignInButtonClick: ",t)}},this.updateGuestUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;const e=uc(!0,this.apiKey);if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,(t=>{try{const e=JSON.stringify(t),i=lc(e,ie,oe);nc(Mt,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),yc("Error in updateGuestUser: ",t)}})(e),await Velt.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await Sc(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,nc(Bt,"true"),Cc(pt.Events.GUEST_MODE_NAME_ADDED,{oldName:null==t?void 0:t.name,newName:null==e?void 0:e.name})}this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateGuestUserName: ",t),yc("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Cc(pt.Events.REVIEW_PASSWORD_ADDED),!(null===(t=this.password)||void 0===t?void 0:t.trim()))return;if(this.validatingPasswordLoading)return;this.validatingPasswordLoading=!0,this.isPasswordValid=await(async(t,e,i)=>{var o;try{const n=go(vc,re,{timeout:12e5}),r=await n({eventType:"validatePassword",apiKey:t,projectId:e,password:i});return null===(o=null==r?void 0:r.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in validatePassword: ",t),null}})(this.apiKey,this.projectId,this.password),function(t,e){try{const i="object"==typeof e?JSON.stringify(e):e;localStorage.setItem(t,i)}catch(t){console.warn("Error in setLocalStorage: ",t)}}(Pt,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),Cc(pt.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Cc(pt.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),yc("Error in submitPassword: ",t)}},this.updateUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;this.guestUserNameUpdateLoading=!0;const e=JSON.parse(JSON.stringify(this.snippylyUser)),i=JSON.parse(JSON.stringify(this.snippylyUser));i.name=this.guestUserNameInput,await Sc(this.apiKey,this.projectId||"",e,i),await Velt.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=dc();o.name=i.name;const n=JSON.stringify(o),r=lc(n,ie,oe);nc(St,r,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),yc("Error in updateUserName: ",t)}},this.disableCommentMode=()=>{var t;try{(null===(t=this.commentElement)||void 0===t?void 0:t.disableCommentMode)&&this.commentElement.disableCommentMode()}catch(t){console.warn("Error in disableAddCommentMode: ",t),yc("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?$`
3958
3958
  <div class="disable-add-comment-button" @click=${()=>this.disableCommentMode()}>
3959
3959
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
3960
3960
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3.52861 3.52858C3.78896 3.26823 4.21107 3.26823 4.47141 3.52858L8.00001 7.05717L11.5286 3.52858C11.789 3.26823 12.2111 3.26823 12.4714 3.52858C12.7318 3.78892 12.7318 4.21103 12.4714 4.47138L8.94282 7.99998L12.4714 11.5286C12.7318 11.7889 12.7318 12.211 12.4714 12.4714C12.2111 12.7317 11.789 12.7317 11.5286 12.4714L8.00001 8.94279L4.47141 12.4714C4.21107 12.7317 3.78896 12.7317 3.52861 12.4714C3.26826 12.211 3.26826 11.7889 3.52861 11.5286L7.0572 7.99998L3.52861 4.47138C3.26826 4.21103 3.26826 3.78892 3.52861 3.52858Z" fill="#FAFBFF"/>