import{j as l}from"./query-ATBhtd3K.js";import{r as c}from"./vendor-EnoIVk-c.js";import{a as m}from"./routing-nZgBtxly.js";import{ag as C,ah as S,ai as b,aj as O}from"./en-IUV4ZXKH-BjYNERUx.js";import{u as v}from"./i18n-BYxb14hm.js";function E({isOpen:e,onClose:t}){const o=m(),{t:n}=v(),s=(r,a)=>n(`Search.${r}`,a),i=(r,a)=>{r==="resource"?o.push(`/know/resource/${encodeURIComponent(a)}`):o.push(`/know/entity/${a}`)};return l.jsx(C,{isOpen:e,onClose:t,onNavigate:i,translations:{placeholder:s("placeholder"),searching:s("searching"),noResults:s("noResults"),startTyping:s("startTyping"),navigate:s("navigate"),select:s("select"),close:s("close"),enter:s("enter"),esc:s("esc")}})}const T=c.createContext(null);function U({children:e}){const t=m(),[o,n]=c.useState(!1),[s,i]=c.useState(!1),[r,a]=c.useState([]),u=c.useCallback(()=>{n(!0)},[]),f=c.useCallback(()=>{i(!0)},[]),h=c.useCallback(()=>{n(!1),i(!1),r.forEach(w=>w()),a([])},[r]);S([{key:"k",ctrlOrCmd:!0,handler:()=>{u()},description:"Open global search"},{key:"n",ctrlOrCmd:!0,handler:()=>{t.push("/know/compose")},description:"Create new resource"},{key:"/",handler:()=>{u()},description:"Open global search (alternative)"},{key:"?",shift:!0,handler:()=>{f()},description:"Show keyboard shortcuts help"}]),b("Escape",h,300);const k={openGlobalSearch:u,openKeyboardHelp:f,closeAllOverlays:h};return l.jsxs(T.Provider,{value:k,children:[e,o&&l.jsx(E,{isOpen:o,onClose:()=>n(!1)}),s&&l.jsx(O,{isOpen:s,onClose:()=>i(!1)})]})}const x=[{id:"necessary",name:"Strictly Necessary",description:"These cookies are essential for the website to function properly. They enable core functionality such as security, network management, and accessibility.",required:!0,cookies:["semiont-token","consent-preferences"]},{id:"analytics",name:"Analytics",description:"These cookies help us understand how visitors interact with our website by collecting and reporting information anonymously.",required:!1,cookies:["_ga","_ga_*","_gid","_gat","lighthouse-*"]},{id:"marketing",name:"Marketing",description:"These cookies are used to track visitors across websites to display relevant advertisements and measure campaign effectiveness.",required:!1,cookies:["_fbp","_fbc","fr","ads-*"]},{id:"preferences",name:"Preferences",description:"These cookies remember your choices and preferences to provide a more personalized experience.",required:!1,cookies:["theme-preference","language-preference","ui-settings"]}],p="1.0",g="semiont-cookie-consent",_={necessary:!0,analytics:!1,marketing:!1,preferences:!1,timestamp:new Date().toISOString(),version:p},A=e=>{typeof window>"u"||x.forEach(t=>{if(t.required)return;e[t.id]||t.cookies.forEach(n=>{if(n.includes("*")){const s=n.replace("*","");document.cookie.split(";").forEach(i=>{var a;const r=(a=i.split("=")[0])==null?void 0:a.trim();r&&r.startsWith(s)&&d(r)})}else d(n)})})},d=e=>{document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`;const t=window.location.hostname.split(".").slice(-2).join(".");document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${t}`},I=()=>{if(typeof window>"u")return null;try{const e=localStorage.getItem(g);if(!e)return null;const t=JSON.parse(e);return t.version!==p?null:t}catch(e){return console.warn("Failed to parse cookie consent:",e),null}},j=e=>{if(typeof window>"u")return;const t={..._,...e,necessary:!0,timestamp:new Date().toISOString(),version:p};try{localStorage.setItem(g,JSON.stringify(t)),A(t),window.dispatchEvent(new CustomEvent("cookieConsentChanged",{detail:t}))}catch(o){console.error("Failed to save cookie consent:",o)}},D=()=>{const e=I();if(!e)return!1;const t=new Date(e.timestamp),o=new Date;return o.setMonth(o.getMonth()-13),t>o},G=()=>typeof window>"u"?!1:!D(),y=async()=>{try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return e.includes("Europe/")?"EU":e.includes("America/Los_Angeles")||e.includes("America/Vancouver")?"CA":e.includes("America/")?"US":"OTHER"}catch{return"OTHER"}},H=async()=>await y()==="CA",P=async()=>await y()==="EU",q=()=>{if(typeof window>"u")return{};const e={};document.cookie.split(";").forEach(t=>{const[o,n]=t.trim().split("=");o&&n&&(e[`cookie_${o}`]=decodeURIComponent(n))});for(let t=0;t<localStorage.length;t++){const o=localStorage.key(t);o&&(e[`localStorage_${o}`]=localStorage.getItem(o)||"")}for(let t=0;t<sessionStorage.length;t++){const o=sessionStorage.key(t);o&&(e[`sessionStorage_${o}`]=sessionStorage.getItem(o)||"")}return e},J=()=>{typeof window>"u"||(localStorage.clear(),sessionStorage.clear(),document.cookie.split(";").forEach(e=>{var o;const t=(o=e.split("=")[0])==null?void 0:o.trim();t&&d(t)}),window.location.reload())};export{x as C,T as K,U as a,G as b,H as c,J as d,q as e,I as g,P as i,j as s};
//# sourceMappingURL=privacy-QEJYcmMw.js.map
