import{i as e,n as t,t as n}from"./jsx-runtime-CXrijb2r.js";var r=e(t(),1),i=n(),a=`orchestra.preferences.explanatory-tooltips`,o=(0,r.createContext)(!0);function s(e){return!(e===`disabled`||e===`false`)}function c(e=window.localStorage){return s(e.getItem(a))}function l(e,t=window.localStorage){t.setItem(a,e?`enabled`:`disabled`)}function u(e,t=document){let n=e?`enabled`:`disabled`;t.documentElement.dataset.explanatoryTooltips=n,t.body&&(t.body.dataset.explanatoryTooltips=n)}function d(e,t){let n=e?.trim();return!t||!n?{}:{title:n,"data-tooltip":n}}function f({enabled:e,children:t}){return(0,i.jsx)(o.Provider,{value:e,children:t})}function p(){return(0,r.useContext)(o)}function m(){let e=p();return(0,r.useCallback)(t=>d(t,e),[e])}export{l as a,c as i,u as n,m as o,d as r,f as t};