@snippyly/plugin-staging 1.0.689 → 1.0.690

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.689",
3
+ "version": "1.0.690",
4
4
  "description": "",
5
5
  "main": "snippyly.js",
6
6
  "scripts": {
package/snippyly.js CHANGED
@@ -2646,7 +2646,7 @@ class da extends Yn{}da.Encryptor=class extends da{processBlock(t,e){const i=t,o
2646
2646
  display: none;
2647
2647
  }
2648
2648
  }
2649
- `;var Za=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 Ka 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=qt,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.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),Ra("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return bo(Da,ae,{timeout:12e5})(e)})(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),Ra("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(Ma(xt),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Ra("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),Ra("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Ra("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Ra("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),Ra("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(yt)&&Sa(gt,"true",!1),(null==e?void 0:e.has(_t))&&!ka(_t)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Nt))if(ka(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(Tt))if(ka(Tt,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Tt),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(Ct)||e.has("snippyly_google_token")){if(e.has(Ct)){const t=decodeURIComponent(e.get(Ct)),i=Ta(t,Xt,te),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=Na(e,Xt,te);Sa(xt,i,!0),Ma(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,Sa(bt,JSON.stringify(i),!0)}e.delete(Ct),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(gt)?(Sa(gt,"true",!1),Ma(ft),e.delete(gt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(ft)||ka(gt,!1)&&this.loadPluginUI(),e.has(ft)?(Sa(ft,"true",!1),Ma(gt),e.delete(ft),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(gt)||ka(ft,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Ra("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(gt)||t.searchParams.set(gt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Ra("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&&Sa(kt,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(gt)||t.has(ft))&&t.has(Mt)&&(Sa(St,Mt,!1,"sessionStorage"),this.projectVersion=t.get(Mt),this.projectVersion&&Sa(kt,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Ra("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||ka(St,!1,"sessionStorage"),e=this.projectVersion||ka(kt,!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),Ra("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a,l;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),void this.setLocation();if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;const c=Ia();if(c&&!(null==c?void 0:c.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),Ra("Error in getCustomerMetadata: ",t)})),Ea($t)&&(this.isPasswordValid=Ea($t)),ka(Ot,!0)&&ka(Pt,!0)&&ka(Lt,!0)&&ka(Dt,!0)&&ka(Ft,!0)?(this.guestMode="true"===ka(Ot,!0),this.allowGuestModeSignIn="true"===ka(Pt,!0),this.passwordProtected="true"===ka(Lt,!0),this.queryParamsComments="true"===ka(Dt,!0),this.usePageTitleAsLocationName="true"===ka(Ft,!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=bo(Da,le,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),this.queryParamsComments=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(r=this.projectConfig)||void 0===r?void 0:r.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=this.projectConfig)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Sa(Ot,this.guestMode+"",!0),Sa(Pt,this.allowGuestModeSignIn+"",!0),Sa(Lt,this.passwordProtected+"",!0),Sa(Dt,this.queryParamsComments+"",!0),Sa(Ft,this.usePageTitleAsLocationName+"",!0)),this.loadPlugin=!0,!document.querySelector(Wt.VELT_COMMENTS)){const t=document.createElement(Wt.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(Wt.VELT_CURSOR)){const t=document.createElement(Wt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Wt.VELT_HUDDLE)){const t=document.createElement(Wt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Wt.VELT_RECORDER_NOTES)){const t=document.createElement(Wt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Wt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Wt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Wt.VELT_ARROWS)){const t=document.createElement(Wt.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),Ra("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{var t,i,o,n,r,s,a,l,c,d,h,u,p,v,m,g,f,w,y,b,C,x,E,S;try{let k=this.staging?pt:vt;this.staging||mt.includes(this.apiKey)||(k="latest"),this.veltVersion&&(k=this.veltVersion);let M=this.staging,_=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(k=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(M=!1,_=!0)}if(console.log("Velt SDK version:",k),await e(this.apiKey,{options:{develop:M,staging:_,version:k,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(Wt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Wt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Zt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Zt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt:Snippyly}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}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),Ra("Error in loadPoppinsFont: ",t)}})()}if(Snippyly&&ja({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.documentId=ba(xa(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+"")),this.serverDocumentId=(S=this.documentId+"")?`${ba(S)}`:void 0,ja({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation(),setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&this.setLocation({forceSetLocation:!0})}}),4e3),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.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&&!ka(Rt)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),Sa(Rt,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!ka(Ut,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),Sa(Ut,"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.enableAutoCategorize)&&this.commentElement.enableAutoCategorize(),(null===(r=this.commentElement)||void 0===r?void 0:r.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(s=this.commentElement)||void 0===s?void 0:s.enableGhostComments)&&this.commentElement.enableGhostComments();const e=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;e&&"object"==typeof e&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(e),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&this.commentElement.enableMinimap(),(null===(c=this.commentElement)||void 0===c?void 0:c.setDStrategy)&&(null===(d=this.commentElement)||void 0===d||d.setDStrategy("dynamicId")),(null===(h=this.commentElement)||void 0===h?void 0:h.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableHotkey)&&this.commentElement.enableHotkey(),(null===(p=this.commentElement)||void 0===p?void 0:p.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(v=this.rewriterElement)||void 0===v||v.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(g=this.presenceElement)||void 0===g||g.enableFlockMode(!0)),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocElement)&&(this.docElement=Snippyly.getDocElement()),null===(b=(null===(f=this.docElement)||void 0===f?void 0:f.getDocumentMetadata)?null===(w=this.docElement)||void 0===w?void 0:w.getDocumentMetadata():null===(y=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===y?void 0:y.getDocumentMetadata$())||void 0===b||b.subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(C=this.viewsElement)||void 0===C?void 0:C.getUniqueViewsByUser)&&(null===(E=null===(x=this.viewsElement)||void 0===x?void 0:x.getUniqueViewsByUser())||void 0===E||E.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Ra("Error in initializeSnippyly: ",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),Ra("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=ka(zt);return t?"false"===t?JSON.parse(JSON.stringify(Kt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),Ra("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=bo(Da,ne,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),La(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Ra("Error in getCustomerMetadata: ",t)}},this.getSamlConfig=async()=>{try{let t=(()=>{try{const t=ka(Bt,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),Ra("Error in getSamlConfigFromStorage: ",t),null}})();return t||(t=await(async t=>{var e;try{const i=bo(Da,he,{timeout:12e5}),o=await i({eventType:"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),t&&(t=>{try{if(t){const e=JSON.stringify(t);Sa(Bt,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),Ra("Error in setSamlConfigToStorage: ",t)}})(t)),t}catch(t){console.warn("Error in getSamlConfig: ",t),Ra("Error in getSamlConfig: ",t)}},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.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==Yt?void 0:Kt)||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.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(d=null===(c=null==Yt?void 0:Kt)||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==g?void 0:g.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==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Ra("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?L`
2649
+ `;var Za=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 Ka 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=qt,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.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),Ra("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return bo(Da,ae,{timeout:12e5})(e)})(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),Ra("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(Ma(xt),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Ra("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),Ra("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Ra("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Ra("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),Ra("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(yt)&&Sa(gt,"true",!1),(null==e?void 0:e.has(_t))&&!ka(_t)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Nt))if(ka(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(Tt))if(ka(Tt,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Tt),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(Ct)||e.has("snippyly_google_token")){if(e.has(Ct)){const t=decodeURIComponent(e.get(Ct)),i=Ta(t,Xt,te),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=Na(e,Xt,te);Sa(xt,i,!0),Ma(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,Sa(bt,JSON.stringify(i),!0)}e.delete(Ct),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(gt)?(Sa(gt,"true",!1),Ma(ft),e.delete(gt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(ft)||ka(gt,!1)&&this.loadPluginUI(),e.has(ft)?(Sa(ft,"true",!1),Ma(gt),e.delete(ft),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(gt)||ka(ft,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Ra("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(gt)||t.searchParams.set(gt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Ra("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&&Sa(kt,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(gt)||t.has(ft))&&t.has(Mt)&&(Sa(St,Mt,!1,"sessionStorage"),this.projectVersion=t.get(Mt),this.projectVersion&&Sa(kt,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Ra("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||ka(St,!1,"sessionStorage"),e=this.projectVersion||ka(kt,!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),Ra("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a,l;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),void this.setLocation();if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;const c=Ia();if(c&&!(null==c?void 0:c.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),Ra("Error in getCustomerMetadata: ",t)})),Ea($t)&&(this.isPasswordValid=Ea($t)),ka(Ot,!0)&&ka(Pt,!0)&&ka(Lt,!0)&&ka(Dt,!0)&&ka(Ft,!0)?(this.guestMode="true"===ka(Ot,!0),this.allowGuestModeSignIn="true"===ka(Pt,!0),this.passwordProtected="true"===ka(Lt,!0),this.queryParamsComments="true"===ka(Dt,!0),this.usePageTitleAsLocationName="true"===ka(Ft,!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=bo(Da,le,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),this.queryParamsComments=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(r=this.projectConfig)||void 0===r?void 0:r.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=this.projectConfig)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Sa(Ot,this.guestMode+"",!0),Sa(Pt,this.allowGuestModeSignIn+"",!0),Sa(Lt,this.passwordProtected+"",!0),Sa(Dt,this.queryParamsComments+"",!0),Sa(Ft,this.usePageTitleAsLocationName+"",!0)),this.loadPlugin=!0,!document.querySelector(Wt.VELT_COMMENTS)){const t=document.createElement(Wt.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(Wt.VELT_CURSOR)){const t=document.createElement(Wt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Wt.VELT_HUDDLE)){const t=document.createElement(Wt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Wt.VELT_RECORDER_NOTES)){const t=document.createElement(Wt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Wt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Wt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Wt.VELT_ARROWS)){const t=document.createElement(Wt.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),Ra("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{var t,i,o,n,r,s,a,l,c,d,h,u,p,v,m,g,f,w,y,b,C,x,E,S;try{let k=this.staging?pt:vt;this.staging||mt.includes(this.apiKey)||(k="latest"),this.veltVersion&&(k=this.veltVersion);let M=this.staging,_=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(k=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(M=!1,_=!0)}if(console.log("Velt SDK version:",k),await e(this.apiKey,{options:{develop:M,staging:_,version:k,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(Wt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Wt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Zt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Zt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt:Snippyly}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}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),Ra("Error in loadPoppinsFont: ",t)}})()}if(Snippyly&&ja({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.documentId=ba(xa(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+"")),this.serverDocumentId=(S=this.documentId+"")?`${ba(S)}`:void 0,ja({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation(),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===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.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&&!ka(Rt)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),Sa(Rt,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!ka(Ut,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),Sa(Ut,"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.enableAutoCategorize)&&this.commentElement.enableAutoCategorize(),(null===(r=this.commentElement)||void 0===r?void 0:r.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(s=this.commentElement)||void 0===s?void 0:s.enableGhostComments)&&this.commentElement.enableGhostComments();const e=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;e&&"object"==typeof e&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(e),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&this.commentElement.enableMinimap(),(null===(c=this.commentElement)||void 0===c?void 0:c.setDStrategy)&&(null===(d=this.commentElement)||void 0===d||d.setDStrategy("dynamicId")),(null===(h=this.commentElement)||void 0===h?void 0:h.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableHotkey)&&this.commentElement.enableHotkey(),(null===(p=this.commentElement)||void 0===p?void 0:p.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(v=this.rewriterElement)||void 0===v||v.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(g=this.presenceElement)||void 0===g||g.enableFlockMode(!0)),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocElement)&&(this.docElement=Snippyly.getDocElement()),null===(b=(null===(f=this.docElement)||void 0===f?void 0:f.getDocumentMetadata)?null===(w=this.docElement)||void 0===w?void 0:w.getDocumentMetadata():null===(y=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===y?void 0:y.getDocumentMetadata$())||void 0===b||b.subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(C=this.viewsElement)||void 0===C?void 0:C.getUniqueViewsByUser)&&(null===(E=null===(x=this.viewsElement)||void 0===x?void 0:x.getUniqueViewsByUser())||void 0===E||E.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Ra("Error in initializeSnippyly: ",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),Ra("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=ka(zt);return t?"false"===t?JSON.parse(JSON.stringify(Kt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),Ra("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=bo(Da,ne,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),La(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Ra("Error in getCustomerMetadata: ",t)}},this.getSamlConfig=async()=>{try{let t=(()=>{try{const t=ka(Bt,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),Ra("Error in getSamlConfigFromStorage: ",t),null}})();return t||(t=await(async t=>{var e;try{const i=bo(Da,he,{timeout:12e5}),o=await i({eventType:"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),t&&(t=>{try{if(t){const e=JSON.stringify(t);Sa(Bt,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),Ra("Error in setSamlConfigToStorage: ",t)}})(t)),t}catch(t){console.warn("Error in getSamlConfig: ",t),Ra("Error in getSamlConfig: ",t)}},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.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==Yt?void 0:Kt)||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.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(d=null===(c=null==Yt?void 0:Kt)||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==g?void 0:g.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==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Ra("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?L`
2650
2650
  ${dt(this.logoMark)}
2651
2651
  `:L`
2652
2652
  <img src=${this.logoMark} />
@@ -2654,7 +2654,7 @@ class da extends Yn{}da.Encryptor=class extends da{processBlock(t,e){const i=t,o
2654
2654
  ${dt(this.wordMark)}
2655
2655
  `:L`
2656
2656
  <img src=${this.wordMark} />
2657
- `}catch(t){return console.warn("Error in getWordMark: ",t),L``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(gt),e.searchParams.delete(ft),e.searchParams.delete(wt),e.searchParams.delete(yt),e.searchParams.delete(_t),e.searchParams.delete(Nt);const i=t.get(Mt)||this.projectVersion;this.queryParamsComments||(e.search="");let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),Ra("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),Ra("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.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=JSON.parse(JSON.stringify(this.location));delete r.locationName,delete r.id;const s=(t=>{try{const e=Ca(t);return ba(JSON.stringify(e))}catch(t){return}})(JSON.parse(JSON.stringify(r)));if(s?this.location.id=`${s}`:delete this.location.id,this.usePageTitleAsLocationName){const t=document.title;t&&(this.location.locationName=t)}null===Snippyly||void 0===Snippyly||Snippyly.setLocation(JSON.parse(JSON.stringify(this.location))),ja({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),Ra("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),Ra("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};e=this.customLoginEnabled&&this.providedUser?this.providedUser:Ia();const r=await this.getSamlConfig(),s=new URL(document.location);if(s.searchParams.has(Ct)&&s.searchParams.delete(Ct),r&&(this.signInUrl=`${Qt}/saml/${r.slug}/login?redirect_url=${encodeURIComponent(null==s?void 0:s.toString())}&source=sf`),(null==e?void 0:e.email)&&(n=e),n.isAnonymous)delete n.groupId;else{const t=Snippyly.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=Oa();t&&(n=JSON.parse(JSON.stringify(t)))}let a;(null==n?void 0:n.isAnonymous)||(this.loading=!0),(null==n?void 0:n.groupId)&&(a||(a={}),a.groupId=null==n?void 0:n.groupId);const l=await(async(t,e,i)=>{var o,n;try{const r=bo(Da,re,{timeout:12e5}),s=await r({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),c={};l&&(c.authToken=l);const d=await Snippyly.identify(n,c);Pa(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||{}));(null==h?void 0:h.userSnippylyId)&&!(null==h?void 0:h.isGuest)&&this.checkToMigrateGuestUser(h),Snippyly.getUserRole$().subscribe((t=>{var e;this.loading=!1,this.snippylyUserRole=t,"Admin"===this.snippylyUserRole&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1),this.snippylyUserRole||Va(ht.Events.USER_EMAIL_NOT_WHITELISTED),null===(e=this.commentElement)||void 0===e||e.enablePriority(),this.checkPrivateCommentModeFromStorage()})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getFeaturesAccessLevelIam$)&&this.subscriptions.push(Snippyly.getFeaturesAccessLevelIam$().subscribe((async t=>{var e,i,o,n,r,s,a,l;this.allFeatureDisabled=!!(null===(e=null==t?void 0:t.all)||void 0===e?void 0:e.disabled)&&"Admin"!==this.snippylyUserRole,this.allFeatureRestricted=!!(null===(i=null==t?void 0:t.all)||void 0===i?void 0:i.restricted),this.guestMode=!!(null===(o=null==t?void 0:t.all)||void 0===o?void 0:o.guestMode),this.allowGuestModeSignIn=!!(null===(r=null===(n=null==t?void 0:t.all)||void 0===n?void 0:n.guestModeConfig)||void 0===r?void 0:r.allowSignIn),this.guestMode&&Va(ht.Events.GUEST_MODE_PRESENT),(null===(s=null==t?void 0:t.all)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=null==t?void 0:t.all)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),Sa(Ot,this.guestMode+"",!0),Sa(Pt,this.allowGuestModeSignIn+"",!0),Sa(Lt,this.passwordProtected+"",!0)}),(t=>{this.loading=!1,console.warn("Error in getFeaturesAccessLevelIam$: ",t),Ra("Error in getFeaturesAccessLevelIam$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.isPlanExpired$)&&(null===Snippyly||void 0===Snippyly||Snippyly.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),Ra("Error in isPlanExpired$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCustomerMetadata$)&&(null===Snippyly||void 0===Snippyly||Snippyly.getCustomerMetadata$().subscribe((t=>{La(t),t&&(this.customerMetadata=t)}),(t=>{console.warn("Error in getCustomerMetadata$: ",t),Ra("Error in getCustomerMetadata$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentMetadata)&&(null===Snippyly||void 0===Snippyly||Snippyly.getDocumentMetadata().subscribe((t=>{var e,i;t&&(this.queryParamsComments=!!(null===(e=null==t?void 0:t.extraConfig)||void 0===e?void 0:e.queryParamsComments),Sa(Dt,this.queryParamsComments+"",!0),this.usePageTitleAsLocationName=!!(null===(i=null==t?void 0:t.extraConfig)||void 0===i?void 0:i.usePageTitleAsLocationName),Sa(Ft,this.usePageTitleAsLocationName+"",!0))}),(t=>{console.warn("Error in getDocumentMetadata: ",t),Ra("Error in getDocumentMetadata: ",t)}))),ja({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==$a?void 0:$a.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==$a?void 0:$a.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==$a?void 0:$a.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==$a?void 0:$a.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};Ua("identify",p)})(n)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{ka(It)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(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,Va(ht.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&(async(t,e)=>{try{const i=bo(Da,ie,{timeout:12e5});await i({apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}})(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(_t))this.isSigningInUserAdmin=!0;else if(ka(At))this.isSigningInUserAdmin="true"===ka(At,!0);else{const t=await(async(t,e,i,o)=>{try{const n=bo(Da,oe,{timeout:12e5}),r=await n({apiKey:t,projectId:e,email:i,userId:o});return null==r?void 0:r.data}catch(t){return console.warn("Error in iam: ",t),null}})(this.apiKey,this.projectId||"",i,o);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),Sa(At,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),Ra("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=Oa(!1);e&&(await za(this.apiKey,this.projectId||"",e,t,!0),Ma(Et))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),Ra("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),Ra("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),Ra("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),Ra("Error in checkGlobalUserContact: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Va(ht.Events.TOOLBAR_EXPANDED):Va(ht.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),Ra("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Va(ht.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Va(ht.Events.PRIVATE_MODE_ENABLED)),Sa(jt,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),Ra("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{this.allFeatureDisabled||"Admin"!==this.snippylyUserRole||ka(jt)&&(this.privateCommentModeEnabled="true"===ka(jt),this.privateCommentModeEnabled&&this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),Ra("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(Va(ht.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;window.open(this.signInUrl,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),Ra("Error in loginWithGoogle: ",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=Na(e,Xt,te),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),Ra("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Va(ht.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),Ra("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.removeSnippyly=async()=>{try{Va(ht.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,Ma(gt),Ma(ft),Ma(wt),Ma(St,"sessionStorage"),Ma(kt,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(wt),e.delete(gt),e.delete(yt),e.delete(ft),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(Mt),e.delete(_t),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),Ra("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Va(ht.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),await Snippyly.signOutUser(),Ma(bt),Ma(xt),Ma(At),Ma(jt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),Ra("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),Ra("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),Ra("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${Qt}`;Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)&&this.serverDocumentId&&(t=`${Qt}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),Va(ht.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),Ra("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${Qt}`;Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)&&this.serverDocumentId&&(t=`${Qt}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),Ra("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),Ra("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,Sa(_t,"true");const t=new URL(document.location);t.searchParams.delete(_t),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),Ra("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,Sa(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),Ra("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Tt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),Ra("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),Ra("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,Sa(It,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),Ra("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Va(ht.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),Ra("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Va(ht.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),Ra("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),Ra("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Va(ht.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),Ra("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Va(ht.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),Ra("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),Ra("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Va(ht.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),Ra("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Va(ht.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),Ra("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Va(ht.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),Ra("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Va(ht.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),Ra("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),Ra("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Va(ht.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),Ra("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=Oa();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=Na(e,Xt,te);Sa(Et,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),Ra("Error in updateGuestUser: ",t)}})(e),await Snippyly.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await za(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,Sa(Vt,"true"),Va(ht.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),Ra("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Va(ht.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=bo(Da,ce,{timeout:12e5}),r=await n({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)}}($t,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),Va(ht.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Va(ht.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),Ra("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 za(this.apiKey,this.projectId||"",e,i),await Snippyly.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=Ia();o.name=i.name;const n=JSON.stringify(o),r=Na(n,Xt,te);Sa(xt,r,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),Ra("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),Ra("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?L`
2657
+ `}catch(t){return console.warn("Error in getWordMark: ",t),L``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(gt),e.searchParams.delete(ft),e.searchParams.delete(wt),e.searchParams.delete(yt),e.searchParams.delete(_t),e.searchParams.delete(Nt);const i=t.get(Mt)||this.projectVersion;this.queryParamsComments||(e.search="");let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),Ra("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),Ra("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.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=Ca(t);return ba(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===Snippyly||void 0===Snippyly||Snippyly.setLocation(JSON.parse(JSON.stringify(this.location))),ja({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),Ra("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),Ra("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};e=this.customLoginEnabled&&this.providedUser?this.providedUser:Ia();const r=await this.getSamlConfig(),s=new URL(document.location);if(s.searchParams.has(Ct)&&s.searchParams.delete(Ct),r&&(this.signInUrl=`${Qt}/saml/${r.slug}/login?redirect_url=${encodeURIComponent(null==s?void 0:s.toString())}&source=sf`),(null==e?void 0:e.email)&&(n=e),n.isAnonymous)delete n.groupId;else{const t=Snippyly.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=Oa();t&&(n=JSON.parse(JSON.stringify(t)))}let a;(null==n?void 0:n.isAnonymous)||(this.loading=!0),(null==n?void 0:n.groupId)&&(a||(a={}),a.groupId=null==n?void 0:n.groupId);const l=await(async(t,e,i)=>{var o,n;try{const r=bo(Da,re,{timeout:12e5}),s=await r({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),c={};l&&(c.authToken=l);const d=await Snippyly.identify(n,c);Pa(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||{}));(null==h?void 0:h.userSnippylyId)&&!(null==h?void 0:h.isGuest)&&this.checkToMigrateGuestUser(h),Snippyly.getUserRole$().subscribe((t=>{var e;this.loading=!1,this.snippylyUserRole=t,"Admin"===this.snippylyUserRole&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1),this.snippylyUserRole||Va(ht.Events.USER_EMAIL_NOT_WHITELISTED),null===(e=this.commentElement)||void 0===e||e.enablePriority(),this.checkPrivateCommentModeFromStorage()})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getFeaturesAccessLevelIam$)&&this.subscriptions.push(Snippyly.getFeaturesAccessLevelIam$().subscribe((async t=>{var e,i,o,n,r,s,a,l;this.allFeatureDisabled=!!(null===(e=null==t?void 0:t.all)||void 0===e?void 0:e.disabled)&&"Admin"!==this.snippylyUserRole,this.allFeatureRestricted=!!(null===(i=null==t?void 0:t.all)||void 0===i?void 0:i.restricted),this.guestMode=!!(null===(o=null==t?void 0:t.all)||void 0===o?void 0:o.guestMode),this.allowGuestModeSignIn=!!(null===(r=null===(n=null==t?void 0:t.all)||void 0===n?void 0:n.guestModeConfig)||void 0===r?void 0:r.allowSignIn),this.guestMode&&Va(ht.Events.GUEST_MODE_PRESENT),(null===(s=null==t?void 0:t.all)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=null==t?void 0:t.all)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),Sa(Ot,this.guestMode+"",!0),Sa(Pt,this.allowGuestModeSignIn+"",!0),Sa(Lt,this.passwordProtected+"",!0)}),(t=>{this.loading=!1,console.warn("Error in getFeaturesAccessLevelIam$: ",t),Ra("Error in getFeaturesAccessLevelIam$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.isPlanExpired$)&&(null===Snippyly||void 0===Snippyly||Snippyly.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),Ra("Error in isPlanExpired$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCustomerMetadata$)&&(null===Snippyly||void 0===Snippyly||Snippyly.getCustomerMetadata$().subscribe((t=>{La(t),t&&(this.customerMetadata=t)}),(t=>{console.warn("Error in getCustomerMetadata$: ",t),Ra("Error in getCustomerMetadata$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentMetadata)&&(null===Snippyly||void 0===Snippyly||Snippyly.getDocumentMetadata().subscribe((t=>{var e,i;t&&(this.queryParamsComments=!!(null===(e=null==t?void 0:t.extraConfig)||void 0===e?void 0:e.queryParamsComments),Sa(Dt,this.queryParamsComments+"",!0),this.usePageTitleAsLocationName=!!(null===(i=null==t?void 0:t.extraConfig)||void 0===i?void 0:i.usePageTitleAsLocationName),Sa(Ft,this.usePageTitleAsLocationName+"",!0))}),(t=>{console.warn("Error in getDocumentMetadata: ",t),Ra("Error in getDocumentMetadata: ",t)}))),ja({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==$a?void 0:$a.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==$a?void 0:$a.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==$a?void 0:$a.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==$a?void 0:$a.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};Ua("identify",p)})(n)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{ka(It)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(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,Va(ht.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&(async(t,e)=>{try{const i=bo(Da,ie,{timeout:12e5});await i({apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}})(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(_t))this.isSigningInUserAdmin=!0;else if(ka(At))this.isSigningInUserAdmin="true"===ka(At,!0);else{const t=await(async(t,e,i,o)=>{try{const n=bo(Da,oe,{timeout:12e5}),r=await n({apiKey:t,projectId:e,email:i,userId:o});return null==r?void 0:r.data}catch(t){return console.warn("Error in iam: ",t),null}})(this.apiKey,this.projectId||"",i,o);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),Sa(At,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),Ra("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=Oa(!1);e&&(await za(this.apiKey,this.projectId||"",e,t,!0),Ma(Et))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),Ra("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),Ra("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),Ra("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),Ra("Error in checkGlobalUserContact: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Va(ht.Events.TOOLBAR_EXPANDED):Va(ht.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),Ra("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Va(ht.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Va(ht.Events.PRIVATE_MODE_ENABLED)),Sa(jt,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),Ra("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{this.allFeatureDisabled||"Admin"!==this.snippylyUserRole||ka(jt)&&(this.privateCommentModeEnabled="true"===ka(jt),this.privateCommentModeEnabled&&this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),Ra("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(Va(ht.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;window.open(this.signInUrl,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),Ra("Error in loginWithGoogle: ",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=Na(e,Xt,te),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),Ra("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Va(ht.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),Ra("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.removeSnippyly=async()=>{try{Va(ht.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,Ma(gt),Ma(ft),Ma(wt),Ma(St,"sessionStorage"),Ma(kt,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(wt),e.delete(gt),e.delete(yt),e.delete(ft),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(Mt),e.delete(_t),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),Ra("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Va(ht.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),await Snippyly.signOutUser(),Ma(bt),Ma(xt),Ma(At),Ma(jt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),Ra("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),Ra("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),Ra("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${Qt}`;Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)&&this.serverDocumentId&&(t=`${Qt}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),Va(ht.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),Ra("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${Qt}`;Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)&&this.serverDocumentId&&(t=`${Qt}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),Ra("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),Ra("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,Sa(_t,"true");const t=new URL(document.location);t.searchParams.delete(_t),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),Ra("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,Sa(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),Ra("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Tt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),Ra("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),Ra("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,Sa(It,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),Ra("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Va(ht.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),Ra("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Va(ht.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),Ra("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),Ra("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Va(ht.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),Ra("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Va(ht.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),Ra("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),Ra("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Va(ht.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),Ra("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Va(ht.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),Ra("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Va(ht.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),Ra("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Va(ht.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),Ra("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),Ra("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Va(ht.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),Ra("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=Oa();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=Na(e,Xt,te);Sa(Et,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),Ra("Error in updateGuestUser: ",t)}})(e),await Snippyly.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await za(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,Sa(Vt,"true"),Va(ht.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),Ra("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Va(ht.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=bo(Da,ce,{timeout:12e5}),r=await n({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)}}($t,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),Va(ht.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Va(ht.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),Ra("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 za(this.apiKey,this.projectId||"",e,i),await Snippyly.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=Ia();o.name=i.name;const n=JSON.stringify(o),r=Na(n,Xt,te);Sa(xt,r,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),Ra("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),Ra("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?L`
2658
2658
  <div class="disable-add-comment-button" @click=${()=>this.disableCommentMode()}>
2659
2659
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2660
2660
  <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
@@ -2646,7 +2646,7 @@ class ha extends qn{}ha.Encryptor=class extends ha{processBlock(t,e){const i=t,o
2646
2646
  display: none;
2647
2647
  }
2648
2648
  }
2649
- `;var Ka=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 Ja 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=Qt,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.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),Va("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return Co(Fa,le,{timeout:12e5})(e)})(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),Va("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(_a(Et),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Va("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),Va("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Va("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Va("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),Va("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(bt)&&ka(ft,"true",!1),(null==e?void 0:e.has(Nt))&&!Ma(Nt)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Tt))if(Ma(Tt,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Tt),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(It))if(Ma(It,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(It),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(xt)||e.has("snippyly_google_token")){if(e.has(xt)){const t=decodeURIComponent(e.get(xt)),i=Ia(t,te,ee),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=Ta(e,te,ee);ka(Et,i,!0),_a(Ot)}}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,ka(Ct,JSON.stringify(i),!0)}e.delete(xt),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(ft)?(ka(ft,"true",!1),_a(wt),e.delete(ft),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(wt)||Ma(ft,!1)&&this.loadPluginUI(),e.has(wt)?(ka(wt,"true",!1),_a(ft),e.delete(wt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(ft)||Ma(wt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Va("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(ft)||t.searchParams.set(ft,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Va("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&&ka(Mt,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(ft)||t.has(wt))&&t.has(_t)&&(ka(kt,_t,!1,"sessionStorage"),this.projectVersion=t.get(_t),this.projectVersion&&ka(Mt,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Va("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||Ma(kt,!1,"sessionStorage"),e=this.projectVersion||Ma(Mt,!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),Va("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a,l;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),void this.setLocation();if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;const c=Aa();if(c&&!(null==c?void 0:c.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),Va("Error in getCustomerMetadata: ",t)})),Sa(jt)&&(this.isPasswordValid=Sa(jt)),Ma(Lt,!0)&&Ma(Rt,!0)&&Ma(Dt,!0)&&Ma(Ft,!0)&&Ma($t,!0)?(this.guestMode="true"===Ma(Lt,!0),this.allowGuestModeSignIn="true"===Ma(Rt,!0),this.passwordProtected="true"===Ma(Dt,!0),this.queryParamsComments="true"===Ma(Ft,!0),this.usePageTitleAsLocationName="true"===Ma($t,!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=Co(Fa,ce,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),this.queryParamsComments=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(r=this.projectConfig)||void 0===r?void 0:r.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=this.projectConfig)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),ka(Lt,this.guestMode+"",!0),ka(Rt,this.allowGuestModeSignIn+"",!0),ka(Dt,this.passwordProtected+"",!0),ka(Ft,this.queryParamsComments+"",!0),ka($t,this.usePageTitleAsLocationName+"",!0)),this.loadPlugin=!0,!document.querySelector(Zt.VELT_COMMENTS)){const t=document.createElement(Zt.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(Zt.VELT_CURSOR)){const t=document.createElement(Zt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_HUDDLE)){const t=document.createElement(Zt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_RECORDER_NOTES)){const t=document.createElement(Zt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Zt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_ARROWS)){const t=document.createElement(Zt.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),Va("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{var t,e,o,n,r,s,a,l,c,d,h,u,p,v,m,g,f,w,y,b,C,x,E,S;try{let k=this.staging?vt:mt;this.staging||gt.includes(this.apiKey)||(k="latest"),this.veltVersion&&(k=this.veltVersion);let M=this.staging,_=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(k=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(M=!1,_=!0)}if(console.log("Velt SDK version:",k),await i(this.apiKey,{options:{develop:M,staging:_,version:k,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(Zt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Zt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Kt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Kt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt:Snippyly}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}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),Va("Error in loadPoppinsFont: ",t)}})()}if(Snippyly&&Pa({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.documentId=Ca(Ea(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+"")),this.serverDocumentId=(S=this.documentId+"")?`${Ca(S)}`:void 0,Pa({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation(),setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&this.setLocation({forceSetLocation:!0})}}),4e3),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.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&&!Ma(Vt)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),ka(Vt,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!Ma(zt,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),ka(zt,"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.enableAutoCategorize)&&this.commentElement.enableAutoCategorize(),(null===(r=this.commentElement)||void 0===r?void 0:r.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(s=this.commentElement)||void 0===s?void 0:s.enableGhostComments)&&this.commentElement.enableGhostComments();const i=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;i&&"object"==typeof i&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(i),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&this.commentElement.enableMinimap(),(null===(c=this.commentElement)||void 0===c?void 0:c.setDStrategy)&&(null===(d=this.commentElement)||void 0===d||d.setDStrategy("dynamicId")),(null===(h=this.commentElement)||void 0===h?void 0:h.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableHotkey)&&this.commentElement.enableHotkey(),(null===(p=this.commentElement)||void 0===p?void 0:p.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(v=this.rewriterElement)||void 0===v||v.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(g=this.presenceElement)||void 0===g||g.enableFlockMode(!0)),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocElement)&&(this.docElement=Snippyly.getDocElement()),null===(b=(null===(f=this.docElement)||void 0===f?void 0:f.getDocumentMetadata)?null===(w=this.docElement)||void 0===w?void 0:w.getDocumentMetadata():null===(y=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===y?void 0:y.getDocumentMetadata$())||void 0===b||b.subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(C=this.viewsElement)||void 0===C?void 0:C.getUniqueViewsByUser)&&(null===(E=null===(x=this.viewsElement)||void 0===x?void 0:x.getUniqueViewsByUser())||void 0===E||E.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Va("Error in initializeSnippyly: ",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),Va("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=Ma(Bt);return t?"false"===t?JSON.parse(JSON.stringify(Jt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),Va("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=Co(Fa,re,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),Da(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Va("Error in getCustomerMetadata: ",t)}},this.getSamlConfig=async()=>{try{let t=(()=>{try{const t=Ma(Ht,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),Va("Error in getSamlConfigFromStorage: ",t),null}})();return t||(t=await(async t=>{var e;try{const i=Co(Fa,ue,{timeout:12e5}),o=await i({eventType:"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),t&&(t=>{try{if(t){const e=JSON.stringify(t);ka(Ht,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),Va("Error in setSamlConfigToStorage: ",t)}})(t)),t}catch(t){console.warn("Error in getSamlConfig: ",t),Va("Error in getSamlConfig: ",t)}},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.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==qt?void 0:Jt)||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.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(d=null===(c=null==qt?void 0:Jt)||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==g?void 0:g.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==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Va("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?D`
2649
+ `;var Ka=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 Ja 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=Qt,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.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),Va("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return Co(Fa,le,{timeout:12e5})(e)})(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),Va("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(_a(Et),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Va("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),Va("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Va("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Va("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),Va("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(bt)&&ka(ft,"true",!1),(null==e?void 0:e.has(Nt))&&!Ma(Nt)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Tt))if(Ma(Tt,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Tt),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(It))if(Ma(It,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(It),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(xt)||e.has("snippyly_google_token")){if(e.has(xt)){const t=decodeURIComponent(e.get(xt)),i=Ia(t,te,ee),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=Ta(e,te,ee);ka(Et,i,!0),_a(Ot)}}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,ka(Ct,JSON.stringify(i),!0)}e.delete(xt),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(ft)?(ka(ft,"true",!1),_a(wt),e.delete(ft),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(wt)||Ma(ft,!1)&&this.loadPluginUI(),e.has(wt)?(ka(wt,"true",!1),_a(ft),e.delete(wt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(ft)||Ma(wt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Va("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(ft)||t.searchParams.set(ft,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Va("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&&ka(Mt,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(ft)||t.has(wt))&&t.has(_t)&&(ka(kt,_t,!1,"sessionStorage"),this.projectVersion=t.get(_t),this.projectVersion&&ka(Mt,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Va("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||Ma(kt,!1,"sessionStorage"),e=this.projectVersion||Ma(Mt,!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),Va("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a,l;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),void this.setLocation();if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;const c=Aa();if(c&&!(null==c?void 0:c.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),Va("Error in getCustomerMetadata: ",t)})),Sa(jt)&&(this.isPasswordValid=Sa(jt)),Ma(Lt,!0)&&Ma(Rt,!0)&&Ma(Dt,!0)&&Ma(Ft,!0)&&Ma($t,!0)?(this.guestMode="true"===Ma(Lt,!0),this.allowGuestModeSignIn="true"===Ma(Rt,!0),this.passwordProtected="true"===Ma(Dt,!0),this.queryParamsComments="true"===Ma(Ft,!0),this.usePageTitleAsLocationName="true"===Ma($t,!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=Co(Fa,ce,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),this.queryParamsComments=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(r=this.projectConfig)||void 0===r?void 0:r.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=this.projectConfig)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),ka(Lt,this.guestMode+"",!0),ka(Rt,this.allowGuestModeSignIn+"",!0),ka(Dt,this.passwordProtected+"",!0),ka(Ft,this.queryParamsComments+"",!0),ka($t,this.usePageTitleAsLocationName+"",!0)),this.loadPlugin=!0,!document.querySelector(Zt.VELT_COMMENTS)){const t=document.createElement(Zt.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(Zt.VELT_CURSOR)){const t=document.createElement(Zt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_HUDDLE)){const t=document.createElement(Zt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_RECORDER_NOTES)){const t=document.createElement(Zt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Zt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_ARROWS)){const t=document.createElement(Zt.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),Va("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{var t,e,o,n,r,s,a,l,c,d,h,u,p,v,m,g,f,w,y,b,C,x,E,S;try{let k=this.staging?vt:mt;this.staging||gt.includes(this.apiKey)||(k="latest"),this.veltVersion&&(k=this.veltVersion);let M=this.staging,_=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(k=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(M=!1,_=!0)}if(console.log("Velt SDK version:",k),await i(this.apiKey,{options:{develop:M,staging:_,version:k,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(Zt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Zt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Kt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Kt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt:Snippyly}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}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),Va("Error in loadPoppinsFont: ",t)}})()}if(Snippyly&&Pa({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.documentId=Ca(Ea(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+"")),this.serverDocumentId=(S=this.documentId+"")?`${Ca(S)}`:void 0,Pa({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation(),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===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.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&&!Ma(Vt)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),ka(Vt,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!Ma(zt,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),ka(zt,"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.enableAutoCategorize)&&this.commentElement.enableAutoCategorize(),(null===(r=this.commentElement)||void 0===r?void 0:r.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(s=this.commentElement)||void 0===s?void 0:s.enableGhostComments)&&this.commentElement.enableGhostComments();const i=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;i&&"object"==typeof i&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(i),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&this.commentElement.enableMinimap(),(null===(c=this.commentElement)||void 0===c?void 0:c.setDStrategy)&&(null===(d=this.commentElement)||void 0===d||d.setDStrategy("dynamicId")),(null===(h=this.commentElement)||void 0===h?void 0:h.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableHotkey)&&this.commentElement.enableHotkey(),(null===(p=this.commentElement)||void 0===p?void 0:p.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(v=this.rewriterElement)||void 0===v||v.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(g=this.presenceElement)||void 0===g||g.enableFlockMode(!0)),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocElement)&&(this.docElement=Snippyly.getDocElement()),null===(b=(null===(f=this.docElement)||void 0===f?void 0:f.getDocumentMetadata)?null===(w=this.docElement)||void 0===w?void 0:w.getDocumentMetadata():null===(y=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===y?void 0:y.getDocumentMetadata$())||void 0===b||b.subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(C=this.viewsElement)||void 0===C?void 0:C.getUniqueViewsByUser)&&(null===(E=null===(x=this.viewsElement)||void 0===x?void 0:x.getUniqueViewsByUser())||void 0===E||E.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Va("Error in initializeSnippyly: ",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),Va("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=Ma(Bt);return t?"false"===t?JSON.parse(JSON.stringify(Jt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),Va("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=Co(Fa,re,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),Da(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Va("Error in getCustomerMetadata: ",t)}},this.getSamlConfig=async()=>{try{let t=(()=>{try{const t=Ma(Ht,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),Va("Error in getSamlConfigFromStorage: ",t),null}})();return t||(t=await(async t=>{var e;try{const i=Co(Fa,ue,{timeout:12e5}),o=await i({eventType:"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),t&&(t=>{try{if(t){const e=JSON.stringify(t);ka(Ht,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),Va("Error in setSamlConfigToStorage: ",t)}})(t)),t}catch(t){console.warn("Error in getSamlConfig: ",t),Va("Error in getSamlConfig: ",t)}},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.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==qt?void 0:Jt)||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.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(d=null===(c=null==qt?void 0:Jt)||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==g?void 0:g.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==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Va("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?D`
2650
2650
  ${ht(this.logoMark)}
2651
2651
  `:D`
2652
2652
  <img src=${this.logoMark} />
@@ -2654,7 +2654,7 @@ class ha extends qn{}ha.Encryptor=class extends ha{processBlock(t,e){const i=t,o
2654
2654
  ${ht(this.wordMark)}
2655
2655
  `:D`
2656
2656
  <img src=${this.wordMark} />
2657
- `}catch(t){return console.warn("Error in getWordMark: ",t),D``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(ft),e.searchParams.delete(wt),e.searchParams.delete(yt),e.searchParams.delete(bt),e.searchParams.delete(Nt),e.searchParams.delete(Tt);const i=t.get(_t)||this.projectVersion;this.queryParamsComments||(e.search="");let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),Va("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),Va("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.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=JSON.parse(JSON.stringify(this.location));delete r.locationName,delete r.id;const s=(t=>{try{const e=xa(t);return Ca(JSON.stringify(e))}catch(t){return}})(JSON.parse(JSON.stringify(r)));if(s?this.location.id=`${s}`:delete this.location.id,this.usePageTitleAsLocationName){const t=document.title;t&&(this.location.locationName=t)}null===Snippyly||void 0===Snippyly||Snippyly.setLocation(JSON.parse(JSON.stringify(this.location))),Pa({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),Va("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),Va("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};e=this.customLoginEnabled&&this.providedUser?this.providedUser:Aa();const r=await this.getSamlConfig(),s=new URL(document.location);if(s.searchParams.has(xt)&&s.searchParams.delete(xt),r&&(this.signInUrl=`${Xt}/saml/${r.slug}/login?redirect_url=${encodeURIComponent(null==s?void 0:s.toString())}&source=sf`),(null==e?void 0:e.email)&&(n=e),n.isAnonymous)delete n.groupId;else{const t=Snippyly.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=La();t&&(n=JSON.parse(JSON.stringify(t)))}let a;(null==n?void 0:n.isAnonymous)||(this.loading=!0),(null==n?void 0:n.groupId)&&(a||(a={}),a.groupId=null==n?void 0:n.groupId);const l=await(async(t,e,i)=>{var o,n;try{const r=Co(Fa,se,{timeout:12e5}),s=await r({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),c={};l&&(c.authToken=l);const d=await Snippyly.identify(n,c);Ra(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||{}));(null==h?void 0:h.userSnippylyId)&&!(null==h?void 0:h.isGuest)&&this.checkToMigrateGuestUser(h),Snippyly.getUserRole$().subscribe((t=>{var e;this.loading=!1,this.snippylyUserRole=t,"Admin"===this.snippylyUserRole&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1),this.snippylyUserRole||Ua(ut.Events.USER_EMAIL_NOT_WHITELISTED),null===(e=this.commentElement)||void 0===e||e.enablePriority(),this.checkPrivateCommentModeFromStorage()})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getFeaturesAccessLevelIam$)&&this.subscriptions.push(Snippyly.getFeaturesAccessLevelIam$().subscribe((async t=>{var e,i,o,n,r,s,a,l;this.allFeatureDisabled=!!(null===(e=null==t?void 0:t.all)||void 0===e?void 0:e.disabled)&&"Admin"!==this.snippylyUserRole,this.allFeatureRestricted=!!(null===(i=null==t?void 0:t.all)||void 0===i?void 0:i.restricted),this.guestMode=!!(null===(o=null==t?void 0:t.all)||void 0===o?void 0:o.guestMode),this.allowGuestModeSignIn=!!(null===(r=null===(n=null==t?void 0:t.all)||void 0===n?void 0:n.guestModeConfig)||void 0===r?void 0:r.allowSignIn),this.guestMode&&Ua(ut.Events.GUEST_MODE_PRESENT),(null===(s=null==t?void 0:t.all)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=null==t?void 0:t.all)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),ka(Lt,this.guestMode+"",!0),ka(Rt,this.allowGuestModeSignIn+"",!0),ka(Dt,this.passwordProtected+"",!0)}),(t=>{this.loading=!1,console.warn("Error in getFeaturesAccessLevelIam$: ",t),Va("Error in getFeaturesAccessLevelIam$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.isPlanExpired$)&&(null===Snippyly||void 0===Snippyly||Snippyly.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),Va("Error in isPlanExpired$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCustomerMetadata$)&&(null===Snippyly||void 0===Snippyly||Snippyly.getCustomerMetadata$().subscribe((t=>{Da(t),t&&(this.customerMetadata=t)}),(t=>{console.warn("Error in getCustomerMetadata$: ",t),Va("Error in getCustomerMetadata$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentMetadata)&&(null===Snippyly||void 0===Snippyly||Snippyly.getDocumentMetadata().subscribe((t=>{var e,i;t&&(this.queryParamsComments=!!(null===(e=null==t?void 0:t.extraConfig)||void 0===e?void 0:e.queryParamsComments),ka(Ft,this.queryParamsComments+"",!0),this.usePageTitleAsLocationName=!!(null===(i=null==t?void 0:t.extraConfig)||void 0===i?void 0:i.usePageTitleAsLocationName),ka($t,this.usePageTitleAsLocationName+"",!0))}),(t=>{console.warn("Error in getDocumentMetadata: ",t),Va("Error in getDocumentMetadata: ",t)}))),Pa({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==ja?void 0:ja.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==ja?void 0:ja.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==ja?void 0:ja.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==ja?void 0:ja.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};za("identify",p)})(n)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{Ma(At)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(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,Ua(ut.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&(async(t,e)=>{try{const i=Co(Fa,oe,{timeout:12e5});await i({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(Ma(Ot))this.isSigningInUserAdmin="true"===Ma(Ot,!0);else{const t=await(async(t,e,i,o)=>{try{const n=Co(Fa,ne,{timeout:12e5}),r=await n({apiKey:t,projectId:e,email:i,userId:o});return null==r?void 0:r.data}catch(t){return console.warn("Error in iam: ",t),null}})(this.apiKey,this.projectId||"",i,o);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),ka(Ot,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),Va("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=La(!1);e&&(await Ba(this.apiKey,this.projectId||"",e,t,!0),_a(St))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),Va("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),Va("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),Va("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),Va("Error in checkGlobalUserContact: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Ua(ut.Events.TOOLBAR_EXPANDED):Ua(ut.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),Va("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Ua(ut.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Ua(ut.Events.PRIVATE_MODE_ENABLED)),ka(Pt,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),Va("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{this.allFeatureDisabled||"Admin"!==this.snippylyUserRole||Ma(Pt)&&(this.privateCommentModeEnabled="true"===Ma(Pt),this.privateCommentModeEnabled&&this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),Va("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(Ua(ut.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;window.open(this.signInUrl,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),Va("Error in loginWithGoogle: ",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=Ta(e,te,ee),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),Va("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Ua(ut.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),Va("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.removeSnippyly=async()=>{try{Ua(ut.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,_a(ft),_a(wt),_a(yt),_a(kt,"sessionStorage"),_a(Mt,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(yt),e.delete(ft),e.delete(bt),e.delete(wt),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(_t),e.delete(Nt),e.delete(Tt),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),Va("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Ua(ut.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),await Snippyly.signOutUser(),_a(Ct),_a(Et),_a(Ot),_a(Pt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),Va("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),Va("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),Va("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${Xt}`;Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)&&this.serverDocumentId&&(t=`${Xt}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),Ua(ut.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),Va("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${Xt}`;Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)&&this.serverDocumentId&&(t=`${Xt}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),Va("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),Va("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,ka(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),Va("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,ka(Tt,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(Tt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),Va("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(It),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),Va("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),Va("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,ka(At,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),Va("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Ua(ut.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),Va("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Ua(ut.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),Va("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),Va("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Ua(ut.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),Va("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Ua(ut.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),Va("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),Va("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Ua(ut.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),Va("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Ua(ut.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),Va("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Ua(ut.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),Va("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Ua(ut.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),Va("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),Va("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Ua(ut.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),Va("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=La();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=Ta(e,te,ee);ka(St,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),Va("Error in updateGuestUser: ",t)}})(e),await Snippyly.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await Ba(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,ka(Ut,"true"),Ua(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),Va("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Ua(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=Co(Fa,de,{timeout:12e5}),r=await n({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([]),Ua(ut.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Ua(ut.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),Va("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 Ba(this.apiKey,this.projectId||"",e,i),await Snippyly.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=Aa();o.name=i.name;const n=JSON.stringify(o),r=Ta(n,te,ee);ka(Et,r,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),Va("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),Va("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?D`
2657
+ `}catch(t){return console.warn("Error in getWordMark: ",t),D``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(ft),e.searchParams.delete(wt),e.searchParams.delete(yt),e.searchParams.delete(bt),e.searchParams.delete(Nt),e.searchParams.delete(Tt);const i=t.get(_t)||this.projectVersion;this.queryParamsComments||(e.search="");let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),Va("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),Va("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.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=xa(t);return Ca(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===Snippyly||void 0===Snippyly||Snippyly.setLocation(JSON.parse(JSON.stringify(this.location))),Pa({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),Va("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),Va("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};e=this.customLoginEnabled&&this.providedUser?this.providedUser:Aa();const r=await this.getSamlConfig(),s=new URL(document.location);if(s.searchParams.has(xt)&&s.searchParams.delete(xt),r&&(this.signInUrl=`${Xt}/saml/${r.slug}/login?redirect_url=${encodeURIComponent(null==s?void 0:s.toString())}&source=sf`),(null==e?void 0:e.email)&&(n=e),n.isAnonymous)delete n.groupId;else{const t=Snippyly.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=La();t&&(n=JSON.parse(JSON.stringify(t)))}let a;(null==n?void 0:n.isAnonymous)||(this.loading=!0),(null==n?void 0:n.groupId)&&(a||(a={}),a.groupId=null==n?void 0:n.groupId);const l=await(async(t,e,i)=>{var o,n;try{const r=Co(Fa,se,{timeout:12e5}),s=await r({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),c={};l&&(c.authToken=l);const d=await Snippyly.identify(n,c);Ra(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||{}));(null==h?void 0:h.userSnippylyId)&&!(null==h?void 0:h.isGuest)&&this.checkToMigrateGuestUser(h),Snippyly.getUserRole$().subscribe((t=>{var e;this.loading=!1,this.snippylyUserRole=t,"Admin"===this.snippylyUserRole&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1),this.snippylyUserRole||Ua(ut.Events.USER_EMAIL_NOT_WHITELISTED),null===(e=this.commentElement)||void 0===e||e.enablePriority(),this.checkPrivateCommentModeFromStorage()})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getFeaturesAccessLevelIam$)&&this.subscriptions.push(Snippyly.getFeaturesAccessLevelIam$().subscribe((async t=>{var e,i,o,n,r,s,a,l;this.allFeatureDisabled=!!(null===(e=null==t?void 0:t.all)||void 0===e?void 0:e.disabled)&&"Admin"!==this.snippylyUserRole,this.allFeatureRestricted=!!(null===(i=null==t?void 0:t.all)||void 0===i?void 0:i.restricted),this.guestMode=!!(null===(o=null==t?void 0:t.all)||void 0===o?void 0:o.guestMode),this.allowGuestModeSignIn=!!(null===(r=null===(n=null==t?void 0:t.all)||void 0===n?void 0:n.guestModeConfig)||void 0===r?void 0:r.allowSignIn),this.guestMode&&Ua(ut.Events.GUEST_MODE_PRESENT),(null===(s=null==t?void 0:t.all)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=null==t?void 0:t.all)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),ka(Lt,this.guestMode+"",!0),ka(Rt,this.allowGuestModeSignIn+"",!0),ka(Dt,this.passwordProtected+"",!0)}),(t=>{this.loading=!1,console.warn("Error in getFeaturesAccessLevelIam$: ",t),Va("Error in getFeaturesAccessLevelIam$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.isPlanExpired$)&&(null===Snippyly||void 0===Snippyly||Snippyly.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),Va("Error in isPlanExpired$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCustomerMetadata$)&&(null===Snippyly||void 0===Snippyly||Snippyly.getCustomerMetadata$().subscribe((t=>{Da(t),t&&(this.customerMetadata=t)}),(t=>{console.warn("Error in getCustomerMetadata$: ",t),Va("Error in getCustomerMetadata$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentMetadata)&&(null===Snippyly||void 0===Snippyly||Snippyly.getDocumentMetadata().subscribe((t=>{var e,i;t&&(this.queryParamsComments=!!(null===(e=null==t?void 0:t.extraConfig)||void 0===e?void 0:e.queryParamsComments),ka(Ft,this.queryParamsComments+"",!0),this.usePageTitleAsLocationName=!!(null===(i=null==t?void 0:t.extraConfig)||void 0===i?void 0:i.usePageTitleAsLocationName),ka($t,this.usePageTitleAsLocationName+"",!0))}),(t=>{console.warn("Error in getDocumentMetadata: ",t),Va("Error in getDocumentMetadata: ",t)}))),Pa({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==ja?void 0:ja.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==ja?void 0:ja.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==ja?void 0:ja.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==ja?void 0:ja.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};za("identify",p)})(n)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{Ma(At)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(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,Ua(ut.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&(async(t,e)=>{try{const i=Co(Fa,oe,{timeout:12e5});await i({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(Ma(Ot))this.isSigningInUserAdmin="true"===Ma(Ot,!0);else{const t=await(async(t,e,i,o)=>{try{const n=Co(Fa,ne,{timeout:12e5}),r=await n({apiKey:t,projectId:e,email:i,userId:o});return null==r?void 0:r.data}catch(t){return console.warn("Error in iam: ",t),null}})(this.apiKey,this.projectId||"",i,o);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),ka(Ot,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),Va("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=La(!1);e&&(await Ba(this.apiKey,this.projectId||"",e,t,!0),_a(St))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),Va("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),Va("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),Va("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),Va("Error in checkGlobalUserContact: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Ua(ut.Events.TOOLBAR_EXPANDED):Ua(ut.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),Va("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Ua(ut.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Ua(ut.Events.PRIVATE_MODE_ENABLED)),ka(Pt,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),Va("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{this.allFeatureDisabled||"Admin"!==this.snippylyUserRole||Ma(Pt)&&(this.privateCommentModeEnabled="true"===Ma(Pt),this.privateCommentModeEnabled&&this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),Va("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(Ua(ut.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;window.open(this.signInUrl,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),Va("Error in loginWithGoogle: ",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=Ta(e,te,ee),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),Va("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Ua(ut.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),Va("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.removeSnippyly=async()=>{try{Ua(ut.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,_a(ft),_a(wt),_a(yt),_a(kt,"sessionStorage"),_a(Mt,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(yt),e.delete(ft),e.delete(bt),e.delete(wt),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(_t),e.delete(Nt),e.delete(Tt),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),Va("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Ua(ut.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),await Snippyly.signOutUser(),_a(Ct),_a(Et),_a(Ot),_a(Pt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),Va("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),Va("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),Va("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${Xt}`;Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)&&this.serverDocumentId&&(t=`${Xt}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),Ua(ut.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),Va("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${Xt}`;Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)&&this.serverDocumentId&&(t=`${Xt}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),Va("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),Va("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,ka(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),Va("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,ka(Tt,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(Tt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),Va("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(It),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),Va("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),Va("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,ka(At,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),Va("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Ua(ut.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),Va("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Ua(ut.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),Va("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),Va("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Ua(ut.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),Va("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Ua(ut.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),Va("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),Va("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Ua(ut.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),Va("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Ua(ut.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),Va("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Ua(ut.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),Va("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Ua(ut.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),Va("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),Va("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Ua(ut.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),Va("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=La();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=Ta(e,te,ee);ka(St,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),Va("Error in updateGuestUser: ",t)}})(e),await Snippyly.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await Ba(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,ka(Ut,"true"),Ua(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),Va("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Ua(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=Co(Fa,de,{timeout:12e5}),r=await n({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([]),Ua(ut.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Ua(ut.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),Va("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 Ba(this.apiKey,this.projectId||"",e,i),await Snippyly.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=Aa();o.name=i.name;const n=JSON.stringify(o),r=Ta(n,te,ee);ka(Et,r,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),Va("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),Va("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?D`
2658
2658
  <div class="disable-add-comment-button" @click=${()=>this.disableCommentMode()}>
2659
2659
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2660
2660
  <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"/>