PageSourceSearch

https://artoftheinformationalinterview.com/assets/radio-group-DrTf7ygM.js

js artoftheinformationalinterview.com collected 2026-10-08 00:34:26 UTC 5,749 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4368aa28-3590-5981-a862-7a38a766757f")}catch(e){}}();
3import{a as e}from"./jsx-runtime-CMgEUHpv.js";import{V as t}from"./dist-CAHjj65Z.js";import{g as n,h as r,i,l as a,m as o,o as s,t as c,u as l}from"./render-D-6lIDot.js";import{a as u,i as d,n as f,r as p,t as m}from"./label-6Is4t9r1.js";import{t as h}from"./use-disposables-DmKy7YN_.js";import{n as g,t as _}from"./keyboard-BynAefDg.js";import{a as v,d as y,i as b,n as x,r as S}from"./focus-management-zpJZeZqO.js";import{t as C}from"./use-tree-walker-ZwaT0_v6.js";import{n as w,t as T}from"./hidden-tfADjw18.js";import{n as E}from"./transition-zOPc9j2i.js";import{t as D}from"./bugs-DRRBxuGP.js";import{n as O,t as k}from"./description-DulSWBwH.js";var A=e(t(),1),j=(e=>(e[e.RegisterOption=0]=`RegisterOption`,e[e.UnregisterOption=1]=`UnregisterOption`,e))(j||{}),M={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:x(n,e=>e.element.current)}},1(e,t){let n=e.options.slice(),r=e.options.findIndex(e=>e.id===t.id);return r===-1?e:(n.splice(r,1),{...e,options:n})}},N=(0,A.createContext)(null);N.displayName=`RadioGroupDataContext`;function P(e){let t=(0,A.useContext)(N);if(t===null){let t=Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,P),t}return t}var F=(0,A.createContext)(null);F.displayName=`RadioGroupActionsContext`;function I(e){let t=(0,A.useContext)(F);if(t===null){let t=Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,I),t}return t}function L(e,t){return l(t.type,M,e,t)}var R=`div`;function z(e,t){let n=g(),{id:r=`headlessui-radiogroup-${n}`,value:i,defaultValue:l,form:m,name:x,onChange:E,by:D=(e,t)=>e===t,disabled:k=!1,...j}=e,M=o(typeof D==`string`?(e,t)=>{let n=D;return e?.[n]===t?.[n]}:D),[P,I]=(0,A.useReducer)(L,{options:[]}),z=P.options,[B,V]=f(),[H,U]=O(),W=(0,A.useRef)(null),G=a(W,t),[K,q]=u(i,E,l),J=(0,A.useMemo)(()=>z.find(e=>!e.propsRef.current.disabled),[z]),Y=(0,A.useMemo)(()=>z.some(e=>M(e.propsRef.current.value,K)),[z,K]),X=o(e=>{if(k||M(e,K))return!1;let t=z.find(t=>M(t.propsRef.current.value,e))?.propsRef.current;return t!=null&&t.disabled?!1:(q?.(e),!0)});C({container:W.current,accept(e){return e.getAttribute(`role`)===`radio`?NodeFilter.FILTER_REJECT:e.hasAttribute(`role`)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(e){e.setAttribute(`role`,`none`)}});let Z=o(e=>{let t=W.current;if(!t)return;let n=y(t),r=z.filter(e=>e.propsRef.current.disabled===!1).map(e=>e.element.current);switch(e.key){case _.Enter:d(e.currentTarget);break;case _.ArrowLeft:case _.ArrowUp:if(e.preventDefault(),e.stopPropagation(),v(r,S.Previous|S.WrapAround)===b.Success){let e=z.find(e=>e.element.current===n?.activeElement);e&&X(e.propsRef.current.value)}break;case _.ArrowRight:case _.ArrowDown:if(e.preventDefault(),e.stopPropagation(),v(r,S.Next|S.WrapAround)===b.Success){let e=z.find(e=>e.element.current===n?.activeElement);e&&X(e.propsRef.current.value)}break;case _.Space:{e.preventDefault(),e.stopPropagation();let t=z.find(e=>e.element.current===n?.activeElement);t&&X(t.propsRef.current.value)}break}}),Q=o(e=>(I({type:0,...e}),()=>I({type:1,id:e.id}))),ee=(0,A.useMemo)(()=>({value:K,firstOption:J,containsCheckedOption:Y,disabled:k,compare:M,...P}),[K,J,Y,k,M,P]),te=(0,A.useMemo)(()=>({registerOption:Q,change:X}),[Q,X]),ne={ref:G,id:r,role:`radiogroup`,"aria-labelledby":B,"aria-describedby":H,onKeyDown:Z},re=(0,A.useMemo)(()=>({value:K}),[K]),$=(0,A.useRef)(null),ie=h();return(0,A.useEffect)(()=>{$.current&&l!==void 0&&ie.addEventListener($.current,`reset`,()=>{X(l)})},[$,X]),A.createElement(U,{name:`RadioGroup.Description`},A.createElement(V,{name:`RadioGroup.Label`},A.createElement(F.Provider,{value:te},A.createElement(N.Provider,{value:ee},x!=null&&K!=null&&p({[x]:K}).map(([e,t],n)=>A.createElement(w,{features:T.Hidden,ref:n===0?e=>{$.current=e?.closest(`form`)??null}:void 0,...s({key:e,as:`input`,type:`radio`,checked:t!=null,hidden:!0,readOnly:!0,form:m,disabled:k,name:e,value:t})})),c({ourProps:ne,theirProps:j,slot:re,defaultTag:R,name:`RadioGroup`})))))}var B=(e=>(e[e.Empty=1]=`Empty`,e[e.Active=2]=`Active`,e))(B||{}),V=`div`;function H(e,t){let i=g(),{id:s=`headlessui-radiogroup-option-${i}`,value:l,disabled:u=!1,...d}=e,p=(0,A.useRef)(null),m=a(p,t),[h,_]=f(),[v,y]=O(),{addFlag:b,removeFlag:x,hasFlag:S}=E(1),C=r({value:l,disabled:u}),w=P(`RadioGroup.Option`),T=I(`RadioGroup.Option`);
3n(()=>T.registerOption({id:s,element:p,propsRef:C}),[s,T,p,C]);let k=o(e=>{var t;if(D(e.currentTarget))return e.preventDefault();T.change(l)&&(b(2),(t=p.current)==null||t.focus())}),j=o(e=>{if(D(e.currentTarget))return e.preventDefault();b(2)}),M=o(()=>x(2)),N=w.firstOption?.id===s,F=w.disabled||u,L=w.compare(w.value,l),R={ref:m,id:s,role:`radio`,"aria-checked":L?`true`:`false`,"aria-labelledby":h,"aria-describedby":v,"aria-disabled":F?!0:void 0,tabIndex:F?-1:L||!w.containsCheckedOption&&N?0:-1,onClick:F?void 0:k,onFocus:F?void 0:j,onBlur:F?void 0:M},z=(0,A.useMemo)(()=>({checked:L,disabled:F,active:S(2)}),[L,F,S]);return A.createElement(y,{name:`RadioGroup.Description`},A.createElement(_,{name:`RadioGroup.Label`},c({ourProps:R,theirProps:d,slot:z,defaultTag:V,name:`RadioGroup.Option`})))}var U=i(z),W=i(H),G=Object.assign(U,{Option:W,Label:m,Description:k});export{G as t};
4//# sourceMappingURL=radio-group-DrTf7ygM.js.map
5//# debugId=4368aa28-3590-5981-a862-7a38a766757f

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.