gleap 19.1.1 → 19.2.1

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.
@@ -0,0 +1 @@
1
+ (()=>{var e="data-gleap-survey-ready",t="undefined"!=typeof document?document.currentScript:null,n=t&&t.dataset||{},a=null,i=!1,r=function(r){if(!r.hasAttribute(e)){r.setAttribute(e,"true");var o=r.getAttribute("data-gleap-survey");if(o){var d=r.getAttribute("data-mode")||"inline",u=function(e){var t={},n=e.dataset||{};return Object.keys(n).forEach((function(e){if(0===e.indexOf("field")&&e.length>5){var a=e.charAt(5).toLowerCase()+e.slice(6);t[a]=String(n[e])}})),t}(r);if("inline"===d){if(i)return void console.warn("[Gleap] survey embed: only one inline survey per page.");i=!0}(window.Gleap&&"function"==typeof window.Gleap.initialize?Promise.resolve(window.Gleap):a||(a=new Promise((function(e,a){var i=document.createElement("script");i.src=n.sdkSrc||"https://sdk.gleap.io/latest/index.js",i.async=!0,t&&t.nonce&&(i.nonce=t.nonce),i.onload=function(){return window.Gleap?e(window.Gleap):a(new Error("Gleap SDK missing"))},i.onerror=function(){return a(new Error("Gleap SDK failed to load"))},(document.head||document.body).appendChild(i)})))).then((function(e){if(function(e,t){var a="function"==typeof e.getInstance?e.getInstance():null;if(a&&a.initialized)return!0;var i=t.getAttribute("data-api-key")||n.apiKey;if(!i)return console.warn("[Gleap] survey embed: data-api-key is missing."),!1;var r=t.getAttribute("data-region")||n.region;r&&"eu"!==r&&"function"==typeof e.setRegion&&e.setRegion(r);var o=t.getAttribute("data-language")||n.language;return o&&e.setLanguage(o),e.showFeedbackButton(!1),e.setDisableInAppNotifications(!0),e.initialize(i),!0}(e,r))if("inline"!==d){var t={format:"full"===r.getAttribute("data-format")?"full":"card",fields:u};if("tab"!==d){var a=parseFloat(r.getAttribute("data-delay")||"0");setTimeout((function(){e.showSurvey(o,t)}),isNaN(a)?0:1e3*Math.max(0,a))}else!function(e,t,n,a){var i=document.createElement("button");i.type="button",i.textContent=t.getAttribute("data-label")||"Feedback",i.setAttribute("aria-label",i.textContent);var r="left"===t.getAttribute("data-position"),o=i.style;o.position="fixed",o.top="50%",o[r?"left":"right"]="0",o.transform="translateY(-50%) rotate(180deg)",o.writingMode="vertical-rl",o.zIndex="2147483000",o.border="0",o.margin="0",o.cursor="pointer",o.padding="14px 9px",o.borderRadius=r?"0 10px 10px 0":"10px 0 0 10px",o.background=t.getAttribute("data-color")||"#0f7b6c",o.color=t.getAttribute("data-text-color")||"#ffffff",o.font='600 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',o.letterSpacing="0.01em",o.boxShadow="0 6px 20px rgba(16, 24, 40, 0.18)",i.addEventListener("click",(function(){e.showSurvey(n,a)})),document.body.appendChild(i)}(e,r,o,t)}else e.showSurvey(o,{format:"page",container:r,fields:u})})).catch((function(e){console.warn("[Gleap] survey embed:",e&&e.message)}))}}},o=function(){for(var e=document.querySelectorAll("[data-gleap-survey]"),t=0;t<e.length;t++)r(e[t])};"undefined"!=typeof window&&"undefined"!=typeof document&&(window.GleapSurveyEmbed?window.GleapSurveyEmbed.scan():(window.GleapSurveyEmbed={scan:o},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",o):o()))})();