import{d as e,l as t,p as n,s as r}from"./hooks.module-BrXTvcfS.js";import{G as i,R as a}from"./content_renderer-DOj8g78V.js";import{F as o,a as s}from"./i18n-BaLR3UdQ.js";import{t as c}from"./jsxRuntime.module-Cao1NCKs.js";import{n as l}from"./react_utils-Bz0ffU2Y.js";e();function u({className:e,helpPage:t,title:r,style:a}){let u=n(l)?.ntxId?.startsWith(`_`)??!1;return c(`button`,{class:`${e??``} icon-action bx bx-help-circle`,type:`button`,onClick:()=>{u?i.triggerCommand(`openInPopup`,{noteIdOrPath:`_help_${t}`}):o(t)},title:r??s(`open-help-page`),style:a})}e();function d({currentValue:e,helpPage:n,switchOnName:i,switchOnTooltip:o,switchOffName:s,switchOffTooltip:l,onChange:d,disabled:f,afterName:p,id:m}){let[h,g]=r(!0),_=i||s;return t(()=>{let e=setTimeout(()=>{g(!1)},100);return()=>clearTimeout(e)},[]),c(`div`,{className:`switch-widget`,children:[_&&c(`span`,{className:`switch-name`,children:e?s:i}),p,c(`label`,{children:c(`div`,{className:a(`switch-button`,{on:e,disabled:f,"disable-transitions":h}),title:e?l:o,children:c(`input`,{id:m,className:`switch-toggle`,type:`checkbox`,checked:e===!0,onInput:t=>{d(!e),t.preventDefault()},disabled:f})})}),n&&c(u,{className:`switch-help-button`,helpPage:n})]})}export{u as n,d as t};