text: "use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_extends=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},PNotifyConfirm=function(t){t=t&&t.__esModule?t.default:t;var n;function e(t,n){var e,i,o=!1;function r(){o=!0,n.set({prompt_value:e.value}),o=!1}function s(t){n.handleKeyPress(t)}return{c:function(){e=_("textarea"),this.h()},h:function(){g(e,"input",r),e.rows="5",e.className=i="\n              ui-pnotify-prompt-input\n              "+(t._notice.get("_styles").input?t._notice.get("_styles").input:"")+"\n              "+t.prompt_class+"\n            ",g(e,"keypress",s)},m:function(i,o){y(e,i,o),n.refs.promptMulti=e,e.value=t.prompt_value},p:function(t,n){o||(e.value=n.prompt_value),(t._notice||t.prompt_class)&&i!==(i="\n              ui-pnotify-prompt-input\n              "+(n._notice.get("_styles").input?n._notice.get("_styles").input:"")+"\n              "+n.prompt_class+"\n            ")&&(e.className=i)},u:function(){d(e)},d:function(){b(e,"input",r),b(e,"keypress",s),n.refs.promptMulti===e&&(n.refs.promptMulti=null)}}}function i(t,n){var e,i,o=!1;function r(){o=!0,n.set({prompt_value:e.value}),o=!1}function s(t){n.handleKeyPress(t)}return{c:function(){e=_("input"),this.h()},h:function(){g(e,"input",r),e.type="text",e.className=i="\n              ui-pnotify-prompt-input\n              "+(t._notice.get("_styles").input?t._notice.get("_styles").input:"")+"\n              "+t.prompt_class+"\n            ",g(e,"keypress",s)},m:function(i,o){y(e,i,o),n.refs.promptSingle=e,e.value=t.prompt_value},p:function(t,n){o||(e.value=n.prompt_value),(t._notice||t.prompt_class)&&i!==(i="\n              ui-pnotify-prompt-input\n              "+(n._notice.get("_styles").input?n._notice.get("_styles").input:"")+"\n              "+n.prompt_class+"\n            ")&&(e.className=i)},u:function(){d(e)},d:function(){b(e,"input",r),b(e,"keypress",s),n.refs.promptSingle===e&&(n.refs.promptSingle=null)}}}function o(t,n){var e,i=a(t),o=i(t,n);return{c:function(){o.c(),e=h()},m:function(t,n){o.m(t,n),y(e,t,n)},p:function(t,r){i===(i=a(r))&&o?o.p(t,r):(o.u(),o.d(),(o=i(r,n)).c(),o.m(e.parentNode,e))},u:function(){o.u(),d(e)},d:function(){o.d()}}}function r(t,n,e,i,o){var r,s,u=l(t,n,e,i),c=u(t,n,e,i,o);return{c:function(){r=_("button"),c.c(),this.h()},h:function(){r.type="button",r.className=s="\n            ui-pnotify-action-button\n            "+(e.primary?t._notice.get("_styles").btn_primary?t._notice.get("_styles").btn_primary:"":t._notice.get("_styles").btn?t._notice.get("_styles").btn:"")+"\n            "+(e.addClass?e.addClass:"")+"\n          ",g(r,"click",p),r._svelte={component:o,buttons:n,button_index:i}},m:function(t,n){y(r,t,n),c.m(r,null)},p:function(t,n,e,i,a){u===(u=l(n,e,i,a))&&c?c.p(t,n,e,i,a):(c.u(),c.d(),(c=u(n,e,i,a,o)).c(),c.m(r,null)),(t.buttons||t._notice)&&s!==(s="\n            ui-pnotify-action-button\n            "+(i.primary?n._notice.get("_styles").btn_primary?n._notice.get("_styles").btn_primary:"":n._notice.get("_styles").btn?n._notice.get("_styles").btn:"")+"\n            "+(i.addClass?i.addClass:"")+"\n          ")&&(r.className=s),r._svelte.buttons=e,r._svelte.button_index=a},u:function(){d(r),c.u()},d:function(){c.d(),b(r,"click",p)}}}function s(t,n,e,i,o){var r,s,u=e.text;return{c:function(){r=_("noscript"),s=_("noscript")},m:function(t,n){y(r,t,n),r.insertAdjacentHTML("afterend",u),y(s,t,n)},p:function(t,n,e,i,o){t.buttons&&u!==(u=i.text)&&(v(r,s),r.insertAdjacentHTML("afterend",u))},u:function(){v(r,s),d(r),d(s)},d:x}}function u(t,n,e,i,o){var r,s=e.text;return{c:function(){r=k(s)},m:function(t,n){y(r,t,n)},p:function(t,n,e,i,o){t.buttons&&s!==(s=i.text)&&(r.data=s)},u:function(){d(r)},d:x}}function c(t,n){for(var e,i,s,u=t.prompt&&o(t,n),c=t.buttons,a=[],l=0;l<c.length;l+=1)a[l]=r(t,c,c[l],l,n);return{c:function(){e=_("div"),u&&u.c(),i=k("\n    ");for(var t=0;t<a.length;t+=1)a[t].c();this.h()},h:function(){e.className=s="\n        ui-pnotify-action-bar\n        "+(t._notice.get("_styles").action_bar?t._notice.get("_styles").action_bar:"")+"\n        "+(t._notice.get("_styles").text?t._notice.get("_styles").text:"")+"\n      ",C(e,"text-align",t.align)},m:function(t,n){y(e,t,n),u&&u.m(e,null),m(i,e);for(var o=0;o<a.length;o+=1)a[o].m(e,null)},p:function(t,c){c.prompt?u?u.p(t,c):((u=o(c,n)).c(),u.m(e,i)):u&&(u.u(),u.d(),u=null);var l=c.buttons;if(t.buttons||t._notice){for(var p=0;p<l.length;p+=1)a[p]?a[p].p(t,c,l,l[p],p):(a[p]=r(c,l,l[p],p,n),a[p].c(),a[p].m(e,null));for(;p<a.length;p+=1)a[p].u(),a[p].d();a.length=l.length}t._notice&&s!==(s="\n        ui-pnotify-action-bar\n        "+(c._notice.get("_styles").action_bar?c._notice.get("_styles").action_bar:"")+"\n        "+(c._notice.get("_styles").text?c._notice.get("_styles").text:"")+"\n      ")&&(e.className=s),t.align&&C(e,"text-align",c.align)},u:function(){d(e),u&&u.u();for(var t=0;t<a.length;t+=1)a[t].u()},d:function(){u&&u.d(),function(t){for(var n=0;n<t.length;n+=1)t[n]&&t[n].d()}(a)}}}function a(t){return t.prompt_multi_line?e:i}function l(t,n,e,i){return e.trustText?s:u}function p(t){var n=this._svelte.component,e=this._svelte.buttons[this._svelte.button_index];n.handleClick(e,t)}function f(n){var e,i,o;i=n,(e=this)._observers={pre:O(),post:O()},e._handlers=O(),e._bind=i._bind,e.options=i,e.root=i.root||e,e.store=e.root.store||i.store,this.refs={},this._state=N(_extends({_notice:null,_options:{}},t.modules.Confirm.defaults),n.data),document.getElementById("svelte-3546993901-style")||((o=_("style")).id="svelte-3546993901-style",o.textContent=".ui-pnotify-action-bar{margin-top:5px;clear:both}.ui-pnotify-prompt-input{margin-bottom:5px;clear:both}.ui-pnotify.ui-pnotify-with-icon .ui-pnotify-action-bar.ui-pnotify-confirm-ml{margin-left:24px}",m(o,document.head));var r,s,u,a,l=function(){this.fire("init",{module:this})}.bind(this);n.root?this.root._oncreate.push(l):this._oncreate=[l],this._fragment=(r=this._state,s=this,a=(r.confirm||r.prompt)&&c(r,s),{c:function(){a&&a.c(),u=h()},m:function(t,n){a&&a.m(t,n),y(u,t,n)},p:function(t,n){n.confirm||n.prompt?a?a.p(t,n):((a=c(n,s)).c(),a.m(u.parentNode,u)):a&&(a.u(),a.d(),a=null)},u:function(){a&&a.u(),d(u)},d:function(){a&&a.d()}}),n.target&&(this._fragment.c(),this._fragment.m(n.target,n.anchor||null),S(this._oncreate))}function _(t){return document.createElement(t)}function m(t,n){n.appendChild(t)}function h(){return document.createComment("")}function y(t,n,e){n.insertBefore(t,e)}function d(t){t.parentNode.removeChild(t)}function g(t,n,e){t.addEventListener(n,e,!1)}function b(t,n,e){t.removeEventListener(n,e,!1)}function v(t,n){for(;t.nextSibling&&t.nextSibling!==n;)t.parentNode.removeChild(t.nextSibling)}function x(){}function k(t){return document.createTextNode(t)}function C(t,n,e){t.style.setProperty(n,e)}function N(t){for(var n,e,i=1,o=arguments.length;i<o;i++){e=arguments[i];for(n in e)t[n]=e[n]}return t}function S(t){for(;t&&t.length;)t.pop()()}function M(t){this.destroy=x,this.fire("destroy"),this.set=this.get=x,!1!==t&&this._fragment.u(),this._fragment.d(),this._fragment=this._state=null}function O(){return Object.create(null)}function T(t,n,e,i,o){for(var r in n)if(e[r]){var s=i[r],u=o[r],c=n[r];if(c)for(var a=0;a<c.length;a+=1){var l=c[a];l.__calling||(l.__calling=!0,l.call(t,s,u),l.__calling=!1)}}}return N(f.prototype,{initModule:function(t){this.set(t)},afterOpen:function(){this.get("prompt")&&(this.get("prompt_multi_line")?this.refs.promptMulti.focus():this.refs.promptSingle.focus())},handleClick:function(t,n){t.click&&t.click(this.get("_notice"),this.get("prompt")?this.get("prompt_value"):null,n)},handleKeyPress:function(t){if(13==t.keyCode&&!t.shiftKey){t.preventDefault();for(var n=this.get("buttons"),e=0;e<n.length;e++)n[e].promptTrigger&&n[e].click&&n[e].click(this.get("_notice"),this.get("prompt")?this.get("prompt_value"):null,t)}}},{destroy:M,get:function(t){return t?this._state[t]:this._state},fire:function(t,n){var e=t in this._handlers&&this._handlers[t].slice();if(!e)return;for(var i=0;i<e.length;i+=1)e[i].call(this,n)},observe:function(t,n,e){var i=e&&e.defer?this._observers.post:this._observers.pre;(i[t]||(i[t]=[])).push(n),e&&!1===e.init||(n.__calling=!0,n.call(this,this._state[t]),n.__calling=!1);return{cancel:function(){var e=i[t].indexOf(n);~e&&i[t].splice(e,1)}}},on:function(t,n){if("teardown"===t)return this.on("destroy",n);var e=this._handlers[t]||(this._handlers[t]=[]);return e.push(n),{cancel:function(){var t=e.indexOf(n);~t&&e.splice(t,1)}}},set:function(t){if(this._set(N({},t)),this.root._lock)return;this.root._lock=!0,S(this.root._beforecreate),S(this.root._oncreate),S(this.root._aftercreate),this.root._lock=!1},teardown:M,_set:function(t){var n=this._state,e={},i=!1;for(var o in t)r=t[o],s=n[o],(r!==s||r&&"object"===(void 0===r?"undefined":_typeof(r))||"function"==typeof r)&&(e[o]=i=!0);var r,s;if(!i)return;this._state=N({},n,t),this._recompute(e,this._state),this._bind&&this._bind(e,this._state);this._fragment&&(T(this,this._observers.pre,e,this._state,n),this._fragment.p(e,this._state),T(this,this._observers.post,e,this._state,n))},_mount:function(t,n){this._fragment.m(t,n)},_unmount:function(){this._fragment&&this._fragment.u()}}),f.prototype._recompute=x,(n=f).key="Confirm",n.defaults={confirm:!1,prompt:!1,prompt_class:"",prompt_value:"",prompt_multi_line:!1,align:"right",buttons:[{text:"Ok",trustText:!1,addClass:"",primary:!0,promptTrigger:!0,click:function(t,n){t.close(),t.fire("pnotify.confirm",{notice:t,value:n})}},{text:"Cancel",trustText:!1,addClass:"",click:function(t){t.close(),t.fire("pnotify.cancel",{notice:t})}}]},t.modules.Confirm=n,t.modulesAppendContainer.push(n),_extends(t.styling.brighttheme,{action_bar:"",btn:"",btn_primary:"brighttheme-primary",input:""}),_extends(t.styling.bootstrap3,{action_bar:"ui-pnotify-confirm-ml",btn:"btn btn-default",btn_primary:"btn btn-default btn-primary",input:"form-control"}),_extends(t.styling.bootstrap4,{action_bar:"ui-pnotify-confirm-ml",btn:"btn btn-secondary ml-1",btn_primary:"btn btn-primary ml-1",input:"form-control"}),t.styling.material||(t.styling.material={}),_extends(t.styling.material,{action_bar:"",btn:"",btn_primary:"ui-pnotify-material-primary",input:""}),f}(PNotify);
  //# sourceMappingURL=PNotifyConfirm.js.map