/*
* # Fomantic UI - 2.9.0
* https://github.com/fomantic/Fomantic-UI
* http://fomantic-ui.com/
*
* Copyright 2022 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
!function(Q,U,X,_){"use strict";Q.isFunction=Q.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},U=void 0!==U&&U.Math==Math?U:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),Q.flyout=Q.fn.flyout=function(O){var P,e=Q(this),D=Q(U),L=Q(X),z=Q("html"),B=Q("head"),N=Q("body"),R=e.selector||"",I=(new Date).getTime(),j=[],K=O,V="string"==typeof K,W=[].slice.call(arguments,1),q=U.requestAnimationFrame||U.mozRequestAnimationFrame||U.webkitRequestAnimationFrame||U.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var t,e,o,s,n,i,r,c,l=Q.isPlainObject(O)?Q.extend(!0,{},Q.fn.flyout.settings,O):Q.extend({},Q.fn.flyout.settings),a=l.selector,u=l.className,d=l.namespace,f=l.fields,h=l.regExp,g=l.error,p="."+d,m="module-"+d,b=Q(this),v=[U,X].indexOf(l.context)<0?L.find(l.context):N,y=b.find(a.close),k=b.children(a.flyout),x=v.children(a.pusher),w=b.hasClass("flyout"),S=this,C=w?b.data(m):_,A=!1,T=v[0]===N[0],F="",E="",H=!1,M={initialize:function(){var s;M.debug("Initializing flyout",O),M.create.id(),w||(M.create.flyout(),Q.isFunction(l.onHidden)||(l.onHidden=function(){M.destroy(),b.remove()}),l.autoShow||(l.autoShow=!0)),b.addClass(l.class),""!==l.title&&b.find(a.header).html(M.helpers.escape(l.title,l.preserveHTML)).addClass(l.classTitle),""!==l.content&&b.find(a.content).html(M.helpers.escape(l.content,l.preserveHTML)).addClass(l.classContent),M.has.configActions()&&(0===(s=b.find(a.actions).addClass(l.classActions)).length?s=Q("
",{class:u.actions+" "+(l.classActions||"")}).appendTo(b):s.empty(),l.actions.forEach(function(e){var t=e[f.icon]?"':"",n=M.helpers.escape(e[f.text]||"",l.preserveHTML),i=M.helpers.deQuote(e[f.class]||""),o=e[f.click]&&Q.isFunction(e[f.click])?e[f.click]:function(){};s.append(Q("",{html:t+n,"aria-label":(e[f.text]||e[f.icon]||"").replace(/<[^>]+(>|$)/g,""),class:u.button+" "+i,click:function(){!1!==o.call(S,b)&&M.hide()}}))})),c=M.get.transitionEvent(),l.delaySetup?q(M.setup.layout):M.setup.layout(),q(function(){M.setup.cache()}),"left"!=M.get.direction()&&"right"!=M.get.direction()||(M.setup.heights(),M.bind.resize()),M.bind.events(),M.observeChanges(),M.instantiate(),l.autoShow&&M.show()},instantiate:function(){M.verbose("Storing instance of module",M),C=M,b.data(m,C)},create:{flyout:function(){var e;M.verbose("Programmaticaly create flyout",v),b=Q("",{class:u.flyout,role:"dialog","aria-modal":l.dimPage}),l.closeIcon&&(y=Q("",{class:u.close,role:"button",tabindex:0,"aria-label":l.text.close}),b.append(y)),""!==l.title&&(e="_"+M.get.id()+"title",b.attr("aria-labelledby",e),Q("",{class:u.header,id:e}).appendTo(b)),""!==l.content&&(e="_"+M.get.id()+"desc",b.attr("aria-describedby",e),Q("",{class:u.content,id:e}).appendTo(b)),M.has.configActions()&&Q("",{class:u.actions}).appendTo(b),b.prependTo(v),S=b[0]},id:function(){n=(Math.random().toString(16)+"000000000").slice(2,10),s="."+n,M.verbose("Creating unique id for element",n)}},destroy:function(){i&&i.disconnect(),M.verbose("Destroying previous module for",b),b.off(p).removeData(m),M.is.ios()&&M.remove.ios(),y.off(s),t&&t.off(s),v.off(s),D.off(s),L.off(s)},event:{keyboard:function(e){e.which===l.keys.escape&&(l.closable?(M.debug("Escape key pressed hiding flyout"),M.hide()):M.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){M.setup.heights()},clickaway:function(e){var t;l.closable&&(t=0=S.scrollHeight&&(S.scrollTop=S.scrollHeight-S.offsetHeight-1)},scroll:function(e){0===Q(e.target).closest(a.flyout).length&&e.preventDefault()}},bind:{resize:function(){M.verbose("Adding resize event to window",D),D.on("resize"+s,M.event.resize)},events:function(){M.verbose("Attaching events"),b.on("click"+p,a.close,M.event.close).on("click"+p,a.approve,M.event.approve).on("click"+p,a.deny,M.event.deny),y.on("keyup"+s,M.event.closeKeyUp)},clickaway:function(){M.verbose("Adding clickaway events to context",v),v.on("click"+s,M.event.clickaway).on("touchend"+s,M.event.clickaway)},scrollLock:function(){l.scrollLock&&(M.debug("Disabling page scroll"),(H=M.has.scrollbar())&&(M.save.bodyMargin(),M.set.bodyMargin()),v.addClass(u.locked)),M.verbose("Adding events to contain flyout scroll"),L.on("touchmove"+s,M.event.touch),b.on("scroll"+p,M.event.containScroll)}},unbind:{clickaway:function(){M.verbose("Removing clickaway events from context",v),v.off(s)},scrollLock:function(){M.verbose("Removing scroll lock from page"),H&&M.restore.bodyMargin(),v.removeClass(u.locked),L.off(s),b.off("scroll"+p)}},add:{inlineCSS:function(){var e=M.cache.width||b.outerWidth(),t=M.cache.height||b.outerHeight(),n=M.is.rtl(),i=M.get.direction(),t={left:e,right:-e,top:t,bottom:-t};n&&(M.verbose("RTL detected, flipping widths"),t.left=-e,t.right=e),n="").appendTo(B),M.debug("Adding sizing css to head",o)},keyboardShortcuts:function(){M.verbose("Adding keyboard shortcuts"),L.on("keydown"+p,M.event.keyboard)}},observeChanges:function(){"MutationObserver"in U&&((i=new MutationObserver(function(e){M.refreshInputs()})).observe(S,{childList:!0,subtree:!0}),M.debug("Setting up mutation observer",i))},refresh:function(){M.verbose("Refreshing selector cache"),v=[U,X].indexOf(l.context)<0?L.find(l.context):N,M.refreshFlyouts(),x=v.children(a.pusher),M.clear.cache()},refreshFlyouts:function(){M.verbose("Refreshing other flyouts"),k=v.children(a.flyout)},refreshInputs:function(){t&&t.off("keydown"+s),l.dimPage&&((t=b.find("[tabindex], :input").filter(":visible").filter(function(){return 0===Q(this).closest(".disabled").length})).first().on("keydown"+s,M.event.inputKeyDown.first),t.last().on("keydown"+s,M.event.inputKeyDown.last))},setup:{cache:function(){M.cache={width:b.outerWidth(),height:b.outerHeight()}},layout:function(){0===v.children(a.pusher).length&&(M.debug("Adding wrapper element for flyout"),M.error(g.pusher),x=Q(''),v.children().not(a.omitted).not(k).wrapAll(x),M.refresh()),0!==b.nextAll(a.pusher).length&&b.nextAll(a.pusher)[0]===x[0]||(M.debug("Moved flyout to correct parent element"),M.error(g.movedFlyout,S),b.detach().prependTo(v),M.refresh()),M.is.mobile()&&b.addClass(u.fullscreen),M.clear.cache(),M.set.pushable(),M.set.direction()},heights:function(){M.debug("Setting up heights",b);var e=b.children(a.header),t=b.children(a.content),n=b.children(a.actions);t.css("min-height",v.height()-e.outerHeight()-n.outerHeight()+"px")}},attachEvents:function(e,t){var n=Q(e);t=Q.isFunction(M[t])?M[t]:M.toggle,0":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,12};)/gi,"&")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},setting:function(e,t){if(M.debug("Changing setting",e,t),Q.isPlainObject(e))Q.extend(!0,l,e);else{if(t===_)return l[e];Q.isPlainObject(l[e])?Q.extend(!0,l[e],t):l[e]=t}},internal:function(e,t){if(Q.isPlainObject(e))Q.extend(!0,M,e);else{if(t===_)return M[e];M[e]=t}},debug:function(){!l.silent&&l.debug&&(l.performance?M.performance.log(arguments):(M.debug=Function.prototype.bind.call(console.info,console,l.name+":"),M.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?M.performance.log(arguments):(M.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),M.verbose.apply(console,arguments)))},error:function(){l.silent||(M.error=Function.prototype.bind.call(console.error,console,l.name+":"),M.error.apply(console,arguments))},performance:{log:function(e){var t,n;l.performance&&(n=(t=(new Date).getTime())-(I||t),I=t,j.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(M.performance.timer),M.performance.timer=setTimeout(M.performance.display,500)},display:function(){var e=l.name+":",n=0;I=!1,clearTimeout(M.performance.timer),Q.each(j,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",R&&(e+=" '"+R+"'"),(console.group!==_||console.table!==_)&&0 .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.right.flyout, > .ui.fixed.nag, > .ui.fixed.nag > .close",fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",flyout:".ui.flyout",header:".ui.header",content:".content",actions:".actions",close:".close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedFlyout:"Had to move flyout. For optimal performance make sure flyout and pusher are direct children of your body tag",notFound:"There were no elements that matched the specified selector"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},Q.fn.flyout.settings.templates={getArguments:function(e){e=[].slice.call(e);return Q.isPlainObject(e[0])?Q.extend({handler:function(){},content:"",title:""},e[0]):(Q.isFunction(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:t.handler}]}},confirm:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){t.handler(!0)}},{text:e.text.cancel,class:e.className.cancel,click:function(){t.handler(!1)}}]}},prompt:function(){var t=this,e=this.get.settings(),n=e.templates.getArguments(arguments);return 0===Q(Q.parseHTML(n.content)).filter(".ui.input").length&&(n.content+=''),{title:n.title,content:n.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){var e=t.get.settings(),e=t.get.element().find(e.selector.prompt)[0];n.handler(Q(e).val())}},{text:e.text.cancel,class:e.className.cancel,click:function(){n.handler(null)}}]}}}}(jQuery,window,document);