-
Notifications
You must be signed in to change notification settings - Fork 0
/
component---src-templates-language-jsx-fceee2064ab3f930035d.js
2 lines (2 loc) · 9.99 KB
/
component---src-templates-language-jsx-fceee2064ab3f930035d.js
1
2
"use strict";(self.webpackChunktav=self.webpackChunktav||[]).push([[98],{6300:function(e,t,n){n.r(t),n.d(t,{default:function(){return N}});var r,a,l=n(7294),i=n(8270),s=n(2337),c=n(3503),o=n(8629),u=n(1450),d=n(9366),f=n(7906),m=n(8496),p=n(1075);!function(e){e[e.SetSelectedIndex=0]="SetSelectedIndex",e[e.SetOrientation=1]="SetOrientation",e[e.SetActivation=2]="SetActivation",e[e.RegisterTab=3]="RegisterTab",e[e.UnregisterTab=4]="UnregisterTab",e[e.RegisterPanel=5]="RegisterPanel",e[e.UnregisterPanel=6]="UnregisterPanel",e[e.ForceRerender=7]="ForceRerender"}(a||(a={}));var x=((r={})[a.SetSelectedIndex]=function(e,t){return e.selectedIndex===t.index?e:(0,s.gY)({},e,{selectedIndex:t.index})},r[a.SetOrientation]=function(e,t){return e.orientation===t.orientation?e:(0,s.gY)({},e,{orientation:t.orientation})},r[a.SetActivation]=function(e,t){return e.activation===t.activation?e:(0,s.gY)({},e,{activation:t.activation})},r[a.RegisterTab]=function(e,t){return e.tabs.includes(t.tab)?e:(0,s.gY)({},e,{tabs:[].concat(e.tabs,[t.tab])})},r[a.UnregisterTab]=function(e,t){return(0,s.gY)({},e,{tabs:e.tabs.filter((function(e){return e!==t.tab}))})},r[a.RegisterPanel]=function(e,t){return e.panels.includes(t.panel)?e:(0,s.gY)({},e,{panels:[].concat(e.panels,[t.panel])})},r[a.UnregisterPanel]=function(e,t){return(0,s.gY)({},e,{panels:e.panels.filter((function(e){return e!==t.panel}))})},r[a.ForceRerender]=function(e){return(0,s.gY)({},e)},r),v=(0,l.createContext)(null);function g(e){var t=(0,l.useContext)(v);if(null===t){var n=new Error("<"+e+" /> is missing a parent <Tab.Group /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(n,g),n}return t}function b(e,t){return(0,c.E)(t.type,x,e,t)}v.displayName="TabsContext";var y=l.Fragment;var h="button";function E(e){var t,n,r,i="headlessui-tabs-tab-"+(0,m.M)(),x=g(E.name),v=x[0],b=v.selectedIndex,y=v.tabs,w=v.panels,T=v.orientation,N=v.activation,R=x[1],S=R.dispatch,I=R.change,P=(0,l.useRef)(null),k=(0,u.T)(P,(function(e){e&&S({type:a.ForceRerender})}));(0,f.e)((function(){return S({type:a.RegisterTab,tab:P}),function(){return S({type:a.UnregisterTab,tab:P})}}),[S,P]);var A=y.indexOf(P),O=A===b,Y=(0,l.useCallback)((function(e){var t=y.map((function(e){return e.current})).filter(Boolean);if(e.key===d.R.Space||e.key===d.R.Enter)return e.preventDefault(),e.stopPropagation(),void I(A);switch(e.key){case d.R.Home:case d.R.PageUp:return e.preventDefault(),e.stopPropagation(),(0,p.jA)(t,p.TO.First);case d.R.End:case d.R.PageDown:return e.preventDefault(),e.stopPropagation(),(0,p.jA)(t,p.TO.Last)}return(0,c.E)(T,{vertical:function(){return e.key===d.R.ArrowUp?(0,p.jA)(t,p.TO.Previous|p.TO.WrapAround):e.key===d.R.ArrowDown?(0,p.jA)(t,p.TO.Next|p.TO.WrapAround):void 0},horizontal:function(){return e.key===d.R.ArrowLeft?(0,p.jA)(t,p.TO.Previous|p.TO.WrapAround):e.key===d.R.ArrowRight?(0,p.jA)(t,p.TO.Next|p.TO.WrapAround):void 0}})}),[y,T,A,I]),j=(0,l.useCallback)((function(){var e;null==(e=P.current)||e.focus()}),[P]),C=(0,l.useCallback)((function(){var e;null==(e=P.current)||e.focus(),I(A)}),[I,A,P]),U=(null!=(t=null==e?void 0:e.type)?t:"button"===(e.as||h))?"button":void 0,F=(0,l.useMemo)((function(){return{selected:O}}),[O]),H={ref:k,onKeyDown:Y,onFocus:"manual"===N?j:C,onClick:C,id:i,role:"tab",type:U,"aria-controls":null==(n=w[A])||null==(r=n.current)?void 0:r.id,"aria-selected":O,tabIndex:O?0:-1},M=e;return(0,o.sY)({props:(0,s.gY)({},M,H),slot:F,defaultTag:h,name:"Tabs.Tab"})}var w=o.AN.RenderStrategy|o.AN.Static;E.Group=function(e){var t=e.defaultIndex,n=void 0===t?0:t,r=e.vertical,i=void 0!==r&&r,c=e.manual,u=void 0!==c&&c,d=e.onChange,f=(0,s.gK)(e,["defaultIndex","vertical","manual","onChange"]),m=i?"vertical":"horizontal",p=u?"manual":"auto",x=(0,l.useReducer)(b,{selectedIndex:null,tabs:[],panels:[],orientation:m,activation:p}),g=x[0],h=x[1],E=(0,l.useMemo)((function(){return{selectedIndex:g.selectedIndex}}),[g.selectedIndex]),w=(0,l.useRef)((function(){}));(0,l.useEffect)((function(){h({type:a.SetOrientation,orientation:m})}),[m]),(0,l.useEffect)((function(){h({type:a.SetActivation,activation:p})}),[p]),(0,l.useEffect)((function(){"function"==typeof d&&(w.current=d)}),[d]),(0,l.useEffect)((function(){if(!(g.tabs.length<=0)&&null===g.selectedIndex){var e=g.tabs.map((function(e){return e.current})).filter(Boolean),t=e.filter((function(e){return!e.hasAttribute("disabled")}));if(n<0)h({type:a.SetSelectedIndex,index:e.indexOf(t[0])});else if(n>g.tabs.length)h({type:a.SetSelectedIndex,index:e.indexOf(t[t.length-1])});else{var r=e.slice(0,n),l=e.slice(n),i=[].concat(l,r).find((function(e){return t.includes(e)}));if(!i)return;h({type:a.SetSelectedIndex,index:e.indexOf(i)})}}}),[n,g.tabs,g.selectedIndex]);var T=(0,l.useRef)(g.selectedIndex),N=(0,l.useMemo)((function(){return[g,{dispatch:h,change:function(e){T.current!==e&&w.current(e),T.current=e,h({type:a.SetSelectedIndex,index:e})}}]}),[g,h]);return l.createElement(v.Provider,{value:N},(0,o.sY)({props:(0,s.gY)({},f),slot:E,defaultTag:y,name:"Tabs"}))},E.List=function e(t){var n=g([E.name,e.name].join("."))[0],r={selectedIndex:n.selectedIndex},a={role:"tablist","aria-orientation":n.orientation},l=t;return(0,o.sY)({props:(0,s.gY)({},l,a),slot:r,defaultTag:"div",name:"Tabs.List"})},E.Panels=function e(t){var n=g([E.name,e.name].join("."))[0].selectedIndex,r=(0,l.useMemo)((function(){return{selectedIndex:n}}),[n]);return(0,o.sY)({props:t,slot:r,defaultTag:"div",name:"Tabs.Panels"})},E.Panel=function e(t){var n,r,i=g([E.name,e.name].join(".")),c=i[0],d=c.selectedIndex,p=c.tabs,x=c.panels,v=i[1].dispatch,b="headlessui-tabs-panel-"+(0,m.M)(),y=(0,l.useRef)(null),h=(0,u.T)(y,(function(e){e&&v({type:a.ForceRerender})}));(0,f.e)((function(){return v({type:a.RegisterPanel,panel:y}),function(){return v({type:a.UnregisterPanel,panel:y})}}),[v,y]);var T=x.indexOf(y),N=T===d,R=(0,l.useMemo)((function(){return{selected:N}}),[N]),S={ref:h,id:b,role:"tabpanel","aria-labelledby":null==(n=p[T])||null==(r=n.current)?void 0:r.id,tabIndex:N?0:-1},I=t;return(0,o.sY)({props:(0,s.gY)({},I,S),slot:R,defaultTag:"div",features:w,visible:N,name:"Tabs.Panel"})};var T=n(9487),N=(n(2393),function(e){var t=e.pageContext,n=(t.language,t.bibles),r=t.resources,a=t.films,s=(0,i.$)().t,c=[{name:s("bibles.title"),href:"#",count:n?n.length:0,current:!0},{name:s("resources.title"),href:"#",count:r?r.length:0,current:!1},{name:s("films.title"),href:"#",count:a?a.length:0,current:!1}];function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}return l.createElement("div",null,l.createElement(E.Group,null,l.createElement("div",{className:"border-b border-gray-200 mb-8"},l.createElement(E.List,null,l.createElement("nav",{className:"-mb-px flex space-x-8 justify-center","aria-label":"Tabs"},c.map((function(e){return l.createElement(E,{key:e.name,"aria-current":e.current?"page":void 0},(function(t){var n=t.selected;return l.createElement("span",{className:o(n?"border-primary-500 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-200","whitespace-nowrap flex py-4 px-1 border-b-2 text-sm")},e.name,e.count?l.createElement("span",{className:o(n?"bg-primary-100 text-primary-600":"bg-gray-100 text-gray-900","hidden ml-3 py-0.5 px-2.5 rounded-full text-xs md:inline-block")},e.count):null)}))}))))),l.createElement(E.Panels,null,l.createElement(E.Panel,null,l.createElement("ul",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3"},n.map((function(e){return l.createElement("li",{key:e.id,className:"col-span-1 bg-white rounded-lg shadow divide-y divide-gray-200 flex flex-col"},l.createElement("div",{className:"w-full flex flex-grow items-center justify-between p-6 space-x-6"},l.createElement("div",{className:"flex-1"},l.createElement("div",{className:"flex space-x-3"},l.createElement("h3",{className:"flex-1 text-gray-900 text-sm"},e.title),l.createElement("span",{className:"flex-shrink-0 inline-block px-2 py-0.5 text-gray-400 text-xs"},e.date)),l.createElement("p",{className:"text-gray-500 text-md"},e.title_vernacular))),l.createElement("div",{className:"flex divide-x divide-gray-200 items-end"},l.createElement("div",{className:"w-0 flex-1 flex"},l.createElement("a",{href:"https://downloads.dbs.org/downloads/pdf/"+e.id+"/"+e.id+".pdf",target:"_blank",rel:"noreferrer",className:"relative -mr-px w-0 flex-1 inline-flex items-center justify-center py-4 text-sm text-gray-700 border border-transparent rounded-bl-lg hover:text-gray-500"},l.createElement("span",{className:"ml-3"},"PDF"))),l.createElement("div",{className:"-ml-px w-0 flex-1 flex"},l.createElement("a",{href:"https://downloads.dbs.org/downloads/html_zips/"+e.id+".zip",className:"relative w-0 flex-1 inline-flex items-center justify-center py-4 text-sm text-gray-700 border border-transparent rounded-br-lg hover:text-gray-500"},l.createElement("span",{className:"ml-3"},"HTML"))),l.createElement("div",{className:"-ml-px w-0 flex-1 flex"},l.createElement("a",{href:"/bibles/"+e.id,className:"relative w-0 flex-1 inline-flex items-center justify-center py-4 text-sm text-gray-700 border border-transparent rounded-br-lg hover:text-gray-500"},l.createElement("span",{className:"ml-3"},"ePub")))))})))),l.createElement(E.Panel,null,l.createElement(T.Z,{data:r,columns:[{accessor:"title",Header:s("fields.name"),Cell:function(e){var t=e.row;return l.createElement("a",{className:"text-primary-600",href:t.values.url},l.createElement("div",{className:"text-primary-600 w-60 overflow-ellipsis overflow-hidden"},t.values.title))}},{accessor:"url",Header:"url",hidden:!0},{accessor:"type",Header:s("fields.type")},{accessor:"author",Header:s("fields.author")}]})),l.createElement(E.Panel,null,l.createElement(T.Z,{data:a,columns:[{accessor:"title",Header:s("fields.name"),Cell:function(e){var t=e.row;return l.createElement("a",{className:"text-primary-600",href:t.values.url},l.createElement("div",{className:"text-primary-600 w-60 overflow-ellipsis overflow-hidden"},t.values.title))}},{accessor:"url",Header:"url",hidden:!0},{accessor:"author",Header:s("fields.author")}]})))))})}}]);
//# sourceMappingURL=component---src-templates-language-jsx-fceee2064ab3f930035d.js.map