graphdb-workbench 3.0.2-TR1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{18.b09e14d8a204a28fb95b.bundle.js → 18.b2d04af2d60cc37a5ebe.bundle.js} +1 -1
- package/dist/{190.431c135250df34322375.bundle.js → 190.4969eb91b83aaa7cd263.bundle.js} +1 -1
- package/dist/231.909faa919088245e9988.bundle.js +1 -1
- package/dist/{29.1f79f4caa66f63bd6611.bundle.js → 29.5ec5948f2e30819e6dc8.bundle.js} +1 -1
- package/dist/{30.2125e28509307f3a225f.bundle.js → 30.a60e3c2ac0de3b37e185.bundle.js} +1 -1
- package/dist/31.7452fe0f096c31a9a1f1.bundle.js +2 -0
- package/dist/{38.79bf8cac11760d2e69be.bundle.js → 38.8819c36a5204129f3dbc.bundle.js} +1 -1
- package/dist/{41.0d8779a7af2eb26cf157.bundle.js → 41.c6545eb0ce13e63738d2.bundle.js} +1 -1
- package/dist/410.b74d59055b7cf830abe5.bundle.js +1 -1
- package/dist/416.68f6286f80654cdbe4e4.bundle.js +1 -1
- package/dist/417.70adf0a6f0571c394764.bundle.js +1 -1
- package/dist/42.baaa159c3b1e81422600.bundle.js +1 -1
- package/dist/423.6edb13ec0cf08388c947.bundle.js +1 -1
- package/dist/424.725b821051516e73783a.bundle.js +1 -1
- package/dist/425.03fcf969da1a4e92fec3.bundle.js +1 -1
- package/dist/426.aa6924f6f1192d037009.bundle.js +1 -1
- package/dist/427.5c7b72141707b841e8a3.bundle.js +1 -1
- package/dist/428.0d471ce7c68654947c04.bundle.js +1 -1
- package/dist/{44.45a26f697588279fbc60.bundle.js → 44.ec337831549cfeaab224.bundle.js} +1 -1
- package/dist/443.969280af4067a22d1a8b.bundle.js +1 -1
- package/dist/444.a5971579184b091ed392.bundle.js +1 -1
- package/dist/445.2b20cb9e68a11879f6c4.bundle.js +1 -1
- package/dist/446.fe3cf3d6e288c8c4444b.bundle.js +1 -1
- package/dist/447.d1d078921f6f28e2fa38.bundle.js +1 -1
- package/dist/448.d6c9bed6d99b8b23619f.bundle.js +1 -1
- package/dist/468.8e259940c62a68ef3055.bundle.js +1 -1
- package/dist/{48.ba4cec793ef54b1611e5.bundle.js → 48.8726b8de8055297cec7c.bundle.js} +1 -1
- package/dist/480.379bf3b338e0a3224a1f.bundle.js +1 -1
- package/dist/481.0387239b174f787e70ea.bundle.js +1 -1
- package/dist/483.c81275cb05dd78ce389f.bundle.js +1 -1
- package/dist/484.25a82c267c3a705d2a65.bundle.js +1 -1
- package/dist/485.91cbfbfd37eccde375c9.bundle.js +1 -1
- package/dist/488.a69dcce23066c0dafdf7.bundle.js +1 -1
- package/dist/489.a976085b601cccf438d4.bundle.js +1 -1
- package/dist/49.ec8921fc54aaae50ca52.bundle.js +1 -1
- package/dist/490.d3e0f3e499b5a24f6808.bundle.js +1 -1
- package/dist/491.62c185868f9d99dd5713.bundle.js +1 -1
- package/dist/50.4886e820614f9dadb147.bundle.js +1 -0
- package/dist/{54.c54ba6791e3926ebb553.bundle.js → 54.f1ed20f259011ef082b2.bundle.js} +1 -1
- package/dist/76.fc1058890354a7ee6abe.bundle.js +1 -1
- package/dist/{bundle.6c88507cb6367ac80d16.bundle.js → bundle.fc37b3e514d7594f55be.bundle.js} +3 -3
- package/dist/css/rdf-class-hierarchy.css +1 -1
- package/dist/index.html +3 -3
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +2 -2
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +2 -2
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/license-checker.json +2 -2
- package/dist/pages/aclmanagement.html +2 -2
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +9 -11
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +12 -12
- package/package.json +1 -1
- package/dist/31.e0747ab3d38bd6efa832.bundle.js +0 -2
- package/dist/50.ee3ed147b2bc2382a0a2.bundle.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[18,55,82,97,297,305,317,318,319,320,323,388],{104:function(e,t,i){"use strict";i.r(t),i.d(t,"RenderingMode",(function(){return r}));var r={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},106:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityIndexType",(function(){return r}));var r={TEXT:"text",TEXT_LITERAL:"textLiteral",PREDICATION:"predication",isTextType:function(e){return r.TEXT===e},isTextLiteralType:function(e){return r.TEXT_LITERAL===e},isPredicationType:function(e){return r.PREDICATION===e}}},107:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityIndexStatus",(function(){return r}));var r={CREATING:"CREATING",BUILDING:"BUILDING",BUILT:"BUILT",REBUILDING:"REBUILDING",OUTDATED:"OUTDATED",INTERRUPTED:"INTERRUPTED",OBSOLETE:"OBSOLETE",FAILED:"FAILED",isCreatingStatus:function(e){return r.CREATING===e},isBuildingStatus:function(e){return r.BUILDING===e},isBuiltStatus:function(e){return r.BUILT===e},isRebuildingStatus:function(e){return r.REBUILDING===e},isOutdatedStatus:function(e){return r.OUTDATED===e},isInterruptedStatus:function(e){return r.INTERRUPTED===e},isObsoleteStatus:function(e){return r.OBSOLETE===e},isFailedStatus:function(e){return r.FAILED===e}}},110:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityIndex",(function(){return s}));var r=i(106),n=i(107);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var s=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.analyzer="",this.infer=!0,this.options="",this.sameAs=!0,this.searchQuery="",this.selectQuery="",this.stopList=void 0,this.name="",this.type=r.SimilarityIndexType.TEXT,this.status=void 0,this.analogicalQuery=void 0,this.inputIndex=void 0,this.isLiteralIndex=""},(t=[{key:"isTextType",value:function(){return r.SimilarityIndexType.isTextType(this.type)}},{key:"isTextLiteralType",value:function(){return r.SimilarityIndexType.isTextLiteralType(this.type)}},{key:"isPredicationType",value:function(){return r.SimilarityIndexType.isPredicationType(this.type)}},{key:"isCreatingStatus",value:function(){return n.SimilarityIndexStatus.isCreatingStatus(this.status)}},{key:"isBuildingStatus",value:function(){return n.SimilarityIndexStatus.isBuildingStatus(this.status)}},{key:"isBuiltStatus",value:function(){return n.SimilarityIndexStatus.isBuiltStatus(this.status)}},{key:"isRebuildingStatus",value:function(){return n.SimilarityIndexStatus.isRebuildingStatus(this.status)}},{key:"isOutdatedStatus",value:function(){return n.SimilarityIndexStatus.isOutdatedStatus(this.status)}},{key:"isInterruptedStatus",value:function(){return n.SimilarityIndexStatus.isInterruptedStatus(this.status)}},{key:"isObsoleteStatus",value:function(){return n.SimilarityIndexStatus.isObsoleteStatus(this.status)}},{key:"isFailedStatus",value:function(){return n.SimilarityIndexStatus.isFailedStatus(this.status)}}])&&o(e.prototype,t),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}()},115:function(e,t,i){"use strict";i.r(t),i.d(t,"YasqeMode",(function(){return r}));var r={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},117:function(e,t,i){"use strict";i.r(t),i.d(t,"mapIndexesResponseToSimilarityIndex",(function(){return n}));var r=i(110),n=function(e){return e.map((function(e){var t=new r.SimilarityIndex;return t.type=e.type,t.stopList=e.stopList,t.status=e.status,t.selectQuery=e.selectQuery,t.searchQuery=e.searchQuery,t.sameAs=e.sameAs,t.options=e.options,t.name=e.name,t.infer=e.infer,t.analyzer=e.analyzer,t.analogicalQuery=e.analogicalQuery,t}))}},118:function(e,t){function i(e,t){return{showToastMessageWithDelay:function(i){return new Promise((function(r){e.success(t.instant(i)),setTimeout(r,300)}))}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",i),i.$inject=["toastr","$translate"]},189:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityQueryType",(function(){return r}));var r={DATA:"DATA",SEARCH:"SEARCH",ANALOGICAL:"ANALOGICAL"}},354:function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t,i){return t=d(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,y()?Reflect.construct(t,i||[],d(e).constructor):t.apply(e,i))}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return l(e,arguments,d(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),c(i,e)})(e)}function l(e,t,i){if(y())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var n=new(e.bind.apply(e,r));return i&&c(n,i.prototype),n}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}i.r(t),i.d(t,"SimilarityIndexError",(function(){return f}));var f=function(e){function t(){return o(this,t),u(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),i=t,r&&n(i.prototype,r),a&&n(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r,a}(s(Error))},355:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityIndexInfo",(function(){return y}));var r=i(110),n=i(189),a=i(104);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var l=new RegExp("^[a-zA-Z0-9-_]+$"),y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.similarityIndex=new r.SimilarityIndex,this.isNameExist=!1,this.invalidSelectQueryType=!1,this.invalidSelectQuery=!1,this.invalidSearchQueryType=!1,this.invalidSearchQuery=!1,this.invalidAnalogicalQueryType=!1,this.invalidAnalogicalQuery=!1,this.selectedQueryType=n.SimilarityQueryType.DATA,this.selectedYasguiRenderMode=a.RenderingMode.YASQE},(t=[{key:"setQuery",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=t||this.selectedQueryType;n.SimilarityQueryType.DATA!==i?n.SimilarityQueryType.SEARCH!==i?n.SimilarityQueryType.ANALOGICAL===i&&(this.similarityIndex.analogicalQuery=e):this.similarityIndex.searchQuery=e:this.similarityIndex.selectQuery=e}},{key:"getQuery",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=e||this.selectedQueryType;switch(t){case n.SimilarityQueryType.DATA:return this.similarityIndex.selectQuery;case n.SimilarityQueryType.SEARCH:return this.similarityIndex.searchQuery;case n.SimilarityQueryType.ANALOGICAL:return this.similarityIndex.analogicalQuery}}},{key:"markInvalidQuery",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e||this.selectedQueryType;n.SimilarityQueryType.DATA!==i?n.SimilarityQueryType.SEARCH!==i?n.SimilarityQueryType.ANALOGICAL===i&&(this.invalidAnalogicalQuery=t):this.invalidSearchQuery=t:this.invalidSelectQuery=t}},{key:"markInvalidQueryType",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e||this.selectedQueryType;n.SimilarityQueryType.DATA!==i?n.SimilarityQueryType.SEARCH!==i?n.SimilarityQueryType.ANALOGICAL===i&&(this.invalidAnalogicalQueryType=t):this.invalidSearchQueryType=t:this.invalidSelectQueryType=t}},{key:"setSelectedQueryType",value:function(e){this.selectedQueryType=e}},{key:"getSelectedQueryType",value:function(){return this.selectedQueryType}},{key:"setSelectedYasguiRenderMode",value:function(e){this.selectedYasguiRenderMode=e}},{key:"getSelectedYasguiRenderMode",value:function(){return this.selectedYasguiRenderMode}},{key:"isDataQueryTypeSelected",value:function(){return n.SimilarityQueryType.DATA===this.selectedQueryType}},{key:"isSearchQueryTypeSelected",value:function(){return n.SimilarityQueryType.SEARCH===this.selectedQueryType}},{key:"isAnalogicalQueryTypeSelected",value:function(){return n.SimilarityQueryType.ANALOGICAL===this.selectedQueryType}},{key:"isTextType",value:function(){return this.similarityIndex.isTextType()}},{key:"isPredicationType",value:function(){return this.similarityIndex.isPredicationType()}},{key:"isTextLiteralType",value:function(){return this.similarityIndex.isTextLiteralType()}},{key:"hasName",value:function(){return!!this.similarityIndex.name}},{key:"isNameValid",value:function(){return l.test(this.similarityIndex.name)}},{key:"hasSelectQuery",value:function(){return!!this.similarityIndex.selectQuery}},{key:"hasSearchQuery",value:function(){return!!this.similarityIndex.searchQuery}},{key:"hasAnalogicalQuery",value:function(){return!!this.similarityIndex.analogicalQuery}},{key:"isYasqeRenderMode",value:function(){return a.RenderingMode.YASQE===this.getSelectedYasguiRenderMode()}},{key:"isYasrRenderMode",value:function(){return a.RenderingMode.YASR===this.getSelectedYasguiRenderMode()}},{key:"getName",value:function(){return this.similarityIndex.name}},{key:"setName",value:function(e){this.similarityIndex.name=e}},{key:"setInputIndex",value:function(e){this.similarityIndex.inputIndex=e}},{key:"getInputIndex",value:function(){return this.similarityIndex.inputIndex}},{key:"setLiteralIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.similarityIndex.isLiteralIndex=e}},{key:"getSimilarityIndex",value:function(){return this.similarityIndex}},{key:"setStopList",value:function(e){this.similarityIndex.stopList=e}},{key:"getStopList",value:function(){return this.similarityIndex.stopList}},{key:"setAnalyzer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"org.apache.lucene.analysis.en.EnglishAnalyzer";this.similarityIndex.analyzer=e}},{key:"getAnalyzer",value:function(){return this.similarityIndex.analyzer}},{key:"setType",value:function(e){this.similarityIndex.type=e}},{key:"getType",value:function(){return this.similarityIndex.type}},{key:"setOptions",value:function(e){this.similarityIndex.options=e}},{key:"getOptions",value:function(){return this.similarityIndex.options}},{key:"getInference",value:function(){return this.similarityIndex.infer}},{key:"getSameAs",value:function(){return this.similarityIndex.sameAs}}])&&u(e.prototype,t),i&&u(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}()},356:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityViewMode",(function(){return r}));var r={CREATE:"CREATE",EDIT:"EDIT",CLONE:"CLONE"}},381:function(e,t,i){"use strict";i.r(t);i(118),i(15),i(30);var r=i(117),n=i(27),a=i(104),o=i(115),u=i(356),s=i(189),l=i(106),y=i(354),c=i(170),d=i(355);function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,n,a,o,u=[],s=!0,l=!1;try{if(a=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;s=!1}else for(;!(s=(r=a.call(i)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){l=!0,n=e}finally{try{if(!s&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(l)throw n}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?p(e,t):void 0}}(e,t)||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 p(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function I(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function S(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?I(Object(i),!0).forEach((function(t){v(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function v(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=f(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==f(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e,t,i,f,p,I,v,h,T,g,x,Q,E,A,b,w){e.productInfo=h,e.SimilarityQueryType=s.SimilarityQueryType,e.SimilarityIndexType=l.SimilarityIndexType,e.similarityIndexInfo=void 0,e.samples=void 0,e.yasguiConfig=void 0,e.saveOrUpdateExecuted=!1,e.loadingControllerResources=!1,e.helpHidden=1===x.get(Q.HIDE_SIMILARITY_HELP),e.savingIndex=!1;var R=!1,O=void 0,L=void 0,P=void 0,C=u.SimilarityViewMode.CREATE;e.changeSimilarityIndexType=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.SimilarityQueryType.DATA;e.similarityIndexInfo.setType(t),e.similarityIndexInfo.isPredicationType()?e.samples=L[l.SimilarityIndexType.PREDICATION]:e.samples=L[l.SimilarityIndexType.TEXT],e.changeQueryTab(i).then((function(t){k(e.similarityIndexInfo),e.setEditorQuery(e.similarityIndexInfo.getQuery())}))},e.changeQueryTab=function(t){var i=e.similarityIndexInfo.getSelectedQueryType();return i===t?Promise.resolve():(e.similarityIndexInfo.setSelectedQueryType(t),D(e.similarityIndexInfo,i).then((function(e){return ee(e,i)})).then((function(e){return Z(e,i)})).catch((function(e){e instanceof y.SimilarityIndexError||console.log(e)})).finally((function(){var t=V();e.similarityIndexInfo.setSelectedYasguiRenderMode(a.RenderingMode.YASQE),t.changeRenderMode(e.similarityIndexInfo.getSelectedYasguiRenderMode()),e.similarityIndexInfo.isDataQueryTypeSelected()?t.showYasqeActionButton([n.YasqeButtonName.INFER_STATEMENTS,n.YasqeButtonName.EXPANDS_RESULTS]):t.hideYasqeActionButton([n.YasqeButtonName.INFER_STATEMENTS,n.YasqeButtonName.EXPANDS_RESULTS]),t.setQuery(e.similarityIndexInfo.getQuery())})))},e.createSimilarityIndex=function(){e.saveOrUpdateExecuted=!0,e.savingIndex=!0,D(e.similarityIndexInfo).then(ee).then(Z).then($).then(F).then((function(e){return _(e.getSimilarityIndex())})).then((function(){return U()})).catch((function(e){e instanceof y.SimilarityIndexError||t.error(getError(e),E.instant("similarity.could.not.get.indexes.error"))})).finally((function(){e.savingIndex=!1}))},e.viewQuery=function(){D(e.similarityIndexInfo).then($).then(M).then(N).catch((function(e){return t.error(getError(e))}))},e.preview=function(){D(e.similarityIndexInfo).then(Z).then(ee).then((function(){var t=V();e.similarityIndexInfo.setSelectedYasguiRenderMode(a.RenderingMode.YASR),t.query(e.similarityIndexInfo.getSelectedYasguiRenderMode())}))},e.saveSearchQuery=function(){R?(e.saveOrUpdateExecuted=!0,e.savingIndex=!0,D(e.similarityIndexInfo).then(W).then(ee).then(Z).then(J).then(K).then(B).then((function(e){return T.showToastMessageWithDelay(e?"similarity.changed.search.query.msg":"similarity.changed.analogical.query.msg")})).then((function(){v.url("similarity")})).catch((function(e){e instanceof y.SimilarityIndexError||t.error(getError(e),E.instant("similarity.change.query.error"))})).finally((function(){e.savingIndex=!1}))):v.url("similarity")},e.setEditorQuery=function(t){e.similarityIndexInfo.markInvalidQuery(void 0,!1),e.similarityIndexInfo.markInvalidQueryType(void 0,!1),e.yasguiConfig?V().setQuery(t):Y({initialQuery:t||" "})},e.similarityIndexNameChanged=function(){e.setDirty(),e.similarityIndexInfo.isNameExist=!1},e.queryChanged=function(){e.setDirty(),e.similarityIndexInfo.markInvalidQuery(void 0,!1),e.similarityIndexInfo.markInvalidQueryType(void 0,!1)},e.isCloneViewMode=function(){return u.SimilarityViewMode.CLONE===C},e.isEditViewMode=function(){return u.SimilarityViewMode.EDIT===C},e.isCreateViewMode=function(){return u.SimilarityViewMode.CREATE===C},e.setDirty=function(){R=!0},e.isYasqeShown=function(){return e.similarityIndexInfo&&e.similarityIndexInfo.isYasqeRenderMode()},e.isYasrShown=function(){return e.similarityIndexInfo&&e.similarityIndexInfo.isYasrRenderMode()},e.showEditor=function(){var t=V();t.abortQuery().then((function(){return t.setQuery(e.similarityIndexInfo.getQuery())})).then((function(){return e.similarityIndexInfo.setSelectedYasguiRenderMode(a.RenderingMode.YASQE),t.changeRenderMode(e.similarityIndexInfo.getSelectedYasguiRenderMode())}))},e.toggleHelp=function(t){void 0===t&&(t=x.get(Q.HIDE_SIMILARITY_HELP)),1!==t?(x.set(Q.HIDE_SIMILARITY_HELP,1),e.helpHidden=!0):(x.set(Q.HIDE_SIMILARITY_HELP,0),e.helpHidden=!1)},e.getCloseBtnMsg=function(){var t=e.editSearchQuery?E.instant("similarity.query.edition.msg"):E.instant("similarity.index.creation.msg");return E.instant("similarity.close.btn.msg",{operation:t})},e.hasQueryError=function(){var t=e.similarityIndexInfo.getSelectedQueryType();return s.SimilarityQueryType.DATA===t?e.hasSelectQueryError():s.SimilarityQueryType.SEARCH===t?e.hasSearchQueryError():s.SimilarityQueryType.ANALOGICAL===t&&e.hasAnalogicalQueryError()},e.hasSelectQueryError=function(){return!e.similarityIndexInfo.hasSelectQuery()||e.similarityIndexInfo.invalidSelectQuery||e.similarityIndexInfo.invalidSelectQueryType},e.hasSearchQueryError=function(){return!e.similarityIndexInfo.hasSearchQuery()||e.similarityIndexInfo.invalidSearchQuery||e.similarityIndexInfo.invalidSearchQueryType},e.hasAnalogicalQueryError=function(){return!e.similarityIndexInfo.hasAnalogicalQuery()||e.similarityIndexInfo.invalidAnalogicalQuery||e.similarityIndexInfo.invalidAnalogicalQueryType},e.getQueryErrorMessage=function(){var t=e.similarityIndexInfo.getSelectedQueryType(),i=!1,r=!1,n=!1;s.SimilarityQueryType.DATA===t?(i=!e.similarityIndexInfo.hasSelectQuery(),r=e.similarityIndexInfo.invalidSelectQueryType,n=e.similarityIndexInfo.invalidSelectQuery):s.SimilarityQueryType.SEARCH===t?(i=!e.similarityIndexInfo.hasSearchQuery(),r=e.similarityIndexInfo.invalidSearchQueryType,n=e.similarityIndexInfo.invalidSearchQuery):s.SimilarityQueryType.ANALOGICAL===t&&(i=!e.similarityIndexInfo.hasAnalogicalQuery(),r=e.similarityIndexInfo.invalidAnalogicalQueryType,n=e.similarityIndexInfo.invalidAnalogicalQuery);var a={queryType:E.instant("similarity.query.type.".concat(t,".name"))};return i?E.instant("similarity.error.query.empty",a):n?E.instant("similarity.error.query.invalid",a):r?E.instant("similarity.error.query.invalid_type",a):""};var D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return V().getQuery().then((function(i){return e.setQuery(i,t)})).then((function(){return e}))},M=function(e){return p.getQuery({indexName:e.getName(),indexOptions:e.getOptions(),query:e.getQuery(),indexStopList:e.getStopList(),queryInference:e.getInference(),querySameAs:e.getSameAs(),viewType:e.getSelectedQueryType(),indexAnalyzer:e.getAnalyzer()}).then((function(e){return e.data}))},N=function(e){e&&i.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){return e}}})},k=function(t){var i=t.getType();if(!e.isEditViewMode()&&O&&(t.setQuery(O[i],s.SimilarityQueryType.SEARCH),t.setQuery(O.analogical,s.SimilarityQueryType.ANALOGICAL)),L)if(l.SimilarityIndexType.PREDICATION===i){var r=L[l.SimilarityIndexType.PREDICATION].predication;t.setQuery(r,s.SimilarityQueryType.DATA)}else{var n=L[l.SimilarityIndexType.TEXT].literals;t.setQuery(n,s.SimilarityQueryType.DATA)}},j=function(){var i=new d.SimilarityIndexInfo;i.setName(H()),i.setType(G()),i.setSelectedQueryType(e.isEditViewMode()?s.SimilarityQueryType.SEARCH:s.SimilarityQueryType.DATA);var n=v.search().options;n?i.setOptions(n):i.setOptions(i.isTextType()?"-termweight idf":""),k(i);var a=v.search().searchQuery;a&&i.setQuery(a,s.SimilarityQueryType.SEARCH);var o=v.search().selectQuery;o&&i.setQuery(o,s.SimilarityQueryType.DATA);var u=v.search().analogicalQuery;if(u&&i.setQuery(u,s.SimilarityQueryType.ANALOGICAL),i.isTextType()){i.setStopList(v.search().stopList),i.setAnalyzer(v.search().analyzer);var l=z(i.getSimilarityIndex(),"-literal_index");void 0!==l&&i.setLiteralIndex(l)}return i.isPredicationType()?p.getIndexes().then((function(t){var n=Object(r.mapIndexesResponseToSimilarityIndex)(t.data).filter((function(e){return e.isTextLiteralType()&&(e.isBuiltStatus()||e.isOutdatedStatus())})).map((function(e){return e.name}));if(e.literalIndexes=["no-index"].concat(n),void 0===i.getInputIndex()){var a=z(i.getSimilarityIndex(),"-input_index");if(void 0!==a)for(var o=0;o<e.literalIndexes.length;o++)a===e.literalIndexes[o]&&i.setInputIndex(e.literalIndexes[o])}return void 0===i.getInputIndex()&&i.setInputIndex(e.literalIndexes[0]),i})).catch((function(e){var i=getError(e);t.error(i,E.instant("similarity.could.not.get.indexes.error"))})):Promise.resolve(i)},Y=function(t){var i={endpoint:q,componentId:"create-index",showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,showQueryButton:!1,downloadAsOn:!1,showResultInfo:!1,showYasqeResizer:!1,pageSize:100,prefixes:P,render:e.similarityIndexInfo.getSelectedYasguiRenderMode(),yasqeActionButtons:e.isEditViewMode()||!e.similarityIndexInfo.isDataQueryTypeSelected()?n.DISABLE_YASQE_BUTTONS_CONFIGURATION:n.INFERRED_AND_SAME_AS_BUTTONS_CONFIGURATION,maxPersistentResponseSize:0,yasqeMode:e.canWriteActiveRepo()?o.YasqeMode.WRITE:o.YasqeMode.PROTECTED},r={};angular.extend(r,i,t),e.yasguiConfig=r},q=function(){return"repositories/".concat(A.getActiveRepository())},_=function(i){if(void 0!==e.literalIndexes){var r=i.inputIndex;r!==e.literalIndexes[0]&&(i.options=i.options+(""===i.options?"":" ")+"-input_index "+r)}return"true"===i.isLiteralIndex&&(i.options=i.options+(""===i.options?"":" ")+"-literal_index true",i.type=l.SimilarityIndexType.TEXT_LITERAL),R=!1,p.createIndex("POST",i.name,i.options,i.selectQuery,i.searchQuery,i.isPredicationType()?i.analogicalQuery:"",i.stopList,i.infer,i.sameAs,i.type,i.analyzer).then((function(){return t.success(E.instant("similarity.create.index.successfully")),i})).catch((function(e){var i=getError(e);return t.error(i,E.instant("similarity.create.index.error")),console.log(i),Promise.reject(new y.SimilarityIndexError("Could not create index."))}))},B=function(e){var t=e.isSearchQueryTypeSelected(),i={name:e.getSimilarityIndex().name,changedQuery:e.getQuery(),isSearchQuery:t};return p.saveSearchQuery(JSON.stringify(i)).then((function(){return R=!1,t}))},U=function(){setTimeout((function(){return v.url("similarity")}),100)},V=function(){return n.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor")},H=function(){var t=v.search().name||"";return e.isCloneViewMode()?"".concat(E.instant("similarity.copy_of.prefix"),"_").concat(t):t},G=function(){var e=v.search().type;return void 0===e||e.startsWith("text")?l.SimilarityIndexType.TEXT:e},z=function(e,t){for(var i=e.options.split(" "),r=0;r<i.length;r++)if(i[r]===t&&r+1<i.length){var n=i[r+1];return delete i[r],delete i[r+1],e.options=i.join(" "),n}},$=function(e){return Promise.all([W(e).then(X).then(J).then(K).then(Z).then(ee)]).then((function(){return e}))},F=function(e){return p.getIndexes().then((function(t){return t.data.some((function(t){return t.name===e.getName()}))?(e.isNameExist=!0,Promise.reject(new y.SimilarityIndexError("Similarity index name exists."))):e}))},W=function(e){return e.getSimilarityIndex().name?e.isNameValid()?Promise.resolve(e):Promise.reject(new y.SimilarityIndexError("Invalid similarity name.")):Promise.reject(new y.SimilarityIndexError("Missing similarity name."))},X=function(e){return e.hasSelectQuery()?e.invalidSelectQuery?Promise.reject(new y.SimilarityIndexError("Invalid select query")):e.invalidSelectQueryType?Promise.reject(new y.SimilarityIndexError("Invalid select query type")):Promise.resolve(e):Promise.reject(new y.SimilarityIndexError("Missing select query."))},J=function(e){return e.hasSearchQuery()?e.invalidSearchQuery?Promise.reject(new y.SimilarityIndexError("Invalid search query")):e.invalidSearchQueryType?Promise.reject(new y.SimilarityIndexError("Invalid search query type")):Promise.resolve(e):Promise.reject(new y.SimilarityIndexError("Missing search query."))},K=function(e){return e.isPredicationType()&&!e.hasAnalogicalQuery()?Promise.reject(new y.SimilarityIndexError("Missing analogical query.")):e.invalidAnalogicalQuery?Promise.reject(new y.SimilarityIndexError("Invalid analogical query")):e.invalidAnalogicalQueryType?Promise.reject(new y.SimilarityIndexError("Invalid analogical query type")):Promise.resolve(e)},Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return V().getQueryType().then((function(i){return c.QueryType.SELECT!==i?(e.markInvalidQueryType(t),Promise.reject(new y.SimilarityIndexError("Query type is not valid."))):(e.markInvalidQueryType(t,!1),e)}))},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return V().isQueryValid().then((function(i){return i?(e.markInvalidQuery(t,!1),e):(e.markInvalidQuery(t),Promise.reject(new y.SimilarityIndexError("Query is not valid.")))}))},te=function(e,t,i,r){w.openSimpleModal({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(i)&&i()}),(function(){angular.isFunction(r)&&r()}))},ie=function(){e.isYasrShown()&&e.similarityIndexInfo.isDataQueryTypeSelected()&&e.showEditor(),e.canEditActiveRepo=e.canWriteActiveRepo();var t=S(S({},e.yasguiConfig),{},{yasqeMode:e.canWriteActiveRepo()});Y(t)},re=function(e){R&&(e.returnValue=!0)},ne=function(){window.removeEventListener("beforeunload",re),ae.forEach((function(e){return e()}))},ae=[];ae.push(b.subscribe("repositoryWillChangeEvent",(function(t){return new Promise((function(i){if(e.isCreateViewMode()||e.isCloneViewMode())i(t);else{var r=function(){R=!1,U(),i(t)};if(R){var n=E.instant("common.confirm"),a=E.instant("similarity.warning.unsaved.changes");te(n,a,r,(function(){t.cancel=!0,i(t)}))}else r()}}))}))),ae.push(e.$on("$locationChangeStart",(function(e,t){if(R){e.preventDefault();var i=E.instant("common.confirm"),r=E.instant("similarity.warning.unsaved.changes");te(i,r,(function(){ne();var e=v.absUrl().length-v.url().length,i=t.substring(e);v.path(i)}))}else ne()}))),ae.push(e.$on("$destroy",ne)),window.addEventListener("beforeunload",re),C=function(){if(void 0===v.search().name)return u.SimilarityViewMode.CREATE;var e=v.search().editSearchQuery;return void 0===e?u.SimilarityViewMode.CLONE:"string"==typeof e?"false"===e?u.SimilarityViewMode.CLONE:u.SimilarityViewMode.EDIT:e?u.SimilarityViewMode.EDIT:u.SimilarityViewMode.CLONE}();var oe=e.$watch((function(){return e.getActiveRepositoryObject()}),(function(t){t&&(e.loadingControllerResources=!0,Promise.all([p.getSearchQueries(),p.getSamples(),A.getPrefixes(t.id)]).then((function(t){var i=m(t,3),r=i[0],n=i[1],a=i[2];e.canEditActiveRepo=e.canWriteActiveRepo(),O=r?r.data:[],L=n?n.data:[],P=a,j().then((function(t){e.similarityIndexInfo=t;var i=s.SimilarityQueryType.DATA;e.isEditViewMode()&&(i=s.SimilarityQueryType.SEARCH),e.changeSimilarityIndexType(t.getType(),i)}))})).catch((function(t){console.log(t),e.repositoryError=getError(t)})).finally((function(){ae.push(e.$on("repositoryIsSet",ie)),oe(),e.loadingControllerResources=!1})))}))}angular.module("graphdb.framework.similarity.controllers.create",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("CreateSimilarityIdxCtrl",h),h.$inject=["$scope","toastr","$uibModal","$timeout","SimilarityRestService","SparqlRestService","$location","productInfo","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate","$repositories","EventEmitterService","ModalService"]}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[18,55,82,97,297,305,317,318,319,320,323,388],{104:function(e,t,i){"use strict";i.r(t),i.d(t,"RenderingMode",(function(){return r}));var r={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},106:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityIndexType",(function(){return r}));var r={TEXT:"text",TEXT_LITERAL:"textLiteral",PREDICATION:"predication",isTextType:function(e){return r.TEXT===e},isTextLiteralType:function(e){return r.TEXT_LITERAL===e},isPredicationType:function(e){return r.PREDICATION===e}}},107:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityIndexStatus",(function(){return r}));var r={CREATING:"CREATING",BUILDING:"BUILDING",BUILT:"BUILT",REBUILDING:"REBUILDING",OUTDATED:"OUTDATED",INTERRUPTED:"INTERRUPTED",OBSOLETE:"OBSOLETE",FAILED:"FAILED",isCreatingStatus:function(e){return r.CREATING===e},isBuildingStatus:function(e){return r.BUILDING===e},isBuiltStatus:function(e){return r.BUILT===e},isRebuildingStatus:function(e){return r.REBUILDING===e},isOutdatedStatus:function(e){return r.OUTDATED===e},isInterruptedStatus:function(e){return r.INTERRUPTED===e},isObsoleteStatus:function(e){return r.OBSOLETE===e},isFailedStatus:function(e){return r.FAILED===e}}},110:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityIndex",(function(){return s}));var r=i(106),n=i(107);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}var s=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.analyzer="",this.infer=!0,this.options="",this.sameAs=!0,this.searchQuery="",this.selectQuery="",this.stopList=void 0,this.name="",this.type=r.SimilarityIndexType.TEXT,this.status=void 0,this.analogicalQuery=void 0,this.inputIndex=void 0,this.isLiteralIndex=""},(t=[{key:"isTextType",value:function(){return r.SimilarityIndexType.isTextType(this.type)}},{key:"isTextLiteralType",value:function(){return r.SimilarityIndexType.isTextLiteralType(this.type)}},{key:"isPredicationType",value:function(){return r.SimilarityIndexType.isPredicationType(this.type)}},{key:"isCreatingStatus",value:function(){return n.SimilarityIndexStatus.isCreatingStatus(this.status)}},{key:"isBuildingStatus",value:function(){return n.SimilarityIndexStatus.isBuildingStatus(this.status)}},{key:"isBuiltStatus",value:function(){return n.SimilarityIndexStatus.isBuiltStatus(this.status)}},{key:"isRebuildingStatus",value:function(){return n.SimilarityIndexStatus.isRebuildingStatus(this.status)}},{key:"isOutdatedStatus",value:function(){return n.SimilarityIndexStatus.isOutdatedStatus(this.status)}},{key:"isInterruptedStatus",value:function(){return n.SimilarityIndexStatus.isInterruptedStatus(this.status)}},{key:"isObsoleteStatus",value:function(){return n.SimilarityIndexStatus.isObsoleteStatus(this.status)}},{key:"isFailedStatus",value:function(){return n.SimilarityIndexStatus.isFailedStatus(this.status)}}])&&o(e.prototype,t),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}()},115:function(e,t,i){"use strict";i.r(t),i.d(t,"YasqeMode",(function(){return r}));var r={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},117:function(e,t,i){"use strict";i.r(t),i.d(t,"mapIndexesResponseToSimilarityIndex",(function(){return n}));var r=i(110),n=function(e){return e.map((function(e){var t=new r.SimilarityIndex;return t.type=e.type,t.stopList=e.stopList,t.status=e.status,t.selectQuery=e.selectQuery,t.searchQuery=e.searchQuery,t.sameAs=e.sameAs,t.options=e.options,t.name=e.name,t.infer=e.infer,t.analyzer=e.analyzer,t.analogicalQuery=e.analogicalQuery,t}))}},118:function(e,t){function i(e,t){return{showToastMessageWithDelay:function(i){return new Promise((function(r){e.success(t.instant(i)),setTimeout(r,300)}))}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",i),i.$inject=["toastr","$translate"]},189:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityQueryType",(function(){return r}));var r={DATA:"DATA",SEARCH:"SEARCH",ANALOGICAL:"ANALOGICAL"}},354:function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t,i){return t=d(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,y()?Reflect.construct(t,i||[],d(e).constructor):t.apply(e,i))}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return l(e,arguments,d(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),c(i,e)})(e)}function l(e,t,i){if(y())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var n=new(e.bind.apply(e,r));return i&&c(n,i.prototype),n}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}i.r(t),i.d(t,"SimilarityIndexError",(function(){return f}));var f=function(e){function t(){return o(this,t),u(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),i=t,r&&n(i.prototype,r),a&&n(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,r,a}(s(Error))},355:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityIndexInfo",(function(){return y}));var r=i(110),n=i(189),a=i(104);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var l=new RegExp("^[a-zA-Z0-9-_]+$"),y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.similarityIndex=new r.SimilarityIndex,this.isNameExist=!1,this.invalidSelectQueryType=!1,this.invalidSelectQuery=!1,this.invalidSearchQueryType=!1,this.invalidSearchQuery=!1,this.invalidAnalogicalQueryType=!1,this.invalidAnalogicalQuery=!1,this.selectedQueryType=n.SimilarityQueryType.DATA,this.selectedYasguiRenderMode=a.RenderingMode.YASQE},(t=[{key:"setQuery",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=t||this.selectedQueryType;n.SimilarityQueryType.DATA!==i?n.SimilarityQueryType.SEARCH!==i?n.SimilarityQueryType.ANALOGICAL===i&&(this.similarityIndex.analogicalQuery=e):this.similarityIndex.searchQuery=e:this.similarityIndex.selectQuery=e}},{key:"getQuery",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=e||this.selectedQueryType;switch(t){case n.SimilarityQueryType.DATA:return this.similarityIndex.selectQuery;case n.SimilarityQueryType.SEARCH:return this.similarityIndex.searchQuery;case n.SimilarityQueryType.ANALOGICAL:return this.similarityIndex.analogicalQuery}}},{key:"markInvalidQuery",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e||this.selectedQueryType;n.SimilarityQueryType.DATA!==i?n.SimilarityQueryType.SEARCH!==i?n.SimilarityQueryType.ANALOGICAL===i&&(this.invalidAnalogicalQuery=t):this.invalidSearchQuery=t:this.invalidSelectQuery=t}},{key:"markInvalidQueryType",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e||this.selectedQueryType;n.SimilarityQueryType.DATA!==i?n.SimilarityQueryType.SEARCH!==i?n.SimilarityQueryType.ANALOGICAL===i&&(this.invalidAnalogicalQueryType=t):this.invalidSearchQueryType=t:this.invalidSelectQueryType=t}},{key:"setSelectedQueryType",value:function(e){this.selectedQueryType=e}},{key:"getSelectedQueryType",value:function(){return this.selectedQueryType}},{key:"setSelectedYasguiRenderMode",value:function(e){this.selectedYasguiRenderMode=e}},{key:"getSelectedYasguiRenderMode",value:function(){return this.selectedYasguiRenderMode}},{key:"isDataQueryTypeSelected",value:function(){return n.SimilarityQueryType.DATA===this.selectedQueryType}},{key:"isSearchQueryTypeSelected",value:function(){return n.SimilarityQueryType.SEARCH===this.selectedQueryType}},{key:"isAnalogicalQueryTypeSelected",value:function(){return n.SimilarityQueryType.ANALOGICAL===this.selectedQueryType}},{key:"isTextType",value:function(){return this.similarityIndex.isTextType()}},{key:"isPredicationType",value:function(){return this.similarityIndex.isPredicationType()}},{key:"isTextLiteralType",value:function(){return this.similarityIndex.isTextLiteralType()}},{key:"hasName",value:function(){return!!this.similarityIndex.name}},{key:"isNameValid",value:function(){return l.test(this.similarityIndex.name)}},{key:"hasSelectQuery",value:function(){return!!this.similarityIndex.selectQuery}},{key:"hasSearchQuery",value:function(){return!!this.similarityIndex.searchQuery}},{key:"hasAnalogicalQuery",value:function(){return!!this.similarityIndex.analogicalQuery}},{key:"isYasqeRenderMode",value:function(){return a.RenderingMode.YASQE===this.getSelectedYasguiRenderMode()}},{key:"isYasrRenderMode",value:function(){return a.RenderingMode.YASR===this.getSelectedYasguiRenderMode()}},{key:"getName",value:function(){return this.similarityIndex.name}},{key:"setName",value:function(e){this.similarityIndex.name=e}},{key:"setInputIndex",value:function(e){this.similarityIndex.inputIndex=e}},{key:"getInputIndex",value:function(){return this.similarityIndex.inputIndex}},{key:"setLiteralIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.similarityIndex.isLiteralIndex=e}},{key:"getSimilarityIndex",value:function(){return this.similarityIndex}},{key:"setStopList",value:function(e){this.similarityIndex.stopList=e}},{key:"getStopList",value:function(){return this.similarityIndex.stopList}},{key:"setAnalyzer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"org.apache.lucene.analysis.en.EnglishAnalyzer";this.similarityIndex.analyzer=e}},{key:"getAnalyzer",value:function(){return this.similarityIndex.analyzer}},{key:"setType",value:function(e){this.similarityIndex.type=e}},{key:"getType",value:function(){return this.similarityIndex.type}},{key:"setOptions",value:function(e){this.similarityIndex.options=e}},{key:"getOptions",value:function(){return this.similarityIndex.options}},{key:"getInference",value:function(){return this.similarityIndex.infer}},{key:"getSameAs",value:function(){return this.similarityIndex.sameAs}}])&&u(e.prototype,t),i&&u(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}()},356:function(e,t,i){"use strict";i.r(t),i.d(t,"SimilarityViewMode",(function(){return r}));var r={CREATE:"CREATE",EDIT:"EDIT",CLONE:"CLONE"}},381:function(e,t,i){"use strict";i.r(t);i(118),i(15),i(30);var r=i(117),n=i(27),a=i(104),o=i(115),u=i(356),s=i(189),l=i(106),y=i(354),c=i(170),d=i(355);function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,n,a,o,u=[],s=!0,l=!1;try{if(a=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;s=!1}else for(;!(s=(r=a.call(i)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){l=!0,n=e}finally{try{if(!s&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(l)throw n}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?p(e,t):void 0}}(e,t)||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 p(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function I(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function S(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?I(Object(i),!0).forEach((function(t){v(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):I(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function v(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=f(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==f(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h(e,t,i,f,p,I,v,h,T,g,x,Q,E,A,b,w){e.productInfo=h,e.SimilarityQueryType=s.SimilarityQueryType,e.SimilarityIndexType=l.SimilarityIndexType,e.similarityIndexInfo=void 0,e.samples=void 0,e.yasguiConfig=void 0,e.saveOrUpdateExecuted=!1,e.loadingControllerResources=!1,e.helpHidden=1===x.get(Q.HIDE_SIMILARITY_HELP),e.savingIndex=!1;var R=!1,O=void 0,L=void 0,P=void 0,C=u.SimilarityViewMode.CREATE;e.changeSimilarityIndexType=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.SimilarityQueryType.DATA;e.similarityIndexInfo.setType(t),e.similarityIndexInfo.isPredicationType()?e.samples=L[l.SimilarityIndexType.PREDICATION]:e.samples=L[l.SimilarityIndexType.TEXT],e.changeQueryTab(i).then((function(t){k(e.similarityIndexInfo),e.setEditorQuery(e.similarityIndexInfo.getQuery())}))},e.changeQueryTab=function(t){var i=e.similarityIndexInfo.getSelectedQueryType();return i===t?Promise.resolve():(e.similarityIndexInfo.setSelectedQueryType(t),D(e.similarityIndexInfo,i).then((function(e){return ee(e,i)})).then((function(e){return Z(e,i)})).catch((function(e){e instanceof y.SimilarityIndexError||console.log(e)})).finally((function(){var t=V();e.similarityIndexInfo.setSelectedYasguiRenderMode(a.RenderingMode.YASQE),t.changeRenderMode(e.similarityIndexInfo.getSelectedYasguiRenderMode()),e.similarityIndexInfo.isDataQueryTypeSelected()?t.showYasqeActionButton([n.YasqeButtonName.INFER_STATEMENTS,n.YasqeButtonName.EXPANDS_RESULTS]):t.hideYasqeActionButton([n.YasqeButtonName.INFER_STATEMENTS,n.YasqeButtonName.EXPANDS_RESULTS]),t.setQuery(e.similarityIndexInfo.getQuery())})))},e.createSimilarityIndex=function(){e.saveOrUpdateExecuted=!0,e.savingIndex=!0,D(e.similarityIndexInfo).then(ee).then(Z).then($).then(F).then((function(e){return _(e.getSimilarityIndex())})).then((function(){return U()})).catch((function(e){e instanceof y.SimilarityIndexError||t.error(getError(e),E.instant("similarity.could.not.get.indexes.error"))})).finally((function(){e.savingIndex=!1}))},e.viewQuery=function(){D(e.similarityIndexInfo).then($).then(M).then(N).catch((function(e){return t.error(getError(e))}))},e.preview=function(){D(e.similarityIndexInfo).then(Z).then(ee).then((function(){var t=V();e.similarityIndexInfo.setSelectedYasguiRenderMode(a.RenderingMode.YASR),t.query(e.similarityIndexInfo.getSelectedYasguiRenderMode())}))},e.saveSearchQuery=function(){R?(e.saveOrUpdateExecuted=!0,e.savingIndex=!0,D(e.similarityIndexInfo).then(W).then(ee).then(Z).then(J).then(K).then(B).then((function(e){return T.showToastMessageWithDelay(e?"similarity.changed.search.query.msg":"similarity.changed.analogical.query.msg")})).then((function(){v.url("similarity")})).catch((function(e){e instanceof y.SimilarityIndexError||t.error(getError(e),E.instant("similarity.change.query.error"))})).finally((function(){e.savingIndex=!1}))):v.url("similarity")},e.setEditorQuery=function(t){e.similarityIndexInfo.markInvalidQuery(void 0,!1),e.similarityIndexInfo.markInvalidQueryType(void 0,!1),e.yasguiConfig?V().setQuery(t):Y({initialQuery:t||" "})},e.similarityIndexNameChanged=function(){e.setDirty(),e.similarityIndexInfo.isNameExist=!1},e.queryChanged=function(){e.setDirty(),e.similarityIndexInfo.markInvalidQuery(void 0,!1),e.similarityIndexInfo.markInvalidQueryType(void 0,!1)},e.isCloneViewMode=function(){return u.SimilarityViewMode.CLONE===C},e.isEditViewMode=function(){return u.SimilarityViewMode.EDIT===C},e.isCreateViewMode=function(){return u.SimilarityViewMode.CREATE===C},e.setDirty=function(){R=!0},e.isYasqeShown=function(){return e.similarityIndexInfo&&e.similarityIndexInfo.isYasqeRenderMode()},e.isYasrShown=function(){return e.similarityIndexInfo&&e.similarityIndexInfo.isYasrRenderMode()},e.showEditor=function(){var t=V();t.abortQuery().then((function(){return t.setQuery(e.similarityIndexInfo.getQuery())})).then((function(){return e.similarityIndexInfo.setSelectedYasguiRenderMode(a.RenderingMode.YASQE),t.changeRenderMode(e.similarityIndexInfo.getSelectedYasguiRenderMode())}))},e.toggleHelp=function(t){void 0===t&&(t=x.get(Q.HIDE_SIMILARITY_HELP)),1!==t?(x.set(Q.HIDE_SIMILARITY_HELP,1),e.helpHidden=!0):(x.set(Q.HIDE_SIMILARITY_HELP,0),e.helpHidden=!1)},e.getCloseBtnMsg=function(){var t=e.editSearchQuery?E.instant("similarity.query.edition.msg"):E.instant("similarity.index.creation.msg");return E.instant("similarity.close.btn.msg",{operation:t})},e.hasQueryError=function(){var t=e.similarityIndexInfo.getSelectedQueryType();return s.SimilarityQueryType.DATA===t?e.hasSelectQueryError():s.SimilarityQueryType.SEARCH===t?e.hasSearchQueryError():s.SimilarityQueryType.ANALOGICAL===t&&e.hasAnalogicalQueryError()},e.hasSelectQueryError=function(){return!e.similarityIndexInfo.hasSelectQuery()||e.similarityIndexInfo.invalidSelectQuery||e.similarityIndexInfo.invalidSelectQueryType},e.hasSearchQueryError=function(){return!e.similarityIndexInfo.hasSearchQuery()||e.similarityIndexInfo.invalidSearchQuery||e.similarityIndexInfo.invalidSearchQueryType},e.hasAnalogicalQueryError=function(){return!e.similarityIndexInfo.hasAnalogicalQuery()||e.similarityIndexInfo.invalidAnalogicalQuery||e.similarityIndexInfo.invalidAnalogicalQueryType},e.getQueryErrorMessage=function(){var t=e.similarityIndexInfo.getSelectedQueryType(),i=!1,r=!1,n=!1;s.SimilarityQueryType.DATA===t?(i=!e.similarityIndexInfo.hasSelectQuery(),r=e.similarityIndexInfo.invalidSelectQueryType,n=e.similarityIndexInfo.invalidSelectQuery):s.SimilarityQueryType.SEARCH===t?(i=!e.similarityIndexInfo.hasSearchQuery(),r=e.similarityIndexInfo.invalidSearchQueryType,n=e.similarityIndexInfo.invalidSearchQuery):s.SimilarityQueryType.ANALOGICAL===t&&(i=!e.similarityIndexInfo.hasAnalogicalQuery(),r=e.similarityIndexInfo.invalidAnalogicalQueryType,n=e.similarityIndexInfo.invalidAnalogicalQuery);var a={queryType:E.instant("similarity.query.type.".concat(t,".name"))};return i?E.instant("similarity.error.query.empty",a):n?E.instant("similarity.error.query.invalid",a):r?E.instant("similarity.error.query.invalid_type",a):""};var D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return V().getQuery().then((function(i){return e.setQuery(i,t)})).then((function(){return e}))},M=function(e){return p.getQuery({indexName:e.getName(),indexOptions:e.getOptions(),query:e.getQuery(),indexStopList:e.getStopList(),queryInference:e.getInference(),querySameAs:e.getSameAs(),viewType:e.getSelectedQueryType(),indexAnalyzer:e.getAnalyzer()}).then((function(e){return e.data}))},N=function(e){e&&i.open({templateUrl:"pages/viewQuery.html",controller:"ViewQueryCtrl",resolve:{query:function(){return e}}})},k=function(t){var i=t.getType();if(!e.isEditViewMode()&&O&&(t.setQuery(O[i],s.SimilarityQueryType.SEARCH),t.setQuery(O.analogical,s.SimilarityQueryType.ANALOGICAL)),L)if(l.SimilarityIndexType.PREDICATION===i){var r=L[l.SimilarityIndexType.PREDICATION].predication;t.setQuery(r,s.SimilarityQueryType.DATA)}else{var n=L[l.SimilarityIndexType.TEXT].literals;t.setQuery(n,s.SimilarityQueryType.DATA)}},j=function(){var i=new d.SimilarityIndexInfo;i.setName(H()),i.setType(G()),i.setSelectedQueryType(e.isEditViewMode()?s.SimilarityQueryType.SEARCH:s.SimilarityQueryType.DATA);var n=v.search().options;n?i.setOptions(n):i.setOptions(i.isTextType()?"-termweight idf":""),k(i);var a=v.search().searchQuery;a&&i.setQuery(a,s.SimilarityQueryType.SEARCH);var o=v.search().selectQuery;o&&i.setQuery(o,s.SimilarityQueryType.DATA);var u=v.search().analogicalQuery;if(u&&i.setQuery(u,s.SimilarityQueryType.ANALOGICAL),i.isTextType()){i.setStopList(v.search().stopList),i.setAnalyzer(v.search().analyzer);var l=z(i.getSimilarityIndex(),"-literal_index");void 0!==l&&i.setLiteralIndex(l)}return i.isPredicationType()?p.getIndexes().then((function(t){var n=Object(r.mapIndexesResponseToSimilarityIndex)(t.data).filter((function(e){return e.isTextLiteralType()&&(e.isBuiltStatus()||e.isOutdatedStatus())})).map((function(e){return e.name}));if(e.literalIndexes=["no-index"].concat(n),void 0===i.getInputIndex()){var a=z(i.getSimilarityIndex(),"-input_index");if(void 0!==a)for(var o=0;o<e.literalIndexes.length;o++)a===e.literalIndexes[o]&&i.setInputIndex(e.literalIndexes[o])}return void 0===i.getInputIndex()&&i.setInputIndex(e.literalIndexes[0]),i})).catch((function(e){var i=getError(e);t.error(i,E.instant("similarity.could.not.get.indexes.error"))})):Promise.resolve(i)},Y=function(t){var i={endpoint:q,componentId:"create-index",showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showYasqeActionButtons:!1,showQueryButton:!1,downloadAsOn:!1,showResultInfo:!1,showYasqeResizer:!1,pageSize:100,prefixes:P,render:e.similarityIndexInfo.getSelectedYasguiRenderMode(),yasqeActionButtons:e.isEditViewMode()||!e.similarityIndexInfo.isDataQueryTypeSelected()?n.DISABLE_YASQE_BUTTONS_CONFIGURATION:n.INFERRED_AND_SAME_AS_BUTTONS_CONFIGURATION,maxPersistentResponseSize:0,yasqeMode:e.canWriteActiveRepo()?o.YasqeMode.WRITE:o.YasqeMode.READ},r={};angular.extend(r,i,t),e.yasguiConfig=r},q=function(){return"repositories/".concat(A.getActiveRepository())},_=function(i){if(void 0!==e.literalIndexes){var r=i.inputIndex;r!==e.literalIndexes[0]&&(i.options=i.options+(""===i.options?"":" ")+"-input_index "+r)}return"true"===i.isLiteralIndex&&(i.options=i.options+(""===i.options?"":" ")+"-literal_index true",i.type=l.SimilarityIndexType.TEXT_LITERAL),R=!1,p.createIndex("POST",i.name,i.options,i.selectQuery,i.searchQuery,i.isPredicationType()?i.analogicalQuery:"",i.stopList,i.infer,i.sameAs,i.type,i.analyzer).then((function(){return t.success(E.instant("similarity.create.index.successfully")),i})).catch((function(e){var i=getError(e);return t.error(i,E.instant("similarity.create.index.error")),console.log(i),Promise.reject(new y.SimilarityIndexError("Could not create index."))}))},B=function(e){var t=e.isSearchQueryTypeSelected(),i={name:e.getSimilarityIndex().name,changedQuery:e.getQuery(),isSearchQuery:t};return p.saveSearchQuery(JSON.stringify(i)).then((function(){return R=!1,t}))},U=function(){setTimeout((function(){return v.url("similarity")}),100)},V=function(){return n.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor")},H=function(){var t=v.search().name||"";return e.isCloneViewMode()?"".concat(E.instant("similarity.copy_of.prefix"),"_").concat(t):t},G=function(){var e=v.search().type;return void 0===e||e.startsWith("text")?l.SimilarityIndexType.TEXT:e},z=function(e,t){for(var i=e.options.split(" "),r=0;r<i.length;r++)if(i[r]===t&&r+1<i.length){var n=i[r+1];return delete i[r],delete i[r+1],e.options=i.join(" "),n}},$=function(e){return Promise.all([W(e).then(X).then(J).then(K).then(Z).then(ee)]).then((function(){return e}))},F=function(e){return p.getIndexes().then((function(t){return t.data.some((function(t){return t.name===e.getName()}))?(e.isNameExist=!0,Promise.reject(new y.SimilarityIndexError("Similarity index name exists."))):e}))},W=function(e){return e.getSimilarityIndex().name?e.isNameValid()?Promise.resolve(e):Promise.reject(new y.SimilarityIndexError("Invalid similarity name.")):Promise.reject(new y.SimilarityIndexError("Missing similarity name."))},X=function(e){return e.hasSelectQuery()?e.invalidSelectQuery?Promise.reject(new y.SimilarityIndexError("Invalid select query")):e.invalidSelectQueryType?Promise.reject(new y.SimilarityIndexError("Invalid select query type")):Promise.resolve(e):Promise.reject(new y.SimilarityIndexError("Missing select query."))},J=function(e){return e.hasSearchQuery()?e.invalidSearchQuery?Promise.reject(new y.SimilarityIndexError("Invalid search query")):e.invalidSearchQueryType?Promise.reject(new y.SimilarityIndexError("Invalid search query type")):Promise.resolve(e):Promise.reject(new y.SimilarityIndexError("Missing search query."))},K=function(e){return e.isPredicationType()&&!e.hasAnalogicalQuery()?Promise.reject(new y.SimilarityIndexError("Missing analogical query.")):e.invalidAnalogicalQuery?Promise.reject(new y.SimilarityIndexError("Invalid analogical query")):e.invalidAnalogicalQueryType?Promise.reject(new y.SimilarityIndexError("Invalid analogical query type")):Promise.resolve(e)},Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return V().getQueryType().then((function(i){return c.QueryType.SELECT!==i?(e.markInvalidQueryType(t),Promise.reject(new y.SimilarityIndexError("Query type is not valid."))):(e.markInvalidQueryType(t,!1),e)}))},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return V().isQueryValid().then((function(i){return i?(e.markInvalidQuery(t,!1),e):(e.markInvalidQuery(t),Promise.reject(new y.SimilarityIndexError("Query is not valid.")))}))},te=function(e,t,i,r){w.openSimpleModal({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(i)&&i()}),(function(){angular.isFunction(r)&&r()}))},ie=function(){e.isYasrShown()&&e.similarityIndexInfo.isDataQueryTypeSelected()&&e.showEditor(),e.canEditActiveRepo=e.canWriteActiveRepo();var t=S(S({},e.yasguiConfig),{},{yasqeMode:e.canWriteActiveRepo()});Y(t)},re=function(e){R&&(e.returnValue=!0)},ne=function(){window.removeEventListener("beforeunload",re),ae.forEach((function(e){return e()}))},ae=[];ae.push(b.subscribe("repositoryWillChangeEvent",(function(t){return new Promise((function(i){if(e.isCreateViewMode()||e.isCloneViewMode())i(t);else{var r=function(){R=!1,U(),i(t)};if(R){var n=E.instant("common.confirm"),a=E.instant("similarity.warning.unsaved.changes");te(n,a,r,(function(){t.cancel=!0,i(t)}))}else r()}}))}))),ae.push(e.$on("$locationChangeStart",(function(e,t){if(R){e.preventDefault();var i=E.instant("common.confirm"),r=E.instant("similarity.warning.unsaved.changes");te(i,r,(function(){ne();var e=v.absUrl().length-v.url().length,i=t.substring(e);v.path(i)}))}else ne()}))),ae.push(e.$on("$destroy",ne)),window.addEventListener("beforeunload",re),C=function(){if(void 0===v.search().name)return u.SimilarityViewMode.CREATE;var e=v.search().editSearchQuery;return void 0===e?u.SimilarityViewMode.CLONE:"string"==typeof e?"false"===e?u.SimilarityViewMode.CLONE:u.SimilarityViewMode.EDIT:e?u.SimilarityViewMode.EDIT:u.SimilarityViewMode.CLONE}();var oe=e.$watch((function(){return e.getActiveRepositoryObject()}),(function(t){t&&(e.loadingControllerResources=!0,Promise.all([p.getSearchQueries(),p.getSamples(),A.getPrefixes(t.id)]).then((function(t){var i=m(t,3),r=i[0],n=i[1],a=i[2];e.canEditActiveRepo=e.canWriteActiveRepo(),O=r?r.data:[],L=n?n.data:[],P=a,j().then((function(t){e.similarityIndexInfo=t;var i=s.SimilarityQueryType.DATA;e.isEditViewMode()&&(i=s.SimilarityQueryType.SEARCH),e.changeSimilarityIndexType(t.getType(),i)}))})).catch((function(t){console.log(t),e.repositoryError=getError(t)})).finally((function(){ae.push(e.$on("repositoryIsSet",ie)),oe(),e.loadingControllerResources=!1})))}))}angular.module("graphdb.framework.similarity.controllers.create",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("CreateSimilarityIdxCtrl",h),h.$inject=["$scope","toastr","$uibModal","$timeout","SimilarityRestService","SparqlRestService","$location","productInfo","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate","$repositories","EventEmitterService","ModalService"]}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[190],{299:function(e,r,n){"use strict";n.r(r);n(15);var t=n(33);function a(e,r,n,a,s,o,i,c,l,u,p,d,h,g,f,m,C){e.hasMoreGraphs=!1,e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=function(){return angular.noop()},e.currentBrowserLimit=2e3,h.firefox?e.currentBrowserLimit=50:(h.safari||h.msie||h.msedge)&&(e.currentBrowserLimit=400),e.graphsDropdownToggled=function(r){e.hasMoreGraphs&&r&&i.warning(C.instant("dependencies.graphs.too.many.warning",{graphsLimit:t.NumberUtils.formatNumberToLocaleString(1e3,C.use())}))};var y={},S=0,v=0;r.key="",y.get=function(r,n,t){return l.initLazyList(r,n,t,S,e.instancesObj.items)};var w=allGraphs,b=function(){if(e.getActiveRepository())return m.resolveGraphs(a.getActiveRepository(),1001).success((function(r){e.graphsInRepo=r.results.bindings,e.hasMoreGraphs=e.graphsInRepo.length>1002,R()})).error((function(r){e.repositoryError=getError(r),i.error(getError(r),C.instant("graphexplore.error.getting.graphs"))}))},R=function(){var r=g.get("classHierarchy-selectedGraph-".concat(a.getActiveRepository()));null!==r&&e.graphsInRepo.some((function(e){return e.contextID.uri===r.contextID.uri}))?w=r:g.set("classHierarchy-selectedGraph-".concat(a.getActiveRepository()),w)},E=function(){return e.instancesObj.items.length<1e3?C.instant("graphexplore.search.class.instances"):C.instant("graphexplore.search.first.class.instances")};r.$watch((function(){return r.key}),(function(){S=0,_.each(e.instancesObj.items,(function(e){r.key>e&&S++})),v++})),y.revision=function(){return v},e.adapterContainer={adapter:{remain:!0}};var x=[];x.push(e.$on("goToDomainRangeGraphView",(function(e,r){A(r)}))),x.push(e.$on("classCount",L)),x.push(e.$on("repositoryIsSet",(function(){if(!s.isLicenseValid())return;if(O===a.getActiveRepository())return;O=a.getActiveRepository();if(e.repositoryError=null,!O)return;w=allGraphs,b().then(j)}))),x.push(r.$on("$translateChangeSuccess",(function(){e.instancesSearchPlaceholder=E()})));function L(r,n,t){e.classCountSlider.options&&e.classCountSlider.options.ceil!==n&&(e.classCountSlider={});var a;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:n,options:{floor:1,ceil:n,vertical:!0,showSelectionBar:!0,onChange:function(){p(I,100,!0)}}},null===g.get(f.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&n>e.currentBrowserLimit&&(a=e.currentBrowserLimit,h.chrome?i.warning(C.instant("graphexplore.disabling.animations",{classLimit:a}),C.instant("graphexplore.reducing.visual.effects")):i.warning(C.instant("graphexplore.browser.performance",{browser:h.name,classLimit:a}),C.instant("graphexplore.reducing.visual.effects"))));var s=g.get(f.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=s&&"true"!==s&&(e.showExternalElements=!0),t?e.classCountSlider.value=t:n>=1500&&(e.classCountSlider.value=1500,i.warning(C.instant("graphexplore.class.count.slider",{count:1500}),C.instant("graphexplore.reducing.class.count"))),n>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,i.warning(C.instant("graphexplore.class.count.browser",{count:25}),C.instant("graphexplore.reducing.class.count"))),p((function(){e.$broadcast("reCalcViewDimensions");var r=document.getElementById("rzslider"),n=0;r.addEventListener("wheel",(function(r){r.preventDefault(),r.stopPropagation();var t=(new Date).getTime();if(t-n>100){n=t;var a=e.classCountSlider.value,s=e.classCountSlider.options.step||1;r.deltaY<=-1?a+=s:r.deltaY>=1&&(a-=s),(a=Math.max(e.classCountSlider.options.floor,Math.min(e.classCountSlider.options.ceil,a)))!==e.classCountSlider.value&&e.$apply((function(){e.classCountSlider.value=a,p(I,100,!0)}))}}))}),200),I()}function I(){e.currentSliderValue=e.classCountSlider.value}function A(e){var r=e.data.fullName,t=e.data.name;c.checkDomainRangeData(r).success((function(e,a){204===a?i.warning(C.instant("graphexplore.no.domain.range",{name:t})):(g.set(f.CLASS_HIERARCHY_LAST_SELECTED_CLASS,n.hash()),n.hash("").path("domain-range-graph").search("uri",r).search("name",t))})).error((function(){i.error(C.instant("graphexplore.error.request.failed",{name:t}))}))}function H(){n.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,g.clearClassHieararchyState(),e.hidePrefixes="true"===g.get(f.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},r.$broadcast("angucomplete-alt:clearInput")}function D(){e.hasClassHierarchy()&&p((function(){$("#toolbar").removeClass("ng-hide")}),0)}x.push(e.$on("$destroy",(function(){x.forEach((function(e){return e()}))}))),e.datasource=y,e.goToDomainRangeGraphView=A,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,r.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return a.getActiveRepository()},e.isSystemRepository=function(){return a.isSystemRepository()},e.confirmReloadClassHierarchy=function(){d.openSimpleModal({title:C.instant("confirm.operation"),message:C.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){H(),e.loader=!0,e.hierarchyError=!1,c.reloadClassHierarchy(w.contextID.uri).success((function(r){e.loader=!1,e.classHierarchyData=r,D(),L()})).error((function(r){e.loader=!1,e.hierarchyError=getError(r),i.error(getError(r),C.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){d.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){var n={name:e.title};r.$broadcast("searchedClass",n)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(r){return r.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},b(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&p((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(r){var n=r.data.fullName,t=r.data.name;if(t===n){var a=t.lastIndexOf("#");t=t.substring(a+1)}e.encodedUri=encodeURIComponent(n);var s=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+n+"> .\n}");e.viewInstancesUri="sparql?name="+t+"&infer=true&sameAs=false&query="+s+"&execute=true",c.getRdfsLabelAndComment(n).success((function(r){e.rdfsLabel=r.label,e.rdfsComment=r.comment,e.expanded=!1})).error((function(){i.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,c.getClassInstances(n).success((function(r){e.instancesObj.items=[],_.each(r,(function(r,n){var t={};t.type=r.startsWith("<<")&&r.endsWith(">>")?"triple":"uri",t.absUri=encodeURIComponent(r),t.absUriNonEncoded=r,t.resolvedUri=n,e.instancesObj.items.push(t)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=E(),e.instancesNotFiltered=e.instancesObj.items})).error((function(){i.error(C.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));var O=a.getActiveRepository();function j(){H(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,c.getClassHierarchyData(w.contextID.uri).success((function(r,n){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=r,207===n&&i.warning(C.instant("graphexplore.update.diagram"),C.instant("graphexplore.repository.data.changed")),D()})).error((function(r){e.loader=!1,e.hierarchyError=getError(r),i.error(getError(r),C.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return s.isLicenseValid()},e.chosenGraph=function(e){w=e,j(),g.set("classHierarchy-selectedGraph-".concat(a.getActiveRepository()),w)},e.getSelGraphValue=function(){return w.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelGraphValue()}}angular.module("graphdb.framework.graphexplore.controllers.class",["pageslide-directive","ngAnimate","ui.scroll.jqlite","ui.scroll","angucomplete-alt","rzSlider","toastr","graphdb.framework.utils.localstorageadapter"]).controller("RdfClassHierarchyCtlr",a),a.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[190],{299:function(e,r,n){"use strict";n.r(r);n(15);var t=n(33);function a(e,r,n,a,s,o,i,c,l,u,p,d,h,g,f,m,C){e.hasMoreGraphs=!1,e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=function(){return angular.noop()},e.currentBrowserLimit=2e3,h.firefox?e.currentBrowserLimit=50:(h.safari||h.msie||h.msedge)&&(e.currentBrowserLimit=400),e.graphsDropdownToggled=function(r){e.hasMoreGraphs&&r&&i.warning(C.instant("dependencies.graphs.too.many.warning",{graphsLimit:t.NumberUtils.formatNumberToLocaleString(1e3,C.use())}))};var y={},S=0,v=0;r.key="",y.get=function(r,n,t){return l.initLazyList(r,n,t,S,e.instancesObj.items)};var w=allGraphs,b=function(){if(e.getActiveRepository())return m.resolveGraphs(a.getActiveRepository(),1001).success((function(r){e.graphsInRepo=r.results.bindings,e.hasMoreGraphs=e.graphsInRepo.length>1002,R()})).error((function(r){e.repositoryError=getError(r),i.error(getError(r),C.instant("graphexplore.error.getting.graphs"))}))},R=function(){var r=g.get("classHierarchy-selectedGraph-".concat(a.getActiveRepository()));null!==r&&e.graphsInRepo.some((function(e){return e.contextID.uri===r.contextID.uri}))?w=r:g.set("classHierarchy-selectedGraph-".concat(a.getActiveRepository()),w)},E=function(){return e.instancesObj.items.length<1e3?C.instant("graphexplore.search.class.instances"):C.instant("graphexplore.search.first.class.instances")};r.$watch((function(){return r.key}),(function(){S=0,_.each(e.instancesObj.items,(function(e){r.key>e&&S++})),v++})),y.revision=function(){return v},e.adapterContainer={adapter:{remain:!0}};var x=[];x.push(e.$on("goToDomainRangeGraphView",(function(e,r){A(r)}))),x.push(e.$on("classCount",L)),x.push(e.$on("repositoryIsSet",(function(){if(!s.isLicenseValid())return;if(O===a.getActiveRepository())return;O=a.getActiveRepository();if(e.repositoryError=null,!O)return;w=allGraphs,b().then(j)}))),x.push(r.$on("$translateChangeSuccess",(function(){e.instancesSearchPlaceholder=E()})));function L(r,n,t){e.classCountSlider.options&&e.classCountSlider.options.ceil!==n&&(e.classCountSlider={});var a;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:n,options:{floor:1,ceil:n,vertical:!0,showSelectionBar:!0,onChange:function(){p(I,100,!0)}}},null===g.get(f.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&n>e.currentBrowserLimit&&(a=e.currentBrowserLimit,h.chrome?i.warning(C.instant("graphexplore.disabling.animations",{classLimit:a}),C.instant("graphexplore.reducing.visual.effects")):i.warning(C.instant("graphexplore.browser.performance",{browser:h.name,classLimit:a}),C.instant("graphexplore.reducing.visual.effects"))));var s=g.get(f.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=s&&"true"!==s&&(e.showExternalElements=!0),t?e.classCountSlider.value=t:n>=1500&&(e.classCountSlider.value=1500,i.warning(C.instant("graphexplore.class.count.slider",{count:1500}),C.instant("graphexplore.reducing.class.count"))),n>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,i.warning(C.instant("graphexplore.class.count.browser",{count:25}),C.instant("graphexplore.reducing.class.count"))),p((function(){e.$broadcast("reCalcViewDimensions");var r=document.getElementById("rzslider"),n=0;r.addEventListener("wheel",(function(r){r.preventDefault(),r.stopPropagation();var t=(new Date).getTime();if(t-n>100){n=t;var a=e.classCountSlider.value,s=e.classCountSlider.options.step||1;r.deltaY<=-1?a+=s:r.deltaY>=1&&(a-=s),(a=Math.max(e.classCountSlider.options.floor,Math.min(e.classCountSlider.options.ceil,a)))!==e.classCountSlider.value&&e.$apply((function(){e.classCountSlider.value=a,p(I,100,!0)}))}}))}),200),I()}function I(){e.currentSliderValue=e.classCountSlider.value}function A(e){var r=e.data.fullName,t=e.data.name;c.checkDomainRangeData(r).success((function(e,a){204===a?i.warning(C.instant("graphexplore.no.domain.range",{name:t})):(g.set(f.CLASS_HIERARCHY_LAST_SELECTED_CLASS,n.hash()),n.hash("").path("domain-range-graph").search("uri",r).search("name",t))})).error((function(){i.error(C.instant("graphexplore.error.request.failed",{name:t}))}))}function H(){n.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,g.clearClassHieararchyState(),e.hidePrefixes="true"===g.get(f.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},r.$broadcast("angucomplete-alt:clearInput")}function D(){e.hasClassHierarchy()&&p((function(){$("#toolbar").removeClass("ng-hide")}),0)}x.push(e.$on("$destroy",(function(){x.forEach((function(e){return e()}))}))),e.datasource=y,e.goToDomainRangeGraphView=A,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,r.$broadcast("sidePanelClosed")},e.toggleHidePrefixes=function(){e.hidePrefixes=!e.hidePrefixes},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return a.getActiveRepository()},e.isSystemRepository=function(){return a.isSystemRepository()},e.confirmReloadClassHierarchy=function(){d.openSimpleModal({title:C.instant("confirm.operation"),message:C.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){H(),e.loader=!0,e.hierarchyError=!1,c.reloadClassHierarchy(w.contextID.uri).success((function(r){e.loader=!1,e.classHierarchyData=r,D(),L()})).error((function(r){e.loader=!1,e.hierarchyError=getError(r),i.error(getError(r),C.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){d.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){var n={name:e.title};r.$broadcast("searchedClass",n)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(r){return r.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},b(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&p((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(r){var n=r.data.fullName,t=r.data.name;if(t===n){var a=t.lastIndexOf("#");t=t.substring(a+1)}e.encodedUri=encodeURIComponent(n);var s=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+n+"> .\n}");e.viewInstancesUri="sparql?name="+t+"&infer=true&sameAs=false&query="+s+"&execute=true",c.getRdfsLabelAndComment(n).success((function(r){e.rdfsLabel=r.label,e.rdfsComment=r.comment,e.expanded=!1})).error((function(){i.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,c.getClassInstances(n).success((function(r){e.instancesObj.items=[],_.each(r,(function(r,n){var t={};t.type=r.startsWith("<<")&&r.endsWith(">>")?"triple":"uri",t.absUri=encodeURIComponent(r),t.absUriNonEncoded=r,t.resolvedUri=n,e.instancesObj.items.push(t)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=E(),e.instancesNotFiltered=e.instancesObj.items})).error((function(){i.error(C.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));var O=a.getActiveRepository();function j(){H(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,c.getClassHierarchyData(w.contextID.uri).success((function(r,n){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=r,207===n&&i.warning(C.instant("graphexplore.update.diagram"),C.instant("graphexplore.repository.data.changed")),D()})).error((function(r){e.loader=!1,e.hierarchyError=getError(r),i.error(getError(r),C.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return s.isLicenseValid()},e.chosenGraph=function(e){w=e,j(),g.set("classHierarchy-selectedGraph-".concat(a.getActiveRepository()),w)},e.getSelGraphValue=function(){return w.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelGraphValue()}}angular.module("graphdb.framework.graphexplore.controllers.class",["pageslide-directive","ngAnimate","ui.scroll.jqlite","ui.scroll","angucomplete-alt","rzSlider","toastr","graphdb.framework.utils.localstorageadapter"]).controller("RdfClassHierarchyCtlr",a),a.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[231],{331:function(t,e){function o(){return{link:function(t,e,o){t.$watch("file.status",(function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.0.2
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[231],{331:function(t,e){function o(){return{link:function(t,e,o){t.$watch("file.status",(function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.0.2">{{\'common.loading\' | translate}}</object>')}))}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",o),o.$inject=[]}}]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[29,20,30,35,36,47,68,69,73,82,90,97,121,149,150,151,171,174,179,180,242,259,318,319,354,363,378,379,383,384,385],{102:function(t,e,n){"use strict";n.r(e),n.d(e,"TTYGEventName",(function(){return r}));var o=n(24);function i(t){var e=void 0,n=void 0,i=void 0,a=void 0,s={},c=void 0,u=!1,l=function(){return Object(o.cloneDeep)(e)},d=function(){return Object(o.cloneDeep)(n)},g=function(t){n=Object(o.cloneDeep)(t),T(r.CHAT_LIST_UPDATED,d())},f=function(){return Object(o.cloneDeep)(i)},p=function(){return Object(o.cloneDeep)(a)},m=function(){return Object(o.cloneDeep)(s)},h=function(t){return!!s[t]},y=function(){return u},T=function(e,n){t.emitSync(e,Object(o.cloneDeep)(n))},v=function(e,n){return t.subscribeSync(e,(function(t){return n(t)}))};return{resetContext:function(){e=void 0,n=void 0,i=void 0,a=void 0,s={},c=void 0,u=!1},emit:T,subscribe:v,getChats:d,updateChats:g,addChat:function(t){n.appendChat(t),g(n)},replaceChat:function(t,e){n.replaceChat(t,e),g(n)},onChatsListChanged:function(t){return n&&angular.isFunction(t)&&t(d()),v(r.CHAT_LIST_UPDATED,(function(e){return t(e)}))},getSelectedChat:f,selectChat:function(t){i&&i.id===t.id||(i=Object(o.cloneDeep)(t),T(r.SELECT_CHAT,f()))},deselectChat:function(){i=void 0,T(r.SELECT_CHAT,f())},deleteChat:function(t){n.deleteChat(t),g(n)},onSelectedChatChanged:function(t){return angular.isFunction(t)&&t(f()),v(r.SELECT_CHAT,(function(e){return t(e)}))},updateSelectedChat:function(t){i&&i.id&&t&&i.id!==t.id||(i=Object(o.cloneDeep)(t),T(r.SELECTED_CHAT_UPDATED,f()))},onSelectedChatUpdated:function(t){return i&&angular.isFunction(t)&&t(f()),v(r.SELECTED_CHAT_UPDATED,(function(e){return t(e)}))},onLastMessageReceived:function(t){return i&&angular.isFunction(t)&&t(f()),v(r.LAST_MESSAGE_RECEIVED,(function(e){return t(e)}))},updateAgents:function(t){e=Object(o.cloneDeep)(t),T(r.AGENT_LIST_UPDATED,l())},onAgentsListChanged:function(t){return e&&angular.isFunction(t)&&t(l()),v(r.AGENT_LIST_UPDATED,(function(e){return t(e)}))},getAgents:l,getAgent:function(t){if(e)return Object(o.cloneDeep)(e.getAgent(t))},selectAgent:function(t){a=Object(o.cloneDeep)(t),T(r.AGENT_SELECTED,p())},getSelectedAgent:p,onSelectedAgentChanged:function(t){return a&&angular.isFunction(t)&&t(p()),v(r.AGENT_SELECTED,(function(e){return t(e)}))},getDefaultAgent:function(){return Object(o.cloneDeep)(c)},setDefaultAgent:function(t){c=t},setCanModifyAgent:function(t){u=Object(o.cloneDeep)(t),T(r.CAN_MODIFY_AGENT_UPDATED,y())},getCanModifyAgent:y,onCanUpdateAgentUpdated:function(t){return angular.isFunction(t)&&t(y()),v(r.CAN_MODIFY_AGENT_UPDATED,(function(e){return t(e)}))},hasExplainResponse:h,toggleExplainResponse:function(t){h(t)&&(s[t].expanded=!s[t].expanded,T(r.EXPLAIN_RESPONSE_CACHE_UPDATED,m()))},getExplainResponse:function(t){return Object(o.cloneDeep)(s[t])},addExplainResponseCache:function(t){s[t.answerId]=Object(o.cloneDeep)(t),T(r.EXPLAIN_RESPONSE_CACHE_UPDATED,m())},onExplainResponseCacheUpdated:function(t){return angular.isFunction(t)&&t(m()),v(r.EXPLAIN_RESPONSE_CACHE_UPDATED,(function(e){return t(e)}))}}}angular.module("graphdb.framework.ttyg.services.ttygcontext",[]).factory("TTYGContextService",i),i.$inject=["EventEmitterService","TTYGService"];var r={CREATE_CHAT:"createChat",CREATE_CHAT_SUCCESSFUL:"chatCreated",CREATE_CHAT_FAILURE:"chatCreationFailed",RENAME_CHAT:"renameChat",RENAME_CHAT_SUCCESSFUL:"chatRenamed",RENAME_CHAT_FAILURE:"chatRenamedFailure",SELECT_CHAT:"selectChat",SELECTED_CHAT_UPDATED:"selectChatUpdated",LAST_MESSAGE_RECEIVED:"lastMessageReceived",DELETING_CHAT:"deletingChat",DELETE_CHAT:"deleteChat",DELETE_CHAT_SUCCESSFUL:"chatDeleted",DELETE_CHAT_FAILURE:"chatDeletedFailure",CHAT_EXPORT:"chatExport",CHAT_EXPORT_SUCCESSFUL:"chatExportSuccess",CHAT_EXPORT_FAILURE:"chatExportFailure",CHAT_LIST_UPDATED:"chatListUpdated",ASK_QUESTION:"askQuestion",ASK_QUESTION_FAILURE:"askQuestionFailure",CONTINUE_CHAT_RUN:"continueChatRun",LOAD_CHATS:"loadChats",LOAD_CHAT_SUCCESSFUL:"loadChatSuccess",LOAD_CHAT_FAILURE:"loadChatFailure",AGENT_LIST_UPDATED:"agentListUpdated",OPEN_AGENT_SETTINGS:"openAgentSettings",EDIT_AGENT:"editAgent",CLONE_AGENT:"cloneAgent",DELETE_AGENT:"deleteAgent",AGENT_DELETED:"agentDeleted",DELETING_AGENT:"deletingAgent",AGENT_SELECTED:"agentSelected",GO_TO_CREATE_SIMILARITY_VIEW:"goToCreateSimilarityView",GO_TO_CONNECTORS_VIEW:"goToConnectorsView",EXPLAIN_RESPONSE:"explainResponse",EXPLAIN_RESPONSE_CACHE_UPDATED:"explainResponseCacheUpdated",GO_TO_SPARQL_EDITOR:"openQueryInSparqlEditor",CAN_MODIFY_AGENT_UPDATED:"canModifyAgentUpdated"}},106:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndexType",(function(){return o}));var o={TEXT:"text",TEXT_LITERAL:"textLiteral",PREDICATION:"predication",isTextType:function(t){return o.TEXT===t},isTextLiteralType:function(t){return o.TEXT_LITERAL===t},isPredicationType:function(t){return o.PREDICATION===t}}},107:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndexStatus",(function(){return o}));var o={CREATING:"CREATING",BUILDING:"BUILDING",BUILT:"BUILT",REBUILDING:"REBUILDING",OUTDATED:"OUTDATED",INTERRUPTED:"INTERRUPTED",OBSOLETE:"OBSOLETE",FAILED:"FAILED",isCreatingStatus:function(t){return o.CREATING===t},isBuildingStatus:function(t){return o.BUILDING===t},isBuiltStatus:function(t){return o.BUILT===t},isRebuildingStatus:function(t){return o.REBUILDING===t},isOutdatedStatus:function(t){return o.OUTDATED===t},isInterruptedStatus:function(t){return o.INTERRUPTED===t},isObsoleteStatus:function(t){return o.OBSOLETE===t},isFailedStatus:function(t){return o.FAILED===t}}},110:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndex",(function(){return c}));var o=n(106),i=n(107);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}}function s(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}var c=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.analyzer="",this.infer=!0,this.options="",this.sameAs=!0,this.searchQuery="",this.selectQuery="",this.stopList=void 0,this.name="",this.type=o.SimilarityIndexType.TEXT,this.status=void 0,this.analogicalQuery=void 0,this.inputIndex=void 0,this.isLiteralIndex=""},(e=[{key:"isTextType",value:function(){return o.SimilarityIndexType.isTextType(this.type)}},{key:"isTextLiteralType",value:function(){return o.SimilarityIndexType.isTextLiteralType(this.type)}},{key:"isPredicationType",value:function(){return o.SimilarityIndexType.isPredicationType(this.type)}},{key:"isCreatingStatus",value:function(){return i.SimilarityIndexStatus.isCreatingStatus(this.status)}},{key:"isBuildingStatus",value:function(){return i.SimilarityIndexStatus.isBuildingStatus(this.status)}},{key:"isBuiltStatus",value:function(){return i.SimilarityIndexStatus.isBuiltStatus(this.status)}},{key:"isRebuildingStatus",value:function(){return i.SimilarityIndexStatus.isRebuildingStatus(this.status)}},{key:"isOutdatedStatus",value:function(){return i.SimilarityIndexStatus.isOutdatedStatus(this.status)}},{key:"isInterruptedStatus",value:function(){return i.SimilarityIndexStatus.isInterruptedStatus(this.status)}},{key:"isObsoleteStatus",value:function(){return i.SimilarityIndexStatus.isObsoleteStatus(this.status)}},{key:"isFailedStatus",value:function(){return i.SimilarityIndexStatus.isFailedStatus(this.status)}}])&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}()},111:function(t,e){angular.module("graphdb.framework.rest.connectors.service",[]).factory("ConnectorsRestService",n),n.$inject=["$http"];function n(t){return{getConnectors:function(e,n){if(e)return t.get("rest/connectors",{headers:{"X-GraphDB-Repository":e,"X-GraphDB-Repository-Location":n}});return t.get("rest/connectors")},initConnector:function(e){return t.get("".concat("rest/connectors","/options?prefix=").concat(e))},hasConnector:function(e,n,o){if(n)return t.get("".concat("rest/connectors","/existing?prefix=").concat(e),{headers:{"X-GraphDB-Repository":n,"X-GraphDB-Repository-Location":o}});return t.get("".concat("rest/connectors","/existing?prefix=").concat(e))},checkConnector:function(e){return t.post("".concat("rest/connectors","/check"),e,{headers:{"Content-Type":"text/plain"}})}}}},117:function(t,e,n){"use strict";n.r(e),n.d(e,"mapIndexesResponseToSimilarityIndex",(function(){return i}));var o=n(110),i=function(t){return t.map((function(t){var e=new o.SimilarityIndex;return e.type=t.type,e.stopList=t.stopList,e.status=t.status,e.selectQuery=t.selectQuery,e.searchQuery=t.searchQuery,e.sameAs=t.sameAs,e.options=t.options,e.name=t.name,e.infer=t.infer,e.analyzer=t.analyzer,e.analogicalQuery=t.analogicalQuery,e}))}},123:function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}}function a(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}n.r(e),n.d(e,"ConnectorTypesListModel",(function(){return c})),n.d(e,"ConnectorTypeModel",(function(){return u})),n.d(e,"ConnectorListModel",(function(){return l})),n.d(e,"ConnectorModel",(function(){return d})),n.d(e,"ConnectorSettingsModel",(function(){return g}));var c=function(){return a((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),this._connectors=e.connectors||[]}),[{key:"getConnectorByName",value:function(t){return this._connectors.find((function(e){return e.name===t}))}},{key:"connectors",get:function(){return this._connectors},set:function(t){this._connectors=t}}])}(),u=function(){return a((function t(e){i(this,t),this._name=e.name,this._prefix=e.prefix}),[{key:"name",get:function(){return this._name},set:function(t){this._name=t}},{key:"prefix",get:function(){return this._prefix},set:function(t){this._prefix=t}}])}(),l=function(){return a((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];i(this,t),this._connectors=e.connectors}),[{key:"connectors",get:function(){return this._connectors},set:function(t){this._connectors=t}}])}(),d=function(){return a((function t(e){i(this,t),this._name=e.name,this._settings=new g(e)}),[{key:"settings",get:function(){return this._settings},set:function(t){this._settings=t}},{key:"name",get:function(){return this._name},set:function(t){this._name=t}}])}(),g=function(){return a((function t(e){i(this,t),this._settings=e.values||{}}),[{key:"settings",get:function(){return this._settings},set:function(t){this._settings=t}}])}()},124:function(t,e){angular.module("graphdb.framework.rest.similarity.service",[]).factory("SimilarityRestService",n),n.$inject=["$http","$repositories"];function n(t){return{getIndexes:function(e,n){if(e)return t.get("rest/similarity",{headers:{"X-GraphDB-Repository":e,"X-GraphDB-Repository-Location":n}});return t.get("rest/similarity")},getSearchQueries:function(){return t.get("".concat("rest/similarity","/config"))},rebuildIndex:function(t){return e("PUT",t.name,t.options,t.selectQuery,t.searchQuery,t.analogicalQuery,t.stopList,t.infer,t.sameAs,t.type)},deleteIndex:function(e){return t.delete("".concat("rest/similarity","?name=").concat(e.name))},createIndex:e,getSamples:function(){return t.get("".concat("rest/similarity","/samples"))},getQuery:function(e){return t.get("rest/similarity/query",{params:{name:e.indexName,options:e.indexOptions,stopList:e.indexStopList,selectQuery:e.query,infer:e.queryInference,sameAs:e.querySameAs,type:e.viewType,analyzer:e.indexAnalyzer}})},saveSearchQuery:function(e){return t({method:"put",url:"rest/similarity/search-query",data:e})}};function e(e,n,o,i,r,a,s,c,u,l,d){return t({method:e,url:"".concat("rest/similarity"),noCancelOnRouteChange:!0,data:{name:n,options:o,selectQuery:i,stopList:s,infer:c,sameAs:u,type:l,analyzer:d,searchQuery:r,analogicalQuery:a}})}}},126:function(t,e,n){"use strict";n.r(e);n(111);var o=n(136),i=n(25);function r(t){var e=function(e,n){return t.getConnectors(e,n).then((function(t){return Object(o.connectorTypesListMapper)(t.data)}))},n=function(e,n,i){return t.hasConnector(encodeURIComponent(e),n,i).then((function(t){return Object(o.connectorsMapper)(t.data)}))};return{getConnectorTypes:e,getConnectorsByType:n,getConnectorPrefixByName:function(t,n,o){return e(n,o).then((function(e){var n=e.getConnectorByName(t);return n?n.prefix:null}))},getConnectorsByTypeAsSelectMenuOptions:function(t,e,o){return n(t,e,o).then((function(t){return t.connectors.map((function(t){return new i.SelectMenuOptionsModel({value:t.name,label:t.name})}))}))}}}angular.module("graphdb.framework.core.services.connectors",["graphdb.framework.rest.connectors.service"]).factory("ConnectorsService",r),r.$inject=["ConnectorsRestService"]},128:function(t,e,n){"use strict";n.r(e);n(124);var o=n(117),i=n(25);function r(t){var e=function(e,n){return t.getIndexes(e,n).then((function(t){return Object(o.mapIndexesResponseToSimilarityIndex)(t.data)}))};return{getIndexes:e,getIndexesAsMenuModel:function(t,n){return e(t,n).then((function(t){return t.map((function(t){return new i.SelectMenuOptionsModel({label:t.name,value:t.name})}))}))}}}angular.module("graphdb.framework.core.services.similarity",["graphdb.framework.rest.similarity.service"]).factory("SimilarityService",r),r.$inject=["SimilarityRestService"]},133:function(t,e,n){"use strict";n.r(e),n.d(e,"markdownCodeCopyPlugin",(function(){return r}));var o={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function i(t,e){return e=_.merge({},o,e),function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var r=o[0],a=o[1],s=r[a],c=r[a].content.replaceAll('"',""").replaceAll("'","'"),u=t.apply(void 0,o);return"fence"===s.type&&u.trim()?'<div style="position: relative">\n '.concat(u,'\n <copy-to-clipboard\n style="').concat(e.buttonStyle,'"\n class="').concat(e.buttonClass,'"\n tooltip-text="ttyg.chat_panel.btn.copy_sparql.tooltip"\n text-to-copy="').concat(c,'">\n </copy-to-clipboard>\n </div>'):u}}var r=function(t,e){t.renderer.rules.code_block=i(t.renderer.rules.code_block,e),t.renderer.rules.fence=i(t.renderer.rules.fence,e)}},134:function(t,e,n){"use strict";n.r(e),n.d(e,"markdownOpenInSparqlEditorPlugin",(function(){return r}));var o={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function i(t,e){return e=_.merge({},o,e),function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var r=o[0],a=o[1],s=r[a],c=r[a].content.replaceAll('"',""").replaceAll("'","'"),u=t.apply(void 0,o);return"fence"===s.type&&"sparql"===s.info&&u.trim()?'<div style="position: relative">\n '.concat(u,'\n <open-in-sparql-editor\n style="').concat(e.buttonStyle,'"\n class="').concat(e.buttonClass,'"\n execute-query="').concat(e.executeQuery,'"\n repository-id="').concat(e.repositoryId,'"\n query="').concat(c,'">\n </open-in-sparql-editor>\n </div>'):u}}var r=function(t,e){t.renderer.rules.code_block=i(t.renderer.rules.code_block,e),t.renderer.rules.fence=i(t.renderer.rules.fence,e)}},136:function(t,e,n){"use strict";n.r(e),n.d(e,"connectorTypesListMapper",(function(){return i})),n.d(e,"connectorsMapper",(function(){return r}));var o=n(123),i=function(t){var e=new o.ConnectorTypesListModel;return t?(e.connectors=Object.keys(t).map((function(e){return new o.ConnectorTypeModel({name:e,prefix:t[e]})})),e):e},r=function(t){var e=new o.ConnectorListModel;return t?(e.connectors=t.map((function(t){return new o.ConnectorModel(t)})),e):e}},140:function(t,e,n){"use strict";n.r(e),n.d(e,"getHumanReadableTimestamp",(function(){return o}));var o=function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)return"";var i=new Date(n),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(a.getDate()-1);var c=new Date(i.getFullYear(),i.getMonth(),i.getDate()),u=o.timeFormat?e("date")(i,o.timeFormat):"";if(c.getTime()===a.getTime())return t.instant("common.dates.today")+u;if(c.getTime()===s.getTime())return t.instant("common.dates.yesterday")+u;var l=o.dateFormat||"yyyy-MM-dd";return e("date")(i,l)+u}},146:function(t,e,n){"use strict";n.r(e);var o=n(669),i=n(133),r=n(134),a={buttonStyle:"position: absolute; top: 0; right: 0; margin-right: 24px"};function s(t){var e=Object(o.a)().use(i.markdownCodeCopyPlugin).use(r.markdownOpenInSparqlEditorPlugin,a);return{renderMarkdown:function(n,s){try{return t.trustAsHtml(function(t){return t?Object(o.a)().use(i.markdownCodeCopyPlugin,t).use(r.markdownOpenInSparqlEditorPlugin,_.merge({},a,t)):e}(s).render(n))}catch(e){return console.error("Error rendering markdown:",e),t.trustAsHtml(n)}}}}angular.module("graphdb.framework.core.services.markdown-service",[]).service("MarkdownService",s),s.$inject=["$sce"]},164:function(t,e){function n(t){return{restrict:"E",scope:{fieldName:"@",source:"=",onSave:"&",onCancel:"&",onClick:"&",onDblclick:"&",isEditing:"="},templateUrl:"js/angular/core/directives/inline-editable-text/templates/inline-editable-text.template.html",link:function(e,n){e.editableModel={};var o,i=[];e.onKeydown=function(t){"Enter"===t.key?(a(),e.editableModel.text!==e.text&&e.onSave({newText:e.editableModel.text,source:e.source})):"Escape"===t.key&&r()},e.onCancelEditing=function(){r()},e.onSelect=function(){o?(a(),e.onDblclick({source:e.source})):o=t((function(){e.onClick({source:e.source}),a()}),250)};var r=function(){a(),e.onCancel()},a=function(){t.cancel(o),o=void 0};i.push(e.$watch("isEditing",(function(o){o&&(e.editableModel.text=e.source[e.fieldName],t((function(){var t=n.find("input")[0];t.focus(),t.select()}),0))})));e.$on("$destroy",(function(){i.forEach((function(t){return t()})),a()}))}}}angular.module("graphdb.framework.core.directives.inline-editable-text",[]).directive("inlineEditableText",n),n.$inject=["$timeout"]},165:function(t,e,n){"use strict";n.r(e);n(146);function o(t,e){return{template:'<div class="markdown-content" ng-bind-html="markdownContent"></div>',restrict:"E",scope:{content:"@",options:"="},link:function(n,o){n.markdownContent=void 0;var i=function(){n.$evalAsync((function(){var e=o.find(".markdown-content");t(angular.element(e).contents())(n)}))};n.markdownContent=e.renderMarkdown(n.content,n.options),i()}}}angular.module("graphdb.framework.core.directives.markdown-content",["graphdb.framework.core.services.markdown-service"]).directive("markdownContent",o),o.$inject=["$compile","MarkdownService"]},166:function(t,e,n){"use strict";n.r(e);var o=n(1);function i(t,e,n,i){return{template:'\n <style>\n .open-in-sparql-editor-btn {\n line-height: 0.75;\n }\n .open-in-sparql-editor-btn .fa:nth-child(2) {\n margin-left: -0.2em;\n margin-right: -0.2em;\n font-size: 0.9em;\n }\n </style>\n <button class="btn btn-link btn-sm open-in-sparql-editor-btn" gdb-tooltip="{{\'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip\' | translate}}" ng-click="onGoToSparqlEditorView()" guide-selector="open-in-sparql-editor-btn">\n <i class="fa fa-bracket-curly"></i><i class="fa fa-ellipsis"></i><i class="fa fa-bracket-curly-right"></i>\n </button>\n ',restrict:"E",scope:{query:"@",repositoryId:"@",executeQuery:"@"},link:function(r,a){r.tooltipText="ttyg.chat_panel.btn.open_in_sparql_editor.tooltip";var s="true"===r.executeQuery;r.onGoToSparqlEditorView=function(){var i=t.getActiveRepository();i&&i===r.repositoryId?c(r.query):n.openConfirmationModal({title:e.instant("common.confirm"),message:Object(o.decodeHTML)(e.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:r.repositoryId})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){t.setRepository(t.getRepository(r.repositoryId)),c(r.query)}))};var c=function(t){i.open("/sparql?query=".concat(encodeURIComponent(t),"&execute=").concat(s),"_blank")}}}}angular.module("graphdb.framework.core.directives.open-in-sparql-editor",[]).directive("openInSparqlEditor",i),i.$inject=["$repositories","$translate","ModalService","$window"]},179:function(t,e,n){"use strict";n.r(e);n(128),n(126),n(142),n(26);function o(t,e,n,o,i){t.agentInstructionsExplain=i.agentInstructionsExplain,t.close=function(){e.dismiss({})},t.onCloseAgentInstructionsExplainModal=function(){e.dismiss({})};var r=[];t.$on("$destroy",(function(){r.forEach((function(t){return t()}))}))}angular.module("graphdb.framework.ttyg.controllers.agent-instructions-explain-modal",[]).controller("AgentInstructionsExplainModalController",o),o.$inject=["$scope","$uibModalInstance","ModalService","$translate","dialogModel"]},190:function(t,e,n){"use strict";n.r(e);n(165),n(166);var o=n(102),i=n(144),r=n(140);function a(t,e,n,a,s){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-item-detail.html",scope:{chatItemDetail:"=",showActions:"=",asking:"=",disabled:"=",onRegenerateQuestion:"&",onAskHowDeliveredAnswer:"&"},link:function(c,u,l){c.ExplainQueryType=i.ExplainQueryType,c.repositoryId=void 0,c.markdownContentOptions=void 0,c.agentNameByIdMap={},c.explainResponseModel={},c.loadingExplainResponse={},c.regenerateQuestion=function(){c.onRegenerateQuestion({chatItem:c.chatItemDetail})},c.explainResponse=function(o){n.hasExplainResponse(o)?n.toggleExplainResponse(o):(c.loadingExplainResponse[o]=!0,a.explainResponse(c.chatItemDetail,o).then((function(t){n.addExplainResponseCache(t)})).catch((function(){t.error(e.instant("ttyg.chat_panel.messages.explain_response_failure"))})).finally((function(){return c.loadingExplainResponse[o]=!1})))},c.onAskHowAnswerWasDerived=function(){c.onAskHowDeliveredAnswer()},c.onOpenInSparqlEditor=function(t){c.chatItemDetail.agentId&&n.emit(o.TTYGEventName.GO_TO_SPARQL_EDITOR,{query:t,repositoryId:c.repositoryId})},c.showRawQuery=function(t){var e=t.rawQuery.replace(/\s+/g,""),n=t.query.replace(/\s+/g,"");return e&&e!==n},c.getRepositoryId=function(t){var e=n.getAgent(c.chatItemDetail.agentId);return e?e.repositoryId:""},c.getHumanReadableQuestionTimestamp=function(t){return Object(r.getHumanReadableTimestamp)(e,s,t)};var d=function(){c.chatItemDetail.answers.forEach((function(t){c.explainResponseModel[t.id]=n.getExplainResponse(t.id)}))},g=[];g.push(n.onExplainResponseCacheUpdated((function(){d()}))),g.push(n.onAgentsListChanged((function(){c.agentNameByIdMap=n.getAgents().agentNameByIdMap}))),c.$on("$destroy",(function(){g.forEach((function(t){return t()}))})),c.repositoryId=c.getRepositoryId(),c.markdownContentOptions={repositoryId:c.repositoryId},d()}}}angular.module("graphdb.framework.ttyg.directives.chat-item-detail",["graphdb.framework.core.directives.open-in-sparql-editor","graphdb.framework.core.directives.markdown-content"]).directive("chatItemDetail",a),a.$inject=["toastr","$translate","TTYGContextService","TTYGService","$filter"]},231:function(t,e,n){"use strict";n.r(e),n.d(e,"status",(function(){return o}));var o={BAD_REQUEST:400,UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,CONFLICT:409,INTERNAL_SERVER_ERROR:500,SERVICE_UNAVAILABLE:503}},239:function(t,e,n){"use strict";n.r(e);n(164);var o=n(102),i=n(140),r=n(1);function a(t,e,n,a){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-list.html",link:function(s){s.selectedChat=void 0,s.renamedChat=void 0,s.deletingChat=void 0,s.onSelectChatForRenaming=function(t){s.renamedChat=t},s.onSelectChat=function(e){if(!s.selectedChat||s.selectedChat.id!==e.id){var n=t.getChats().getNonPersistedChat();n&&t.deleteChat(n),t.selectChat(e),s.renamedChat=void 0}},s.onDeleteChat=function(i){var a=n.instant("ttyg.dialog.delete.title"),s=Object(r.decodeHTML)(n.instant("ttyg.dialog.delete.body",{chatName:i.name}));e.openConfirmation(a,s,(function(){return t.emit(o.TTYGEventName.DELETE_CHAT,i)}))},s.onRenameChat=function(e,n){n.name=e,s.renamedChat=void 0,t.emit(o.TTYGEventName.RENAME_CHAT,n)},s.onExportChat=function(e){t.emit(o.TTYGEventName.CHAT_EXPORT,e)},s.onCancelChatRenaming=function(){s.renamedChat=void 0},s.getHumanReadableChatGroupTimestamp=function(t){return Object(i.getHumanReadableTimestamp)(n,a,t)};var c=function(t){s.selectedChat=t},u=[];u.push(t.onSelectedChatChanged(c)),u.push(t.onSelectedChatUpdated(c)),u.push(t.onChatsListChanged((function(t){s.chatList=t}))),u.push(t.subscribe(o.TTYGEventName.DELETING_CHAT,(function(t){s.deletingChat=t}))),s.$on("$destroy",(function(){u.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.chat-list",["graphdb.framework.core.directives.inline-editable-text"]).directive("chatList",a),a.$inject=["TTYGContextService","ModalService","$translate","$filter"]},240:function(t,e,n){"use strict";n.r(e);n(190);var o=n(102),i=n(108),r=n(112),a=n(24),s=n(1),c=n(137);function u(t,e,n,u){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-panel.html",link:function(t,u,l){t.chat=void 0,t.selectedAgent=void 0,t.chatItem=void 0,t.askingChatItem=void 0,t.waitingForLastMessage=!1,t.loadingChat=!0,t.ask=function(){t.chatItem.question.timestamp=Date.now(),t.askingChatItem=Object(a.cloneDeep)(t.chatItem),t.chatItem.chatId?g(t.chatItem):d(),t.chatItem=p(),h(),m()},t.regenerateQuestion=function(e){var n=p();n.setQuestionMessage(e.getQuestionMessage()),n.question.timestamp=Date.now(),t.askingChatItem=n,g(n),h()},t.onKeypressOnInput=function(e){t.askingChatItem||"Enter"!==e.key||e.shiftKey||e.ctrlKey||t.ask()},t.onAskHowDeliveredAnswer=function(){var n=p();n.setQuestionMessage(e.instant("ttyg.chat_panel.btn.derive_answer.label")),n.question.timestamp=Date.now(),t.askingChatItem=Object(a.cloneDeep)(n),g(n),h()},t.getAgentName=function(t){var o=n.getAgent(t);return o?o.name:Object(s.decodeHTML)(e.instant("ttyg.chat_panel.deleted_agent"))};var d=function(){t.waitingForLastMessage=!0,n.emit(o.TTYGEventName.CREATE_CHAT,t.chatItem)},g=function(e){t.waitingForLastMessage=!0,n.emit(o.TTYGEventName.ASK_QUESTION,e)},f=function(){t.chatItem=Object(a.cloneDeep)(t.askingChatItem),t.askingChatItem=void 0,t.waitingForLastMessage=!1},p=function(){var e=new r.ChatItemModel;return e.question=new i.ChatMessageModel({role:i.CHAT_MESSAGE_ROLE.USER}),t.chat&&(e.chatId=t.chat.id),t.selectedAgent&&(e.agentId=t.selectedAgent.id),e},m=function(){setTimeout((function(){var t=document.querySelector(".question-input");t&&t.focus()}))},h=function(){setTimeout((function(){var t=u.find(".chat-details")[0];t&&(t.scrollTop=t.scrollHeight)}))},y=function(){t.chat=c.ChatModel.getEmptyChat(),t.loadingChat=!1,t.chatItem=p(),t.askingChatItem=void 0,t.waitingForLastMessage=!1,m()},T=[];T.push(t.$watchCollection("chat.chatHistory.items",h)),T.push(n.onSelectedChatUpdated((function(e){if(t.chat=e,e&&(e.id||!t.askingChatItem)){t.loadingChat=!1;var o=t.chatItem.question.message;if(t.chatItem=p(),t.chatItem.question.message=o,t.askingChatItem=void 0,t.chat){var i=t.chat.chatHistory.getLast();i&&i.agentId&&n.selectAgent(n.getAgent(i.agentId))}m()}}))),T.push(n.onLastMessageReceived((function(){t.waitingForLastMessage=!1}))),T.push(n.onSelectedAgentChanged((function(e){t.selectedAgent=e,t.selectedAgent&&t.chatItem&&(t.chatItem.agentId=t.selectedAgent.id),m()}))),T.push(n.onSelectedChatChanged((function(e){e?(t.loadingChat=e&&e.id,t.chatItem=p(),m()):y()}))),T.push(n.subscribe(o.TTYGEventName.LOAD_CHAT_FAILURE,(function(){t.loadingChat=!1,t.chatItem=p(),m()}))),T.push(n.subscribe(o.TTYGEventName.ASK_QUESTION_FAILURE,f)),T.push(n.subscribe(o.TTYGEventName.CREATE_CHAT_FAILURE,f)),T.push(n.subscribe(o.TTYGEventName.DELETE_CHAT_SUCCESSFUL,(function(e){t.chat&&e.id===t.chat.id&&y()}))),t.$on("$destroy",(function(){T.forEach((function(t){return t()}))})),t.chat=c.ChatModel.getEmptyChat(),t.chatItem=p(),m()}}}angular.module("graphdb.framework.ttyg.directives.chat-panel",["graphdb.framework.ttyg.directives.chat-item-detail"]).directive("chatPanel",u),u.$inject=["toastr","$translate","TTYGContextService","$timeout"]},241:function(t,e,n){"use strict";n.r(e);var o=n(1),i=n(102);function r(t,e,n){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-list.html",scope:{agentList:"=",agentListFilterModel:"="},link:function(r,a,s){r.selectedAgent=void 0,r.selectedAgentsFilter=void 0,r.deletingAgent=void 0,r.onEditAgent=function(e){t.emit(i.TTYGEventName.EDIT_AGENT,e)},r.onCloneAgent=function(e){t.emit(i.TTYGEventName.CLONE_AGENT,e)},r.onDeleteAgent=function(r){var a=n.instant("ttyg.agent.delete_agent_modal.title"),s=Object(o.decodeHTML)(n.instant("ttyg.agent.delete_agent_modal.body",{agentName:r.name}));e.openConfirmation(a,s,(function(){return t.emit(i.TTYGEventName.DELETE_AGENT,r)}))},r.onAgentsFilterChange=function(t){r.selectedAgentsFilter=t,r.selectedAgentsFilter&&r.agentList.filterByRepository(r.selectedAgentsFilter.key)};var c=function(){var t=r.agentListFilterModel.find((function(t){return t.selected}));r.selectedAgentsFilter=t||r.agentListFilterModel[0],r.onAgentsFilterChange(r.selectedAgentsFilter)},u=[];u.push(r.$watch("agentListFilterModel",c)),u.push(t.subscribe(i.TTYGEventName.DELETING_AGENT,(function(t){r.deletingAgent=t}))),u.push(t.onSelectedAgentChanged((function(t){r.selectedAgent=t}))),r.$on("$destroy",(function(){u.forEach((function(t){return t()}))})),c()}}}angular.module("graphdb.framework.ttyg.directives.agent-list",[]).directive("agentList",r),r.$inject=["TTYGContextService","ModalService","$translate"]},242:function(t,e,n){"use strict";n.r(e);var o=n(25),i=n(102);function r(t,e,n,r){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-select-menu.html",scope:{},link:function(n){n.agentOptionsList=[],n.selectedAgent=void 0,n.onAgentSelected=function(o){if(a(o),n.selectedAgent=o,t.selectAgent(o),o.isRepositoryDeleted){var s=e.instant("ttyg.agent.agent_select_menu.configure_agent_modal.title"),c=e.instant("ttyg.agent.agent_select_menu.configure_agent_modal.body");r.openConfirmation(s,c,(function(){return t.emit(i.TTYGEventName.EDIT_AGENT,o)}))}};var a=function(t){n.agentOptionsList.forEach((function(e){e.selected=e.data.agent===t}))},s=function(t){n.agentOptionsList=t.agents.map((function(t){return new o.SelectMenuOptionsModel({value:t.id,label:t.name,data:{agent:t}})}))},c=[];c.push(t.onAgentsListChanged((function(t){s(t)}))),c.push(t.subscribe(i.TTYGEventName.AGENT_DELETED,(function(e){n.selectedAgent&&n.selectedAgent.id===e.id&&(n.selectedAgent.isDeleted=!0,t.selectAgent(n.selectedAgent))}))),c.push(t.onSelectedAgentChanged((function(t){a(t),n.selectedAgent=t}))),n.$on("$destroy",(function(){c.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.agent-select-menu",[]).directive("agentSelectMenu",r),r.$inject=["TTYGContextService","$translate","$sce","ModalService"]},243:function(t,e,n){"use strict";n.r(e);var o=n(102),i=n(17);function r(t,e){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/no-agents-view.html",scope:{},link:function(n){n.canModifyAgent=!1,n.talkToGraphDocumentationLink=i.DocumentationUrlResolver.getDocumentationUrl(e.productShortVersion,"talk-to-graph.html"),n.onCreateAgent=function(){t.emit(o.TTYGEventName.OPEN_AGENT_SETTINGS)};var r=[];r.push(t.onCanUpdateAgentUpdated((function(t){n.canModifyAgent=t}))),n.$on("$destroy",(function(){r.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.no-agents-view",[]).directive("noAgentsView",r),r.$inject=["TTYGContextService","productInfo"]},244:function(t,e){angular.module("graphdb.framework.ttyg.directives.show-tooltip-on-overflow",[]).directive("showTooltipOnOverflow",(function(){return{link:function(t,e){setTimeout((function(){var n=e[0].querySelector(".editable-text-element");n&&(n.scrollWidth>n.clientWidth?e.attr("title",t.chat.name):e.removeAttr("title"))}),0)}}}))},245:function(t,e,n){"use strict";n.r(e);var o=n(1),i=n(143),r=(n(128),n(126),n(142),n(26),n(179),n(12)),a=n(102),s=n(129),c=n(37);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=u(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d(t,e,n,u,d,g,f,p,m,h,y,T,v,E,S,A,C){t.AGENT_OPERATION=s.AGENT_OPERATION,t.operation=T.operation,t.savingAgent=!1,t.agentFormModel=T.agentFormModel,t.activeRepositoryInfo=T.activeRepositoryInfo,t.extractionMethodLoaderFlags=l({},i.ExtractionMethod.SIMILARITY,!1),t.activeRepositoryList=T.activeRepositoryList,t.extractionMethods=i.ExtractionMethod,t.additionalExtractionMethods=i.AdditionalExtractionMethod,t.ExtractionMethodTemplates=S,t.showAdvancedSettings=!1,t.showHighTemperatureWarning=!1,t.showSystemInstructionWarning=!1,t.similarityIndexes=[],t.retrievalConnectors=[],t.ftsEnabled=!1,t.autocompleteSuggestions=[],t.toggleExtractionMethod=function(e){e.expanded=e.selected,t.agentSettingsForm.extractionMethods.$setTouched(),x(),G[e.method](e)},t.onExtractionMethodPanelToggle=function(t){t.toggleCollapse(),G[t.method](t)},t.toggleAdditionalExtractionMethod=function(e){e.expanded=e.selected,t.checkAutocompleteIndexEnabled(),k[e.method](e)},t.onAdditionalExtractionMethodPanelToggle=function(t){t.toggleCollapse(),k[t.method](t)},t.getModelHelpMessage=function(){var t=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.model.hint"));return p.trustAsHtml(t)},t.getFTSDisabledHelpMessage=function(){var e=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.fts_search.fts_disabled_message",{repositoryEditPage:"#/repository/edit/"+t.agentFormModel.repositoryId}));return p.trustAsHtml(e)},t.getAutocompleteDisabledHelpMessage=function(){var t=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.additional_query_methods.autocomplete_disabled_message",{autocompleteIndexPage:"#/autocomplete"}));return p.trustAsHtml(t)},t.goToCreateSimilarityView=function(){v.emit(a.TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW,{repositoryId:t.agentFormModel.repositoryId})},t.goToConnectorsView=function(){v.emit(a.TTYGEventName.GO_TO_CONNECTORS_VIEW,{repositoryId:t.agentFormModel.repositoryId})},t.ok=function(){var e=t.agentFormModel.toPayload();return b[t.operation](e)},t.cancel=function(){e.dismiss({})},t.close=function(){e.dismiss({})},t.updateSimilaritySearchPanel=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t.agentFormModel.assistantExtractionMethods.getSimilarityExtractionMethod();n.selected&&(e&&(n.similarityIndex=null),L(n))},t.updateRetrievalConnectorPanel=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t.agentFormModel.assistantExtractionMethods.getRetrievalExtractionMethod();n.selected&&(e&&(n.retrievalConnectorInstance=null),M(n))},t.checkIfFTSEnabled=function(){t.agentFormModel.repositoryId?t.agentFormModel.assistantExtractionMethods.getFTSSearchExtractionMethod().selected?(t.extractionMethodLoaderFlags[i.ExtractionMethod.FTS_SEARCH]=!0,f.getRepositoryModel({id:t.agentFormModel.repositoryId}).then((function(e){t.ftsEnabled=e.getParamValue(r.REPOSITORY_PARAMS.enableFtsIndex)})).catch((function(t){w(t,"ttyg.agent.messages.error_repository_config_loading")})).finally((function(){t.extractionMethodLoaderFlags[i.ExtractionMethod.FTS_SEARCH]=!1,t.agentSettingsForm.$setValidity("FTSDisabled",t.ftsEnabled)}))):t.agentSettingsForm.$setValidity("FTSDisabled",!0):t.agentSettingsForm.$setValidity("FTSDisabled",!1)},t.onRepositoryChange=function(){F(!0,!0)},t.checkAutocompleteIndexEnabled=function(){A.checkAutocompleteStatus().then((function(e){t.autocompleteEnabled=e})).catch((function(t){m.error(getError(t))}))},t.onRestoreDefaultSystemInstructions=function(){t.agentFormModel.instructions.systemInstruction=t.agentFormModel.instructions.systemInstructionCopy},t.onRestoreDefaultUserInstructions=function(){t.agentFormModel.instructions.userInstruction=t.agentFormModel.instructions.userInstructionCopy},t.onTemperatureChange=function(){t.showHighTemperatureWarning=t.agentFormModel.temperature.value>1},t.onSystemInstructionChange=function(){""===t.agentFormModel.instructions.systemInstruction||t.showSystemInstructionWarning||(t.showSystemInstructionWarning=!0,n.openModalAlert({title:y.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.title"),message:y.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.body")}).result.then((function(){}))),""===t.agentFormModel.instructions.systemInstruction&&(t.showSystemInstructionWarning=!1)},t.onExplainAgentSettings=function(){var e=t.agentFormModel.toPayload();E.explainAgentSettings(e).then((function(t){var e={templateUrl:"js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html",controller:"AgentInstructionsExplainModalController",windowClass:"agent-instructions-explain-modal",backdrop:"static",resolve:{dialogModel:function(){return{agentInstructionsExplain:t}}},size:"lg"};u.open(e).result.then((function(){}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))}))},t.getSuggestions=function(e){var n=e.target.value;C.getAutocompleteSuggestions(n).then(c.mapUriAsNtripleAutocompleteResponse).then((function(e){t.autocompleteSuggestions=e.map((function(t){return{text:t.value}}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))}))};var b=l(l(l({},s.AGENT_OPERATION.CREATE,(function(t){return _(t)})),s.AGENT_OPERATION.EDIT,(function(t){return I(t)})),s.AGENT_OPERATION.CLONE,(function(t){return R(t)})),_=function(n){return t.savingAgent=!0,E.createAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},I=function(n){return t.savingAgent=!0,E.editAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},R=function(n){return t.savingAgent=!0,E.createAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},w=function(t,e){console.error(t),m.error(y.instant(e))},x=function(){t.agentSettingsForm.extractionMethods.$setValidity("required",t.agentFormModel.hasExtractionMethodSelected())},O=function(){var e=t.activeRepositoryList.find((function(e){return e.value===t.agentFormModel.repositoryId}));return{repositoryId:e?e.data.repository.id:void 0,repositoryLocation:e?e.data.repository.location:void 0}},L=function(e){if(e.selected||t.agentSettingsForm.$setValidity("missingIndex",!0),e.expanded){t.extractionMethodLoaderFlags[e.method]=!0;var n=O();d.getIndexesAsMenuModel(n.repositoryId,n.repositoryLocation).then((function(n){t.similarityIndexes=n,t.agentSettingsForm.$setValidity("missingIndex",!e.selected||!(!n||!n.length)),N(t.similarityIndexes,e)})).catch((function(e){t.agentSettingsForm.$setValidity("missingIndex",!1),w(e,"ttyg.agent.messages.error_similarity_indexes_loading")})).finally((function(){t.extractionMethodLoaderFlags[e.method]=!1}))}},N=function(t,e){if(0!==t.length){var n=t.find((function(t){return t.value===e.similarityIndex}));e.similarityIndex=n?n.value:t[0].value}else e.similarityIndex=null},M=function(e){if(e.selected||t.agentSettingsForm.$setValidity("missingConnector",!0),e.expanded){t.extractionMethodLoaderFlags[e.method]=!0;var n=O();g.getConnectorPrefixByName("ChatGPT Retrieval",n.repositoryId,n.repositoryLocation).then((function(t){return g.getConnectorsByTypeAsSelectMenuOptions(t,n.repositoryId,n.repositoryLocation)})).then((function(n){t.retrievalConnectors=n,t.agentSettingsForm.$setValidity("missingConnector",!e.selected||!(!n||!n.length)),D(t.retrievalConnectors,e)})).catch((function(e){t.agentSettingsForm.$setValidity("missingConnector",!1),w(e,"ttyg.agent.messages.error_retrieval_connectors_loading")})).finally((function(){t.extractionMethodLoaderFlags[e.method]=!1}))}},D=function(t,e){if(0!==t.length){var n=t.find((function(t){return t.value===e.retrievalConnectorInstance}));e.retrievalConnectorInstance=n?n.value:t[0].value}else e.retrievalConnectorInstance=null},G=l(l(l(l({},i.ExtractionMethod.FTS_SEARCH,(function(e){t.checkIfFTSEnabled()})),i.ExtractionMethod.SPARQL,(function(t){})),i.ExtractionMethod.SIMILARITY,(function(t){return L(t)})),i.ExtractionMethod.RETRIEVAL,(function(t){return M(t)})),k=l(l({},i.AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH,(function(t){return $(t)})),i.AdditionalExtractionMethod.IRI_DISCOVERY_SEARCH,(function(){})),$=function(){t.checkAutocompleteIndexEnabled()},F=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.checkIfFTSEnabled(),t.updateSimilaritySearchPanel(e),t.updateRetrievalConnectorPanel(n),t.checkAutocompleteIndexEnabled()},U=function(){document.hidden||F()};document.addEventListener("visibilitychange",U),t.$on("$destroy",(function(){document.removeEventListener("visibilitychange",U)}));setTimeout(x,0)}angular.module("graphdb.framework.ttyg.controllers.agent-settings-modal",["graphdb.framework.core.services.similarity","graphdb.framework.core.services.connectors","graphdb.framework.rest.repositories.service","graphdb.framework.ttyg.controllers.agent-instructions-explain-modal","ngTagsInput"]).constant("ExtractionMethodTemplates",{iri_discovery_search:"iri-discovery-search"}).controller("AgentSettingsModalController",d),d.$inject=["$scope","$uibModalInstance","ModalService","$uibModal","SimilarityService","ConnectorsService","RepositoriesRestService","$sce","toastr","UriUtils","$translate","dialogModel","TTYGContextService","TTYGService","ExtractionMethodTemplates","AutocompleteService","AutocompleteRestService"]},246:function(t,e){function n(t,e){var n={agent:{id:void 0},chat:{id:void 0}},o=function(){var o=t.get(e.TTYG);return o||(o=n),o.agent||(o.agent={}),o.chat||(o.chat={}),o};return{saveAgent:function(n){var i=o();i.agent.id=n?n.id:void 0,t.set(e.TTYG,i)},getAgentId:function(){var t=o();if(t.agent)return t.agent.id},saveChat:function(n){var i=o();i.chat.id=n?n.id:void 0,t.set(e.TTYG,i)},getChatId:function(){var t=o();if(t.chat)return t.chat.id}}}angular.module("graphdb.framework.ttyg.services.ttygstorage",[]).factory("TTYGStorageService",n),n.$inject=["LocalStorageAdapter","LSKeys"]},247:function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,a(o.key),o)}}function r(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}n.r(e),n.d(e,"AgentSettingsModal",(function(){return s}));var s=r((function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.activeRepositoryInfo=e,this.activeRepositoryList=n,this.agentFormModel=o,this.operation=i}))},371:function(t,e,n){"use strict";n.r(e);n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(142);var o=n(102),i=(n(246),n(129)),r=n(143),a=n(137),s=n(214),c=n(25),u=n(38),l=n(639),d=n(247),g=n(1),f=n(231),p=n(149);function m(t){return function(t){if(Array.isArray(t))return h(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){if("string"==typeof t)return h(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}(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 h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function y(t,e,n,h,y,T,v,E,S,A,C,b,_,I,R){var w=[],x={filter_all:v.instant("ttyg.agent.btn.filter.all")};h.helpTemplateUrl="js/angular/ttyg/templates/chatInfo.html",h.isHelpVisible=!1,h.showChats=!0,h.showAgents=!1,h.chats=void 0,h.loadingChats=!1,h.loadingChat=!1,h.initialized=!1,h.agents=void 0,h.selectedAgent=void 0,h.loadingAgents=!1,h.reloadingAgents=!1,h.connectorID=void 0,h.canModifyAgent=!1,h.agentListFilterModel=[],h.activeRepositoryList=[],h.onopen=h.onclose=function(){return angular.noop()},h.startNewChat=function(){I.deselectChat()},h.toggleChatsListSidebar=function(){h.showChats=!h.showChats},h.toggleAgentsListSidebar=function(){h.showAgents=!h.showAgents},h.onToggleHelp=function(){h.isHelpVisible=!h.isHelpVisible},h.onExportSelectedChat=function(){$(I.getSelectedChat())};var O=function(){var t=I.getDefaultAgent();return t?Promise.resolve(t):_.getDefaultAgent().then((function(t){return I.setDefaultAgent(t),t}))};h.onOpenNewAgentSettings=function(){O().then((function(t){var e=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());t.repositoryId=e.id;var n=Object(s.agentFormModelMapper)(new r.AgentModel({}),t,i.AGENT_OPERATION.CREATE);return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(e,h.activeRepositoryList,n,i.AGENT_OPERATION.CREATE)}},size:"lg"}})).then((function(t){E.open(t).result.then(N)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))},h.onOpenAgentSettings=function(t){var e=t;e||(e=I.getSelectedAgent()),O().then((function(t){var n=Object(s.agentFormModelMapper)(e,t,i.AGENT_OPERATION.EDIT),o=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(o,h.activeRepositoryList,n,i.AGENT_OPERATION.EDIT)}},size:"lg"}})).then((function(t){E.open(t).result.then((function(t){var e=I.getSelectedAgent();e&&t.id===e.id&&I.selectAgent(t),N()}))})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))},h.onOpenCloneAgentSettings=function(t){O().then((function(e){var n=Object(s.agentFormModelMapper)(t,e,i.AGENT_OPERATION.CLONE);n.name="clone-".concat(n.name);var o=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(o,h.activeRepositoryList,n,i.AGENT_OPERATION.CLONE)}},size:"lg"}})).then((function(t){E.open(t).result.then((function(t){var e=I.getSelectedAgent();e&&t.id===e.id&&I.selectAgent(t),N()}))})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))};var L=function(){return h.loadingChats=!0,_.getConversations().then((function(t){return I.updateChats(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH)),k(new a.ChatsListModel)})).finally((function(){h.loadingChats=!1}))},N=function(){return h.reloadingAgents=!0,_.getAgents().then((function(t){return I.updateAgents(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){h.reloadingAgents=!1}))},M=function(){I.setCanModifyAgent(t.isRepoManager())},D=function(t,e,n){var i;if(t.timestamp=n.timestamp,e.answers=e.answers||[],(i=e.answers).push.apply(i,m(n.messages)),I.updateSelectedChat(t),n.continueRunId)I.emit(o.TTYGEventName.CONTINUE_CHAT_RUN,new p.ContinueChatRun(e,n.continueRunId));else{var r=I.getChats();r.updateChatTimestamp(t.id,n.timestamp),r.updateChatName(t.id,n.chatName),t.name=n.name,I.updateChats(r),I.emit(o.TTYGEventName.LAST_MESSAGE_RECEIVED,t)}},G=function(t,e,n){t.chatHistory.appendItem(e),D(t,e,n)},k=function(t){t.isEmpty()?h.showChats=!1:(h.showChats=!0,I.getSelectedChat()||R.getChatId()||I.selectChat(h.chats.getFirstChat()))},$=function(t){_.exportConversation(t.id).then((function(e){var n=e.data,i=e.filename;Object(l.saveAs)(n,i),I.emit(o.TTYGEventName.CHAT_EXPORT_SUCCESSFUL,t)})).catch((function(){I.emit(o.TTYGEventName.CHAT_EXPORT_FAILURE),A.error(v.instant("ttyg.chat.messages.export_failure"))}))},F=function(){var t=S.getActiveRepository(),e=S.getLocalReadableGraphdbRepositories().map((function(e){return new r.AgentListFilterModel(e.id,e.id,e.id===t)}));h.agentListFilterModel=[new r.AgentListFilterModel(i.AGENTS_FILTER_ALL_KEY,x.filter_all)].concat(m(e))},U=function(t){C.openModalAlert({title:v.instant("ttyg.chat.dialog.chat_is_missing.title"),message:v.instant("ttyg.chat.dialog.chat_is_missing.body")}).result.then((function(){I.deleteChat(t)}))},P=function(){e.open("/similarity/index/create","_blank")},H=function(){e.open("/connectors","_blank")},j=function(t){e.open("/sparql?query=".concat(encodeURIComponent(t),"&execute=true"),"_blank")},Y=function(){var t=R.getChatId(),e=I.getChats();t&&e.getChat(t)&&I.selectChat(I.getChats().getChat(t))};w.push(h.$watch(h.getActiveRepositoryObject,(function(t){t&&(h.activeRepositoryList=S.getLocalReadableGraphdbRepositories().map((function(t){return new c.SelectMenuOptionsModel({value:t.id,label:t.id,data:{repository:t}})})),function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return h.loadingAgents=t,_.getAgents().then((function(t){return I.updateAgents(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){h.loadingAgents=!1}))}().then((function(){return h.initialized=!0,F(),L()})).then(Y),M())}))),w.push(I.onSelectedChatChanged((function(t){t&&t.id?_.getConversation(t.id).then((function(e){I.updateSelectedChat(e),R.saveChat(t)})).catch((function(e){e.status===f.status.NOT_FOUND&&(U(t),I.emit(o.TTYGEventName.LOAD_CHAT_FAILURE,t))})):t&&I.updateSelectedChat(t)}))),w.push(I.onChatsListChanged((function(t){h.chats=t,k(t)}))),w.push(I.onCanUpdateAgentUpdated((function(t){h.canModifyAgent=t}))),w.push(I.subscribe(I.onAgentsListChanged((function(t){h.agents=t})))),w.push(I.subscribe(o.TTYGEventName.CREATE_CHAT,(function(t){var e=I.getChats().getNonPersistedChat();e||(e=a.ChatModel.getEmptyChat(),I.addChat(e)),I.selectChat(e),_.createConversation(t).then((function(e){I.emit(o.TTYGEventName.CREATE_CHAT_SUCCESSFUL);var n=I.getSelectedChat();if(n&&!n.id){n.id=e.chatId,t.chatId=e.chatId;var i=I.getChats().getNonPersistedChat();I.replaceChat(n,i),R.saveChat(n),G(n,t,e)}})).catch((function(t){I.emit(o.TTYGEventName.CREATE_CHAT_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.RENAME_CHAT,(function(t){_.renameConversation(t).then((function(){I.emit(o.TTYGEventName.RENAME_CHAT_SUCCESSFUL),I.emit(o.TTYGEventName.LOAD_CHATS)})).catch((function(){I.emit(o.TTYGEventName.RENAME_CHAT_FAILURE),A.error(v.instant("ttyg.chat.messages.rename_failure"))}))}))),w.push(I.subscribe(o.TTYGEventName.DELETE_CHAT,(function(t){I.emit(o.TTYGEventName.DELETING_CHAT,{chatId:t.id,inProgress:!0}),_.deleteConversation(t.id).then((function(){I.emit(o.TTYGEventName.DELETE_CHAT_SUCCESSFUL,t);var e=I.getChats();e.deleteChat(t),I.updateChats(e)})).catch((function(){I.emit(o.TTYGEventName.DELETE_CHAT_FAILURE),A.error(v.instant("ttyg.chat.messages.delete_failure"))})).finally((function(){return I.emit(o.TTYGEventName.DELETING_CHAT,{chatId:t.id,inProgress:!1})}))}))),w.push(I.subscribe(o.TTYGEventName.CHAT_EXPORT,$)),w.push(I.subscribe(o.TTYGEventName.ASK_QUESTION,(function(t){_.askQuestion(t).then((function(e){var n=I.getSelectedChat();n&&n.id===t.chatId&&G(n,t,e)})).catch((function(t){I.emit(o.TTYGEventName.ASK_QUESTION_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.CONTINUE_CHAT_RUN,(function(t){_.continueChatRun(t).then((function(e){var n=t.chatId,o=I.getSelectedChat();if(o&&o.id===n){var i=o.chatHistory.items,r=i[i.length-1];D(o,r,e)}})).catch((function(t){I.emit(o.TTYGEventName.ASK_QUESTION_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.LOAD_CHATS,L)),w.push(I.subscribe(o.TTYGEventName.OPEN_AGENT_SETTINGS,h.onOpenNewAgentSettings)),w.push(I.subscribe(o.TTYGEventName.EDIT_AGENT,h.onOpenAgentSettings)),w.push(I.subscribe(o.TTYGEventName.CLONE_AGENT,h.onOpenCloneAgentSettings)),w.push(I.subscribe(o.TTYGEventName.DELETE_AGENT,(function(t){I.emit(o.TTYGEventName.DELETING_AGENT,{agentId:t.id,inProgress:!0}),_.deleteAgent(t.id).then((function(){return N()})).then((function(){I.emit(o.TTYGEventName.AGENT_DELETED,t),h.selectedAgent&&h.selectedAgent.id===t.id&&(h.selectedAgent=void 0)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){I.emit(o.TTYGEventName.DELETING_AGENT,{agentId:t.id,inProgress:!1})}))}))),w.push(I.subscribe(o.TTYGEventName.AGENT_SELECTED,(function(t){h.selectedAgent=t}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmationModal({title:v.instant("common.confirm"),message:Object(g.decodeHTML)(v.instant("ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_similarity.body",{repositoryId:e.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){S.setRepository(e),P()}))}else P()}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_CONNECTORS_VIEW,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmationModal({title:v.instant("common.confirm"),message:Object(g.decodeHTML)(v.instant("ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_connectors.body",{repositoryId:e.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){S.setRepository(e),H()}))}else H()}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_SPARQL_EDITOR,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmation(v.instant("common.confirm"),Object(g.decodeHTML)(v.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:t.repositoryId})),(function(){S.setRepository(e),j(t.query)}))}else j(t.query)}))),w.push(n.$on("$translateChangeSuccess",(function(){x.filter_all=v.instant("ttyg.agent.btn.filter.all"),F()}))),w.push(n.$on("securityInit",M)),h.$on("$destroy",(function(){w.forEach((function(t){return t()})),I.resetContext()}))}angular.module("graphdb.framework.ttyg.controllers.ttyg-view",["toastr","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.ttyg-service","graphdb.framework.ttyg.services.ttygcontext","graphdb.framework.ttyg.services.ttygstorage","graphdb.framework.ttyg.directives.chat-list","graphdb.framework.ttyg.directives.chat-panel","graphdb.framework.ttyg.directives.agent-list","graphdb.framework.ttyg.directives.agent-select-menu","graphdb.framework.ttyg.directives.no-agents-view","graphdb.framework.ttyg.directives.show-tooltip-on-overflow","graphdb.framework.ttyg.controllers.agent-settings-modal"]).controller("TTYGViewCtrl",y),y.$inject=["$jwtAuth","$window","$rootScope","$scope","$http","$timeout","$translate","$uibModal","$repositories","toastr","ModalService","LocalStorageAdapter","TTYGService","TTYGContextService","TTYGStorageService"]},483:function(t,e,n){"use strict";n.r(e);n(371),n(659);angular.module("graphdb.framework.ttyg",["ngRoute","graphdb.framework.ttyg.controllers.ttyg-view"])},638:function(t,e){(function(e){t.exports=e}).call(this,{})},639:function(t,e,n){var o,i=i||function(t){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},o=e.createElementNS("http://www.w3.org/1999/xhtml","a"),i=t.webkitRequestFileSystem,r=t.requestFileSystem||i||t.mozRequestFileSystem,a=function(e){(t.setImmediate||t.setTimeout)((function(){throw e}),0)},s=0,c=function(e){var o=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};t.chrome?o():setTimeout(o,500)},u=function(t,e,n){for(var o=(e=[].concat(e)).length;o--;){var i=t["on"+e[o]];if("function"==typeof i)try{i.call(t,n||t)}catch(t){a(t)}}},l=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},d=function(e,a){e=l(e);var d,g,f,p=this,m=e.type,h=!1,y=function(){u(p,"writestart progress write writeend".split(" "))},T=function(){(!h&&d||(d=n().createObjectURL(e)),g)?g.location.href=d:null==t.open(d,"_blank")&&"undefined"!=typeof safari&&(t.location.href=d);p.readyState=p.DONE,y(),c(d)},v=function(t){return function(){if(p.readyState!==p.DONE)return t.apply(this,arguments)}},E={create:!0,exclusive:!1};if(p.readyState=p.INIT,a||(a="download"),o)return d=n().createObjectURL(e),o.href=d,o.download=a,void setTimeout((function(){var t,e;t=o,e=new MouseEvent("click"),t.dispatchEvent(e),y(),c(d),p.readyState=p.DONE}));t.chrome&&m&&"application/octet-stream"!==m&&(f=e.slice||e.webkitSlice,e=f.call(e,0,e.size,"application/octet-stream"),h=!0),i&&"download"!==a&&(a+=".download"),("application/octet-stream"===m||i)&&(g=t),r?(s+=e.size,r(t.TEMPORARY,s,v((function(t){t.root.getDirectory("saved",E,v((function(t){var n=function(){t.getFile(a,E,v((function(t){t.createWriter(v((function(n){n.onwriteend=function(e){g.location.href=t.toURL(),p.readyState=p.DONE,u(p,"writeend",e),c(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&T()},"writestart progress write abort".split(" ").forEach((function(t){n["on"+t]=p["on"+t]})),n.write(e),p.abort=function(){n.abort(),p.readyState=p.DONE},p.readyState=p.WRITING})),T)})),T)};t.getFile(a,{create:!1},v((function(t){t.remove(),n()})),v((function(t){t.code===t.NOT_FOUND_ERR?n():T()})))})),T)})),T)):T()},g=d.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e){return navigator.msSaveOrOpenBlob(l(t),e)}:(g.abort=function(){this.readyState=this.DONE,u(this,"abort")},g.readyState=g.INIT=0,g.WRITING=1,g.DONE=2,g.error=g.onwritestart=g.onprogress=g.onwrite=g.onabort=g.onerror=g.onwriteend=null,function(t,e){return new d(t,e)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[29,20,30,35,36,47,68,69,73,82,90,97,121,149,150,151,171,174,179,180,242,259,318,319,354,363,378,379,383,384,385],{102:function(t,e,n){"use strict";n.r(e),n.d(e,"TTYGEventName",(function(){return r}));var o=n(24);function i(t){var e=void 0,n=void 0,i=void 0,a=void 0,s={},c=void 0,u=!1,l=function(){return Object(o.cloneDeep)(e)},d=function(){return Object(o.cloneDeep)(n)},g=function(t){n=Object(o.cloneDeep)(t),T(r.CHAT_LIST_UPDATED,d())},f=function(){return Object(o.cloneDeep)(i)},p=function(){return Object(o.cloneDeep)(a)},m=function(){return Object(o.cloneDeep)(s)},h=function(t){return!!s[t]},y=function(){return u},T=function(e,n){t.emitSync(e,Object(o.cloneDeep)(n))},v=function(e,n){return t.subscribeSync(e,(function(t){return n(t)}))};return{resetContext:function(){e=void 0,n=void 0,i=void 0,a=void 0,s={},c=void 0,u=!1},emit:T,subscribe:v,getChats:d,updateChats:g,addChat:function(t){n.appendChat(t),g(n)},replaceChat:function(t,e){n.replaceChat(t,e),g(n)},onChatsListChanged:function(t){return n&&angular.isFunction(t)&&t(d()),v(r.CHAT_LIST_UPDATED,(function(e){return t(e)}))},getSelectedChat:f,selectChat:function(t){i&&i.id===t.id||(i=Object(o.cloneDeep)(t),T(r.SELECT_CHAT,f()))},deselectChat:function(){i=void 0,T(r.SELECT_CHAT,f())},deleteChat:function(t){n.deleteChat(t),g(n)},onSelectedChatChanged:function(t){return angular.isFunction(t)&&t(f()),v(r.SELECT_CHAT,(function(e){return t(e)}))},updateSelectedChat:function(t){i&&i.id&&t&&i.id!==t.id||(i=Object(o.cloneDeep)(t),T(r.SELECTED_CHAT_UPDATED,f()))},onSelectedChatUpdated:function(t){return i&&angular.isFunction(t)&&t(f()),v(r.SELECTED_CHAT_UPDATED,(function(e){return t(e)}))},onLastMessageReceived:function(t){return i&&angular.isFunction(t)&&t(f()),v(r.LAST_MESSAGE_RECEIVED,(function(e){return t(e)}))},updateAgents:function(t){e=Object(o.cloneDeep)(t),T(r.AGENT_LIST_UPDATED,l())},onAgentsListChanged:function(t){return e&&angular.isFunction(t)&&t(l()),v(r.AGENT_LIST_UPDATED,(function(e){return t(e)}))},getAgents:l,getAgent:function(t){if(e)return Object(o.cloneDeep)(e.getAgent(t))},selectAgent:function(t){a=Object(o.cloneDeep)(t),T(r.AGENT_SELECTED,p())},getSelectedAgent:p,onSelectedAgentChanged:function(t){return a&&angular.isFunction(t)&&t(p()),v(r.AGENT_SELECTED,(function(e){return t(e)}))},getDefaultAgent:function(){return Object(o.cloneDeep)(c)},setDefaultAgent:function(t){c=t},setCanModifyAgent:function(t){u=Object(o.cloneDeep)(t),T(r.CAN_MODIFY_AGENT_UPDATED,y())},getCanModifyAgent:y,onCanUpdateAgentUpdated:function(t){return angular.isFunction(t)&&t(y()),v(r.CAN_MODIFY_AGENT_UPDATED,(function(e){return t(e)}))},hasExplainResponse:h,toggleExplainResponse:function(t){h(t)&&(s[t].expanded=!s[t].expanded,T(r.EXPLAIN_RESPONSE_CACHE_UPDATED,m()))},getExplainResponse:function(t){return Object(o.cloneDeep)(s[t])},addExplainResponseCache:function(t){s[t.answerId]=Object(o.cloneDeep)(t),T(r.EXPLAIN_RESPONSE_CACHE_UPDATED,m())},onExplainResponseCacheUpdated:function(t){return angular.isFunction(t)&&t(m()),v(r.EXPLAIN_RESPONSE_CACHE_UPDATED,(function(e){return t(e)}))}}}angular.module("graphdb.framework.ttyg.services.ttygcontext",[]).factory("TTYGContextService",i),i.$inject=["EventEmitterService","TTYGService"];var r={CREATE_CHAT:"createChat",CREATE_CHAT_SUCCESSFUL:"chatCreated",CREATE_CHAT_FAILURE:"chatCreationFailed",RENAME_CHAT:"renameChat",RENAME_CHAT_SUCCESSFUL:"chatRenamed",RENAME_CHAT_FAILURE:"chatRenamedFailure",SELECT_CHAT:"selectChat",SELECTED_CHAT_UPDATED:"selectChatUpdated",LAST_MESSAGE_RECEIVED:"lastMessageReceived",DELETING_CHAT:"deletingChat",DELETE_CHAT:"deleteChat",DELETE_CHAT_SUCCESSFUL:"chatDeleted",DELETE_CHAT_FAILURE:"chatDeletedFailure",CHAT_EXPORT:"chatExport",CHAT_EXPORT_SUCCESSFUL:"chatExportSuccess",CHAT_EXPORT_FAILURE:"chatExportFailure",CHAT_LIST_UPDATED:"chatListUpdated",ASK_QUESTION:"askQuestion",ASK_QUESTION_FAILURE:"askQuestionFailure",CONTINUE_CHAT_RUN:"continueChatRun",LOAD_CHATS:"loadChats",LOAD_CHAT_SUCCESSFUL:"loadChatSuccess",LOAD_CHAT_FAILURE:"loadChatFailure",AGENT_LIST_UPDATED:"agentListUpdated",OPEN_AGENT_SETTINGS:"openAgentSettings",EDIT_AGENT:"editAgent",CLONE_AGENT:"cloneAgent",DELETE_AGENT:"deleteAgent",AGENT_DELETED:"agentDeleted",DELETING_AGENT:"deletingAgent",AGENT_SELECTED:"agentSelected",GO_TO_CREATE_SIMILARITY_VIEW:"goToCreateSimilarityView",GO_TO_CONNECTORS_VIEW:"goToConnectorsView",EXPLAIN_RESPONSE:"explainResponse",EXPLAIN_RESPONSE_CACHE_UPDATED:"explainResponseCacheUpdated",GO_TO_SPARQL_EDITOR:"openQueryInSparqlEditor",CAN_MODIFY_AGENT_UPDATED:"canModifyAgentUpdated"}},106:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndexType",(function(){return o}));var o={TEXT:"text",TEXT_LITERAL:"textLiteral",PREDICATION:"predication",isTextType:function(t){return o.TEXT===t},isTextLiteralType:function(t){return o.TEXT_LITERAL===t},isPredicationType:function(t){return o.PREDICATION===t}}},107:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndexStatus",(function(){return o}));var o={CREATING:"CREATING",BUILDING:"BUILDING",BUILT:"BUILT",REBUILDING:"REBUILDING",OUTDATED:"OUTDATED",INTERRUPTED:"INTERRUPTED",OBSOLETE:"OBSOLETE",FAILED:"FAILED",isCreatingStatus:function(t){return o.CREATING===t},isBuildingStatus:function(t){return o.BUILDING===t},isBuiltStatus:function(t){return o.BUILT===t},isRebuildingStatus:function(t){return o.REBUILDING===t},isOutdatedStatus:function(t){return o.OUTDATED===t},isInterruptedStatus:function(t){return o.INTERRUPTED===t},isObsoleteStatus:function(t){return o.OBSOLETE===t},isFailedStatus:function(t){return o.FAILED===t}}},110:function(t,e,n){"use strict";n.r(e),n.d(e,"SimilarityIndex",(function(){return c}));var o=n(106),i=n(107);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}}function s(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}var c=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.analyzer="",this.infer=!0,this.options="",this.sameAs=!0,this.searchQuery="",this.selectQuery="",this.stopList=void 0,this.name="",this.type=o.SimilarityIndexType.TEXT,this.status=void 0,this.analogicalQuery=void 0,this.inputIndex=void 0,this.isLiteralIndex=""},(e=[{key:"isTextType",value:function(){return o.SimilarityIndexType.isTextType(this.type)}},{key:"isTextLiteralType",value:function(){return o.SimilarityIndexType.isTextLiteralType(this.type)}},{key:"isPredicationType",value:function(){return o.SimilarityIndexType.isPredicationType(this.type)}},{key:"isCreatingStatus",value:function(){return i.SimilarityIndexStatus.isCreatingStatus(this.status)}},{key:"isBuildingStatus",value:function(){return i.SimilarityIndexStatus.isBuildingStatus(this.status)}},{key:"isBuiltStatus",value:function(){return i.SimilarityIndexStatus.isBuiltStatus(this.status)}},{key:"isRebuildingStatus",value:function(){return i.SimilarityIndexStatus.isRebuildingStatus(this.status)}},{key:"isOutdatedStatus",value:function(){return i.SimilarityIndexStatus.isOutdatedStatus(this.status)}},{key:"isInterruptedStatus",value:function(){return i.SimilarityIndexStatus.isInterruptedStatus(this.status)}},{key:"isObsoleteStatus",value:function(){return i.SimilarityIndexStatus.isObsoleteStatus(this.status)}},{key:"isFailedStatus",value:function(){return i.SimilarityIndexStatus.isFailedStatus(this.status)}}])&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}()},111:function(t,e){angular.module("graphdb.framework.rest.connectors.service",[]).factory("ConnectorsRestService",n),n.$inject=["$http"];function n(t){return{getConnectors:function(e,n){if(e)return t.get("rest/connectors",{headers:{"X-GraphDB-Repository":e,"X-GraphDB-Repository-Location":n}});return t.get("rest/connectors")},initConnector:function(e){return t.get("".concat("rest/connectors","/options?prefix=").concat(e))},hasConnector:function(e,n,o){if(n)return t.get("".concat("rest/connectors","/existing?prefix=").concat(e),{headers:{"X-GraphDB-Repository":n,"X-GraphDB-Repository-Location":o}});return t.get("".concat("rest/connectors","/existing?prefix=").concat(e))},checkConnector:function(e){return t.post("".concat("rest/connectors","/check"),e,{headers:{"Content-Type":"text/plain"}})}}}},117:function(t,e,n){"use strict";n.r(e),n.d(e,"mapIndexesResponseToSimilarityIndex",(function(){return i}));var o=n(110),i=function(t){return t.map((function(t){var e=new o.SimilarityIndex;return e.type=t.type,e.stopList=t.stopList,e.status=t.status,e.selectQuery=t.selectQuery,e.searchQuery=t.searchQuery,e.sameAs=t.sameAs,e.options=t.options,e.name=t.name,e.infer=t.infer,e.analyzer=t.analyzer,e.analogicalQuery=t.analogicalQuery,e}))}},123:function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}}function a(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}n.r(e),n.d(e,"ConnectorTypesListModel",(function(){return c})),n.d(e,"ConnectorTypeModel",(function(){return u})),n.d(e,"ConnectorListModel",(function(){return l})),n.d(e,"ConnectorModel",(function(){return d})),n.d(e,"ConnectorSettingsModel",(function(){return g}));var c=function(){return a((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),this._connectors=e.connectors||[]}),[{key:"getConnectorByName",value:function(t){return this._connectors.find((function(e){return e.name===t}))}},{key:"connectors",get:function(){return this._connectors},set:function(t){this._connectors=t}}])}(),u=function(){return a((function t(e){i(this,t),this._name=e.name,this._prefix=e.prefix}),[{key:"name",get:function(){return this._name},set:function(t){this._name=t}},{key:"prefix",get:function(){return this._prefix},set:function(t){this._prefix=t}}])}(),l=function(){return a((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];i(this,t),this._connectors=e.connectors}),[{key:"connectors",get:function(){return this._connectors},set:function(t){this._connectors=t}}])}(),d=function(){return a((function t(e){i(this,t),this._name=e.name,this._settings=new g(e)}),[{key:"settings",get:function(){return this._settings},set:function(t){this._settings=t}},{key:"name",get:function(){return this._name},set:function(t){this._name=t}}])}(),g=function(){return a((function t(e){i(this,t),this._settings=e.values||{}}),[{key:"settings",get:function(){return this._settings},set:function(t){this._settings=t}}])}()},124:function(t,e){angular.module("graphdb.framework.rest.similarity.service",[]).factory("SimilarityRestService",n),n.$inject=["$http","$repositories"];function n(t){return{getIndexes:function(e,n){if(e)return t.get("rest/similarity",{headers:{"X-GraphDB-Repository":e,"X-GraphDB-Repository-Location":n}});return t.get("rest/similarity")},getSearchQueries:function(){return t.get("".concat("rest/similarity","/config"))},rebuildIndex:function(t){return e("PUT",t.name,t.options,t.selectQuery,t.searchQuery,t.analogicalQuery,t.stopList,t.infer,t.sameAs,t.type)},deleteIndex:function(e){return t.delete("".concat("rest/similarity","?name=").concat(e.name))},createIndex:e,getSamples:function(){return t.get("".concat("rest/similarity","/samples"))},getQuery:function(e){return t.get("rest/similarity/query",{params:{name:e.indexName,options:e.indexOptions,stopList:e.indexStopList,selectQuery:e.query,infer:e.queryInference,sameAs:e.querySameAs,type:e.viewType,analyzer:e.indexAnalyzer}})},saveSearchQuery:function(e){return t({method:"put",url:"rest/similarity/search-query",data:e})}};function e(e,n,o,i,r,a,s,c,u,l,d){return t({method:e,url:"".concat("rest/similarity"),noCancelOnRouteChange:!0,data:{name:n,options:o,selectQuery:i,stopList:s,infer:c,sameAs:u,type:l,analyzer:d,searchQuery:r,analogicalQuery:a}})}}},126:function(t,e,n){"use strict";n.r(e);n(111);var o=n(136),i=n(25);function r(t){var e=function(e,n){return t.getConnectors(e,n).then((function(t){return Object(o.connectorTypesListMapper)(t.data)}))},n=function(e,n,i){return t.hasConnector(encodeURIComponent(e),n,i).then((function(t){return Object(o.connectorsMapper)(t.data)}))};return{getConnectorTypes:e,getConnectorsByType:n,getConnectorPrefixByName:function(t,n,o){return e(n,o).then((function(e){var n=e.getConnectorByName(t);return n?n.prefix:null}))},getConnectorsByTypeAsSelectMenuOptions:function(t,e,o){return n(t,e,o).then((function(t){return t.connectors.map((function(t){return new i.SelectMenuOptionsModel({value:t.name,label:t.name})}))}))}}}angular.module("graphdb.framework.core.services.connectors",["graphdb.framework.rest.connectors.service"]).factory("ConnectorsService",r),r.$inject=["ConnectorsRestService"]},128:function(t,e,n){"use strict";n.r(e);n(124);var o=n(117),i=n(25);function r(t){var e=function(e,n){return t.getIndexes(e,n).then((function(t){return Object(o.mapIndexesResponseToSimilarityIndex)(t.data)}))};return{getIndexes:e,getIndexesAsMenuModel:function(t,n){return e(t,n).then((function(t){return t.map((function(t){return new i.SelectMenuOptionsModel({label:t.name,value:t.name})}))}))}}}angular.module("graphdb.framework.core.services.similarity",["graphdb.framework.rest.similarity.service"]).factory("SimilarityService",r),r.$inject=["SimilarityRestService"]},133:function(t,e,n){"use strict";n.r(e),n.d(e,"markdownCodeCopyPlugin",(function(){return r}));var o={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function i(t,e){return e=_.merge({},o,e),function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var r=o[0],a=o[1],s=r[a],c=r[a].content.replaceAll('"',""").replaceAll("'","'"),u=t.apply(void 0,o);return"fence"===s.type&&u.trim()?'<div style="position: relative">\n '.concat(u,'\n <copy-to-clipboard\n style="').concat(e.buttonStyle,'"\n class="').concat(e.buttonClass,'"\n tooltip-text="ttyg.chat_panel.btn.copy_sparql.tooltip"\n text-to-copy="').concat(c,'">\n </copy-to-clipboard>\n </div>'):u}}var r=function(t,e){t.renderer.rules.code_block=i(t.renderer.rules.code_block,e),t.renderer.rules.fence=i(t.renderer.rules.fence,e)}},134:function(t,e,n){"use strict";n.r(e),n.d(e,"markdownOpenInSparqlEditorPlugin",(function(){return r}));var o={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function i(t,e){return e=_.merge({},o,e),function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var r=o[0],a=o[1],s=r[a],c=r[a].content.replaceAll('"',""").replaceAll("'","'"),u=t.apply(void 0,o);return"fence"===s.type&&"sparql"===s.info&&u.trim()?'<div style="position: relative">\n '.concat(u,'\n <open-in-sparql-editor\n style="').concat(e.buttonStyle,'"\n class="').concat(e.buttonClass,'"\n execute-query="').concat(e.executeQuery,'"\n repository-id="').concat(e.repositoryId,'"\n query="').concat(c,'">\n </open-in-sparql-editor>\n </div>'):u}}var r=function(t,e){t.renderer.rules.code_block=i(t.renderer.rules.code_block,e),t.renderer.rules.fence=i(t.renderer.rules.fence,e)}},136:function(t,e,n){"use strict";n.r(e),n.d(e,"connectorTypesListMapper",(function(){return i})),n.d(e,"connectorsMapper",(function(){return r}));var o=n(123),i=function(t){var e=new o.ConnectorTypesListModel;return t?(e.connectors=Object.keys(t).map((function(e){return new o.ConnectorTypeModel({name:e,prefix:t[e]})})),e):e},r=function(t){var e=new o.ConnectorListModel;return t?(e.connectors=t.map((function(t){return new o.ConnectorModel(t)})),e):e}},140:function(t,e,n){"use strict";n.r(e),n.d(e,"getHumanReadableTimestamp",(function(){return o}));var o=function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)return"";var i=new Date(n),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(a);s.setDate(a.getDate()-1);var c=new Date(i.getFullYear(),i.getMonth(),i.getDate()),u=o.timeFormat?e("date")(i,o.timeFormat):"";if(c.getTime()===a.getTime())return t.instant("common.dates.today")+u;if(c.getTime()===s.getTime())return t.instant("common.dates.yesterday")+u;var l=o.dateFormat||"yyyy-MM-dd";return e("date")(i,l)+u}},146:function(t,e,n){"use strict";n.r(e);var o=n(669),i=n(133),r=n(134),a={buttonStyle:"position: absolute; top: 0; right: 0; margin-right: 24px"};function s(t){var e=Object(o.a)().use(i.markdownCodeCopyPlugin).use(r.markdownOpenInSparqlEditorPlugin,a);return{renderMarkdown:function(n,s){try{return t.trustAsHtml(function(t){return t?Object(o.a)().use(i.markdownCodeCopyPlugin,t).use(r.markdownOpenInSparqlEditorPlugin,_.merge({},a,t)):e}(s).render(n))}catch(e){return console.error("Error rendering markdown:",e),t.trustAsHtml(n)}}}}angular.module("graphdb.framework.core.services.markdown-service",[]).service("MarkdownService",s),s.$inject=["$sce"]},164:function(t,e){function n(t){return{restrict:"E",scope:{fieldName:"@",source:"=",onSave:"&",onCancel:"&",onClick:"&",onDblclick:"&",isEditing:"="},templateUrl:"js/angular/core/directives/inline-editable-text/templates/inline-editable-text.template.html",link:function(e,n){e.editableModel={};var o,i=[];e.onKeydown=function(t){"Enter"===t.key?(a(),e.editableModel.text!==e.text&&e.onSave({newText:e.editableModel.text,source:e.source})):"Escape"===t.key&&r()},e.onCancelEditing=function(){r()},e.onSelect=function(){o?(a(),e.onDblclick({source:e.source})):o=t((function(){e.onClick({source:e.source}),a()}),250)};var r=function(){a(),e.onCancel()},a=function(){t.cancel(o),o=void 0};i.push(e.$watch("isEditing",(function(o){o&&(e.editableModel.text=e.source[e.fieldName],t((function(){var t=n.find("input")[0];t.focus(),t.select()}),0))})));e.$on("$destroy",(function(){i.forEach((function(t){return t()})),a()}))}}}angular.module("graphdb.framework.core.directives.inline-editable-text",[]).directive("inlineEditableText",n),n.$inject=["$timeout"]},165:function(t,e,n){"use strict";n.r(e);n(146);function o(t,e){return{template:'<div class="markdown-content" ng-bind-html="markdownContent"></div>',restrict:"E",scope:{content:"@",options:"="},link:function(n,o){n.markdownContent=void 0;var i=function(){n.$evalAsync((function(){var e=o.find(".markdown-content");t(angular.element(e).contents())(n)}))};n.markdownContent=e.renderMarkdown(n.content,n.options),i()}}}angular.module("graphdb.framework.core.directives.markdown-content",["graphdb.framework.core.services.markdown-service"]).directive("markdownContent",o),o.$inject=["$compile","MarkdownService"]},166:function(t,e,n){"use strict";n.r(e);var o=n(1);function i(t,e,n,i){return{template:'\n <style>\n .open-in-sparql-editor-btn {\n line-height: 0.75;\n }\n .open-in-sparql-editor-btn .fa:nth-child(2) {\n margin-left: -0.2em;\n margin-right: -0.2em;\n font-size: 0.9em;\n }\n </style>\n <button class="btn btn-link btn-sm open-in-sparql-editor-btn" gdb-tooltip="{{\'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip\' | translate}}" ng-click="onGoToSparqlEditorView()" guide-selector="open-in-sparql-editor-btn">\n <i class="fa fa-bracket-curly"></i><i class="fa fa-ellipsis"></i><i class="fa fa-bracket-curly-right"></i>\n </button>\n ',restrict:"E",scope:{query:"@",repositoryId:"@",executeQuery:"@"},link:function(r,a){r.tooltipText="ttyg.chat_panel.btn.open_in_sparql_editor.tooltip";var s="true"===r.executeQuery;r.onGoToSparqlEditorView=function(){var i=t.getActiveRepository();i&&i===r.repositoryId?c(r.query):n.openConfirmationModal({title:e.instant("common.confirm"),message:Object(o.decodeHTML)(e.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:r.repositoryId})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){t.setRepository(t.getRepository(r.repositoryId)),c(r.query)}))};var c=function(t){i.open("/sparql?query=".concat(encodeURIComponent(t),"&execute=").concat(s),"_blank")}}}}angular.module("graphdb.framework.core.directives.open-in-sparql-editor",[]).directive("openInSparqlEditor",i),i.$inject=["$repositories","$translate","ModalService","$window"]},179:function(t,e,n){"use strict";n.r(e);n(128),n(126),n(142),n(26);function o(t,e,n,o,i){t.agentInstructionsExplain=i.agentInstructionsExplain,t.close=function(){e.dismiss({})},t.onCloseAgentInstructionsExplainModal=function(){e.dismiss({})};var r=[];t.$on("$destroy",(function(){r.forEach((function(t){return t()}))}))}angular.module("graphdb.framework.ttyg.controllers.agent-instructions-explain-modal",[]).controller("AgentInstructionsExplainModalController",o),o.$inject=["$scope","$uibModalInstance","ModalService","$translate","dialogModel"]},190:function(t,e,n){"use strict";n.r(e);n(165),n(166);var o=n(102),i=n(144),r=n(140);function a(t,e,n,a,s){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-item-detail.html",scope:{chatItemDetail:"=",showActions:"=",asking:"=",disabled:"=",onRegenerateQuestion:"&",onAskHowDeliveredAnswer:"&"},link:function(c,u,l){c.ExplainQueryType=i.ExplainQueryType,c.repositoryId=void 0,c.markdownContentOptions=void 0,c.agentNameByIdMap={},c.explainResponseModel={},c.loadingExplainResponse={},c.regenerateQuestion=function(){c.onRegenerateQuestion({chatItem:c.chatItemDetail})},c.explainResponse=function(o){n.hasExplainResponse(o)?n.toggleExplainResponse(o):(c.loadingExplainResponse[o]=!0,a.explainResponse(c.chatItemDetail,o).then((function(t){n.addExplainResponseCache(t)})).catch((function(){t.error(e.instant("ttyg.chat_panel.messages.explain_response_failure"))})).finally((function(){return c.loadingExplainResponse[o]=!1})))},c.onAskHowAnswerWasDerived=function(){c.onAskHowDeliveredAnswer()},c.onOpenInSparqlEditor=function(t){c.chatItemDetail.agentId&&n.emit(o.TTYGEventName.GO_TO_SPARQL_EDITOR,{query:t,repositoryId:c.repositoryId})},c.showRawQuery=function(t){var e=t.rawQuery.replace(/\s+/g,""),n=t.query.replace(/\s+/g,"");return e&&e!==n},c.getRepositoryId=function(t){var e=n.getAgent(c.chatItemDetail.agentId);return e?e.repositoryId:""},c.getHumanReadableQuestionTimestamp=function(t){return Object(r.getHumanReadableTimestamp)(e,s,t)};var d=function(){c.chatItemDetail.answers.forEach((function(t){c.explainResponseModel[t.id]=n.getExplainResponse(t.id)}))},g=[];g.push(n.onExplainResponseCacheUpdated((function(){d()}))),g.push(n.onAgentsListChanged((function(){c.agentNameByIdMap=n.getAgents().agentNameByIdMap}))),c.$on("$destroy",(function(){g.forEach((function(t){return t()}))})),c.repositoryId=c.getRepositoryId(),c.markdownContentOptions={repositoryId:c.repositoryId},d()}}}angular.module("graphdb.framework.ttyg.directives.chat-item-detail",["graphdb.framework.core.directives.open-in-sparql-editor","graphdb.framework.core.directives.markdown-content"]).directive("chatItemDetail",a),a.$inject=["toastr","$translate","TTYGContextService","TTYGService","$filter"]},231:function(t,e,n){"use strict";n.r(e),n.d(e,"status",(function(){return o}));var o={BAD_REQUEST:400,UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,CONFLICT:409,INTERNAL_SERVER_ERROR:500,SERVICE_UNAVAILABLE:503}},239:function(t,e,n){"use strict";n.r(e);n(164);var o=n(102),i=n(140),r=n(1);function a(t,e,n,a){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-list.html",link:function(s){s.selectedChat=void 0,s.renamedChat=void 0,s.deletingChat=void 0,s.onSelectChatForRenaming=function(t){s.renamedChat=t},s.onSelectChat=function(e){if(!s.selectedChat||s.selectedChat.id!==e.id){var n=t.getChats().getNonPersistedChat();n&&t.deleteChat(n),t.selectChat(e),s.renamedChat=void 0}},s.onDeleteChat=function(i){var a=n.instant("ttyg.dialog.delete.title"),s=Object(r.decodeHTML)(n.instant("ttyg.dialog.delete.body",{chatName:i.name}));e.openConfirmation(a,s,(function(){return t.emit(o.TTYGEventName.DELETE_CHAT,i)}))},s.onRenameChat=function(e,n){n.name=e,s.renamedChat=void 0,t.emit(o.TTYGEventName.RENAME_CHAT,n)},s.onExportChat=function(e){t.emit(o.TTYGEventName.CHAT_EXPORT,e)},s.onCancelChatRenaming=function(){s.renamedChat=void 0},s.getHumanReadableChatGroupTimestamp=function(t){return Object(i.getHumanReadableTimestamp)(n,a,t)};var c=function(t){s.selectedChat=t},u=[];u.push(t.onSelectedChatChanged(c)),u.push(t.onSelectedChatUpdated(c)),u.push(t.onChatsListChanged((function(t){s.chatList=t}))),u.push(t.subscribe(o.TTYGEventName.DELETING_CHAT,(function(t){s.deletingChat=t}))),s.$on("$destroy",(function(){u.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.chat-list",["graphdb.framework.core.directives.inline-editable-text"]).directive("chatList",a),a.$inject=["TTYGContextService","ModalService","$translate","$filter"]},240:function(t,e,n){"use strict";n.r(e);n(190);var o=n(102),i=n(108),r=n(112),a=n(24),s=n(1),c=n(137);function u(t,e,n,u){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-panel.html",link:function(t,u,l){t.chat=void 0,t.selectedAgent=void 0,t.chatItem=void 0,t.askingChatItem=void 0,t.waitingForLastMessage=!1,t.loadingChat=!0,t.ask=function(){t.chatItem.question.timestamp=Date.now(),t.askingChatItem=Object(a.cloneDeep)(t.chatItem),t.chatItem.chatId?g(t.chatItem):d(),t.chatItem=p(),h(),m()},t.regenerateQuestion=function(e){var n=p();n.setQuestionMessage(e.getQuestionMessage()),n.question.timestamp=Date.now(),t.askingChatItem=n,g(n),h()},t.onKeypressOnInput=function(e){t.askingChatItem||"Enter"!==e.key||e.shiftKey||e.ctrlKey||t.ask()},t.onAskHowDeliveredAnswer=function(){var n=p();n.setQuestionMessage(e.instant("ttyg.chat_panel.btn.derive_answer.label")),n.question.timestamp=Date.now(),t.askingChatItem=Object(a.cloneDeep)(n),g(n),h()},t.getAgentName=function(t){var o=n.getAgent(t);return o?o.name:Object(s.decodeHTML)(e.instant("ttyg.chat_panel.deleted_agent"))};var d=function(){t.waitingForLastMessage=!0,n.emit(o.TTYGEventName.CREATE_CHAT,t.chatItem)},g=function(e){t.waitingForLastMessage=!0,n.emit(o.TTYGEventName.ASK_QUESTION,e)},f=function(){t.chatItem=Object(a.cloneDeep)(t.askingChatItem),t.askingChatItem=void 0,t.waitingForLastMessage=!1},p=function(){var e=new r.ChatItemModel;return e.question=new i.ChatMessageModel({role:i.CHAT_MESSAGE_ROLE.USER}),t.chat&&(e.chatId=t.chat.id),t.selectedAgent&&(e.agentId=t.selectedAgent.id),e},m=function(){setTimeout((function(){var t=document.querySelector(".question-input");t&&t.focus()}))},h=function(){setTimeout((function(){var t=u.find(".chat-details")[0];t&&(t.scrollTop=t.scrollHeight)}))},y=function(){t.chat=c.ChatModel.getEmptyChat(),t.loadingChat=!1,t.chatItem=p(),t.askingChatItem=void 0,t.waitingForLastMessage=!1,m()},T=[];T.push(t.$watchCollection("chat.chatHistory.items",h)),T.push(n.onSelectedChatUpdated((function(e){if(t.chat=e,e&&(e.id||!t.askingChatItem)){t.loadingChat=!1;var o=t.chatItem.question.message;if(t.chatItem=p(),t.chatItem.question.message=o,t.askingChatItem=void 0,t.chat){var i=t.chat.chatHistory.getLast();i&&i.agentId&&n.selectAgent(n.getAgent(i.agentId))}m()}}))),T.push(n.onLastMessageReceived((function(){t.waitingForLastMessage=!1}))),T.push(n.onSelectedAgentChanged((function(e){t.selectedAgent=e,t.selectedAgent&&t.chatItem&&(t.chatItem.agentId=t.selectedAgent.id),m()}))),T.push(n.onSelectedChatChanged((function(e){e?(t.loadingChat=e&&e.id,t.chatItem=p(),m()):y()}))),T.push(n.subscribe(o.TTYGEventName.LOAD_CHAT_FAILURE,(function(){t.loadingChat=!1,t.chatItem=p(),m()}))),T.push(n.subscribe(o.TTYGEventName.ASK_QUESTION_FAILURE,f)),T.push(n.subscribe(o.TTYGEventName.CREATE_CHAT_FAILURE,f)),T.push(n.subscribe(o.TTYGEventName.DELETE_CHAT_SUCCESSFUL,(function(e){t.chat&&e.id===t.chat.id&&y()}))),t.$on("$destroy",(function(){T.forEach((function(t){return t()}))})),t.chat=c.ChatModel.getEmptyChat(),t.chatItem=p(),m()}}}angular.module("graphdb.framework.ttyg.directives.chat-panel",["graphdb.framework.ttyg.directives.chat-item-detail"]).directive("chatPanel",u),u.$inject=["toastr","$translate","TTYGContextService","$timeout"]},241:function(t,e,n){"use strict";n.r(e);var o=n(1),i=n(102);function r(t,e,n){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-list.html",scope:{agentList:"=",agentListFilterModel:"="},link:function(r,a,s){r.selectedAgent=void 0,r.selectedAgentsFilter=void 0,r.deletingAgent=void 0,r.onEditAgent=function(e){t.emit(i.TTYGEventName.EDIT_AGENT,e)},r.onCloneAgent=function(e){t.emit(i.TTYGEventName.CLONE_AGENT,e)},r.onDeleteAgent=function(r){var a=n.instant("ttyg.agent.delete_agent_modal.title"),s=Object(o.decodeHTML)(n.instant("ttyg.agent.delete_agent_modal.body",{agentName:r.name}));e.openConfirmation(a,s,(function(){return t.emit(i.TTYGEventName.DELETE_AGENT,r)}))},r.onAgentsFilterChange=function(t){r.selectedAgentsFilter=t,r.selectedAgentsFilter&&r.agentList.filterByRepository(r.selectedAgentsFilter.key)};var c=function(){var t=r.agentListFilterModel.find((function(t){return t.selected}));r.selectedAgentsFilter=t||r.agentListFilterModel[0],r.onAgentsFilterChange(r.selectedAgentsFilter)},u=[];u.push(r.$watch("agentListFilterModel",c)),u.push(t.subscribe(i.TTYGEventName.DELETING_AGENT,(function(t){r.deletingAgent=t}))),u.push(t.onSelectedAgentChanged((function(t){r.selectedAgent=t}))),r.$on("$destroy",(function(){u.forEach((function(t){return t()}))})),c()}}}angular.module("graphdb.framework.ttyg.directives.agent-list",[]).directive("agentList",r),r.$inject=["TTYGContextService","ModalService","$translate"]},242:function(t,e,n){"use strict";n.r(e);var o=n(25),i=n(102);function r(t,e,n,r){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-select-menu.html",scope:{},link:function(n){n.agentOptionsList=[],n.selectedAgent=void 0,n.onAgentSelected=function(o){if(a(o),n.selectedAgent=o,t.selectAgent(o),o.isRepositoryDeleted){var s=e.instant("ttyg.agent.agent_select_menu.configure_agent_modal.title"),c=e.instant("ttyg.agent.agent_select_menu.configure_agent_modal.body");r.openConfirmation(s,c,(function(){return t.emit(i.TTYGEventName.EDIT_AGENT,o)}))}};var a=function(t){n.agentOptionsList.forEach((function(e){e.selected=e.data.agent===t}))},s=function(t){n.agentOptionsList=t.agents.map((function(t){return new o.SelectMenuOptionsModel({value:t.id,label:t.name,data:{agent:t}})}))},c=[];c.push(t.onAgentsListChanged((function(t){s(t)}))),c.push(t.subscribe(i.TTYGEventName.AGENT_DELETED,(function(e){n.selectedAgent&&n.selectedAgent.id===e.id&&(n.selectedAgent.isDeleted=!0,t.selectAgent(n.selectedAgent))}))),c.push(t.onSelectedAgentChanged((function(t){a(t),n.selectedAgent=t}))),n.$on("$destroy",(function(){c.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.agent-select-menu",[]).directive("agentSelectMenu",r),r.$inject=["TTYGContextService","$translate","$sce","ModalService"]},243:function(t,e,n){"use strict";n.r(e);var o=n(102),i=n(17);function r(t,e){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/no-agents-view.html",scope:{},link:function(n){n.canModifyAgent=!1,n.talkToGraphDocumentationLink=i.DocumentationUrlResolver.getDocumentationUrl(e.productShortVersion,"talk-to-graph.html"),n.onCreateAgent=function(){t.emit(o.TTYGEventName.OPEN_AGENT_SETTINGS)};var r=[];r.push(t.onCanUpdateAgentUpdated((function(t){n.canModifyAgent=t}))),n.$on("$destroy",(function(){r.forEach((function(t){return t()}))}))}}}angular.module("graphdb.framework.ttyg.directives.no-agents-view",[]).directive("noAgentsView",r),r.$inject=["TTYGContextService","productInfo"]},244:function(t,e){angular.module("graphdb.framework.ttyg.directives.show-tooltip-on-overflow",[]).directive("showTooltipOnOverflow",(function(){return{link:function(t,e){setTimeout((function(){var n=e[0].querySelector(".editable-text-element");n&&(n.scrollWidth>n.clientWidth?e.attr("title",t.chat.name):e.removeAttr("title"))}),0)}}}))},245:function(t,e,n){"use strict";n.r(e);var o=n(1),i=n(143),r=(n(128),n(126),n(142),n(26),n(179),n(12)),a=n(102),s=n(129),c=n(37);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=u(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d(t,e,n,u,d,g,f,p,m,h,y,T,v,E,S,A,C){t.AGENT_OPERATION=s.AGENT_OPERATION,t.operation=T.operation,t.savingAgent=!1,t.agentFormModel=T.agentFormModel,t.activeRepositoryInfo=T.activeRepositoryInfo,t.extractionMethodLoaderFlags=l({},i.ExtractionMethod.SIMILARITY,!1),t.activeRepositoryList=T.activeRepositoryList,t.extractionMethods=i.ExtractionMethod,t.additionalExtractionMethods=i.AdditionalExtractionMethod,t.ExtractionMethodTemplates=S,t.showAdvancedSettings=!1,t.showHighTemperatureWarning=!1,t.showSystemInstructionWarning=!1,t.similarityIndexes=[],t.retrievalConnectors=[],t.ftsEnabled=!1,t.autocompleteSuggestions=[],t.toggleExtractionMethod=function(e){e.expanded=e.selected,t.agentSettingsForm.extractionMethods.$setTouched(),x(),G[e.method](e)},t.onExtractionMethodPanelToggle=function(t){t.toggleCollapse(),G[t.method](t)},t.toggleAdditionalExtractionMethod=function(e){e.expanded=e.selected,t.checkAutocompleteIndexEnabled(),k[e.method](e)},t.onAdditionalExtractionMethodPanelToggle=function(t){t.toggleCollapse(),k[t.method](t)},t.getModelHelpMessage=function(){var t=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.model.hint"));return p.trustAsHtml(t)},t.getFTSDisabledHelpMessage=function(){var e=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.fts_search.fts_disabled_message",{repositoryEditPage:"#/repository/edit/"+t.agentFormModel.repositoryId}));return p.trustAsHtml(e)},t.getAutocompleteDisabledHelpMessage=function(){var t=Object(o.decodeHTML)(y.instant("ttyg.agent.create_agent_modal.form.additional_query_methods.autocomplete_disabled_message",{autocompleteIndexPage:"#/autocomplete"}));return p.trustAsHtml(t)},t.goToCreateSimilarityView=function(){v.emit(a.TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW,{repositoryId:t.agentFormModel.repositoryId})},t.goToConnectorsView=function(){v.emit(a.TTYGEventName.GO_TO_CONNECTORS_VIEW,{repositoryId:t.agentFormModel.repositoryId})},t.ok=function(){var e=t.agentFormModel.toPayload();return b[t.operation](e)},t.cancel=function(){e.dismiss({})},t.close=function(){e.dismiss({})},t.updateSimilaritySearchPanel=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t.agentFormModel.assistantExtractionMethods.getSimilarityExtractionMethod();n.selected&&(e&&(n.similarityIndex=null),L(n))},t.updateRetrievalConnectorPanel=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=t.agentFormModel.assistantExtractionMethods.getRetrievalExtractionMethod();n.selected&&(e&&(n.retrievalConnectorInstance=null),M(n))},t.checkIfFTSEnabled=function(){t.agentFormModel.repositoryId?t.agentFormModel.assistantExtractionMethods.getFTSSearchExtractionMethod().selected?(t.extractionMethodLoaderFlags[i.ExtractionMethod.FTS_SEARCH]=!0,f.getRepositoryModel({id:t.agentFormModel.repositoryId}).then((function(e){t.ftsEnabled=e.getParamValue(r.REPOSITORY_PARAMS.enableFtsIndex)})).catch((function(t){w(t,"ttyg.agent.messages.error_repository_config_loading")})).finally((function(){t.extractionMethodLoaderFlags[i.ExtractionMethod.FTS_SEARCH]=!1,t.agentSettingsForm.$setValidity("FTSDisabled",t.ftsEnabled)}))):t.agentSettingsForm.$setValidity("FTSDisabled",!0):t.agentSettingsForm.$setValidity("FTSDisabled",!1)},t.onRepositoryChange=function(){F(!0,!0)},t.checkAutocompleteIndexEnabled=function(){A.checkAutocompleteStatus().then((function(e){t.autocompleteEnabled=e})).catch((function(t){m.error(getError(t))}))},t.onRestoreDefaultSystemInstructions=function(){t.agentFormModel.instructions.systemInstruction=t.agentFormModel.instructions.systemInstructionCopy},t.onRestoreDefaultUserInstructions=function(){t.agentFormModel.instructions.userInstruction=t.agentFormModel.instructions.userInstructionCopy},t.onTemperatureChange=function(){t.showHighTemperatureWarning=t.agentFormModel.temperature.value>1},t.onSystemInstructionChange=function(){""===t.agentFormModel.instructions.systemInstruction||t.showSystemInstructionWarning||(t.showSystemInstructionWarning=!0,n.openModalAlert({title:y.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.title"),message:y.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.body")}).result.then((function(){}))),""===t.agentFormModel.instructions.systemInstruction&&(t.showSystemInstructionWarning=!1)},t.onExplainAgentSettings=function(){var e=t.agentFormModel.toPayload();E.explainAgentSettings(e).then((function(t){var e={templateUrl:"js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html",controller:"AgentInstructionsExplainModalController",windowClass:"agent-instructions-explain-modal",backdrop:"static",resolve:{dialogModel:function(){return{agentInstructionsExplain:t}}},size:"lg"};u.open(e).result.then((function(){}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))}))},t.getSuggestions=function(e){var n=e.target.value;C.getAutocompleteSuggestions(n).then(c.mapUriAsNtripleAutocompleteResponse).then((function(e){t.autocompleteSuggestions=e.map((function(t){return{text:t.value}}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))}))};var b=l(l(l({},s.AGENT_OPERATION.CREATE,(function(t){return _(t)})),s.AGENT_OPERATION.EDIT,(function(t){return I(t)})),s.AGENT_OPERATION.CLONE,(function(t){return R(t)})),_=function(n){return t.savingAgent=!0,E.createAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},I=function(n){return t.savingAgent=!0,E.editAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},R=function(n){return t.savingAgent=!0,E.createAgent(n).then((function(t){e.close(t),m.success(y.instant("ttyg.agent.messages.agent_save_successfully",{agentName:t.name}))})).catch((function(t){m.error(getError(t,0,s.TTYG_ERROR_MSG_LENGTH))})).finally((function(){t.savingAgent=!1}))},w=function(t,e){console.error(t),m.error(y.instant(e))},x=function(){t.agentSettingsForm.extractionMethods.$setValidity("required",t.agentFormModel.hasExtractionMethodSelected())},O=function(){var e=t.activeRepositoryList.find((function(e){return e.value===t.agentFormModel.repositoryId}));return{repositoryId:e?e.data.repository.id:void 0,repositoryLocation:e?e.data.repository.location:void 0}},L=function(e){if(e.selected||t.agentSettingsForm.$setValidity("missingIndex",!0),e.expanded){t.extractionMethodLoaderFlags[e.method]=!0;var n=O();d.getIndexesAsMenuModel(n.repositoryId,n.repositoryLocation).then((function(n){t.similarityIndexes=n,t.agentSettingsForm.$setValidity("missingIndex",!e.selected||!(!n||!n.length)),N(t.similarityIndexes,e)})).catch((function(e){t.agentSettingsForm.$setValidity("missingIndex",!1),w(e,"ttyg.agent.messages.error_similarity_indexes_loading")})).finally((function(){t.extractionMethodLoaderFlags[e.method]=!1}))}},N=function(t,e){if(0!==t.length){var n=t.find((function(t){return t.value===e.similarityIndex}));e.similarityIndex=n?n.value:t[0].value}else e.similarityIndex=null},M=function(e){if(e.selected||t.agentSettingsForm.$setValidity("missingConnector",!0),e.expanded){t.extractionMethodLoaderFlags[e.method]=!0;var n=O();g.getConnectorPrefixByName("ChatGPT Retrieval",n.repositoryId,n.repositoryLocation).then((function(t){return g.getConnectorsByTypeAsSelectMenuOptions(t,n.repositoryId,n.repositoryLocation)})).then((function(n){t.retrievalConnectors=n,t.agentSettingsForm.$setValidity("missingConnector",!e.selected||!(!n||!n.length)),D(t.retrievalConnectors,e)})).catch((function(e){t.agentSettingsForm.$setValidity("missingConnector",!1),w(e,"ttyg.agent.messages.error_retrieval_connectors_loading")})).finally((function(){t.extractionMethodLoaderFlags[e.method]=!1}))}},D=function(t,e){if(0!==t.length){var n=t.find((function(t){return t.value===e.retrievalConnectorInstance}));e.retrievalConnectorInstance=n?n.value:t[0].value}else e.retrievalConnectorInstance=null},G=l(l(l(l({},i.ExtractionMethod.FTS_SEARCH,(function(e){t.checkIfFTSEnabled()})),i.ExtractionMethod.SPARQL,(function(t){})),i.ExtractionMethod.SIMILARITY,(function(t){return L(t)})),i.ExtractionMethod.RETRIEVAL,(function(t){return M(t)})),k=l(l({},i.AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH,(function(t){return $(t)})),i.AdditionalExtractionMethod.IRI_DISCOVERY_SEARCH,(function(){})),$=function(){t.checkAutocompleteIndexEnabled()},F=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.checkIfFTSEnabled(),t.updateSimilaritySearchPanel(e),t.updateRetrievalConnectorPanel(n),t.checkAutocompleteIndexEnabled()},U=function(){document.hidden||F()};document.addEventListener("visibilitychange",U),t.$on("$destroy",(function(){document.removeEventListener("visibilitychange",U)}));setTimeout(x,0)}angular.module("graphdb.framework.ttyg.controllers.agent-settings-modal",["graphdb.framework.core.services.similarity","graphdb.framework.core.services.connectors","graphdb.framework.rest.repositories.service","graphdb.framework.ttyg.controllers.agent-instructions-explain-modal","ngTagsInput"]).constant("ExtractionMethodTemplates",{iri_discovery_search:"iri-discovery-search"}).controller("AgentSettingsModalController",d),d.$inject=["$scope","$uibModalInstance","ModalService","$uibModal","SimilarityService","ConnectorsService","RepositoriesRestService","$sce","toastr","UriUtils","$translate","dialogModel","TTYGContextService","TTYGService","ExtractionMethodTemplates","AutocompleteService","AutocompleteRestService"]},246:function(t,e){function n(t,e){var n={agent:{id:void 0},chat:{id:void 0}},o=function(){var o=t.get(e.TTYG);return o||(o=n),o.agent||(o.agent={}),o.chat||(o.chat={}),o};return{saveAgent:function(n){var i=o();i.agent.id=n?n.id:void 0,t.set(e.TTYG,i)},getAgentId:function(){var t=o();if(t.agent)return t.agent.id},saveChat:function(n){var i=o();i.chat.id=n?n.id:void 0,t.set(e.TTYG,i)},getChatId:function(){var t=o();if(t.chat)return t.chat.id}}}angular.module("graphdb.framework.ttyg.services.ttygstorage",[]).factory("TTYGStorageService",n),n.$inject=["LocalStorageAdapter","LSKeys"]},247:function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,a(o.key),o)}}function r(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}n.r(e),n.d(e,"AgentSettingsModal",(function(){return s}));var s=r((function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.activeRepositoryInfo=e,this.activeRepositoryList=n,this.agentFormModel=o,this.operation=i}))},371:function(t,e,n){"use strict";n.r(e);n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(142);var o=n(102),i=(n(246),n(129)),r=n(143),a=n(137),s=n(214),c=n(25),u=n(38),l=n(639),d=n(247),g=n(1),f=n(231),p=n(149);function m(t){return function(t){if(Array.isArray(t))return h(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){if("string"==typeof t)return h(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}(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 h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function y(t,e,n,h,y,T,v,E,S,A,C,b,_,I,R){var w=[],x={filter_all:v.instant("ttyg.agent.btn.filter.all")};h.helpTemplateUrl="js/angular/ttyg/templates/chatInfo.html",h.isHelpVisible=!1,h.showChats=!0,h.showAgents=!1,h.chats=void 0,h.loadingChats=!1,h.loadingChat=!1,h.initialized=!1,h.agents=void 0,h.selectedAgent=void 0,h.loadingAgents=!1,h.reloadingAgents=!1,h.connectorID=void 0,h.canModifyAgent=!1,h.agentListFilterModel=[],h.activeRepositoryList=[],h.onopen=h.onclose=function(){return angular.noop()},h.startNewChat=function(){I.deselectChat()},h.toggleChatsListSidebar=function(){h.showChats=!h.showChats},h.toggleAgentsListSidebar=function(){h.showAgents=!h.showAgents},h.onToggleHelp=function(){h.isHelpVisible=!h.isHelpVisible},h.onExportSelectedChat=function(){$(I.getSelectedChat())};var O=function(){var t=I.getDefaultAgent();return t?Promise.resolve(t):_.getDefaultAgent().then((function(t){return I.setDefaultAgent(t),t}))};h.onOpenNewAgentSettings=function(){O().then((function(t){var e=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());t.repositoryId=e.id;var n=Object(s.agentFormModelMapper)(new r.AgentModel({}),t,i.AGENT_OPERATION.CREATE);return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(e,h.activeRepositoryList,n,i.AGENT_OPERATION.CREATE)}},size:"lg"}})).then((function(t){E.open(t).result.then(N)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))},h.onOpenAgentSettings=function(t){var e=t;e||(e=I.getSelectedAgent()),O().then((function(t){var n=Object(s.agentFormModelMapper)(e,t,i.AGENT_OPERATION.EDIT),o=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(o,h.activeRepositoryList,n,i.AGENT_OPERATION.EDIT)}},size:"lg"}})).then((function(t){E.open(t).result.then((function(t){var e=I.getSelectedAgent();e&&t.id===e.id&&I.selectAgent(t),N()}))})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))},h.onOpenCloneAgentSettings=function(t){O().then((function(e){var n=Object(s.agentFormModelMapper)(t,e,i.AGENT_OPERATION.CLONE);n.name="clone-".concat(n.name);var o=Object(u.repositoryInfoMapper)(S.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new d.AgentSettingsModal(o,h.activeRepositoryList,n,i.AGENT_OPERATION.CLONE)}},size:"lg"}})).then((function(t){E.open(t).result.then((function(t){var e=I.getSelectedAgent();e&&t.id===e.id&&I.selectAgent(t),N()}))})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))};var L=function(){return h.loadingChats=!0,_.getConversations().then((function(t){return I.updateChats(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH)),k(new a.ChatsListModel)})).finally((function(){h.loadingChats=!1}))},N=function(){return h.reloadingAgents=!0,_.getAgents().then((function(t){return I.updateAgents(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){h.reloadingAgents=!1}))},M=function(){I.setCanModifyAgent(t.isRepoManager())},D=function(t,e,n){var i;if(t.timestamp=n.timestamp,e.answers=e.answers||[],(i=e.answers).push.apply(i,m(n.messages)),I.updateSelectedChat(t),n.continueRunId)I.emit(o.TTYGEventName.CONTINUE_CHAT_RUN,new p.ContinueChatRun(e,n.continueRunId));else{var r=I.getChats();r.updateChatTimestamp(t.id,n.timestamp),r.updateChatName(t.id,n.chatName),t.name=n.name,I.updateChats(r),I.emit(o.TTYGEventName.LAST_MESSAGE_RECEIVED,t)}},G=function(t,e,n){t.chatHistory.appendItem(e),D(t,e,n)},k=function(t){t.isEmpty()?h.showChats=!1:(h.showChats=!0,I.getSelectedChat()||R.getChatId()||I.selectChat(h.chats.getFirstChat()))},$=function(t){_.exportConversation(t.id).then((function(e){var n=e.data,i=e.filename;Object(l.saveAs)(n,i),I.emit(o.TTYGEventName.CHAT_EXPORT_SUCCESSFUL,t)})).catch((function(){I.emit(o.TTYGEventName.CHAT_EXPORT_FAILURE),A.error(v.instant("ttyg.chat.messages.export_failure"))}))},F=function(){var t=S.getActiveRepository(),e=S.getLocalReadableGraphdbRepositories().map((function(e){return new r.AgentListFilterModel(e.id,e.id,e.id===t)}));h.agentListFilterModel=[new r.AgentListFilterModel(i.AGENTS_FILTER_ALL_KEY,x.filter_all)].concat(m(e))},U=function(t){C.openModalAlert({title:v.instant("ttyg.chat.dialog.chat_is_missing.title"),message:v.instant("ttyg.chat.dialog.chat_is_missing.body")}).result.then((function(){I.deleteChat(t)}))},P=function(){e.open("similarity/index/create","_blank")},H=function(){e.open("connectors","_blank")},j=function(t){e.open("/sparql?query=".concat(encodeURIComponent(t),"&execute=true"),"_blank")},Y=function(){var t=R.getChatId(),e=I.getChats();t&&e.getChat(t)&&I.selectChat(I.getChats().getChat(t))};w.push(h.$watch(h.getActiveRepositoryObject,(function(t){t&&(h.activeRepositoryList=S.getLocalReadableGraphdbRepositories().map((function(t){return new c.SelectMenuOptionsModel({value:t.id,label:t.id,data:{repository:t}})})),function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return h.loadingAgents=t,_.getAgents().then((function(t){return I.updateAgents(t)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){h.loadingAgents=!1}))}().then((function(){return h.initialized=!0,F(),L()})).then(Y),M())}))),w.push(I.onSelectedChatChanged((function(t){t&&t.id?_.getConversation(t.id).then((function(e){I.updateSelectedChat(e),R.saveChat(t)})).catch((function(e){e.status===f.status.NOT_FOUND&&(U(t),I.emit(o.TTYGEventName.LOAD_CHAT_FAILURE,t))})):t&&I.updateSelectedChat(t)}))),w.push(I.onChatsListChanged((function(t){h.chats=t,k(t)}))),w.push(I.onCanUpdateAgentUpdated((function(t){h.canModifyAgent=t}))),w.push(I.subscribe(I.onAgentsListChanged((function(t){h.agents=t})))),w.push(I.subscribe(o.TTYGEventName.CREATE_CHAT,(function(t){var e=I.getChats().getNonPersistedChat();e||(e=a.ChatModel.getEmptyChat(),I.addChat(e)),I.selectChat(e),_.createConversation(t).then((function(e){I.emit(o.TTYGEventName.CREATE_CHAT_SUCCESSFUL);var n=I.getSelectedChat();if(n&&!n.id){n.id=e.chatId,t.chatId=e.chatId;var i=I.getChats().getNonPersistedChat();I.replaceChat(n,i),R.saveChat(n),G(n,t,e)}})).catch((function(t){I.emit(o.TTYGEventName.CREATE_CHAT_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.RENAME_CHAT,(function(t){_.renameConversation(t).then((function(){I.emit(o.TTYGEventName.RENAME_CHAT_SUCCESSFUL),I.emit(o.TTYGEventName.LOAD_CHATS)})).catch((function(){I.emit(o.TTYGEventName.RENAME_CHAT_FAILURE),A.error(v.instant("ttyg.chat.messages.rename_failure"))}))}))),w.push(I.subscribe(o.TTYGEventName.DELETE_CHAT,(function(t){I.emit(o.TTYGEventName.DELETING_CHAT,{chatId:t.id,inProgress:!0}),_.deleteConversation(t.id).then((function(){I.emit(o.TTYGEventName.DELETE_CHAT_SUCCESSFUL,t);var e=I.getChats();e.deleteChat(t),I.updateChats(e)})).catch((function(){I.emit(o.TTYGEventName.DELETE_CHAT_FAILURE),A.error(v.instant("ttyg.chat.messages.delete_failure"))})).finally((function(){return I.emit(o.TTYGEventName.DELETING_CHAT,{chatId:t.id,inProgress:!1})}))}))),w.push(I.subscribe(o.TTYGEventName.CHAT_EXPORT,$)),w.push(I.subscribe(o.TTYGEventName.ASK_QUESTION,(function(t){_.askQuestion(t).then((function(e){var n=I.getSelectedChat();n&&n.id===t.chatId&&G(n,t,e)})).catch((function(t){I.emit(o.TTYGEventName.ASK_QUESTION_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.CONTINUE_CHAT_RUN,(function(t){_.continueChatRun(t).then((function(e){var n=t.chatId,o=I.getSelectedChat();if(o&&o.id===n){var i=o.chatHistory.items,r=i[i.length-1];D(o,r,e)}})).catch((function(t){I.emit(o.TTYGEventName.ASK_QUESTION_FAILURE),A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))}))}))),w.push(I.subscribe(o.TTYGEventName.LOAD_CHATS,L)),w.push(I.subscribe(o.TTYGEventName.OPEN_AGENT_SETTINGS,h.onOpenNewAgentSettings)),w.push(I.subscribe(o.TTYGEventName.EDIT_AGENT,h.onOpenAgentSettings)),w.push(I.subscribe(o.TTYGEventName.CLONE_AGENT,h.onOpenCloneAgentSettings)),w.push(I.subscribe(o.TTYGEventName.DELETE_AGENT,(function(t){I.emit(o.TTYGEventName.DELETING_AGENT,{agentId:t.id,inProgress:!0}),_.deleteAgent(t.id).then((function(){return N()})).then((function(){I.emit(o.TTYGEventName.AGENT_DELETED,t),h.selectedAgent&&h.selectedAgent.id===t.id&&(h.selectedAgent=void 0)})).catch((function(t){A.error(getError(t,0,i.TTYG_ERROR_MSG_LENGTH))})).finally((function(){I.emit(o.TTYGEventName.DELETING_AGENT,{agentId:t.id,inProgress:!1})}))}))),w.push(I.subscribe(o.TTYGEventName.AGENT_SELECTED,(function(t){h.selectedAgent=t}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmationModal({title:v.instant("common.confirm"),message:Object(g.decodeHTML)(v.instant("ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_similarity.body",{repositoryId:e.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){S.setRepository(e),P()}))}else P()}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_CONNECTORS_VIEW,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmationModal({title:v.instant("common.confirm"),message:Object(g.decodeHTML)(v.instant("ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_connectors.body",{repositoryId:e.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},(function(){S.setRepository(e),H()}))}else H()}))),w.push(I.subscribe(o.TTYGEventName.GO_TO_SPARQL_EDITOR,(function(t){if(t.repositoryId!==S.getActiveRepository()){var e=S.getRepository(t.repositoryId);e&&C.openConfirmation(v.instant("common.confirm"),Object(g.decodeHTML)(v.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:t.repositoryId})),(function(){S.setRepository(e),j(t.query)}))}else j(t.query)}))),w.push(n.$on("$translateChangeSuccess",(function(){x.filter_all=v.instant("ttyg.agent.btn.filter.all"),F()}))),w.push(n.$on("securityInit",M)),h.$on("$destroy",(function(){w.forEach((function(t){return t()})),I.resetContext()}))}angular.module("graphdb.framework.ttyg.controllers.ttyg-view",["toastr","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.ttyg-service","graphdb.framework.ttyg.services.ttygcontext","graphdb.framework.ttyg.services.ttygstorage","graphdb.framework.ttyg.directives.chat-list","graphdb.framework.ttyg.directives.chat-panel","graphdb.framework.ttyg.directives.agent-list","graphdb.framework.ttyg.directives.agent-select-menu","graphdb.framework.ttyg.directives.no-agents-view","graphdb.framework.ttyg.directives.show-tooltip-on-overflow","graphdb.framework.ttyg.controllers.agent-settings-modal"]).controller("TTYGViewCtrl",y),y.$inject=["$jwtAuth","$window","$rootScope","$scope","$http","$timeout","$translate","$uibModal","$repositories","toastr","ModalService","LocalStorageAdapter","TTYGService","TTYGContextService","TTYGStorageService"]},483:function(t,e,n){"use strict";n.r(e);n(371),n(659);angular.module("graphdb.framework.ttyg",["ngRoute","graphdb.framework.ttyg.controllers.ttyg-view"])},638:function(t,e){(function(e){t.exports=e}).call(this,{})},639:function(t,e,n){var o,i=i||function(t){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var e=t.document,n=function(){return t.URL||t.webkitURL||t},o=e.createElementNS("http://www.w3.org/1999/xhtml","a"),i=t.webkitRequestFileSystem,r=t.requestFileSystem||i||t.mozRequestFileSystem,a=function(e){(t.setImmediate||t.setTimeout)((function(){throw e}),0)},s=0,c=function(e){var o=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};t.chrome?o():setTimeout(o,500)},u=function(t,e,n){for(var o=(e=[].concat(e)).length;o--;){var i=t["on"+e[o]];if("function"==typeof i)try{i.call(t,n||t)}catch(t){a(t)}}},l=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t},d=function(e,a){e=l(e);var d,g,f,p=this,m=e.type,h=!1,y=function(){u(p,"writestart progress write writeend".split(" "))},T=function(){(!h&&d||(d=n().createObjectURL(e)),g)?g.location.href=d:null==t.open(d,"_blank")&&"undefined"!=typeof safari&&(t.location.href=d);p.readyState=p.DONE,y(),c(d)},v=function(t){return function(){if(p.readyState!==p.DONE)return t.apply(this,arguments)}},E={create:!0,exclusive:!1};if(p.readyState=p.INIT,a||(a="download"),o)return d=n().createObjectURL(e),o.href=d,o.download=a,void setTimeout((function(){var t,e;t=o,e=new MouseEvent("click"),t.dispatchEvent(e),y(),c(d),p.readyState=p.DONE}));t.chrome&&m&&"application/octet-stream"!==m&&(f=e.slice||e.webkitSlice,e=f.call(e,0,e.size,"application/octet-stream"),h=!0),i&&"download"!==a&&(a+=".download"),("application/octet-stream"===m||i)&&(g=t),r?(s+=e.size,r(t.TEMPORARY,s,v((function(t){t.root.getDirectory("saved",E,v((function(t){var n=function(){t.getFile(a,E,v((function(t){t.createWriter(v((function(n){n.onwriteend=function(e){g.location.href=t.toURL(),p.readyState=p.DONE,u(p,"writeend",e),c(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&T()},"writestart progress write abort".split(" ").forEach((function(t){n["on"+t]=p["on"+t]})),n.write(e),p.abort=function(){n.abort(),p.readyState=p.DONE},p.readyState=p.WRITING})),T)})),T)};t.getFile(a,{create:!1},v((function(t){t.remove(),n()})),v((function(t){t.code===t.NOT_FOUND_ERR?n():T()})))})),T)})),T)):T()},g=d.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e){return navigator.msSaveOrOpenBlob(l(t),e)}:(g.abort=function(){this.readyState=this.DONE,u(this,"abort")},g.readyState=g.INIT=0,g.WRITING=1,g.DONE=2,g.error=g.onwritestart=g.onprogress=g.onwrite=g.onabort=g.onerror=g.onwriteend=null,function(t,e){return new d(t,e)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
|
|
2
2
|
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */t.exports?t.exports.saveAs=i:null!==n(645)&&null!=n(638)&&(void 0===(o=function(){return i}.apply(e,[]))||(t.exports=o))},645:function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},659:function(t,e){
|
|
3
3
|
/*! ngTagsInput v3.2.0 License: MIT */!function(){"use strict";var t=8,e=9,n=13,o=27,i=32,r=38,a=40,s=37,c=39,u=46,l=188,d=9007199254740991,g=["text","email","url"],f=angular.module("ngTagsInput",[]);f.directive("tagsInput",["$timeout","$document","$window","$q","tagsInputConfig","tiUtil",function(e,o,r,a,f,p){function m(t,e,n,o){var i,r,s,c,u={};return i=function(e){return p.safeToString(e[t.displayProperty])},r=function(e,n){e[t.displayProperty]=n},s=function(e){var o=i(e),r=o&&o.length>=t.minLength&&o.length<=t.maxLength&&t.allowedTagsPattern.test(o)&&!p.findInObjectArray(u.items,e,t.keyProperty||t.displayProperty);return a.when(r&&n({$tag:e})).then(p.promisifyValue)},c=function(t){return a.when(o({$tag:t})).then(p.promisifyValue)},u.items=[],u.addText=function(t){var e={};return r(e,t),u.add(e)},u.add=function(n){var o=i(n);return t.replaceSpacesWithDashes&&(o=p.replaceSpacesWithDashes(o)),r(n,o),s(n).then((function(){u.items.push(n),e.trigger("tag-added",{$tag:n})})).catch((function(){o&&e.trigger("invalid-tag",{$tag:n})}))},u.remove=function(t){var n=u.items[t];return c(n).then((function(){return u.items.splice(t,1),u.clearSelection(),e.trigger("tag-removed",{$tag:n}),n}))},u.select=function(t){0>t?t=u.items.length-1:t>=u.items.length&&(t=0),u.index=t,u.selected=u.items[t]},u.selectPrior=function(){u.select(--u.index)},u.selectNext=function(){u.select(++u.index)},u.removeSelected=function(){return u.remove(u.index)},u.clearSelection=function(){u.selected=null,u.index=-1},u.getItems=function(){return t.useStrings?u.items.map(i):u.items},u.clearSelection(),u}function h(t){return-1!==g.indexOf(t)}return{restrict:"E",require:"ngModel",scope:{tags:"=ngModel",text:"=?",templateScope:"=?",tagClass:"&",onTagAdding:"&",onTagAdded:"&",onInvalidTag:"&",onTagRemoving:"&",onTagRemoved:"&",onTagClicked:"&"},replace:!1,transclude:!0,templateUrl:"ngTagsInput/tags-input.html",controller:["$scope","$attrs","$element",function(t,e,n){t.events=p.simplePubSub(),f.load("tagsInput",t,e,{template:[String,"ngTagsInput/tag-item.html"],type:[String,"text",h],placeholder:[String,"Add a tag"],tabindex:[Number,null],removeTagSymbol:[String,String.fromCharCode(215)],replaceSpacesWithDashes:[Boolean,!0],minLength:[Number,3],maxLength:[Number,d],addOnEnter:[Boolean,!0],addOnSpace:[Boolean,!1],addOnComma:[Boolean,!0],addOnBlur:[Boolean,!0],addOnPaste:[Boolean,!1],pasteSplitPattern:[RegExp,/,/],allowedTagsPattern:[RegExp,/.+/],enableEditingLastTag:[Boolean,!1],minTags:[Number,0],maxTags:[Number,d],displayProperty:[String,"text"],keyProperty:[String,""],allowLeftoverText:[Boolean,!1],addFromAutocompleteOnly:[Boolean,!1],spellcheck:[Boolean,!0],useStrings:[Boolean,!1]}),t.tagList=new m(t.options,t.events,p.handleUndefinedResult(t.onTagAdding,!0),p.handleUndefinedResult(t.onTagRemoving,!0)),this.registerAutocomplete=function(){return n.find("input"),{addTag:function(e){return t.tagList.add(e)},getTags:function(){return t.tagList.items},getCurrentTagText:function(){return t.newTag.text()},getOptions:function(){return t.options},getTemplateScope:function(){return t.templateScope},on:function(e,n){return t.events.on(e,n,!0),this}}},this.registerTagItem=function(){return{getOptions:function(){return t.options},removeTag:function(e){t.disabled||t.tagList.remove(e)}}}}],link:function(a,d,g,f){var m,h,y=[n,l,i,t,u,s,c],T=a.tagList,v=a.events,E=a.options,S=d.find("input"),A=["minTags","maxTags","allowLeftoverText"];m=function(){f.$setValidity("maxTags",T.items.length<=E.maxTags),f.$setValidity("minTags",T.items.length>=E.minTags),f.$setValidity("leftoverText",!(!a.hasFocus&&!E.allowLeftoverText)||!a.newTag.text())},h=function(){e((function(){S[0].focus()}))},f.$isEmpty=function(t){return!t||!t.length},a.newTag={text:function(t){return angular.isDefined(t)?(a.text=t,void v.trigger("input-change",t)):a.text||""},invalid:null},a.track=function(t){return t[E.keyProperty||E.displayProperty]},a.getTagClass=function(t,e){var n=t===T.selected;return[a.tagClass({$tag:t,$index:e,$selected:n}),{selected:n}]},a.$watch("tags",(function(t){if(t){if(T.items=p.makeObjectArray(t,E.displayProperty),E.useStrings)return;a.tags=T.items}else T.items=[]})),a.$watch("tags.length",(function(){m(),f.$validate()})),g.$observe("disabled",(function(t){a.disabled=t})),a.eventHandlers={input:{keydown:function(t){v.trigger("input-keydown",t)},focus:function(){a.hasFocus||(a.hasFocus=!0,v.trigger("input-focus"))},blur:function(){e((function(){var t=o.prop("activeElement"),e=t===S[0],n=d[0].contains(t);(e||!n)&&(a.hasFocus=!1,v.trigger("input-blur"))}))},paste:function(t){t.getTextData=function(){var e=t.clipboardData||t.originalEvent&&t.originalEvent.clipboardData;return e?e.getData("text/plain"):r.clipboardData.getData("Text")},v.trigger("input-paste",t)}},host:{click:function(){a.disabled||h()}},tag:{click:function(t){v.trigger("tag-clicked",{$tag:t})}}},v.on("tag-added",a.onTagAdded).on("invalid-tag",a.onInvalidTag).on("tag-removed",a.onTagRemoved).on("tag-clicked",a.onTagClicked).on("tag-added",(function(){a.newTag.text("")})).on("tag-added tag-removed",(function(){a.tags=T.getItems(),f.$setDirty(),h()})).on("invalid-tag",(function(){a.newTag.invalid=!0})).on("option-change",(function(t){-1!==A.indexOf(t.name)&&m()})).on("input-change",(function(){T.clearSelection(),a.newTag.invalid=null})).on("input-focus",(function(){d.triggerHandler("focus"),f.$setValidity("leftoverText",!0)})).on("input-blur",(function(){E.addOnBlur&&!E.addFromAutocompleteOnly&&T.addText(a.newTag.text()),d.triggerHandler("blur"),m()})).on("input-keydown",(function(e){var o,r,d,g,f=e.keyCode,m={};p.isModifierOn(e)||-1===y.indexOf(f)||(m[n]=E.addOnEnter,m[l]=E.addOnComma,m[i]=E.addOnSpace,o=!E.addFromAutocompleteOnly&&m[f],r=(f===t||f===u)&&T.selected,g=f===t&&0===a.newTag.text().length&&E.enableEditingLastTag,d=(f===t||f===s||f===c)&&0===a.newTag.text().length&&!E.enableEditingLastTag,o?T.addText(a.newTag.text()):g?(T.selectPrior(),T.removeSelected().then((function(t){t&&a.newTag.text(t[E.displayProperty])}))):r?T.removeSelected():d&&(f===s||f===t?T.selectPrior():f===c&&T.selectNext()),(o||d||r||g)&&e.preventDefault())})).on("input-paste",(function(t){if(E.addOnPaste){var e=t.getTextData().split(E.pasteSplitPattern);e.length>1&&(e.forEach((function(t){T.addText(t)})),t.preventDefault())}}))}}}]),f.directive("tiTagItem",["tiUtil",function(t){return{restrict:"E",require:"^tagsInput",template:'<ng-include src="$$template"></ng-include>',scope:{$scope:"=scope",data:"="},link:function(e,n,o,i){var r=i.registerTagItem(),a=r.getOptions();e.$$template=a.template,e.$$removeTagSymbol=a.removeTagSymbol,e.$getDisplayText=function(){return t.safeToString(e.data[a.displayProperty])},e.$removeTag=function(){r.removeTag(e.$index)},e.$watch("$parent.$index",(function(t){e.$index=t}))}}}]),f.directive("autoComplete",["$document","$timeout","$sce","$q","tagsInputConfig","tiUtil",function(t,i,s,c,u,l){function d(t,e,n){var o,i,r,a={};return r=function(){return e.tagsInput.keyProperty||e.tagsInput.displayProperty},o=function(t,n){return t.filter((function(t){return!l.findInObjectArray(n,t,r(),(function(t,n){return e.tagsInput.replaceSpacesWithDashes&&(t=l.replaceSpacesWithDashes(t),n=l.replaceSpacesWithDashes(n)),l.defaultComparer(t,n)}))}))},a.reset=function(){i=null,a.items=[],a.visible=!1,a.index=-1,a.selected=null,a.query=null},a.show=function(){e.selectFirstMatch?a.select(0):a.selected=null,a.visible=!0},a.load=l.debounce((function(n,s){a.query=n;var u=c.when(t({$query:n}));i=u,u.then((function(t){u===i&&(t=l.makeObjectArray(t.data||t,r()),t=o(t,s),a.items=t.slice(0,e.maxResultsToShow),a.items.length>0?a.show():a.reset())}))}),e.debounceDelay),a.selectNext=function(){a.select(++a.index)},a.selectPrior=function(){a.select(--a.index)},a.select=function(t){0>t?t=a.items.length-1:t>=a.items.length&&(t=0),a.index=t,a.selected=a.items[t],n.trigger("suggestion-selected",t)},a.reset(),a}return{restrict:"E",require:"^tagsInput",scope:{source:"&",matchClass:"&"},templateUrl:"ngTagsInput/auto-complete.html",controller:["$scope","$element","$attrs",function(t,e,n){t.events=l.simplePubSub(),u.load("autoComplete",t,n,{template:[String,"ngTagsInput/auto-complete-match.html"],debounceDelay:[Number,100],minLength:[Number,3],highlightMatchedText:[Boolean,!0],maxResultsToShow:[Number,10],loadOnDownArrow:[Boolean,!1],loadOnEmpty:[Boolean,!1],loadOnFocus:[Boolean,!1],selectFirstMatch:[Boolean,!0],displayProperty:[String,""]}),t.suggestionList=new d(t.source,t.options,t.events),this.registerAutocompleteMatch=function(){return{getOptions:function(){return t.options},getQuery:function(){return t.suggestionList.query}}}}],link:function(t,i,s,c){var u,d=[n,e,o,r,a],g=t.suggestionList,f=c.registerAutocomplete(),p=t.options,m=t.events;p.tagsInput=f.getOptions(),u=function(t){return t&&t.length>=p.minLength||!t&&p.loadOnEmpty},t.templateScope=f.getTemplateScope(),t.addSuggestionByIndex=function(e){g.select(e),t.addSuggestion()},t.addSuggestion=function(){var t=!1;return g.selected&&(f.addTag(angular.copy(g.selected)),g.reset(),t=!0),t},t.track=function(t){return t[p.tagsInput.keyProperty||p.tagsInput.displayProperty]},t.getSuggestionClass=function(e,n){var o=e===g.selected;return[t.matchClass({$match:e,$index:n,$selected:o}),{selected:o}]},f.on("tag-added tag-removed invalid-tag input-blur",(function(){g.reset()})).on("input-change",(function(t){u(t)?g.load(t,f.getTags()):g.reset()})).on("input-focus",(function(){var t=f.getCurrentTagText();p.loadOnFocus&&u(t)&&g.load(t,f.getTags())})).on("input-keydown",(function(i){var s=i.keyCode,c=!1;if(!l.isModifierOn(i)&&-1!==d.indexOf(s))return g.visible?s===a?(g.selectNext(),c=!0):s===r?(g.selectPrior(),c=!0):s===o?(g.reset(),c=!0):(s===n||s===e)&&(c=t.addSuggestion()):s===a&&t.options.loadOnDownArrow&&(g.load(f.getCurrentTagText(),f.getTags()),c=!0),c?(i.preventDefault(),i.stopImmediatePropagation(),!1):void 0})),m.on("suggestion-selected",(function(t){!function(t,e){var n=t.find("li").eq(e),o=n.parent(),i=n.prop("offsetTop"),r=n.prop("offsetHeight"),a=o.prop("clientHeight"),s=o.prop("scrollTop");s>i?o.prop("scrollTop",i):i+r>a+s&&o.prop("scrollTop",i+r-a)}(i,t)}))}}}]),f.directive("tiAutocompleteMatch",["$sce","tiUtil",function(t,e){return{restrict:"E",require:"^autoComplete",template:'<ng-include src="$$template"></ng-include>',scope:{$scope:"=scope",data:"="},link:function(n,o,i,r){var a=r.registerAutocompleteMatch(),s=a.getOptions();n.$$template=s.template,n.$index=n.$parent.$index,n.$highlight=function(n){return s.highlightMatchedText&&(n=e.safeHighlight(n,a.getQuery())),t.trustAsHtml(n)},n.$getDisplayText=function(){return e.safeToString(n.data[s.displayProperty||s.tagsInput.displayProperty])}}}}]),f.directive("tiTranscludeAppend",(function(){return function(t,e,n,o,i){i((function(t){e.append(t)}))}})),f.directive("tiAutosize",["tagsInputConfig",function(t){return{restrict:"A",require:"ngModel",link:function(e,n,o,i){var r,a,s=t.getTextAutosizeThreshold();(r=angular.element('<span class="input"></span>')).css("display","none").css("visibility","hidden").css("width","auto").css("white-space","pre"),n.parent().append(r),a=function(t){var e,i=t;return angular.isString(i)&&0===i.length&&(i=o.placeholder),i&&(r.text(i),r.css("display",""),e=r.prop("offsetWidth"),r.css("display","none")),n.css("width",e?e+s+"px":""),t},i.$parsers.unshift(a),i.$formatters.unshift(a),o.$observe("placeholder",(function(t){i.$modelValue||a(t)}))}}}]),f.directive("tiBindAttrs",(function(){return function(t,e,n){t.$watch(n.tiBindAttrs,(function(t){angular.forEach(t,(function(t,e){n.$set(e,t)}))}),!0)}})),f.provider("tagsInputConfig",(function(){var t={},e={},n=3;this.setDefaults=function(e,n){return t[e]=n,this},this.setActiveInterpolation=function(t,n){return e[t]=n,this},this.setTextAutosizeThreshold=function(t){return n=t,this},this.$get=["$interpolate",function(o){var i={};return i[String]=function(t){return t},i[Number]=function(t){return parseInt(t,10)},i[Boolean]=function(t){return"true"===t.toLowerCase()},i[RegExp]=function(t){return new RegExp(t)},{load:function(n,r,a,s){var c=function(){return!0};r.options={},angular.forEach(s,(function(s,u){var l,d,g,f,p,m;l=s[0],d=s[1],g=s[2]||c,f=i[l],p=function(){var e=t[n]&&t[n][u];return angular.isDefined(e)?e:d},m=function(t){r.options[u]=t&&g(t)?f(t):p()},e[n]&&e[n][u]?a.$observe(u,(function(t){m(t),r.events.trigger("option-change",{name:u,newValue:t})})):m(a[u]&&o(a[u])(r.$parent))}))},getTextAutosizeThreshold:function(){return n}}}]})),f.factory("tiUtil",["$timeout","$q",function(t,e){var n={debounce:function(e,n){var o;return function(){var i=arguments;t.cancel(o),o=t((function(){e.apply(null,i)}),n)}},makeObjectArray:function(t,e){if(!angular.isArray(t)||0===t.length||angular.isObject(t[0]))return t;var n=[];return t.forEach((function(t){var o={};o[e]=t,n.push(o)})),n},findInObjectArray:function(t,e,o,i){var r=null;return i=i||n.defaultComparer,t.some((function(t){return i(t[o],e[o])?(r=t,!0):void 0})),r},defaultComparer:function(t,e){return n.safeToString(t).toLowerCase()===n.safeToString(e).toLowerCase()},safeHighlight:function(t,e){if(t=n.encodeHTML(t),!(e=n.encodeHTML(e)))return t;var o=new RegExp("&[^;]+;|"+function(t){return t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}(e),"gi");return t.replace(o,(function(t){return t.toLowerCase()===e.toLowerCase()?"<em>"+t+"</em>":t}))},safeToString:function(t){return angular.isUndefined(t)||null==t?"":t.toString().trim()},encodeHTML:function(t){return n.safeToString(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},handleUndefinedResult:function(t,e){return function(){var n=t.apply(null,arguments);return angular.isUndefined(n)?e:n}},replaceSpacesWithDashes:function(t){return n.safeToString(t).replace(/\s/g,"-")},isModifierOn:function(t){return t.shiftKey||t.ctrlKey||t.altKey||t.metaKey},promisifyValue:function(t){return t=!!angular.isUndefined(t)||t,e[t?"when":"reject"]()},simplePubSub:function(){var t={};return{on:function(e,n,o){return e.split(" ").forEach((function(e){t[e]||(t[e]=[]),(o?[].unshift:[].push).call(t[e],n)})),this},trigger:function(e,o){return(t[e]||[]).every((function(t){return n.handleUndefinedResult(t,!0)(o)})),this}}}};return n}]),f.run(["$templateCache",function(t){t.put("ngTagsInput/tags-input.html",'<div class="host" tabindex="-1" ng-click="eventHandlers.host.click()" ti-transclude-append><div class="tags" ng-class="{focused: hasFocus}"><ul class="tag-list"><li class="tag-item" ng-repeat="tag in tagList.items track by track(tag)" ng-class="getTagClass(tag, $index)" ng-click="eventHandlers.tag.click(tag)"><ti-tag-item scope="templateScope" data="::tag"></ti-tag-item></li></ul><input class="input" autocomplete="off" ng-model="newTag.text" ng-model-options="{getterSetter: true}" ng-keydown="eventHandlers.input.keydown($event)" ng-focus="eventHandlers.input.focus($event)" ng-blur="eventHandlers.input.blur($event)" ng-paste="eventHandlers.input.paste($event)" ng-trim="false" ng-class="{\'invalid-tag\': newTag.invalid}" ng-disabled="disabled" ti-bind-attrs="{type: options.type, placeholder: options.placeholder, tabindex: options.tabindex, spellcheck: options.spellcheck}" ti-autosize></div></div>'),t.put("ngTagsInput/tag-item.html",'<span ng-bind="$getDisplayText()"></span> <a class="remove-button" ng-click="$removeTag()" ng-bind="::$$removeTagSymbol"></a>'),t.put("ngTagsInput/auto-complete.html",'<div class="autocomplete" ng-if="suggestionList.visible"><ul class="suggestion-list"><li class="suggestion-item" ng-repeat="item in suggestionList.items track by track(item)" ng-class="getSuggestionClass(item, $index)" ng-click="addSuggestionByIndex($index)" ng-mouseenter="suggestionList.select($index)"><ti-autocomplete-match scope="templateScope" data="::item"></ti-autocomplete-match></li></ul></div>'),t.put("ngTagsInput/auto-complete-match.html",'<span ng-bind-html="$highlight($getDisplayText())"></span>')}])}()}}]);
|