import{s as K,e as f,f as v,c as p,h as B,g as D,j as g,d as E,a as c,b as y,i as M,k as l,n as P,o as Q,r as V}from"./scheduler.bDsl0G2p.js";import{S as G,i as J,c as W,a as X,m as Y,t as Z,b as $,d as tt}from"./index.DtyFm6kT.js";const j=i=>{const t=i.shiftKey,n=i.keyCode;return{escape:n===27,next_tab:t===!1&&n===9,back_tab:t===!0&&n===9}},et=({first_element:i,last_element:t,panel_element:n,escape_to_element:u="",after_escape:a=()=>{},records:o=0})=>{const _=s=>{o>=1&&console.log(s)},m=s=>{_(1),typeof u=="object"&&(s.preventDefault(),s.stopPropagation(),u.focus(),a())};n.addEventListener("keydown",function(s){const{escape:h}=j(s);if(h)return m(s);_(1)}),i.addEventListener("keydown",function(s){const{back_tab:h,escape:e}=j(s);if(e)return m(s);h&&(s.preventDefault(),s.stopPropagation(),t.focus()),_(1)}),t.addEventListener("keydown",function(s){const{next_tab:h,escape:e}=j(s);if(e)return m(s);h&&(s.preventDefault(),s.stopPropagation(),i.focus()),_(1)})};function nt(i){let t,n,u="Hone Focus",a,o,_="Outside",m,s,h,e,r,q="Start of Panel",O,w,R,C,z="Button",L,T,N,k,A="Button",S,H,U,x,F="End of Panel";return{c(){t=f("div"),n=f("header"),n.textContent=u,a=v(),o=f("button"),o.textContent=_,m=v(),s=f("div"),h=v(),e=f("div"),r=f("div"),r.textContent=q,O=v(),w=f("hr"),R=v(),C=f("button"),C.textContent=z,L=v(),T=f("hr"),N=v(),k=f("button"),k.textContent=A,S=v(),H=f("hr"),U=v(),x=f("div"),x.textContent=F,this.h()},l(I){t=p(I,"DIV",{});var b=B(t);n=p(b,"HEADER",{"data-svelte-h":!0}),D(n)!=="svelte-1vx9ei8"&&(n.textContent=u),a=g(b),o=p(b,"BUTTON",{outside_button:!0,type:!0,class:!0,"data-svelte-h":!0}),D(o)!=="svelte-1c38pe7"&&(o.textContent=_),m=g(b),s=p(b,"DIV",{style:!0}),B(s).forEach(E),h=g(b),e=p(b,"DIV",{the_panel:!0,style:!0});var d=B(e);r=p(d,"DIV",{tabindex:!0,start_of_panel:!0,"data-svelte-h":!0}),D(r)!=="svelte-liyfc5"&&(r.textContent=q),O=g(d),w=p(d,"HR",{class:!0,style:!0}),R=g(d),C=p(d,"BUTTON",{type:!0,class:!0,"data-svelte-h":!0}),D(C)!=="svelte-3mwe7c"&&(C.textContent=z),L=g(d),T=p(d,"HR",{class:!0,style:!0}),N=g(d),k=p(d,"BUTTON",{type:!0,class:!0,"data-svelte-h":!0}),D(k)!=="svelte-3mwe7c"&&(k.textContent=A),S=g(d),H=p(d,"HR",{class:!0,style:!0}),U=g(d),x=p(d,"DIV",{tabindex:!0,end_of_panel:!0,"data-svelte-h":!0}),D(x)!=="svelte-1fyozdk"&&(x.textContent=F),d.forEach(E),b.forEach(E),this.h()},h(){c(o,"outside_button",""),c(o,"type","button"),c(o,"class","btn variant-filled"),y(s,"height","20px"),c(r,"tabindex","0"),c(r,"start_of_panel",""),c(w,"class","!border-t-4"),y(w,"margin","8px 0"),c(C,"type","button"),c(C,"class","btn variant-filled"),c(T,"class","!border-t-4"),y(T,"margin","8px 0"),c(k,"type","button"),c(k,"class","btn variant-filled"),c(H,"class","!border-t-4"),y(H,"margin","8px 0"),c(x,"tabindex","0"),c(x,"end_of_panel",""),c(e,"the_panel",""),y(e,"border","4px solid black"),y(e,"min-height","500px"),y(e,"width","100%"),y(e,"border-radius","9px"),y(e,"padding","12px")},m(I,b){M(I,t,b),l(t,n),l(t,a),l(t,o),i[4](o),l(t,m),l(t,s),l(t,h),l(t,e),l(e,r),i[5](r),l(e,O),l(e,w),l(e,R),l(e,C),l(e,L),l(e,T),l(e,N),l(e,k),l(e,S),l(e,H),l(e,U),l(e,x),i[6](x),i[7](e)},p:P,i:P,o:P,d(I){I&&E(t),i[4](null),i[5](null),i[6](null),i[7](null)}}}function st(i,t,n){let u="",a="",o="",_="";Q(()=>{et({escape_to_element:_,after_escape(){console.log("escaped")},panel_element:o,first_element:u,last_element:a})});function m(r){V[r?"unshift":"push"](()=>{_=r,n(3,_)})}function s(r){V[r?"unshift":"push"](()=>{u=r,n(0,u)})}function h(r){V[r?"unshift":"push"](()=>{a=r,n(1,a)})}function e(r){V[r?"unshift":"push"](()=>{o=r,n(2,o)})}return[u,a,o,_,m,s,h,e]}class ot extends G{constructor(t){super(),J(this,t,st,nt,K,{})}}function at(i){let t,n,u;return n=new ot({}),{c(){t=f("div"),W(n.$$.fragment)},l(a){t=p(a,"DIV",{});var o=B(t);X(n.$$.fragment,o),o.forEach(E)},m(a,o){M(a,t,o),Y(n,t,null),u=!0},p:P,i(a){u||(Z(n.$$.fragment,a),u=!0)},o(a){$(n.$$.fragment,a),u=!1},d(a){a&&E(t),tt(n)}}}class it extends G{constructor(t){super(),J(this,t,null,at,K,{})}}export{it as default};
//# sourceMappingURL=Trinket.B230tXn7.js.map
