Built motion from commit 67e5df37.|2.0.66
[motion2.git] / server / components / parsers / qs.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xa432=['offset','sort','map','indexOf','priority','cast','col','unsigned','substr','omit','length','isString','isArray','unset','hasOwnProperty','sequelize','fields','split','filters','isEmpty','forOwn','parse','limit'];(function(_0xf3e2cf,_0x42951f){var _0x400a6d=function(_0x277b8d){while(--_0x277b8d){_0xf3e2cf['push'](_0xf3e2cf['shift']());}};_0x400a6d(++_0x42951f);}(_0xa432,0x17f));var _0x2a43=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xa432[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var sequelize=require(_0x2a43('0x0'));var LIMIT_VALUE=0xfa;exports[_0x2a43('0x1')]=function(_0x1d5d85){var _0x46a4e7=null;if(_0x1d5d85){_0x46a4e7=_0x1d5d85[_0x2a43('0x2')](',');}return _0x46a4e7;};exports[_0x2a43('0x3')]=function(_0x30e4dd){var _0x31b1f1={};if(!_[_0x2a43('0x4')](_0x30e4dd)){_0x31b1f1={};_[_0x2a43('0x5')](_0x30e4dd,function(_0x5b5dce,_0x65db7){try{_0x31b1f1[_0x65db7]=JSON[_0x2a43('0x6')](_0x5b5dce);}catch(_0x99a71e){_0x31b1f1[_0x65db7]=_0x5b5dce[_0x2a43('0x2')](',');}});}return _0x31b1f1;};exports[_0x2a43('0x7')]=function(_0x2761fa){_0x2761fa=parseInt(_0x2761fa,0xa);if(!_0x2761fa||_0x2761fa<0x0){_0x2761fa=LIMIT_VALUE;}return _0x2761fa;};exports[_0x2a43('0x8')]=function(_0x316692){_0x316692=parseInt(_0x316692,0xa);if(!_0x316692||_0x316692<0x0){_0x316692=0x0;}return _0x316692;};exports[_0x2a43('0x9')]=function(_0x47b9bd){var _0x11e1cc,_0x4259cc=null;if(_0x47b9bd){_0x11e1cc=_0x47b9bd[_0x2a43('0x2')](',');_0x4259cc=_[_0x2a43('0xa')](_0x11e1cc,function(_0x12e57c){if(_0x12e57c[_0x2a43('0xb')]('-')===0x0){return[_0x12e57c===_0x2a43('0xc')?sequelize[_0x2a43('0xd')](sequelize[_0x2a43('0xe')](_0x2a43('0xc')),_0x2a43('0xf')):_0x12e57c[_0x2a43('0x10')](0x1),'DESC'];}else{return[_0x12e57c==='priority'?sequelize[_0x2a43('0xd')](sequelize[_0x2a43('0xe')](_0x2a43('0xc')),_0x2a43('0xf')):_0x12e57c,'ASC'];}});}return _0x4259cc;};exports[_0x2a43('0x11')]=function(_0x584d7a,_0x3e8612){if(_[_0x2a43('0x4')](_0x584d7a)){return _0x584d7a;}if(_['isArray'](_0x584d7a)){for(var _0x2bce6b=0x0;_0x2bce6b<_0x584d7a[_0x2a43('0x12')];_0x2bce6b+=0x1){_0x584d7a[_0x2bce6b]=this[_0x2a43('0x11')](_0x584d7a[_0x2bce6b],_0x3e8612);}return _0x584d7a;}if(!_['isObject'](_0x584d7a)){return _0x584d7a;}if(_[_0x2a43('0x13')](_0x3e8612)){_0x3e8612=[_0x3e8612];}if(!_[_0x2a43('0x14')](_0x3e8612)){return _0x584d7a;}for(var _0x2faf4f=0x0;_0x2faf4f<_0x3e8612[_0x2a43('0x12')];_0x2faf4f+=0x1){_[_0x2a43('0x15')](_0x584d7a,_0x3e8612[_0x2faf4f]);}for(var _0x256bc4 in _0x584d7a){if(_0x584d7a[_0x2a43('0x16')](_0x256bc4)){_0x584d7a[_0x256bc4]=this[_0x2a43('0x11')](_0x584d7a[_0x256bc4],_0x3e8612);}}return _0x584d7a;};