/* * # 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,X,U,V){"use strict";Q.isFunction=Q.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},X=void 0!==X&&X.Math==Math?X:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),Q.modal=Q.fn.modal=function(E){var L,e=Q(this),I=Q(X),N=Q(U),z=Q("body"),j=e.selector||"",q=(new Date).getTime(),B=[],R=E,W="string"==typeof R,P=[].slice.call(arguments,1),K=X.requestAnimationFrame||X.mozRequestAnimationFrame||X.webkitRequestAnimationFrame||X.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var t,o,s,e,i,n,a,r,c,l,d,u=Q.isPlainObject(E)?Q.extend(!0,{},Q.fn.modal.settings,E):Q.extend({},Q.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,p=u.error,v="."+h,b="module-"+h,y=Q(this),k=[X,U].indexOf(u.context)<0?N.find(u.context):z,x=k[0]===z[0],w=y.find(f.closeIcon),C=y.hasClass("modal"),S=this,F=C?y.data(b):V,M=!1,T="",A="",D=!1,H=!1,O={initialize:function(){var s;O.create.id(),C||(O.create.modal(),Q.isFunction(u.onHidden)||(u.onHidden=function(){O.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(O.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(O.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),O.has.configActions()&&(0===(s=y.find(f.actions).addClass(u.classActions)).length?s=Q("
",{class:m.actions+" "+(u.classActions||"")}).appendTo(y):s.empty(),u.actions.forEach(function(e){var t=e[g.icon]?"':"",n=O.helpers.escape(e[g.text]||"",u.preserveHTML),i=O.helpers.deQuote(e[g.class]||""),o=e[g.click]&&Q.isFunction(e[g.click])?e[g.click]:function(){};s.append(Q("",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,click:function(){var e=Q(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(S,y)||O.hide()}}))})),O.cache={},O.verbose("Initializing dimmer",k),O.create.dimmer(),u.allowMultiple&&O.create.innerDimmer(),u.centered||y.addClass("top aligned"),O.refreshModals(),O.bind.events(),O.observeChanges(),O.instantiate(),u.autoShow&&O.show()},instantiate:function(){O.verbose("Storing instance of modal"),F=O,y.data(b,F)},create:{modal:function(){var e;y=Q("",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=Q("",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(w)),""!==u.title&&(e="_"+O.get.id()+"title",y.attr("aria-labelledby",e),Q("",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+O.get.id()+"desc",y.attr("aria-describedby",e),Q("",{class:m.content,id:e}).appendTo(y)),O.has.configActions()&&Q("",{class:m.actions}).appendTo(y),k.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=Q.extend(!0,e,u.dimmerSettings);Q.fn.dimmer===V?O.error(p.dimmer):(O.debug("Creating dimmer"),i=k.dimmer(e),D=O.is.scrolling(),u.detachable?(O.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):O.set.undetached(),n=i.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),c="."+l,O.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&Q("",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),O.verbose("Destroying previous modal"),y.removeData(b).off(v),I.off(c),n.off(c),w.off(c),t&&t.off(c),k.dimmer("destroy")},observeChanges:function(){"MutationObserver"in X&&((d=new MutationObserver(function(e){u.observeChanges&&(O.debug("DOM tree modified, refreshing"),O.refresh()),O.refreshInputs()})).observe(S,{childList:!0,subtree:!0}),O.debug("Setting up mutation observer",d))},refresh:function(){O.remove.scrolling(),O.cacheSizes(),O.can.useFlex()||O.set.modalOffset(),O.set.screenHeight(),O.set.type()},refreshModals:function(){s=y.siblings(f.modal),o=s.add(y)},refreshInputs:function(){t&&t.off("keydown"+c),(t=y.find("[tabindex], :input").filter(":visible").filter(function(){return 0===Q(this).closest(".disabled").length})).first().on("keydown"+c,O.event.inputKeyDown.first),t.last().on("keydown"+c,O.event.inputKeyDown.last)},attachEvents:function(e,t){var n=Q(e);t=Q.isFunction(O[t])?O[t]:O.toggle,0":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(e)?(e=e.replace(/&(?![a-z0-9#]{1,12};)/gi,"&")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},can:{leftBodyScrollbar:function(){return O.cache.leftBodyScrollbar===V&&(O.cache.leftBodyScrollbar=O.is.rtl()&&(O.is.iframe&&!O.is.firefox()||O.is.safari()||O.is.edge()||O.is.ie())),O.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable&&!O.is.ie():(u.useFlex&&O.is.ie()?O.debug("useFlex true is not supported in IE"):u.useFlex&&!u.detachable&&O.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=O.cache.contextHeight,t=O.cache.contextHeight/2,n=O.cache.topOffset,i=O.cache.scrollHeight,o=O.cache.height,s=u.padding;return o .header",content:"> .content",actions:"> .actions",close:"> .close",closeIcon:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal",dimmer:"> .ui.dimmer",bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",prompt:".ui.input > input"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached",front:"front",close:"close icon",button:"ui button",modal:"ui modal",title:"header",content:"content",actions:"actions",template:"ui tiny modal",ok:"positive",cancel:"negative",prompt:"ui fluid input",innerDimmer:"ui inverted dimmer"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},Q.fn.modal.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),n=t.handler;return{title:t.title,content:t.content,onApprove:n,actions:[{text:e.text.ok,class:e.className.ok,click:n}]}},confirm:function(){function e(){i.handler(!0)}function t(){i.handler(!1)}var n=this.get.settings(),i=n.templates.getArguments(arguments);return{title:i.title,content:i.content,onApprove:e,onDeny:t,actions:[{text:n.text.ok,class:n.className.ok,click:e},{text:n.text.cancel,class:n.className.cancel,click:t}]}},prompt:function(){function e(){var e=n.get.settings(),e=n.get.element().find(e.selector.prompt)[0];o.handler(Q(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===Q(Q.parseHTML(o.content)).filter(".ui.input").length&&(o.content+=''),{title:o.title,content:o.content,onApprove:e,onDeny:t,actions:[{text:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}}}}(jQuery,window,document);