import{d as f,aJ as u,aM as l,aN as d,c as m,b as w,h as p,m as h,s as _,a as g}from"./index-BKaqQGb-.js";import{_ as b}from"./definition.vue_vue_type_script_setup_true_lang-fQa65UMX.js";function v(){return{resolve:e=>({href:new URL(e,window.location.href).href})}}function x(e,t){return window.location.assign(e),Promise.resolve()}const B=f({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,i=v(),a=_(),r=(n,o)=>p(n,{...h(a),...o});function c(n){try{return new URL(n,window.location.href).origin!==window.location.origin}catch{return!1}}const s=u(()=>l(r(t.config.url),n=>d(async()=>{const o=c(n);if(t.config.mode==="_blank"){window.open(o?n:i.resolve(n).href,"_blank");return}await x(n)})));return(n,o)=>(g(),m(b,{"action-id":e.buttonId,effect:w(s)},null,8,["action-id","effect"]))}});export{B as default};
