pushfeedback 0.1.63 → 0.1.65

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.
@@ -10,39 +10,40 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
10
10
  this.__attachShadow();
11
11
  this.feedbackSent = createEvent(this, "feedbackSent", 7);
12
12
  this.feedbackError = createEvent(this, "feedbackError", 7);
13
- this.sessionId = "";
13
+ this.buttonPosition = 'default';
14
+ this.buttonStyle = 'default';
15
+ this.hideIcon = false;
16
+ this.hideMobile = false;
17
+ this.sessionId = '';
18
+ this.submit = false;
14
19
  this.customFont = false;
15
- this.errorMessage = "Please try again later.";
16
- this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
17
- this.errorMessage404 = "We could not find the provided project id in PushFeedback.";
18
- this.modalTitle = 'Share your feedback';
19
- this.modalTitleSuccess = 'Thanks for your feedback!';
20
- this.modalTitleError = "Oops!";
21
- this.modalPosition = 'center';
22
- this.sendButtonText = 'Send';
23
- this.successMessage = "";
24
- this.project = '';
25
- this.screenshotButtonText = 'Add a screenshot';
26
- this.screenshotTopbarText = 'Select an element on this page';
27
- this.hideEmail = false;
28
20
  this.emailAddress = '';
29
- this.emailPlaceholder = 'Email address (optional)';
30
- this.messagePlaceholder = 'Comments';
21
+ this.isEmailRequired = false;
22
+ this.fetchData = true;
23
+ this.hideEmail = false;
24
+ this.hidePrivacyPolicy = true;
31
25
  this.hideRating = false;
26
+ this.hideScreenshotButton = false;
27
+ this.modalPosition = 'center';
28
+ this.project = '';
32
29
  this.rating = undefined;
33
30
  this.ratingMode = 'thumbs';
34
- this.ratingPlaceholder = 'Was this page helpful?';
35
- this.ratingStarsPlaceholder = 'How would you rate this page?';
31
+ this.emailPlaceholder = 'Email address (optional)';
32
+ this.errorMessage = 'Please try again later.';
33
+ this.errorMessage403 = 'The request URL does not match the one defined in PushFeedback for this project.';
34
+ this.errorMessage404 = 'We could not find the provided project id in PushFeedback.';
36
35
  this.footerText = '';
37
- this.buttonStyle = 'default';
38
- this.buttonPosition = 'default';
39
- this.hideIcon = false;
40
- this.hideScreenshotButton = false;
41
- this.hidePrivacyPolicy = true;
42
- this.hideMobile = false;
36
+ this.messagePlaceholder = 'Comments';
37
+ this.modalTitle = 'Share your feedback';
38
+ this.modalTitleError = 'Oops!';
39
+ this.modalTitleSuccess = 'Thanks for your feedback!';
43
40
  this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
44
- this.fetchData = true;
45
- this.submit = false;
41
+ this.ratingPlaceholder = 'Was this page helpful?';
42
+ this.ratingStarsPlaceholder = 'How would you rate this page?';
43
+ this.screenshotButtonText = 'Add a screenshot';
44
+ this.screenshotTopbarText = 'Select an element on this page';
45
+ this.sendButtonText = 'Send';
46
+ this.successMessage = '';
46
47
  }
47
48
  componentWillLoad() {
48
49
  if (!this.sessionId) {
@@ -61,7 +62,7 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
61
62
  if (this.isSafariBrowser()) {
62
63
  adjustement = 5;
63
64
  }
64
- buttonContent.style.right = `${(buttonContent.offsetWidth + adjustement) / 2 * -1}px`;
65
+ buttonContent.style.right = `${((buttonContent.offsetWidth + adjustement) / 2) * -1}px`;
65
66
  }
66
67
  if (!this.customFont) {
67
68
  this.loadInterFont();
@@ -71,34 +72,35 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
71
72
  this.feedbackModal = document.createElement('feedback-modal');
72
73
  const props = [
73
74
  'customFont',
75
+ 'emailAddress',
76
+ 'fetchData',
77
+ 'hideEmail',
78
+ 'hidePrivacyPolicy',
79
+ 'hideRating',
80
+ 'hideScreenshotButton',
81
+ 'isEmailRequired',
82
+ 'modalPosition',
83
+ 'project',
84
+ 'rating',
85
+ 'ratingMode',
86
+ 'emailPlaceholder',
74
87
  'errorMessage',
75
88
  'errorMessage403',
76
89
  'errorMessage404',
90
+ 'footerText',
91
+ 'messagePlaceholder',
77
92
  'modalTitle',
78
- 'modalTitleSuccess',
79
93
  'modalTitleError',
80
- 'modalPosition',
81
- 'sendButtonText',
82
- 'successMessage',
83
- 'project',
84
- 'screenshotButtonText',
85
- 'screenshotTopbarText',
86
- 'hideEmail',
87
- 'emailAddress',
88
- 'emailPlaceholder',
89
- 'messagePlaceholder',
90
- 'hideRating',
91
- 'rating',
92
- 'ratingMode',
94
+ 'modalTitleSuccess',
95
+ 'privacyPolicyText',
93
96
  'ratingPlaceholder',
94
97
  'ratingStarsPlaceholder',
95
- 'footerText',
96
- 'hideScreenshotButton',
97
- 'hidePrivacyPolicy',
98
- 'privacyPolicyText',
99
- 'fetchData',
98
+ 'screenshotButtonText',
99
+ 'screenshotTopbarText',
100
+ 'sendButtonText',
101
+ 'successMessage',
100
102
  ];
101
- props.forEach(prop => {
103
+ props.forEach((prop) => {
102
104
  this.feedbackModal[prop] = this[prop];
103
105
  });
104
106
  document.body.appendChild(this.feedbackModal);
@@ -134,15 +136,15 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
134
136
  project: this.project,
135
137
  rating: this.rating || -1,
136
138
  ratingMode: this.ratingMode,
137
- message: "",
139
+ message: '',
138
140
  session: localStorage.getItem('pushfeedback_sessionid') || '',
139
141
  };
140
142
  const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
141
143
  method: 'POST',
142
144
  body: JSON.stringify(body),
143
145
  headers: {
144
- 'Content-Type': 'application/json'
145
- }
146
+ 'Content-Type': 'application/json',
147
+ },
146
148
  });
147
149
  if (res.status === 201) {
148
150
  const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
@@ -171,39 +173,40 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
171
173
  get el() { return this; }
172
174
  static get style() { return feedbackButtonCss; }
173
175
  }, [1, "feedback-button", {
176
+ "buttonPosition": [1, "button-position"],
177
+ "buttonStyle": [1, "button-style"],
178
+ "hideIcon": [4, "hide-icon"],
179
+ "hideMobile": [4, "hide-mobile"],
174
180
  "sessionId": [1537, "session-id"],
181
+ "submit": [4],
175
182
  "customFont": [4, "custom-font"],
183
+ "emailAddress": [1, "email-address"],
184
+ "isEmailRequired": [4, "is-email-required"],
185
+ "fetchData": [4, "fetch-data"],
186
+ "hideEmail": [4, "hide-email"],
187
+ "hidePrivacyPolicy": [4, "hide-privacy-policy"],
188
+ "hideRating": [4, "hide-rating"],
189
+ "hideScreenshotButton": [4, "hide-screenshot-button"],
190
+ "modalPosition": [1, "modal-position"],
191
+ "project": [1],
192
+ "rating": [2],
193
+ "ratingMode": [1, "rating-mode"],
194
+ "emailPlaceholder": [1, "email-placeholder"],
176
195
  "errorMessage": [1, "error-message"],
177
196
  "errorMessage403": [1, "error-message-4-0-3"],
178
197
  "errorMessage404": [1, "error-message-4-0-4"],
198
+ "footerText": [1, "footer-text"],
199
+ "messagePlaceholder": [1, "message-placeholder"],
179
200
  "modalTitle": [1, "modal-title"],
180
- "modalTitleSuccess": [1, "modal-title-success"],
181
201
  "modalTitleError": [1, "modal-title-error"],
182
- "modalPosition": [1, "modal-position"],
183
- "sendButtonText": [1, "send-button-text"],
184
- "successMessage": [1, "success-message"],
185
- "project": [1],
186
- "screenshotButtonText": [1, "screenshot-button-text"],
187
- "screenshotTopbarText": [1, "screenshot-topbar-text"],
188
- "hideEmail": [4, "hide-email"],
189
- "emailAddress": [1, "email-address"],
190
- "emailPlaceholder": [1, "email-placeholder"],
191
- "messagePlaceholder": [1, "message-placeholder"],
192
- "hideRating": [4, "hide-rating"],
193
- "rating": [2],
194
- "ratingMode": [1, "rating-mode"],
202
+ "modalTitleSuccess": [1, "modal-title-success"],
203
+ "privacyPolicyText": [1, "privacy-policy-text"],
195
204
  "ratingPlaceholder": [1, "rating-placeholder"],
196
205
  "ratingStarsPlaceholder": [1, "rating-stars-placeholder"],
197
- "footerText": [1, "footer-text"],
198
- "buttonStyle": [1, "button-style"],
199
- "buttonPosition": [1, "button-position"],
200
- "hideIcon": [4, "hide-icon"],
201
- "hideScreenshotButton": [4, "hide-screenshot-button"],
202
- "hidePrivacyPolicy": [4, "hide-privacy-policy"],
203
- "hideMobile": [4, "hide-mobile"],
204
- "privacyPolicyText": [1, "privacy-policy-text"],
205
- "fetchData": [4, "fetch-data"],
206
- "submit": [4]
206
+ "screenshotButtonText": [1, "screenshot-button-text"],
207
+ "screenshotTopbarText": [1, "screenshot-topbar-text"],
208
+ "sendButtonText": [1, "send-button-text"],
209
+ "successMessage": [1, "success-message"]
207
210
  }]);
208
211
  function defineCustomElement$1() {
209
212
  if (typeof customElements === "undefined") {
@@ -8804,12 +8804,15 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
8804
8804
  clearTimeout(this.scrollTimeout);
8805
8805
  this.scrollTimeout = setTimeout(() => {
8806
8806
  document.documentElement.classList.remove('feedback-modal-screenshot-closing');
8807
- document.documentElement.style.top = "";
8807
+ document.documentElement.style.top = '';
8808
8808
  window.removeEventListener('scroll', this.onScrollDebounced);
8809
8809
  }, 200);
8810
8810
  };
8811
8811
  this.handleSubmit = async (event) => {
8812
8812
  event.preventDefault();
8813
+ if (this.isEmailRequired && !this.formEmail) {
8814
+ return;
8815
+ }
8813
8816
  this.resetOverflow();
8814
8817
  this.showScreenshotMode = false;
8815
8818
  this.showScreenshotTopBar = false;
@@ -8831,8 +8834,8 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
8831
8834
  method: 'POST',
8832
8835
  body: JSON.stringify(body),
8833
8836
  headers: {
8834
- 'Content-Type': 'application/json'
8835
- }
8837
+ 'Content-Type': 'application/json',
8838
+ },
8836
8839
  });
8837
8840
  if (res.status === 201) {
8838
8841
  const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
@@ -8916,7 +8919,7 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
8916
8919
  const rect = elementUnder.getBoundingClientRect();
8917
8920
  this.screenshotModal.style.display = '';
8918
8921
  // Get the bounding box of the element selected
8919
- this.elementSelected.style.position = "absolute";
8922
+ this.elementSelected.style.position = 'absolute';
8920
8923
  this.elementSelected.style.left = `${rect.left}px`;
8921
8924
  this.elementSelected.style.top = `${rect.top}px`;
8922
8925
  this.elementSelected.style.width = `${rect.width}px`;
@@ -8924,33 +8927,33 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
8924
8927
  this.elementSelected.classList.add('feedback-modal-element-hover');
8925
8928
  // Set the background color of nonselected areas
8926
8929
  // Top
8927
- this.topSide.style.position = "absolute";
8930
+ this.topSide.style.position = 'absolute';
8928
8931
  this.topSide.style.left = `${rect.left}px`;
8929
8932
  this.topSide.style.top = '0px';
8930
8933
  this.topSide.style.width = `${rect.width + borderOffset}px`;
8931
8934
  this.topSide.style.height = `${rect.top}px`;
8932
- this.topSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8935
+ this.topSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
8933
8936
  // Left
8934
- this.leftSide.style.position = "absolute";
8937
+ this.leftSide.style.position = 'absolute';
8935
8938
  this.leftSide.style.left = '0px';
8936
8939
  this.leftSide.style.top = '0px';
8937
8940
  this.leftSide.style.width = `${rect.left}px`;
8938
8941
  this.leftSide.style.height = '100vh';
8939
- this.leftSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8942
+ this.leftSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
8940
8943
  // Bottom
8941
- this.bottomSide.style.position = "absolute";
8944
+ this.bottomSide.style.position = 'absolute';
8942
8945
  this.bottomSide.style.left = `${rect.left}px`;
8943
8946
  this.bottomSide.style.top = `${rect.bottom + borderOffset}px`;
8944
8947
  this.bottomSide.style.width = `${rect.width + borderOffset}px`;
8945
8948
  this.bottomSide.style.height = '100vh';
8946
- this.bottomSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8949
+ this.bottomSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
8947
8950
  // Right
8948
- this.rightSide.style.position = "absolute";
8951
+ this.rightSide.style.position = 'absolute';
8949
8952
  this.rightSide.style.left = `${rect.right + borderOffset}px`;
8950
8953
  this.rightSide.style.top = '0px';
8951
8954
  this.rightSide.style.width = '100%';
8952
8955
  this.rightSide.style.height = '100vh';
8953
- this.rightSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
8956
+ this.rightSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
8954
8957
  // Restore the visibility of the screenshot-modal
8955
8958
  this.screenshotModal.style.backgroundColor = 'transparent';
8956
8959
  };
@@ -9002,36 +9005,37 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
9002
9005
  this.overlayVisible = false;
9003
9006
  this.isAnimating = false;
9004
9007
  this.customFont = false;
9005
- this.errorMessage = "Please try again later.";
9006
- this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
9007
- this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
9008
- this.modalTitle = 'Share your feedback';
9009
- this.modalTitleSuccess = 'Thanks for your feedback!';
9010
- this.modalTitleError = "Oops!";
9011
- this.modalPosition = 'center';
9012
- this.sendButtonText = 'Send';
9013
- this.successMessage = "";
9014
- this.project = '';
9015
- this.screenshotButtonText = 'Add a screenshot';
9016
- this.screenshotTopbarText = 'Select an element on this page';
9017
- this.hideEmail = false;
9018
9008
  this.emailAddress = '';
9019
- this.emailPlaceholder = 'Email address (optional)';
9020
- this.messagePlaceholder = 'Comments';
9021
- this.hideRating = false;
9022
- this.rating = undefined;
9009
+ this.hideEmail = false;
9010
+ this.isEmailRequired = false;
9023
9011
  this.ratingMode = 'thumbs';
9024
- this.ratingPlaceholder = 'Was this page helpful?';
9025
- this.ratingStarsPlaceholder = 'How would you rate this page?';
9026
- this.footerText = '';
9027
- this.showModal = false;
9028
- this.showScreenshotMode = false;
9029
- this.showScreenshotTopBar = false;
9030
9012
  this.hasSelectedElement = false;
9031
- this.hideScreenshotButton = false;
9032
9013
  this.hidePrivacyPolicy = true;
9033
- this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
9014
+ this.hideRating = false;
9015
+ this.hideScreenshotButton = false;
9016
+ this.project = '';
9017
+ this.showScreenshotMode = false;
9018
+ this.showScreenshotTopBar = false;
9019
+ this.showModal = false;
9020
+ this.rating = undefined;
9034
9021
  this.fetchData = true;
9022
+ this.emailPlaceholder = 'Email address (optional)';
9023
+ this.errorMessage = 'Please try again later.';
9024
+ this.errorMessage403 = 'The request URL does not match the one defined in PushFeedback for this project.';
9025
+ this.errorMessage404 = 'We could not find the provided project ID in PushFeedback.';
9026
+ this.messagePlaceholder = 'Comments';
9027
+ this.footerText = '';
9028
+ this.modalPosition = 'center';
9029
+ this.modalTitle = 'Share your feedback';
9030
+ this.modalTitleError = 'Oops!';
9031
+ this.modalTitleSuccess = 'Thanks for your feedback!';
9032
+ this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
9033
+ this.ratingPlaceholder = 'Was this page helpful?';
9034
+ this.ratingStarsPlaceholder = 'How would you rate this page?';
9035
+ this.sendButtonText = 'Send';
9036
+ this.screenshotButtonText = 'Add a screenshot';
9037
+ this.screenshotTopbarText = 'Select an element on this page';
9038
+ this.successMessage = '';
9035
9039
  }
9036
9040
  componentWillLoad() {
9037
9041
  if (this.fetchData)
@@ -9040,7 +9044,7 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
9040
9044
  if (this.rating) {
9041
9045
  this.selectedRating = this.rating;
9042
9046
  }
9043
- if (this.ratingMode == "thumbs" && this.rating == 0) {
9047
+ if (this.ratingMode == 'thumbs' && this.rating == 0) {
9044
9048
  this.selectedRating = 5;
9045
9049
  }
9046
9050
  }
@@ -9079,11 +9083,12 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
9079
9083
  y: window.scrollY,
9080
9084
  width: window.innerWidth,
9081
9085
  height: window.innerHeight,
9082
- }).then(canvas => {
9086
+ })
9087
+ .then((canvas) => {
9083
9088
  const dataUrl = canvas.toDataURL();
9084
9089
  resolve(dataUrl);
9085
9090
  })
9086
- .catch(error => {
9091
+ .catch((error) => {
9087
9092
  console.error(error);
9088
9093
  reject(error);
9089
9094
  });
@@ -9100,16 +9105,22 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
9100
9105
  this.selectedRating = newRating;
9101
9106
  }
9102
9107
  render() {
9103
- return (h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, this.showScreenshotMode && (h("div", { class: "feedback-modal-screenshot", ref: el => (this.screenshotModal = el), onMouseMove: this.handleMouseOverScreenShot }, h("div", { class: "feedback-modal-screenshot-element-selected", ref: el => (this.elementSelected = el), onClick: this.handleMouseClickedSelectedElement }), h("div", { class: "top-side", ref: el => (this.topSide = el) }), h("div", { class: "left-side", ref: el => (this.leftSide = el) }), h("div", { class: "bottom-side", ref: el => (this.bottomSide = el) }), h("div", { class: "right-side", ref: el => (this.rightSide = el) }), this.showScreenshotTopBar && (h("div", { class: "feedback-modal-screenshot-header", onClick: this.closeScreenShot }, h("span", null, this.screenshotTopbarText), h("span", { class: "feedback-modal-screenshot-close" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "#191919", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-x" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))))))), this.showModal && (h("div", { class: `feedback-overlay ${this.isAnimating ? 'feedback-overlay--visible' : ''}` })), this.showModal && (h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating ? 'feedback-modal-content--open' : ''}`, ref: el => (this.modalContent = el) }, h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (h("span", null, this.modalTitle)) : this.formSuccess ? (h("span", null, this.modalTitleSuccess)) : h("span", null, this.modalTitleError), h("button", { class: "feedback-modal-close", onClick: this.close }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "#191919", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-x" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), h("div", { class: "feedback-modal-body" }, !this.formSuccess && !this.formError ? (h("form", { onSubmit: this.handleSubmit }, !this.hideRating && (h("div", { class: "feedback-modal-rating" }, this.ratingMode === 'thumbs' ? (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs" }, h("button", { title: "Yes", class: `feedback-modal-rating-button ${this.selectedRating === 1 ? 'feedback-modal-rating-button--selected' : ''}`, onClick: (event) => {
9108
+ return (h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, this.showScreenshotMode && (h("div", { class: "feedback-modal-screenshot", ref: (el) => (this.screenshotModal = el), onMouseMove: this.handleMouseOverScreenShot }, h("div", { class: "feedback-modal-screenshot-element-selected", ref: (el) => (this.elementSelected = el), onClick: this.handleMouseClickedSelectedElement }), h("div", { class: "top-side", ref: (el) => (this.topSide = el) }), h("div", { class: "left-side", ref: (el) => (this.leftSide = el) }), h("div", { class: "bottom-side", ref: (el) => (this.bottomSide = el) }), h("div", { class: "right-side", ref: (el) => (this.rightSide = el) }), this.showScreenshotTopBar && (h("div", { class: "feedback-modal-screenshot-header", onClick: this.closeScreenShot }, h("span", null, this.screenshotTopbarText), h("span", { class: "feedback-modal-screenshot-close" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "#191919", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-x" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))))))), this.showModal && (h("div", { class: `feedback-overlay ${this.isAnimating ? 'feedback-overlay--visible' : ''}` })), this.showModal && (h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating ? 'feedback-modal-content--open' : ''}`, ref: (el) => (this.modalContent = el) }, h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (h("span", null, this.modalTitle)) : this.formSuccess ? (h("span", null, this.modalTitleSuccess)) : (h("span", null, this.modalTitleError)), h("button", { class: "feedback-modal-close", onClick: this.close }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "#191919", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-x" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), h("div", { class: "feedback-modal-body" }, !this.formSuccess && !this.formError ? (h("form", { onSubmit: this.handleSubmit }, !this.hideRating && (h("div", { class: "feedback-modal-rating" }, this.ratingMode === 'thumbs' ? (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs" }, h("button", { title: "Yes", class: `feedback-modal-rating-button ${this.selectedRating === 1
9109
+ ? 'feedback-modal-rating-button--selected'
9110
+ : ''}`, onClick: (event) => {
9104
9111
  event.preventDefault();
9105
9112
  this.handleRatingChange(1);
9106
- } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" }))), h("button", { title: "No", class: `feedback-modal-rating-button ${this.selectedRating === 5 ? 'feedback-modal-rating-button--selected' : ''}`, onClick: (event) => {
9113
+ } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" }))), h("button", { title: "No", class: `feedback-modal-rating-button ${this.selectedRating === 5
9114
+ ? 'feedback-modal-rating-button--selected'
9115
+ : ''}`, onClick: (event) => {
9107
9116
  event.preventDefault();
9108
9117
  this.handleRatingChange(5);
9109
- } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17" })))))) : (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingStarsPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--stars" }, [1, 2, 3, 4, 5].map((rating) => (h("button", { key: rating, class: `feedback-modal-rating-button ${this.selectedRating >= rating ? 'feedback-modal-rating-button--selected' : ''}`, onClick: (event) => {
9118
+ } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17" })))))) : (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingStarsPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--stars" }, [1, 2, 3, 4, 5].map((rating) => (h("button", { key: rating, class: `feedback-modal-rating-button ${this.selectedRating >= rating
9119
+ ? 'feedback-modal-rating-button--selected'
9120
+ : ''}`, onClick: (event) => {
9110
9121
  event.preventDefault();
9111
9122
  this.handleRatingChange(rating);
9112
- } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" })))))))))), h("div", { class: "feedback-modal-text" }, h("textarea", { placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event) })), !this.hideEmail && (h("div", { class: "feedback-modal-email" }, h("input", { placeholder: this.emailPlaceholder, type: "email", onInput: (event) => this.handleEmailInput(event), value: this.formEmail }))), h("div", { class: "feedback-verification" }, h("input", { type: "text", name: "verification", style: { display: 'none' }, onInput: (event) => this.handleVerification(event), value: this.formVerification })), !this.hidePrivacyPolicy && (h("div", { class: "feedback-modal-privacy" }, h("input", { type: "checkbox", id: "privacyPolicy", onChange: (ev) => this.handleCheckboxChange(ev), required: true }), h("span", { innerHTML: this.privacyPolicyText }))), h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}` }, !this.hideScreenshotButton && (h("button", { type: "button", class: `feedback-modal-button feedback-modal-button--screenshot ${this.encodedScreenshot ? "feedback-modal-button--active" : ""}`, onClick: this.openScreenShot, disabled: this.sending }, h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 -960 960 960", width: "24" }, h("path", { d: "M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-200v-200h80v120h120v80H200Zm0-360v-200h200v80H280v120h-80Zm480 0v-120H560v-80h200v200h-80Z" })), this.screenshotButtonText)), h("button", { class: "feedback-modal-button feedback-modal-button--submit", type: "submit", disabled: this.sending }, this.sendButtonText)))) : this.formSuccess && !this.formError ? (h("div", { class: "feedback-modal-success" }, h("p", { class: "feedback-modal-message" }, this.successMessage))) : this.formError && this.formErrorStatus == 404 ? (h("p", { class: "feedback-modal-message" }, this.errorMessage404)) : this.formError && this.formErrorStatus == 403 ? (h("p", { class: "feedback-modal-message" }, this.errorMessage403)) : this.formError ? (h("p", { class: "feedback-modal-message" }, this.errorMessage)) : h("span", null)), h("div", { class: "feedback-modal-footer" }, h("div", { class: "feedback-logo", style: { display: this.whitelabel ? 'none' : 'block' } }, "Powered by ", h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")), this.footerText && h("div", { class: "feedback-footer-text" }, h("span", { innerHTML: this.footerText })))))));
9123
+ } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" })))))))))), h("div", { class: "feedback-modal-text" }, h("textarea", { placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event) })), !this.hideEmail && (h("div", { class: "feedback-modal-email" }, h("input", { placeholder: this.emailPlaceholder, type: "email", onInput: (event) => this.handleEmailInput(event), value: this.formEmail, required: this.isEmailRequired }))), h("div", { class: "feedback-verification" }, h("input", { type: "text", name: "verification", style: { display: 'none' }, onInput: (event) => this.handleVerification(event), value: this.formVerification })), !this.hidePrivacyPolicy && (h("div", { class: "feedback-modal-privacy" }, h("input", { type: "checkbox", id: "privacyPolicy", onChange: (ev) => this.handleCheckboxChange(ev), required: true }), h("span", { innerHTML: this.privacyPolicyText }))), h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}` }, !this.hideScreenshotButton && (h("button", { type: "button", class: `feedback-modal-button feedback-modal-button--screenshot ${this.encodedScreenshot ? 'feedback-modal-button--active' : ''}`, onClick: this.openScreenShot, disabled: this.sending }, h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 -960 960 960", width: "24" }, h("path", { d: "M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-200v-200h80v120h120v80H200Zm0-360v-200h200v80H280v120h-80Zm480 0v-120H560v-80h200v200h-80Z" })), this.screenshotButtonText)), h("button", { class: "feedback-modal-button feedback-modal-button--submit", type: "submit", disabled: this.sending }, this.sendButtonText)))) : this.formSuccess && !this.formError ? (h("div", { class: "feedback-modal-success" }, h("p", { class: "feedback-modal-message" }, this.successMessage))) : this.formError && this.formErrorStatus == 404 ? (h("p", { class: "feedback-modal-message" }, this.errorMessage404)) : this.formError && this.formErrorStatus == 403 ? (h("p", { class: "feedback-modal-message" }, this.errorMessage403)) : this.formError ? (h("p", { class: "feedback-modal-message" }, this.errorMessage)) : (h("span", null))), h("div", { class: "feedback-modal-footer" }, h("div", { class: "feedback-logo", style: { display: this.whitelabel ? 'none' : 'block' } }, "Powered by", ' ', h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")), this.footerText && (h("div", { class: "feedback-footer-text" }, h("span", { innerHTML: this.footerText }))))))));
9113
9124
  }
9114
9125
  componentDidRender() {
9115
9126
  if (this.showModal) {
@@ -9129,36 +9140,37 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
9129
9140
  static get style() { return feedbackModalCss; }
9130
9141
  }, [1, "feedback-modal", {
9131
9142
  "customFont": [4, "custom-font"],
9143
+ "emailAddress": [1, "email-address"],
9144
+ "hideEmail": [4, "hide-email"],
9145
+ "isEmailRequired": [4, "is-email-required"],
9146
+ "ratingMode": [1, "rating-mode"],
9147
+ "hasSelectedElement": [1540, "has-selected-element"],
9148
+ "hidePrivacyPolicy": [4, "hide-privacy-policy"],
9149
+ "hideRating": [4, "hide-rating"],
9150
+ "hideScreenshotButton": [4, "hide-screenshot-button"],
9151
+ "project": [1],
9152
+ "showScreenshotMode": [1540, "show-screenshot-mode"],
9153
+ "showScreenshotTopBar": [1540, "show-screenshot-top-bar"],
9154
+ "showModal": [1540, "show-modal"],
9155
+ "rating": [2],
9156
+ "fetchData": [4, "fetch-data"],
9157
+ "emailPlaceholder": [1, "email-placeholder"],
9132
9158
  "errorMessage": [1, "error-message"],
9133
9159
  "errorMessage403": [1, "error-message-4-0-3"],
9134
9160
  "errorMessage404": [1, "error-message-4-0-4"],
9161
+ "messagePlaceholder": [1, "message-placeholder"],
9162
+ "footerText": [1, "footer-text"],
9163
+ "modalPosition": [1, "modal-position"],
9135
9164
  "modalTitle": [1, "modal-title"],
9136
- "modalTitleSuccess": [1, "modal-title-success"],
9137
9165
  "modalTitleError": [1, "modal-title-error"],
9138
- "modalPosition": [1, "modal-position"],
9166
+ "modalTitleSuccess": [1, "modal-title-success"],
9167
+ "privacyPolicyText": [1, "privacy-policy-text"],
9168
+ "ratingPlaceholder": [1, "rating-placeholder"],
9169
+ "ratingStarsPlaceholder": [1, "rating-stars-placeholder"],
9139
9170
  "sendButtonText": [1, "send-button-text"],
9140
- "successMessage": [1, "success-message"],
9141
- "project": [1],
9142
9171
  "screenshotButtonText": [1, "screenshot-button-text"],
9143
9172
  "screenshotTopbarText": [1, "screenshot-topbar-text"],
9144
- "hideEmail": [4, "hide-email"],
9145
- "emailAddress": [1, "email-address"],
9146
- "emailPlaceholder": [1, "email-placeholder"],
9147
- "messagePlaceholder": [1, "message-placeholder"],
9148
- "hideRating": [4, "hide-rating"],
9149
- "rating": [2],
9150
- "ratingMode": [1, "rating-mode"],
9151
- "ratingPlaceholder": [1, "rating-placeholder"],
9152
- "ratingStarsPlaceholder": [1, "rating-stars-placeholder"],
9153
- "footerText": [1, "footer-text"],
9154
- "showModal": [1540, "show-modal"],
9155
- "showScreenshotMode": [1540, "show-screenshot-mode"],
9156
- "showScreenshotTopBar": [1540, "show-screenshot-top-bar"],
9157
- "hasSelectedElement": [1540, "has-selected-element"],
9158
- "hideScreenshotButton": [4, "hide-screenshot-button"],
9159
- "hidePrivacyPolicy": [4, "hide-privacy-policy"],
9160
- "privacyPolicyText": [1, "privacy-policy-text"],
9161
- "fetchData": [4, "fetch-data"],
9173
+ "successMessage": [1, "success-message"],
9162
9174
  "sending": [32],
9163
9175
  "formMessage": [32],
9164
9176
  "formEmail": [32],