@visitscotland/component-library
Version:
VisitScotland Component Library
1 lines • 3.46 kB
JavaScript
;(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[810],{10810:function(t,e,n){n.d(e,{aH:function(){return m},bP:function(){return w}});var o,i=n(12189),r=n(50953),c=n(20641),s=n(96763);Symbol(),function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"}(o||(o={}));const a="undefined"!=typeof window,l=(()=>"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 u(t,e,n){const o=new XMLHttpRequest;o.open("GET",t),o.responseType="blob",o.onload=function(){g(o.response,e,n)},o.onerror=function(){s.error("could not download file")},o.send()}function f(t){const e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function d(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 p="object"==typeof navigator?navigator:{userAgent:""},b=(()=>/Macintosh/.test(p.userAgent)&&/AppleWebKit/.test(p.userAgent)&&!/Safari/.test(p.userAgent))(),g=a?"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype&&!b?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?f(o.href)?u(t,e,n):(o.target="_blank",d(o)):d(o)):(o.href=URL.createObjectURL(t),setTimeout((function(){URL.revokeObjectURL(o.href)}),4e4),setTimeout((function(){d(o)}),0))}:"msSaveOrOpenBlob"in p?function(t,e="download",n){if("string"==typeof t)if(f(t))u(t,e,n);else{const e=document.createElement("a");e.href=t,e.target="_blank",setTimeout((function(){d(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 u(t,e,n);const i="application/octet-stream"===t.type,r=/constructor/i.test(String(l.HTMLElement))||"safari"in l,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||i&&r||b)&&"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=c?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:y}=Object;Symbol(),Symbol(),Symbol();const{assign:h}=Object;function m(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)),{})}function w(t){if(i.LER)return(0,r.QW)(t);{const e=(0,r.ux)(t),n={};for(const o in e){const i=e[o];i.effect?n[o]=(0,c.EW)({get:()=>t[o],set(e){t[o]=e}}):((0,r.i9)(i)||(0,r.g8)(i))&&(n[o]=(0,r.lW)(t,o))}return n}}},12189:function(t,e,n){n.d(e,{LER:function(){return o}});var o=!1}}]);