(window.webpackJsonp=window.webpackJsonp||[]).push([[4],[function(module,exports,__webpack_require__){"use strict";var angular=__webpack_require__(6);angular.lowercase=angular.$$lowercase,module.exports=angular.module("app.common",[])},,,,,function(module,exports,__webpack_require__){"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},__importDefault=function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0});var app_1=__importDefault(__webpack_require__(0)),lodash_1=__importDefault(__webpack_require__(17));__webpack_require__(340),app_1.default.service("httpService",["commonService","$rootScope","Upload","$q",function(commonService,$rootScope,Upload,$q){var errMsg="failure.unknown",promises={},results={};this.getUrlPrefix=function(){return"/action"},this.expandUrl=function(url){for(var args=[],i=1;i0?level:1,tagIdList:tagId>0?[tagId]:null,docTypeId:helpers_1.default.validUuid(documentTypeUuid)?documentTypeUuid:null,resourceStatusEnumList:Array.isArray(resourceStatusEnum)?resourceStatusEnum:[resourceStatusEnum],loadFields:loadFields};return httpService.post("/documents",params).then(function(data){return data.details})},this.list=function(filter){return httpService.post("/documentsAllVersions",filter).then(function(data){return data.details})},this.listPublic=function(filter){return httpService.post("/documents/public",filter).then(function(data){return data.details})};var searchInfoContent=void 0;this.searchInfo=function(){return searchInfoContent?$rootScope.resolveObject(searchInfoContent):this.listPublic({documentTypeName:"Klaustukai",pageSize:99,resourceStatusEnum:"ACTIVE",loadFields:!0}).then(function(response){return searchInfoContent=response.list})},this.loadDocuments=function(filter){return httpService.post("/documents",filter).then(function(data){return data.details})},this.loadDocumentsByTag=function(tagId,page,pageSize,loadFields){return underscore_1.default.isUndefined(loadFields)&&(loadFields=!1),httpService.get("/documents/tag/{tagId}/{page}/{pageSize}/{loadFields}",tagId,page,pageSize,loadFields).then(function(operation){return operation.details})},this.loadDocumentsByTagList=function(tagList,page,pageSize,loadFields,orderBy,isInt){underscore_1.default.isUndefined(loadFields)&&(loadFields=!1);var tagListCsv="";return underscore_1.default.isEmpty(tagList)||underscore_1.default.isUndefined(tagList)||(tagListCsv=tagList.join(",")),underscore_1.default.isUndefined(orderBy)&&(orderBy=""),underscore_1.default.isUndefined(isInt)&&(isInt=!1),httpService.get("/documents/tag/{page}/{pageSize}/{loadFields}?tags={tagListCsv}&orderBy={orderBy}&isInt={isInt}",page,pageSize,loadFields,tagListCsv,orderBy,isInt).then(function(operation){return operation.details})},this.loadDocumentsByParent=function(versionId){return httpService.get("/documents/parent/{versionId}",versionId).then(function(data){return data.details})},this.listDocumentFieldsByDocTypeName=function(fieldListByDocTypeNameDetails){return httpService.post("/documents/doctypename",fieldListByDocTypeNameDetails).then(function(data){return data.details})},this.listDocumentFieldsByDocTypeNames=function(fieldListByDocTypeNameDetails){return httpService.post("/documents/doctypenames",fieldListByDocTypeNameDetails).then(function(data){return data.details})},this.loadDocumentsByStructureFieldLink=function(structureFieldId,display,localeEnum,parentDocumentId,searchAllLevels){return underscore_1.default.isUndefined(parentDocumentId)&&(parentDocumentId=0),underscore_1.default.isUndefined(searchAllLevels)&&(searchAllLevels=!1),httpService.get("/documents/structurefield/link/{structureFieldId}/{value}/{localeEnum}/{parentDocumentId}/{searchAllLevels}",structureFieldId,display,localeEnum,parentDocumentId,searchAllLevels).then(function(data){return data.details})},this.loadDocumentsByStructureFieldLinkType=function(structureFieldId,type,display,localeEnum){return httpService.get("/documents/structurefield/linkType/{structureFieldId}/{value}/{localeEnum}",structureFieldId,display,localeEnum).then(function(operation){return operation.list})},this.saveDocument=function(document){return httpService.post("/document",document).then(function(data){return data.details})},this.deleteDocument=function(documentId){return httpService.delete("/document/{documentId}",documentId)},this.getDocumentByVersionId=function(versionId){return httpService.get("/document/version/{versionId}",versionId).then(function(data){return data.details})},this.getDocumentByUuid=function(documentUuid){return httpService.get("/document/{documentUuid}",documentUuid).then(function(data){return data.details})},this.getDocumentByResourceId=function(resourceId){return console.error("documentService.getDocumentByResourceId - deprecated"),httpService.get("/document/resource/{resourceId}",resourceId)},this.getNewDocument=function(documentTypeUuid,levelId,parentDocumentUuid,orderNumber){return levelId=levelId||0,httpService.get("/document/new?documentTypeUuid={documentTypeUuid}&levelId={levelId}&parentDocumentUuid={parentDocumentUuid}",documentTypeUuid,levelId,parentDocumentUuid||"").then(function(data){console.log("this.getNewDocument -> data",data);var documentDetails=data.details;return orderNumber&&(documentDetails.orderNumber=orderNumber),documentDetails})},this.getNewDocumentByDocTypeName=function(documentTypeName,levelId,parentVersionId){return underscore_1.default.isEmpty(levelId)&&(levelId=0),underscore_1.default.isEmpty(parentVersionId)&&(parentVersionId=0),httpService.get("/document/new/name/{levelId}/{parentDocumentId}?documentTypeName={documentTypeName}",levelId,parentVersionId,documentTypeName).then(function(data){return data.details})},this.getSingletonDocument=function(documentTypeName){var params={documentTypeName:documentTypeName};return httpService.get("/document/singleton/",params).then(function(data){return data.details})},this.getDocumentStatuses=function(){var deferred=$q.defer();return deferred.resolve(["ACTIVE","PUBLIC"]),deferred.promise},this.loadVersionList=function(versionId){return httpService.get("/document/versions/{versionId}",versionId).then(function(data){return data.details})},this.listDocumentByDocTypeNameAndParentDocId=function(fieldListByDocTypeNameAndParentDocIdDetails){return httpService.post("/documents/doctypenameandparentdocId",fieldListByDocTypeNameAndParentDocIdDetails).then(function(data){return data.details})},this.getFieldDownloadLink=function(fieldId){return $rootScope.getAppPath()+httpService.expandUrl("/document/download/{fieldId}",fieldId)},this.getHomeDocument=function(){return httpService.get("/document/home").then(function(data){return data.details})}}])},function(module,exports,__webpack_require__){"use strict";Promise.resolve().then(function(){var __WEBPACK_AMD_REQUIRE_ARRAY__=[__webpack_require__(0),__webpack_require__(1),__webpack_require__(5)];(function(app,_){app.service("menuService",["httpService","$q","$timeout",function(httpService,$q,$timeout){var menuService={},defaultMenu={};menuService.getDefaultMenu=function(){return defaultMenu},menuService.setDefaultMenu=function(menu){defaultMenu=menu},menuService.menuBySiteAndName=function(siteName,name){return httpService.get("/menu/bysite/{siteName}/{name}",siteName,name)},menuService.list=function(filter){return httpService.post("/menus",filter).then(function(data){return data.details})},menuService.get=function(uuid,viewType){return void 0==viewType&&(viewType=0),httpService.get("/menu/{menuUuid}?viewType={viewType}",uuid,viewType).then(function(data){return data.details})},menuService.save=function(menu){return httpService.put("/menu",menu).then(function(data){return data.details})},menuService.delete=function(uuid){return httpService.delete("/menu/{uuid}",uuid)};var editMenuNameFn=[];menuService.getEditMenuName=function(defaultName){return editMenuNameFn.length>0?editMenuNameFn[0].fn():defaultName},menuService.setEditMenuNameFn=function($scope,fn){editMenuNameFn.push({fn:fn,scope:$scope}),$scope.$on("$destroy",function(event){var currentScope=event.currentScope;for(var i in editMenuNameFn){var fn=editMenuNameFn[i];if(fn.scope==currentScope){editMenuNameFn.splice(i,1);break}}})};var menus={},promises={};menuService.getMenu=function(siteName,name){var key=siteName+name;if(_.isEmpty(menus[key]))return _.isEmpty(promises[key])&&(promises[key]=this.menuBySiteAndName(siteName,name),promises[key].then(function(data){return menus[key]=angular.copy(data),delete promises[key],function loadStateToMenuMapping(name,menu){menu.moduleDetails&&menu.moduleDetails.state&&(stateToMenuMapping[name]=stateToMenuMapping[name]||{},stateToMenuMapping[name][menu.moduleDetails.state]=menu);for(var index in menu.children)loadStateToMenuMapping(name,menu.children[index])}(name,data.details),data})),promises[key];var deferred=$q.defer();return deferred.resolve(menus[key]),deferred.promise},menuService.newMenu=function(menu){return{number:1,index:0,nameTranslationList:[],descriptionList:[],roleList:[],moduleDetails:{id:""}}};var stateToMenuMapping={};return menuService.getStateToMenuMapping=function(name){return stateToMenuMapping[name]},menuService.getFlatMenu=function(siteName,menu){return menuService.getMenu(siteName,menu).then(function(response){var menu=response.details,flatMenu=[menu];return function flatChildren(menu){angular.forEach(menu.children,function(child){flatMenu.push(child),flatChildren(child)})}(menu),flatMenu})},menuService}])}).apply(null,__WEBPACK_AMD_REQUIRE_ARRAY__)}).catch(__webpack_require__.oe)},,function(module,exports,__webpack_require__){"use strict";var __importDefault=function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0});var app_1=__importDefault(__webpack_require__(0));__webpack_require__(5),__webpack_require__(103),app_1.default.service("userService",["$rootScope","httpService","$cookies","cacheableService",function($rootScope,httpService,$cookies,cacheableService){this.getUser=function(refresh){return refresh&&cacheableService.clearCache(httpService.get,"/user"),cacheableService.getCached(httpService.get,"/user").then(function(data){return data.details})},this.logout=function(){httpService.post("/user/logout").finally(function(){$cookies.remove("SESSION"),window.location="/"})},this.saveSelf=function(details){return"SITE"===details.userType?details.type=".SiteUserDetails":details.type=".ClientUserDetails",httpService.put("/user/self",details).then(function(data){return data.details})},this.save=function(userDetails,assignGroups){return assignGroups=void 0!=assignGroups&&assignGroups,httpService.put("/user?assignGroups={assignGroups}",userDetails,assignGroups).then(function(data){return data.details})},this.saveClientUser=function(clientUserDetails){return httpService.put("/user/client",clientUserDetails).then(function(data){return data.details})},this.list=function(userSearch){return httpService.post("/users",userSearch).then(function(data){return data.details})},this.listClients=function(userSearch){return httpService.post("/users/client",userSearch).then(function(data){return data.details})},this.listByUsername=function(userSearch){return httpService.post("/users/username",userSearch).then(function(data){return data.details})},this.getClient=function(uuid){return httpService.post("/client/{uuid}",uuid).then(function(data){return data.details})},this.listSimple=function(userSearch){return httpService.post("/simpleUsers",userSearch).then(function(data){return data.details})},this.changeUserStatus=function(uuid,status){return httpService.post("/user/{userUuid}/status/{status}",null,uuid,status)},this.delete=function(uuid){return httpService.delete("/user/{userUuid}",uuid)},this.get=function(uuid){if(void 0==uuid||function(s){return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(s)}(uuid))return httpService.get("/user/{userUuid}",uuid).then(function(data){return data.details})},this.getClientUser=function(uuid){return httpService.get("/user/client/{userUuid}",uuid).then(function(data){return data.details})},this.getSimple=function(uuid){return httpService.get("/simpleUser/{userUuid}",uuid).then(function(data){return data.details})},this.edit=function(userDetails){return httpService.post("/user",userDetails).then(function(data){return data.details})},this.confirmRegistration=function(password,token){return httpService.post("/user/registration/confirm/{token}",password,token).then(function(data){return data.details})},this.confirmEmail=function(token){return httpService.get("/user/email/{token}",token)},this.changePassword=function(password){return httpService.post("/user/password",password)},this.resetPasswordInit=function(email){return httpService.post("/user/password/reset/init?email={email}",null,email)},this.resetPassword=function(token,password){return httpService.post("/user/password/reset/{token}",password,token)},this.clientUser={import:function(fileContent){return httpService.post("/client/import",fileContent).then(function(data){return data.details})}},this.siteUser={list:function(filter){return httpService.post("/users/site",filter).then(function(data){return data.details})}},this.representative={get:function(uuid){return httpService.get("/representative/{representativeUuid}",uuid).then(function(data){return data.details})},save:function(details){return httpService.put("/representative",details).then(function(data){return data.details})},saveSelf:function(details){return httpService.put("/representative/self",details).then(function(data){return data.details})},list:function(filter){return httpService.post("/representatives",filter).then(function(data){return data.details})}},this.idp={list:function(filter){return httpService.post("/identity/users",filter).then(function(data){return data})},save:function(details){return httpService.put("/identity/users",[details]).then(function(data){return data.details[0]})}}}])},,,,function(module,exports,__webpack_require__){"use strict";var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(1)],void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(_){return{randomIfEmpty:function(val){return _.isEmpty(val)?parseInt(1e11*Math.random()).toString("20"):val},validUuid:function(uuid){var uuidExp=new RegExp("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}");return"string"==typeof uuid&&uuidExp.test(uuid.toLowerCase())},formatSize:function(bytes){for(var unitIndex=0;bytes>1e3;)bytes/=1e3,unitIndex++;return bytes+" "+["B","KB","MB","GB","TB"][unitIndex]},initCheckboxes:function(scope,listName){scope.select_all={checked:!1},scope.$watch("select_all.checked",function(newVal){for(var i in scope[listName])scope[listName][i].checked=newVal})},getSelected:function(list){var selected=[];for(var i in list)list[i].checked&&selected.push(list[i]);return selected},validDecimal:function(precision,scale){var validIntRegexp=new RegExp("^[0-9]{1,"+precision+"}$"),validFloatRegexp=scale>0?new RegExp("^[0-9]{1,"+precision+"}\\.[0-9]{1,"+scale+"}$"):validIntRegexp;return function(value){return void 0===value||""===value||(validIntRegexp.test(value)||validFloatRegexp.test(value))}},largestRemainderRound:function(numbers,desiredTotal){for(var result=numbers.map(function(number,index){return{floor:Math.floor(number),remainder:function(number){return(number-Math.floor(number)).toFixed(4)}(number),index:index}}).sort(function(a,b){return b.remainder-a.remainder}),delta=desiredTotal-result.reduce(function(sum,current){return sum+current.floor},0),i=0;i0&&(encoded+="=".repeat(4-encoded.length%4)),resolve(encoded)},reader.onerror=function(error){return reject(error)},reader.readAsDataURL(file)})},toByteArray:function(file){return new Promise(function(resolve,reject){var reader=new FileReader;reader.onload=function(event){var contents=event.target.result,bytes=new Uint8Array(contents);resolve(bytes)},reader.onerror=function(error){return reject(error)},reader.readAsArrayBuffer(file)})},newUuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=16*Math.random()|0;return("x"==c?r:3&r|8).toString(16)})},serializeObjectIntoUrlParams:function(object){return _.chain(object).pick(function(value,key){return value}).map(function(value,key){return key+"="+value})._wrapped.join("&")},sortByLocale:function(list,mapper,ignoreCase,fullText){ignoreCase=void 0===ignoreCase||ignoreCase;var sortFunction=function(a,b){var collator=new Intl.Collator("lt",{});if(ignoreCase?(a=(a||"").toString().toLowerCase(),b=(b||"").toString().toLowerCase()):(a=(a||"").toString(),b=(b||"").toString()),fullText)return collator.compare(a,b);for(var length=Math.min(a.length,b.length),i=0;ib.length?1:-1};return list.slice().sort(function(a,b){return mapper?sortFunction(mapper(a),mapper(b)):sortFunction(a,b)})},htmlEntitiesToString:function(str){return(str||"").replace(/&#\d+;/gm,function(s){return String.fromCharCode(s.match(/\d+/gm)[0])})}}}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(module,exports,__webpack_require__){"use strict";(function($){var __importDefault=function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0});var app_1=__importDefault(__webpack_require__(0)),underscore_1=__importDefault(__webpack_require__(1));__webpack_require__(12),app_1.default.factory("documentUtils",["$rootScope","documentService","$sce","$filter","settings",function($rootScope,documentService,$sce,$filter,settings){var fieldIndex=0;return{markFields:markFields,markDocument:function(document){return markFields(document.fieldList),document},resetDocumentIds:function(document){null!=document&&(document.versionId=null,document.version=null,resetFieldIds(document.fieldList));return document},repeatField:repeatField,unmarkDocument:function(doc){var document=angular.copy(doc);return function unmarkFields(fieldList){if(void 0!==fieldList&&null!==fieldList)for(var i=0;i]*?)align=["](.*?)["]([^>]*?>)/gm,'$1style="text-align: $2;"$3')})}var repeatable=field.structureField.repeatable;!0===repeatable&&(field.repeatField=function(){return repeatField(this,fieldList)}),field.deleteField=function(){deleteField(this,fieldList)},field.index=fieldIndex++,markFields(field.fieldList)}}function resetValueIds(valueList){if(null!=valueList)for(var i=0;i\n\n
\n
\n
\n\n