PageSourceSearch

https://cloud.typesense.org/packs/js/999-355cfe6255a990c3170b.chunk.js

js typesense.org collected 2026-09-24 15:22:04 UTC 269,651 bytes, 3 lines download raw bytes

1/*! For license information please see 999-355cfe6255a990c3170b.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunktypesense_cloud=self.webpackChunktypesense_cloud||[]).push([[999],{58234:function(t,e,r){r.r(e),r.d(e,{initializeRouter:function(){return xr}});var n=r(62893),a=r(40173),i=r(5947),s=r.n(i),o={name:"ClusterProvisioningState",computed:{clusterStatus:function(){return this.$store.state.clusterStatus}}},c=r(14486),l=(0,c.A)(o,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"row"},[e("div",{staticClass:"col"},[e("div",{staticClass:"d-flex align-items-baseline"},["Provisioning"===t.clusterStatus.status?e("h4",[t._v("Your cluster is being provisioned")]):e("h4",[t._v("Your cluster is being initialized")]),t._v(" "),e("div",{staticClass:"spinner-border spinner-border-sm text-secondary mx-2",attrs:{role:"status","aria-hidden":"true"}})]),t._v(" "),e("p",[t._v("\n      This should take about 4-6 minutes. You'll be able to generate your API keys shortly after.\n    ")])])])}),[],!1,null,"602d2e92",null).exports,u={name:"GenerateAPIKeysPrompt",computed:{clusterInfo:function(){return this.$store.state.clusterInfo}}},d=(0,c.A)(u,(function(){this._self._c;return this._m(0)}),[function(){var t=this,e=t._self._c;return e("div",{staticClass:"row mt-4"},[e("div",{staticClass:"col-sm-9"},[e("div",{staticClass:"alert alert-success alert-dismissible mb-0 fade show",attrs:{role:"alert"}},[e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":"Close"}},[e("span",{attrs:{"aria-hidden":"true"}},[t._v("\xd7")])]),t._v(" "),e("div",{staticClass:"font-weight-bold"},[t._v("Your cluster is ready to use.")]),t._v(" "),e("div",{staticClass:"mt-2 small"},[e("ol",[e("li",[t._v('Click on "Generate API Keys" to download your API Keys')]),t._v(" "),e("li",[t._v("\n            Read our\n            "),e("a",{attrs:{href:"https://typesense.org/docs/guide",target:"_blank"}},[t._v("Quick-Start Guide")]),t._v("\n            for a walk-through of how to integrate with Typesense.\n          ")]),t._v(" "),e("li",[t._v("\n            To get general help, ask in our public\n            "),e("a",{attrs:{href:"https://join.slack.com/t/typesense-community/shared_invite/zt-2fetvh0pw-ft5y2YQlq4l_bPhhqpjXig",target:"_blank"}},[t._v("Slack Community")]),t._v(", search "),e("a",{attrs:{href:"https://threads.typesense.org/",target:"_blank"}},[t._v("past threads")]),t._v(",\n            or post in our\n            "),e("a",{attrs:{href:"https://github.com/typesense/typesense",target:"_blank"}},[t._v("GitHub issue tracker")]),t._v(".\n          ")]),t._v(" "),e("li",[t._v("\n            For 1:1 support, see our\n            "),e("a",{attrs:{href:"/support-plans"}},[t._v("Prioritized Support Plans")]),t._v(".\n          ")])])])])])])}],!1,null,"2a7e091c",null).exports,h=r(73872);function f(){f=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,s=Object.create(i.prototype),o=new E(n||[]);return a(s,"_invoke",{value:A(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",p="suspendedYield",m="executing",v="completed",y={};function g(){}function _(){}function b(){}var w={};l(w,s,(function(){return this}));var C=Object.getPrototypeOf,S=C&&C(C(O([])));S&&S!==r&&n.call(S,s)&&(w=S);var x=b.prototype=g.prototype=Object.create(w);function R(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function A(e,r,n){var a=h;return function(i,s){if(a===m)throw Error("Generator is already running");if(a===v){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=k(o,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?v:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&
vendor: 1,572 bytes, line 2
2(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function O(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return _.prototype=b,a(x,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:_,configurable:!0}),_.displayName=l(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}}
2,R(N.prototype),l(N.prototype,o,(function(){return this})),e.AsyncIterator=N,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new N(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},R(x),l(x,c,"Generator"),l(x,s,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;L(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function p(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}var m={name:"ClusterActions",components:{GenerateAPIKeysPrompt:d},data:function(){return{apiKeysGenerated:!0,errorMessage:null}},computed:{clusterStatus:function(){return this.$store.state.clusterStatus},clusterInfo:function(){return this.$store.state.clusterInfo},showConnectAgentLink:function(){return"In Service"===this.clusterStatus.status&&!this.clusterInfo.account_has_agent_connection},accessControlPolicy:function(){return this.$store.state.clusterInfo.access_control_policy},showGenerateAPIKeysPrompt:function(){return"In Service"===this.clusterStatus.status&&!this.clusterStatus.is_initializing&&!this.apiKeysGenerated}},created:function(){this.apiKeysGenerated=this.clusterInfo.api_keys_generated||!1},methods:{generateAPIKeys:function(){var t,e=this;return(t=f().mark((function t(){var r,n,a,i,o;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.errorMessage=null,s().start(),t.prev=1,t.next=2,h.A.post(e.clusterInfo.routes.generate_api_keys_cluster_path);case 2:r=t.sent,n=new Blob([r.data],{type:r.headers["content-type"]}),(a=document.createElement("a")).href=URL.createObjectURL(n),a.download=r.headers["content-disposition"].match(/filename="(.*)"/)[1]||"API Keys",a.click(),URL.revokeObjectURL(a.href),e.apiKeysGenerated=!0,t.next=4;break;case 3:t.prev=3,o=t.catch(1),e.errorMessage="".concat(o.message," | ").concat((null===o||void 0===o||null===(i=o.response)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.error)||""),console.error(o);case 4:return t.prev=4,s().done(),t.finish(4);case 5:case"end":return t.stop()}}),t,null,[[1,3,4,5]])})),function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){p(i,n,a,s,o,"next",t)}function o(t){p(i,n,a,s,o,"throw",t)}s(void 0)}))})()}}},v=m,y=(0,c.A)(v,(function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"row no-gutters"},[e("div",{staticClass:"col-sm"},[e("div",{staticClass:"btn-toolbar",attrs:{role:"toolbar","aria-label":"Cluster actions"}},[e("div",{staticClass:"btn-group mr-2",attrs:{role:"group","aria-label":"Generate API Keys"}},[e("button",{staticClass:"btn btn-primary btn-sm",attrs:{disabled:"In Service"!==t.clusterStatus.status||t.clusterStatus.is_initializing},on:{click:function(e){return t.generateAPIKeys()}}},[t._v("\n            Generate API Keys\n          ")])]),t._v(" "),t.showConnectAgentLink?e("RouterLink",{staticClass:"btn btn-link btn-sm connect-agent-link",attrs:{to:{name:"mcpServer"}}},[t._v("\n          Connect an AI agent (MCP) \u2192\n        ")]):t._e()],1)])]),t._v(" "),t.showGenerateAPIKeysPrompt?[e("GenerateAPIKeysPrompt")]:t._e(),t._v(" "),t.errorMessage?e("div",{staticClass:"mt-3 alert alert-warning alert-dismissible mb-0 fade show",attrs:{role:"alert"}},[t._m(0),t._v(" "),e("div",[t._v(t._s(t.errorMessage)+".")])]):t._e()],2)}),[function(){var t=this._self._c;return t("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":"Close"}},[t("span",{attrs:{"aria-hidden":"true"}},[this._v("\xd7")])])}],!1,null,"64680ecd",null).exports;function g(){g=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new E(n||[]);return a(s,"_invoke",{value:A(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function _(){}function b(){}var w={};l(w,s,(function(){return this}));var C=Object.getPrototypeOf,S=C&&C(C(O([])));S&&S!==r&&n.call(S,s)&&(w=S);var x=b.prototype=y.prototype=Object.create(w);function R(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function A(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=k(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&
vendor: 1,572 bytes, line 2
2(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function O(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return _.prototype=b,a(x,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:_,configurable:!0}),_.displayName=l(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}}
2,R(N.prototype),l(N.prototype,o,(function(){return this})),e.AsyncIterator=N,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new N(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},R(x),l(x,c,"Generator"),l(x,s,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;L(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function _(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}var b={name:"CopyableIdentifier",props:{text:{type:String,required:!0},copyValue:{type:String,default:null},annotation:{type:String,default:""},copyLabel:{type:String,default:"Copy to clipboard"}},data:function(){return{copied:!1,resetTimer:null}},beforeDestroy:function(){this.resetTimer&&clearTimeout(this.resetTimer)},methods:{copy:function(){var t,e=this;return(t=g().mark((function t(){var r,n,a,i;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=null!=e.copyValue?e.copyValue:e.text,t.prev=1,!navigator.clipboard||!window.isSecureContext){t.next=3;break}return t.next=2,navigator.clipboard.writeText(r);case 2:t.next=4;break;case 3:(n=document.createElement("textarea")).value=r,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select(),a=!1;try{a=document.execCommand("copy")}finally{document.body.removeChild(n)}if(a){t.next=4;break}throw new Error("execCommand('copy') returned false");case 4:e.copied=!0,e.resetTimer&&clearTimeout(e.resetTimer),e.resetTimer=setTimeout((function(){e.copied=!1}),1500),t.next=6;break;case 5:t.prev=5,i=t.catch(1),console.error(i);case 6:case"end":return t.stop()}}),t,null,[[1,5]])})),function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){_(i,n,a,s,o,"next",t)}function o(t){_(i,n,a,s,o,"throw",t)}s(void 0)}))})()}}},w=b,C={name:"ClusterNodes",components:{CopyableIdentifier:(0,c.A)(w,(function(){var t=this,e=t._self._c;return e("span",{staticClass:"copyable-identifier"},[e("span",{staticClass:"copyable-identifier__text font-mono"},[t._v(t._s(t.text))]),t._v(" "),t.annotation?e("span",{staticClass:"copyable-identifier__annotation"},[t._v(t._s(t.annotation))]):t._e(),t._v(" "),e("button",{staticClass:"copyable-identifier__copy btn",class:{"
2is-copied":t.copied},attrs:{type:"button",title:t.copied?"Copied":t.copyLabel,"aria-label":t.copied?"Copied":t.copyLabel},on:{click:t.copy}},[t.copied?e("svg",{attrs:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}},[e("polyline",{attrs:{points:"20 6 9 17 4 12"}})]):e("svg",{attrs:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}},[e("rect",{attrs:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}}),t._v(" "),e("path",{attrs:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}})])])])}),[],!1,null,"6234eaca",null).exports},computed:{clusterInfo:function(){return this.$store.state.clusterInfo},showNodeRegions:function(){return"off"!==this.clusterInfo.configuration.search_delivery_network_option&&this.clusterInfo.per_node_regions&&new Set(this.clusterInfo.per_node_regions).size>1}}},S=(0,c.A)(C,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"row no-gutters"},[e("div",{staticClass:"col"},[e("h4",{staticClass:"mb-3"},[t._v("Endpoints")]),t._v(" "),e("div",{staticClass:"endpoints-card"},["off"!==t.clusterInfo.configuration.search_delivery_network_option?e("div",[e("h6",{staticClass:"endpoints-group-title",class:"yes"===t.clusterInfo.configuration.load_balancing_option?"mb-0":""},[t._v("\n          Nearest Node\n        ")]),t._v(" "),"yes"===t.clusterInfo.configuration.load_balancing_option?e("div",[e("small",[t._v("Geo load-balanced endpoint with automatic failover.")]),t._v(" "),t._m(0)]):t._e(),t._v(" "),e("p",{class:"yes"===t.clusterInfo.configuration.load_balancing_option?"mt-2":""},[e("CopyableIdentifier",{attrs:{text:t.clusterInfo.hostnames.search_delivery_network,annotation:"[https:443]","copy-label":"Copy hostname"}}),t._v(" "),"yes"===t.clusterInfo.configuration.load_balancing_option?e("span",{staticClass:"badge badge-light ml-3 node-region-badge"},[t._v("Geo Load Balanced")]):t._e()],1),t._v(" "),e("h6",{staticClass:"endpoints-group-title mb-2 mt-4"},[t._v("Individual Nodes")])]):"yes"===t.clusterInfo.configuration.load_balancing_option?e("div",[e("h6",{staticClass:"endpoints-group-title mb-0"},[t._v("Load-Balanced Endpoint")]),t._v(" "),t._m(1),t._v(" "),e("p",{staticClass:"mt-2"},[e("CopyableIdentifier",{attrs:{text:t.clusterInfo.hostnames.load_balanced,annotation:"[https:443]","copy-label":"Copy hostname"}})],1),t._v(" "),e("h6",{staticClass:"endpoints-group-title mb-2 mt-4"},[t._v("Individual Nodes")])]):[e("h6",{staticClass:"endpoints-group-title mb-2"},[t._v("\n          "+t._s(1===t.clusterInfo.hostnames.nodes.length?"Node":"Nodes")+"\n        ")])],t._v(" "),e("ul",{staticClass:"list-group list-group-no-borders mb-0"},t._l(t.clusterInfo.hostnames.nodes,(function(r,n){return e("li",{key:r,class:["list-group-item","d-flex","align-items-center",{"mb-2":t.showNodeRegions}]},[e("CopyableIdentifier",{attrs:{text:r,annotation:"[https: 443]","copy-label":"Copy hostname"}}),t._v(" "),t.showNodeRegions&&t.clusterInfo.per_node_regions[n]?e("span",{staticClass:"badge badge-light ml-3 node-region-badge"},[t._v(t._s(t.clusterInfo.per_node_regions[n]))]):t._e()],1)})),0)],2)])])}),[function(){var t=this,e=t._self._c;return e("small",[t._v("Read more on how to configure your client library\n            "),e("a",{attrs:{target:"_blank",href:"https://typesense.org/docs/guide/typesense-cloud/search-delivery-network.html#client-configuration"}},[t._v("here")]),t._v(".")])},function(){var t=this,e=t._self._c;return e("div",[e("small",[t._v("With automatic failover.")]),t._v(" "),e("small",[t._v("Read more on how to configure your client library\n            "),e("a",{attrs:{target:"_blank",href:"https://typesense.org/docs/guide/high-availability.html#when-using-typesense-cloud-or-a-load-balancer"}},[t._v("here")]),t._v(".")])])}],!1,null,"30b77492",null).exports,x=r(79023),R=r.n(x),N=r(95332),A=r(81601);r(1036);function k(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||L(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i,s,o=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(t){l=!0,a=t}
2finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw a}}return o}}(t,e)||L(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(t,e){if(t){if("string"===typeof t)return E(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var O={name:"MetricChart",props:{chartData:{type:Object,default:null},chartDataMetricNames:{type:Array,default:function(){return[]}},chartDataMetricDisplayNames:{type:Array,default:function(){return[]}},chartTitle:{type:String,default:null},dataTransformer:{type:Function,default:null},showLoadingState:{type:Boolean,default:!0}},data:function(){return{chartObject:null}},computed:{isMetricsDataAvailable:function(){var t=this;return this.chartData&&this.chartDataMetricNames.some((function(e){return t.chartData[e]}))},chartDataWarning:function(){var t=this,e=!1;return this.isMetricsDataAvailable&&this.chartDataMetricNames.forEach((function(r){for(var n=0,a=Object.entries(t.chartData[r]||{});n<a.length;n++){var i=P(a[n],2),s=(i[0],i[1]);if(s.warning){e=s.warning;break}}})),e},chartCssSlug:function(){return this.chartTitle.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")},chartCssClass:function(){return"chart-".concat(this.chartCssSlug)},chartAlertCssClass:function(){return"chart-alert-".concat(this.chartCssSlug)}},watch:{chartData:function(t,e){if(null!=t&&this.chartObject){var r=this.buildDatasets(t);this.chartObject.data.labels=this.concatAllLabels(t),this.chartObject.data.datasets=r,this.chartObject.options.plugins.legend.display=!1,this.chartObject.update()}}},mounted:function(){var t=this.$refs.chart;A.default.defaults.font.family='"Palanquin", -apple-system, BlinkMacSystemFont,\n  "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans",\n  sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",\n  "Noto Color Emoji"';var e=this.isMetricsDataAvailable?this.buildDatasets(this.chartData):[],r={type:"line",options:{animation:{duration:0},interaction:{intersect:!1,mode:"index"},scales:{x:{grid:{lineWidth:0},type:"timeseries",ticks:{autoSkip:!0,major:{enabled:!0},source:"labels",font:function(t){if(t.tick&&t.tick.major)return{weight:"bold"}}}},y:{grid:{color:"rgba(108, 117, 125, 0.12)",drawBorder:!1},min:0,ticks:{color:"#6c757d",padding:8}}},responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1,position:"bottom",align:"center",labels:{boxWidth:8,boxHeight:8,color:"#495057",padding:12,usePointStyle:!0}},title:{display:!0,text:this.chartTitle,position:"left",color:"#343a40",font:{weight:"600"}},tooltip:{cornerRadius:0,padding:15,bodySpacing:7,boxPadding:7,titleMarginBottom:10,usePointStyle:!0}}}};this.isMetricsDataAvailable?r.data={labels:this.concatAllLabels(this.chartData),datasets:e}:console.warn("Metrics data is not available for ".concat(this.chartDataMetricNames.join(", "),". Not rendering chart.")),this.chartObject=new A.default(t,r)},methods:{buildDatasets:function(t){var e=this,r=["#2563eb","#16a34a","#dc2626","#7c3aed","#ea580c","#0891b2","#4b5563"],n=[],a=this.concatAllLabels(t);return this.chartDataMetricNames.forEach((function(i,s){var o=Object.entries(t[i]||{}),c=o.map((function(t,n){var i=P(t,2),c=i[0],l=i[1],u=Number.parseInt(c,10),d=Number.isFinite(u)?u:n+1,h=r[(d-1)%r.length],f=e.dataTransformer?l.values.map(e.dataTransformer):l.values,p=[];a.forEach((function(t,e){var r=l.timestamps.findIndex((function(e){return e===t}));p[e]=r>=0?f[r]:null}));var m={data:p,labels:a,borderColor:h,backgroundColor:h,borderDash:s>0&&e.chartDataMetricNames.length>1?[6,4]:[],borderWidth:1,fill:!1,tension:.12,hoverRadius:4,hitRadius:8,radius:1===l.values.length||l.values.every((function(t){return 0===t}))?2:0,spanGaps:!0}
2,v=e.chartDataMetricDisplayNames[s],y=[];return v&&y.push(v),(o.length>1||!v)&&y.push("Node ".concat(d)),m.label=y.join(" | "),m.nodeNumber=d,m.metricNameIndex=s,m}));n.push.apply(n,k(c))})),n.sort((function(t,e){return t.nodeNumber-e.nodeNumber||t.metricNameIndex-e.metricNameIndex})),n},concatAllLabels:function(t){var e=[];return this.chartDataMetricNames.forEach((function(r){t[r]?e.push.apply(e,k(Object.values(t[r]).map((function(t){return t.timestamps})).reduce((function(t,e){return t.concat(e)}),[]))):console.warn("Metrics data is not available for ".concat(r,". Not rendering line in chart."))})),k(new Set(e)).sort()}}},T=(0,c.A)(O,(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"show",rawName:"v-show",value:t.isMetricsDataAvailable,expression:"isMetricsDataAvailable"}],class:t.chartDataWarning?"border border-warning chart-warning-wrapper":""},[e("div",{staticClass:"chart-container",class:t.chartCssClass},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.showLoadingState,expression:"showLoadingState"}],staticClass:"loadingPane"},[e("div",{staticClass:"spinner-border spinner-border-lg text-secondary mx-2",attrs:{role:"status","aria-hidden":"true"}})]),t._v(" "),e("canvas",{ref:"chart"})]),t._v(" "),t.chartDataWarning?e("div",{staticClass:"alert alert-warning small py-1 px-2 m-0",class:t.chartAlertCssClass},[t._v("\n    Warning: "+t._s(t.chartDataWarning)+"\n  ")]):t._e()])}),[],!1,null,"987a0688",null).exports,I=r(6804),D=r.n(I),M=r(32967),F=r(35899),j=r(29470),q=r(9015);function B(t){return function(t){if(Array.isArray(t))return U(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||V(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i,s,o=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(t){l=!0,a=t}finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw a}}return o}}(t,e)||V(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(t,e){if(t){if("string"===typeof t)return U(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(t,e):void 0}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function H(){H=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new L(n||[]);return a(s,"_invoke",{value:N(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function _(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(E([])));C&&C!==r&&n.call(C,s)&&(b=C);var S=_.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function N(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=A(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&
vendor: 1,572 bytes, line 2
2(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,a(S,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:g,configurable:!0}),g.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}}
2,x(R.prototype),l(R.prototype,o,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new R(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Q(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}function W(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){Q(i,n,a,s,o,"next",t)}function o(t){Q(i,n,a,s,o,"throw",t)}s(void 0)}))}}var Y={name:"ClusterMonitoring",components:{MetricChart:T,VSelect:D(),ClusterConfigurationChangeProgress:F.A,ClusterCloningProgress:j.A},filters:{numberToHumanSize:R()},mixins:[q.A],data:function(){var t=["15_mins","1_hr","2_hrs","3_hrs","6_hrs","12_hrs","24_hrs","3_days","7_days","14_days","30_days"].map((function(t){return{name:t.replace("_"," "),label:t}}));return{loadingMonitoring:!0,clusterHealth:{ok:!0},clusterMetrics:{},clusterMetricsChartData:{},pollingEnabled:!0,healthPollingTimer:null,metricsChartPollingTimer:null,realtimeMetricsPollingTimer:null,questionMarkIcon:N,metricsRelativeStartTimeOptions:t,metricsRelativeStartTime:t[0],metricsAggregateFunctionOptions:["max","avg","p95","min"],metricsAggregateFunction:"p95",metricsShowLoadingState:!0,highAvailabilityCloudHelpDocsUrl:"https://cloud-help-center.typesense.org/article/10-high-availability",highAvailabilityLoadBalancerDocsUrl:"https://typesense.org/docs/guide/high-availability.html#when-using-typesense-cloud-or-a-load-balancer",Deselect:{render:function(t){return t("span","")}},OpenIndicator:M.A}},computed:{clusterStatus:function(){return this.$store.state.clusterStatus},clusterInfo:function(){return this.$store.state.clusterInfo},accessControlPolicy:function(){return this.$store.state.clusterInfo.access_control_policy},showNodeRegions:function(){return this.hasMultiRegionSearchDeliveryNetwork},showEnableHighAvailabilitySearchTrafficWarning:function(){if("yes"===this.clusterInfo.configuration.high_availability_option)return!1;var t=this.clusterMetricsChartData.search_requests_per_second;return!!t&&this.hasSustainedSearchTraffic(t)},showHighAvailabilitySingleNodeTrafficWarning:function(){return Boolean(this.highAvailabilitySingleNodeTrafficWarningDetails)},highAvailabilitySingleNodeTrafficWarningDetails:function(){if("yes"!==this.clusterInfo.configuration.high_availability_option)return null;if(this.hasMultiRegionSearchDeliveryNetwork)return null;var t=this.clusterInfo.hostnames&&this.clusterInfo.hostnames.nodes;if(!t||t.length<2)return null;var e=this.clusterMetricsChartData.search_requests_per_second;return e?this.sustainedSingleNodeSearchTrafficWarningDetails(e):null},highAvailabilitySingleNodeTrafficEndpointDescription:function(){return"off"!==this.clusterInfo.configuration.search_delivery_network_option?"Search Delivery Network or load-balanced endpoint":"load-balanced endpoint"},hasMultiRegionSearchDeliveryNetwork:function(){return"off"!==this.clusterInfo.configuration.search_delivery_network_option&&this.clusterInfo.per_node_regions&&new Set(this.clusterInfo.per_node_regions).size>1},totalMemoryUsedWarning:function(){var t=this.clusterMetricsChartData.total_memory_used_bytes;if(!t)return null;var e=Object.values(t).find((function(t){return t&&t.warning}));return e?e.warning:null}},watch:{metricsRelativeStartTime:function(){this.fetchMetricsChartData()},metricsAggregateFunction:function(){this.fetchMetricsChartData()}},created:function(){var t=this;return W(H().mark((function e(){return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.fetchMetricsChartData(),t.fetchHealthData(),t.fetchRealtimeMetrics();case 1:case"end":return e.stop()}}),e)})))()},beforeDestroy:function(){this.pollingEnabled=!1,this.healthPollingTimer&&(clearTimeout(this.healthPollingTimer),this.healthPollingTimer=null),this.metricsChartPollingTimer&&(clearTimeout(this.metricsChartPollingTimer),this.metricsChartPollingTimer=null),this.realtimeMetricsPollingTimer&&(clearTimeout(this.realtimeMetricsPollingTimer),this.realtimeMetricsPollingTimer=null)}
2,methods:{fetchMetricsChartData:function(){var t=this;return W(H().mark((function e(){var r;return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.metricsChartPollingTimer&&(clearTimeout(t.metricsChartPollingTimer),t.metricsChartPollingTimer=null),e.prev=1,"In Service"!==t.clusterStatus.status||t.clusterStatus.is_initializing){e.next=3;break}return t.metricsShowLoadingState=!0,e.next=2,h.A.get(t.clusterInfo.routes.cluster_metrics_chart_data_path,{params:{relative_start:t.metricsRelativeStartTime.label,aggregate_function:t.metricsAggregateFunction}});case 2:t.clusterMetricsChartData=e.sent.data,t.metricsShowLoadingState=!1;case 3:e.next=5;break;case 4:e.prev=4,r=e.catch(1),console.warn(r);case 5:return e.prev=5,t.metricsShowLoadingState=!1,"Terminated"!==t.clusterStatus.status&&t.pollingEnabled&&null==t.metricsChartPollingTimer&&(t.metricsChartPollingTimer=setTimeout(t.fetchMetricsChartData,6e4)),e.finish(5);case 6:case"end":return e.stop()}}),e,null,[[1,4,5,6]])})))()},fetchHealthData:function(){var t=this;return W(H().mark((function e(){var r;return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.healthPollingTimer&&(clearTimeout(t.healthPollingTimer),t.healthPollingTimer=null),e.prev=1,"In Service"!==t.clusterStatus.status||t.clusterStatus.is_initializing){e.next=3;break}return e.next=2,h.A.get(t.clusterInfo.routes.cluster_health_path,{validateStatus:function(t){return!0}});case 2:t.clusterHealth=e.sent.data;case 3:e.next=5;break;case 4:e.prev=4,r=e.catch(1),t.clusterHealth={ok:null},console.warn(r);case 5:return e.prev=5,t.loadingMonitoring=!1,"Terminated"!==t.clusterStatus.status&&t.pollingEnabled&&null==t.healthPollingTimer&&(t.healthPollingTimer=setTimeout(t.fetchHealthData,1e4*t.clusterInfo.hostnames.nodes.length)),e.finish(5);case 6:case"end":return e.stop()}}),e,null,[[1,4,5,6]])})))()},fetchRealtimeMetrics:function(){var t=this;return W(H().mark((function e(){var r;return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.realtimeMetricsPollingTimer&&(clearTimeout(t.realtimeMetricsPollingTimer),t.realtimeMetricsPollingTimer=null),e.prev=1,"In Service"!==t.clusterStatus.status||t.clusterStatus.is_initializing){e.next=3;break}return e.next=2,h.A.get(t.clusterInfo.routes.cluster_metrics_path);case 2:t.clusterMetrics=e.sent.data;case 3:e.next=5;break;case 4:e.prev=4,r=e.catch(1),t.clusterMetrics={},console.warn(r);case 5:return e.prev=5,"Terminated"!==t.clusterStatus.status&&t.pollingEnabled&&null==t.realtimeMetricsPollingTimer&&(t.realtimeMetricsPollingTimer=setTimeout(t.fetchRealtimeMetrics,5e3*t.clusterInfo.hostnames.nodes.length)),e.finish(5);case 6:case"end":return e.stop()}}),e,null,[[1,4,5,6]])})))()},hasSustainedSearchTraffic:function(t){var e={};Object.values(t).forEach((function(t){var r=t.timestamps||[],n=t.values||[];r.forEach((function(t,r){var a=Number(t),i=Number(n[r]);Number.isFinite(a)&&Number.isFinite(i)&&(e[a]=e[a]||i>=.1)}))}));var r=Object.keys(e).map((function(t){return Number(t)})).sort((function(t,e){return t-e})),n=r.filter((function(t){return e[t]})).length;return this.hasSufficientSustainedSearchTrafficEvidence(r,n)},sustainedSingleNodeSearchTrafficWarningDetails:function(t){var e=this,r={};Object.entries(t).forEach((function(t){var n=G(t,2),a=n[0],i=n[1],s=e.searchMetricNodeLabelFor(a);if(s){var o=i.timestamps||[],c=i.values||[];o.forEach((function(t,e){var n=Number(t),a=Number(c[e]);!Number.isFinite(n)||!Number.isFinite(a)||a<0||(r[n]=r[n]||{},r[n][s]=(r[n][s]||0)+a)}))}}));var n=Object.keys(r).map((function(t){return Number(t)})).sort((function(t,e){return t-e})),a=n.map((function(t){var e=r[t],n=Object.values(e).reduce((function(t,e){return t+e}),0);if(n<.1)return null;var a=G(Object.entries(e).sort((function(t,e){return e[1]-t[1]}))[0],2);return{dominantNodeLabel:a[0],dominantNodeShare:a[1]/n}})).filter(Boolean);if(!this.hasSufficientSustainedSearchTrafficEvidence(n,a.length))return null;var i=a.filter((function(t){return t.dominantNodeShare>=.9}));if(i.length/a.length<.9)return null;var s=i.reduce((function(t,e){var r=e.dominantNodeLabel;return t[r]=(t[r]||0)+1,t}),{}),o=G(Object.entries(s).sort((function(t,e){return e[1]-t[1]}))[0]||[null,0],2),c=o[0],l=o[1];return!c||l/a.length<.9?null:{nodeLabel:c}},searchMetricNodeLabelFor:function(t){var e=Number(t);return!Number.isInteger(e)||e<1?null:"Node ".concat(e)},hasSufficientSustainedSearchTrafficEvidence:function(t,e){if(t.length<5)return!1;var r=this.inferMetricsBucketIntervalInMilliseconds(t);return!(t[t.length-1]-t[0]+r<3e5)&&e/(Math.floor((t[t.length-1]-t[0])/r)+1)>=.9},inferMetricsBucketIntervalInMilliseconds:function(t){var e=t.slice(1).map((function(e,r){return e-t[r]})).filter((function(t){return t>0}));return e.length>0?Math.min.apply(Math,B(e)):6e4}}};function K(){K=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new L(n||[]);return a(s,"_invoke",{value:N(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function _(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(E([])));C&&C!==r&&n.call(C,s)&&(b=C);var S=_.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function N(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=A(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&
vendor: 1,572 bytes, line 2
2(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,a(S,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:g,configurable:!0}),g.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}}
2,x(R.prototype),l(R.prototype,o,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new R(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function z(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}var J={name:"ClusterOverview",components:{ClusterMonitoring:(0,c.A)(Y,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"row no-gutters"},[e("div",{staticClass:"col"},[e("h4",{staticClass:"mb-3"},[t._v("Monitoring")]),t._v(" "),t.loadingMonitoring?e("div",{staticClass:"spinner-border spinner-border-sm text-secondary",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[t._v("Loading...")])]):e("div",[e("div",{staticClass:"row no-gutters"},[e("div",{staticClass:"col"},[e("div",{staticClass:"d-flex align-items-center justify-content-start"},[e("div",{staticClass:"d-flex align-items-center"},[e("span",{staticClass:"badge",class:t.clusterStatus.status_badge},[t._v(t._s(t.clusterStatus.status))]),t._v(" "),"Deprovisioning"===t.clusterStatus.status?e("span",{staticClass:"spinner-border spinner-border-sm text-warning mx-2",attrs:{role:"status","aria-hidden":"true"}}):t._e()]),t._v(" "),"In Service"===t.clusterStatus.status?[!0===t.clusterHealth.ok&&null==t.clusterHealth.resource_error?e("div",{staticClass:"spinner-grow spinner-grow-sm mx-2 text-success",attrs:{role:"status","aria-hidden":"true"}}):!0===t.clusterHealth.ok&&null!=t.clusterHealth.resource_error?e("div",{staticClass:"spinner-grow spinner-grow-sm mx-2 text-warning",attrs:{role:"status","aria-hidden":"true"}}):!1===t.clusterHealth.ok?e("div",{staticClass:"spinner-grow spinner-grow-sm mx-2 text-danger",attrs:{role:"status","aria-hidden":"true"}}):e("div",{staticClass:"spinner-grow spinner-grow-sm mx-2 text-light",attrs:{role:"status","aria-hidden":"true"}}),t._v(" "),!0===t.clusterHealth.ok&&null==t.clusterHealth.resource_error?e("span",{staticClass:"sr-only"},[t._v("Healthy")]):!0===t.clusterHealth.ok&&null!=t.clusterHealth.resource_error?e("span",{staticClass:"sr-only"},[t._v(t._s(t.clusterHealth.resource_error))]):!1===t.clusterHealth.ok?e("span",{staticClass:"sr-only"},[t._v("Unhealthy")]):e("span",{staticClass:"sr-only"},[t._v("Health: Unknown")]),t._v(" "),e("div",{staticClass:"d-flex align-items-center"},[!0===t.clusterHealth.ok&&null==t.clusterHealth.resource_error?e("span",{staticClass:"badge badge-success"},[t._v("Healthy")]):!0===t.clusterHealth.ok&&null!=t.clusterHealth.resource_error?e("span",{staticClass:"badge badge-warning"},[t._v(t._s(t.clusterHealth.resource_error))]):!1===t.clusterHealth.ok?e("span",{staticClass:"badge badge-danger"},[t._v("Unhealthy")]):e("span",{staticClass:"badge badge-outline-dark"},[t._v("Health: Unknown")])])]:t._e()],2)])]),t._v(" "),"Suspended"===t.clusterStatus.status?[e("div",{staticClass:"alert alert-warning mt-4"},[t.clusterInfo.account_has_payment_source?[t._v("\n            Your cluster has been suspended due to multiple payment failures. Please update your\n            payment method to access this cluster.\n          ")]:[t._v("\n            Your cluster has been suspended because your free tier has run out and you do not have\n            a payment method on file. Please update your payment method to access this cluster.\n          ")]],2),t._v(" "),e("div",{staticClass:"mt-2"},[e("a",{staticClass:"btn btn-primary",attrs:{href:t.clusterInfo.routes.add_payment_method_path}},[t._v("Update Payment Method")])])]:t._e(),t._v(" "),e("transition",{attrs:{name:"fade"}},["In Service"==t.clusterStatus.status&&t.clusterMetrics&&Object.keys(t.clusterMetrics).length>0&&t.clusterInfo.hostnames.nodes.length>0?e("div",{staticClass:"row mt-4 cluster-metrics no-gutters overflow-auto"},[e("div",{staticClass:"col d-flex"},t._l(t.clusterInfo.hostnames.nodes,(function(r,n){return e("div",{key:r},[e("div",{staticClass:"card bg-light rounded mr-2"},[e("div",{staticClass:"card-body"},[e("p",{staticClass:"card-text"},[e("small",[t._v("Node "+t._s(n+1))]),t._v(" "),t.showNodeRegions&&t.clusterInfo.per_node_regions[n]?e("br"):t._e(),t._v(" "),t.showNodeRegions&&t.clusterInfo.per_node_regions[n]?e("small",{staticClass:"text-muted node-region-label"},[t._v(t._s(t.clusterInfo.per_node_regions[n]))]):t._e()]),t._v(" "),e("div",{staticClass:"card-title"},[t.clusterMetrics[n]?e("span",[!0===t.clusterMetrics[n].ok&&null==t.clusterMetrics[n].resource_error?e("span",{staticClass:"badge badge-success"},[t._v("Healthy")]):!0===t.clusterMetrics[n].ok&&null!=t.clusterMetrics[n].resource_error?e("span",{staticClass:"badge badge-warning"},[t._v(t._s(t.clusterMetrics[n].resource_error))]):!1===t.clusterMetrics[n].ok?e("span",{staticClass:"badge badge-danger"},[t._v("Unhealthy")]):t._e()]):e("span",{staticClass:"badge badge-outline-dark"},[t._v("Health: N/A")])]),t._v(" "),t._e()])])])})),0)]):t._e()])],2),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"col-sm-auto"},[e("ClusterConfigurationChangeProgress")],1)]),t._v(" "),e("div",{staticClass:"row mt-2"},[e("div",{staticClass:"col-sm-auto"},[e("ClusterCloningProgress")],1)]),t._v(" "),"In Service"==t.clusterStatus.status&&Object.keys(t.clusterMetricsChartData).length>0&&t.accessControlPolicy.cluster_dashboard.view_metrics?e("div",{staticClass:"metrics-container mt-5"},[e("div",{staticClass:"metrics-toolbar d-flex align-items-center flex-wrap mb-2"},[e("h4",{staticClass:"mb-0 mr-3"},[t._v("Metrics")]),t._v(" "),e("div",{staticClass:"d-flex ml-sm-auto"},[e("div",{staticClass:"form-group mb-0"},[e("VSelect",{staticClass:"metrics-relative-start-time-selector",attrs:{id:"metrics-relative-start-time-selector",options:t.metricsRelativeStartTimeOptions,components:{Deselect:t.Deselect,OpenIndicator:t.OpenIndicator},searchable:!1,label:"name"},model:{value:t.metricsRelativeStartTime,callback:function(e){t.metricsRelativeStartTime=e},expression:"metricsRelativeStartTime"}})],1),t._v(" "),e("div",{staticClass:"form-group mb-0 ml-2"},[e("VSelect",{staticClass:"metrics-aggregate-function-selector",attrs:{id:"metrics-aggregate-function-selector",options:t.metricsAggregateFunctionOptions,components:{Deselect:t.Deselect,OpenIndicator:t.OpenIndicator},searchable:!1,label:"name"},model:{value:t.metricsAggregateFunction,callback:function(e){t.metricsAggregateFunction=e},expression:"metricsAggregateFunction"}})],1)])]),t._v(" "),e("h6",{staticClass:"metrics-family-title mt-4 mb-1"},[t._v("Memory Usage")]),t._v(" "),e("p",{staticClass:"small text-muted mb-3"},[t._v("\n        RAM Usage + Swap Usage must be less than your cluster's total RAM for writes to be\n        processed.\n      ")]),t._v(" "),t.totalMemoryUsedWarning?e("div",{staticClass:"alert alert-warning small mb-4"},[t._v("\n        "+t._s(t.totalMemoryUsedWarning)+"\n      ")]):t._e(),t._v(" "),e("div",{staticClass:"charts-container"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.system_memory_used_bytes,expression:"clusterMetricsChartData['system_memory_used_bytes']"}]}
2,[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["system_memory_used_bytes"],"chart-title":"RAM Used (GB)","data-transformer":function(t){return Number((t/1024/1024/1024).toFixed(1))},"show-loading-state":t.metricsShowLoadingState}})],1),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.system_memory_total_bytes,expression:"clusterMetricsChartData['system_memory_total_bytes']"}]},[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["system_memory_total_bytes"],"chart-title":"RAM Total (GB)","data-transformer":function(t){return Number((t/1024/1024/1024).toFixed(1))},"show-loading-state":t.metricsShowLoadingState}})],1),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.system_swap_used_bytes,expression:"clusterMetricsChartData['system_swap_used_bytes']"}]},[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["system_swap_used_bytes","system_swap_total_bytes"],"chart-data-metric-display-names":["Used","Total"],"chart-title":"Swap (GB)","data-transformer":function(t){return Number((t/1024/1024/1024).toFixed(1))},"show-loading-state":t.metricsShowLoadingState}})],1)]),t._v(" "),e("h6",{staticClass:"metrics-family-title mt-5 mb-1"},[t._v("CPU Usage")]),t._v(" "),e("p",{staticClass:"small text-muted mb-3"},[t._v("\n        Should ideally be below 60% during normal course of operations, with occasional spikes\n        over that.\n      ")]),t._v(" "),e("div",{staticClass:"charts-container"},[e("div",[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["system_cpu_active_percentage"],"chart-title":"CPU Usage %","show-loading-state":t.metricsShowLoadingState}})],1)]),t._v(" "),e("h6",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.search_requests_per_second||t.clusterMetricsChartData.search_latency_ms,expression:"\n          clusterMetricsChartData['search_requests_per_second'] ||\n          clusterMetricsChartData['search_latency_ms']\n        "}],staticClass:"metrics-family-title mt-5 mb-3"},[t._v("\n        Search Metrics\n      ")]),t._v(" "),e("div",{staticClass:"charts-container"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.search_requests_per_second,expression:"clusterMetricsChartData['search_requests_per_second']"}]},[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["search_requests_per_second"],"chart-title":"Search Requests per Second","show-loading-state":t.metricsShowLoadingState}}),t._v(" "),t.showEnableHighAvailabilitySearchTrafficWarning?e("div",{staticClass:"alert alert-warning small mt-2 mb-0 ha-search-traffic-warning"},[e("strong",[t._v("Consider turning on High Availability.")]),t._v("\n            The displayed search metric shows sustained traffic across this metrics window. For\n            production search traffic, High Availability keeps searches running through node\n            failures and rolling maintenance, and can spread read traffic across multiple nodes.\n            "),e("a",{attrs:{href:t.highAvailabilityCloudHelpDocsUrl,target:"_blank",rel:"noopener"}},[t._v("Learn how High Availability works")]),t._v(".\n          ")]):t._e(),t._v(" "),t.showHighAvailabilitySingleNodeTrafficWarning?e("div",{staticClass:"alert alert-warning small mt-2 mb-0 ha-single-node-search-traffic-warning"},[e("strong",[t._v("\n              High Availability is enabled, but search traffic is mostly reaching\n              "+t._s(t.highAvailabilitySingleNodeTrafficWarningDetails.nodeLabel)+".\n            ")]),t._v("\n            Update your Typesense client configuration to use the\n            "+t._s(t.highAvailabilitySingleNodeTrafficEndpointDescription)+", with all node hostnames\n            configured as fallbacks.\n            "),e("a",{attrs:{href:t.highAvailabilityLoadBalancerDocsUrl,target:"_blank",rel:"noopener"}},[t._v("Learn how to configure High Availability clients")]),t._v(".\n          ")]):t._e()],1),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.search_latency_ms,expression:"clusterMetricsChartData['search_latency_ms']"}]}
2,[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["search_latency_ms"],"chart-title":"Search Latency (ms)","show-loading-state":t.metricsShowLoadingState}})],1)]),t._v(" "),e("h6",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.pending_write_batches,expression:"clusterMetricsChartData['pending_write_batches']"}],staticClass:"metrics-family-title mt-5 mb-3"},[t._v("\n        Write Metrics\n      ")]),t._v(" "),e("div",{staticClass:"charts-container"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.pending_write_batches,expression:"clusterMetricsChartData['pending_write_batches']"}]},[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["pending_write_batches"],"chart-title":"Pending Write Batches","show-loading-state":t.metricsShowLoadingState}})],1)]),t._v(" "),e("h6",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.system_disk_used_bytes||t.clusterMetricsChartData.system_disk_total_bytes,expression:"\n          clusterMetricsChartData['system_disk_used_bytes'] ||\n          clusterMetricsChartData['system_disk_total_bytes']\n        "}],staticClass:"metrics-family-title mt-5 mb-1"},[t._v("\n        Disk Usage\n      ")]),t._v(" "),e("p",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.system_disk_used_bytes||t.clusterMetricsChartData.system_disk_total_bytes,expression:"\n          clusterMetricsChartData['system_disk_used_bytes'] ||\n          clusterMetricsChartData['system_disk_total_bytes']\n        "}],staticClass:"small text-muted mb-3"},[t._v("\n        We provision 5X disk space, for a cluster with X amount of RAM. Should ideally be below\n        80%.\n      ")]),t._v(" "),e("div",{staticClass:"charts-container"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.system_disk_used_bytes,expression:"clusterMetricsChartData['system_disk_used_bytes']"}]},[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["system_disk_used_bytes"],"chart-title":"Disk Used (GB)","data-transformer":function(t){return Number((t/1024/1024/1024).toFixed(1))},"show-loading-state":t.metricsShowLoadingState}})],1),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.system_disk_total_bytes,expression:"clusterMetricsChartData['system_disk_total_bytes']"}]},[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["system_disk_total_bytes"],"chart-title":"Disk Total (GB)","data-transformer":function(t){return Number((t/1024/1024/1024).toFixed(1))},"show-loading-state":t.metricsShowLoadingState}})],1)]),t._v(" "),e("h6",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.system_network_received_bytes_rate||t.clusterMetricsChartData.system_network_sent_bytes_rate,expression:"\n          clusterMetricsChartData['system_network_received_bytes_rate'] ||\n          clusterMetricsChartData['system_network_sent_bytes_rate']\n        "}],staticClass:"metrics-family-title mt-5 mb-3"},[t._v("\n        Network Usage\n      ")]),t._v(" "),e("div",{staticClass:"charts-container"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.system_network_received_bytes_rate,expression:"clusterMetricsChartData['system_network_received_bytes_rate']"}]},[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["system_network_received_bytes_rate"],"chart-title":"Network Received Rate (MBps)","data-transformer":function(t){return Math.round(t/1024/1024)},"show-loading-state":t.metricsShowLoadingState}})],1),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.clusterMetricsChartData.system_network_sent_bytes_rate,expression:"clusterMetricsChartData['system_network_sent_bytes_rate']"}]},[e("MetricChart",{attrs:{"chart-data":t.clusterMetricsChartData,"chart-data-metric-names":["system_network_sent_bytes_rate"],"chart-title":"Network Sent Rate (MBps)","data-transformer":function(t){return Math.round(t/1024/1024)},"show-loading-state":t.metricsShowLoadingState}})],1)])]):t._e()])])}
2),[],!1,null,"1f160c6f",null).exports,ClusterNodes:S,ClusterActions:y,ClusterProvisioningState:l},computed:{showProvisioningState:function(){return"Provisioning"===this.clusterStatus.status||this.clusterStatus.is_initializing},loadingClusterStatus:function(){return this.$store.state.loadingClusterStatus},clusterStatus:function(){return this.$store.state.clusterStatus},accessControlPolicy:function(){return this.$store.state.clusterInfo.access_control_policy}},created:function(){var t,e=this;return(t=K().mark((function t(){return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.$store.dispatch("fetchClusterInfo");case 1:return t.abrupt("return",t.sent);case 2:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){z(i,n,a,s,o,"next",t)}function o(t){z(i,n,a,s,o,"throw",t)}s(void 0)}))})()}},X=J,Z=(0,c.A)(X,(function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"row no-gutters",class:t.$options.name},[t._m(0)]),t._v(" "),e("div",{staticClass:"row no-gutters"},[e("div",{staticClass:"col-sm"},[t.loadingClusterStatus?[e("div",{staticClass:"spinner-border spinner-border-sm text-secondary mx-2",attrs:{role:"status","aria-hidden":"true"}})]:[t.accessControlPolicy.cluster_dashboard.full_access?e("ClusterActions",{staticClass:"mb-4"}):t._e(),t._v(" "),t.showProvisioningState?[e("ClusterProvisioningState")]:[e("ClusterNodes"),t._v(" "),e("ClusterMonitoring",{staticClass:"mt-5"})]]],2)])])}),[function(){var t=this._self._c;return t("div",{staticClass:"col-sm"},[t("h2",{staticClass:"mb-4 h3"},[this._v("Overview")])])}],!1,null,null,null).exports,tt=r(71623),et=r(36847),rt=r(14744),nt=r(23519),at=r(51690),it=r(79116),st=r(5337),ot=r(20378),ct=r.n(ot),lt=r(52592),ut=r(38567),dt=(r(10246),r(90821)),ht={name:"DeselectCross"},ft=(0,c.A)(ht,(function(){var t=this._self._c;return t("svg",{attrs:{fill:"none",height:"8",viewBox:"0 0 8 8",width:"8",xmlns:"http://www.w3.org/2000/svg"}},[t("path",{attrs:{"clip-rule":"evenodd",d:"m3.99526 5.00592-2.5784 2.5784c-.661246.66125-1.662158-.34938-1.001278-1.01064l2.578398-2.5784-2.578398-2.5784c-.661248-.661251.34-1.662163 1.001278-1.001283l2.5784 2.578403 2.5784-2.578403c.66125-.661248 1.67184.34 1.01064 1.001283l-2.5784 2.5784 2.5784 2.5784c.66125.66125-.34937 1.67184-1.01064 1.01064z",fill:"#6169c5","fill-rule":"evenodd"}})])}),[],!1,null,"a48677c0",null).exports,pt=r(22378),mt=r(94432),vt=r(5485),yt=r(43799),gt=r(26130),_t=r(52741),bt=r(71983),wt=(r(72514),r(10993));function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function St(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ct(Object(r),!0).forEach((function(e){xt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function xt(t,e,r){var n;return(e="symbol"==typeof(n=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?n:n+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rt(){Rt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new L(n||[]);return a(s,"_invoke",{value:N(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function _(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(E([])));C&&C!==r&&n.call(C,s)&&(b=C);var S=_.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function N(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=A(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&
vendor: 1,572 bytes, line 2
2(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,a(S,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:g,configurable:!0}),g.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}}
2,x(R.prototype),l(R.prototype,o,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new R(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Nt(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}function At(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){Nt(i,n,a,s,o,"next",t)}function o(t){Nt(i,n,a,s,o,"throw",t)}s(void 0)}))}}var kt={name:"DocumentEditModal",components:{PrismEditor:_t.N},props:{documentIdToEdit:{type:String,required:!0},collectionName:{type:String,default:null}},data:function(){return{document:null,editDocumentEditorContent:null,DocumentMetadataFields:wt.A}},computed:{typesenseServerConfig:function(){return this.$store.state.typesenseServerConfig},documentId:function(){var t;return null===(t=this.document)||void 0===t?void 0:t.id}},watch:{document:{immediate:!0,handler:function(t,e){this.editDocumentEditorContent=JSON.stringify(this.document,null,2)}}},methods:{highlighter:function(t){return(0,bt.highlight)(t,bt.languages.json)},show:function(){var t=this;return At(Rt().mark((function e(){return Rt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,t.fetchLatestDocument();case 1:t.document=e.sent,$(t.$refs.modalRoot).modal("show");case 2:case"end":return e.stop()}}),e)})))()},fetchLatestDocument:function(){var t=this;return At(Rt().mark((function e(){var r,n,a;return Rt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.collectionName){e.next=1;break}return e.abrupt("return",{});case 1:return r=new ut.Ay.Client(t.typesenseServerConfig),e.prev=2,e.next=3,r.collections(t.collectionName).documents(t.documentIdToEdit).retrieve();case 3:return n=e.sent,e.abrupt("return",n);case 4:e.prev=4,a=e.catch(2),console.error("Unable to fetch document ".concat(t.documentIdToEdit)),console.error(a),alert("There was an error fetching document ".concat(t.documentIdToEdit,". Please see console for errors and reach out to contact at typesense dot org with a screenshot to troubleshoot."));case 5:case"end":return e.stop()}}),e,null,[[2,4]])})))()},upsertDocument:function(){var t=this;return At(Rt().mark((function e(){var r,n;return Rt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $(t.$refs.modalRoot).modal("hide"),e.prev=1,r=new ut.Kj(t.$store.state.typesenseServerConfig),s().start(),e.next=2,r.collections(t.collectionName).documents().upsert(St({id:t.documentIdToEdit},JSON.parse(t.editDocumentEditorContent)));case 2:e.sent,t.$emit("document-upsert-finished",{succeeded:!0,documentId:t.documentIdToEdit}),e.next=4;break;case 3:e.prev=3,n=e.catch(1),t.$emit("document-upsert-finished",{succeeded:!1,documentId:t.documentIdToEdit,error:n}),console.error(n);case 4:return e.prev=4,s().done(),e.abrupt("return",!0);case 5:case"end":return e.stop()}}),e,null,[[1,3,4,5]])})))()}}},Pt=(0,c.A)(kt,(function(){var t=this,e=t._self._c;return e("div",{ref:"modalRoot",staticClass:"modal fade",attrs:{tabindex:"-1","aria-labelledby":"editDocumentMod
2alLabel-".concat(t.documentId),"aria-hidden":"true"}},[e("div",{staticClass:"modal-dialog modal-lg"},[e("div",{staticClass:"modal-content"},[e("div",{staticClass:"modal-header"},[e("h4",{staticClass:"modal-title",attrs:{id:"editDocumentModalLabel-".concat(t.documentId)}},[t._v("\n          Edit Document ID: "+t._s(t.documentId)+"\n        ")]),t._v(" "),t._m(0)]),t._v(" "),e("div",{staticClass:"modal-body"},[t.document?e("div",[e("PrismEditor",{ref:"editDocumentEditor",staticClass:"code-editor",attrs:{highlight:t.highlighter,"line-numbers":""},model:{value:t.editDocumentEditorContent,callback:function(e){t.editDocumentEditorContent=e},expression:"editDocumentEditorContent"}},[t._v("{}")])],1):t._e()]),t._v(" "),e("div",{staticClass:"modal-footer"},[e("button",{staticClass:"btn btn-primary",on:{click:function(e){return t.upsertDocument()}}},[t._v("Upsert")])])])])])}),[function(){var t=this._self._c;return t("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[t("span",{attrs:{"aria-hidden":"true"}},[this._v("\xd7")])])}],!1,null,null,null).exports;function Lt(){Lt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new L(n||[]);return a(s,"_invoke",{value:N(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function _(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(E([])));C&&C!==r&&n.call(C,s)&&(b=C);var S=_.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function N(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=A(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);
2if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,a(S,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:g,configurable:!0}),g.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(R.prototype),l(R.prototype,o,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new R(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Et(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}function Ot(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){Et(i,n,a,s,o,"next",t)}function o(t){Et(i,n,a,s,o,"throw",t)}s(void 0)}))}}var Tt={name:"DocumentViewJsonModal",components:{},props:{documentIdToView:{type:String,required:!0},hitItem:{type:Object,default:function(){return{}}},collectionName:{type:String,default:null}},data:function(){return{documentHit:null}},computed:{typesenseServerConfig:function(){return this.$store.state.typesenseServerConfig},documentId:function(){var t;return null===(t=this.documentHit)||void 0===t||null===(t=t.document)||void 0===t?void 0:t.id}},updated:function(){this.$nextTick((function(){Prism.highlightAll()}))},beforeDestroy:function(){$(this.$refs.modalRoot).modal("hide")}
2,mounted:function(){this.$nextTick((function(){Prism.highlightAll()}))},methods:{highlighter:function(t){return(0,bt.highlight)(t,bt.languages.json)},show:function(){var t=this;return Ot(Lt().mark((function e(){var r;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Object.assign({},t.hitItem._rawTypesenseHit),t.documentHit=r,$(t.$refs.modalRoot).modal("show");case 1:case"end":return e.stop()}}),e)})))()},hide:function(){$(this.$refs.modalRoot).modal("hide")},fetchLatestDocument:function(){var t=this;return Ot(Lt().mark((function e(){var r,n,a;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.collectionName){e.next=1;break}return e.abrupt("return",{});case 1:return r=new ut.Ay.Client(t.typesenseServerConfig),e.prev=2,e.next=3,r.collections(t.collectionName).documents(t.documentIdToView).retrieve();case 3:return n=e.sent,e.abrupt("return",n);case 4:e.prev=4,a=e.catch(2),console.error("Unable to fetch document ".concat(t.documentIdToView)),console.error(a),alert("There was an error fetching document ".concat(t.documentIdToView,". Please see console for errors and reach out to contact at typesense dot org with a screenshot to troubleshoot."));case 5:case"end":return e.stop()}}),e,null,[[2,4]])})))()}}},It=(0,c.A)(Tt,(function(){var t=this,e=t._self._c;return e("div",{ref:"modalRoot",staticClass:"modal fade",attrs:{tabindex:"-1","aria-labelledby":"viewDocumentModalLabel-".concat(t.documentId),"aria-hidden":"true"}},[e("div",{staticClass:"modal-dialog modal-lg"},[e("div",{staticClass:"modal-content"},[e("div",{staticClass:"modal-header"},[e("h4",{staticClass:"modal-title",attrs:{id:"viewDocumentModalLabel-".concat(t.documentId)}},[t._v("\n          Viewing Document ID: "+t._s(t.documentId)+"\n        ")]),t._v(" "),t._m(0)]),t._v(" "),e("div",{staticClass:"modal-body"},[t.documentHit?e("pre",{key:JSON.stringify(t.documentHit)},[e("code",{staticClass:"language-json"},[t._v(t._s(t.documentHit))])]):t._e()]),t._v(" "),t._m(1)])])])}),[function(){var t=this._self._c;return t("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[t("span",{attrs:{"aria-hidden":"true"}},[this._v("\xd7")])])},function(){var t=this._self._c;return t("div",{staticClass:"modal-footer"},[t("button",{staticClass:"btn btn-primary",attrs:{"data-dismiss":"modal"}},[this._v("Close")])])}],!1,null,null,null).exports,Dt=r(31856),Mt=r(34351),Ft=r(70214),jt=r(60089),qt=r(85349),$t=(r(16762),r(9404));function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i,s,o=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(t){l=!0,a=t}finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw a}}return o}}(t,e)||function(t,e){if(!t)return;if("string"===typeof t)return Gt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Vt=r(58467),Ut=r(23682),Ht=r.n(Ut),Qt=r(32028),Wt=r.n(Qt),Yt={name:"ConversationWidget",mixins:[(0,st.yb)({connector:Vt.A})],emits:["conversation-id-updated"],data:function(){return{lodashStartCase:Ht(),lodashCamelCase:Wt(),currentConversationId:null}},computed:{widgetParams:function(){return{}},hits:function(){var t;return[null===(t=this.state)||void 0===t||null===(t=t.hits)||void 0===t||null===(t=t[0])||void 0===t?void 0:t._rawTypesenseConversation]},conversation:function(){var t,e,r;return Array.isArray(null===(t=this.hits)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.conversation_history)?null===(e=this.hits)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.conversation_history:null===(r=this.hits)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.conversation_history)||void 0===r?void 0:r.conversation}},watch:{hits:function(t){var e,r,n;if(null!==(e=this.hits)&&void 0!==e&&null!==(e=e[0])&&void 0!==e&&null!==(e=e.conversation_history)&&void 0!==e&&e.id)this.currentConversationId=null===(n=this.hits)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.conversation_history)||void 0===n?void 0:n.id;else if(null!==(r=this.hits)&&void 0!==r&&null!==(r=r[0])&&void 0!==r&&r.conversation_id){var a;this.currentConversationId=null===(a=this.hits)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.conversation_id}}}},Kt=(0,c.A)(Yt,(function(){var t=this,e=t._self._c;return t.hits[0]?e("div",[t.currentConversationId?e("div",{staticClass:"row mt-4"},[e("div",{staticClass:"col-sm small"},[t._v("\n      To ask follow-up questions in the same conversation, add this to the Additional Search\n      Parameters Section:\n      "),e("code",[t._v("conversation_id="+t._s(t.currentConversationId))])])]):t._e(),t._v(" "),e("div",{staticClass:"mt-4 px-4 pb-4"},t._l(t.conversation.slice().reverse(),(function(r,n){return e("div",{key:"c
2onversation-".concat(t.hits[0].converation_id,"-item-").concat(n),staticClass:"row border-left-light",class:[n===t.conversation.length-1?"":"mb-4",n<2?"bg-light p-3 mb-2":""]},[e("div",{staticClass:"col-sm"},t._l(Object.entries(r),(function(r){var n=Bt(r,2),a=n[0],i=n[1];return e("div",{key:"".concat(a,"-").concat(i)},[e("h6",{staticClass:"mb-1"},[t._v(t._s(t.lodashStartCase(t.lodashCamelCase(a))))]),t._v("\n          "+t._s(i)+"\n        ")])})),0)])})),0)]):t._e()}),[],!1,null,null,null).exports,zt={name:"LoadingIndicator",mixins:[(0,st.yb)({connector:function(t,e){return function(){return{init:function(){t({searchMetadata:{}},!0)},render:function(e){var r=e.searchMetadata;t({searchMetadata:r},!1)},dispose:function(){e()}}}}})]},Jt=(0,c.A)(zt,(function(){var t=this,e=t._self._c;return t.state&&t.state.searchMetadata.isSearchStalled?e("span",{staticClass:"spinner-border spinner-border-sm text-secondary spinner-border-thin",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[t._v("Loading...")])]):t._e()}),[],!1,null,"5ddef5de",null).exports;function Xt(){Xt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new L(n||[]);return a(s,"_invoke",{value:N(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function _(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(E([])));C&&C!==r&&n.call(C,s)&&(b=C);var S=_.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function N(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=A(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);
vendor: 4,465 bytes, line 2
2if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,a(S,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:g,configurable:!0}),g.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(R.prototype),l(R.prototype,o,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new R(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Zt(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}function te(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){Zt(i,n,a,s,o,"next",t)}function o(t){Zt(i,n,a,s,o,"throw",t)}s(void 0)}))}}function ee(t){return function(t){if(Array.isArray(t))return ae(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ne(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function re(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i,s,o=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(t){l=!0,a=t}
2finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw a}}return o}}(t,e)||ne(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(t,e){if(t){if("string"===typeof t)return ae(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ae(t,e):void 0}}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function se(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ie(Object(r),!0).forEach((function(e){oe(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function oe(t,e,r){var n;return(e="symbol"==typeof(n=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?n:n+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ce=5e5,le=/[$^*+\[\]{}|?]/,ue={name:"CollectionDocumentsSearch",components:{LoadingIndicator:Jt,ConversationWidget:Kt,DocumentAttributes:Ft.A,DebouncedSearchBox:Mt.A,AisRefreshState:Dt.A,AisInstantSearch:st.bF,AisSearchBox:st.DH,AisHits:st.g2,AisStateResults:st.jV,AisRefinementList:st.tq,AisRangeInput:st.$0,AisPagination:st.WY,AisHitsPerPage:st.Cn,AisStats:st.NP,VueSlider:ct(),VSelect:D(),InputTag:lt.A,DocumentEditModal:Pt,DocumentViewJsonModal:It,DropdownArrow:M.A},mixins:[q.A,jt.A,qt.A,$t.A],data:function(){return{currentQueryByFields:null,currentfacetAndFilterByFields:null,currentSortByFields:null,currentGroupByFields:null,currentAdditionalSearchParameters:null,currentPreset:null,presets:[],OpenIndicator:M.A,Deselect:ft,errorMessage:null,additionalSearchParameterErrorMessage:null,errorMessageScrollTimer:null,currentTypesenseInstantSearchAdapter:null,refreshCurrentTypesenseInstantSearchAdapter:!0,searchAsYouType:!0,deleteIcon:pt,editIcon:mt,viewJsonIcon:vt,hierarchyIcon:yt,searchIcon:gt}},computed:{typesenseServerVersion:function(){return this.$store.state.clusterInfo.configuration.typesense_server_version_option},typesenseServerConfig:function(){return this.$store.state.typesenseServerConfig},currentCollection:function(){return this.$store.state.currentCollection||{}},searchParametersFromFields:function(){var t=this,e=se({query_by:this.queryByFields.map((function(t){return t.name})).join(","),group_by:this.groupByFields.map((function(t){return t.name})).join(","),sort_by:this.sortByFields.join(",")},Object.fromEntries(this.additionalSearchParameters.map((function(e){return t.splitAtFirstOccurenceOfCharacter(e,"=")}))));return se({},Object.fromEntries(Object.entries(e).filter((function(t){var e=re(t,2),r=(e[0],e[1]);return null!=r&&""!==r}))))},presetOptions:function(){return ee(this.presets.map((function(t){return t.name}))).sort()},queryByOptions:function(){var t=(this.currentCollection.fields||[]).filter((function(t){return["string","string[]"].includes(t.type)})).filter((function(t){return!le.test(t.name)})).filter((function(t){return!1!==t.index}));return this.isTypesenseServerVersionAtleast("0.25.0.rc50")&&(t=t.concat(this.currentCollectionAutoEmbedVectorFields.slice(0,1))),ee(t).sort((function(t,e){return t.name.localeCompare(e.name)}))},hasEffectiveQueryBy:function(){return Boolean(this.searchParametersFromFields.query_by)||Boolean(this.selectedPreset)},hasStringFields:function(){return(this.currentCollection.fields||[]).some((function(t){return["string","string[]"].includes(t.type)}))},facetAndFilterByOptions:function(){return ee((this.currentCollection.fields||[]).filter((function(t){return t.facet})).filter((function(t){return!le.test(t.name)})).filter((function(t){return!["object","object[]"].includes(t.type)}))).sort((function(t,e){return t.name.localeCompare(e.name)}
2))},sortByOptions:function(){var t=["_text_match:desc"],e=(this.currentCollection.fields||[]).filter((function(t){return["int32","int64","float"].includes(t.type)&&(!0===t.sort||null==t.sort)})).filter((function(t){return!le.test(t.name)}));if(t.push(e.map((function(t){return["".concat(t.name,":asc"),"".concat(t.name,":desc")]}))),this.isTypesenseServerVersionAtleast("0.23.0.rc10")){var r=(this.currentCollection.fields||[]).filter((function(t){return["string"].includes(t.type)&&!0===t.sort})).filter((function(t){return!le.test(t.name)}));t.push(r.map((function(t){return["".concat(t.name,":asc"),"".concat(t.name,":desc")]})))}return ee(t.flat(2)).sort()},groupByOptions:function(){return this.facetAndFilterByOptions},queryByFields:{get:function(){var t=this;if(this.currentQueryByFields)return this.currentQueryByFields;var e=new URL(window.location.href).searchParams.getAll("query_by");if(e.length>0)return e.map((function(e){return t.queryByOptions.find((function(t){return t.name===e}))||{name:e}}));var r=this.queryByOptions.filter((function(t){return!1===t.facet&&!t.name.endsWith("_id")&&"id"!==t.name})).slice(0,3);return 0===r.length?this.queryByOptions.slice(0,3):r},set:function(t){this.currentQueryByFields=t}},sortByFields:{get:function(){if(this.currentSortByFields)return this.currentSortByFields;var t=new URL(window.location.href).searchParams.getAll("sort_by");return t.length>0?t:["_text_match:desc"]},set:function(t){this.currentSortByFields=t}},facetAndFilterByFields:{get:function(){var t=this;if(this.currentfacetAndFilterByFields)return this.currentfacetAndFilterByFields;var e=new URL(window.location.href).searchParams.getAll("facet_and_filter_by");return e.length>0?e.map((function(e){return t.facetAndFilterByOptions.find((function(t){return t.name===e}))})).filter((function(t){return t})):[]},set:function(t){this.currentfacetAndFilterByFields=t}},groupByFields:{get:function(){var t=this;if(this.currentGroupByFields)return this.currentGroupByFields;var e=new URL(window.location.href).searchParams.getAll("group_by");return e.length>0?e.map((function(e){return t.groupByOptions.find((function(t){return t.name===e}))})).filter((function(t){return t})):[]},set:function(t){this.currentGroupByFields=t}},selectedPreset:{get:function(){return this.currentPreset},set:function(t){this.currentPreset=t}},additionalSearchParameters:{get:function(){if(Array.isArray(this.currentAdditionalSearchParameters))return this.currentAdditionalSearchParameters;var t=new URL(window.location.href).searchParams.getAll("additional_search_parameters");return t.length>0?t:Array.isArray(this.currentCollectionVectorFields)&&this.currentCollectionVectorFields.length>0?["exclude_fields="+this.currentCollectionVectorFields.map((function(t){return t.name})).join(",")]:[]},set:function(t){this.currentAdditionalSearchParameters=t}},currentCollectionVectorFields:function(){var t;return((null===(t=this.currentCollection)||void 0===t?void 0:t.fields)||[]).filter((function(t){return"float[]"===t.type&&t.num_dim&&t.num_dim>0}))},currentCollectionAutoEmbedVectorFields:function(){return this.currentCollectionVectorFields.filter((function(t){return null!=t.embed}))},initialUiState:function(){return oe({},this.currentCollection.name,{query:this.hasEffectiveQueryBy&&this.currentCollection.num_documents>ce?"query":""})},searchClient:function(){var t,e,r=this;return{search:(e=te(Xt().mark((function t(e){var n;return Xt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.errorMessage=null,t.prev=1,null!=r.currentTypesenseInstantSearchAdapter&&!0!==r.refreshCurrentTypesenseInstantSearchAdapter||(r.currentTypesenseInstantSearchAdapter=r.buildNewTypesenseInstantSearchAdapter(),r.refreshCurrentTypesenseInstantSearchAdapter=!1),"true"===r.searchParametersFromFields.conversation&&null==r.queryByFields.find((function(t){return null!=t.embed}))&&(r.errorMessage="Conversation mode requires an auto-embedding field to be specified as a Query By field."),t.next=2,r.currentTypesenseInstantSearchAdapter.searchClient.search(e);case 2:return t.abrupt("return",t.sent);case 3:t.prev=3,n=t.catch(1),r.errorMessage=n;case 4:case"end":return t.stop()}}),t,null,[[1,3]])}
2))),function(t){return e.apply(this,arguments)}),searchForFacetValues:(t=te(Xt().mark((function t(e){var n;return Xt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.errorMessage=null,t.prev=1,null!=r.currentTypesenseInstantSearchAdapter&&!0!==r.refreshCurrentTypesenseInstantSearchAdapter||(r.currentTypesenseInstantSearchAdapter=r.buildNewTypesenseInstantSearchAdapter(),r.refreshCurrentTypesenseInstantSearchAdapter=!1),t.next=2,r.currentTypesenseInstantSearchAdapter.searchClient.searchForFacetValues(e);case 2:return t.abrupt("return",t.sent);case 3:t.prev=3,n=t.catch(1),r.errorMessage=n;case 4:case"end":return t.stop()}}),t,null,[[1,3]])}))),function(e){return t.apply(this,arguments)})}},clusterDashboardSettingsPeristenceNamespace:function(){return"".concat(this.$route.path)},documentGridStyle:function(){return{display:"grid",gridTemplateColumns:"repeat(".concat(this.numColumns,", 1fr)")}}},watch:{errorMessage:function(t){null!=t&&""!==t&&this.scrollErrorMessageIntoView()},selectedPreset:function(t){this.errorMessage=null,null!=this.currentPreset&&""!==this.currentPreset&&(this.queryByFields=[],this.sortByFields=[],this.groupByFields=[],this.additionalSearchParameters=[]),this.persistClusterDashbordSettings(oe({},"".concat(this.clusterDashboardSettingsPeristenceNamespace,"/searchParameters/selectedPreset"),t)),this.refreshCurrentTypesenseInstantSearchAdapter=!0},queryByFields:{immediate:!0,handler:function(t,e){var r=this;if(t&&(this.errorMessage=null,this.refreshCurrentTypesenseInstantSearchAdapter=!0,null!=e&&this.setSearchParametersStateInQueryString(),"true"===this.searchParametersFromFields.conversation&&null==t.find((function(t){return null!=t.embed}))&&(this.errorMessage="Conversation mode requires an auto-embedding field to be specified as a Query By field."),t.some((function(t){return!t.type})))){var n=t.map((function(t){return t.type?t:r.queryByOptions.find((function(e){return e.name.toLowerCase()===t.name.toLowerCase()}))||t}));JSON.stringify(n)!==JSON.stringify(t)&&(this.currentQueryByFields=n)}}},hasEffectiveQueryBy:function(t,e){e&&!t&&this.$refs.searchBox&&this.$refs.searchBox.clearQuery()},sortByFields:{immediate:!0,handler:function(t,e){this.errorMessage=null,this.refreshCurrentTypesenseInstantSearchAdapter=!0,null!=e&&this.setSearchParametersStateInQueryString()}},facetAndFilterByFields:{immediate:!0,handler:function(t,e){this.errorMessage=null,this.refreshCurrentTypesenseInstantSearchAdapter=!0,null!=e&&this.setSearchParametersStateInQueryString()}},groupByFields:{immediate:!0,handler:function(t,e){this.errorMessage=null,this.refreshCurrentTypesenseInstantSearchAdapter=!0,null!=e&&this.setSearchParametersStateInQueryString()}},additionalSearchParameters:{immediate:!0,handler:function(t,e){this.errorMessage=null,this.refreshCurrentTypesenseInstantSearchAdapter=!0,null!=e&&this.setSearchParametersStateInQueryString(),t.find((function(t){return"conversation=true"===t}))?this.searchAsYouType=!1:this.searchAsYouType=!0}},additionalDisplayFields:function(t){this.errorMessage=null,this.persistClusterDashbordSettings(oe({},"".concat(this.clusterDashboardSettingsPeristenceNamespace,"/displayOptions/additionalDisplayFields"),t))},imageField:function(t){this.errorMessage=null,this.persistClusterDashbordSettings(oe({},"".concat(this.clusterDashboardSettingsPeristenceNamespace,"/displayOptions/imageField"),t))},numColumns:function(t){this.persistClusterDashbordSettings(oe({},"".concat(this.clusterDashboardSettingsPeristenceNamespace,"/displayOptions/numColumns"),t))}},created:function(){var t=this;return te(Xt().mark((function e(){var r;return Xt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s().start(),e.prev=1,e.next=2,t.$store.dispatch("refreshCurrentCollection");case 2:e.next=4;break;case 3:e.prev=3,r=e.catch(1),console.error("Error refreshing current collection"),console.error(r);case 4:return e.prev=4,s().done(),e.finish(4);case 5:case"end":return e.stop()}}),e,null,[[1,3,4,5]])})))()},mounted:function(){var t=this;return te(Xt().mark((function e(){return Xt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.isTypesenseServerVersionAtleast("0.24.0.rcn50")){e.next=1;break}return e.next=1,t.fetchPresets();case 1:return e.next=2,t.getReferenceDocument();case 2:return t.referenceDocument=e.sent,e.next=3,t.loadPersistedSettings();case 3:t.initAllSortables();case 4:case"end":return e.stop()}}),e)})))()},methods:{toValue:function(t,e){return[null!=t.min?t.min:e.min,null!=t.max?t.max:e.max]},scrollSearchParametersContainerIntoView:function(){return this.$refs.searchParametersContainer.scrollIntoView({behavior:"smooth"}),!0},searchFunction:function(t){this.errorMessage||(!this.hasEffectiveQueryBy&&t.state.query&&t.setQuery(""),this.hasEffectiveQueryBy&&(this.currentCollection.num_documents||0)>ce&&""===t.state.query.trim()||t.search())},validateAdditionalSearchParameter:function(t){if(""===t.trim())return this.additionalSearchParameterErrorMessage=null,!0;var e=this.splitAtFirstOccurenceOfCharacter(t,"=");return 2===e.length&&""!==e[0]&&""!==e[1]?"conversation"===e[0]&&"true"===e[1]&&null==this.queryByFields.find((function(t){return null!=t.embed}))?(this.additionalSearchParameterErrorMessage="Conversation mode requires an auto-embedding field to be specified as a Query By field.",!1):(this.additionalSearchParameterErrorMessage=null,!0):(this.additionalSearchParameterErrorMessage="Error parsing additional search parameter. Please enter it as parameter=value one at a time, and press enter.",!1)},transformItems:function(t){return t},deleteDocument:function(t){var e=this;return te(Xt().mark((function r(){var n,a,i;return Xt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(confirm("Are you sure you want to DELETE Document ID ".concat(t,"?"))){r.next=1;break}return r.abrupt("return");case 1:return r.prev=1,n=new ut.Kj(e.$store.state.typesenseServerConfig),s().start(),r.next=2,n.collections(e.currentCollection.name).documents(t).delete();case 2:r.sent,e.$refs["document-hit-".concat(t)][0].classList.remove("bg-light","rounded","d-flex","justify-content-end","position-relative"),e.$refs["document-hit-".concat(t)][0].classList.add("alert","alert-warning"),e.$refs["document-hit-".concat(t)][0].innerHTML="Document deleted.",setTimeout(te(Xt().mark((function t(){return Xt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.refreshCurrentTypesenseInstantSearchAdapter=!0,t.next=1,e.$store.dispatch("refreshCurrentCollection");case 1:case"end":return t.stop()}}),t)}))),2e3),r.next=4;break;case 3:r.prev=3,i=r.catch(1),(a=e.$refs["document-edit-delete-status-".concat(t)][0]).classList.remove("d-none","alert-success","alert-warning"),a.classList.add("alert-warning"),a.innerHTML="Error deleting document: "+i,console.error(i);case 4:return r.prev=4,s().done(),r.abrupt("return",!0);case 5:case"end":return r.stop()}}),r,null,[[1,3,4,5]])})))()},handleDocumentUpsertFinished:function(t){var e=this,r=t.succeeded,n=t.documentId,a=t.error,i=this.$refs["document-edit-delete-status-".concat(n)][0];i.classList.remove("d-none","alert-success","alert-warning"),$(i).fadeIn(100),r?(i.classList.add("alert-success"),i.innerHTML="Document Updated.",setTimeout((function(){$(i).fadeOut(),e.refreshCurrentTypesenseInstantSearchAdapter=!0,e.$refs.aisRefreshState.refresh()}),1e3)):(i.classList.add("alert-warning"),i.innerHTML="Document Update Failed: "+a)},fetchPresets:function(){var t=this;return te(Xt().mark((function e(){var r,n,a;return Xt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new ut.Kj(t.$store.state.typesenseServerConfig),e.prev=1,e.next=2,r.presets().retrieve();case 2:n=e.sent.presets,t.presets=n,e.next=4;break;case 3:e.prev=3,a=e.catch(1),console.error(a);case 4:case"end":return e.stop()}}),e,null,[[1,3]])}
2)))()},saveAsPreset:function(){this.$router.push({name:"presets",query:se({addNewPreset:!0},this.searchParametersFromFields)})},scrollErrorMessageIntoView:function(){var t=this;this.errorMessageScrollTimer&&clearTimeout(this.errorMessageScrollTimer),this.errorMessageScrollTimer=setTimeout((function(){var e;document.activeElement.blur(),null===(e=t.$refs.errorMessage)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),500)},splitAtFirstOccurenceOfCharacter:function(t,e){var r=t.indexOf(e);return-1===r?[t]:[t.substring(0,r),t.substring(r+e.length)]},loadPersistedSettings:function(){var t=this;return te(Xt().mark((function e(){var r,n,a,i,s;return Xt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,t.fetchClusterDashbordSettings("".concat(t.clusterDashboardSettingsPeristenceNamespace,"/searchParameters/selectedPreset"),"".concat(t.clusterDashboardSettingsPeristenceNamespace,"/displayOptions/imageField"),"".concat(t.clusterDashboardSettingsPeristenceNamespace,"/displayOptions/numColumns"),"".concat(t.clusterDashboardSettingsPeristenceNamespace,"/displayOptions/additionalDisplayFields"));case 1:r=e.sent,(n=r["".concat(t.clusterDashboardSettingsPeristenceNamespace,"/searchParameters/selectedPreset")])&&t.presetOptions.includes(n)&&(t.selectedPreset=n),(a=r["".concat(t.clusterDashboardSettingsPeristenceNamespace,"/displayOptions/additionalDisplayFields")])&&(t.additionalDisplayFields=a),(i=r["".concat(t.clusterDashboardSettingsPeristenceNamespace,"/displayOptions/imageField")])&&(t.imageField=i),(s=parseInt(r["".concat(t.clusterDashboardSettingsPeristenceNamespace,"/displayOptions/numColumns")]))&&t.numColumnsOptions.includes(s)&&(t.numColumns=s);case 2:case"end":return e.stop()}}),e)})))()},initAllSortables:function(){this.initSortable(".query-by-selector .vs__selected-options","queryByFields"),this.initSortable(".sort-by-selector .vs__selected-options","sortByFields"),this.initSortable(".group-by-selector .vs__selected-options","groupByFields"),this.initSortable(".filter-facet-by-selector .vs__selected-options","facetAndFilterByFields"),this.initSortable(".search-additional-display-fields-selector .vs__selected-options","additionalDisplayFields")},buildNewTypesenseInstantSearchAdapter:function(){var t=!this.hasEffectiveQueryBy,e={server:se(se({},this.typesenseServerConfig),{},{cacheSearchResultsForSeconds:10}),additionalSearchParameters:se(se({},this.searchParametersFromFields),{},{preset:this.selectedPreset||""})};t&&(e.additionalSearchParameters.query_by="id");var r=new dt.A(e);return t&&(r.configuration.additionalSearchParameters.query_by="",r.configuration.additionalSearchParameters.highlight_full_fields=""),r},handleEditDocumentButtonClicked:function(t){this.$refs["document-edit-modal-".concat(t.id)][0].show()},handleViewJSONDocumentButtonClicked:function(t){this.$refs["document-view-json-modal-".concat(t.id)][0].show()},setSearchParametersStateInQueryString:function(){if(window.history.pushState){var t=new URL(window.location.href);t.searchParams.delete("query_by"),this.queryByFields.forEach((function(e){t.searchParams.append("query_by",e.name)})),t.searchParams.delete("facet_and_filter_by"),this.facetAndFilterByFields.forEach((function(e){t.searchParams.append("facet_and_filter_by",e.name)})),t.searchParams.delete("sort_by"),this.sortByFields.forEach((function(e){t.searchParams.append("sort_by",e)})),t.searchParams.delete("group_by"),this.groupByFields.forEach((function(e){t.searchParams.append("group_by",e.name)})),t.searchParams.delete("additional_search_parameters"),this.additionalSearchParameters.forEach((function(e){t.searchParams.append("additional_search_parameters",e)})),window.history.replaceState({path:t.href},"",t.href)}}}},de=ue,he=(0,c.A)(de,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"row no-gutters",class:t.$options.name},[e("div",{staticClass:"col-sm"},[e("div",{staticClass:"text-muted small mb-2"},[t._v(t._s(t.currentCollection.name))]),t._v(" "),e("div",{staticClass:"d-flex"},[e("img",{staticStyle:{"margin-right":"5px"},attrs:{src:t.hierarchyIcon,height:"15",width:"15"}}),t._v(" "),e("h2",{staticClass:"mb-4 h3"},[t._v("Search")])]),t._v(" "),t.currentCollection.name?t.isTypesenseServerVersionAtleast("0.19.0")?e("div",{key:"c
2ollection-".concat(t.currentCollection.name,"-documents-instantsearch")},[e("div",[e("button",{staticClass:"btn btn-link p-0 shadow-none",on:{click:t.scrollSearchParametersContainerIntoView}},[t._v("\n          Search Parameters "),e("DropdownArrow")],1)]),t._v(" "),t.currentCollection.fields?e("AisInstantSearch",{staticClass:"mt-4",attrs:{"search-client":t.searchClient,"search-function":t.searchFunction,"initial-ui-state":t.initialUiState,"index-name":t.currentCollection.name||"indexName"}},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-sm"},[e("AisSearchBox",[e("div",{staticClass:"document-search-box position-relative"},[e("DebouncedSearchBox",{ref:"searchBox",attrs:{delay:30,disabled:!t.hasEffectiveQueryBy,"initial-query":t.initialUiState[t.currentCollection.name].query,placeholder:t.hasEffectiveQueryBy?"Search for records...":"No Query By field or preset is selected in the settings panel at the bottom of this page, so documents are listed without a text query.","search-as-you-type":t.searchAsYouType}}),t._v(" "),e("img",{staticClass:"document-search-box-icon position-absolute",attrs:{src:t.searchIcon,width:"16",height:"16",alt:"","aria-hidden":"true"}})],1)]),t._v(" "),e("div",{staticClass:"row d-flex"},[e("div",{staticClass:"col-sm d-flex align-items-baseline"},[e("AisStats",{staticClass:"small mt-1",scopedSlots:t._u([{key:"default",fn:function(r){var n=r.nbHits,a=r.processingTimeMS;return e("div",{},[t._v("\n                    "+t._s(n.toLocaleString())+" "+t._s(1===n?"result":"results")+" found\n                    from\n                    "+t._s(t.currentCollection.num_documents.toLocaleString())+"\n                    "+t._s((t.currentCollection.num_documents,"docs"))+" in\n                    "+t._s(0===a?1:a)+"ms\n                  ")])}}],null,!1,300154148)}),t._v(" "),e("LoadingIndicator",{staticClass:"ml-2"})],1),t._v(" "),!1===t.searchAsYouType?e("div",{staticClass:"col-sm small text-right"},[t._v("\n                Search-as-you-type is disabled. Press Enter to initiate a search.\n              ")]):t._e()])],1)]),t._v(" "),e("div",{staticClass:"row conversation"},[e("div",{staticClass:"col-sm"},[e("ConversationWidget")],1)]),t._v(" "),e("div",{staticClass:"row mt-4"},[e("Transition",{attrs:{name:"fade"}},[t.facetAndFilterByFields.length>0?e("div",{staticClass:"col-sm-2 order-1 order-sm-0"},[e("Transition",{attrs:{name:"fade"}},[e("div",{key:JSON.stringify(t.facetAndFilterByFields),staticClass:"filters"},[e("TransitionGroup",{attrs:{name:"list",tag:"div"}},t._l(t.facetAndFilterByFields.filter((function(t){return["string","string[]","bool","bool[]","int32","int64","float","int32[]","int64[]","float[]"].includes(t.type)})),(function(r){return e("div",{key:"refinement-list-".concat(r.name),staticClass:"mb-4"},[e("h6",[t._v(t._s(r.name))]),t._v(" "),["string","string[]","bool","bool[]"].includes(r.type)?e("AisRefinementList",{attrs:{attribute:r.name,searchable:"","class-names":{"ais-SearchBox-input":"form-control form-control-sm mb-2","ais-SearchBox-submit":"d-none","ais-SearchBox-reset":"d-none","ais-RefinementList-showMore":"btn btn-secondary btn-sm align-content-center","ais-RefinementList-list":"list-unstyled","ais-RefinementList-count":"badge badge-light ml-2","ais-RefinementList-label":"d-flex align-items-center","ais-RefinementList-labelText":"font-weight-normal","ais-RefinementList-checkbox":"mr-2"}}}):t._e(),t._v(" "),["int32","int64","int32[]","int64[]","float","float[]"].includes(r.type)?e("AisRangeInput",{attrs:{attribute:r.name},scopedSlots:t._u([{key:"default",fn:function(r){var n=r.currentRefinement,a=r.range,i=r.refine;return e("div",{},[e("VueSlider",{attrs:{min:a.min,max:a.max,lazy:"",value:t.toValue(n,a),adsorb:""},on:{change:function(t){return i({min:t[0],max:t[1]})}}})],1)}}],null,!0)}):t._e()],1)})),0)],1)])],1):t._e()]),t._v(" "),e("div",{class:t.facetAndFilterByFields.length>0?"col-sm-10 order-0 order-sm-1":"col-sm"},[e("Transition",{attrs:{name:"fade"}},[e("AisHits",{attrs:{"class-names":{"ais-Hits-list":"p-0"},"transform-items":t.transformItems},scopedSlots:t._u([{key:"default",fn:function(r){var n=r.items;return e("div",{},[e("div",{style:t.documentGridStyle},t._l(n,(function(r){return e("div",{key:"document-hit-".concat(r.id),ref:"document-hit-".concat(r.id),refInFor:!0,staticClass:"document-hit position-relative bg-light rounded p-4 m-2"},[e("div",{staticClass:"document-crud-operations-container"},[e("button",{staticClass:"btn p-0",attrs:{id:"delete-document-".concat(r.id),title:"Delete Document"},on:{click:function(e){return t.deleteDocument(r.id)}}},[e("img",{attrs:{src:t.deleteIcon,height:"15",width:"15"}})]),t._v(" "),e("button",{staticClass:"btn p-0",attrs:{id:"edit-document-".concat(r.id),title:"Edit Document"},on:{click:function(e){return t.handleEditDocumentButtonClicked(r)}}},[e("img",{attrs:{src:t.editIcon,height:"15",width:"15"}})]),t._v(" "),e("button",{staticClass:"btn p-0",attrs:{id:"view-json-document-".concat(r.id),title:"View JSON Document"},on:{click:function(e){return t.handleViewJSONDocumentButtonClicked(r)}}},[e("img",{attrs:{src:t.viewJsonIcon,height:"15",width:"15"}})])]),t._v(" "),e("div",[e("div",{ref:"document-edit-delete-status-".concat(r.id),refInFor:!0,staticClass:"alert mx-3 d-none"}),t._v(" "),e("DocumentEditModal",{ref:"document-edit-modal-".concat(r.id),refInFor:!0,attrs:{"document-id-to-edit":r.id,"collection-name":t.currentCollection.name},on:{"document-upsert-finished":t.handleDocumentUpsertFinished}}),t._v(" "),e("DocumentViewJsonModal",{ref:"document-view-json-modal-".concat(r.id),refInFor:!0,attrs:{"document-id-to-view":r.id,"hit-item":r,"collection-name":t.currentCollection.name}}),t._v(" "),e("DocumentAttributes",{attrs:{"instantsearch-result-item":r,collection:t.currentCollection,"query-by-fields":t.queryByFields,"image-field":t.imageField,"additional-display-fields":t.additionalDisplayFields,"show-unindexed-fields":0===t.additionalDisplayFields.length,"show-non-query-by-fields":0===t.additionalDisplayFields.length}})],1)])})),0)])}}],null,!1,2332690821)})],1),t._v(" "),e("Transition",{attrs:{name:"fade"}},[e("AisStateResults",{scopedSlots:t._u([{key:"default",fn:function(r){var n=r.state.query,a=r.results.hits;return e("div",{directives:[{name:"show",rawName:"v-show",value:!a.length,expression:"!hits.length"}]},[e("p",[t._v("\n                    No results found for "),e("q",[t._v(t._s(n))]),t._v(".\n                  ")])])}}],null,!1,1850357946)})],1),t._v(" "),e("div",{staticClass:"d-flex justify-content-between mt-3"},[e("RouterLink",{attrs:{to:"/collections/".concat(encodeURIComponent(t.currentCollection.name),"/documents/add")}},[t._v("+ Add Documents")]),t._v(" "),e("Transition",{attrs:{name:"fade"}},[e("div",{staticClass:"d-flex"},[e("AisHitsPerPage",{key:"".concat(t.currentCollection.name,"-hits-per-page"),attrs:{items:[{label:"6 hits per page",value:6,default:!0},{label:"15 hits per page",value:15},{label:"30 hits per page",value:30},{label:"60 hits per page",value:60},{label:"100 hits per page",value:100},{label:"250 hits per page",value:250}],"class-names":{"ais-HitsPerPage-select":"custom-select custom-select-sm"}}}),t._v(" "),e("AisPagination",{key:"".concat(t.currentCollection.name,"-pagination"),attrs:{"show-last":!1,"class-names":{"ais-Pagination-list":"d-flex flex-row justify-content-end pl-3","ais-Pagination-item":"px-2 d-block","ais-Pagination-item--disabled":"text-muted","ais-Pagination-item--selected":"font-weight-bold"}}})],1)])],1)],1)],1),t._v(" "),e("AisRefreshState",{ref:"aisRefreshState"})],1):t._e(),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.errorMessage,expression:"errorMessage"}],ref:"errorMessage",staticClass:"alert alert-warning",attrs:{role:"alert"}},[t._v("\n        "+t._s(t.errorMessage)+"\n      ")]),t._v(" "),e("h5",{staticClass:"mt-5"},[t._v("Search Parameters")]),t._v(" "),e("div",{staticClass:"small"},[t._v("\n        These settings control ranking, relevance and search f
2ine-tuning.\n        "),t.isTypesenseServerVersionAtleast("0.24.0.rcn50")?[t._v("Use a preset to save your configuration, and recall in your application.\n        ")]:t._e(),t._v(" "),e("a",{attrs:{href:t.typesenseDocsLink("api/documents.html#search-parameters"),target:"_blank"}},[t._v("Docs >")])],2),t._v(" "),e("div",{ref:"searchParametersContainer",staticClass:"bg-light rounded mt-3 p-sm-5 p-4"},[t.isTypesenseServerVersionAtleast("0.24.0.rcn50")&&t.presets.length>0?e("div",{staticClass:"row d-flex align-items-center mb-4"},[t._m(0),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("VSelect",{staticClass:"search-param-selector preset-selector",attrs:{searchable:!0,options:t.presetOptions,components:{OpenIndicator:t.OpenIndicator,Deselect:t.Deselect},label:"name"},model:{value:t.selectedPreset,callback:function(e){t.selectedPreset=e},expression:"selectedPreset"}})],1)]):t._e(),t._v(" "),e("div",{staticClass:"row d-flex align-items-center"},[t._m(1),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("VSelect",{staticClass:"search-param-selector query-by-selector",attrs:{searchable:!0,multiple:!0,taggable:!0,"create-option":function(t){return{name:t}},options:t.queryByOptions,components:{OpenIndicator:t.OpenIndicator,Deselect:t.Deselect},label:"name"},model:{value:t.queryByFields,callback:function(e){t.queryByFields=e},expression:"queryByFields"}})],1)]),t._v(" "),t.hasStringFields?t._e():e("div",{staticClass:"row mt-1"},[e("div",{staticClass:"col-sm-3"}),t._v(" "),e("div",{staticClass:"query-by-help col-sm-7 small text-muted"},[t._v("\n            String fields are required for full-text search, but your documents do not contain any\n            `string` or `string[]` fields.\n          ")])]),t._v(" "),e("div",{staticClass:"row d-flex align-items-center mt-4"},[t._m(2),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("VSelect",{staticClass:"search-param-selector filter-facet-by-selector",attrs:{searchable:!0,multiple:!0,options:t.facetAndFilterByOptions,components:{OpenIndicator:t.OpenIndicator,Deselect:t.Deselect},label:"name"},model:{value:t.facetAndFilterByFields,callback:function(e){t.facetAndFilterByFields=e},expression:"facetAndFilterByFields"}})],1)]),t._v(" "),e("div",{staticClass:"row d-flex align-items-center mt-4"},[t._m(3),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("VSelect",{staticClass:"search-param-selector sort-by-selector",attrs:{searchable:!0,multiple:!0,options:t.sortByOptions,taggable:!0,components:{OpenIndicator:t.OpenIndicator,Deselect:t.Deselect},selectable:function(){return t.sortByFields.length<3}},model:{value:t.sortByFields,callback:function(e){t.sortByFields=e},expression:"sortByFields"}})],1)]),t._v(" "),e("div",{staticClass:"row d-flex align-items-center mt-4"},[t._m(4),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("VSelect",{staticClass:"search-param-selector group-by-selector",attrs:{searchable:!0,multiple:!0,taggable:!0,options:t.groupByOptions,components:{OpenIndicator:t.OpenIndicator,Deselect:t.Deselect},label:"name"},model:{value:t.groupByFields,callback:function(e){t.groupByFields=e},expression:"groupByFields"}})],1)]),t._v(" "),e("div",{staticClass:"row d-flex align-items-center mt-4"},[t._m(5),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("InputTag",{staticClass:"additional-search-params-tag-input",attrs:{"add-tag-on-keys":[13,9],"add-tag-on-blur":!0,validate:t.validateAdditionalSearchParameter},model:{value:t.additionalSearchParameters,callback:function(e){t.additionalSearchParameters=e},expression:"additionalSearchParameters"}})],1)]),t._v(" "),e("div",{staticClass:"row mt-1"},[e("div",{staticClass:"col-sm-3"}),t._v(" "),e("div",{staticClass:"col-sm-7 small text-muted"},[t._v("\n            Eg: query_by_weights=1,4,8. Read the\n            "),e("a",{attrs:{href:t.typesenseDocsLink("api/documents.html#search-parameters"),target:"_blank"}},[t._v("docs")]),t._v("\n            for more information on available options.\n\n            "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.additionalSearchParameterErrorMessage,expression:"additionalSearchParameterErrorMessage"}],staticClass:"text-danger"},[t._v("\n              "+t._s(t.additionalSearchParameterErrorMessage)+"\n            ")])])]),t._v(" "),t.isTypesenseServerVersionAtleast("0.24.0.rcn50")?e("div",{staticClass:"row d-flex align-items-center mt-4"},[e("div",{staticClass:"col-sm-3 text-sm-right"}),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("button",{staticClass:"btn btn-outline-primary",on:{click:t.saveAsPreset}},[t._v("Save as Preset")])])]):t._e()]),t._v(" "),e("h5",{staticClass:"mt-5"},[t._v("Dashboard Display Options")]),t._v(" "),e("div",{staticClass:"small"},[t._v("\n        These options control the visual display of the results in the search dashboard above\n      ")]),t._v(" "),e("div",{ref:"displayOptionsContainer",staticClass:"bg-light rounded mt-3 p-sm-5 p-4"},[e("div",{staticClass:"row d-flex align-items-center"},[t._m(6),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("VSelect",{staticClass:"search-additional-display-fields-selector",attrs:{searchable:!0,multiple:"",taggable:"",options:t.additionalDisplayFieldsOptions,components:{OpenIndicator:t.OpenIndicator},label:"name"},model:{value:t.additionalDisplayFields,callback:function(e){t.additionalDisplayFields=e},expression:"additionalDisplayFields"}},[e("span",{attrs:{slot:"no-options"},slot:"no-options"}
2,[t._v("No fields found.")])])],1)]),t._v(" "),t._m(7),t._v(" "),e("div",{staticClass:"row d-flex align-items-center mt-3"},[t._m(8),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("VSelect",{staticClass:"search-image-field-selector",attrs:{searchable:!0,taggable:"",options:t.imageFieldOptions,components:{OpenIndicator:t.OpenIndicator},label:"name"},model:{value:t.imageField,callback:function(e){t.imageField=e},expression:"imageField"}},[e("div",{attrs:{slot:"no-options"},slot:"no-options"},[t._v("\n                No fields with URLs that end with known image file extensions were found.\n                "),e("br"),t._v("\n                But you can still type any field name here.\n              ")])])],1)]),t._v(" "),t._m(9),t._v(" "),e("div",{staticClass:"row d-flex align-items-center mt-3"},[t._m(10),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.numColumns,expression:"numColumns"}],staticClass:"custom-select form-control search-num-columns-selector",on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.numColumns=e.target.multiple?r:r[0]}}},t._l(t.numColumnsOptions,(function(r){return e("option",{key:"numColumnsOption-".concat(r),domProps:{value:r}},[t._v("\n                "+t._s(r)+"\n              ")])})),0)])])])],1):e("div",{key:"collection-".concat(t.currentCollection.name,"-documents-instantsearch-not-available")},[t._v("\n      The search dashboard is only available from Typesense Server v0.19.0.\n    ")]):[e("div",{staticClass:"spinner-border spinner-border-sm text-secondary mx-2",attrs:{role:"status","aria-hidden":"true"}})]],2)])}),[function(){var t=this._self._c;return t("div",{staticClass:"col-sm-3 text-sm-right"},[t("span",{staticClass:"h6"},[this._v("Preset")])])},function(){var t=this._self._c;return t("div",{staticClass:"col-sm-3 text-sm-right"},[t("span",{staticClass:"h6"},[this._v("Query By")])])},function(){var t=this._self._c;return t("div",{staticClass:"col-sm-3 text-sm-right"},[t("span",{staticClass:"h6"},[this._v("Facet & Filter By")])])},function(){var t=this._self._c;return t("div",{staticClass:"col-sm-3 text-sm-right"},[t("span",{staticClass:"h6"},[this._v("Sort By")])])},function(){var t=this._self._c;return t("div",{staticClass:"col-sm-3 text-sm-right"},[t("span",{staticClass:"h6"},[this._v("Group By")])])},function(){var t=this._self._c;return t("div",{staticClass:"col-sm-3 text-sm-right"},[t("span",{staticClass:"h6"},[this._v("Additional Search Parameters")])])},function(){var t=this._self._c;return t("div",{staticClass:"col-sm-3 text-sm-right"},[t("span",{staticClass:"h6"},[this._v("Display Fields")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"row mt-1"},[e("div",{staticClass:"col-sm-3"}),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("small",{staticClass:"form-text text-muted"},[t._v('When empty, all fields are displayed. When specified, the selected fields are\n              displayed along with the "Query By" fields.\n            ')])])])},function(){var t=this._self._c;return t("div",{staticClass:"col-sm-3 text-sm-right"},[t("span",{staticClass:"h6"},[this._v("Image Field")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"row mt-1"},[e("div",{staticClass:"col-sm-3"}),t._v(" "),e("div",{staticClass:"col-sm-7"},[e("small",{staticClass:"form-text text-muted"},[t._v("The selected field is used to show an image in the results above.\n            ")])])])},function(){var t=this._self._c;return t("div",{staticClass:"col-sm-3 text-sm-right"},[t("span",{staticClass:"h6"},[this._v("Number of Columns in View")])])}],!1,null,"6a3e32be",null).exports,fe=r(44669),pe=r(38793),me=r(33539);function ve(t){return function(t){if(Array.isArray(t))return ye(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return ye(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ye(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ge(){ge=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new L(n||[]);return a(s,"_invoke",{value:N(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function _(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(E([])));C&&C!==r&&n.call(C,s)&&(b=C);var S=_.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function N(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=A(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&
vendor: 1,572 bytes, line 2
2(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,a(S,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:g,configurable:!0}),g.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}}
2,x(R.prototype),l(R.prototype,o,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new R(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function _e(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}function be(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){_e(i,n,a,s,o,"next",t)}function o(t){_e(i,n,a,s,o,"throw",t)}s(void 0)}))}}var we={name:"CollectionCuration",components:{OverrideUpsert:pe.A},mixins:[q.A],data:function(){return{overrides:[],errorMessage:null,successMessage:null,lastOverridesFetchTimestamp:Date.now(),hierarchyIcon:yt,allCurationSets:[],linkedCurationSets:null,linkedCurationSetNames:[],missingCurationSetNames:[],availableCurationSets:[],selectedCurationSetToAdd:"",curationSetsErrorMessage:null,curationSetsSuccessMessage:null,isLoadingCurationSets:!1,emptyStateIcon:me}},computed:{currentCollection:function(){return this.$store.state.currentCollection||{}},typesenseServerVersion:function(){return this.$store.state.clusterInfo.configuration.typesense_server_version_option},isCurationSetsEnabled:function(){return this.isTypesenseServerVersionAtleast("30.0.rca28")}},watch:{currentCollection:function(t){var e=this;return be(ge().mark((function r(){return ge().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t||!t.name){r.next=1;break}return r.next=1,e.loadData();case 1:case"end":return r.stop()}}),r)})))()},$route:function(t){var e=this;return be(ge().mark((function r(){return ge().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t.path.includes("/curation")||!e.currentCollection.name){r.next=1;break}return r.next=1,e.loadData();case 1:case"end":return r.stop()}}),r)})))()}},created:function(){var t=this;return be(ge().mark((function e(){var r;return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s().start(),e.prev=1,e.next=2,t.$store.dispatch("refreshCurrentCollection");case 2:e.next=4;break;case 3:e.prev=3,r=e.catch(1),console.error("Error refreshing current collection"),console.error(r);case 4:return e.prev=4,s().done(),e.finish(4);case 5:case"end":return e.stop()}}),e,null,[[1,3,4,5]])})))()},mounted:function(){var t=this;return be(ge().mark((function e(){return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.currentCollection.name){e.next=1;break}return e.next=1,t.loadData();case 1:case"end":return e.stop()}}),e)})))()},methods:{loadData:function(){var t=this;return be(ge().mark((function e(){return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.isCurationSetsEnabled){e.next=2;break}return e.next=1,t.loadCurationSetsData();case 1:e.next=3;break;case 2:return e.next=3,t.fetchOverrides();case 3:case"end":return e.stop()}}),e)})))()},loadCurationSetsData:function(){var t=this;return be(ge().mark((function e(){var r,n,a,i;return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.currentCollection.name){e.next=1;break}return e.abrupt("return");case 1:return t.curationSetsErrorMessage=null,t.isLoadingCurationSets=!0,t.linkedCurationSets=null,r=new ut.Kj(t.$store.state.typesenseServerConfig),s().start(),e.prev=2,e.next=3,r.curationSets().retrieve();case 3:return n=e.sent,t.allCurationSets=n||[],t.linkedCurationSetNames=(t.currentCollection.curation_sets||[]).slice(),e.next=4,Promise.all(t.linkedCurationSetNames.map(function(){var t=be(ge().mark((function t(e){var n,a;return ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=1,r.curationSets(e).retrieve();case 1:return n=t.sent,t.abrupt("return",{ok:!0,setName:e,set:n});case 2:return t.prev=2,a=t.catch(0),console.warn("Could not load curation set ".concat(e,":"),a),t.abrupt("return",{ok:!1,setName:e,error:a});case 3:case"end":return t.stop()}}),t,null,[[0,2]])})));return function(e){return t.apply(this,arguments)}}()));case 4:a=e.sent,t.linkedCurationSets=a.map((function(t){return t.ok?t.set:{name:t.setName,items:null,isMissing:!0}})),t.missingCurationSetNames=a.filter((function(t){return!t.ok})).map((function(t){return t.setName})),t.availableCurationSets=t.allCurationSets.filter((function(e){return!t.linkedCurationSetNames.includes(e.name)})),e.next=6;break;case 5:e.prev=5,i=e.catch(2),console.error("Error loading curation sets:",i),t.curationSetsErrorMessage=i.message||"Failed to load curation sets",t.linkedCurationSets=[],t.availableCurationSets=[],t.missingCurationSetNames=[];case 6:return e.prev=6,t.isLoadingCurationSets=!1,s().done(),e.finish(6);case 7:case"end":return e.stop()}}),e,null,[[2,5,6,7]])})))()},linkCurationSet:function(){var t=this;return be(ge().mark((function e(){var r,n,a,i;return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.selectedCurationSetToAdd){e.next=1;break}return e.abrupt("return");case 1:return t.curationSetsErrorMessage=null,t.curationSetsSuccessMessage=null,r=new ut.Kj(t.$store.state.typesenseServerConfig),n=t.linkedCurationSetNames.filter((function(e){return!t.missingCurationSetNames.includes(e)})),a=[].concat(ve(n),[t.selectedCurationSetToAdd]),s().start(),e.prev=2,e.next=3,r.collections(t.currentCollection.name).update({curation_sets:a});case 3:return t.curationSetsSuccessMessage='Successfully linked curation set "'.concat(t.selectedCurationSetToAdd,'" to collection "').concat(t.currentCollection.name,'"'),t.selectedCurationSetToAdd="",e.next=4,t.$store.dispatch("refreshCollection",t.currentCollection.name);case 4:e.next=6;break;case 5:e.prev=5,i=e.catch(2),console.error("Error linking curation set:",i),t.curationSetsErrorMessage=i.message||"Failed to link curation set";case 6:return e.prev=6,s().done(),e.finish(6);case 7:case"end":return e.stop()}}),e,null,[[2,5,6,7]])})))()},unlinkCurationSet:function(t){var e=this;return be(ge().mark((function r(){var n,a,i;return ge().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(confirm('Are you sure you want to unlink the curation set "'.concat(t,'" from this collection?'))){r.next=1;break}return r.abrupt("return");case 1:return e.curationSetsErrorMessage=null,e.curationSetsSuccessMessage=null,n=new ut.Kj(e.$store.state.typesenseServerConfig),a=e.linkedCurationSetNames.filter((function(r){return r!==t&&!e.missingCurationSetNames.includes(r)})),s().start(),r.prev=2,r.next=3,n.collections(e.currentCollection.name).update({curation_sets:a});case 3:return e.curationSetsSuccessMessage='Successfully unlinked curation set "'.concat(t,'"'),r.next=4,e.$store.dispatch("refreshCollection",e.currentCollection.name);case 4:r.next=6;break;case 5:r.prev=5,i=r.catch(2),console.error("Error unlinking curation set:",i),e.curationSetsErrorMessage=i.message||"Failed to unlink curation set";case 6:return r.prev=6,s().done(),r.finish(6);case 7:case"end":return r.stop()}}),r,null,[[2,5,6,7]])})))()},formatCurationItemSummary:function(t){var e,r,n,a,i;if(!t)return"No conditions configured";var s=[];if(null!==(e=t.rule)&&void 0!==e&&e.query){var o=t.rule.query,c=o.length>60?"".concat(o.slice(0,57),"..."):o;s.push("query: ".concat(c))}if(null!==(r=t.rule)&&void 0!==r&&r.filter_by){var l=t.rule.filter_by,u=l.length>60?"".concat(l.slice(0,57),"..."):l;s.push("filter: ".concat(u))}if(null!==(n=t.rule)&&void 0!==n&&n.tags&&t.rule.tags.length>0){var d=t.rule.tags.join(", "),h=d.length>60?"".concat(d.slice(0,57),"..."):d;s.push("tags: ".concat(h))}if(null!==(a=t.includes)&&void 0!==a&&a.length&&s.push("pinned: ".concat(t.includes.length)),null!==(i=t.excludes)&&void 0!==i&&i.length&&s.push("hidden: ".concat(t.excludes.length)),t.replace_query&&s.push("replace query"),t.sort_by&&s.push("sort"),t.effective_from_ts)try{var f=new Date(1e3*t.effective_from_ts);
2s.push("from: ".concat(f.toLocaleString()))}catch(y){}if(t.effective_to_ts)try{var p=new Date(1e3*t.effective_to_ts);s.push("to: ".concat(p.toLocaleString()))}catch(y){}if(null!=t.metadata)try{var m=JSON.stringify(t.metadata),v=m.length>60?"".concat(m.slice(0,57),"..."):m;s.push("metadata: ".concat(v))}catch(y){}return s.join(" \u2022 ")||"No conditions configured"},fetchOverrides:function(){var t=this;return be(ge().mark((function e(){var r,n,a;return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new ut.Kj(t.$store.state.typesenseServerConfig),e.prev=1,s().start(),e.next=2,r.collections(t.currentCollection.name).overrides().retrieve();case 2:(n=e.sent.overrides).forEach((function(t){null!=t.includes&&t.includes.sort((function(t,e){return t.position-e.position}))})),t.overrides=n,t.lastOverridesFetchTimestamp=Date.now(),e.next=4;break;case 3:e.prev=3,a=e.catch(1),console.error(a),t.successMessage=null,t.errorMessage=a;case 4:return e.prev=4,s().done(),e.finish(4);case 5:case"end":return e.stop()}}),e,null,[[1,3,4,5]])})))()},handleOverrideUpserted:function(t){var e=this;return be(ge().mark((function r(){return ge().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=1,e.fetchOverrides();case 1:setTimeout((function(){e.$refs.overrideUpserts.find((function(e){return e.override.id===t.id})).openPane()}),1e3);case 2:case"end":return r.stop()}}),r)})))()},handleOverrideDeleted:function(t){var e=this;return be(ge().mark((function t(){return ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.fetchOverrides();case 1:case"end":return t.stop()}}),t)})))()}}},Ce=we,Se=(0,c.A)(Ce,(function(){var t=this,e=t._self._c;return e("div",{key:"".concat(t.currentCollection.name,"-curation"),staticClass:"row no-gutters",class:t.$options.name},[e("div",{staticClass:"col-sm"},[e("div",{staticClass:"text-muted small mb-2"},[t._v(t._s(t.currentCollection.name))]),t._v(" "),e("div",{staticClass:"d-flex"},[e("img",{staticStyle:{"margin-right":"5px"},attrs:{src:t.hierarchyIcon,height:"15",width:"15"}}),t._v(" "),e("h2",{staticClass:"mb-4 h3"},[t._v("Curation")])]),t._v(" "),t.isCurationSetsEnabled?e("div",[e("p",[t._v("\n        You can link a "),e("RouterLink",{attrs:{to:{name:"curationSets"}}},[t._v("curation set")]),t._v(" to\n        this collection to reuse curated rules across collections.\n        "),e("a",{attrs:{href:t.typesenseDocsLink("api/curation.html"),target:"_blank"}},[t._v("Read the docs")]),t._v("\n        for more information.\n      ")],1),t._v(" "),t.curationSetsSuccessMessage?e("div",{staticClass:"alert alert-success alert-dismissible fade show",attrs:{role:"alert"}},[t._v("\n        "+t._s(t.curationSetsSuccessMessage)+"\n        "),t._m(0)]):t._e(),t._v(" "),t.curationSetsErrorMessage?e("div",{staticClass:"alert alert-danger alert-dismissible fade show",attrs:{role:"alert"}},[t._v("\n        "+t._s(t.curationSetsErrorMessage)+"\n        "),t._m(1)]):t._e(),t._v(" "),t.isLoadingCurationSets?e("div",{staticClass:"text-center py-5"},[t._m(2)]):null!==t.linkedCurationSets?e("div",[t.allCurationSets.length>0?e("div",{staticClass:"mb-4"},[e("div",{staticClass:"d-flex align-items-center"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedCurationSetToAdd,expression:"selectedCurationSetToAdd"}],staticClass:"custom-select w-auto mr-2",on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.selectedCurationSetToAdd=e.target.multiple?r:r[0]}}},[e("option",{attrs:{value:"",disabled:""}},[t._v("Select a curation set to link")]),t._v(" "),t.availableCurationSets.length>0?t._l(t.availableCurationSets,(function(r){return e("option",{key:r.name,domProps:{value:r.name}},[t._v("\n                  "+t._s(r.name)+" ("+t._s(r.items?r.items.length:0)+" items)\n                ")])})):[e("option",{attrs:{value:"",disabled:""}},[t._v("All available sets are already linked")])]],2),t._v(" "),e("button",{staticClass:"btn btn-primary mr-auto",attrs:{disabled:!t.selectedCurationSetToAdd},on:{click:t.linkCurationSet}},[t._v("\n              Link\n            ")]),t._v(" "),e("RouterLink",{staticClass:"btn btn-outline-primary",attrs:{to:{name:"curationSets"}}},[t._v("\n              View all Curation Sets\n            ")])],1)]):t._e(),t._v(" "),0===t.linkedCurationSets.length?e("div",{staticClass:"empty-state bg-dot-grid"},[e("img",{staticClass:"empty-state-icon",attrs:{src:t.emptyStateIcon,height:"60",width:"60"}}),t._v(" "),e("p",{staticClass:"empty-state-title"},[t._v("\n            No curation sets linked to collection "+t._s(t.currentCollection.name)+"\n          ")]),t._v(" "),0===t.allCurationSets.length?e("div",[e("p",{staticClass:"text-muted mb-4"},[t._v("\n              Create your first curation set below, then come back here to link it to this\n              collection.\n            ")]),t._v(" "),e("RouterLink",{staticClass:"btn btn-primary",attrs:{to:{name:"curationSets"}}},[t._v("\n              Manage Curation Sets\n            ")])],1):e("div",[e("p",{staticClass:"text-muted small"},[t._v("\n              Link curation sets using the dropdown above or\n              "),e("RouterLink",{attrs:{to:{name:"curationSets"}}},[t._v("create / manage curation sets")])],1)])]):e("div",{staticClass:"linked-sets"},t._l(t.linkedCurationSets,(function(r){return e("div",{key:r.name,staticClass:"shadow-sm bg-light rounded p-3 mb-3 curation-set-panel"},[e("div",{staticClass:"d-flex justify-content-between align-items-start"},[e("div",{staticClass:"flex-grow-1"},[r.isMissing?e("div",[e("h6",{staticClass:"mb-2"},[t._v(t._s(r.name))]),t._v(" "),t._m(3,!0)]):e("div",[e("h6",{staticClass:"mb-3"},[e("RouterLink",{attrs:{to:{name:"curationSetEdit",params:{setName:r.name}}}},[t._v("\n                      "+t._s(r.name)+"\n                    ")])],1),t._v(" "),r.items&&r.items.length>0?e("div",{staticClass:"curation-preview"},[t._l(r.items.slice(0,3),(function(r){return e("div",{key:r.id,staticClass:"mb-2"}
2,[e("strong",[t._v(t._s(r.id))]),t._v(" "),e("span",{staticClass:"text-muted small"},[t._v("\n                        "+t._s(t.formatCurationItemSummary(r)))])])})),t._v(" "),r.items.length>3?e("div",{staticClass:"text-muted small"},[t._v("\n                      +"+t._s(r.items.length-3)+" more items\n                    ")]):t._e()],2):e("div",{staticClass:"text-muted small"},[t._v("No curation items yet.")])])]),t._v(" "),e("div",{staticClass:"ml-3 d-flex align-items-start"},[r.isMissing?t._e():e("RouterLink",{staticClass:"btn btn-sm btn-outline-primary mr-2",attrs:{to:{name:"curationSetEdit",params:{setName:r.name}}}},[t._v("\n                  Manage\n                ")]),t._v(" "),e("button",{staticClass:"btn btn-sm btn-outline-primary",on:{click:function(e){return t.unlinkCurationSet(r.name)}}},[t._v("\n                  Unlink\n                ")])],1)])])})),0)]):e("div",{staticClass:"text-center py-5"},[t._m(4)])]):e("div",[e("p",[t._v("\n        Curation allows you to pin certain records at particular positions or hide results, for a\n        given search query.\n        "),e("a",{attrs:{href:t.typesenseDocsLink("api/curation.html"),target:"_blank"}},[t._v("Docs >")])]),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.errorMessage,expression:"errorMessage"}],staticClass:"mt-4 alert alert-warning",attrs:{role:"alert"}},[t._v("\n        "+t._s(t.errorMessage)+"\n      ")]),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.successMessage,expression:"successMessage"}],staticClass:"mt-4 alert alert-success",attrs:{role:"alert"}},[t._v("\n        "+t._s(t.successMessage)+"\n      ")]),t._v(" "),e("div",{staticClass:"accordion mt-4",attrs:{id:"overrideAccordion"}},[t._l(t.overrides,(function(r){return e("div",{key:"override-".concat(r.id,"-").concat(t.lastOverridesFetchTimestamp)},[e("OverrideUpsert",{ref:"overrideUpserts",refInFor:!0,attrs:{override:r},on:{"override-delete":t.handleOverrideDeleted,"override-update":t.handleOverrideUpserted}})],1)})),t._v(" "),e("OverrideUpsert",{on:{"override-create":t.handleOverrideUpserted}})],2)])])])}),[function(){var t=this._self._c;return t("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":"Close"}},[t("span",{attrs:{"aria-hidden":"true"}},[this._v("\xd7")])])},function(){var t=this._self._c;return t("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":"Close"}},[t("span",{attrs:{"aria-hidden":"true"}},[this._v("\xd7")])])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border text-primary",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this,e=t._self._c;return e("p",{staticClass:"small mb-0"},[e("strong",{staticClass:"text-danger"},[t._v("Curation set not found")]),t._v(" - This set may\n                    have been deleted or doesn't exist.\n                  ")])},function(){var t=this._self._c;return t("div",{staticClass:"spinner-border text-primary",attrs:{role:"status"}},[t("span",{staticClass:"sr-only"},[this._v("Loading...")])])}],!1,null,"cca06fd6",null).exports,xe=r(99269),Re=r(53353),Ne=r(98423),Ae=r(92369),ke=r(9772);function Pe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,i,s,o=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(t){l=!0,a=t}finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw a}}return o}}(t,e)||Ee(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Le(t){return function(t){if(Array.isArray(t))return Oe(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ee(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(t,e){if(t){if("string"===typeof t)return Oe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oe(t,e):void 0}}function Oe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Te={name:"PresetSearchParameters",props:{initialSearchParameters:{},presetName:{type:String,required:!0,default:function(){return"new"}}},data:function(){return{currentSearchParameters:null}},computed:{searchParameters:{get:function(){return null==this.currentSearchParameters?Le(Object.entries(this.initialSearchParameters||{}).map((function(t){var e=Pe(t,2);return{name:e[0],value:e[1]}}))):this.currentSearchParameters},set:function(t){this.currentSearchParameters=t}}},mounted:function(){0===this.searchParameters.length&&this.addNewParameter()},methods:{addNewParameter:function(){this.searchParameters=[].concat(Le(this.searchParameters),[{name:"",value:""}])},removeSearchParameter:function(t){this.searchParameters=[].concat(Le(this.searchParameters.slice(0,t)),Le(this.searchParameters.slice(t+1,this.searchParameters.length)))}}},Ie=(0,c.A)(Te,(function(){var t=this,e=t._self._c;return e("div",[t._l(t.searchParameters,(function(r,n){return e("div",{key:"searchParameter-".concat(n),staticClass:"row mt-1"},[e("div",{staticClass:"col-sm-7 d-flex"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.searchParameters[n].name,expression:"searchParameters[index].name"}],class:"form-control parameter-name parameter-name-".concat(n),attrs:{type:"text",required:"",placeholder:"Parameter Name"},domProps:{value:t.searchParameters[n].name},on:{input:function(e){e.target.composing||t.$set(t.searchParameters[n],"name",e.target.value)}}}),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.searchParameters[n].value,expression:"searchParameters[index].value"}],class:"form-control ml-2 parameter-value parameter-value-".concat(n),attrs:{type:"text",required:"",placeholder:"Parameter Value"},domProps:{value:t.searchParameters[n].value},on:{input:function(e){e.target.composing||t.$set(t.searchParameters[n],"value",e.target.value)}}}),t._v(" "),e("button",{staticClass:"btn btn-link p-0 ml-2 shadow-none text-decoration-none",class:"btn-delete-search-parameter btn-delete-search-parameter-".concat(n),on:{click:function(e){return t.removeSearchParameter(n)}}},[t._v("\n        -\n      ")])])])})),t._v(" "),e("button",{staticClass:"btn btn-link p-0 shadow-none mt-2",on:{click:t.addNe
2wParameter}},[t._v("\n    + Add Parameter\n  ")])],2)}),[],!1,null,"68e5f8a8",null).exports;function De(t){return function(t){if(Array.isArray(t))return Me(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return Me(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Me(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Me(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Fe={name:"PresetMultiSearch",components:{PresetSearchParameters:Ie},props:{initialSearchesArray:{},presetName:{type:String,required:!0,default:function(){return"new"}}},data:function(){return{searchesArray:De(this.initialSearchesArray||[])}},mounted:function(){0===this.searchesArray.length&&this.addNewSearchToArray()},methods:{addNewSearchToArray:function(){this.searchesArray.push([])},removeSearchFromArray:function(t){this.searchesArray.splice(t,1)}}};function je(){je=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new L(n||[]);return a(s,"_invoke",{value:N(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function _(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(E([])));C&&C!==r&&n.call(C,s)&&(b=C);var S=_.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function N(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=A(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);
2if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,a(S,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:g,configurable:!0}),g.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(R.prototype),l(R.prototype,o,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new R(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function qe(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}function $e(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){qe(i,n,a,s,o,"next",t)}function o(t){qe(i,n,a,s,o,"throw",t)}s(void 0)}))}}var Be={name:"PresetUpsert",components:{PresetMultiSearch:(0,c.A)(Fe,(function(){var t=this,e=t._self._c;return e("div",[t._l(t.searchesArray,(function(r,n){return e("div",{key:"".concat(t.presetName,"-search-").concat(n),staticClass:"row mt-3"},[e("div",{staticClass:"col-sm"},[e("div",{staticClass:"border border-primary p-4 multi-search-parameters",class:"multi-search-parameters-".concat(n)},[e("h6",[t._v("\n          Search "+t._s(n+1)+"\n          "),e("button",{staticClass:"btn btn-link p-0 ml-2 shadow-none text-decoration-none",class:"btn-delete-multi-search btn-delete-multi-search-".concat(n),on:{click:function(e){return t.removeSearchFromArray(n)}}},[t._v("\n            -\n          ")])]),t._v(" "),e("PresetSearchParameters",{ref:"presetSearchParameters",refInFor:!0,attrs:{"preset-name":t.presetName,"initial-search-parameters":r}})],1)])])})),t._v(" "),e("button",{staticClass:"btn btn-outline-secondary btn-sm shadow-none mt-4",on:{click:t.addNe
2wSearchToArray}},[t._v("\n    + Add Search\n  ")])],2)}),[],!1,null,"f0a4ab28",null).exports,DropdownArrow:M.A,VSelect:D(),PresetSearchParameters:Ie},mixins:[q.A],props:{preset:{type:Object,default:function(){return{}}}},emits:["preset-delete","preset-update","preset-create"],data:function(){try{decodeURIComponent(this.preset.name)}catch(t){console.log(this.preset.name)}return{OpenIndicator:M.A,Deselect:null,errorMessage:null,successMessage:null,timestamp:Date.now(),currentPresetType:null,currentPresetName:null}},computed:{typesenseServerConfig:function(){return this.$store.state.typesenseServerConfig},presetName:{get:function(){return null==this.currentPresetName?null!=this.preset.name?decodeURIComponent(this.preset.name):this.preset.name:this.currentPresetName},set:function(t){this.currentPresetName=t}},isNewPreset:function(){return null==this.preset.name},presetType:{get:function(){var t;return null==this.currentPresetType?null!==(t=this.preset)&&void 0!==t&&null!==(t=t.value)&&void 0!==t&&t.searches?"multi_search":"single_collection_search":this.currentPresetType},set:function(t){this.currentPresetType=t}}},mounted:function(){$(this.$refs.presetCollapse).on("show.bs.collapse",$e(je().mark((function t(){return je().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:$(this).parent().addClass("border-highlight");case 1:case"end":return t.stop()}}),t,this)})))),$(this.$refs.presetCollapse).on("hidden.bs.collapse",(function(){$(this).parent().removeClass("border-highlight")}))},methods:{idSafeString:function(t){return null==t?t:"".concat(t.replace(/[^a-z0-9]/g,(function(t){var e=t.charCodeAt(0);return 32==e?"-":e>=65&&e<=90?"_"+t.toLowerCase():"__"+("000"+e.toString(16)).slice(-4)})),"-").concat(this.timestamp)},upsertPreset:function(){var t=this;return $e(je().mark((function e(){var r,n,a,i;return je().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.successMessage=null,t.errorMessage=null,r={},"single_collection_search"===t.presetType?r={value:Object.fromEntries(t.$refs.presetSearchParametersForSingleCollectionSearch.searchParameters.filter((function(t){return""!==t.name})).map((function(t){return[t.name,t.value]})))}:"multi_search"===t.presetType&&(r.value={searches:[]},t.$refs.presetSearchParametersForMultiSearch.$refs.presetSearchParameters.forEach((function(t){r.value.searches.push(Object.fromEntries(t.searchParameters.filter((function(t){return""!==t.name})).map((function(t){return[t.name,t.value]}))))}))),n=new ut.Kj(t.$store.state.typesenseServerConfig),e.prev=1,s().start(),e.next=2,n.presets().upsert(t.presetName||"preset_".concat(Math.round(Date.now()/1e3)),r);case 2:a=e.sent,t.successMessage="Preset ".concat(t.isNewPreset?"created":"updated","."),setTimeout($e(je().mark((function e(){var r,i,s,o;return je().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.successMessage="",!t.isNewPreset){e.next=1;break}t.resetFields(),$(t.$refs.presetCollapse).collapse("hide"),t.$emit("preset-create",a),e.next=3;break;case 1:if(o=null!==(r=t.preset)&&void 0!==r&&r.name?decodeURIComponent(null===(i=t.preset)||void 0===i?void 0:i.name):null===(s=t.preset)||void 0===s?void 0:s.name,t.presetName===o){e.next=2;break}return e.next=2,n.presets(t.preset.name).delete();case 2:t.$emit("preset-update",a);case 3:case"end":return e.stop()}}),e)}))),1e3),e.next=4;break;case 3:e.prev=3,i=e.catch(1),console.error(i),t.errorMessage="Error ".concat(t.isNewPreset?"creating":"updating"," preset: ").concat(i);case 4:return e.prev=4,s().done(),e.finish(4);case 5:case"end":return e.stop()}}),e,null,[[1,3,4,5]])})))()},deletePreset:function(){var t=this;return $e(je().mark((function e(){var r,n;return je().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(confirm('Are you sure you want to DELETE preset "'.concat(t.presetName,'"?'))){e.next=1;break}return e.abrupt("return");case 1:return r=new ut.Kj(t.$store.state.typesenseServerConfig),e.prev=2,s().start(),e.next=3,r.presets(t.presetName).delete();case 3:t.successMessage="Preset deleted.",setTimeout((function(){$(t.$refs.presetCollapse).collapse("hide"),t.$emit("preset-delete",t.preset)}),1e3),e.next=5;break;case 4:e.prev=4,n=e.catch(2),console.error(n),t.errorMessage="Error deleting preset: ".concat(n);case 5:return e.prev=5,s().done(),e.finish(5);case 6:case"end":return e.stop()}}),e,null,[[2,4,5,6]])})))()},resetFields:function(){Object.assign(this.$data,this.$options.data.apply(this)),this.errorMessage="",this.successMessage=""},openPane:function(){$(this.$refs.presetCollapse).collapse("show")}}}
2,Ge=(0,c.A)(Be,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"bg-light rounded py-3 my-2 px-3 border-transparent"},[e("div",{attrs:{id:"preset-heading-".concat(t.idSafeString(t.preset.name)||"new")}},[e("h2",{staticClass:"mb-0"},[e("button",{staticClass:"btn btn-block d-flex justify-content-between align-items-center shadow-none",attrs:{type:"button","data-toggle":"collapse","data-target":"#preset-collapse-".concat(t.idSafeString(t.preset.name)||"new"),"aria-expanded":"true","aria-controls":"preset-collapse-".concat(t.idSafeString(t.preset.name)||"new")}},[e("h5",{staticClass:"text-secondary mb-0"},[t._v("\n          "+t._s(t.isNewPreset?"Add New Preset":t.presetName)+"\n        ")]),t._v(" "),e("DropdownArrow")],1)])]),t._v(" "),e("div",{ref:"presetCollapse",staticClass:"collapse",attrs:{id:"preset-collapse-".concat(t.idSafeString(t.preset.name)||"new"),"aria-labelledby":"preset-heading-".concat(t.idSafeString(t.preset.name)||"new"),"data-parent":"#presetsAccordion"}},[e("div",{staticClass:"card-body"},[e("div",[e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm-4"},[e("label",{attrs:{for:"presetName-".concat(t.idSafeString(t.presetName)||"new")}},[t._v("Preset Name")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.presetName,expression:"presetName"}],staticClass:"form-control",attrs:{id:"presetName-".concat(t.idSafeString(t.presetName)||"new"),type:"text",placeholder:"Eg: listing_view"},domProps:{value:t.presetName},on:{input:function(e){e.target.composing||(t.presetName=e.target.value)}}})])]),t._v(" "),e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm"},[e("label",{attrs:{for:"presetType-".concat(t.idSafeString(t.presetName)||"new")}},[t._v("Preset Type")]),t._v(" "),e("VSelect",{staticClass:"preset-type-selector",attrs:{id:"presetType-".concat(t.idSafeString(t.presetName)||"new"),searchable:!1,options:[{label:"Single-Collection Search",code:"single_collection_search"},{label:"Multi-Search",code:"multi_search"}],reduce:function(t){return t.code},components:{OpenIndicator:t.OpenIndicator,Deselect:t.Deselect}},model:{value:t.presetType,callback:function(e){t.presetType=e},expression:"presetType"}})],1)]),t._v(" "),e("div",{staticClass:"row mt-4"},[e("div",{staticClass:"col-sm"},[e("label",[t._v("Search Parameters")]),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:"single_collection_search"===t.presetType,expression:"presetType === 'single_collection_search'"}]},[e("PresetSearchParameters",{ref:"presetSearchParametersForSingleCollectionSearch",attrs:{"initial-search-parameters":(t.preset.value||{}).searches?t.preset.value.searches[0]:t.preset.value,"preset-name":"".concat(t.idSafeString(t.presetName)||"new")}})],1),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:"multi_search"===t.presetType,expression:"presetType === 'multi_search'"}]},[e("PresetMultiSearch",{ref:"presetSearchParametersForMultiSearch",attrs:{"initial-searches-array":Array.isArray((t.preset.value||{}).searches)?(t.preset.value||{}).searches:[t.preset.value||{}],"preset-name":"".concat(t.idSafeString(t.presetName)||"new")}})],1)])]),t._v(" "),e("div",{staticClass:"mt-4"},[e("div",[e("button",{staticClass:"btn btn-primary mt-4",on:{click:function(e){return e.preventDefault(),t.upsertPreset.apply(null,arguments)}}},[t._v("\n              "+t._s(t.isNewPreset?"Add Preset":"Update Preset")+"\n            ")])]),t._v(" "),e("div",{staticClass:"mt-2"},[t.isNewPreset?t._e():e("button",{staticClass:"btn btn-link btn-sm px-0 shadow-none",on:{click:function(e){return e.preventDefault(),t.deletePreset.apply(null,arguments)}}},[t._v("\n              Delete\n            ")])])]),t._v(" "),t.errorMessage?e("div",{staticClass:"mt-4 alert alert-warning",attrs:{role:"alert"}},[t._v("\n          "+t._s(t.errorMessage)+"\n        ")]):t._e(),t._v(" "),e("transition",{attrs:{name:"fade"}},[t.successMessage?e("div",{staticClass:"mt-4 alert alert-success",attrs:{role:"alert"}},[t._v("\n            "+t._s(t.successMessage)+"\n          ")]):t._e()])],1)])])])}),[],!1,null,"631b6f0e",null),Ve=Ge.exports,Ue=["addNewPreset"];function He(){He=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new L(n||[]);return a(s,"_invoke",{value:N(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function _(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(E([])));C&&C!==r&&n.call(C,s)&&(b=C);var S=_.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function N(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=A(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&
vendor: 1,572 bytes, line 2
2(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,a(S,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:g,configurable:!0}),g.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}}
2,x(R.prototype),l(R.prototype,o,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new R(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Qe(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}function We(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){Qe(i,n,a,s,o,"next",t)}function o(t){Qe(i,n,a,s,o,"throw",t)}s(void 0)}))}}function Ye(t,e){if(null==t)return{};var r,n,a=function(t,e){if(null==t)return{};var r,n,a={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}var Ke={name:"Presets",components:{PresetUpsert:Ve},mixins:[q.A],data:function(){var t={};if(this.$route.query.addNewPreset){var e=this.$route.query;e.addNewPreset;t={name:null,value:Ye(e,Ue)}}return{presets:[],prepopulatedNewPreset:t,errorMessage:null,successMessage:null,lastPresetsFetchTimestamp:Date.now()}},computed:{typesenseServerVersion:function(){return this.$store.state.clusterInfo.configuration.typesense_server_version_option},typesenseServerConfig:function(){return this.$store.state.typesenseServerConfig},clusterInfo:function(){return this.$store.state.clusterInfo},accessControlPolicy:function(){return this.$store.state.clusterInfo.access_control_policy},clusterStatus:function(){return this.$store.state.clusterStatus},loadingClusterStatus:function(){return this.$store.state.loadingClusterStatus}},mounted:function(){var t=this;return We(He().mark((function e(){return He().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,t.fetchPresets();case 1:t.$route.query.addNewPreset&&(t.$refs.addNewPreset.openPane(),setTimeout((function(){t.$refs.addNewPreset.$el.scrollIntoView({behavior:"smooth"})}),750));case 2:case"end":return e.stop()}}),e)})))()},methods:{fetchPresets:function(){var t=this;return We(He().mark((function e(){var r,n,a;return He().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new ut.Kj(t.$store.state.typesenseServerConfig),e.prev=1,s().start(),e.next=2,r.presets().retrieve();case 2:n=e.sent.presets,t.presets=n,t.lastPresetsFetchTimestamp=Date.now(),e.next=4;break;case 3:e.prev=3,a=e.catch(1),console.error(a),t.successMessage=null,t.errorMessage=a;case 4:return e.prev=4,s().done(),e.finish(4);case 5:case"end":return e.stop()}}),e,null,[[1,3,4,5]])})))()},handlePresetUpserted:function(t){var e=this;return We(He().mark((function r(){return He().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=1,e.fetchPresets();case 1:setTimeout((function(){var r=e.$refs.presetUpserts.find((function(e){return e.preset.name===t.name}));r.openPane(),setTimeout((function(){r.$el.scrollIntoView({behavior:"smooth"})}),750)}),1e3),e.$route.query.addNewPreset&&(e.$router.replace({query:null}),e.prepopulatedNewPreset={});case 2:case"end":return r.stop()}}),r)})))()},handlePresetDeleted:function(t){var e=this;return We(He().mark((function t(){return He().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.fetchPresets();case 1:case"end":return t.stop()}}),t)})))()}}},ze=Ke,Je=(0,c.A)(ze,(function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"row no-gutters",class:t.$options.name},[e("div",{staticClass:"col-sm"},[e("h2",{staticClass:"mb-4 h3"},[t._v("Presets")]),t._v(" "),e("div",{staticClass:"row"},[e("p",{staticClass:"col-sm-6"},[t._v("\n          Presets allow you to manage search parameters in Typesense, and reference just the\n          preset name in your application. This way, you can change search parameters without\n          having to make code changes.\n          "),e("a",{attrs:{href:t.typesenseDocsLink("api/search.html#presets"),target:"_blank"}},[t._v("Read the documentation")]),t._v("\n          for more information on available options.\n        ")])]),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.errorMessage,expression:"errorMessage"}],staticClass:"mt-4 alert alert-warning",attrs:{role:"alert"}},[t._v("\n        "+t._s(t.errorMessage)+"\n      ")]),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.successMessage,expression:"successMessage"}],staticClass:"mt-4 alert alert-success",attrs:{role:"alert"}},[t._v("\n        "+t._s(t.successMessage)+"\n      ")]),t._v(" "),e("div",{staticClass:"accordion mt-4",attrs:{id:"presetsAccordion"}},[t._l(t.presets,(function(r){return e("div",{key:"preset-".concat(r.name,"-").concat(t.lastPresetsFetchTimestamp)},[e("PresetUpsert",{ref:"presetUpserts",refInFor:!0,attrs:{preset:r},on:{"preset-delete":t.handlePresetDeleted,"preset-update":t.handlePresetUpserted}})],1)})),t._v(" "),e("PresetUpsert",{ref:"addNewPreset",attrs:{preset:t.prepopulatedNewPreset},on:{"preset-create":t.handlePresetUpserted}})],2)])])])}),[],!1,null,"27e70778",null).exports,Xe=r(96285);function Ze(){Ze=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new L(n||[]);return a(s,"_invoke",{value:N(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function _(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(E([])));C&&C!==r&&n.call(C,s)&&(b=C);var S=_.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function N(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=A(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&
vendor: 1,572 bytes, line 2
2(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,a(S,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:g,configurable:!0}),g.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}}
2,x(R.prototype),l(R.prototype,o,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new R(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function tr(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}function er(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){tr(i,n,a,s,o,"next",t)}function o(t){tr(i,n,a,s,o,"throw",t)}s(void 0)}))}}function rr(t){return function(t){if(Array.isArray(t))return nr(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return nr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nr(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ar={name:"AnalyticsRuleUpsert",components:{DropdownArrow:M.A,VSelect:D()},mixins:[q.A],props:{analyticsRule:{type:Object,default:function(){return{}}}},emits:["analyticsRule-delete","analyticsRule-update","analyticsRule-create"],data:function(){var t,e,r,n,a,i,s,o,c,l,u,d,h,f,p,m,v,y,g,_,b,w,C,S,x=this;return{OpenIndicator:M.A,Deselect:ft,errorMessage:null,successMessage:null,timestamp:Date.now(),analyticsRuleType:(null===(t=this.analyticsRule)||void 0===t?void 0:t.type)||"popular_queries",analyticsRuleName:null!=this.analyticsRule.name?decodeURIComponent(this.analyticsRule.name):this.analyticsRule.name,analyticsRulePopularQueriesLimit:(null===(e=this.analyticsRule)||void 0===e||null===(e=e.params)||void 0===e?void 0:e.limit)||100,analyticsRulePopularQueriesExpandQuery:null!==(r=null===(n=this.analyticsRule)||void 0===n||null===(n=n.params)||void 0===n?void 0:n.expand_query)&&void 0!==r&&r,selectedMetaFields:(S=null===(C=x.analyticsRule)||void 0===C||null===(C=C.params)||void 0===C?void 0:C.meta_fields,Array.isArray(S)?S.map((function(t){return{name:t}})):[]),analyticsRuleNoHitsQueriesLimit:(null===(a=this.analyticsRule)||void 0===a||null===(a=a.params)||void 0===a?void 0:a.limit)||100,analyticsRuleCaptureSearchRequests:null!=(null===(g=x.analyticsRule)||void 0===g||null===(g=g.params)||void 0===g?void 0:g.capture_search_requests)?!(null===(b=x.analyticsRule)||void 0===b||null===(b=b.params)||void 0===b||!b.capture_search_requests):null==(null===(_=x.analyticsRule)||void 0===_||null===(_=_.params)||void 0===_||null===(_=_.source)||void 0===_?void 0:_.enable_auto_aggregation)||!(null===(w=x.analyticsRule)||void 0===w||null===(w=w.params)||void 0===w||null===(w=w.source)||void 0===w||!w.enable_auto_aggregation),selectedSourceCollections:null!==(m=x.analyticsRule)&&void 0!==m&&m.collection?[{name:x.analyticsRule.collection}]:null!=(null===(v=x.analyticsRule)||void 0===v||null===(v=v.params)||void 0===v||null===(v=v.source)||void 0===v?void 0:v.collections)?null===(y=x.analyticsRule)||void 0===y||null===(y=y.params)||void 0===y||null===(y=y.source)||void 0===y||null===(y=y.
2collections)||void 0===y?void 0:y.map((function(t){return{name:t}})):[],selectedSourceCollection:null!==(h=x.analyticsRule)&&void 0!==h&&h.collection?{name:x.analyticsRule.collection}:1===(null===(f=x.analyticsRule)||void 0===f||null===(f=f.params)||void 0===f||null===(f=f.source)||void 0===f||null===(f=f.collections)||void 0===f?void 0:f.length)?{name:null===(p=x.analyticsRule)||void 0===p||null===(p=p.params)||void 0===p||null===(p=p.source)||void 0===p?void 0:p.collections[0]}:null,selectedDestinationCollection:null!==(c=x.analyticsRule)&&void 0!==c&&null!==(c=c.params)&&void 0!==c&&c.destination_collection?{name:null===(u=x.analyticsRule)||void 0===u||null===(u=u.params)||void 0===u?void 0:u.destination_collection}:null!=(null===(l=x.analyticsRule)||void 0===l||null===(l=l.params)||void 0===l||null===(l=l.destination)||void 0===l?void 0:l.collection)?{name:null===(d=x.analyticsRule)||void 0===d||null===(d=d.params)||void 0===d||null===(d=d.destination)||void 0===d?void 0:d.collection}:null,analyticsRuleTag:(null===(i=this.analyticsRule)||void 0===i?void 0:i.rule_tag)||"",analyticsRuleCounterField:(null===(s=this.analyticsRule)||void 0===s||null===(s=s.params)||void 0===s?void 0:s.counter_field)||"",analyticsRuleCounterWeight:(null===(o=this.analyticsRule)||void 0===o||null===(o=o.params)||void 0===o?void 0:o.weight)||1,analyticsRuleEventType:function(t,e){var r;if(null!==(t=x.analyticsRule)&&void 0!==t&&t.event_type)return null===(r=x.analyticsRule)||void 0===r?void 0:r.event_type;var n=(null===(e=x.analyticsRule)||void 0===e?void 0:e.type)||x.analyticsRuleType;return"popular_queries"===n||"nohits_queries"===n?"query":"counter"===n||"log"===n?"click":"query"}(),analyticsRuleNotificationFrequencyDays:"7",analyticsRuleNotificationEmailAddresses:"",analyticsRuleNotificationStartsAt:Xe.c9.local().plus({hours:2}),analyticsRuleNotificationStartsAtMin:Xe.c9.local().plus({hours:1}),analyticsRuleNotificationStartsAtLabel:"Starting At",aliases:[],currentTimeZone:Xe.c9.local().offsetNameLong,DateTime:Xe.c9}},computed:{analyticsRuleTypeOptions:function(){var t=[{label:"Popular Queries",code:"popular_queries"}];return this.isTypesenseServerVersionAtleast("0.26.0.rc50")&&t.push({label:"No Hits Queries",code:"nohits_queries"}),this.showV30PlusAnalyticsInterface&&(t.push({label:"Counter",code:"counter"}),t.push({label:"Log",code:"log"})),t},eventTypeOptions:function(){return this.showV30PlusAnalyticsInterface?"popular_queries"===this.analyticsRuleType||"nohits_queries"===this.analyticsRuleType?[{label:"query",code:"query"}]:"counter"===this.analyticsRuleType?[{label:"click",code:"click"},{label:"conversion",code:"conversion"}]:[{label:"query",code:"query"},{label:"click",code:"click"},{label:"conversion",code:"conversion"},{label:"visit",code:"visit"}]:[{label:"query",code:"query"}]},metaFieldsOptions:function(){return[{name:"filter_by"},{name:"analytics_tag"}]},typesenseServerConfig:function(){return this.$store.state.typesenseServerConfig},clusterInfo:function(){return this.$store.state.clusterInfo},collections:function(){var t=[];return t.push.apply(t,rr(this.$store.state.collections||[])),t.push.apply(t,rr(this.aliases.map((function(t){return{name:t.name}}))||[])),t},showV30PlusAnalyticsInterface:function(){return this.isTypesenseServerVersionAtleast("30.0.rca28")},isNewAnalyticsRule:function(){return null==this.analyticsRule.name}},mounted:function(){var t=this;return er(Ze().mark((function e(){return Ze().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t,$(t.$refs.analyticsRuleCollapse).on("show.bs.collapse",er(Ze().mark((function t(){return Ze().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:$(this).parent().addClass("border-highlight");case 1:case"end":return t.stop()}}),t,this)})))),$(t.$refs.analyticsRuleCollapse).on("hidden.bs.collapse",(function(){$(this).parent().removeClass("border-highlight")})),e.next=1,t.fetchAliases();case 1:t.fetchAnalyticsRuleNotificationSettings(t.analyticsRuleName);case 2:case"end":return e.stop()}}),e)})))()},methods:{idSafeString:function(t){return null==t?t:"".concat(t.replace(/[^a-z0-9]/g,(function(t){var e=t.charCodeAt(0);return 32==e?"-":e>=65&&e<=90?"_"+t.toLowerCase():"__"+("000"+e.toString(16)).slice(-4)})),"-").concat(this.timestamp)},ensureDestinationCollectionSelected:function(){return!!this.selectedDestinationCollection||(this.errorMessage="Please select a destination collection.",!1)},upsertAnalyticsRule:function(){var t=this;return er(Ze().mark((function e(){var r,n,a,i,o,c,l,u,d,h,f,p,m;return Ze().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.successMessage=null,t.errorMessage=null,r={},n=t.isTypesenseServerVersionAtleast("30.0.rca28"),"popular_queries"!==t.analyticsRuleType){e.next=6;break}if(!n){e.next=3;break}if(i=t.selectedSourceCollection||(null===(a=t.selectedSourceCollections)||void 0===a?void 0:a[0])||null){e.next=1;break}return t.errorMessage="Please select a source collection.",e.abrupt("return");
2case 1:if(t.ensureDestinationCollectionSelected()){e.next=2;break}return e.abrupt("return");case 2:r={name:t.analyticsRuleName,type:"popular_queries",collection:i.name,event_type:"search",params:{destination_collection:t.selectedDestinationCollection.name,limit:parseInt(t.analyticsRulePopularQueriesLimit||"0"),expand_query:t.analyticsRulePopularQueriesExpandQuery,capture_search_requests:!!t.analyticsRuleCaptureSearchRequests}},(t.selectedMetaFields||[]).length>0&&(r.params.meta_fields=t.selectedMetaFields.map((function(t){return t.name}))),(t.analyticsRuleTag||"").trim().length>0&&(r.rule_tag=t.analyticsRuleTag.trim()),e.next=5;break;case 3:if(t.ensureDestinationCollectionSelected()){e.next=4;break}return e.abrupt("return");case 4:r={type:"popular_queries",params:{source:{collections:t.selectedSourceCollections.map((function(t){return t.name})),enable_auto_aggregation:!!t.analyticsRuleCaptureSearchRequests},destination:{collection:t.selectedDestinationCollection.name},limit:parseInt(t.analyticsRulePopularQueriesLimit||"0"),expand_query:t.analyticsRulePopularQueriesExpandQuery}};case 5:e.next=18;break;case 6:if("nohits_queries"!==t.analyticsRuleType){e.next=12;break}if(!n){e.next=9;break}if(c=t.selectedSourceCollection||(null===(o=t.selectedSourceCollections)||void 0===o?void 0:o[0])||null){e.next=7;break}return t.errorMessage="Please select a source collection.",e.abrupt("return");case 7:if(t.ensureDestinationCollectionSelected()){e.next=8;break}return e.abrupt("return");case 8:r={name:t.analyticsRuleName,type:"nohits_queries",collection:c.name,event_type:"search",params:{destination_collection:t.selectedDestinationCollection.name,limit:parseInt(t.analyticsRuleNoHitsQueriesLimit||"0"),capture_search_requests:!!t.analyticsRuleCaptureSearchRequests}},(t.selectedMetaFields||[]).length>0&&(r.params.meta_fields=t.selectedMetaFields.map((function(t){return t.name}))),(t.analyticsRuleTag||"").trim().length>0&&(r.rule_tag=t.analyticsRuleTag.trim()),e.next=11;break;case 9:if(t.ensureDestinationCollectionSelected()){e.next=10;break}return e.abrupt("return");case 10:r={type:"nohits_queries",params:{source:{collections:t.selectedSourceCollections.map((function(t){return t.name})),enable_auto_aggregation:!!t.analyticsRuleCaptureSearchRequests},destination:{collection:t.selectedDestinationCollection.name},limit:parseInt(t.analyticsRuleNoHitsQueriesLimit||"0")}};case 11:e.next=18;break;case 12:if(!n||"counter"!==t.analyticsRuleType){e.next=16;break}if(u=t.selectedSourceCollection||(null===(l=t.selectedSourceCollections)||void 0===l?void 0:l[0])||null){e.next=13;break}return t.errorMessage="Please select a source collection.",e.abrupt("return");case 13:if(t.ensureDestinationCollectionSelected()){e.next=14;break}return e.abrupt("return");case 14:if(t.analyticsRuleCounterField){e.next=15;break}return t.errorMessage="Please specify a counter field.",e.abrupt("return");case 15:r={name:t.analyticsRuleName,type:"counter",collection:u.name,event_type:t.analyticsRuleEventType||"click",params:{destination_collection:t.selectedDestinationCollection.name,counter_field:t.analyticsRuleCounterField,weight:parseFloat(t.analyticsRuleCounterWeight||"1")||1}},(t.analyticsRuleTag||"").trim().length>0&&(r.rule_tag=t.analyticsRuleTag.trim()),e.next=18;break;case 16:if(!n||"log"!==t.analyticsRuleType){e.next=18;break}if(h=t.selectedSourceCollection||(null===(d=t.selectedSourceCollections)||void 0===d?void 0:d[0])||null){e.next=17;break}return t.errorMessage="Please select a source collection.",e.abrupt("return");case 17:r={name:t.analyticsRuleName,type:"log",collection:h.name,event_type:t.analyticsRuleEventType||"click"},(t.analyticsRuleTag||"").trim().length>0&&(r.rule_tag=t.analyticsRuleTag.trim());case 18:return f=new ut.Kj(t.$store.state.typesenseServerConfig),e.prev=19,s().start(),e.next=20,f.analytics.rules().upsert(t.analyticsRuleName||"analyticsRule_".concat(Math.round(Date.now()/1e3)),r);case 20:return p=e.sent,e.next=21,t.saveAnalyticsRuleNotificationSettings(p.name,t.analyticsRuleNotificationEmailAddresses,t.analyticsRuleNotificationFrequencyDays,t.anal
2yticsRuleNotificationStartsAt);case 21:if(!1!==e.sent){e.next=22;break}throw"Please check the format of your notification email address(es).";case 22:t.successMessage="Rule ".concat(t.isNewAnalyticsRule?"created":"updated","."),setTimeout(er(Ze().mark((function e(){var r,n,a,i;return Ze().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.successMessage="",!t.isNewAnalyticsRule){e.next=1;break}t.resetFields(),$(t.$refs.analyticsRuleCollapse).collapse("hide"),t.$emit("analyticsRule-create",p),e.next=4;break;case 1:if(i=null!==(r=t.analyticsRule)&&void 0!==r&&r.name?decodeURIComponent(null===(n=t.analyticsRule)||void 0===n?void 0:n.name):null===(a=t.analyticsRule)||void 0===a?void 0:a.name,t.analyticsRuleName===i){e.next=3;break}return e.next=2,f.analytics.rules(t.analyticsRule.name).delete();case 2:t.deleteAnalyticsRuleNotificationSettings(t.analyticsRule.name);case 3:t.$emit("analyticsRule-update",p);case 4:case"end":return e.stop()}}),e)}))),1e3),e.next=24;break;case 23:e.prev=23,m=e.catch(19),console.error(m),t.errorMessage="Error ".concat(t.isNewAnalyticsRule?"creating":"updating"," analyticsRule: ").concat(m);case 24:return e.prev=24,s().done(),e.finish(24);case 25:case"end":return e.stop()}}),e,null,[[19,23,24,25]])})))()},deleteAnalyticsRule:function(){var t=this;return er(Ze().mark((function e(){var r,n;return Ze().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(confirm('Are you sure you want to DELETE Rule "'.concat(t.analyticsRuleName,'"?'))){e.next=1;break}return e.abrupt("return");case 1:return r=new ut.Kj(t.$store.state.typesenseServerConfig),e.prev=2,s().start(),e.next=3,r.analytics.rules(t.analyticsRuleName).delete();case 3:t.deleteAnalyticsRuleNotificationSettings(t.analyticsRuleName),t.successMessage="Rule deleted.",setTimeout((function(){$(t.$refs.analyticsRuleCollapse).collapse("hide"),t.$emit("analyticsRule-delete",t.analyticsRule)}),1e3),e.next=5;break;case 4:e.prev=4,n=e.catch(2),console.error(n),t.errorMessage="Error deleting Rule: ".concat(n);case 5:return e.prev=5,s().done(),e.finish(5);case 6:case"end":return e.stop()}}),e,null,[[2,4,5,6]])})))()},saveAnalyticsRuleNotificationSettings:function(t,e,r,n){var a=this;return er(Ze().mark((function i(){var s,o;return Ze().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(0!==(s=e.split("\n").map((function(t){return t.trim()})).filter((function(t){return t}))).length){i.next=2;break}return i.next=1,a.deleteAnalyticsRuleNotificationSettings(t);case 1:return i.abrupt("return",i.sent);case 2:return i.prev=2,i.next=3,h.A.post(a.clusterInfo.routes.cluster_analytics_rule_notification_settings_path,{analytics_rule_name:t,notification_email_addresses:s,notification_frequency_days:parseInt(r),notification_starts_at_unix_timestamp:n.toSeconds()});case 3:if(!0===i.sent.data.success){i.next=4;break}throw"Error saving notification settings";case 4:i.next=6;break;case 5:return i.prev=5,o=i.catch(2),console.warn(o),a.errorMessage="There was an error saving your notification settings. Please check your email address format.",i.abrupt("return",!1);case 6:return i.abrupt("return",!0);case 7:case"end":return i.stop()}}),i,null,[[2,5]])})))()},fetchAnalyticsRuleNotificationSettings:function(t){var e=this;return er(Ze().mark((function r(){var n,a;return Ze().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(null!=t){r.next=1;break}return r.abrupt("return");case 1:return r.prev=1,r.next=2,h.A.get(e.clusterInfo.routes.cluster_analytics_rule_notification_settings_path,{params:{analytics_rule_name:t}});case 2:n=r.sent,e.analyticsRuleNotificationEmailAddresses=(n.data.notification_email_addresses||[]).join("\n"),n.data.notification_frequency_days&&(e.analyticsRuleNotificationFrequencyDays="".concat(n.data.notification_frequency_days)),n.data.notification_starts_at_unix_timestamp&&(e.analyticsRuleNotificationStartsAt=Xe.c9.fromSeconds(n.data.notification_starts_at_unix_timestamp),e.analyticsRuleNotificationStartsAtLabel="Next Notification At"),r.next=4;break;case 3:r.prev=3,a=r.catch(1),console.warn(a);case 4:case"end":return r.stop()}}),r,null,[[1,3]])}
2)))()},deleteAnalyticsRuleNotificationSettings:function(t){var e=this;return er(Ze().mark((function r(){var n,a;return Ze().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=1,h.A.delete(e.clusterInfo.routes.cluster_analytics_rule_notification_settings_path,{params:{analytics_rule_name:t}});case 1:return n=r.sent,r.abrupt("return",n.data);case 2:r.prev=2,a=r.catch(0),console.warn(a);case 3:case"end":return r.stop()}}),r,null,[[0,2]])})))()},fetchAliases:function(){var t=this;return er(Ze().mark((function e(){var r,n;return Ze().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new ut.Kj(t.$store.state.typesenseServerConfig),e.prev=1,e.next=2,r.aliases().retrieve();case 2:t.aliases=e.sent.aliases,e.next=4;break;case 3:e.prev=3,n=e.catch(1),console.error(n);case 4:case"end":return e.stop()}}),e,null,[[1,3]])})))()},resetFields:function(){Object.assign(this.$data,this.$options.data.apply(this)),this.errorMessage="",this.successMessage=""},openPane:function(){$(this.$refs.analyticsRuleCollapse).collapse("show")}}},ir=(0,c.A)(ar,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"bg-light rounded py-3 my-2 px-3 border-transparent"},[e("div",{attrs:{id:"analyticsRule-heading-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[e("h2",{staticClass:"mb-0"},[e("button",{staticClass:"btn btn-block d-flex justify-content-between align-items-center shadow-none",attrs:{type:"button","data-toggle":"collapse","data-target":"#analyticsRule-collapse-".concat(t.idSafeString(t.analyticsRuleName)||"new"),"aria-expanded":"true","aria-controls":"analyticsRule-collapse-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[e("h5",{staticClass:"text-secondary mb-0"},[t._v("\n          "+t._s(t.isNewAnalyticsRule?"Add New Analytics Rule":t.analyticsRuleName)+"\n        ")]),t._v(" "),e("DropdownArrow")],1)])]),t._v(" "),e("div",{ref:"analyticsRuleCollapse",staticClass:"collapse p-3",attrs:{id:"analyticsRule-collapse-".concat(t.idSafeString(t.analyticsRuleName)||"new"),"aria-labelledby":"analyticsRule-heading-".concat(t.idSafeString(t.analyticsRuleName)||"new"),"data-parent":"#analyticsRulesAccordion"}},[e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm"},[e("label",{attrs:{for:"analyticsRuleName-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Rule Name")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRuleName,expression:"analyticsRuleName"}],staticClass:"form-control",attrs:{id:"analyticsRuleName-".concat(t.idSafeString(t.analyticsRuleName)||"new"),type:"text",placeholder:"Eg: search_suggestions"},domProps:{value:t.analyticsRuleName},on:{input:function(e){e.target.composing||(t.analyticsRuleName=e.target.value)}}})])]),t._v(" "),e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm"},[e("label",{attrs:{for:"analyticsRuleType-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Rule Type")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-type-selector",attrs:{id:"analyticsRuleType-".concat(t.idSafeString(t.analyticsRuleName)||"new"),searchable:!1,multiple:!1,options:t.analyticsRuleTypeOptions,reduce:function(t){return t.code},components:{OpenIndicator:t.OpenIndicator,Deselect:null}},model:{value:t.analyticsRuleType,callback:function(e){t.analyticsRuleType=e},expression:"analyticsRuleType"}})],1),t._v(" "),t.showV30PlusAnalyticsInterface?e("div",{staticClass:"col-sm"},[e("label",{attrs:{for:"analyticsRuleRuleTag-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Rule Tag (optional)")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRuleTag,expression:"analyticsRuleTag"}],staticClass:"form-control",attrs:{id:"analyticsRuleRuleTag-".concat(t.idSafeString(t.analyticsRuleName)||"new"),type:"text",placeholder:"Eg: homepage, mobile, campaign_123"},domProps:{value:t.analyticsRuleTag},on:{input:function(e){e.target.composing||(t.analyticsRuleTag=e.target.value)}}}),t._v(" "),e("span",{staticClass:"small text-muted"},[t._v("\n          Attach a tag to help group a set of rules, for easy access later")])]):t._e()]),t._v(" "),e("h5",{staticClass:"mt-3 mb-0 text-dark"},[t._v("Parameters")]),t._v(" "),e("hr",{staticClass:"my-1"}),t._v(" "),"popular_queries"===t.analyticsRuleType?e("div",{staticClass:"row mt-4"},[e("div",{staticClass:"col-sm"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-sm"},[e("label",{attrs:{for:"analyticsRulePopularQueriesSourceCollections-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v(t._s(t.showV30PlusAnalyticsInterface?"Source Collection":"Source Collection(s)"))]),t._v(" "),t.showV30PlusAnalyticsInterface?[e("VSelect",{staticClass:"analyticsRule-destination-collection-selector",attrs:{id:"analyticsRulePopularQueriesSourceCollections-".concat(t.idSafeString(t.analyticsRuleName)||"new"),title:(t.selectedSourceCollection||{}).name,options:t.collections,components:{OpenIndicator:t.OpenIndicator,Deselect:null},label:"name"},model:{value:t.selectedSourceCollection,callback:function(e){t.selectedSourceCollection=e},expression:"selectedSourceCollection"}})]:[e("VSelect",{staticClass:"analyticsRule-source-collections-selector",attrs:{id:"analyticsRulePopularQueriesSourceCollections-".concat(t.idSafeString(t.analyticsRuleName)||"new"),title:(t.selectedSourceCollections||[]).map((function(t){return t.name})).join(", "),options:t.collections,components:{Deselect:t.Deselect,OpenIndicator:t.OpenIndicator},label:"name",multiple:!0},model:{value:t.selectedSourceCollections,callback:function(e){t.selectedSourceCollections=e},expression:"selectedSourceCollections"}})],t._v(" "),e("span",{staticClass:"small text-muted"},[t._v("Track searches sent to\n              "+t._s(t.showV30PlusAnalyticsInterface?"this collection":"these collections"))])],2),t._v(" "),e("div",{staticClass:"col-sm"},[e("label",{attrs:{for:"analyticsRulePopularQueriesDestinationCollection-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Destination Collection")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-destination-collection-selector",attrs:{id:"analyticsRulePopularQueriesDestinationCollection-".concat(t.idSafeString(t.analyticsRuleName)||"new"),title:(t.selectedDestinationCollection||{}).name,options:t.collections,components:{OpenIndicator:t.OpenIndicator,Deselect:null},label:"name"},model:{value:t.selectedDestinationCollection,callback:function(e){t.selectedDestinationCollection=e},expression:"selectedDestinationCollection"}}),t._v(" "),e("span",{staticClass:"small text-muted"},[t._v("Collect search terms in this collection. Collection's schema needs to be set\n              according to the docs")])],1)]),t._v(" "),e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm-3"},[e("label",{attrs:{for:"analyticsRulePopularQueriesLimit-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Limit")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRulePopularQueriesLimit,expression:"analyticsRulePopularQueriesLimit"}],staticClass:"form-control",attrs:{id:"analyticsRulePopularQueriesLimit-".concat(t.idSafeString(t.analyticsRuleName)||"new"),t
2ype:"number",required:"",placeholder:"Eg: 100"},domProps:{value:t.analyticsRulePopularQueriesLimit},on:{input:function(e){e.target.composing||(t.analyticsRulePopularQueriesLimit=e.target.value)}}}),t._v(" "),e("span",{staticClass:"small text-muted"},[t._v(" Number of Search Terms to collect ")])])]),t._v(" "),t.showV30PlusAnalyticsInterface?e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm-6"},[e("label",{attrs:{for:"analyticsRuleMetaFieldsPopular-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Meta Fields (optional)")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-source-collections-selector",attrs:{id:"analyticsRuleMetaFieldsPopular-".concat(t.idSafeString(t.analyticsRuleName)||"new"),options:t.metaFieldsOptions,components:{Deselect:t.Deselect,OpenIndicator:t.OpenIndicator},label:"name",multiple:!0},model:{value:t.selectedMetaFields,callback:function(e){t.selectedMetaFields=e},expression:"selectedMetaFields"}}),t._v(" "),e("span",{staticClass:"small text-muted"},[t._v("Additional meta data to capture, during aggregation")])],1)]):t._e(),t._v(" "),t.isTypesenseServerVersionAtleast("0.26.0.rc40")?e("div",{staticClass:"row mt-4"},[e("div",{staticClass:"col-sm-7"},[e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRulePopularQueriesExpandQuery,expression:"analyticsRulePopularQueriesExpandQuery"}],staticClass:"custom-control-input",attrs:{id:"analyticsRulePopularQueriesExpandQuery-".concat(t.idSafeString(t.analyticsRuleName)||"new"),type:"checkbox"},domProps:{checked:Array.isArray(t.analyticsRulePopularQueriesExpandQuery)?t._i(t.analyticsRulePopularQueriesExpandQuery,null)>-1:t.analyticsRulePopularQueriesExpandQuery},on:{change:function(e){var r=t.analyticsRulePopularQueriesExpandQuery,n=e.target,a=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&(t.analyticsRulePopularQueriesExpandQuery=r.concat([null])):i>-1&&(t.analyticsRulePopularQueriesExpandQuery=r.slice(0,i).concat(r.slice(i+1)))}else t.analyticsRulePopularQueriesExpandQuery=a}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"analyticsRulePopularQueriesExpandQuery-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Expand Partial Queries")])]),t._v(" "),e("div",{staticClass:"small text-muted"},[t._v("\n              If a searcher types in a partial query, should it be fully expanded automatically\n              when logged\n            ")])])]):t._e(),t._v(" "),t.showV30PlusAnalyticsInterface?e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm-7"},[e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRuleCaptureSearchRequests,expression:"analyticsRuleCaptureSearchRequests"}],staticClass:"custom-control-input",attrs:{id:"analyticsRuleCaptureSearchRequests-".concat(t.idSafeString(t.analyticsRuleName)||"new"),type:"checkbox"},domProps:{checked:Array.isArray(t.analyticsRuleCaptureSearchRequests)?t._i(t.analyticsRuleCaptureSearchRequests,null)>-1:t.analyticsRuleCaptureSearchRequests},on:{change:function(e){var r=t.analyticsRuleCaptureSearchRequests,n=e.target,a=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&(t.analyticsRuleCaptureSearchRequests=r.concat([null])):i>-1&&(t.analyticsRuleCaptureSearchRequests=r.slice(0,i).concat(r.slice(i+1)))}else t.analyticsRuleCaptureSearchRequests=a}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"analyticsRuleCaptureSearchRequests-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Capture search requests automatically")])]),t._v(" "),e("div",{staticClass:"small text-muted"},[t._v("\n              If disabled, only analytics events sent via the events API will be aggregated.\n            ")])])]):t._e(),t._v(" "),e("div",{staticClass:"mt-4"},[e("a",{attrs:{href:"#analytics-rule-notification-settings-".concat(t.idSafeString(t.analyticsRuleName)||"new"),"data-toggle":"collapse",role:"button","aria-expanded":"false","aria-controls":"#analytics-rule-notification-settings-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("\n            Notifications \u2193\n          ")])]),t._v(" "),e("div",{staticClass:"row mt-3 collapse",attrs:{id:"analytics-rule-notification-settings-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[e("div",{staticClass:"col-sm"},[e("div",{staticClass:"small text-muted mb-4"},[t._v("\n              Receive a summary with the top queries tracked by this rule\n            ")]),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"col-sm-4"},[e("label",{attrs:{for:"analyticsRuleNotificationEmailAddresses-".concat(t.idSafeString(t.analyticsRuleName)||"new")}}
2,[t._v("Notification Email Addresses")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRuleNotificationEmailAddresses,expression:"analyticsRuleNotificationEmailAddresses"}],staticClass:"form-control",attrs:{id:"analyticsRuleNotificationEmailAddresses-".concat(t.idSafeString(t.analyticsRuleName)||"new"),rows:"5",cols:"100",placeholder:"One email per line"},domProps:{value:t.analyticsRuleNotificationEmailAddresses},on:{input:function(e){e.target.composing||(t.analyticsRuleNotificationEmailAddresses=e.target.value)}}})]),t._v(" "),e("div",{staticClass:"col-sm-6"},[e("div",[e("label",{attrs:{for:"analyticsRuleNotificationFrequency-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Notification Frequency")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-notification-frequency-selector",attrs:{id:"analyticsRuleNotificationFrequency-".concat(t.idSafeString(t.analyticsRuleName)||"new"),searchable:!1,multiple:!1,options:[{label:"Daily",code:"1"},{label:"Every 3 Days",code:"3"},{label:"Weekly",code:"7"},{label:"Monthly",code:"28"}],reduce:function(t){return t.code},components:{OpenIndicator:t.OpenIndicator,Deselect:null}},model:{value:t.analyticsRuleNotificationFrequencyDays,callback:function(e){t.analyticsRuleNotificationFrequencyDays=e},expression:"analyticsRuleNotificationFrequencyDays"}})],1),t._v(" "),e("div",{staticClass:"mt-4"},[e("label",{attrs:{for:"analyticsRuleNotificationStartingAt-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v(t._s(t.analyticsRuleNotificationStartsAtLabel))]),t._v(" "),e("div",{staticClass:"input-group"},[e("input",{key:"analytics-rule-notification-starting-at-input-".concat(t.idSafeString(t.analyticsRuleName)||"new"),staticClass:"form-control",staticStyle:{"max-width":"270px","min-width":"270px"},attrs:{id:"analytics-rule-notification-starting-at-".concat(t.idSafeString(t.analyticsRuleName)||"new"),min:t.analyticsRuleNotificationStartsAtMin.toFormat("yyyy-MM-dd'T'HH:mm"),type:"datetime-local",pattern:"[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}","aria-label":"Starting at","aria-describedby":"analytics-rule-notification-starting-at-timezone-".concat(t.idSafeString(t.analyticsRuleName)||"new")},domProps:{value:t.analyticsRuleNotificationStartsAt&&t.analyticsRuleNotificationStartsAt.toFormat("yyyy-MM-dd'T'HH:mm")},on:{input:function(e){t.analyticsRuleNotificationStartsAt=t.DateTime.fromISO(e.target.value)}}}),t._v(" "),e("div",{staticClass:"input-group-append"},[e("span",{staticClass:"input-group-text",attrs:{id:"analytics-rule-notification-starting-at-timezone-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v(t._s(t.analyticsRuleNotificationStartsAt?t.analyticsRuleNotificationStartsAt.offsetNameLong:t.DateTime.local().offsetNameLong))])])])])])])])])])]):t._e(),t._v(" "),"nohits_queries"===t.analyticsRuleType?e("div",{staticClass:"row mt-4"},[e("div",{staticClass:"col-sm"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-sm"},[e("label",{attrs:{for:"analyticsRuleNoHitsQueriesSourceCollections-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v(t._s(t.showV30PlusAnalyticsInterface?"Source Collection":"Source Collection(s)"))]),t._v(" "),t.showV30PlusAnalyticsInterface?[e("VSelect",{staticClass:"analyticsRule-destination-collection-selector",attrs:{id:"analyticsRuleNoHitsQueriesSourceCollections-".concat(t.idSafeString(t.analyticsRuleName)||"new"),title:(t.selectedSourceCollection||{}).name,options:t.collections,components:{OpenIndicator:t.OpenIndicator,Deselect:null},label:"name"},model:{value:t.selectedSourceCollection,callback:function(e){t.selectedSourceCollection=e},expression:"selectedSourceCollection"}})]:[e("VSelect",{staticClass:"analyticsRule-source-collections-selector",attrs:{id:"analyticsRuleNoHitsQueriesSourceCollections-".concat(t.idSafeString(t.analyticsRuleName)||"new"),title:(t.selectedSourceCollections||[]).map((function(t){return t.name})).join(", "),options:t.collections,components:{Deselect:t.Deselect,OpenIndicator:t.OpenIndicator},label:"name",multiple:!0},model:{value:t.selectedSourceCollections,callback:function(e){t.selectedSourceCollections=e},expression:"selectedSourceCollections"}})],t._v(" "),e("span",{staticClass:"small text-muted"},[t._v("Track searches sent to\n              "+t._s(t.showV30PlusAnalyticsInterface?"this collection":"these collections"))])],2),t._v(" "),e("div",{staticClass:"col-sm"},[e("label",{attrs:{for:"analyticsRuleNoHitsQueriesDestinationCollection-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Destination Collection")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-destination-collection-selector",attrs:{id:"analyticsRuleNoHitsQueriesDestinationCollection-".concat(t.idSafeString(t.analyticsRuleName)||"new"),title:(t.selectedDestinationCollection||{}).name,options:t.collections,components:{OpenIndicator:t.OpenIndicator,Deselect:null},label:"name"},model:{value:t.selectedDestinationCollection,callback:function(e){t.selectedDestinationCollection=e},expression:"selectedDestinationCollection"}}),t._v(" "),e("span",{staticClass:"small text-muted"},[t._v("Collect search terms in this collection. Collection's schema needs to be set\n              according to the docs")])],1)]),t._v(" "),e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm-4"},[e("label",{attrs:{for:"analyticsRuleNoHitsQueriesLimit-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Limit")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRuleNoHitsQueriesLimit,expression:"analyticsRuleNoHitsQueriesLimit"}],staticClass:"form-control",attrs:{id:"analyticsRuleNoHitsQueriesLimit-".concat(t.idSafeString(t.analyticsRuleName)||"new"),t
2ype:"number",required:"",placeholder:"Eg: 100"},domProps:{value:t.analyticsRuleNoHitsQueriesLimit},on:{input:function(e){e.target.composing||(t.analyticsRuleNoHitsQueriesLimit=e.target.value)}}}),t._v(" "),e("span",{staticClass:"small text-muted"},[t._v(" Number of Search Terms with No Hits to collect ")])])]),t._v(" "),t.showV30PlusAnalyticsInterface?e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm-6"},[e("label",{attrs:{for:"analyticsRuleMetaFieldsNoHits-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Meta Tags (optional)")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-source-collections-selector",attrs:{id:"analyticsRuleMetaFieldsNoHits-".concat(t.idSafeString(t.analyticsRuleName)||"new"),options:t.metaFieldsOptions,components:{Deselect:t.Deselect,OpenIndicator:t.OpenIndicator},label:"name",multiple:!0},model:{value:t.selectedMetaFields,callback:function(e){t.selectedMetaFields=e},expression:"selectedMetaFields"}}),t._v(" "),e("span",{staticClass:"small text-muted"},[t._v("Additional metadata to capture during aggreation")])],1)]):t._e(),t._v(" "),t.showV30PlusAnalyticsInterface?e("div",{staticClass:"row mt-4"},[e("div",{staticClass:"col-sm-6"},[e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRuleCaptureSearchRequests,expression:"analyticsRuleCaptureSearchRequests"}],staticClass:"custom-control-input",attrs:{id:"analyticsRuleCaptureSearchRequestsNoHits-".concat(t.idSafeString(t.analyticsRuleName)||"new"),type:"checkbox"},domProps:{checked:Array.isArray(t.analyticsRuleCaptureSearchRequests)?t._i(t.analyticsRuleCaptureSearchRequests,null)>-1:t.analyticsRuleCaptureSearchRequests},on:{change:function(e){var r=t.analyticsRuleCaptureSearchRequests,n=e.target,a=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&(t.analyticsRuleCaptureSearchRequests=r.concat([null])):i>-1&&(t.analyticsRuleCaptureSearchRequests=r.slice(0,i).concat(r.slice(i+1)))}else t.analyticsRuleCaptureSearchRequests=a}}}),t._v(" "),e("label",{staticClass:"custom-control-label",attrs:{for:"analyticsRuleCaptureSearchRequestsNoHits-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Capture search requests automatically")])]),t._v(" "),e("div",{staticClass:"small text-muted"},[t._v("\n              If disabled, only analytics events sent via the events API will be aggregated.\n            ")])])]):t._e(),t._v(" "),e("div",{staticClass:"mt-4"},[e("a",{attrs:{href:"#analytics-rule-notification-settings-".concat(t.idSafeString(t.analyticsRuleName)||"new"),"data-toggle":"collapse",role:"button","aria-expanded":"false","aria-controls":"#analytics-rule-notification-settings-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("\n            Notifications \u2193\n          ")])]),t._v(" "),e("div",{staticClass:"row mt-3 collapse",attrs:{id:"analytics-rule-notification-settings-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[e("div",{staticClass:"col-sm"},[e("div",{staticClass:"small text-muted mb-4"},[t._v("\n              Receive a summary with the top no-hits terms tracked by this rule\n            ")]),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"col-sm-4"},[e("label",{attrs:{for:"analyticsRuleNotificationEmailAddresses-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Notification Email Addresses")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRuleNotificationEmailAddresses,expression:"analyticsRuleNotificationEmailAddresses"}],staticClass:"form-control",attrs:{id:"analyticsRuleNotificationEmailAddresses-".concat(t.idSafeString(t.analyticsRuleName)||"new"),rows:"5",cols:"100",placeholder:"One email per line"},domProps:{value:t.analyticsRuleNotificationEmailAddresses},on:{input:function(e){e.target.composing||(t.analyticsRuleNotificationEmailAddresses=e.target.value)}}})]),t._v(" "),e("div",{staticClass:"col-sm-6"},[e("div",[e("label",{attrs:{for:"analyticsRuleNotificationFrequency-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Notification Frequency")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-notification-frequency-selector",attrs:{id:"analyticsRuleNotificationFrequency-".concat(t.idSafeString(t.analyticsRuleName)||"new"),searchable:!1,multiple:!1,options:[{label:"Daily",code:"1"},{label:"Every 3 Days",code:"3"},{label:"Weekly",code:"7"},{label:"Monthly",code:"28"}],reduce:function(t){return t.code},components:{OpenIndicator:t.OpenIndicator,Deselect:null}},model:{value:t.analyticsRuleNotificationFrequencyDays,callback:function(e){t.analyticsRuleNotificationFrequencyDays=e},expression:"analyticsRuleNotificationFrequencyDays"}}
2)],1),t._v(" "),e("div",{staticClass:"mt-4"},[e("label",{attrs:{for:"analyticsRuleNotificationStartingAt-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v(t._s(t.analyticsRuleNotificationStartsAtLabel))]),t._v(" "),e("div",{staticClass:"input-group"},[e("input",{key:"analytics-rule-notification-starting-at-input-".concat(t.idSafeString(t.analyticsRuleName)||"new"),staticClass:"form-control",staticStyle:{"max-width":"270px","min-width":"270px"},attrs:{id:"analytics-rule-notification-starting-at-".concat(t.idSafeString(t.analyticsRuleName)||"new"),min:t.analyticsRuleNotificationStartsAtMin.toFormat("yyyy-MM-dd'T'HH:mm"),type:"datetime-local",pattern:"[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}","aria-label":"Starting at","aria-describedby":"analytics-rule-notification-starting-at-timezone-".concat(t.idSafeString(t.analyticsRuleName)||"new")},domProps:{value:t.analyticsRuleNotificationStartsAt&&t.analyticsRuleNotificationStartsAt.toFormat("yyyy-MM-dd'T'HH:mm")},on:{input:function(e){t.analyticsRuleNotificationStartsAt=t.DateTime.fromISO(e.target.value)}}}),t._v(" "),e("div",{staticClass:"input-group-append"},[e("span",{staticClass:"input-group-text",attrs:{id:"analytics-rule-notification-starting-at-timezone-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v(t._s(t.analyticsRuleNotificationStartsAt?t.analyticsRuleNotificationStartsAt.offsetNameLong:t.DateTime.local().offsetNameLong))])])])])])])])])])]):t._e(),t._v(" "),t.showV30PlusAnalyticsInterface&&"counter"===t.analyticsRuleType?e("div",{staticClass:"row mt-4"},[e("div",{staticClass:"col-sm"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-sm-6"},[e("label",{attrs:{for:"analyticsRuleCounterSource-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Source Collection")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-destination-collection-selector",attrs:{id:"analyticsRuleCounterSource-".concat(t.idSafeString(t.analyticsRuleName)||"new"),title:(t.selectedSourceCollection||{}).name,options:t.collections,components:{OpenIndicator:t.OpenIndicator,Deselect:null},label:"name"},model:{value:t.selectedSourceCollection,callback:function(e){t.selectedSourceCollection=e},expression:"selectedSourceCollection"}}),t._v(" "),e("div",{staticClass:"small text-muted"},[t._v("Collection to listen for events in")])],1),t._v(" "),e("div",{staticClass:"col-sm-6"},[e("label",{attrs:{for:"analyticsRuleCounterDestination-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Destination Collection")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-destination-collection-selector",attrs:{id:"analyticsRuleCounterDestination-".concat(t.idSafeString(t.analyticsRuleName)||"new"),title:(t.selectedDestinationCollection||{}).name,options:t.collections,components:{OpenIndicator:t.OpenIndicator,Deselect:null},label:"name"},model:{value:t.selectedDestinationCollection,callback:function(e){t.selectedDestinationCollection=e},expression:"selectedDestinationCollection"}}),t._v(" "),e("div",{staticClass:"small text-muted"},[t._v("Collection with the counter field")]),t._v(" "),e("div",{staticClass:"mt-3"},[e("label",{attrs:{for:"analyticsRuleCounterField-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Counter Field in Destination Collection")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRuleCounterField,expression:"analyticsRuleCounterField"}],staticClass:"form-control",attrs:{id:"analyticsRuleCounterField-".concat(t.idSafeString(t.analyticsRuleName)||"new"),type:"text",placeholder:"Eg: popularity"},domProps:{value:t.analyticsRuleCounterField},on:{input:function(e){e.target.composing||(t.analyticsRuleCounterField=e.target.value)}}})])],1)]),t._v(" "),e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm-6"}),t._v(" "),e("div",{staticClass:"col-sm-3"},[e("label",{attrs:{for:"analyticsRuleCounterWeight-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Increment Counter Field by")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.analyticsRuleCounterWeight,expression:"analyticsRuleCounterWeight"}],staticClass:"form-control",attrs:{id:"analyticsRuleCounterWeight-".concat(t.idSafeString(t.analyticsRuleName)||"new"),t
2ype:"number",placeholder:"Eg: 1"},domProps:{value:t.analyticsRuleCounterWeight},on:{input:function(e){e.target.composing||(t.analyticsRuleCounterWeight=e.target.value)}}})])]),t._v(" "),e("div",{staticClass:"row mt-3"},[e("div",{staticClass:"col-sm-6"}),t._v(" "),e("div",{staticClass:"col-sm-3"},[e("label",{attrs:{for:"analyticsRuleCounterEventType-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Event Type")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-notification-frequency-selector",attrs:{id:"analyticsRuleCounterEventType-".concat(t.idSafeString(t.analyticsRuleName)||"new"),searchable:!1,multiple:!1,options:t.eventTypeOptions,reduce:function(t){return t.code},components:{OpenIndicator:t.OpenIndicator,Deselect:null}},model:{value:t.analyticsRuleEventType,callback:function(e){t.analyticsRuleEventType=e},expression:"analyticsRuleEventType"}})],1)])])]):t._e(),t._v(" "),t.showV30PlusAnalyticsInterface&&"log"===t.analyticsRuleType?e("div",{staticClass:"row mt-4"},[e("div",{staticClass:"col-sm"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-sm-6"},[e("label",{attrs:{for:"analyticsRuleLogSource-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Source Collection")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-destination-collection-selector",attrs:{id:"analyticsRuleLogSource-".concat(t.idSafeString(t.analyticsRuleName)||"new"),title:(t.selectedSourceCollection||{}).name,options:t.collections,components:{OpenIndicator:t.OpenIndicator,Deselect:null},label:"name"},model:{value:t.selectedSourceCollection,callback:function(e){t.selectedSourceCollection=e},expression:"selectedSourceCollection"}})],1),t._v(" "),e("div",{staticClass:"col-sm-3"},[e("label",{attrs:{for:"analyticsRuleLogEventType-".concat(t.idSafeString(t.analyticsRuleName)||"new")}},[t._v("Event Type")]),t._v(" "),e("VSelect",{staticClass:"analyticsRule-notification-frequency-selector",attrs:{id:"analyticsRuleLogEventType-".concat(t.idSafeString(t.analyticsRuleName)||"new"),searchable:!1,multiple:!1,options:t.eventTypeOptions,reduce:function(t){return t.code},components:{OpenIndicator:t.OpenIndicator,Deselect:null}},model:{value:t.analyticsRuleEventType,callback:function(e){t.analyticsRuleEventType=e},expression:"analyticsRuleEventType"}})],1)])])]):t._e(),t._v(" "),e("div",{staticClass:"mt-4"},[e("div",[e("button",{staticClass:"btn btn-primary mt-4",on:{click:function(e){return e.preventDefault(),t.upsertAnalyticsRule.apply(null,arguments)}}},[t._v("\n          "+t._s(t.isNewAnalyticsRule?"Add Analytics Rule":"Update Analytics Rule")+"\n        ")])]),t._v(" "),e("div",{staticClass:"mt-2"},[t.isNewAnalyticsRule?t._e():e("button",{staticClass:"btn btn-link btn-sm px-0 shadow-none",on:{click:function(e){return e.preventDefault(),t.deleteAnalyticsRule.apply(null,arguments)}}},[t._v("\n          Delete\n        ")])])]),t._v(" "),t.errorMessage?e("div",{staticClass:"mt-4 alert alert-warning",attrs:{role:"alert"}},[t._v("\n      "+t._s(t.errorMessage)+"\n    ")]):t._e(),t._v(" "),e("transition",{attrs:{name:"fade"}},[t.successMessage?e("div",{staticClass:"mt-4 alert alert-success",attrs:{role:"alert"}},[t._v("\n        "+t._s(t.successMessage)+"\n      ")]):t._e()])],1)])}),[],!1,null,"c96e9eac",null);function sr(){sr=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,s=Object.create(i.prototype),o=new L(n||[]);return a(s,"_invoke",{value:N(t,r,o)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",v={};function y(){}function g(){}function _(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(E([])));C&&C!==r&&n.call(C,s)&&(b=C);var S=_.prototype=y.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function r(a,i,s,o){var c=d(t[a],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,s,o)}),(function(t){r("throw",t,s,o)})):e.resolve(u).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,o)}))}o(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return i=i?i.then(a,a):a()}})}function N(e,r,n){var a=h;return function(i,s){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===i)throw s;return{value:t,done:!0}}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var c=A(o,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=d(e,r,n);if("normal"===l.type){if(a=n.done?m:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&
vendor: 1,572 bytes, line 2
2(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=d(a,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var s=i.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=_,a(S,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:g,configurable:!0}),g.displayName=l(_,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}}
2,x(R.prototype),l(R.prototype,o,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var s=new R(u(t,r,n,a),i);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(S),l(S,c,"Generator"),l(S,s,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return o.type="throw",o.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function or(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(l){return void r(l)}o.done?e(c):Promise.resolve(c).then(n,a)}function cr(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){or(i,n,a,s,o,"next",t)}function o(t){or(i,n,a,s,o,"throw",t)}s(void 0)}))}}var lr={name:"AnalyticsRules",components:{AnalyticsRuleUpsert:ir.exports},mixins:[q.A],data:function(){return{analyticsRules:[],prepopulatedNewAnalyticsRule:{},errorMessage:null,successMessage:null,lastAnalyticsRulesFetchTimestamp:Date.now(),ruleTagFilter:"",hasAnyRuleWithTag:!1}},computed:{docsUrl:function(){return this.typesenseDocsLink("api/analytics-query-suggestions.html")},isV30:function(){return this.isTypesenseServerVersionAtleast("30.0.rca28")},showRuleTagFilter:function(){return this.isV30&&(this.hasAnyRuleWithTag||(this.ruleTagFilter||"").trim().length>0)},typesenseServerVersion:function(){return this.$store.state.clusterInfo.configuration.typesense_server_version_option},typesenseServerConfig:function(){return this.$store.state.typesenseServerConfig},clusterInfo:function(){return this.$store.state.clusterInfo},accessControlPolicy:function(){return this.$store.state.clusterInfo.access_control_policy},clusterStatus:function(){return this.$store.state.clusterStatus},loadingClusterStatus:function(){return this.$store.state.loadingClusterStatus}},mounted:function(){var t=this;return cr(sr().mark((function e(){return sr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,t.fetchAnalyticsRules();case 1:t.$route.query.addNewAnalyticsRule&&(t.$refs.addNewAnalyticsRule.openPane(),setTimeout((function(){t.$refs.addNewAnalyticsRule.$el.scrollIntoView({behavior:"smooth"})}),750));case 2:case"end":return e.stop()}}),e)})))()},methods:{fetchAnalyticsRules:function(){var t=this;return cr(sr().mark((function e(){var r,n,a,i,o,c,l;return sr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new ut.Kj(t.$store.state.typesenseServerConfig),e.prev=1,s().start(),n={},t.isV30&&(t.ruleTagFilter||"").trim().length>0&&(n.rule_tag=t.ruleTagFilter.trim()),!Object.keys(n).length){e.next=3;break}return e.next=2,r.analytics.rules().retrieve(n);case 2:c=e.sent,e.next=5;break;case 3:return e.next=4,r.analytics.rules().retrieve();case 4:c=e.sent;case 5:a=c,i=Array.isArray(a)?a:(null===a||void 0===a?void 0:a.rules)||[],0===(t.ruleTagFilter||"").trim().length&&(t.hasAnyRuleWithTag=i.some((function(t){return(t.rule_tag||"").length>0}))),o=i,t.isV30&&(t.ruleTagFilter||"").trim().length>0&&(o=i.filter((function(e){return(e.rule_tag||"")===t.ruleTagFilter.trim()}))),t.analyticsRules=o,t.lastAnalyticsRulesFetchTimestamp=Date.now(),e.next=7;break;case 6:e.prev=6,l=e.catch(1),console.error(l),t.successMessage=null,t.errorMessage=l;case 7:return e.prev=7,s().done(),e.finish(7);case 8:case"end":return e.stop()}}),e,null,[[1,6,7,8]])}
2)))()},applyRuleTagFilter:function(){this.fetchAnalyticsRules()},clearRuleTagFilter:function(){this.ruleTagFilter="",this.fetchAnalyticsRules()},handleAnalyticsRuleUpserted:function(t){var e=this;return cr(sr().mark((function r(){return sr().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=1,e.fetchAnalyticsRules();case 1:e.$nextTick((function(){var r=e.$refs.analyticsRuleUpserts,n=(Array.isArray(r)?r:r?[r]:[]).find((function(e){return e&&e.analyticsRule&&e.analyticsRule.name===t.name}));n&&(n.openPane(),setTimeout((function(){n.$el.scrollIntoView({behavior:"smooth"})}),750))})),e.$route.query.addNewAnalyticsRule&&(e.$router.replace({query:null}),e.prepopulatedNewAnalyticsRule={});case 2:case"end":return r.stop()}}),r)})))()},handleAnalyticsRuleDeleted:function(t){var e=this;return cr(sr().mark((function t(){return sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,e.fetchAnalyticsRules();case 1:case"end":return t.stop()}}),t)})))()}}},ur=lr,dr=(0,c.A)(ur,(function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"row no-gutters",class:t.$options.name},[e("div",{staticClass:"col-sm"},[e("h2",{staticClass:"mb-4 h3"},[t._v("Analytics Rules")]),t._v(" "),e("div",{staticClass:"row"},[e("p",{staticClass:"col-sm-8"},[t._v("\n          This section allows you to configure rules to capture search analytics.\n          "),e("a",{attrs:{href:t.docsUrl,target:"_blank"}},[t._v("Docs >")])])]),t._v(" "),t.showRuleTagFilter?e("div",{staticClass:"row mt-2"},[e("div",{staticClass:"col-sm-6"},[e("label",{attrs:{for:"analyticsRuleTagFilter"}},[t._v("Filter by Rule Tag (optional)")]),t._v(" "),e("div",{staticClass:"input-group input-group-sm"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.ruleTagFilter,expression:"ruleTagFilter"}],staticClass:"form-control form-control-sm",attrs:{id:"analyticsRuleTagFilter",type:"text",placeholder:"Eg: homepage"},domProps:{value:t.ruleTagFilter},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.applyRuleTagFilter.apply(null,arguments)},input:function(e){e.target.composing||(t.ruleTagFilter=e.target.value)}}}),t._v(" "),e("div",{staticClass:"input-group-append"},[e("button",{staticClass:"btn btn-outline-primary btn-sm",on:{click:function(e){return e.preventDefault(),t.applyRuleTagFilter.apply(null,arguments)}}},[t._v("\n                Filter\n              ")]),t._v(" "),e("button",{staticClass:"btn btn-outline-primary btn-sm",attrs:{disabled:!t.ruleTagFilter},on:{click:function(e){return e.preventDefault(),t.clearRuleTagFilter.apply(null,arguments)}}},[t._v("\n                Clear\n              ")])])])])]):t._e(),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.errorMessage,expression:"errorMessage"}],staticClass:"mt-4 alert alert-warning",attrs:{role:"alert"}},[t._v("\n        "+t._s(t.errorMessage)+"\n      ")]),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.successMessage,expression:"successMessage"}],staticClass:"mt-4 alert alert-success",attrs:{role:"alert"}},[t._v("\n        "+t._s(t.successMessage)+"\n      ")]),t._v(" "),e("div",{staticClass:"accordion mt-4",attrs:{id:"analyticsRulesAccordion"}},[t._l(t.analyticsRules,(function(r){return e("div",{key:"analyticsRule-".concat(r.name,"-").concat(t.lastAnalyticsRulesFetchTimestamp)},[e("AnalyticsRuleUpsert",{ref:"analyticsRuleUpserts",refInFor:!0,attrs:{"analytics-rule":r},on:{"analyticsRule-delete":t.handleAnalyticsRuleDeleted,"analyticsRule-update":t.handleAnalyticsRuleUpserted}})],1)})),t._v(" "),e("AnalyticsRuleUpsert",{ref:"addNewAnalyticsRule",attrs:{"analytics-rule":t.prepopulatedNewAnalyticsRule},on:{"analyticsRule-create":t.handleAnalyticsRuleUpserted}})],2)])])])}),[],!1,null,"5eed4ae9",null),hr=dr.exports,fr=r(29537),pr=r(29111),mr=r(55075),vr=r(90943),yr=r(83858),gr=r(91384),_r=r(88842),br=r(56520),wr=r(45100),Cr=r(45658),Sr=function(t,e){var r=t.replace(/^\/clusters\/[^/]+\/?/,"/clusters/__reference_id__"),n=e.matched[e.matched.length-1];return(r+(n&&"*"!==n.path?n.path.replace(/:([A-Za-z0-9_]+)\??/g,"__$1__"):"/__unrecognized__")).replace(/\/$/,"")||"/"};n.default.use(a.Ay);
2var xr=function(t){var e=new a.Ay({mode:"history",base:t,scrollBehavior:function(t,e,r){return t.hash?{selector:t.hash}:r||{x:0,y:0}},routes:[{name:"clusterOverview",path:"/",component:Z},{name:"clusterConfiguration",path:"/cluster-configuration",component:tt.A},{name:"collectionNew",path:"/collections/new",component:et.A},{name:"collectionSchema",path:"/collections/:collectionName/schema",redirect:{name:"collectionSettings"}},{name:"collectionSettings",path:"/collections/:collectionName/collection-settings",component:rt.A},{name:"collectionDelete",path:"/collections/:collectionName/delete",component:nt.A},{name:"collectionDocumentsAdd",path:"/collections/:collectionName/documents/add",component:at.A},{name:"collectionDocumentsExport",path:"/collections/:collectionName/documents/export",component:it.A},{name:"collectionDocumentsDelete",path:"/collections/:collectionName/documents/delete",component:Ae.A},{name:"collectionDocumentsSearch",path:"/collections/:collectionName/documents/search",component:he},{name:"collectionSynonyms",path:"/collections/:collectionName/synonyms",component:fe.A},{name:"collectionCuration",path:"/collections/:collectionName/curation",component:Se},{name:"curationSets",path:"/curation-sets",component:vr.A},{name:"curationSetNew",path:"/curation-sets/new",component:yr.A},{name:"curationSetEdit",path:"/curation-sets/:setName",component:yr.A},{name:"collections",path:"/collections",component:fr.A},{name:"synonymSets",path:"/synonym-sets",component:pr.A},{name:"synonymSetNew",path:"/synonym-sets/new",component:mr.A},{name:"synonymSetEdit",path:"/synonym-sets/:setName",component:mr.A},{name:"aliases",path:"/aliases",component:xe.A},{name:"apiKeys",path:"/api-keys",component:Re.A},{name:"mcpServer",path:"/mcp-server",component:Ne.A},{name:"presets",path:"/presets",component:Je},{name:"analytics-rules",path:"/analytics/rules",component:hr},{name:"stopwords",path:"/stopwords",component:gr.A},{name:"stemmingDictionaryNew",path:"/stemming-dictionaries/new",component:br.A},{name:"stemmingDictionaryEdit",path:"/stemming-dictionaries/:dictionaryId",component:br.A},{name:"stemmingDictionaries",path:"/stemming-dictionaries",component:_r.A},{name:"conversationModels",path:"/conversation-models",component:wr.A},{name:"naturalLanguageModels",path:"/natural-language-models",component:Cr.A},{name:"notFound",path:"*",component:ke.A}]});return document.documentElement.setAttribute("data-vue-route",t),window.isVueRoute=function(r){var n=r.replace(t,""),a=e.getMatchedComponents({path:n})[0];return!!a&&a!==ke.A},e.afterEach((function(t,r){e.getMatchedComponents(t).length&&e.app.$forceUpdate()})),e.afterEach((function(e){return function(t,e){var r,n;window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"app_page_view",page_path_template:Sr(t,e),page_title_template:(r="ga-page-title-template",n=document.querySelector('meta[name="'.concat(r,'"]')),n?n.getAttribute("content"):null)})}(t,e)})),e}}}]);
3//# sourceMappingURL=999-355cfe6255a990c3170b.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.