@visitscotland/component-library
Version:
VisitScotland Component Library
2 lines • 3.21 kB
JavaScript
/*! For license information please see a6399d652dfbb8a40c41.js.LICENSE.txt */
;(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[810],{10810:function(t,e,n){n.d(e,{aH:function(){return g}});var o,i=n(96763);Symbol(),function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"}(o||(o={}));const c="undefined"!=typeof window,r=(()=>"object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:"object"==typeof globalThis?globalThis:{HTMLElement:null})();function a(t,e,n){const o=new XMLHttpRequest;o.open("GET",t),o.responseType="blob",o.onload=function(){d(o.response,e,n)},o.onerror=function(){i.error("could not download file")},o.send()}function s(t){const e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function l(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}const u="object"==typeof navigator?navigator:{userAgent:""},f=(()=>/Macintosh/.test(u.userAgent)&&/AppleWebKit/.test(u.userAgent)&&!/Safari/.test(u.userAgent))(),d=c?"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype&&!f?function(t,e="download",n){const o=document.createElement("a");o.download=e,o.rel="noopener","string"==typeof t?(o.href=t,o.origin!==location.origin?s(o.href)?a(t,e,n):(o.target="_blank",l(o)):l(o)):(o.href=URL.createObjectURL(t),setTimeout((function(){URL.revokeObjectURL(o.href)}),4e4),setTimeout((function(){l(o)}),0))}:"msSaveOrOpenBlob"in u?function(t,e="download",n){if("string"==typeof t)if(s(t))a(t,e,n);else{const e=document.createElement("a");e.href=t,e.target="_blank",setTimeout((function(){l(e)}))}else navigator.msSaveOrOpenBlob(function(t,{autoBom:e=!1}={}){return e&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}(t,n),e)}:function(t,e,n,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return a(t,e,n);const i="application/octet-stream"===t.type,c=/constructor/i.test(String(r.HTMLElement))||"safari"in r,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||i&&c||f)&&"undefined"!=typeof FileReader){const e=new FileReader;e.onloadend=function(){let t=e.result;if("string"!=typeof t)throw o=null,new Error("Wrong reader.result type");t=s?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=t:location.assign(t),o=null},e.readAsDataURL(t)}else{const e=URL.createObjectURL(t);o?o.location.assign(e):location.href=e,o=null,setTimeout((function(){URL.revokeObjectURL(e)}),4e4)}}:()=>{},{assign:p}=Object;Symbol(),Symbol(),Symbol();const{assign:b}=Object;function g(t,e){return Array.isArray(e)?e.reduce(((e,n)=>(e[n]=function(){return t(this.$pinia)[n]},e)),{}):Object.keys(e).reduce(((n,o)=>(n[o]=function(){const n=t(this.$pinia),i=e[o];return"function"==typeof i?i.call(this,n):n[i]},n)),{})}}}]);