!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require,exports):"function"==typeof define&&define.amd&&define(["require","exports","tslib","./textUtilities"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});e=e("tslib").__importStar(e("./textUtilities"));t.text=e;var n=0,r=(new Date).valueOf();function c(e,t){if(null!=e){e=e.index;return"number"==typeof e?e:t}}function m(e,t){return e=e.index,t=t.index,e<t?-1:t<e?1:0}function o(e,t){void 0===t&&(t=c);var n={};if("object"!=typeof e||null===e)return n;var r,i=0,o=[];for(r in e){var u=e[r],a=t(u,i++);"number"==typeof a&&o.push({key:r,index:a,item:u})}for(var f=0,s=o.sort(m);f<s.length;f++){var l=s[f];n[l.key]=l.item}return n}function i(e,t){return e.className.split(" ").filter(function(e){return 0<e.length&&e!==t}).join(" ")}function u(e){return"gcx-forms-"+(e&&e.replace(/[\W]/g,"")||"element")}t.makeId=function(){return 2147483648<=n&&(r=(new Date).valueOf(),n=0),"5DDC9A38-AAAB-44C1-AD87-415160F43D75:"+r+":"+n++},t.sort=o,t.sortItems=function(e){var t=e.current,n=e.value,r=o(e.items,function(e,t){if(null!=e&&!1!==e.visible){e=e.index;return"number"==typeof e?e:t}});if(void 0===(t=null==t||void 0===r[t]?void 0:t)&&null!=n)for(var i in r){if(r[i].value===n)break;t=void 0}return void 0!==t?(e.current=t,e.label=r[t].label,e.value=r[t].value):(e.current=void 0,e.label=void 0,e.value=void 0),r},t.makeSafeClassName=u;var a=0;function f(e,t){void 0!==e.classList?e.classList.add(t):e.className=i(e,t)+" "+t}function s(e,t){void 0!==e.classList?e.classList.remove(t):e.className=i(e,t)}function l(e,t){return"object"==typeof e&&null!==e&&(!Array.isArray(e)&&e.refValueType===t)}function d(e){return l(e,"geometry")}t.makeUniqueId=function(e){return u(e)+"-"+ ++a},t.addClass=f,t.removeClass=s,t.setClass=function(e,t,n){(n?f:s)(e,t)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isDataRef=function(e){return l(e,"data")},t.isDateTimeRef=function(e){return l(e,"date")||l(e,"time")||l(e,"datetime")},t.isFilesRef=function(e){return l(e,"files")},t.isScanRef=function(e){return l(e,"scan")},t.isGeometryRef=d,t.isItemsRef=function(e){return l(e,"items")},t.isNumberRef=function(e){return l(e,"number")},t.sanitizeGeometryRef=function(e){if(d(e)){var t=e.geometry;if(Array.isArray(t)&&0<t.length)switch(e.format){case"point":case"polygon":case"polyline":case"polygon-freehand":case"polyline-freehand":case"extent":case"line":return e}}},t.createGeometryRef=function(e){return{refValueType:"geometry",format:e,geometry:[]}},t.addStyleToDocument=function(e){var t=document.createElement("style");return t.appendChild(document.createTextNode(e)),(e=document.head).insertBefore(t,e.firstChild),t},t.throttle=function(i,o){var u,a;return void 0===o&&(o=100),function(){function e(){a=void 0,u=Date.now(),i.apply(t,n)}var t=this,n=arguments,r=Date.now();u&&r<u+o?(clearTimeout(a),a=setTimeout(e,o)):e()}},t.isNumeric=function(e){return!isNaN(parseFloat(e))&&isFinite(e)}});