"use strict";var e=require("../client-Co_j5m_k.js"),t=require("../ssr-RXknEJpO.js");require("../observable-BXDJFaLN.js"),require("../i18n-CP31jeWH.js"),require("../empty_html-hFq4zm9t.js"),require("@kdcloudjs/kwc");const r="kingdeeroutingservicegetlinkinfo",n=new WeakMap,s={standard:"standard_webPage"};function i(e,t){return new Promise((n,s)=>{const i=new CustomEvent(r,{detail:{stateRef:t,callback:(e,t)=>{e?s(e):n(t)}},bubbles:!0,composed:!0,cancelable:!0});e.dispatchEvent(i)})}exports.LinkInfo=class{constructor(e,t){this.url=e,this.dispatcher=t,Object.freeze(this)}},exports.getLinkInfo=i,exports.hasLinkProvider=function(e){let{parentNode:t}=e;for(;t;){if(n.has(t))return!0;t=t.parentNode}return!1},exports.isLinkProvider=function(e){return n.has(e)},exports.registerLinkProvider=function(e,t){let s=n.get(e);void 0===s&&(s=new Set,n.set(e,s)),s.add(t),e.addEventListener(r,t)},exports.unregisterLinkProvider=function(e,t){const s=n.get(e);s&&(s.delete(t),s.size||n.delete(e)),e.removeEventListener(r,t)},exports.updateRawLinkInfo=function(r,{url:n,target:o}){return t.isCSR&&function(e,t){return!e||"_self"===e||"Small"===t||"_top"===e&&window.top===window||"_parent"===e&&window.parent===window}(o,e.formFactor)?i(r,{stateType:s.standard,attributes:{url:n,target:o}}):new Promise(e=>{e({url:n,dispatcher:()=>{}})})},exports.urlTypes=s;
