pushfeedback 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/cjs/feedback-button_2.cjs.entry.js +1049 -0
  2. package/dist/cjs/index-d5ac8167.js +1469 -0
  3. package/dist/cjs/index.cjs.js +2 -0
  4. package/dist/cjs/loader.cjs.js +22 -0
  5. package/dist/cjs/pushfeedback.cjs.js +23 -0
  6. package/dist/collection/collection-manifest.json +13 -0
  7. package/dist/collection/components/feedback-button/feedback-button.css +57 -0
  8. package/dist/collection/components/feedback-button/feedback-button.js +343 -0
  9. package/dist/collection/components/feedback-modal/feedback-modal.css +222 -0
  10. package/dist/collection/components/feedback-modal/feedback-modal.js +529 -0
  11. package/dist/collection/index.js +1 -0
  12. package/dist/{pushfeedback/feedback-button.entry.js → components/feedback-button.js} +48 -8
  13. package/dist/components/feedback-modal.js +6 -0
  14. package/dist/{pushfeedback/feedback-modal.entry.js → components/feedback-modal2.js} +63 -50
  15. package/dist/components/index.js +3 -0
  16. package/dist/esm/feedback-button_2.entry.js +1044 -0
  17. package/dist/esm/index-74109694.js +1441 -0
  18. package/dist/esm/index.js +1 -0
  19. package/dist/esm/loader.js +18 -0
  20. package/dist/esm/polyfills/core-js.js +11 -0
  21. package/dist/esm/polyfills/css-shim.js +1 -0
  22. package/dist/esm/polyfills/dom.js +79 -0
  23. package/dist/esm/polyfills/es5-html-element.js +1 -0
  24. package/dist/esm/polyfills/index.js +34 -0
  25. package/dist/esm/polyfills/system.js +6 -0
  26. package/dist/esm/pushfeedback.js +18 -0
  27. package/dist/index.cjs.js +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/pushfeedback/index.esm.js +0 -1
  30. package/dist/pushfeedback/p-09647793.entry.js +1 -0
  31. package/dist/pushfeedback/p-38d135e1.js +2 -0
  32. package/dist/pushfeedback/pushfeedback.css +1 -55
  33. package/dist/pushfeedback/pushfeedback.esm.js +1 -148
  34. package/dist/types/components/feedback-modal/feedback-modal.d.ts +5 -2
  35. package/dist/types/components.d.ts +8 -4
  36. package/package.json +2 -2
  37. package/dist/pushfeedback/app-globals-0f993ce5.js +0 -3
  38. package/dist/pushfeedback/css-shim-b7d3d95f.js +0 -4
  39. package/dist/pushfeedback/dom-64053c71.js +0 -73
  40. package/dist/pushfeedback/index-e4444da7.js +0 -3371
  41. package/dist/pushfeedback/shadow-css-008a49f5.js +0 -387
@@ -0,0 +1,1049 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-d5ac8167.js');
6
+
7
+ const feedbackButtonCss = ".feedback-button-content{cursor:pointer;z-index:300}.feedback-button-content--light{align-items:center;background-color:var(--feedback-white-color);border-radius:20px;box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;display:flex;font-family:var(--feedback-font-family);color:var(--feedback-primary-color);font-weight:bold;padding:8px 15px;font-size:var(--feedback-text-font-size)}.feedback-button-content--dark{align-items:center;background-color:var(--feedback-primary-color);border-radius:20px;box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;display:flex;font-family:var(--feedback-font-family);color:var(--feedback-white-color);font-weight:bold;padding:8px 15px;font-size:16px}.feedback-button-content--bottom-right{position:fixed;bottom:10px;right:10px}.feedback-button-content--center-right{position:fixed;top:50%;transform:rotate(-90deg) translateY(-50%)}.feedback-button-content--center-right.feedback-button-content--dark,.feedback-button-content--center-right.feedback-button-content--light{border-radius:4px;border-bottom-right-radius:0px;border-bottom-left-radius:0px}.feedback-button-content-icon{margin-right:5px;height:16px;width:16px}";
8
+
9
+ const FeedbackButton = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.modalTitle = 'Share your feedback';
13
+ this.successModalTitle = 'Thanks for your feedback!';
14
+ this.errorModalTitle = "Oops! We didn't receive your feedback. Please try again later.";
15
+ this.modalPosition = 'center';
16
+ this.sendButtonText = 'Send';
17
+ this.project = '';
18
+ this.screenshotButtonTooltipText = 'Take a Screenshot';
19
+ this.screenshotTopbarText = 'SELECT AN ELEMENT ON THE PAGE';
20
+ this.email = '';
21
+ this.emailPlaceholder = 'Email address (optional)';
22
+ this.messagePlaceholder = 'How could this page be more helpful?';
23
+ this.buttonStyle = 'default';
24
+ this.buttonPosition = 'default';
25
+ this.hideIcon = false;
26
+ this.hideScreenshotButton = false;
27
+ }
28
+ connectedCallback() {
29
+ this.feedbackModal = document.createElement('feedback-modal');
30
+ const props = [
31
+ 'modalTitle',
32
+ 'successModalTitle',
33
+ 'errorModalTitle',
34
+ 'modalPosition',
35
+ 'sendButtonText',
36
+ 'project',
37
+ 'screenshotButtonTooltipText',
38
+ 'screenshotTopbarText',
39
+ 'email',
40
+ 'emailPlaceholder',
41
+ 'messagePlaceholder',
42
+ 'hideScreenshotButton'
43
+ ];
44
+ props.forEach(prop => {
45
+ this.feedbackModal[prop] = this[prop];
46
+ });
47
+ document.body.appendChild(this.feedbackModal);
48
+ }
49
+ disconnectedCallback() {
50
+ document.body.removeChild(this.feedbackModal);
51
+ }
52
+ componentDidLoad() {
53
+ if (this.buttonPosition === 'center-right') {
54
+ const buttonContent = this.el.shadowRoot.querySelector('.feedback-button-content');
55
+ buttonContent.style.right = `${buttonContent.offsetWidth / 2 * -1}px`;
56
+ }
57
+ }
58
+ showModal() {
59
+ this.feedbackModal.showModal = true;
60
+ }
61
+ render() {
62
+ return (index.h(index.Host, null, index.h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition}`, onClick: () => this.showModal() }, !this.hideIcon && this.buttonStyle === 'dark' && (index.h("span", { class: "feedback-button-content-icon" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-repeat" }, index.h("polyline", { points: "17 1 21 5 17 9" }), index.h("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), index.h("polyline", { points: "7 23 3 19 7 15" }), index.h("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })))), !this.hideIcon && this.buttonStyle === 'light' && (index.h("span", { class: "feedback-button-content-icon" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#0070F4", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-repeat" }, index.h("polyline", { points: "17 1 21 5 17 9" }), index.h("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), index.h("polyline", { points: "7 23 3 19 7 15" }), index.h("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })))), index.h("slot", null))));
63
+ }
64
+ get el() { return index.getElement(this); }
65
+ };
66
+ FeedbackButton.style = feedbackButtonCss;
67
+
68
+ function createCommonjsModule(fn, basedir, module) {
69
+ return module = {
70
+ path: basedir,
71
+ exports: {},
72
+ require: function (path, base) {
73
+ return commonjsRequire();
74
+ }
75
+ }, fn(module, module.exports), module.exports;
76
+ }
77
+
78
+ function commonjsRequire () {
79
+ throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
80
+ }
81
+
82
+ var domToImage = createCommonjsModule(function (module) {
83
+ (function (global) {
84
+
85
+ var util = newUtil();
86
+ var inliner = newInliner();
87
+ var fontFaces = newFontFaces();
88
+ var images = newImages();
89
+
90
+ // Default impl options
91
+ var defaultOptions = {
92
+ // Default is to fail on error, no placeholder
93
+ imagePlaceholder: undefined,
94
+ // Default cache bust is false, it will use the cache
95
+ cacheBust: false
96
+ };
97
+
98
+ var domtoimage = {
99
+ toSvg: toSvg,
100
+ toPng: toPng,
101
+ toJpeg: toJpeg,
102
+ toBlob: toBlob,
103
+ toPixelData: toPixelData,
104
+ impl: {
105
+ fontFaces: fontFaces,
106
+ images: images,
107
+ util: util,
108
+ inliner: inliner,
109
+ options: {}
110
+ }
111
+ };
112
+
113
+ module.exports = domtoimage;
114
+
115
+
116
+ /**
117
+ * @param {Node} node - The DOM Node object to render
118
+ * @param {Object} options - Rendering options
119
+ * @param {Function} options.filter - Should return true if passed node should be included in the output
120
+ * (excluding node means excluding it's children as well). Not called on the root node.
121
+ * @param {String} options.bgcolor - color for the background, any valid CSS color value.
122
+ * @param {Number} options.width - width to be applied to node before rendering.
123
+ * @param {Number} options.height - height to be applied to node before rendering.
124
+ * @param {Object} options.style - an object whose properties to be copied to node's style before rendering.
125
+ * @param {Number} options.quality - a Number between 0 and 1 indicating image quality (applicable to JPEG only),
126
+ defaults to 1.0.
127
+ * @param {String} options.imagePlaceholder - dataURL to use as a placeholder for failed images, default behaviour is to fail fast on images we can't fetch
128
+ * @param {Boolean} options.cacheBust - set to true to cache bust by appending the time to the request url
129
+ * @return {Promise} - A promise that is fulfilled with a SVG image data URL
130
+ * */
131
+ function toSvg(node, options) {
132
+ options = options || {};
133
+ copyOptions(options);
134
+ return Promise.resolve(node)
135
+ .then(function (node) {
136
+ return cloneNode(node, options.filter, true);
137
+ })
138
+ .then(embedFonts)
139
+ .then(inlineImages)
140
+ .then(applyOptions)
141
+ .then(function (clone) {
142
+ return makeSvgDataUri(clone,
143
+ options.width || util.width(node),
144
+ options.height || util.height(node)
145
+ );
146
+ });
147
+
148
+ function applyOptions(clone) {
149
+ if (options.bgcolor) clone.style.backgroundColor = options.bgcolor;
150
+
151
+ if (options.width) clone.style.width = options.width + 'px';
152
+ if (options.height) clone.style.height = options.height + 'px';
153
+
154
+ if (options.style)
155
+ Object.keys(options.style).forEach(function (property) {
156
+ clone.style[property] = options.style[property];
157
+ });
158
+
159
+ return clone;
160
+ }
161
+ }
162
+
163
+ /**
164
+ * @param {Node} node - The DOM Node object to render
165
+ * @param {Object} options - Rendering options, @see {@link toSvg}
166
+ * @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
167
+ * */
168
+ function toPixelData(node, options) {
169
+ return draw(node, options || {})
170
+ .then(function (canvas) {
171
+ return canvas.getContext('2d').getImageData(
172
+ 0,
173
+ 0,
174
+ util.width(node),
175
+ util.height(node)
176
+ ).data;
177
+ });
178
+ }
179
+
180
+ /**
181
+ * @param {Node} node - The DOM Node object to render
182
+ * @param {Object} options - Rendering options, @see {@link toSvg}
183
+ * @return {Promise} - A promise that is fulfilled with a PNG image data URL
184
+ * */
185
+ function toPng(node, options) {
186
+ return draw(node, options || {})
187
+ .then(function (canvas) {
188
+ return canvas.toDataURL();
189
+ });
190
+ }
191
+
192
+ /**
193
+ * @param {Node} node - The DOM Node object to render
194
+ * @param {Object} options - Rendering options, @see {@link toSvg}
195
+ * @return {Promise} - A promise that is fulfilled with a JPEG image data URL
196
+ * */
197
+ function toJpeg(node, options) {
198
+ options = options || {};
199
+ return draw(node, options)
200
+ .then(function (canvas) {
201
+ return canvas.toDataURL('image/jpeg', options.quality || 1.0);
202
+ });
203
+ }
204
+
205
+ /**
206
+ * @param {Node} node - The DOM Node object to render
207
+ * @param {Object} options - Rendering options, @see {@link toSvg}
208
+ * @return {Promise} - A promise that is fulfilled with a PNG image blob
209
+ * */
210
+ function toBlob(node, options) {
211
+ return draw(node, options || {})
212
+ .then(util.canvasToBlob);
213
+ }
214
+
215
+ function copyOptions(options) {
216
+ // Copy options to impl options for use in impl
217
+ if(typeof(options.imagePlaceholder) === 'undefined') {
218
+ domtoimage.impl.options.imagePlaceholder = defaultOptions.imagePlaceholder;
219
+ } else {
220
+ domtoimage.impl.options.imagePlaceholder = options.imagePlaceholder;
221
+ }
222
+
223
+ if(typeof(options.cacheBust) === 'undefined') {
224
+ domtoimage.impl.options.cacheBust = defaultOptions.cacheBust;
225
+ } else {
226
+ domtoimage.impl.options.cacheBust = options.cacheBust;
227
+ }
228
+ }
229
+
230
+ function draw(domNode, options) {
231
+ return toSvg(domNode, options)
232
+ .then(util.makeImage)
233
+ .then(util.delay(100))
234
+ .then(function (image) {
235
+ var canvas = newCanvas(domNode);
236
+ canvas.getContext('2d').drawImage(image, 0, 0);
237
+ return canvas;
238
+ });
239
+
240
+ function newCanvas(domNode) {
241
+ var canvas = document.createElement('canvas');
242
+ canvas.width = options.width || util.width(domNode);
243
+ canvas.height = options.height || util.height(domNode);
244
+
245
+ if (options.bgcolor) {
246
+ var ctx = canvas.getContext('2d');
247
+ ctx.fillStyle = options.bgcolor;
248
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
249
+ }
250
+
251
+ return canvas;
252
+ }
253
+ }
254
+
255
+ function cloneNode(node, filter, root) {
256
+ if (!root && filter && !filter(node)) return Promise.resolve();
257
+
258
+ return Promise.resolve(node)
259
+ .then(makeNodeCopy)
260
+ .then(function (clone) {
261
+ return cloneChildren(node, clone, filter);
262
+ })
263
+ .then(function (clone) {
264
+ return processClone(node, clone);
265
+ });
266
+
267
+ function makeNodeCopy(node) {
268
+ if (node instanceof HTMLCanvasElement) return util.makeImage(node.toDataURL());
269
+ return node.cloneNode(false);
270
+ }
271
+
272
+ function cloneChildren(original, clone, filter) {
273
+ var children = original.childNodes;
274
+ if (children.length === 0) return Promise.resolve(clone);
275
+
276
+ return cloneChildrenInOrder(clone, util.asArray(children), filter)
277
+ .then(function () {
278
+ return clone;
279
+ });
280
+
281
+ function cloneChildrenInOrder(parent, children, filter) {
282
+ var done = Promise.resolve();
283
+ children.forEach(function (child) {
284
+ done = done
285
+ .then(function () {
286
+ return cloneNode(child, filter);
287
+ })
288
+ .then(function (childClone) {
289
+ if (childClone) parent.appendChild(childClone);
290
+ });
291
+ });
292
+ return done;
293
+ }
294
+ }
295
+
296
+ function processClone(original, clone) {
297
+ if (!(clone instanceof Element)) return clone;
298
+
299
+ return Promise.resolve()
300
+ .then(cloneStyle)
301
+ .then(clonePseudoElements)
302
+ .then(copyUserInput)
303
+ .then(fixSvg)
304
+ .then(function () {
305
+ return clone;
306
+ });
307
+
308
+ function cloneStyle() {
309
+ copyStyle(window.getComputedStyle(original), clone.style);
310
+
311
+ function copyStyle(source, target) {
312
+ if (source.cssText) target.cssText = source.cssText;
313
+ else copyProperties(source, target);
314
+
315
+ function copyProperties(source, target) {
316
+ util.asArray(source).forEach(function (name) {
317
+ target.setProperty(
318
+ name,
319
+ source.getPropertyValue(name),
320
+ source.getPropertyPriority(name)
321
+ );
322
+ });
323
+ }
324
+ }
325
+ }
326
+
327
+ function clonePseudoElements() {
328
+ [':before', ':after'].forEach(function (element) {
329
+ clonePseudoElement(element);
330
+ });
331
+
332
+ function clonePseudoElement(element) {
333
+ var style = window.getComputedStyle(original, element);
334
+ var content = style.getPropertyValue('content');
335
+
336
+ if (content === '' || content === 'none') return;
337
+
338
+ var className = util.uid();
339
+ clone.className = clone.className + ' ' + className;
340
+ var styleElement = document.createElement('style');
341
+ styleElement.appendChild(formatPseudoElementStyle(className, element, style));
342
+ clone.appendChild(styleElement);
343
+
344
+ function formatPseudoElementStyle(className, element, style) {
345
+ var selector = '.' + className + ':' + element;
346
+ var cssText = style.cssText ? formatCssText(style) : formatCssProperties(style);
347
+ return document.createTextNode(selector + '{' + cssText + '}');
348
+
349
+ function formatCssText(style) {
350
+ var content = style.getPropertyValue('content');
351
+ return style.cssText + ' content: ' + content + ';';
352
+ }
353
+
354
+ function formatCssProperties(style) {
355
+
356
+ return util.asArray(style)
357
+ .map(formatProperty)
358
+ .join('; ') + ';';
359
+
360
+ function formatProperty(name) {
361
+ return name + ': ' +
362
+ style.getPropertyValue(name) +
363
+ (style.getPropertyPriority(name) ? ' !important' : '');
364
+ }
365
+ }
366
+ }
367
+ }
368
+ }
369
+
370
+ function copyUserInput() {
371
+ if (original instanceof HTMLTextAreaElement) clone.innerHTML = original.value;
372
+ if (original instanceof HTMLInputElement) clone.setAttribute("value", original.value);
373
+ }
374
+
375
+ function fixSvg() {
376
+ if (!(clone instanceof SVGElement)) return;
377
+ clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
378
+
379
+ if (!(clone instanceof SVGRectElement)) return;
380
+ ['width', 'height'].forEach(function (attribute) {
381
+ var value = clone.getAttribute(attribute);
382
+ if (!value) return;
383
+
384
+ clone.style.setProperty(attribute, value);
385
+ });
386
+ }
387
+ }
388
+ }
389
+
390
+ function embedFonts(node) {
391
+ return fontFaces.resolveAll()
392
+ .then(function (cssText) {
393
+ var styleNode = document.createElement('style');
394
+ node.appendChild(styleNode);
395
+ styleNode.appendChild(document.createTextNode(cssText));
396
+ return node;
397
+ });
398
+ }
399
+
400
+ function inlineImages(node) {
401
+ return images.inlineAll(node)
402
+ .then(function () {
403
+ return node;
404
+ });
405
+ }
406
+
407
+ function makeSvgDataUri(node, width, height) {
408
+ return Promise.resolve(node)
409
+ .then(function (node) {
410
+ node.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
411
+ return new XMLSerializer().serializeToString(node);
412
+ })
413
+ .then(util.escapeXhtml)
414
+ .then(function (xhtml) {
415
+ return '<foreignObject x="0" y="0" width="100%" height="100%">' + xhtml + '</foreignObject>';
416
+ })
417
+ .then(function (foreignObject) {
418
+ return '<svg xmlns="http://www.w3.org/2000/svg" width="' + width + '" height="' + height + '">' +
419
+ foreignObject + '</svg>';
420
+ })
421
+ .then(function (svg) {
422
+ return 'data:image/svg+xml;charset=utf-8,' + svg;
423
+ });
424
+ }
425
+
426
+ function newUtil() {
427
+ return {
428
+ escape: escape,
429
+ parseExtension: parseExtension,
430
+ mimeType: mimeType,
431
+ dataAsUrl: dataAsUrl,
432
+ isDataUrl: isDataUrl,
433
+ canvasToBlob: canvasToBlob,
434
+ resolveUrl: resolveUrl,
435
+ getAndEncode: getAndEncode,
436
+ uid: uid(),
437
+ delay: delay,
438
+ asArray: asArray,
439
+ escapeXhtml: escapeXhtml,
440
+ makeImage: makeImage,
441
+ width: width,
442
+ height: height
443
+ };
444
+
445
+ function mimes() {
446
+ /*
447
+ * Only WOFF and EOT mime types for fonts are 'real'
448
+ * see http://www.iana.org/assignments/media-types/media-types.xhtml
449
+ */
450
+ var WOFF = 'application/font-woff';
451
+ var JPEG = 'image/jpeg';
452
+
453
+ return {
454
+ 'woff': WOFF,
455
+ 'woff2': WOFF,
456
+ 'ttf': 'application/font-truetype',
457
+ 'eot': 'application/vnd.ms-fontobject',
458
+ 'png': 'image/png',
459
+ 'jpg': JPEG,
460
+ 'jpeg': JPEG,
461
+ 'gif': 'image/gif',
462
+ 'tiff': 'image/tiff',
463
+ 'svg': 'image/svg+xml'
464
+ };
465
+ }
466
+
467
+ function parseExtension(url) {
468
+ var match = /\.([^\.\/]*?)$/g.exec(url);
469
+ if (match) return match[1];
470
+ else return '';
471
+ }
472
+
473
+ function mimeType(url) {
474
+ var extension = parseExtension(url).toLowerCase();
475
+ return mimes()[extension] || '';
476
+ }
477
+
478
+ function isDataUrl(url) {
479
+ return url.search(/^(data:)/) !== -1;
480
+ }
481
+
482
+ function toBlob(canvas) {
483
+ return new Promise(function (resolve) {
484
+ var binaryString = window.atob(canvas.toDataURL().split(',')[1]);
485
+ var length = binaryString.length;
486
+ var binaryArray = new Uint8Array(length);
487
+
488
+ for (var i = 0; i < length; i++)
489
+ binaryArray[i] = binaryString.charCodeAt(i);
490
+
491
+ resolve(new Blob([binaryArray], {
492
+ type: 'image/png'
493
+ }));
494
+ });
495
+ }
496
+
497
+ function canvasToBlob(canvas) {
498
+ if (canvas.toBlob)
499
+ return new Promise(function (resolve) {
500
+ canvas.toBlob(resolve);
501
+ });
502
+
503
+ return toBlob(canvas);
504
+ }
505
+
506
+ function resolveUrl(url, baseUrl) {
507
+ var doc = document.implementation.createHTMLDocument();
508
+ var base = doc.createElement('base');
509
+ doc.head.appendChild(base);
510
+ var a = doc.createElement('a');
511
+ doc.body.appendChild(a);
512
+ base.href = baseUrl;
513
+ a.href = url;
514
+ return a.href;
515
+ }
516
+
517
+ function uid() {
518
+ var index = 0;
519
+
520
+ return function () {
521
+ return 'u' + fourRandomChars() + index++;
522
+
523
+ function fourRandomChars() {
524
+ /* see http://stackoverflow.com/a/6248722/2519373 */
525
+ return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);
526
+ }
527
+ };
528
+ }
529
+
530
+ function makeImage(uri) {
531
+ return new Promise(function (resolve, reject) {
532
+ var image = new Image();
533
+ image.onload = function () {
534
+ resolve(image);
535
+ };
536
+ image.onerror = reject;
537
+ image.src = uri;
538
+ });
539
+ }
540
+
541
+ function getAndEncode(url) {
542
+ var TIMEOUT = 30000;
543
+ if(domtoimage.impl.options.cacheBust) {
544
+ // Cache bypass so we dont have CORS issues with cached images
545
+ // Source: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
546
+ url += ((/\?/).test(url) ? "&" : "?") + (new Date()).getTime();
547
+ }
548
+
549
+ return new Promise(function (resolve) {
550
+ var request = new XMLHttpRequest();
551
+
552
+ request.onreadystatechange = done;
553
+ request.ontimeout = timeout;
554
+ request.responseType = 'blob';
555
+ request.timeout = TIMEOUT;
556
+ request.open('GET', url, true);
557
+ request.send();
558
+
559
+ var placeholder;
560
+ if(domtoimage.impl.options.imagePlaceholder) {
561
+ var split = domtoimage.impl.options.imagePlaceholder.split(/,/);
562
+ if(split && split[1]) {
563
+ placeholder = split[1];
564
+ }
565
+ }
566
+
567
+ function done() {
568
+ if (request.readyState !== 4) return;
569
+
570
+ if (request.status !== 200) {
571
+ if(placeholder) {
572
+ resolve(placeholder);
573
+ } else {
574
+ fail('cannot fetch resource: ' + url + ', status: ' + request.status);
575
+ }
576
+
577
+ return;
578
+ }
579
+
580
+ var encoder = new FileReader();
581
+ encoder.onloadend = function () {
582
+ var content = encoder.result.split(/,/)[1];
583
+ resolve(content);
584
+ };
585
+ encoder.readAsDataURL(request.response);
586
+ }
587
+
588
+ function timeout() {
589
+ if(placeholder) {
590
+ resolve(placeholder);
591
+ } else {
592
+ fail('timeout of ' + TIMEOUT + 'ms occured while fetching resource: ' + url);
593
+ }
594
+ }
595
+
596
+ function fail(message) {
597
+ console.error(message);
598
+ resolve('');
599
+ }
600
+ });
601
+ }
602
+
603
+ function dataAsUrl(content, type) {
604
+ return 'data:' + type + ';base64,' + content;
605
+ }
606
+
607
+ function escape(string) {
608
+ return string.replace(/([.*+?^${}()|\[\]\/\\])/g, '\\$1');
609
+ }
610
+
611
+ function delay(ms) {
612
+ return function (arg) {
613
+ return new Promise(function (resolve) {
614
+ setTimeout(function () {
615
+ resolve(arg);
616
+ }, ms);
617
+ });
618
+ };
619
+ }
620
+
621
+ function asArray(arrayLike) {
622
+ var array = [];
623
+ var length = arrayLike.length;
624
+ for (var i = 0; i < length; i++) array.push(arrayLike[i]);
625
+ return array;
626
+ }
627
+
628
+ function escapeXhtml(string) {
629
+ return string.replace(/#/g, '%23').replace(/\n/g, '%0A');
630
+ }
631
+
632
+ function width(node) {
633
+ var leftBorder = px(node, 'border-left-width');
634
+ var rightBorder = px(node, 'border-right-width');
635
+ return node.scrollWidth + leftBorder + rightBorder;
636
+ }
637
+
638
+ function height(node) {
639
+ var topBorder = px(node, 'border-top-width');
640
+ var bottomBorder = px(node, 'border-bottom-width');
641
+ return node.scrollHeight + topBorder + bottomBorder;
642
+ }
643
+
644
+ function px(node, styleProperty) {
645
+ var value = window.getComputedStyle(node).getPropertyValue(styleProperty);
646
+ return parseFloat(value.replace('px', ''));
647
+ }
648
+ }
649
+
650
+ function newInliner() {
651
+ var URL_REGEX = /url\(['"]?([^'"]+?)['"]?\)/g;
652
+
653
+ return {
654
+ inlineAll: inlineAll,
655
+ shouldProcess: shouldProcess,
656
+ impl: {
657
+ readUrls: readUrls,
658
+ inline: inline
659
+ }
660
+ };
661
+
662
+ function shouldProcess(string) {
663
+ return string.search(URL_REGEX) !== -1;
664
+ }
665
+
666
+ function readUrls(string) {
667
+ var result = [];
668
+ var match;
669
+ while ((match = URL_REGEX.exec(string)) !== null) {
670
+ result.push(match[1]);
671
+ }
672
+ return result.filter(function (url) {
673
+ return !util.isDataUrl(url);
674
+ });
675
+ }
676
+
677
+ function inline(string, url, baseUrl, get) {
678
+ return Promise.resolve(url)
679
+ .then(function (url) {
680
+ return baseUrl ? util.resolveUrl(url, baseUrl) : url;
681
+ })
682
+ .then(get || util.getAndEncode)
683
+ .then(function (data) {
684
+ return util.dataAsUrl(data, util.mimeType(url));
685
+ })
686
+ .then(function (dataUrl) {
687
+ return string.replace(urlAsRegex(url), '$1' + dataUrl + '$3');
688
+ });
689
+
690
+ function urlAsRegex(url) {
691
+ return new RegExp('(url\\([\'"]?)(' + util.escape(url) + ')([\'"]?\\))', 'g');
692
+ }
693
+ }
694
+
695
+ function inlineAll(string, baseUrl, get) {
696
+ if (nothingToInline()) return Promise.resolve(string);
697
+
698
+ return Promise.resolve(string)
699
+ .then(readUrls)
700
+ .then(function (urls) {
701
+ var done = Promise.resolve(string);
702
+ urls.forEach(function (url) {
703
+ done = done.then(function (string) {
704
+ return inline(string, url, baseUrl, get);
705
+ });
706
+ });
707
+ return done;
708
+ });
709
+
710
+ function nothingToInline() {
711
+ return !shouldProcess(string);
712
+ }
713
+ }
714
+ }
715
+
716
+ function newFontFaces() {
717
+ return {
718
+ resolveAll: resolveAll,
719
+ impl: {
720
+ readAll: readAll
721
+ }
722
+ };
723
+
724
+ function resolveAll() {
725
+ return readAll()
726
+ .then(function (webFonts) {
727
+ return Promise.all(
728
+ webFonts.map(function (webFont) {
729
+ return webFont.resolve();
730
+ })
731
+ );
732
+ })
733
+ .then(function (cssStrings) {
734
+ return cssStrings.join('\n');
735
+ });
736
+ }
737
+
738
+ function readAll() {
739
+ return Promise.resolve(util.asArray(document.styleSheets))
740
+ .then(getCssRules)
741
+ .then(selectWebFontRules)
742
+ .then(function (rules) {
743
+ return rules.map(newWebFont);
744
+ });
745
+
746
+ function selectWebFontRules(cssRules) {
747
+ return cssRules
748
+ .filter(function (rule) {
749
+ return rule.type === CSSRule.FONT_FACE_RULE;
750
+ })
751
+ .filter(function (rule) {
752
+ return inliner.shouldProcess(rule.style.getPropertyValue('src'));
753
+ });
754
+ }
755
+
756
+ function getCssRules(styleSheets) {
757
+ var cssRules = [];
758
+ styleSheets.forEach(function (sheet) {
759
+ try {
760
+ util.asArray(sheet.cssRules || []).forEach(cssRules.push.bind(cssRules));
761
+ } catch (e) {
762
+ console.log('Error while reading CSS rules from ' + sheet.href, e.toString());
763
+ }
764
+ });
765
+ return cssRules;
766
+ }
767
+
768
+ function newWebFont(webFontRule) {
769
+ return {
770
+ resolve: function resolve() {
771
+ var baseUrl = (webFontRule.parentStyleSheet || {}).href;
772
+ return inliner.inlineAll(webFontRule.cssText, baseUrl);
773
+ },
774
+ src: function () {
775
+ return webFontRule.style.getPropertyValue('src');
776
+ }
777
+ };
778
+ }
779
+ }
780
+ }
781
+
782
+ function newImages() {
783
+ return {
784
+ inlineAll: inlineAll,
785
+ impl: {
786
+ newImage: newImage
787
+ }
788
+ };
789
+
790
+ function newImage(element) {
791
+ return {
792
+ inline: inline
793
+ };
794
+
795
+ function inline(get) {
796
+ if (util.isDataUrl(element.src)) return Promise.resolve();
797
+
798
+ return Promise.resolve(element.src)
799
+ .then(get || util.getAndEncode)
800
+ .then(function (data) {
801
+ return util.dataAsUrl(data, util.mimeType(element.src));
802
+ })
803
+ .then(function (dataUrl) {
804
+ return new Promise(function (resolve, reject) {
805
+ element.onload = resolve;
806
+ element.onerror = reject;
807
+ element.src = dataUrl;
808
+ });
809
+ });
810
+ }
811
+ }
812
+
813
+ function inlineAll(node) {
814
+ if (!(node instanceof Element)) return Promise.resolve(node);
815
+
816
+ return inlineBackground(node)
817
+ .then(function () {
818
+ if (node instanceof HTMLImageElement)
819
+ return newImage(node).inline();
820
+ else
821
+ return Promise.all(
822
+ util.asArray(node.childNodes).map(function (child) {
823
+ return inlineAll(child);
824
+ })
825
+ );
826
+ });
827
+
828
+ function inlineBackground(node) {
829
+ var background = node.style.getPropertyValue('background');
830
+
831
+ if (!background) return Promise.resolve(node);
832
+
833
+ return inliner.inlineAll(background)
834
+ .then(function (inlined) {
835
+ node.style.setProperty(
836
+ 'background',
837
+ inlined,
838
+ node.style.getPropertyPriority('background')
839
+ );
840
+ })
841
+ .then(function () {
842
+ return node;
843
+ });
844
+ }
845
+ }
846
+ }
847
+ })();
848
+ });
849
+
850
+ const feedbackModalCss = ".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300;left:50%;top:50%;transform:translate(-50%, -50%)}@media screen and (min-width: 768px){.feedback-modal-content.feedback-modal-content--bottom-right{top:initial;left:initial;transform:initial;bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{top:initial;transform:initial;bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{top:initial;transform:initial;right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{transform:initial;left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;justify-content:space-between}.feedback-modal-buttons.single{justify-content:flex-end}.button{background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px;min-height:20px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";
851
+
852
+ const FeedbackModal = class {
853
+ constructor(hostRef) {
854
+ index.registerInstance(this, hostRef);
855
+ this.handleSubmit = async (event) => {
856
+ event.preventDefault();
857
+ this.resetOverflow();
858
+ this.showScreenshotMode = false;
859
+ this.showModal = false;
860
+ this.sending = true;
861
+ let encodedScreenshot = "";
862
+ if (this.encodedScreenshot) {
863
+ await this.encodedScreenshot.then((data) => {
864
+ encodedScreenshot = data;
865
+ }).catch((error) => {
866
+ console.log(error);
867
+ });
868
+ }
869
+ try {
870
+ const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
871
+ method: 'POST',
872
+ body: JSON.stringify({
873
+ url: window.location.href,
874
+ message: this.formMessage,
875
+ email: this.formEmail,
876
+ project: this.project,
877
+ screenshot: encodedScreenshot
878
+ }),
879
+ headers: {
880
+ 'Content-Type': 'application/json'
881
+ }
882
+ });
883
+ if (res.status === 201) {
884
+ this.formSuccess = true;
885
+ this.formError = false;
886
+ }
887
+ else {
888
+ this.formSuccess = false;
889
+ this.formError = true;
890
+ this.formErrorStatus = res.status;
891
+ }
892
+ }
893
+ catch (error) {
894
+ console.log(error);
895
+ this.formSuccess = false;
896
+ this.formError = true;
897
+ this.formErrorStatus = 500;
898
+ }
899
+ finally {
900
+ this.sending = false;
901
+ this.showModal = true;
902
+ }
903
+ };
904
+ this.close = () => {
905
+ this.sending = false;
906
+ this.showModal = false;
907
+ this.showScreenshotMode = false;
908
+ this.hasSelectedElement = false;
909
+ this.encodedScreenshot = null;
910
+ this.formSuccess = false;
911
+ this.formError = false;
912
+ this.formErrorStatus = 500;
913
+ this.formMessage = '';
914
+ this.formEmail = '';
915
+ this.resetOverflow();
916
+ };
917
+ this.openScreenShot = () => {
918
+ this.hasSelectedElement = false;
919
+ this.showModal = false;
920
+ this.showScreenshotMode = true;
921
+ this.encodedScreenshot = null;
922
+ this.resetOverflow();
923
+ };
924
+ this.closeScreenShot = () => {
925
+ this.showModal = false;
926
+ this.showScreenshotMode = false;
927
+ this.hasSelectedElement = false;
928
+ this.encodedScreenshot = null;
929
+ this.overlay.style.display = 'none';
930
+ this.resetOverflow();
931
+ };
932
+ this.handleMouseOverScreenShot = (event) => {
933
+ event.preventDefault();
934
+ if (this.hasSelectedElement)
935
+ return;
936
+ this.overlay.style.display = 'none';
937
+ this.screenshotModal.style.display = 'none';
938
+ const elementUnder = document.elementFromPoint(event.clientX, event.clientY);
939
+ const rect = elementUnder.getBoundingClientRect();
940
+ this.screenshotModal.style.display = '';
941
+ // Get the bounding box of the element selected
942
+ this.elementSelected.style.position = "absolute";
943
+ this.elementSelected.style.left = `${rect.left}px`;
944
+ this.elementSelected.style.top = `${rect.top}px`;
945
+ this.elementSelected.style.width = `${rect.width}px`;
946
+ this.elementSelected.style.height = `${rect.height}px`;
947
+ this.elementSelected.classList.add('feedback-modal-element-hover');
948
+ // Set the background color of nonselected areas
949
+ // Top
950
+ this.topSide.style.position = "absolute";
951
+ this.topSide.style.left = `${rect.left}px`;
952
+ this.topSide.style.top = '0px';
953
+ this.topSide.style.width = `${rect.width + 8}px`;
954
+ this.topSide.style.height = `${rect.top}px`;
955
+ this.topSide.style.backgroundColor = "rgba(0, 0, 0, 0.3)";
956
+ // Left
957
+ this.leftSide.style.position = "absolute";
958
+ this.leftSide.style.left = '0px';
959
+ this.leftSide.style.top = '0px';
960
+ this.leftSide.style.width = `${rect.left}px`;
961
+ this.leftSide.style.height = '100vh';
962
+ this.leftSide.style.backgroundColor = "rgba(0, 0, 0, 0.3)";
963
+ // Bottom
964
+ this.bottomSide.style.position = "absolute";
965
+ this.bottomSide.style.left = `${rect.left}px`;
966
+ this.bottomSide.style.top = `${rect.bottom + 8}px`;
967
+ this.bottomSide.style.width = `${rect.width + 8}px`;
968
+ this.bottomSide.style.height = '100vh';
969
+ this.bottomSide.style.backgroundColor = "rgba(0, 0, 0, 0.3)";
970
+ // Right
971
+ this.rightSide.style.position = "absolute";
972
+ this.rightSide.style.left = `${rect.right + 8}px`;
973
+ this.rightSide.style.top = '0px';
974
+ this.rightSide.style.width = '100%';
975
+ this.rightSide.style.height = '100vh';
976
+ this.rightSide.style.backgroundColor = "rgba(0, 0, 0, 0.3)";
977
+ // Restore the visibility of the screenshot-modal
978
+ this.screenshotModal.style.backgroundColor = 'transparent';
979
+ };
980
+ this.handleMouseClickedSelectedElement = (event) => {
981
+ event.preventDefault();
982
+ if (this.elementSelected)
983
+ this.elementSelected.classList.add('feedback-modal-element-selected');
984
+ let top = this.elementSelected.getBoundingClientRect().top;
985
+ this.elementSelected.style.top = `${top + window.pageYOffset}px`;
986
+ const clonedElementSelected = this.elementSelected.cloneNode(true);
987
+ document.body.appendChild(clonedElementSelected);
988
+ this.elementSelected.style.top = `${top}px`;
989
+ this.encodedScreenshot = domToImage.toPng(document.body, { cacheBust: true })
990
+ .then(function (dataUrl) {
991
+ document.body.removeChild(clonedElementSelected);
992
+ return dataUrl;
993
+ })
994
+ .catch(function (error) {
995
+ console.log(error);
996
+ return "";
997
+ });
998
+ const page = document.getElementsByTagName('html')[0];
999
+ page.style.overflow = 'hidden';
1000
+ this.hasSelectedElement = true;
1001
+ this.overlay.style.display = 'block';
1002
+ this.showModal = true;
1003
+ };
1004
+ this.sending = false;
1005
+ this.formMessage = '';
1006
+ this.formEmail = '';
1007
+ this.formSuccess = false;
1008
+ this.formError = false;
1009
+ this.formErrorStatus = 500;
1010
+ this.encodedScreenshot = undefined;
1011
+ this.modalTitle = 'Share your feedback';
1012
+ this.modalTitleSuccess = 'Thanks for your feedback!';
1013
+ this.modalTitleError = "Oops! We didn't receive your feedback. Please try again later.";
1014
+ this.modalTitleError403 = "Oops! The request URL does not match the one defined in PushFeedback for this project.";
1015
+ this.modalTitleError404 = "Oops! We could not find the provided project id in PushFeedback.";
1016
+ this.modalPosition = 'center';
1017
+ this.sendButtonText = 'Send';
1018
+ this.project = '';
1019
+ this.screenshotButtonTooltipText = 'Take a Screenshot';
1020
+ this.screenshotTopbarText = 'SELECT AN ELEMENT ON THE PAGE';
1021
+ this.email = '';
1022
+ this.emailPlaceholder = 'Email address (optional)';
1023
+ this.messagePlaceholder = 'How could this page be more helpful?';
1024
+ this.showModal = false;
1025
+ this.showScreenshotMode = false;
1026
+ this.hasSelectedElement = false;
1027
+ this.hideScreenshotButton = false;
1028
+ }
1029
+ componentWillLoad() {
1030
+ this.formEmail = this.email;
1031
+ }
1032
+ resetOverflow() {
1033
+ const page = document.getElementsByTagName('html')[0];
1034
+ page.style.overflow = 'inherit';
1035
+ }
1036
+ handleMessageInput(event) {
1037
+ this.formMessage = event.target.value;
1038
+ }
1039
+ handleEmailInput(event) {
1040
+ this.formEmail = event.target.value;
1041
+ }
1042
+ render() {
1043
+ return (index.h("div", { class: "feedback-modal-wrapper" }, this.showScreenshotMode && (index.h("div", { class: "feedback-modal-screenshot", ref: el => (this.screenshotModal = el), onMouseMove: this.handleMouseOverScreenShot }, index.h("div", { class: "feedback-modal-screenshot-element-selected", ref: el => (this.elementSelected = el), onClick: this.handleMouseClickedSelectedElement }), index.h("div", { class: "top-side", ref: el => (this.topSide = el) }), index.h("div", { class: "left-side", ref: el => (this.leftSide = el) }), index.h("div", { class: "bottom-side", ref: el => (this.bottomSide = el) }), index.h("div", { class: "right-side", ref: el => (this.rightSide = el) }), index.h("div", { class: "feedback-modal-screenshot-header", onClick: this.closeScreenShot }, index.h("span", null, this.screenshotTopbarText), index.h("span", { class: "feedback-modal-screenshot-close" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-x" }, index.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), index.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), index.h("div", { class: "feedback-modal-screenshot-overlay", ref: el => (this.overlay = el) }))), this.showModal && (index.h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition}`, ref: el => (this.modalContent = el) }, index.h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (index.h("span", null, this.modalTitle)) : this.formSuccess ? (index.h("span", { class: "text-center" }, this.modalTitleSuccess)) : this.formError && this.formErrorStatus == 500 ? (index.h("span", { class: "text-center" }, this.modalTitleError)) : this.formError && this.formErrorStatus == 403 ? (index.h("span", { class: "text-center" }, this.modalTitleError403)) : this.formError && this.formErrorStatus == 404 ? (index.h("span", { class: "text-center" }, this.modalTitleError404)) : index.h("span", null), index.h("button", { class: "feedback-modal-close", onClick: this.close }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#ccc", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-x" }, index.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), index.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), index.h("div", { class: "feedback-modal-body" }, !this.formSuccess && !this.formError ? (index.h("form", { onSubmit: this.handleSubmit }, index.h("div", { class: "feedback-modal-text" }, index.h("textarea", { placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event), required: true })), !this.email && (index.h("div", { class: "feedback-modal-email" }, index.h("input", { type: "email", placeholder: this.emailPlaceholder, onInput: (event) => this.handleEmailInput(event), value: this.formEmail }))), index.h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}` }, !this.hideScreenshotButton && (index.h("button", { type: "button", class: `button${this.encodedScreenshot ? " active" : ""}`, title: this.screenshotButtonTooltipText, onClick: this.openScreenShot, disabled: this.sending }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-camera" }, index.h("path", { d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" }), index.h("circle", { cx: "12", cy: "13", r: "4" })))), index.h("button", { class: "button", type: "submit", disabled: this.sending }, this.sendButtonText)))) : index.h("span", null)), index.h("div", { class: "feedback-modal-footer" }, index.h("div", { class: "feedback-logo" }, index.h("svg", { class: "w-8 h-8", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg" }, index.h("defs", null, index.h("radialGradient", { cx: "21.152%", cy: "86.063%", fx: "21.152%", fy: "86.063%", r: "79.941%", id: "footer-logo" }, index.h("stop", { "stop-color": "#4FD1C5", offset: "0%" }), index.h("stop", { "stop-color": "#81E6D9", offset: "25.871%" }), index.h("stop", { "stop-color": "#338CF5", offset: "100%" }))), index.h("rect", { width: "32", height: "32", rx: "16", fill: "url(#footer-logo)", "fill-rule": "nonzero" })), " ", index.h("a", { href: "https://pushfeedback.com" }, "PushFeedback")))))));
1044
+ }
1045
+ };
1046
+ FeedbackModal.style = feedbackModalCss;
1047
+
1048
+ exports.feedback_button = FeedbackButton;
1049
+ exports.feedback_modal = FeedbackModal;